# Openspec Apply Change

Implement tasks from an OpenSpec change.

- Repository: https://github.com/KunAgent/Kun (6362 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add KunAgent/Kun --skill openspec-apply-change -g -a claude-code -y`
Codex: `npx skills add KunAgent/Kun --skill openspec-apply-change -g -a codex -y`
Cursor: `npx skills add KunAgent/Kun --skill openspec-apply-change -g -a cursor -y`
Gemini CLI: `npx skills add KunAgent/Kun --skill openspec-apply-change -g -a gemini-cli -y`

## Description

Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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:
   - `contextFiles`: artifact ID -> array of concrete 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 every file path listed under `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**

The rest: https://github.com/KunAgent/Kun/blob/HEAD/.claude/skills/openspec-apply-change/SKILL.md
