# openspec-apply-change

Adopt this skill: https://proskills.md/skills/other/getsentry-skillet-claude-skills-openspec-apply-change

Page: https://proskills.md/skills/other/getsentry-skillet-claude-skills-openspec-apply-change
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: .claude/skills/openspec-apply-change/SKILL.md
size: 4724
sha: 716375ac7d8193dbd70f43941eb5ff6eac247c9c
upstream: https://github.com/getsentry/skillet/blob/main/.claude/skills/openspec-apply-change/SKILL.md

````text
---
name: openspec-apply-change
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
license: MIT
compatibility: Requires openspec CLI.
metadata:
  author: openspec
  version: "1.0"
  generatedBy: "1.3.0"
---

Implement tasks from an OpenSpec change.

**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

**Steps**

1. **Select the change**

   If a name is provided, use it. Otherwise:
   - Infer from conversation context if the user mentioned a change
   - Auto-select if only one active change exists
   - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select

   Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).

2. **Check status to understand the schema**
   ```bash
   openspec status --change "<name>" --json
   ```
   Parse the JSON to understand:
   - `schemaName`: The workflow being used (e.g., "spec-driven")
   - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)

3. **Get apply instructions**

   ```bash
   openspec instructions apply --change "<name>" --json
   ```

   This returns:
   - Context file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
   - Progress (total, complete, remaining)
   - Task list with status
   - Dynamic instruction based on current state

   **Handle states:**
   - If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
   - If `state: "all_done"`: congratulate, suggest archive
   - Otherwise: proceed to implementation

4. **Read context files**

   Read the files listed in `contextFiles` from the apply instructions output.
   The files depend on the schema being used:
   - **spec-driven**: proposal, specs, design, tasks
   - Other schemas: follow the contextFiles from CLI output

5. **Show current progress**

   Display:
   - Schema being used
   - Progress: "N/M tasks complete"
   - Remaining tasks overview
   - Dynamic instruction from CLI

6. **Implement tasks (loop until done or blocked)**

   For each pending task:
   - Show which task is being worked on
   - Make the code changes required
   - Keep changes minimal and focused
   - Mark task complete in the tasks file: `- [ ]` → `- [x]`
   - Continue to next task

   **Pause if:**
   - Task is unclear → ask for clarification
   - Implementation reveals a design issue → suggest updating artifacts
   - Error or blocker encountered → report and wait for guidance
   - User interrupts

7. **On completion or pause, show status**

   Display:
   - Tasks completed this session
   - Overall progress: "N/M tasks complete"
   - If all done: suggest archive
   - If paused: explain why and wait for guidance

**Output During Implementation**

```
## Implementing: <change-name> (schema: <schema-name>)

Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete

Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```

**Output On Completion**

```
## Implementation Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓

### Completed This Session
- [x] Task 1
- [x] Task 2
...

All tasks complete! Ready to archive this change.
```

**Output On Pause (Issue Encountered)**

```
## Implementation Paused

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete

### Issue Encountered
<description of the issue>

**Options:**
1. <option 1>
2. <option 2>
3. Other approach

What would you like to do?
```

**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names

**Fluid Workflow Integration**

This skill supports the "actions on a change" model:

- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
````

## File: README.md
upstream: https://github.com/getsentry/skillet/blob/main/README.md

````text
<p align="center">
  <img src="docs/src/assets/skillet-logo.png" alt="Skillet" width="220">
</p>

# Skillet

Build agent skills from a reviewable spec, with optional evals when repeatable measurement is worth the investment.

A Skillet skill has two core artifacts:

- `spec.md` defines the skill's intent and required behaviors.
- `SKILL.md` gives the agent its instructions.

When a skill benefits from evaluation, optional `evals/cases/*.yaml` files test selected scenarios in fresh workspaces. Skillet scaffolds the spec, validates every artifact that exists, and runs cases only when you choose to. It never calls a model API or handles API keys; evals invoke your existing agent CLI.

## Get Started

Skillet requires Node.js 20 or newer.

```bash
npx -y @sentry/skillet@latest init
```

With pnpm, use `pnpx @sentry/skillet@latest init` instead. The explicit
`@latest` keeps agent-driven authoring on the current CLI and instructions.

