بنقرة واحدة
living-spec
Initialize .claude/spec.md from the latest plan's
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Initialize .claude/spec.md from the latest plan's
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when the user describes a multi-step feature or refactor and you need to decide whether to handle it solo, dispatch a parallel `/fan-out`, or run a `/worktree-team` planner→generator→reviewer pipeline. Outputs a routing recommendation with the reasoning behind it.
Use whenever the user asks to apply the same operation to many independent files or components — bulk migration, batch refactor across controllers, parallel exploration of unrelated subsystems. Dispatches one subagent per file with a shared prompt template, then collects the results.
Use to toggle the safe-mode flag at .claude/safe-mode. The flag is written automatically by consecutive-failure-guard once tool failures hit FORGE_SAFE_MODE_THRESHOLD (default 5), and block-destructive.sh denies every Bash/Write/Edit while it exists. /safe-mode off clears the flag, logs the exit, and prompts /postmortem; /safe-mode on enters manually; /safe-mode status reports current state.
Run the 5-stage Token Transformation Pipeline (TRAE §5.2.2) over the current session state — Collection, Ranking, Compression, Budgeting, Assembly. Emits a concrete next-action recommendation (/compact, /lean-md, or /progress-log + fresh session) instead of a generic warning.
Audit or scaffold a CLAUDE.md against the Karpathy 4-section structure (Think Before Coding · Simplicity First · Surgical Changes · Goal-Driven Execution). Companion to /lean-md — structure audit, not size trim.
Print every policy enforcement point declared in plugins/diagnostics/registry/policies.json — id, verdict, plugin, hook event, severity, bypass — grouped by verdict. Single discoverable index of what the harness blocks, anchors, nudges, or logs at runtime.
| name | living-spec |
| description | Initialize .claude/spec.md from the latest plan's |
| when_to_use | Reach for this immediately after a plan is approved (ExitPlanMode), before the generator dispatches, and re-run only if the plan itself changes. Do NOT use for session progress logging — use `/progress-log` instead. |
| paths | [".claude/spec.md"] |
| disable-model-invocation | true |
| allowed-tools | ["Read","Write","Glob","Grep","Bash"] |
| logical | .claude/spec.md initialized (or delta-appended) with contract items from the latest plan |
Write .claude/spec.md from the latest plan's ## Contract. Unlike /contract (which just re-reads static criteria to fight context decay), the living spec is continuously updated by after-subagent.sh as each phase (planner → generator → reviewer) completes. The reviewer compares code vs the spec — not just vs the original plan.
Find the active plan. Run bash plugins/workflow/skills/orchestrate/scripts/find-active-plan.sh (the single source of truth — sort -V numeric-prefix order, skips gate-complete plans). If it prints empty, stop: No plan found. Run Plan mode first.
Extract ## Contract. If missing, stop: Plan has no ## Contract section. /living-spec expects one.
If .claude/spec.md already exists — read it. Check the Plan: header line. If it matches the current plan file, report spec.md already initialized for this plan. Use after-subagent updates instead. and stop.
Write .claude/spec.md with this exact structure:
# Living Spec
Plan: .claude/plans/<file>.md
Initialized: <UTC ISO8601>
## Contract (from plan)
<verbatim copy of the ## Contract section>
## Deltas
<!-- after-subagent.sh appends blocks here, newest last:
### <UTC> — <agent>
Completed:
- ...
Pending:
- ...
-->
Report: spec.md initialized with N contract items. after-subagent.sh will append deltas as agents complete.
bash plugins/workflow/skills/orchestrate/scripts/find-active-plan.sh (abort if it prints empty)## Contract (abort if missing).claude/spec.md exists and its Plan: header matches, report spec.md already initialized for this plan. and stop.claude/spec.md with Plan / Initialized / ## Contract (from plan) / ## Deltas sections (verbatim contract copy)spec.md initialized with N contract items. after-subagent.sh will append deltas as agents complete.Writers:
/living-spec (this skill) — initializesplugins/workflow/hooks/after-subagent.sh — appends delta blocks on each SubagentStopReaders:
/verify — cross-references deltas with features.jsonsurface-progress.sh (SessionStart) — surfaces the last delta/session-resume — includes spec tail in briefing/rest-audit Reliability axis — checks spec presence + delta densityPaired artifacts:
.claude/plans/*.md — the input.claude/features.json — the parallel testable view (from /feature-list)## Contract is empty → write spec.md with ## Contract section empty + warn..claude/spec.md is a directory → fail loudly..claude/ → fail loudly; do NOT fall back to writing elsewhere.claude-progress.txt — those are different artifacts (spec = current plan state, progress = session-to-session history).Input:
plan file: .claude/plans/s7-cache-rewrite.md
## Contract excerpt:
- Cache layer behind a single `CacheService` interface
- All call sites use the interface; no direct Redis client imports outside `app/Cache/`
- Failure path: Redis unavailable → in-memory fallback for ≤60s, then bubble error
spec.md status: does not exist
Output:
# Living Spec
Plan: .claude/plans/s7-cache-rewrite.md
Initialized: 2026-04-28T15:00:00Z
## Contract (from plan)
- Cache layer behind a single `CacheService` interface
- All call sites use the interface; no direct Redis client imports outside `app/Cache/`
- Failure path: Redis unavailable → in-memory fallback for ≤60s, then bubble error
## Deltas
Reported: spec.md initialized with 3 contract items.
Input:
spec.md status: exists
Plan: header matches the current latest plan
Output:
spec.md already initialized for this plan. Use after-subagent updates instead.
(no file write)