specd-implement
Implement code for a specd change — work through tasks and run hooks.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Implement code for a specd change — work through tasks and run hooks.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Write the next artifact for a specd change (or all artifacts in fast-forward mode).
Explore what the user wants to do and create a new specd change when ready.
Verify a specd change's implementation against spec scenarios.
Archive a specd change — reviews deltas and merges them into project specs.
Entry point for specd — detects change state and suggests the next skill to invoke.
Skill: Spec Metadata Generator
| name | specd-implement |
| description | Implement code for a specd change — work through tasks and run hooks. |
| allowed-tools | Bash(node *), Bash(pnpm *), Read, Write, Edit, Grep, Glob, Agent, TaskCreate, TaskUpdate, TaskList, TaskGet |
| argument-hint | <change-name> |
Read .specd/skills/shared.md before doing anything.
Implements the code described by the change's design and tasks artifacts. Works through tasks one by one and marks them done.
specd change status <name> --format json
Store lifecycle.changePath, specIds, and review from the response.
If review.required is true, this change has artifacts that require review
before implementation can continue. Summarize review.reason and
review.affectedArtifacts, then tell the user:
Artifacts need review before implementation can continue. Run
/specd-design <name>.
Stop — do not continue.
If not in ready or implementing or spec-approved, this is the wrong skill. Suggest based on state:
drafting / designing → /specd-design <name>ready → Review artifacts, then approve or continue designing with /specd-design <name>verifying → /specd-verify <name>done / signed-off → /specd-verify <name> (handles done→archivable transition)pending-signoff → "Signoff pending. Run: specd change approve signoff <name> --reason ..."archivable → /specd-archive <name>pending-spec-approval → "Approval pending. Run: specd change approve spec <name> --reason ..."Stop — do not continue.
If in ready or spec-approved, run pre-hooks and transition:
specd change run-hooks <name> implementing --phase pre
specd change hook-instruction <name> implementing --phase pre --format text
Follow guidance — it tells you which change artifacts to read.
specd change transition <name> implementing --skip-hooks all
If already in implementing (resuming), run pre-hooks but skip the transition:
specd change run-hooks <name> implementing --phase pre
specd change hook-instruction <name> implementing --phase pre --format text
specd config show --format json
From the JSON output, build a map of each workspace's codeRoot and ownership.
For each specId in the change, determine which workspace it belongs to.
If any spec targets a readOnly workspace:
Blocked. The following specs belong to readOnly workspaces and cannot be modified:
Spec Workspace codeRoot ... ... ... Remove them from the change or update the workspace ownership in
specd.yaml.
Stop — do not continue.
Continuous guard — applies throughout the entire implementation session:
ReadOnly workspaces are off-limits. You must NOT write or edit any file under
the codeRoot of a readOnly workspace. Before every file write or edit, verify
the target path does not fall within a readOnly codeRoot.
If a task requires modifying code in a readOnly workspace, stop immediately —
do not implement it, do not work around it, do not assume it's okay. Surface it
to the user. The design may need revision, or the workspace ownership must change
in specd.yaml before you can proceed.
specd schema show --format json
Find artifacts with hasTaskCompletionCheck: true — those have trackable checkboxes.
specd change context <name> implementing --follow-deps --depth 1 --rules --constraints --format json [--fingerprint <stored-value>]
Pass --fingerprint <stored-value> if you have a contextFingerprint from a previous change context call in this conversation (see shared.md — "Fingerprint mechanism"). Extract and store the contextFingerprint from the response. If you passed a fingerprint and the response is status: "unchanged", use the context already in memory. If status: "changed", update your stored context and fingerprint with the new response.
MUST follow — project context entries are binding directives. If lazy mode returns
summary specs, evaluate each one and load any that are relevant to the code you're
about to write (see shared.md — "Processing change context output").
Before reading artifacts, use the code graph to understand the blast radius of the files and symbols you'll be modifying:
specd graph hotspots --min-risk MEDIUM --format json
If the tasks (from the design artifact) mention specific symbols or files, check their downstream dependents:
specd graph impact --symbol "<name>" --direction downstream --format json
specd graph impact --file "<workspace:path>" --direction downstream --format json
Surface HIGH or CRITICAL risk findings to the user before starting implementation. This helps prioritize which tasks need extra care and testing.
Use the schema's artifacts array (from step 2) to know which artifacts exist and
their output paths. Read ALL change artifacts from <changePath>/:
<changePath>/<changePath>/deltas/ (existing specs modified by this change)<changePath>/specs/ (new specs created by this change)Do not hardcode filenames — the schema defines what exists.
Before implementing anything, plan the execution order:
Present the wave plan to the user before starting:
Execution plan:
Wave 1 (parallel): 1.1, 1.2, 2.1 Wave 2 (parallel): 2.2, 3.1 — depends on 1.1, 2.1 Wave 3 (sequential): 4.1 — depends on all above
Use this mode when the Agent tool is available AND at least one wave has 2+ tasks.
For each wave, launch one agent per task using the Agent tool. Each agent runs in
a worktree (isolation: "worktree") so file edits don't conflict.
Each agent prompt must include:
design.md that covers this task<changePath>/<taskFile>"Example agent launch:
Agent tool call:
description: "Implement task 1.1"
prompt: |
You are implementing one task from a specd change.
## Task
- [ ] 1.1 Add optional `artifactId` field to input interface
`packages/core/src/application/use-cases/validate-artifacts.ts`:
`ValidateArtifactsInput` — add `artifactId?: string` property
Approach: add as optional field; when present, `execute()` filters
the schema artifacts array to only the matching ID before validation
## Design context
[relevant excerpt from design.md]
## Spec requirements
[relevant requirements and constraints]
## Conventions
[project context directives — ESM, strict TS, no any, etc.]
Implement this task. When done, mark the checkbox as `- [x]` in
`<changePath>/tasks.md`.
isolation: "worktree"
Launch all tasks in a wave as parallel Agent calls in a single message — this is how the Agent tool parallelizes. Wait for all agents in the wave to complete, then verify their work before starting the next wave.
Between waves:
[x]Use this mode when the Agent tool is NOT available, or when all tasks form a single
dependency chain (no parallelism possible).
For each task in order:
- [ ] → - [x]) in the task-bearing artifactTrigger: the moment the last - [ ] across ALL task-bearing artifacts is marked
- [x], run the post-implementing hooks. Do NOT wait, do NOT ask the user anything
first — the hooks fire on completion of the implementation work, before any conversation.
specd change run-hooks <name> implementing --phase post
specd change hook-instruction <name> implementing --phase post --format text
Follow guidance. If hooks fail (tests, lint), fix and re-run until they pass.
Implementation complete. Run
/specd-verify <name>to verify against scenarios.
Stop.
Create tasks at the start for session visibility. Update them as you go.
Load state & hooks — mark done after step 1Load context & artifacts — mark done after step 5tasks.md: Implement: <task summary> — mark done as you complete eachRun exit hooks — mark done after step 7Create the per-task items (step 3) after reading tasks.md in step 5.
Any change transition command may fail with:
Cannot transition from '<current>' to '<target>'
If this happens, the change is in a different state than expected. Extract <current>
from the error message and redirect using this table:
| Current state | Suggest |
|---|---|
drafting / designing | /specd-design <name> |
ready | Review artifacts, then approve or continue designing with /specd-design <name> |
implementing / spec-approved | You're already in the right skill — re-read status and retry |
verifying | /specd-verify <name> |
done / signed-off | /specd-verify <name> (handles done→archivable transition) |
pending-signoff | "Signoff pending. Run: specd change approve signoff <name> --reason ..." |
archivable | /specd-archive <name> |
pending-spec-approval | "Approval pending. Run: specd change approve spec <name> --reason ..." |
Stop — do not continue after redirecting.
If during implementation you discover that the specs, design, or tasks need changes (wrong approach, missing requirement, incorrect assumption), do not try to work around it. Stop, explain the issue to the user, and if they agree:
specd change transition <name> designing --skip-hooks all
Artifacts need revision. Run
/specd-design <name>to update them.
Stop — do not continue implementing.
change status shows review.required = true, stop
implementation and redirect to /specd-design <name>