`init` installs the [`skillet-authoring` skill](https://github.com/getsentry/skillet/tree/main/skills/skillet-authoring) in user scope so your agent knows how to use the CLI. It uses [dotagents](https://github.com/getsentry/dotagents) and asks before writing under `~/.agents`.

If you prefer a global binary, install it explicitly:

```bash
npm install -g @sentry/skillet
skillet init
```

Installed binaries check npm at most once per hour and suggest the current `npx` command when an update is available. If your agent reads skills from somewhere else, copy the [`skills/skillet-authoring`](https://github.com/getsentry/skillet/tree/main/skills/skillet-authoring) directory directly into that location.

To install the authoring skill with dotagents directly:

```bash
npx -y @sentry/dotagents@latest --user add getsentry/skillet skillet-authoring
```

`add` records and installs the skill immediately. The latest `skillet status` checks the standard `~/.agents/skills/skillet-authoring` installation against the authoring contract bundled with the CLI. When it is stale and the exact dotagents source is declared, `status.next` tells the agent to reinstall it through the scoped `add` command and rerun status. To continue in the same agent session, the agent reads the reinstalled SKILL.md first; otherwise it starts a new session. Skillet does not silently change user-scoped configuration.

Custom installation locations cannot be discovered universally. Reinstall those with the same method that originally installed them after upgrading.

Or ask your agent to install the [`skillet-authoring` skill](https://github.com/getsentry/skillet/tree/main/skills/skillet-authoring) for you.

## Create a skill

Ask your agent:

> Create a skill that enforces our commit conventions.

The authoring skill handles the workflow: scaffold the spec, clarify the behavior, render the agent instructions, and validate the skill. It does not create or run evals unless you explicitly ask.

To start manually instead:

```bash
npx -y @sentry/skillet@latest new commit-conventions
cd commit-conventions
npx -y @sentry/skillet@latest status
```

`skillet status` reads the files on disk and tells you the next core step. When writing an artifact yourself, use `skillet instructions spec` or `skillet instructions skill` for its current format and rules. Use `skillet instructions evals` only after choosing to add cases.

For an existing skill, run `skillet status <path>`. Uppercase `SPEC.md` and structurally invalid lowercase `spec.md` are treated as migration input; preserve or rename the legacy content, then derive a valid lowercase `spec.md` before rendering SKILL.md. Inventory the old skill's triggers, workflow, exact lists and protocols, thresholds, stop rules, constraints, and runtime references first, then reconcile that inventory against the new spec and rendered skill instead of assuming a shorter rewrite is equivalent.

## Validate

```bash
npx -y @sentry/skillet@latest validate
```

`validate` checks the spec grammar and `SKILL.md` frontmatter. If optional eval cases exist, it also checks their schemas, behavior references, and fixtures. Behaviors without cases remain valid.

## Evaluate when useful

Ask your agent to add evals when a skill has high-value behavior that benefits from repeatable harness runs, or start manually with `skillet instructions evals`. You can evaluate selected behaviors without building a case for every behavior.

```bash
npx -y @sentry/skillet@latest eval --dry
npx -y @sentry/skillet@latest eval --baseline
```

- `eval --dry` finds cases that a do-nothing agent would pass.
- `eval --baseline` runs each case with and without the skill and reports the difference as lift.

Eval runs invoke real agent CLI sessions. They use that CLI's configured account and model.

Example output:

```text
Behaviors:
  conventional-subject: 100% (3/3) | baseline 33% | lift +67%
  branch-safety:        100% (3/3) | baseline 0%  | lift +100%
```

Lift answers a concrete question: did this skill improve the agent's behavior? Zero lift is useful too—it means the configured agent already passed without the skill.

## Write an optional eval case

A behavior in `spec.md`:

```markdown
### Behavior: Conventional subject

The agent SHALL write commit subjects as `<type>(<scope>): <description>`.

#### Scenario: Committing a staged bug fix

- **WHEN** the workspace has a staged bug fix and the user asks to commit
- **THEN** the commit subject starts with `fix` and stays under 70 characters
```

If this behavior is worth measuring, one case could cover it:

```yaml
behavior: conventional-subject
prompt: |
  I fixed the null check in app.js—please commit my staged change.
setup: |
  git init -q -b main
  git add -A
checks:
  - shell: git log -1 --format=%s | grep -Eq '^(feat|fix|chore)'
  - judge: The commit message accurately describes the null-check fix.
```

Checks inspect the resulting workspace, not just the agent's response. Use `file_exists` and `shell` for deterministic checks; use `judge` when the requirement needs semantic evaluation. See [`examples/`](examples/) for a small skill plus full Garfield and Effect conversions with preserved upstream snapshots.

## Commands

| Command | Purpose |
|---|---|
| `skillet init` | Install the authoring skill with dotagents |
| `skillet new <name>` | Create a skill scaffold |
| `skillet status [path]` | Show artifact state and the next step |
| `skillet instructions <artifact>` | Print the format and rules for `spec`, `skill`, or `evals` |
| `skillet validate [path]` | Validate the skill and any optional eval artifacts |
| `skillet eval [path]` | Run optional eval cases through an agent CLI |
| `skillet show [path]` | Print the parsed spec and optional case mapping |

Every command supports `--json`. Agent-driven workflows use
`npx -y @sentry/skillet@latest <command>` (or the `pnpx` equivalent); the table
uses `skillet` as shorthand. Run `skillet <command> --help` for command-specific options.

## Harnesses and safety

Skillet uses Codex by default and has built-in support for Claude Code. Select one with `--harness codex` or `--harness claude`, optionally with a model suffix such as `--harness claude:sonnet`. You can configure another CLI in `.skillet.yaml`.

Skillet leaves the model unset unless you choose one, so the agent CLI's configured model applies. Built-in trials and judges default to low effort, and up to four trials or skill/baseline variants within a case run in parallel. Override these with `--effort`, `--concurrency`, or `.skillet.yaml`. Baseline remains opt-in.

By default, eval agents run directly on your machine with full access. Use this only for skills and evals you trust. For untrusted skills or CI, build the included Docker image and run with `--sandbox docker`.

See [`LIFECYCLE.md`](LIFECYCLE.md) for the artifact flow, eval execution model, harness configuration, and sandbox details.
````
