[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M786ACDW7C6KDH2RJJA5781Q":3,"skill-same:01M786ACDW7C6KDH2RJJA5781Q":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":48},"01M786ACDW7C6KDH2RJJA5781Q","sp-clarify",null,"Use when an existing specification package has planning-critical gaps, weak analysis, or new constraints that should be absorbed before planning.","chenziyang110\u002Flaunchdeck","chenziyang110","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43693913?v=4","01M7863EBWK1D0P6A29YGEMAS4","Robin11","01M7863ECM1VB6RXDMHTW90D2T",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-clarify\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"sp-clarify\"\ndescription: \"Use when an existing specification package has planning-critical gaps, weak analysis, or new constraints that should be absorbed before planning.\"\nargument-hint: \"Describe what in the current spec package needs deeper analysis or correction\"\ncompatibility: \"Requires spec-kit project structure with .specify\u002F directory\"\nmetadata:\n  author: \"github-spec-kit\"\n  source: \"templates\u002Fcommands\u002Fclarify.md\"\nuser-invocable: true\n---\n## Invocation Syntax\n\n- In this integration, invoke workflow skills with `\u002Fsp-plan`-style syntax.\n- References such as `\u002Fsp.plan`, `\u002Fsp.tasks`, or `next_command: \u002Fsp.plan` are canonical workflow-state identifiers and handoff values.\n- Preserve those canonical state tokens exactly in artifacts and workflow state; do not rewrite them to this integration's invocation syntax.\n\n\n\n## Workflow Contract Summary\n\n- **When to use**: The current spec package exists, but planning-critical ambiguity or new evidence makes \u002Fsp-plan unreliable.\n- **Primary objective**: Strengthen the existing spec package without rerunning the entire `sp-specify` flow from scratch.\n- **Primary outputs**: Updated `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, `clarification\u002Fhandoffs\u002F\u003Clane-id>.json`, `clarification\u002Fevidence-index.json`, and `clarification\u002Fcheckpoints.ndjson` inside the active `FEATURE_DIR`.\n- **Default handoff**: \u002Fsp-plan if the package becomes planning-ready; otherwise continue clarification, run another repair pass, or route unproven feasibility through \u002Fsp-deep-research.\n- **Execution note**: This summary is routing metadata only. Follow the full contract below end-to-end rather than inferring behavior from the description alone.\n\n## Blocked Exit Contract\n\nIf blocked after safe recovery, read and follow\n`.specify\u002Ftemplates\u002Fworkflow-blocker-template.md` and its JSON schema. Never\nreturn only an error or “ask a human”; preserve state and keep agent-capable\nrepair agent-owned. Set `human_action_required: true` only for authority,\ncredentials, protected systems, human decisions\u002Freviews, or physical access.\nTailor steps, expected results, failure paths, evidence, and resume action to\nCI, visual review, or product decisions. Never claim completion.\n\n## User Input\n\n```text\n$ARGUMENTS\n```\n\nYou **MUST** consider the user input before proceeding (if not empty).\n\n## Objective\n\nStrengthen the current specification package just enough to remove planning-critical gaps and make the next planning decision better grounded.\n\n## Context\n\n- Primary inputs: the existing spec package, any newly supplied requirements or references, and the current repository context.\n- The active working set is `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, `clarification\u002Fhandoffs\u002F`, `clarification\u002Fevidence-index.json`, and `clarification\u002Fcheckpoints.ndjson` inside the current `FEATURE_DIR`.\n- This command is enhancement-oriented. It should improve the package already on disk rather than restart the workflow from zero.\n\n## Process\n\n- Identify the specific planning-critical gaps or weak analysis that need improvement.\n- Deepen the relevant parts of the specification package through targeted analysis or bounded research.\n- Update the artifact set in place and reassess planning readiness.\n\n## Output Contract\n\n- Write the improved spec package back to disk.\n- Persist clarification lane evidence before artifact updates: every delegated clarification lane writes `clarification\u002Fhandoffs\u002F\u003Clane-id>.json`, the leader updates `clarification\u002Fevidence-index.json`, and checkpoint records go to `clarification\u002Fcheckpoints.ndjson`.\n- Consume every accepted clarification handoff before final artifact updates: each accepted handoff must be integrated into `spec.md`, `alignment.md`, `context.md`, `references.md`, or explicitly recorded as deferred or blocked with a reason.\n- Report what changed, what risks remain, and whether the package is ready for `\u002Fsp-plan`.\n- Keep unresolved uncertainty explicit instead of implying false readiness.\n\n## Guardrails\n\n- Prefer targeted enhancement over a full restatement.\n- Do not imply planning readiness if planning-critical ambiguity still remains.\n- Do not rerun the whole `sp-specify` flow unless the current package is unusably wrong.\n\n## Senior Consequence Analysis Gate\n\nRun this gate whenever the request, artifact set, defect, or planned change can affect lifecycle operations, running objects, concurrent work, destructive behavior, shared state, downstream consumers, compatibility, security-sensitive behavior, or multiple plausible product behaviors.\n\nProject cognition first. Use the project cognition runtime to identify ownership, consumers, state surfaces, change-propagation facts, verification routes, conflicts, known unknowns, and coverage gaps. Senior consequence analysis second. Turn those facts into explicit product and implementation obligations instead of treating the graph as the decision-maker.\n\nProject cognition readiness provides routing advice. If readiness is `query_ready`, read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons. If readiness is `review`, inspect the returned `minimal_live_reads` before continuing and treat `coverage_diagnostics` as confidence and closeout signals. If readiness is `needs_rebuild`, continue with live repository evidence and recommend `\u002Fsp-map-scan -> \u002Fsp-map-build` only for brownfield first\u002Fmissing\u002Funusable baseline, schema failure, schema v1 or old broad-schema rebuild-required readiness, zero active-generation `path_index` rows outside `greenfield_empty`, missing or invalid `alias_index`, `explicit_rebuild_requested`, or `baseline_identity_invalid`. If readiness is `blocked`, report the blocked state and continue with live repository evidence unless the user's actual request is to fix cognition runtime state. If readiness is `unsupported_runtime`, continue with live evidence and record that compass intake was unavailable. If `baseline_kind=greenfield_empty`, continue with workflow artifacts and live requirements; do not recommend map-scan -> map-build solely because the graph has no paths. Carry relevant project cognition facts, returned `minimal_live_reads`, inference notes, and coverage gaps into the workflow's artifacts or durable state, but back consequence claims with live code, tests, scripts, configuration, or authoritative docs. Mutation closeout is separate from entry routing: entry stale may continue, but that does not allow source\u002Fruntime mutation workflows to defer closeout. Workflow-owned mutation closeout is not an external map-maintenance handoff; after changing project-related files or behavior, the workflow must run inline project cognition update from its changed paths, affected surfaces, and verification evidence, with `project-cognition mark-dirty` only as fallback when inline update cannot complete. `sp-map-update` is for manual\u002Fexternal maintenance and follow-up repair; it is external map maintenance, not routine closeout for this workflow's own changes. In shared routing summaries, sp-map-update is for manual\u002Fexternal maintenance and ordinary existing-baseline gaps.\n\nRequired output when the gate triggers:\n\n- **Affected Object Map**: name each object, record, worker, queue, artifact, command, API, file surface, user-visible state, or downstream consumer that can be affected.\n- **State-Behavior Matrix**: describe behavior for each important lifecycle state, including created, queued, running, paused, failed, cancelled, completed, resumed, archived, missing, stale, or partially refreshed states when relevant.\n- **Dependency Impact Table**: map direct dependencies, indirect consumers, shared state, compatibility surfaces, validation routes, and adjacent workflows that can break if semantics change.\n- **Recovery And Validation Contract**: state rollback, retry, idempotency, cleanup, migration, observability, and validation evidence required before handoff or completion.\n- **Coverage Gaps**: list what project cognition or live evidence cannot prove, who must resolve each gap, the latest safe resolve phase, the stop-and-reopen condition, and the routing decision: current workflow may continue with an assumption, must ask the user, must route to clarification or deep research, or must request map maintenance.\n- **Consequence Obligations**: assign stable `CA-###` IDs to every obligation that must survive downstream handoff, task generation, worker packets, verification, or debug closeout. Each `CA-###` must include claim, affected objects, owner workflow, latest resolve phase, status, and stop-and-reopen condition.\n\nStand down only for docs-only wording changes, trivial isolated fixes, or local refactors that cannot affect lifecycle operations, running state, destructive operations, shared state, downstream consumers, compatibility, security, or multiple behavior choices. Record the no-trigger reason or stand-down reason in the workflow's durable artifact or closeout before skipping the required outputs.\n\nIf the gate triggers and the current workflow cannot preserve the required outputs, stop and route to the workflow that can. Do not mark ready, resolved, handoff-ready, planning-ready, or complete while triggered consequence obligations remain unresolved, unmapped, or unsupported by validation evidence.\n\n[AGENT] For project-cognition-backed semantic intake, routing, audit, resume, or final-claim gates, read `references\u002Fsemantic-work-contract.md`.\n\n## Detailed References\n\nRead [Reference index](references\u002FINDEX.md) before applying shared semantic contracts.\n\n- [semantic work contract](references\u002Fsemantic-work-contract.md)\n\n## Mandatory Subagent Execution\n\nAll substantive tasks in ordinary `sp-*` workflows default to and must use subagents.\n\nThe leader orchestrates: route, split tasks, prepare task contracts, dispatch subagents, wait for structured handoffs, integrate results, verify, and update state.\n\nBefore dispatch, every subagent lane needs a task contract with objective, authoritative inputs, allowed read\u002Fwrite scope, forbidden paths, acceptance checks, verification evidence, and structured handoff format.\n\nUse `execution_model: subagent-mandatory`.\nUse `dispatch_shape: one-subagent | parallel-subagents`.\nUse `execution_surface: native-subagents`.\n\n\n## Pre-Execution Checks\n\n**Check for extension hooks (before clarification)**:\n- Check if `.specify\u002Fextensions.yml` exists in the project root.\n- If it exists, read it and look for entries under the `hooks.before_clarify` key.\n- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.\n- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.\n- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:\n  - If the hook has no `condition` field, or it is null\u002Fempty, treat the hook as executable.\n  - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation.\n- For each executable hook, output the following based on its `optional` flag:\n  - **Optional hook** (`optional: true`):\n    ```\n    ## Extension Hooks\n\n    **Optional Pre-Hook**: {extension}\n    Command: `\u002F{command}`\n    Description: {description}\n\n    Prompt: {prompt}\n    To execute: `\u002F{command}`\n    ```\n  - **Mandatory hook** (`optional: false`):\n    ```\n    ## Extension Hooks\n\n    **Automatic Pre-Hook**: {extension}\n    Executing: `\u002F{command}`\n    EXECUTE_COMMAND: {command}\n\n    Wait for the result of the hook command before proceeding to the Outline.\n    ```\n- If no hooks are registered or `.specify\u002Fextensions.yml` does not exist, skip silently.\n\n## Outline\n\nGoal: Strengthen an existing spec package after `\u002Fsp.specify` by closing planning-critical gaps, correcting misunderstandings, absorbing reference material better, and writing the improved results back into `spec.md`, `alignment.md`, `context.md`, and `references.md`.\n\n## Project Learning\n\nThe CLI is the only agent-facing Learning read surface:\n\n1. Run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning start --command \u003Cclassic-command-name> --format json` before deeper non-trivial work.\n2. Select summaries by applicability and triggers; use `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning list --command \u003Cclassic-command-name> --format json` only to filter or page.\n3. Execute one matching card's `show_argv`. Do not parse Learning storage.\n\n`start`, `list`, and `show` are read-only. Current repository evidence,\n`.specify\u002Fmemory\u002Fconstitution.md`, and explicit user direction override stale or\ncandidate Learning.\n\nAt closeout, corrections, retries, route changes, recovery, false leads, hidden\ndependencies, validation\u002Ftooling\u002Fstate\u002Fcognition gaps, constraints, and near\nmisses are capture signals. Prefer `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning capture-auto`\nfrom owning state; manual capture includes summary, problem, action, triggers,\nsuccess criteria, avoid items, exceptions, and evidence.\n\n- `fast`: skip unless the task escalates.\n- `accept`, `analyze`, `ask`, `auto`, `constitution`, `explain`,\n  `implement-teams`, `taskstoissues`, and `team`: consume-only; do not violate\n  their write boundaries to capture.\n- Other non-trivial workflows: consume before deeper work; capture reusable\n  signals at closeout or record a no-learning decision.\n\nThe `policy` returned by the CLI is authoritative when prompt wording drifts.\n\n1. Run `.specify\u002Fscripts\u002Fpowershell\u002Fcheck-prerequisites.ps1 -Json -PathsOnly` from repo root once (`--json --paths-only` \u002F `-Json -PathsOnly`). Parse:\n   - If `FEATURE_DIR` is not already explicit, prefer `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify lane resolve --command clarify --ensure-worktree` before guessing from branch-only context.\n   - When lane resolution returns a materialized lane worktree, continue clarification from that isolated worktree context so the repaired spec package stays bound to the active feature lane.\n   - `FEATURE_DIR`\n   - `FEATURE_SPEC`\n   - optional downstream paths if returned\n   - If JSON parsing fails, abort and instruct the user to verify the feature branch environment.\n   - Set `ALIGNMENT_FILE` to `FEATURE_DIR\u002Falignment.md`.\n   - Set `CONTEXT_FILE` to `FEATURE_DIR\u002Fcontext.md`.\n   - Set `REFERENCES_FILE` to `FEATURE_DIR\u002Freferences.md`.\n   - Set `WORKFLOW_STATE_FILE` to `FEATURE_DIR\u002Fworkflow-state.md`.\n\n2. Create or resume the workflow state:\n   - Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n   - If `WORKFLOW_STATE_FILE` already exists, read it first and preserve still-valid `next_action`, `exit_criteria`, and `next_command` details instead of relying on chat memory alone.\n   - Treat `WORKFLOW_STATE_FILE` as the stage-state source of truth for `sp-clarify`.\n   - Persist at least these fields for the active pass:\n     - `active_command: sp-clarify`\n     - `phase_mode: planning-only`\n     - `allowed_artifact_writes: spec.md, alignment.md, context.md, references.md, clarification\u002Fhandoffs\u002F*.json, clarification\u002Fevidence-index.json, clarification\u002Fcheckpoints.ndjson, workflow-state.md`\n     - `forbidden_actions: edit source code, edit tests, fix build\u002Ftooling, implement behavior, run implementation-oriented fix loops`\n     - `authoritative_files: spec.md, alignment.md, context.md, references.md, clarification\u002Fhandoffs\u002F*.json, clarification\u002Fevidence-index.json`\n   - When resuming after compaction, re-read `WORKFLOW_STATE_FILE` before proceeding.\n\n3. Load the current spec package and repo context:\n   - `FEATURE_SPEC`\n   - `FEATURE_DIR\u002Falignment.md` if present\n   - `FEATURE_DIR\u002Fcontext.md` if present\n   - `FEATURE_DIR\u002Freferences.md` if present\n   - `.specify\u002Fmemory\u002Fconstitution.md` if present\n   - `.specify\u002Fmemory\u002Fproject-rules.md` if present\n   - compact `learning start --command clarify` results and only selected `learning show` records\n   - **Project cognition gate:** query the active project's runtime before broad\n     repository reads.\n\n     Run or emulate:\n\n     ```text\n     C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent plan --query=\\\"$ARGUMENTS\\\" --format json\n     ```\n\n     After the default compass packet, run the advanced `lexicon -> semantic_intake -> query` path only when `compass_state`, coverage diagnostics, localization, or live evidence requires explicit concept decisions. In that escalation, use `project-cognition lexicon --mode catalog` as the alias catalog, write agent-authored `semantic_intake` and `concept_decisions`, then run `project-cognition query --query-plan \"\u003Cquery_plan_json>\"`; include `query_plan`, `semantic_intake`, `concept_decisions`, `covered_facets`, `missing_facets`, `match_sources`, `lexicon_generation_id`, `repository_search_terms`, project-language search terms, and facet coverage; do not search only the raw user words before source search. Agent-owned semantic normalization remains mandatory: `agent_normalization` and raw lexicon ranking are bootstrap signals only; if `agent_normalization` is omitted, treat it as `required=false`; use `write_semantic_intake_from_alias_catalog` when needed. Raw lexicon ranking is only a bootstrap; CJK or mixed CJK\u002FASCII input still requires agent-owned normalization even when positive raw lexical matches exist. The agent still owns translation. Readiness values are `query_ready`, `review`, `needs_rebuild`, `blocked`, and `unsupported_runtime`.\n\n     Use the returned readiness:\n\n     - `query_ready`: read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons.\n     - `review`: perform only the returned `minimal_live_reads` before continuing and inspect `coverage_diagnostics`.\n     - `blocked`: report the blocking runtime issue and continue with live evidence only where this workflow allows degraded navigation.\n     - **CARRY FORWARD**: Use project-cognition facts to decide whether an\n       apparent requirement gap is already answered by repository truth. Preserve\n       selected ownership, boundary, ambiguity, and verification facts in the\n       clarified spec package before routing back to planning.\n   - relevant repository documentation and design artifacts when they materially affect the requested change\n\n4. Identify what needs enhancement:\n   - shallow or surface-level capability analysis\n   - missing scenarios or usage paths\n   - unresolved contradictions\n   - underused reference material\n   - newly provided requirements or constraints\n   - unresolved gray areas that still change plan structure\n   - unproven feasibility or implementation-chain links that make `\u002Fsp.plan` guess\n   - missing locked decisions, canonical references, or deferred-scope notes\n   - gaps that would make `\u002Fsp.plan` less reliable\n\n5. Classify findings by severity:\n   - high-impact gaps that require user confirmation\n   - lower-risk gaps that can be safely converted into a validated artifact-update subagent lane from current context\n\n6. Clarification loop for high-impact gaps:\n   - Ask only the minimum number of questions required to make planning reliable again.\n   - Do not use scope minimization as a shortcut to resolve ambiguity. Preserve the user's confirmed product scope; scope reduction requires user confirmation or a named constraint that blocks reliable planning.\n   - Present exactly one unresolved high-impact question at a time.\n   - Prefer questions that lock behavior, boundary handling, compatibility, or acceptance proof rather than reopening broad ideation.\n   - Use the user's current language for user-visible questions and confirmations.\n   - If repository evidence or retained references can answer the gap safely, packetize the artifact update as a validated subagent lane instead of asking the user to restate codebase facts.\n\n7. When justified, use multi-agent research or analysis to deepen the spec:\n   - parallelize only when the work naturally separates into independent research tracks\n   - examples: external references, local codebase context, risk analysis, comparison of alternatives\n   - keep the final output synthesized back into the main spec package instead of returning raw research noise\n   - before dispatching any clarification lane, persist a `clarification_checkpoint` record to `clarification\u002Fcheckpoints.ndjson` with the lane id, lane type, authoritative inputs, expected handoff path, and current workflow-state summary\n   - each delegated clarification lane must persist the lane's structured handoff to `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` before the leader accepts the lane, waits at a join point, or updates `spec.md`, `alignment.md`, `context.md`, or `references.md`\n   - update `clarification\u002Fevidence-index.json` after each accepted lane handoff with lane id, handoff path, source artifacts inspected, questions or constraints resolved, affected artifact sections, blocker status, and integration status\n   - consume `clarification\u002Fevidence-index.json` before final artifact updates: for every accepted handoff, mark the handoff as `integrated`, `deferred`, or `blocked`, and name the target `spec.md`, `alignment.md`, `context.md`, or `references.md` section that consumed it\n   - do not update `spec.md`, `alignment.md`, `context.md`, or `references.md` from chat-only lane results; if a lane reports only prose, idle state, or an unwritten handoff, mark `subagent-blocked`, write the blocker to `workflow-state.md`, and stop or re-dispatch with a valid handoff path\n   - when resuming after compaction, re-read `workflow-state.md`, `clarification\u002Fcheckpoints.ndjson`, `clarification\u002Fevidence-index.json`, and all accepted `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` files before continuing clarification synthesis\n\n7a. Decide whether a separate feasibility gate is needed:\n   - If the remaining issue is \"what should the system do?\", keep clarifying in this command.\n   - If the remaining issue is \"can this capability work with the available APIs, libraries, platform behavior, performance envelope, or integration boundary?\", update `alignment.md` and `workflow-state.md` to recommend `\u002Fsp.deep-research`.\n   - Prefer `\u002Fsp.deep-research` when a disposable demo under `FEATURE_DIR\u002Fresearch-spikes\u002F` would prove the implementation chain before planning.\n   - Record that `\u002Fsp.deep-research` must return a `Planning Handoff` with findings, demo evidence, constraints, rejected options, and recommended approach for `\u002Fsp.plan`.\n   - Do not require `\u002Fsp.deep-research` for minor changes to existing capabilities that already have a clear implementation path in the repository.\n\n7b. Consequence Clarification Lane:\n   - If existing artifacts contain a triggered Senior Consequence Analysis Gate, preserve every `CA-###` consequence obligation from `spec.md`, `alignment.md`, `context.md`, `references.md`, and `workflow-state.md`.\n   - Use clarification questions to resolve product semantics for affected objects, lifecycle states, dependency impact, recovery behavior, validation proof, and coverage gaps that still block planning.\n   - For every clarified consequence obligation, record whether the obligation is resolved, deferred with a latest safe resolve phase, or converted into a stop-and-reopen condition.\n   - Must not drop `CA-###` consequence obligations, stop-and-reopen conditions, stand-down reasons, or coverage gaps just because the current clarification pass focuses on another requirement.\n   - If a consequence obligation cannot be answered from repository evidence or user clarification, preserve it as open and route to `\u002Fsp.deep-research` or `\u002Fsp.plan` only when that downstream workflow can carry the unresolved obligation safely.\n\n8. Delegate artifact enhancements through a validated subagent lane:\n   - Build one bounded `WorkerTaskPacket` for the artifact update lane when the write scope is safe and packetized.\n   - Allowed writes are limited to `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, and the clarification evidence files under `clarification\u002F` inside `FEATURE_DIR`.\n   - The packet must list authoritative inputs, exact artifact sections to strengthen, allowed writes, forbidden actions, acceptance checks, verification evidence, and structured handoff format.\n   - The subagent updates `spec.md`, `alignment.md`, `context.md`, `references.md`, and `workflow-state.md` as needed.\n   - The subagent strengthens `Locked Decisions`, `Claude Discretion`, `Canonical References`, and `Deferred \u002F Future Ideas` in `spec.md` when relevant.\n   - The subagent strengthens `Locked Decisions For Planning`, `Outstanding Questions`, and `Planning Gate Recommendation` in `alignment.md`.\n   - The subagent strengthens feasibility \u002F deep research gate status when an implementation-chain proof is needed before planning.\n   - The subagent strengthens `Locked Decisions`, `Claude Discretion`, `Canonical References`, `Existing Code Insights`, `Specific User Signals`, and `Outstanding Questions` in `context.md`.\n   - The leader owns coordination, packet validation, user-question decisions, structured-handoff review, acceptance, final status, and state consistency.\n   - Each accepted artifact-update lane handoff must be referenced from `clarification\u002Fevidence-index.json`, and the final artifact updates must name the handoff paths that shaped resolved questions, retained risks, or escalations.\n   - Do not mark clarification complete while `clarification\u002Fevidence-index.json` contains an accepted handoff without an explicit consuming artifact section, deferral, or blocker reason.\n   - If the artifact update lane cannot be safely packetized or delegated, record `subagent-blocked` in `workflow-state.md` with the escalation or recovery reason and stop instead of making the artifact edits.\n\n9. Maintain a clean output contract:\n   - preserve confirmed facts\n   - expand low-risk inferences only when they are useful for planning\n   - clearly identify what remains unresolved\n   - do not imply the spec package is planning-ready if planning-critical gaps still remain\n\n10. Report completion with:\n   - sections touched\n   - whether multi-agent research was used\n   - updated paths\n   - clarification evidence paths: `clarification\u002Fevidence-index.json`, `clarification\u002Fcheckpoints.ndjson`, and accepted `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` files\n   - remaining planning risks\n   - recommended next command\n   - whether the spec package is now ready for `\u002Fsp.plan`, still needs more clarification, or needs `\u002Fsp.deep-research` feasibility proof first\n   - whether another `\u002Fsp.specify` or `\u002Fsp.clarify` pass is still justified before planning\n   - updated `workflow-state.md` path\n   - cognition follow-up: if artifact-only clarification work proves later implementation should refresh ownership, workflow, integration boundary, or verification-surface cognition, record that as an advisory in `workflow-state.md`, `alignment.md`, or `context.md`; do not mark project cognition dirty or require a refresh until actual source\u002Fruntime changes make the runtime truth out of date.\n   - If this workflow makes actual source\u002Fruntime\u002Ftemplate\u002Fconfig\u002Ftest\u002Fgenerated-asset changes in the current run, follow the shared inline closeout contract:\n\n### Inline Project Cognition Update\n\nWorkflow-owned mutation closeout is not an external map-maintenance handoff and is not external map maintenance. It is the workflow-local form of `\u002Fsp-map-update`. If this workflow changed project-related source, runtime, templates, generated assets, config, tests, state contracts, shared surfaces, or behavior-bearing docs, closeout MUST run inline project cognition update for the workflow-owned changed paths and affected surfaces before claiming clean completion.\n\nCall the planner first:\n\n```text\nproject-cognition closeout-plan --workflow \"$ACTIVE_WORKFLOW\" --format json\n```\n\nWhen `DELTA_SESSION_ID` exists, pass it into the planner:\n\n```text\nproject-cognition closeout-plan --workflow \"$ACTIVE_WORKFLOW\" --delta-session \"$DELTA_SESSION_ID\" --format json\n```\n\nConsume `workflow_canonical`, `update_mode`, `payload_draft`, `required_agent_fields`, `unknown_paths`, `unknown_path_dispositions`, `delta_append_draft`, display-only `delta_append_command`, `update_argv`, display-only `update_command`, and `recommended_next_command`.\n\nBefore running `update`, fill the fields listed in `required_agent_fields` from live evidence from this workflow. Supported agent-owned evidence fields include:\n\n- `verification`\n- `behavior_surfaces`\n- `generated_surfaces`\n- `state_contracts`\n- `known_unknowns`\n- `confidence_notes`\n- `user_decisions`\n- `boundary`\n\nIf a field appears in `required_agent_fields`, provide live-evidence-backed content for it. Fields not listed by `required_agent_fields`, such as `known_unknowns` and `boundary`, are populated only when live evidence supports them; do not invent them to satisfy the shape.\nUse `known_unknowns` only for blockers that make the cognition update unsafe to trust. If the working tree contains unrelated dirty\u002Funtracked paths and the workflow uses explicit workflow-owned paths, record that as `confidence_notes` or `boundary.initial_dirty_paths`, not as a blocking `known_unknowns` item.\n\nFor each `unknown_path_dispositions[]` item, set `agent_disposition` to exactly one allowed value:\n\n- `adoptable`: verified new path inside this workflow-owned scope; it may be recorded in changed\u002Fscope paths and verified adoptable paths do not become blocking `known_unknowns`.\n- `review_only`: path informed review but is not adopted into changed coverage.\n- `ignored`: path remains excluded and must not enter payloads, records, route indexes, evidence, aliases, or minimal live reads.\n- `blocking_known_unknown`: record it as a known unknown and report partial or blocked cognition closeout.\n\n`agent_disposition=adoptable` is an agent accounting decision, not proof that runtime indexing already succeeded. Runtime adoption still requires a usable active project-cognition DB, at least one passing verification evidence item, and no blocking `known_unknowns`. After `update_argv` runs, inspect `result_state`, `adopted_paths`, `review_paths`, `minimal_live_reads`, and `partial_refresh_reasons`; do not explain a remaining `partial_refresh` as \"path_index missing\" until those fields show which adoption gate failed.\n\nIf `update_mode=delta_session`, complete `delta_append_draft.argv_prefix` with agent-owned repeatable flags such as `--behavior-surface`, `--generated-surface`, `--verification`, and accepted `--known-unknown` values from `delta_append_draft.argv_placeholders`. Then append the delta event and run `update_argv`. `delta_append_command` and `update_command` are display-only placeholders, not execution strings.\n\nIf `update_mode=payload_file`, write the completed `payload_draft` to the planner's `payload_path`. Then run `update_argv`. `update_command` is a display-only placeholder, not an execution string.\n\nCompleted payload drafts preserve the planner-owned `changed_paths` and `scope_paths` and add agent-owned evidence fields before recording.\n\nStructured `update` invalidates related claims and returns their stable IDs in `affected_graph_claims`. This is separate from update readiness: generic workflow verification and `result_state=ready` must not re-promote stale or contradicted graph claims. Only when this workflow already has decisive claim-specific bounded live evidence for an exact returned claim ID may it submit semantic reconciliation intent and run:\n\n```text\nproject-cognition claim-reconcile prepare --input \u003Cintent.json> --format json\nproject-cognition claim-reconcile apply --input \u003Cprepared_packet_path> --format json\n```\n\nProvide only reconciliation intent: workflow, stable `claim_id`, reason, and evidence containing repository-relative `source_path`, bounded line `span`, and `supporting` or `contradicting` role. Add verification only when it is claim-specific. The runtime owns the contract version, active generation, expected state and revision, UTC observation and expiry, source kind, content hashes, repository snapshot, IDs, and prepared packet path. Do not author or edit those integrity fields; execute the returned `apply_argv` exactly. If no such evidence exists, leave the claim stale. If reconciliation returns ready, rerun Compass once so later routing consumes the current evidence basis; partial or blocked reconciliation remains withheld and follows `recommended_next_action`.\n\nFor compatibility with worker handoffs and delta packets, the runtime also accepts `verification_evidence` as an alias for `verification` and `generated_surface_notes` as an alias for `generated_surfaces`. Verification evidence may be an array of objects (`command`, `result`, `artifact`) or an array of command-result strings, but clean closeout still requires passing verification evidence; failed verification cannot produce a clean `ready` closeout.\n\nClean closeout keys on `result_state`, not `status=ok`, `update_id`, `last_update_id`, or freshness alone:\n\n- `ready` or `no_op`: project cognition closeout may be clean when ordinary verification also passed.\n- `partial_refresh`: useful update data was written, but the final workflow state must report partial cognition closeout, `partial_refresh_reasons`, and the returned `minimal_live_reads`. If `partial_refresh_reasons` includes `missing_passing_verification_result`, repair the payload or delta evidence and rerun `update_argv` before final closeout; do not route that to `sp-map-update`. If verified workflow-owned paths still remain in `review_paths` after the update, report implementation completion separately from project-cognition maintenance and name `\u002Fsp-map-update` as follow-up repair.\n- `needs_rebuild`: report the exact rebuild condition and route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`.\n- `blocked`: report the runtime or validation blocker and the exact recovery command.\n- `recorded`: legacy recorded-only output; treat it as partial or blocked, never as clean completion.\n\nNever run the `complete-refresh` or `clear-dirty` helper after `result_state=partial_refresh`, `needs_rebuild`, `blocked`, or legacy `recorded`; those helpers are only for states that the runtime and validation prove ready.\n\nDirty fallback command shape: `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe mark-dirty --reason \\\"\u003Creason>\\\" --format json`.\nUse `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe mark-dirty --reason \\\"workflow-closeout-failed\\\" --format json` only when inline update cannot complete: when the planner or update command is unavailable, cannot record useful update data, cannot identify workflow-owned scope, or cannot be trusted because verification\u002Fworkflow completion is not trustworthy. Dirty only when inline update cannot complete.\n\nsp-map-update is for manual\u002Fexternal maintenance and follow-up repair. `\u002Fsp-map-update` remains the external\u002Fmanual workflow for user edits, interrupted workflow repair, explicit map maintenance, and follow-up repair. It is not routine cleanup for changes this workflow just made. If `sp-map-update` already ran `project-cognition update --reason map-update` for the same changed paths, do not run a second `workflow-finalize` closeout update for those paths.\n\n## Presentation Contract\n\nWhen communicating findings and completion, use a structured terminal presentation built from open blocks with:\n\n- a stage header that identifies `clarify` and the current repair state\n- a status block that summarizes whether the spec package was strengthened, partially strengthened, or is waiting on user confirmation\n- an explanation block that explains what changed, which planning-critical gaps were reduced, and why it matters for planning\n- a risk block that lists unresolved planning risks, remaining contradictions, or evidence gaps\n- a next-step block that gives the recommended next command and whether more enhancement work is still needed before `\u002Fsp.plan`\n- when the package is still not planning-ready, the next-step block must avoid implying an automatic handoff to `\u002Fsp.plan`\n\n## Rules\n\n- Use the user's current language for user-visible output unless literal command names, file paths, or fixed status values must remain unchanged.\n- Do not re-run the entire `specify` flow from scratch unless the current spec is unusably wrong.\n- Prefer targeted enhancement over full restatement.\n- If new information materially changes scope or alignment, update `alignment.md` in the same pass.\n- Treat `\u002Fsp.clarify` as the default rescue lane and repair lane when planning-critical ambiguity remains after `\u002Fsp.specify`.\n- If high-impact ambiguity remains after enhancement, recommend another clarification pass instead of implying that `\u002Fsp.plan` is now safe.\n- If requirements are clear but feasibility is unproven, recommend `\u002Fsp.deep-research` instead of implying that `\u002Fsp.plan` is now safe.\n\n## Post-Execution Checks\n\n**Check for extension hooks (after clarification)**:\n- Check if `.specify\u002Fextensions.yml` exists in the project root.\n- If it exists, read it and look for entries under the `hooks.after_clarify` key.\n- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.\n- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.\n- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:\n  - If the hook has no `condition` field, or it is null\u002Fempty, treat the hook as executable.\n  - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation.\n- For each executable hook, output the following based on its `optional` flag:\n  - **Optional hook** (`optional: true`):\n    ```\n    ## Extension Hooks\n\n    **Optional Hook**: {extension}\n    Command: `\u002F{command}`\n    Description: {description}\n\n    Prompt: {prompt}\n    To execute: `\u002F{command}`\n    ```\n  - **Mandatory hook** (`optional: false`):\n    ```\n    ## Extension Hooks\n\n    **Automatic Hook**: {extension}\n    Executing: `\u002F{command}`\n    EXECUTE_COMMAND: {command}\n    ```\n- If no hooks are registered or `.specify\u002Fextensions.yml` does not exist, skip silently.\n\n## Claude Code Subagent Capability Discovery\n\n- Execution model: preserve the workflow's existing `subagent-mandatory`, `subagents-first`, `adaptive`, or `subagent-assisted` policy.\n- Dispatch shape: preserve the workflow's existing dispatch shape; use `subagent-blocked` only after the discovery step below fails or is unsafe.\n- Execution surface: prefer `native-subagents` when the current runtime supports it; use `none` only after recording the unavailable or unsafe surface.\n- Native subagent capability discovery: Before recording `subagent-blocked`, check the active tool surface for the integration-native subagent or task-dispatch entrypoint and record the exact missing surface if unavailable.\n- Do not record `subagent-blocked` until this capability discovery step is complete and the exact unavailable or unsafe surface is recorded.\n- Native subagent dispatch: Dispatch subagents through the integration's native subagent support using the shared prompt contract.\n- Join behavior: Use the integration-native join point, then integrate results back on the leader path.\n- Preserve this workflow's existing packet, handoff, artifact, and result schema; this section only governs capability discovery before dispatch or blocked-state recording.\n\n## Claude Code Structured Question Preference\n\n- If this command was routed by `sp-auto` with `auto_default_recommendation: true`, evaluate the automatic recommended\u002Fdefault continuation gate before any question path.\n- When that gate has one safe recommended\u002Fdefault answer, you must auto-resolve the question or confirmation, record the accepted recommendation in the workflow state or summary, continue the workflow, and do not invoke the native structured question tool only to ask for that approval.\n- If the automatic gate is not safe, write the blocker and self-unblock recommendation before using the normal question path.\n- If the runtime's native structured question tool is available for the current turn and the `sp-auto` automatic gate did not resolve the question, you must use it.\n- Do not render the textual fallback block when the native tool is available.\n- Do not self-authorize textual fallback because the question seems simple, short, or easy to phrase manually.\n- Treat the template's textual question format as fallback-only guidance; use it to shape the question content, but do not render the textual block unless the native tool is unavailable in the current runtime or the tool call fails.\n- Keep native-tool availability, runtime mode, and fallback mechanics backstage. Do not tell the user that a structured question tool is unavailable, that the current runtime\u002Fmode lacks a tool, or that a fallback is being used; ask the user-facing question directly when a question is genuinely required.\n- Ask only the minimum number of questions required by this workflow's existing contract.\n- Keep the user-visible question text in the user's current language and keep option labels short.\n- Do not emit both a native tool question and the textual fallback block in the same turn. The user should see the active question exactly once.\n- If the native tool is unavailable in the current runtime or the tool call fails, ask one concise plain-text confirmation question and continue with the existing enhancement flow.\n- In `clarify`, use this preference for:\n  - high-impact gap confirmation\n  - scope or constraint confirmation when enhancement changes planning readiness\n- Native tool target: `AskUserQuestion`\n- When this native tool target is listed for the integration and the runtime does not signal otherwise, assume it is available by default in normal interactive sessions.\n- Question count: 1-4 questions per call\n- Option count: 2-4 options per question\n- Required question fields: `question`, `header`, `options`, `multiSelect`\n- Option fields: `label`, `description`, `preview (optional)`\n- Use `multiSelect: false` unless the workflow explicitly needs multiple selections.\n- Use `metadata` only when tracking or analytics context adds value; otherwise keep the call minimal.\n","## Invocation Syntax\n\n- In this integration, invoke workflow skills with `\u002Fsp-plan`-style syntax.\n- References such as `\u002Fsp.plan`, `\u002Fsp.tasks`, or `next_command: \u002Fsp.plan` are canonical workflow-state identifiers and handoff values.\n- Preserve those canonical state tokens exactly in artifacts and workflow state; do not rewrite them to this integration's invocation syntax.\n\n\n\n## Workflow Contract Summary\n\n- **When to use**: The current spec package exists, but planning-critical ambiguity or new evidence makes \u002Fsp-plan unreliable.\n- **Primary objective**: Strengthen the existing spec package without rerunning the entire `sp-specify` flow from scratch.\n- **Primary outputs**: Updated `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, `clarification\u002Fhandoffs\u002F\u003Clane-id>.json`, `clarification\u002Fevidence-index.json`, and `clarification\u002Fcheckpoints.ndjson` inside the active `FEATURE_DIR`.\n- **Default handoff**: \u002Fsp-plan if the package becomes planning-ready; otherwise continue clarification, run another repair pass, or route unproven feasibility through \u002Fsp-deep-research.\n- **Execution note**: This summary is routing metadata only. Follow the full contract below end-to-end rather than inferring behavior from the description alone.\n\n## Blocked Exit Contract\n\nIf blocked after safe recovery, read and follow\n`.specify\u002Ftemplates\u002Fworkflow-blocker-template.md` and its JSON schema. Never\nreturn only an error or “ask a human”; preserve state and keep agent-capable\nrepair agent-owned. Set `human_action_required: true` only for authority,\ncredentials, protected systems, human decisions\u002Freviews, or physical access.\nTailor steps, expected results, failure paths, evidence, and resume action to\nCI, visual review, or product decisions. Never claim completion.\n\n## User Input\n\n```text\n$ARGUMENTS\n```\n\nYou **MUST** consider the user input before proceeding (if not empty).\n\n## Objective\n\nStrengthen the current specification package just enough to remove planning-critical gaps and make the next planning decision better grounded.\n\n## Context\n\n- Primary inputs: the existing spec package, any newly supplied requirements or references, and the current repository context.\n- The active working set is `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, `clarification\u002Fhandoffs\u002F`, `clarification\u002Fevidence-index.json`, and `clarification\u002Fcheckpoints.ndjson` inside the current `FEATURE_DIR`.\n- This command is enhancement-oriented. It should improve the package already on disk rather than restart the workflow from zero.\n\n## Process\n\n- Identify the specific planning-critical gaps or weak analysis that need improvement.\n- Deepen the relevant parts of the specification package through targeted analysis or bounded research.\n- Update the artifact set in place and reassess planning readiness.\n\n## Output Contract\n\n- Write the improved spec package back to disk.\n- Persist clarification lane evidence before artifact updates: every delegated clarification lane writes `clarification\u002Fhandoffs\u002F\u003Clane-id>.json`, the leader updates `clarification\u002Fevidence-index.json`, and checkpoint records go to `clarification\u002Fcheckpoints.ndjson`.\n- Consume every accepted clarification handoff before final artifact updates: each accepted handoff must be integrated into `spec.md`, `alignment.md`, `context.md`, `references.md`, or explicitly recorded as deferred or blocked with a reason.\n- Report what changed, what risks remain, and whether the package is ready for `\u002Fsp-plan`.\n- Keep unresolved uncertainty explicit instead of implying false readiness.\n\n## Guardrails\n\n- Prefer targeted enhancement over a full restatement.\n- Do not imply planning readiness if planning-critical ambiguity still remains.\n- Do not rerun the whole `sp-specify` flow unless the current package is unusably wrong.\n\n## Senior Consequence Analysis Gate\n\nRun this gate whenever the request, artifact set, defect, or planned change can affect lifecycle operations, running objects, concurrent work, destructive behavior, shared state, downstream consumers, compatibility, security-sensitive behavior, or multiple plausible product behaviors.\n\nProject cognition first. Use the project cognition runtime to identify ownership, consumers, state surfaces, change-propagation facts, verification routes, conflicts, known unknowns, and coverage gaps. Senior consequence analysis second. Turn those facts into explicit product and implementation obligations instead of treating the graph as the decision-maker.\n\nProject cognition readiness provides routing advice. If readiness is `query_ready`, read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons. If readiness is `review`, inspect the returned `minimal_live_reads` before continuing and treat `coverage_diagnostics` as confidence and closeout signals. If readiness is `needs_rebuild`, continue with live repository evidence and recommend `\u002Fsp-map-scan -> \u002Fsp-map-build` only for brownfield first\u002Fmissing\u002Funusable baseline, schema failure, schema v1 or old broad-schema rebuild-required readiness, zero active-generation `path_index` rows outside `greenfield_empty`, missing or invalid `alias_index`, `explicit_rebuild_requested`, or `baseline_identity_invalid`. If readiness is `blocked`, report the blocked state and continue with live repository evidence unless the user's actual request is to fix cognition runtime state. If readiness is `unsupported_runtime`, continue with live evidence and record that compass intake was unavailable. If `baseline_kind=greenfield_empty`, continue with workflow artifacts and live requirements; do not recommend map-scan -> map-build solely because the graph has no paths. Carry relevant project cognition facts, returned `minimal_live_reads`, inference notes, and coverage gaps into the workflow's artifacts or durable state, but back consequence claims with live code, tests, scripts, configuration, or authoritative docs. Mutation closeout is separate from entry routing: entry stale may continue, but that does not allow source\u002Fruntime mutation workflows to defer closeout. Workflow-owned mutation closeout is not an external map-maintenance handoff; after changing project-related files or behavior, the workflow must run inline project cognition update from its changed paths, affected surfaces, and verification evidence, with `project-cognition mark-dirty` only as fallback when inline update cannot complete. `sp-map-update` is for manual\u002Fexternal maintenance and follow-up repair; it is external map maintenance, not routine closeout for this workflow's own changes. In shared routing summaries, sp-map-update is for manual\u002Fexternal maintenance and ordinary existing-baseline gaps.\n\nRequired output when the gate triggers:\n\n- **Affected Object Map**: name each object, record, worker, queue, artifact, command, API, file surface, user-visible state, or downstream consumer that can be affected.\n- **State-Behavior Matrix**: describe behavior for each important lifecycle state, including created, queued, running, paused, failed, cancelled, completed, resumed, archived, missing, stale, or partially refreshed states when relevant.\n- **Dependency Impact Table**: map direct dependencies, indirect consumers, shared state, compatibility surfaces, validation routes, and adjacent workflows that can break if semantics change.\n- **Recovery And Validation Contract**: state rollback, retry, idempotency, cleanup, migration, observability, and validation evidence required before handoff or completion.\n- **Coverage Gaps**: list what project cognition or live evidence cannot prove, who must resolve each gap, the latest safe resolve phase, the stop-and-reopen condition, and the routing decision: current workflow may continue with an assumption, must ask the user, must route to clarification or deep research, or must request map maintenance.\n- **Consequence Obligations**: assign stable `CA-###` IDs to every obligation that must survive downstream handoff, task generation, worker packets, verification, or debug closeout. Each `CA-###` must include claim, affected objects, owner workflow, latest resolve phase, status, and stop-and-reopen condition.\n\nStand down only for docs-only wording changes, trivial isolated fixes, or local refactors that cannot affect lifecycle operations, running state, destructive operations, shared state, downstream consumers, compatibility, security, or multiple behavior choices. Record the no-trigger reason or stand-down reason in the workflow's durable artifact or closeout before skipping the required outputs.\n\nIf the gate triggers and the current workflow cannot preserve the required outputs, stop and route to the workflow that can. Do not mark ready, resolved, handoff-ready, planning-ready, or complete while triggered consequence obligations remain unresolved, unmapped, or unsupported by validation evidence.\n\n[AGENT] For project-cognition-backed semantic intake, routing, audit, resume, or final-claim gates, read `references\u002Fsemantic-work-contract.md`.\n\n## Detailed References\n\nRead [Reference index](references\u002FINDEX.md) before applying shared semantic contracts.\n\n- [semantic work contract](references\u002Fsemantic-work-contract.md)\n\n## Mandatory Subagent Execution\n\nAll substantive tasks in ordinary `sp-*` workflows default to and must use subagents.\n\nThe leader orchestrates: route, split tasks, prepare task contracts, dispatch subagents, wait for structured handoffs, integrate results, verify, and update state.\n\nBefore dispatch, every subagent lane needs a task contract with objective, authoritative inputs, allowed read\u002Fwrite scope, forbidden paths, acceptance checks, verification evidence, and structured handoff format.\n\nUse `execution_model: subagent-mandatory`.\nUse `dispatch_shape: one-subagent | parallel-subagents`.\nUse `execution_surface: native-subagents`.\n\n\n## Pre-Execution Checks\n\n**Check for extension hooks (before clarification)**:\n- Check if `.specify\u002Fextensions.yml` exists in the project root.\n- If it exists, read it and look for entries under the `hooks.before_clarify` key.\n- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.\n- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.\n- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:\n  - If the hook has no `condition` field, or it is null\u002Fempty, treat the hook as executable.\n  - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation.\n- For each executable hook, output the following based on its `optional` flag:\n  - **Optional hook** (`optional: true`):\n    ```\n    ## Extension Hooks\n\n    **Optional Pre-Hook**: {extension}\n    Command: `\u002F{command}`\n    Description: {description}\n\n    Prompt: {prompt}\n    To execute: `\u002F{command}`\n    ```\n  - **Mandatory hook** (`optional: false`):\n    ```\n    ## Extension Hooks\n\n    **Automatic Pre-Hook**: {extension}\n    Executing: `\u002F{command}`\n    EXECUTE_COMMAND: {command}\n\n    Wait for the result of the hook command before proceeding to the Outline.\n    ```\n- If no hooks are registered or `.specify\u002Fextensions.yml` does not exist, skip silently.\n\n## Outline\n\nGoal: Strengthen an existing spec package after `\u002Fsp.specify` by closing planning-critical gaps, correcting misunderstandings, absorbing reference material better, and writing the improved results back into `spec.md`, `alignment.md`, `context.md`, and `references.md`.\n\n## Project Learning\n\nThe CLI is the only agent-facing Learning read surface:\n\n1. Run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning start --command \u003Cclassic-command-name> --format json` before deeper non-trivial work.\n2. Select summaries by applicability and triggers; use `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning list --command \u003Cclassic-command-name> --format json` only to filter or page.\n3. Execute one matching card's `show_argv`. Do not parse Learning storage.\n\n`start`, `list`, and `show` are read-only. Current repository evidence,\n`.specify\u002Fmemory\u002Fconstitution.md`, and explicit user direction override stale or\ncandidate Learning.\n\nAt closeout, corrections, retries, route changes, recovery, false leads, hidden\ndependencies, validation\u002Ftooling\u002Fstate\u002Fcognition gaps, constraints, and near\nmisses are capture signals. Prefer `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify learning capture-auto`\nfrom owning state; manual capture includes summary, problem, action, triggers,\nsuccess criteria, avoid items, exceptions, and evidence.\n\n- `fast`: skip unless the task escalates.\n- `accept`, `analyze`, `ask`, `auto`, `constitution`, `explain`,\n  `implement-teams`, `taskstoissues`, and `team`: consume-only; do not violate\n  their write boundaries to capture.\n- Other non-trivial workflows: consume before deeper work; capture reusable\n  signals at closeout or record a no-learning decision.\n\nThe `policy` returned by the CLI is authoritative when prompt wording drifts.\n\n1. Run `.specify\u002Fscripts\u002Fpowershell\u002Fcheck-prerequisites.ps1 -Json -PathsOnly` from repo root once (`--json --paths-only` \u002F `-Json -PathsOnly`). Parse:\n   - If `FEATURE_DIR` is not already explicit, prefer `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify lane resolve --command clarify --ensure-worktree` before guessing from branch-only context.\n   - When lane resolution returns a materialized lane worktree, continue clarification from that isolated worktree context so the repaired spec package stays bound to the active feature lane.\n   - `FEATURE_DIR`\n   - `FEATURE_SPEC`\n   - optional downstream paths if returned\n   - If JSON parsing fails, abort and instruct the user to verify the feature branch environment.\n   - Set `ALIGNMENT_FILE` to `FEATURE_DIR\u002Falignment.md`.\n   - Set `CONTEXT_FILE` to `FEATURE_DIR\u002Fcontext.md`.\n   - Set `REFERENCES_FILE` to `FEATURE_DIR\u002Freferences.md`.\n   - Set `WORKFLOW_STATE_FILE` to `FEATURE_DIR\u002Fworkflow-state.md`.\n\n2. Create or resume the workflow state:\n   - Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n   - If `WORKFLOW_STATE_FILE` already exists, read it first and preserve still-valid `next_action`, `exit_criteria`, and `next_command` details instead of relying on chat memory alone.\n   - Treat `WORKFLOW_STATE_FILE` as the stage-state source of truth for `sp-clarify`.\n   - Persist at least these fields for the active pass:\n     - `active_command: sp-clarify`\n     - `phase_mode: planning-only`\n     - `allowed_artifact_writes: spec.md, alignment.md, context.md, references.md, clarification\u002Fhandoffs\u002F*.json, clarification\u002Fevidence-index.json, clarification\u002Fcheckpoints.ndjson, workflow-state.md`\n     - `forbidden_actions: edit source code, edit tests, fix build\u002Ftooling, implement behavior, run implementation-oriented fix loops`\n     - `authoritative_files: spec.md, alignment.md, context.md, references.md, clarification\u002Fhandoffs\u002F*.json, clarification\u002Fevidence-index.json`\n   - When resuming after compaction, re-read `WORKFLOW_STATE_FILE` before proceeding.\n\n3. Load the current spec package and repo context:\n   - `FEATURE_SPEC`\n   - `FEATURE_DIR\u002Falignment.md` if present\n   - `FEATURE_DIR\u002Fcontext.md` if present\n   - `FEATURE_DIR\u002Freferences.md` if present\n   - `.specify\u002Fmemory\u002Fconstitution.md` if present\n   - `.specify\u002Fmemory\u002Fproject-rules.md` if present\n   - compact `learning start --command clarify` results and only selected `learning show` records\n   - **Project cognition gate:** query the active project's runtime before broad\n     repository reads.\n\n     Run or emulate:\n\n     ```text\n     C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent plan --query=\\\"$ARGUMENTS\\\" --format json\n     ```\n\n     After the default compass packet, run the advanced `lexicon -> semantic_intake -> query` path only when `compass_state`, coverage diagnostics, localization, or live evidence requires explicit concept decisions. In that escalation, use `project-cognition lexicon --mode catalog` as the alias catalog, write agent-authored `semantic_intake` and `concept_decisions`, then run `project-cognition query --query-plan \"\u003Cquery_plan_json>\"`; include `query_plan`, `semantic_intake`, `concept_decisions`, `covered_facets`, `missing_facets`, `match_sources`, `lexicon_generation_id`, `repository_search_terms`, project-language search terms, and facet coverage; do not search only the raw user words before source search. Agent-owned semantic normalization remains mandatory: `agent_normalization` and raw lexicon ranking are bootstrap signals only; if `agent_normalization` is omitted, treat it as `required=false`; use `write_semantic_intake_from_alias_catalog` when needed. Raw lexicon ranking is only a bootstrap; CJK or mixed CJK\u002FASCII input still requires agent-owned normalization even when positive raw lexical matches exist. The agent still owns translation. Readiness values are `query_ready`, `review`, `needs_rebuild`, `blocked`, and `unsupported_runtime`.\n\n     Use the returned readiness:\n\n     - `query_ready`: read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons.\n     - `review`: perform only the returned `minimal_live_reads` before continuing and inspect `coverage_diagnostics`.\n     - `blocked`: report the blocking runtime issue and continue with live evidence only where this workflow allows degraded navigation.\n     - **CARRY FORWARD**: Use project-cognition facts to decide whether an\n       apparent requirement gap is already answered by repository truth. Preserve\n       selected ownership, boundary, ambiguity, and verification facts in the\n       clarified spec package before routing back to planning.\n   - relevant repository documentation and design artifacts when they materially affect the requested change\n\n4. Identify what needs enhancement:\n   - shallow or surface-level capability analysis\n   - missing scenarios or usage paths\n   - unresolved contradictions\n   - underused reference material\n   - newly provided requirements or constraints\n   - unresolved gray areas that still change plan structure\n   - unproven feasibility or implementation-chain links that make `\u002Fsp.plan` guess\n   - missing locked decisions, canonical references, or deferred-scope notes\n   - gaps that would make `\u002Fsp.plan` less reliable\n\n5. Classify findings by severity:\n   - high-impact gaps that require user confirmation\n   - lower-risk gaps that can be safely converted into a validated artifact-update subagent lane from current context\n\n6. Clarification loop for high-impact gaps:\n   - Ask only the minimum number of questions required to make planning reliable again.\n   - Do not use scope minimization as a shortcut to resolve ambiguity. Preserve the user's confirmed product scope; scope reduction requires user confirmation or a named constraint that blocks reliable planning.\n   - Present exactly one unresolved high-impact question at a time.\n   - Prefer questions that lock behavior, boundary handling, compatibility, or acceptance proof rather than reopening broad ideation.\n   - Use the user's current language for user-visible questions and confirmations.\n   - If repository evidence or retained references can answer the gap safely, packetize the artifact update as a validated subagent lane instead of asking the user to restate codebase facts.\n\n7. When justified, use multi-agent research or analysis to deepen the spec:\n   - parallelize only when the work naturally separates into independent research tracks\n   - examples: external references, local codebase context, risk analysis, comparison of alternatives\n   - keep the final output synthesized back into the main spec package instead of returning raw research noise\n   - before dispatching any clarification lane, persist a `clarification_checkpoint` record to `clarification\u002Fcheckpoints.ndjson` with the lane id, lane type, authoritative inputs, expected handoff path, and current workflow-state summary\n   - each delegated clarification lane must persist the lane's structured handoff to `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` before the leader accepts the lane, waits at a join point, or updates `spec.md`, `alignment.md`, `context.md`, or `references.md`\n   - update `clarification\u002Fevidence-index.json` after each accepted lane handoff with lane id, handoff path, source artifacts inspected, questions or constraints resolved, affected artifact sections, blocker status, and integration status\n   - consume `clarification\u002Fevidence-index.json` before final artifact updates: for every accepted handoff, mark the handoff as `integrated`, `deferred`, or `blocked`, and name the target `spec.md`, `alignment.md`, `context.md`, or `references.md` section that consumed it\n   - do not update `spec.md`, `alignment.md`, `context.md`, or `references.md` from chat-only lane results; if a lane reports only prose, idle state, or an unwritten handoff, mark `subagent-blocked`, write the blocker to `workflow-state.md`, and stop or re-dispatch with a valid handoff path\n   - when resuming after compaction, re-read `workflow-state.md`, `clarification\u002Fcheckpoints.ndjson`, `clarification\u002Fevidence-index.json`, and all accepted `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` files before continuing clarification synthesis\n\n7a. Decide whether a separate feasibility gate is needed:\n   - If the remaining issue is \"what should the system do?\", keep clarifying in this command.\n   - If the remaining issue is \"can this capability work with the available APIs, libraries, platform behavior, performance envelope, or integration boundary?\", update `alignment.md` and `workflow-state.md` to recommend `\u002Fsp.deep-research`.\n   - Prefer `\u002Fsp.deep-research` when a disposable demo under `FEATURE_DIR\u002Fresearch-spikes\u002F` would prove the implementation chain before planning.\n   - Record that `\u002Fsp.deep-research` must return a `Planning Handoff` with findings, demo evidence, constraints, rejected options, and recommended approach for `\u002Fsp.plan`.\n   - Do not require `\u002Fsp.deep-research` for minor changes to existing capabilities that already have a clear implementation path in the repository.\n\n7b. Consequence Clarification Lane:\n   - If existing artifacts contain a triggered Senior Consequence Analysis Gate, preserve every `CA-###` consequence obligation from `spec.md`, `alignment.md`, `context.md`, `references.md`, and `workflow-state.md`.\n   - Use clarification questions to resolve product semantics for affected objects, lifecycle states, dependency impact, recovery behavior, validation proof, and coverage gaps that still block planning.\n   - For every clarified consequence obligation, record whether the obligation is resolved, deferred with a latest safe resolve phase, or converted into a stop-and-reopen condition.\n   - Must not drop `CA-###` consequence obligations, stop-and-reopen conditions, stand-down reasons, or coverage gaps just because the current clarification pass focuses on another requirement.\n   - If a consequence obligation cannot be answered from repository evidence or user clarification, preserve it as open and route to `\u002Fsp.deep-research` or `\u002Fsp.plan` only when that downstream workflow can carry the unresolved obligation safely.\n\n8. Delegate artifact enhancements through a validated subagent lane:\n   - Build one bounded `WorkerTaskPacket` for the artifact update lane when the write scope is safe and packetized.\n   - Allowed writes are limited to `spec.md`, `alignment.md`, `context.md`, `references.md`, `workflow-state.md`, and the clarification evidence files under `clarification\u002F` inside `FEATURE_DIR`.\n   - The packet must list authoritative inputs, exact artifact sections to strengthen, allowed writes, forbidden actions, acceptance checks, verification evidence, and structured handoff format.\n   - The subagent updates `spec.md`, `alignment.md`, `context.md`, `references.md`, and `workflow-state.md` as needed.\n   - The subagent strengthens `Locked Decisions`, `Claude Discretion`, `Canonical References`, and `Deferred \u002F Future Ideas` in `spec.md` when relevant.\n   - The subagent strengthens `Locked Decisions For Planning`, `Outstanding Questions`, and `Planning Gate Recommendation` in `alignment.md`.\n   - The subagent strengthens feasibility \u002F deep research gate status when an implementation-chain proof is needed before planning.\n   - The subagent strengthens `Locked Decisions`, `Claude Discretion`, `Canonical References`, `Existing Code Insights`, `Specific User Signals`, and `Outstanding Questions` in `context.md`.\n   - The leader owns coordination, packet validation, user-question decisions, structured-handoff review, acceptance, final status, and state consistency.\n   - Each accepted artifact-update lane handoff must be referenced from `clarification\u002Fevidence-index.json`, and the final artifact updates must name the handoff paths that shaped resolved questions, retained risks, or escalations.\n   - Do not mark clarification complete while `clarification\u002Fevidence-index.json` contains an accepted handoff without an explicit consuming artifact section, deferral, or blocker reason.\n   - If the artifact update lane cannot be safely packetized or delegated, record `subagent-blocked` in `workflow-state.md` with the escalation or recovery reason and stop instead of making the artifact edits.\n\n9. Maintain a clean output contract:\n   - preserve confirmed facts\n   - expand low-risk inferences only when they are useful for planning\n   - clearly identify what remains unresolved\n   - do not imply the spec package is planning-ready if planning-critical gaps still remain\n\n10. Report completion with:\n   - sections touched\n   - whether multi-agent research was used\n   - updated paths\n   - clarification evidence paths: `clarification\u002Fevidence-index.json`, `clarification\u002Fcheckpoints.ndjson`, and accepted `clarification\u002Fhandoffs\u002F\u003Clane-id>.json` files\n   - remaining planning risks\n   - recommended next command\n   - whether the spec package is now ready for `\u002Fsp.plan`, still needs more clarification, or needs `\u002Fsp.deep-research` feasibility proof first\n   - whether another `\u002Fsp.specify` or `\u002Fsp.clarify` pass is still justified before planning\n   - updated `workflow-state.md` path\n   - cognition follow-up: if artifact-only clarification work proves later implementation should refresh ownership, workflow, integration boundary, or verification-surface cognition, record that as an advisory in `workflow-state.md`, `alignment.md`, or `context.md`; do not mark project cognition dirty or require a refresh until actual source\u002Fruntime changes make the runtime truth out of date.\n   - If this workflow makes actual source\u002Fruntime\u002Ftemplate\u002Fconfig\u002Ftest\u002Fgenerated-asset changes in the current run, follow the shared inline closeout contract:\n\n### Inline Project Cognition Update\n\nWorkflow-owned mutation closeout is not an external map-maintenance handoff and is not external map maintenance. It is the workflow-local form of `\u002Fsp-map-update`. If this workflow changed project-related source, runtime, templates, generated assets, config, tests, state contracts, shared surfaces, or behavior-bearing docs, closeout MUST run inline project cognition update for the workflow-owned changed paths and affected surfaces before claiming clean completion.\n\nCall the planner first:\n\n```text\nproject-cognition closeout-plan --workflow \"$ACTIVE_WORKFLOW\" --format json\n```\n\nWhen `DELTA_SESSION_ID` exists, pass it into the planner:\n\n```text\nproject-cognition closeout-plan --workflow \"$ACTIVE_WORKFLOW\" --delta-session \"$DELTA_SESSION_ID\" --format json\n```\n\nConsume `workflow_canonical`, `update_mode`, `payload_draft`, `required_agent_fields`, `unknown_paths`, `unknown_path_dispositions`, `delta_append_draft`, display-only `delta_append_command`, `update_argv`, display-only `update_command`, and `recommended_next_command`.\n\nBefore running `update`, fill the fields listed in `required_agent_fields` from live evidence from this workflow. Supported agent-owned evidence fields include:\n\n- `verification`\n- `behavior_surfaces`\n- `generated_surfaces`\n- `state_contracts`\n- `known_unknowns`\n- `confidence_notes`\n- `user_decisions`\n- `boundary`\n\nIf a field appears in `required_agent_fields`, provide live-evidence-backed content for it. Fields not listed by `required_agent_fields`, such as `known_unknowns` and `boundary`, are populated only when live evidence supports them; do not invent them to satisfy the shape.\nUse `known_unknowns` only for blockers that make the cognition update unsafe to trust. If the working tree contains unrelated dirty\u002Funtracked paths and the workflow uses explicit workflow-owned paths, record that as `confidence_notes` or `boundary.initial_dirty_paths`, not as a blocking `known_unknowns` item.\n\nFor each `unknown_path_dispositions[]` item, set `agent_disposition` to exactly one allowed value:\n\n- `adoptable`: verified new path inside this workflow-owned scope; it may be recorded in changed\u002Fscope paths and verified adoptable paths do not become blocking `known_unknowns`.\n- `review_only`: path informed review but is not adopted into changed coverage.\n- `ignored`: path remains excluded and must not enter payloads, records, route indexes, evidence, aliases, or minimal live reads.\n- `blocking_known_unknown`: record it as a known unknown and report partial or blocked cognition closeout.\n\n`agent_disposition=adoptable` is an agent accounting decision, not proof that runtime indexing already succeeded. Runtime adoption still requires a usable active project-cognition DB, at least one passing verification evidence item, and no blocking `known_unknowns`. After `update_argv` runs, inspect `result_state`, `adopted_paths`, `review_paths`, `minimal_live_reads`, and `partial_refresh_reasons`; do not explain a remaining `partial_refresh` as \"path_index missing\" until those fields show which adoption gate failed.\n\nIf `update_mode=delta_session`, complete `delta_append_draft.argv_prefix` with agent-owned repeatable flags such as `--behavior-surface`, `--generated-surface`, `--verification`, and accepted `--known-unknown` values from `delta_append_draft.argv_placeholders`. Then append the delta event and run `update_argv`. `delta_append_command` and `update_command` are display-only placeholders, not execution strings.\n\nIf `update_mode=payload_file`, write the completed `payload_draft` to the planner's `payload_path`. Then run `update_argv`. `update_command` is a display-only placeholder, not an execution string.\n\nCompleted payload drafts preserve the planner-owned `changed_paths` and `scope_paths` and add agent-owned evidence fields before recording.\n\nStructured `update` invalidates related claims and returns their stable IDs in `affected_graph_claims`. This is separate from update readiness: generic workflow verification and `result_state=ready` must not re-promote stale or contradicted graph claims. Only when this workflow already has decisive claim-specific bounded live evidence for an exact returned claim ID may it submit semantic reconciliation intent and run:\n\n```text\nproject-cognition claim-reconcile prepare --input \u003Cintent.json> --format json\nproject-cognition claim-reconcile apply --input \u003Cprepared_packet_path> --format json\n```\n\nProvide only reconciliation intent: workflow, stable `claim_id`, reason, and evidence containing repository-relative `source_path`, bounded line `span`, and `supporting` or `contradicting` role. Add verification only when it is claim-specific. The runtime owns the contract version, active generation, expected state and revision, UTC observation and expiry, source kind, content hashes, repository snapshot, IDs, and prepared packet path. Do not author or edit those integrity fields; execute the returned `apply_argv` exactly. If no such evidence exists, leave the claim stale. If reconciliation returns ready, rerun Compass once so later routing consumes the current evidence basis; partial or blocked reconciliation remains withheld and follows `recommended_next_action`.\n\nFor compatibility with worker handoffs and delta packets, the runtime also accepts `verification_evidence` as an alias for `verification` and `generated_surface_notes` as an alias for `generated_surfaces`. Verification evidence may be an array of objects (`command`, `result`, `artifact`) or an array of command-result strings, but clean closeout still requires passing verification evidence; failed verification cannot produce a clean `ready` closeout.\n\nClean closeout keys on `result_state`, not `status=ok`, `update_id`, `last_update_id`, or freshness alone:\n\n- `ready` or `no_op`: project cognition closeout may be clean when ordinary verification also passed.\n- `partial_refresh`: useful update data was written, but the final workflow state must report partial cognition closeout, `partial_refresh_reasons`, and the returned `minimal_live_reads`. If `partial_refresh_reasons` includes `missing_passing_verification_result`, repair the payload or delta evidence and rerun `update_argv` before final closeout; do not route that to `sp-map-update`. If verified workflow-owned paths still remain in `review_paths` after the update, report implementation completion separately from project-cognition maintenance and name `\u002Fsp-map-update` as follow-up repair.\n- `needs_rebuild`: report the exact rebuild condition and route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`.\n- `blocked`: report the runtime or validation blocker and the exact recovery command.\n- `recorded`: legacy recorded-only output; treat it as partial or blocked, never as clean completion.\n\nNever run the `complete-refresh` or `clear-dirty` helper after `result_state=partial_refresh`, `needs_rebuild`, `blocked`, or legacy `recorded`; those helpers are only for states that the runtime and validation prove ready.\n\nDirty fallback command shape: `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe mark-dirty --reason \\\"\u003Creason>\\\" --format json`.\nUse `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe mark-dirty --reason \\\"workflow-closeout-failed\\\" --format json` only when inline update cannot complete: when the planner or update command is unavailable, cannot record useful update data, cannot identify workflow-owned scope, or cannot be trusted because verification\u002Fworkflow completion is not trustworthy. Dirty only when inline update cannot complete.\n\nsp-map-update is for manual\u002Fexternal maintenance and follow-up repair. `\u002Fsp-map-update` remains the external\u002Fmanual workflow for user edits, interrupted workflow repair, explicit map maintenance, and follow-up repair. It is not routine cleanup for changes this workflow just made. If `sp-map-update` already ran `project-cognition update --reason map-update` for the same changed paths, do not run a second `workflow-finalize` closeout update for those paths.\n\n## Presentation Contract\n\nWhen communicating findings and completion, use a structured terminal presentation built from open blocks with:\n\n- a stage header that identifies `clarify` and the current repair state\n- a status block that summarizes whether the spec package was strengthened, partially strengthened, or is waiting on user confirmation\n- an explanation block that explains what changed, which planning-critical gaps were reduced, and why it matters for planning\n- a risk block that lists unresolved planning risks, remaining contradictions, or evidence gaps\n- a next-step block that gives the recommended next command and whether more enhancement work is still needed before `\u002Fsp.plan`\n- when the package is still not planning-ready, the next-step block must avoid implying an automatic handoff to `\u002Fsp.plan`\n\n## Rules\n\n- Use the user's current language for user-visible output unless literal command names, file paths, or fixed status values must remain unchanged.\n- Do not re-run the entire `specify` flow from scratch unless the current spec is unusably wrong.\n- Prefer targeted enhancement over full restatement.\n- If new information materially changes scope or alignment, update `alignment.md` in the same pass.\n- Treat `\u002Fsp.clarify` as the default rescue lane and repair lane when planning-critical ambiguity remains after `\u002Fsp.specify`.\n- If high-impact ambiguity remains after enhancement, recommend another clarification pass instead of implying that `\u002Fsp.plan` is now safe.\n- If requirements are clear but feasibility is unproven, recommend `\u002Fsp.deep-research` instead of implying that `\u002Fsp.plan` is now safe.\n\n## Post-Execution Checks\n\n**Check for extension hooks (after clarification)**:\n- Check if `.specify\u002Fextensions.yml` exists in the project root.\n- If it exists, read it and look for entries under the `hooks.after_clarify` key.\n- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.\n- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.\n- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:\n  - If the hook has no `condition` field, or it is null\u002Fempty, treat the hook as executable.\n  - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation.\n- For each executable hook, output the following based on its `optional` flag:\n  - **Optional hook** (`optional: true`):\n    ```\n    ## Extension Hooks\n\n    **Optional Hook**: {extension}\n    Command: `\u002F{command}`\n    Description: {description}\n\n    Prompt: {prompt}\n    To execute: `\u002F{command}`\n    ```\n  - **Mandatory hook** (`optional: false`):\n    ```\n    ## Extension Hooks\n\n    **Automatic Hook**: {extension}\n    Executing: `\u002F{command}`\n    EXECUTE_COMMAND: {command}\n    ```\n- If no hooks are registered or `.specify\u002Fextensions.yml` does not exist, skip silently.\n\n## Claude Code Subagent Capability Discovery\n\n- Execution model: preserve the workflow's existing `subagent-mandatory`, `subagents-first`, `adaptive`, or `subagent-assisted` policy.\n- Dispatch shape: preserve the workflow's existing dispatch shape; use `subagent-blocked` only after the discovery step below fails or is unsafe.\n- Execution surface: prefer `native-subagents` when the current runtime supports it; use `none` only after recording the unavailable or unsafe surface.\n- Native subagent capability discovery: Before recording `subagent-blocked`, check the active tool surface for the integration-native subagent or task-dispatch entrypoint and record the exact missing surface if unavailable.\n- Do not record `subagent-blocked` until this capability discovery step is complete and the exact unavailable or unsafe surface is recorded.\n- Native subagent dispatch: Dispatch subagents through the integration's native subagent support using the shared prompt contract.\n- Join behavior: Use the integration-native join point, then integrate results back on the leader path.\n- Preserve this workflow's existing packet, handoff, artifact, and result schema; this section only governs capability discovery before dispatch or blocked-state recording.\n\n## Claude Code Structured Question Preference\n\n- If this command was routed by `sp-auto` with `auto_default_recommendation: true`, evaluate the automatic recommended\u002Fdefault continuation gate before any question path.\n- When that gate has one safe recommended\u002Fdefault answer, you must auto-resolve the question or confirmation, record the accepted recommendation in the workflow state or summary, continue the workflow, and do not invoke the native structured question tool only to ask for that approval.\n- If the automatic gate is not safe, write the blocker and self-unblock recommendation before using the normal question path.\n- If the runtime's native structured question tool is available for the current turn and the `sp-auto` automatic gate did not resolve the question, you must use it.\n- Do not render the textual fallback block when the native tool is available.\n- Do not self-authorize textual fallback because the question seems simple, short, or easy to phrase manually.\n- Treat the template's textual question format as fallback-only guidance; use it to shape the question content, but do not render the textual block unless the native tool is unavailable in the current runtime or the tool call fails.\n- Keep native-tool availability, runtime mode, and fallback mechanics backstage. Do not tell the user that a structured question tool is unavailable, that the current runtime\u002Fmode lacks a tool, or that a fallback is being used; ask the user-facing question directly when a question is genuinely required.\n- Ask only the minimum number of questions required by this workflow's existing contract.\n- Keep the user-visible question text in the user's current language and keep option labels short.\n- Do not emit both a native tool question and the textual fallback block in the same turn. The user should see the active question exactly once.\n- If the native tool is unavailable in the current runtime or the tool call fails, ask one concise plain-text confirmation question and continue with the existing enhancement flow.\n- In `clarify`, use this preference for:\n  - high-impact gap confirmation\n  - scope or constraint confirmation when enhancement changes planning readiness\n- Native tool target: `AskUserQuestion`\n- When this native tool target is listed for the integration and the runtime does not signal otherwise, assume it is available by default in normal interactive sessions.\n- Question count: 1-4 questions per call\n- Option count: 2-4 options per question\n- Required question fields: `question`, `header`, `options`, `multiSelect`\n- Option fields: `label`, `description`, `preview (optional)`\n- Use `multiSelect: false` unless the workflow explicitly needs multiple selections.\n- Use `metadata` only when tracking or analytics context adds value; otherwise keep the call minimal.\n",{"name":5,"metadata":24,"description":7,"argument-hint":27,"compatibility":28,"user-invocable":29},{"author":25,"source":26},"github-spec-kit","templates\u002Fcommands\u002Fclarify.md","Describe what in the current spec package needs deeper analysis or correction","Requires spec-kit project structure with .specify\u002F directory",true,"main","021f5cbe02157229460a577e9a585f2da6d78cb0",".claude\u002Fskills\u002Fsp-clarify","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck","https:\u002F\u002Fgithub.com\u002Fchenziyang110","2026-08-07 18:10:54",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":29},[38,41,44],{"tool":39,"command":40},"npx","npx skills add chenziyang110\u002Flaunchdeck --skill sp-clarify",{"tool":42,"command":43},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill sp-clarify",{"tool":45,"command":46},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill sp-clarify","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-clarify\u002FSKILL.md",[49,55],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002FINDEX.md","REFERENCE","参考文档",604,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-clarify\u002Freferences\u002FINDEX.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fsemantic-work-contract.md",32213,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-clarify\u002Freferences\u002Fsemantic-work-contract.md",[60,67,73,79,86,95],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7875F3HQ1GF5F6BR36KY3JE","launchdeck-agent","Codex host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fcodex\u002Fskill\u002FSKILL.md",[],[],{"skillNo":68,"name":62,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7875DV2DQR33K1NFJHKAMZP","Claude host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fclaude\u002Fskill\u002FSKILL.md",[],[],{"skillNo":74,"name":62,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M78759JQ7A6FQ8KDQTNYS3X9","Use this skill aggressively for local project lifecycle operations even when the user does not mention Launchdeck: start this project, run the dev server, dev, build, test, restart service, stop service, show logs, inspect ports, port is occupied, clean cache; and when the user explicitly asks to configure this local project for Launchdeck or create or generate a project-adapted `.launchdeck.yml`, including 为这个项目生成 Launchdeck 配置. Do not use for ordinary code edits, docs-only work, general explanations, API design discussion, or production deployment unless the user also asks to operate or configure a local project or service.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Fagent\u002Finstaller-payload\u002Fskill\u002Flaunchdeck-agent\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M78753ZJQ7G2CZT1W1G8WRJV","zig-testing","Use ONLY when user explicitly requests Zig test code, built-in test runner configuration,\ntest failure diagnosis, or coverage for Zig projects.\n\nTriggers: \"write test zig\", \"zig test\", \"testing.allocator\", \"zig coverage\",\n\"comptime test\", \"zig expectError\", \"zig snapshot test\", \"zig fuzz\".\n\nDo NOT activate for: general Zig coding without test context, build.zig configuration\nfor non-test targets, Zig compiler errors, or Zig build system setup.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fzig-testing\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":90,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M78750JXY4Z5D5W1EX3PQ31Z","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7874X2T83EQQFRCEY5SJJVC","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fverification-before-completion\u002FSKILL.md",[],[]]