一键导入
spec-kitty-plan
Create an implementation plan
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create an implementation plan
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Validate an approved mission before merge
Cross-artifact consistency and quality analysis
Interview and compile a project charter
Open the mission dashboard
Execute a work package implementation
Merge an accepted mission
| name | spec-kitty.plan |
| description | Create an implementation plan |
| user-invocable | true |
Run this at most once per active agent session before the first Spec Kitty command workflow.
If you already ran spec-kitty upgrade --agent-check --json in this session, reuse that result and skip this block.
Do not run or announce an upgrade check again for later Spec Kitty commands in the same session.
Otherwise, before continuing, run:
spec-kitty upgrade --agent-check --json
If JSON action is none, continue.
If action is auto_upgrade, run upgrade_command before continuing. If it fails, tell the user and continue with the current Spec Kitty version.
If action is guidance, show upgrade_note briefly, then continue.
If action is prompt, ask the user with the host-native question UI when available:
Spec Kitty {latest_version} is available. You are on {installed_version}. Upgrade now?
Use these choices:
upgrade_now, run upgrade_command, then continue.always, run upgrade_command, then continue.not_now, then continue.never_ask, then continue.Record the selected choice before continuing:
spec-kitty upgrade --agent-choice <upgrade_now|always|not_now|never_ask> --agent-latest <latest_version> --json
If no host-native question UI is available, present the same four choices in plain text and wait for the user.
In non-interactive hosts, choose not_now and continue.
Version: 0.11.0+
IMPORTANT: Plan works in the repository root checkout. NO worktrees created.
# Run from project root (same directory as /spec-kitty.specify):
# You should already be here if you just ran /spec-kitty.specify
# Creates:
# - kitty-specs/<mission_slug>/plan.md → In repository root checkout
# (the NNN- prefix in the directory listing is display-only metadata)
# - Commits to target branch
# - NO worktrees created
Do NOT cd anywhere. Stay in the repository root checkout.
/spec-kitty.plan operates on an existing mission, so use --mission <handle>
when the CLI needs a mission selector.
<handle> can be the mission's mission_id (ULID), mid8 (first 8 chars of
the ULID), or mission_slug.mission_id or mid8 when the repo has multiple similarly named
missions.mission_id and returns a structured
MISSION_AMBIGUOUS_SELECTOR error on ambiguity — there is no silent fallback.The content of the user's message that invoked this skill (everything after the skill invocation token, e.g. after /spec-kitty.<command> or $spec-kitty.<command>) is the User Input referenced elsewhere in these instructions.
You MUST consider this user input before proceeding (if not empty).
/spec-kitty.plan will refuse to advance the plan phase unless two
gates pass:
Entry gate. spec.md must already be both committed (tracked +
present at HEAD) and substantive (at least one populated FR-###
row — not just template placeholders). If either check fails, the CLI
returns phase_complete=false with a blocked_reason naming "committed
AND substantive" and does not create or commit plan.md.
Exit gate. plan.md is only auto-committed when its Technical Context
section contains a real Language/Version value (and at least one peer
field) — not the [e.g., …] / [NEEDS CLARIFICATION …] placeholders. If
the plan is left as scaffold, it stays untracked on disk and the CLI
returns phase_complete=false with a substantive-plan blocked_reason.
Section presence is the only signal — adding arbitrary prose without the required structural rows does not count as substantive (no byte-length escape hatch).
To advance: populate the Technical Context with real values, then re-run
spec-kitty agent mission setup-plan --mission <mission-slug> --json. The substantive plan will be
auto-committed and phase_complete will report true.
Reference: kitty-specs/charter-e2e-827-followups-01KQAJA0/contracts/specify-plan-commit-boundary.md.
Before asking planning questions or generating artifacts, you must make the branch contract explicit.
plan.md.setup-plan --json/spec-kitty.tasksBefore planning interrogation, load charter context for this action:
spec-kitty charter context --action plan --json
mode is bootstrap, apply JSON text as first-run governance context and follow referenced docs as needed.mode is compact, continue with condensed governance context.This command runs in the repository root checkout, not in a worktree.
meta.json inspection:
spec-kitty agent mission setup-plan --mission <mission-slug> --jsoncurrent_branch, target_branch / base_branch, and planning_base_branch / merge_target_branch (plus uppercase aliases) from that payloadbranch_matches_target from that payload to detect branch mismatch; do not probe branch state manually inside the promptkitty-specs/<mission_slug>/ (the NNN- prefix is display-only metadata)Path reference rule: When you mention directories or files, provide either the absolute path or a path relative to the project root (for example, kitty-specs/<mission>/tasks/). Never refer to a folder by name alone.
This command does not update agent-specific context files.
CLAUDE.md, AGENTS.md, or similar
agent-specific files as part of /spec-kitty.plan.spec-kitty agent context update
commands. No supported context-update command exists in this release.plan.mdresearch.mddata-model.mdcontracts/quickstart.mdoccurrence_map.yaml when bulk-edit planning appliesBefore asking any clarifying question during plan elaboration, you MUST:
Run spec-kitty agent decision open to mint a decision_id:
spec-kitty agent decision open \
--mission <mission-slug> \
--flow plan \
--slot-key plan.<section>.<question-slug> \
--input-key <snake_case_key> \
--question "<question text>" \
[--options '["option1","option2","Other"]']
Capture the returned decision_id from the JSON output.
Ask the question to the user in chat.
After the user answers, run exactly one of:
spec-kitty agent decision resolve <decision_id> --mission <slug> --final-answer "<answer>"spec-kitty agent decision defer <decision_id> --mission <slug> --rationale "<reason>"spec-kitty agent decision cancel <decision_id> --mission <slug> --rationale "<reason>"When deferring, write the inline marker into plan.md:
[NEEDS CLARIFICATION: <brief description>] <!-- decision_id: <decision_id> -->
Before finishing this command, run:
spec-kitty agent decision verify --mission <slug>
Resolve all findings (DEFERRED_WITHOUT_MARKER, MARKER_WITHOUT_DECISION,
STALE_MARKER) before proceeding.
Important constraints:
--slot-key format: plan.<section>.<question-slug> (e.g.,
plan.architecture.db-choice).--input-key is the snake_case programmatic key (e.g., db_choice).decision_id on the wire is a plain ULID (26 chars). The DM- prefix
appears only in artifact filenames, not in CLI arguments.[NEEDS CLARIFICATION: …] <!-- decision_id: <id> -->
sentinels in plan.md against the decisions index and exits non-zero on drift.DecisionPointWidened.Before executing any scripts or generating artifacts you must interrogate the specification and stakeholders.
Scope proportionality (CRITICAL): FIRST, assess the feature's complexity from the spec:
Scenario-to-design handoff: For non-trivial features, anchor planning questions in the concrete user flows from the spec rather than generic architecture preferences.
Domain rule follow-through: When the spec implies approvals, lifecycle states, irreversible operations, or business-critical validations, ask 1-2 targeted questions about invariants, transitions, atomicity, and externally visible events or integrations. Skip this for trivial features.
User signals to reduce questioning: If the user says "use defaults", "just make it simple", "skip to implementation", "vanilla HTML/CSS/JS" - recognize these as signals to minimize planning questions and use standard approaches.
First response rule:
WAITING_FOR_PLANNING_INPUTIf the user has not provided plan context, keep interrogating with one question at a time.
Conversational cadence: After each reply, assess if you have SUFFICIENT context for this feature's scope. For trivial features, knowing the basic stack is enough. Only continue if critical unknowns remain.
Planning requirements (scale to complexity):
#, Question, Why it matters, and Current insight. Do not render this table to the user.If this mission is marked change_mode: bulk_edit in meta.json — or if the
spec describes renaming the same string (identifier, path, key, label, term)
across many files — load the spec-kitty-bulk-edit-classification skill and
follow it. You will produce kitty-specs/<mission>/occurrence_map.yaml
alongside the other planning artifacts. Every one of the 8 standard categories
(code_symbols, import_paths, filesystem_paths, serialized_keys, cli_commands,
user_facing_strings, tests_fixtures, logs_telemetry) must have an explicit
action. Without that artifact, the implement command will refuse to start
the first WP.
If the mission is not a bulk edit, skip this step.
Check planning discovery status:
WAITING_FOR_PLANNING_INPUT. Do not surface the table. Do not run the setup command yet.Resolve mission context deterministically (CRITICAL - prevents wrong mission selection):
kitty-specs/<mission-slug>/...)--mission — always pass an explicit handle. Running setup-plan without --mission returns PLAN_CONTEXT_UNRESOLVED even when exactly one mission is present.spec-kitty agent context resolve --action plan --mission <handle> --json, then pass the resolved slug to setup-planavailable_missions, stop and pick one explicit mission slug before continuingSetup: If step 2 did not already return a successful setup payload, run spec-kitty agent mission setup-plan --mission <mission-slug> --json from the repository root and parse JSON for:
result: "success" or error messagemission_slug: Resolved feature slugspec_file: Absolute path to resolved spec.mdplan_file: Absolute path to the created plan.mdfeature_dir: Absolute path to the feature directorycurrent_branch: branch checked out when planning startedtarget_branch / base_branch (deterministic branch contract for downstream commands)planning_base_branch / merge_target_branch: explicit aliases for planning and merge intentbranch_strategy_summary: canonical sentence describing the branch strategyBefore proceeding, explicitly state to the user:
branch_matches_target says the current branch matches that intended targetExample:
# Resolve the active mission handle, then pass it to setup-plan.
# The --mission flag accepts mission_id (ULID), mid8 (first 8 chars), or mission_slug.
# The resolver disambiguates by mission_id; ambiguous handles become structured errors.
# --action is required for context resolve; use the action matching this step.
spec-kitty agent context resolve --action plan --mission <handle> --json
spec-kitty agent mission setup-plan --mission <handle> --json
Error handling: If the command fails with "Cannot detect mission", "Multiple missions found", or MISSION_AMBIGUOUS_SELECTOR, pass an unambiguous handle — the mission_id or its 8-char prefix mid8 always disambiguates.
Load context: Read spec_file from setup-plan JSON output and .kittify/charter/charter.md if it exists. If the charter file is missing, skip Charter Check and note that it is absent. Load IMPL_PLAN template (already copied).
Execute plan workflow: Follow the structure in IMPL_PLAN template, using the validated planning answers as ground truth:
[NEEDS CLARIFICATION: …] <!-- decision_id: <id> --> only when the user deliberately postpones a decision (call decision defer before writing each such marker)STOP and report: This command ends after Phase 1 planning. Report branch, IMPL_PLAN path, and generated artifacts (including the Implementation Concern Map if present).
⚠️ CRITICAL: DO NOT proceed to task generation! The user must explicitly run /spec-kitty.tasks to translate implementation concerns from plan.md into executable work packages. Your job is COMPLETE after reporting the planning artifacts.
Extract unknowns from Technical Context above:
Generate and dispatch research agents:
For each unknown in Technical Context:
Task: "Research {unknown} for {feature context}"
For each unresolved domain rule:
Task: "Clarify invariant, state transition, or event behavior for {feature context}"
For each technology choice:
Task: "Find best practices for {tech} in {domain}"
Consolidate findings in research.md using format:
Output: research.md with all NEEDS CLARIFICATION resolved
Prerequisites: research.md complete
Extract entities from feature spec → data-model.md:
Generate API contracts from functional requirements:
/contracts/Output: data-model.md, /contracts/*, quickstart.md
This command is COMPLETE after generating planning artifacts.
After reporting:
plan.md pathresearch.md path (if generated)data-model.md path (if generated)contracts/ contents (if generated)YOU MUST STOP HERE.
Do NOT:
tasks.mdtasks/ subdirectories/spec-kitty.tasks translates implementation concerns from plan.md into executable work packages. The user will run it when they are ready.
Next suggested command: /spec-kitty.tasks (user must invoke this explicitly)