[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7869P2VM8K4QSEQY4DBKWS1":3,"skill-same:01M7869P2VM8K4QSEQY4DBKWS1":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},"01M7869P2VM8K4QSEQY4DBKWS1","sp-analyze",null,"Use when tasks.md exists and you need a non-destructive cross-artifact consistency and boundary-guardrail analysis before or during execution.","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-analyze\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"sp-analyze\"\ndescription: \"Use when tasks.md exists and you need a non-destructive cross-artifact consistency and boundary-guardrail analysis before or during execution.\"\nargument-hint: \"Optional focus areas for analysis, such as boundary guardrail drift (BG1\u002FBG2\u002FBG3)\"\ncompatibility: \"Requires spec-kit project structure with .specify\u002F directory\"\nmetadata:\n  author: \"github-spec-kit\"\n  source: \"templates\u002Fcommands\u002Fanalyze.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**: `tasks.md` is available and you need a read-only analysis pass before, during, or after implementation revalidation.\n- **Primary objective**: Identify inconsistencies, ambiguities, drift, and boundary-guardrail gaps across `spec.md`, `context.md`, `plan.md`, and `tasks.md`.\n- **Primary outputs**: A structured analysis report plus workflow-state gate updates. This command does not edit `spec.md`, `context.md`, `plan.md`, or `tasks.md`.\n- **Default handoff**: Route into \u002Fsp.clarify, \u002Fsp.deep-research, \u002Fsp.plan, \u002Fsp.tasks, \u002Fsp.debug, or \u002Fsp.implement based on the findings; if analysis runs after implementation has started or finished, reopen the highest invalid stage and regenerate downstream artifacts before continuing.\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\nPerform a read-only analysis pass that checks whether the current spec, context, plan, and task artifacts still agree strongly enough to support execution.\n\n## Context\n\n- Primary inputs: `spec.md`, `context.md`, `plan.md`, `tasks.md`, passive learning files, the task-local project cognition query bundle with readiness and returned `minimal_live_reads`, and the smallest workflow-local state files needed for the touched area.\n- Treat `spec-contract.json`, `plan-contract.json`, and `task-index.json` as the phase authorities. When delegation occurred, inspect the compact `planning\u002Flane-manifest.json` or `task-generation\u002Flane-manifest.json` and only the accepted lane results needed to verify downstream consumption. Read clarification evidence only when analysis routes back to clarification.\n- The constitution remains the highest local authority for this analysis surface.\n- This command produces findings only; it does not rewrite the artifact set.\n\n## Process\n\n- Load the minimum artifact context needed to evaluate the current request.\n- Compare the planning artifacts for drift, ambiguity, missing constraints, and boundary-guardrail gaps.\n- Verify every accepted delegated lane result named by a compact manifest was consumed into the downstream canonical contract rather than only preserved on disk.\n- Classify findings by severity and report how they should feed back into the workflow.\n\n## Output Contract\n\n- Emit a structured analysis report with concrete findings, severity, and recommended remediation lanes.\n- Keep the result non-destructive and explicit about what command should handle each class of issue.\n- Do not silently fix artifacts from inside `\u002Fsp-analyze`.\n\n## Guardrails\n\n- Stay read-only.\n- Treat constitution conflicts as critical rather than negotiable.\n- Do not rely on stale or insufficient project cognition query coverage when the runtime should inform the analysis.\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## Goal\n\nIdentify inconsistencies, duplications, ambiguities, and underspecified items across the core planning artifacts (`spec.md`, `context.md`, `plan.md`, `tasks.md`) before implementation, during execution, or after implementation when revalidation is needed. This command MUST run only after the canonical `\u002Fsp.tasks` workflow has successfully produced a complete `tasks.md`.\n\n## Operating Constraints\n\n**READ-ONLY FOR PLANNING ARTIFACTS**: Do **not** modify `spec.md`, `context.md`, `plan.md`, or `tasks.md`. Output a structured analysis report. This command may update `workflow-state.md` to record the cleared or blocked gate result. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).\n\nAnalyze must not switch branches, implicitly check out a \"correct\" feature branch, or mutate git state in order to determine scope. If the active feature cannot be identified safely through explicit `FEATURE_DIR` binding or lane resolution, fail closed and tell the user how to repair routing.\n\n**Closed-loop requirement**: Do not present findings as a dead-end audit. The report MUST tell the user which workflow stage to reopen, which downstream artifacts must be regenerated, and whether implementation may continue immediately or must pause until upstream remediation is complete.\nPreserve canonical `\u002Fsp.implement` only in workflow-state fields.\nWhen recommending manual implementation resumption to the user, tell them to run `\u002Fsp-implement`.\n\n**Convergence requirement**: Complete the full detection matrix before selecting the single `Recommended Next Command`. Do not stop analysis after finding enough evidence to route backward. The report must include the complete blocker bundle for the current artifact set, grouped by invalid stage, so downstream remediation does not discover same-artifact blockers one cycle at a time.\n\n**Constitution Authority**: The project constitution (`.specify\u002Fmemory\u002Fconstitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `\u002Fsp.analyze`.\n\n## Workflow Phase Lock\n\n- [AGENT] Create or resume `WORKFLOW_STATE_FILE` before substantial analysis work begins.\n- Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n- If `WORKFLOW_STATE_FILE` is missing, recreate it from the template and the current artifact package instead of relying on chat memory alone.\n- Treat `WORKFLOW_STATE_FILE` as the gate-state source of truth for whether implementation may proceed.\n- Set or update the state for this run with at least:\n  - `active_command: sp-analyze`\n  - `phase_mode: analysis-only`\n  - `forbidden_actions: edit source code, edit tests, edit planning artifacts, start implementation before the gate is cleared`\n- When resuming after compaction, re-read `WORKFLOW_STATE_FILE` before continuing.\n\n## Analyze Gate Convergence Contract\n\n### Stable Finding Identity\n\n- Use stable finding IDs that survive revalidation. Category-only IDs such as `BG2` are too coarse, and run-local sequence numbers are not stable by themselves.\n- Use a fingerprint-first ID contract:\n  - Build a canonical finding fingerprint from category, invalid stage, artifact, requirement or section key when available, normalized summary, and remediation requirement.\n  - Before assigning IDs, load the previous `Analyze Gate` ledger from `workflow-state.md` when it exists.\n  - Match current findings to previous open or recently cleared findings by fingerprint first, and reuse the prior ID when the fingerprint matches.\n  - Allocate a new ID only for a genuinely new fingerprint.\n  - For new fingerprints, allocate the next unused category sequence after sorting by category, artifact, section key, and normalized summary.\n\n### Revalidation Attribution\n\n- When revalidating after a blocked analyze gate, any new blocker must include one attribution:\n  - `missed_by_previous_analyze`: detectable in the prior artifact set and should have been included in the earlier blocker bundle.\n  - `introduced_by_remediation`: remediation changed `tasks.md` or downstream state in a way that introduced the issue.\n  - `upstream_artifact_changed`: an authoritative input changed since the prior analyze pass.\n  - `detector_scope_changed`: the workflow template or analysis instructions changed the detector scope between runs.\n- If there is no evidence for `introduced_by_remediation`, `upstream_artifact_changed`, or `detector_scope_changed`, use `missed_by_previous_analyze`.\n- Persist attribution per new blocking finding in the `Analyze Gate` `blocker_bundle`; report-body attribution without durable blocker-row attribution is not sufficient for revalidation.\n- No more than one task-layer remediation cycle is expected. If revalidation finds new task-layer blockers that were detectable before remediation, classify them as a previous analyze miss or a tasks self-audit failure. Do not treat repeated task\u002Fanalyze loops as normal workflow.\n\n## Workflow Quality Requirements\n\n- Confirm project cognition freshness and valid workflow entry before deeper analysis begins.\n- Keep `workflow-state.md` current as the durable gate-state source of truth for whether implementation may proceed, which stage must reopen, and what evidence supports the decision.\n- Verify the analysis report, cleared or blocked gate result, and any durable artifact outcomes before final reporting instead of relying on chat narration.\n- Update durable analysis state before compaction-risk transitions, large findings synthesis, remediation handoffs, or any stop where resume will depend on more than the visible conversation.\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\n## Execution Steps\n\n### 1. Initialize Analysis Context\n\nRun `.specify\u002Fscripts\u002Fpowershell\u002Fcheck-prerequisites.ps1 -Json -RequireTasks -IncludeTasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:\n\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 analyze --ensure-worktree` before guessing from branch-only context.\n- When lane resolution returns a materialized lane worktree, continue analysis from that isolated worktree context so downstream gate decisions stay attached to the same lane boundary.\n\n- SPEC_CONTRACT = FEATURE_DIR\u002Fspec-contract.json\n- PLAN_CONTRACT = FEATURE_DIR\u002Fplan-contract.json\n- TASK_INDEX = FEATURE_DIR\u002Ftask-index.json for standard\u002Fheavy work, otherwise TASKS = FEATURE_DIR\u002Ftasks.md\n- PLANNING_LANE_MANIFEST = FEATURE_DIR\u002Fplanning\u002Flane-manifest.json when present\n- TASK_GENERATION_LANE_MANIFEST = FEATURE_DIR\u002Ftask-generation\u002Flane-manifest.json when present\n\nAbort with an error message if any required file is missing (instruct the user to run missing prerequisite command).\nFor single quotes in args like \"I'm Groot\", use escape syntax: e.g 'I'\\''m Groot' (or double-quote if possible: \"I'm Groot\").\n\n- Set `WORKFLOW_STATE_FILE` to `FEATURE_DIR\u002Fworkflow-state.md`.\n- [AGENT] Create or resume `WORKFLOW_STATE_FILE` before substantial analysis work begins.\n- Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n- If `WORKFLOW_STATE_FILE` already exists, read it first and preserve still-valid authoritative file references and gate notes instead of relying on chat memory alone.\n\n### 2. Ensure project cognition runtime exists\n\n- Choose the cognition intent before querying: use `plan` when analyzing planning-only artifacts or upstream spec\u002Fplan drift, use `implement` when analyzing task execution, remediation, or code-change blockers, and preserve the originating workflow intent when this command is reviewing another `sp-*` workflow's output.\n- Query project cognition with `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent plan --query=\\\"$ARGUMENTS\\\" --format json` or `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent implement --query=\\\"$ARGUMENTS\\\" --format json` according to that chosen intent. Read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons, `verification_hints`, `followup_surfaces`, and `before_fix_claim`. Treat `coverage_diagnostics` as confidence and closeout signals, do not infer final edit scope from first-pass reads, and use `project-cognition expand` only when the packet's coverage state or live evidence requires it.\n- Preserve the advanced `lexicon -> semantic_intake -> query` flow for explicit concept decisions or unresolved coverage. In that escalation, write `semantic_intake` from the alias catalog, select candidates by facet coverage, write `concept_decisions` with `covered_facets`, `missing_facets`, and `match_sources`, carry `lexicon_generation_id`, then generate a `query_plan` containing `semantic_intake`, `selected_concepts`, `rejected_concepts`, `concept_decisions`, `lexicon_generation_id`, `expanded_queries`, `repository_search_terms`, and justified `paths`, then run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe query --intent \u003Cchosen-intent> --query-plan \\\"\u003Cquery_plan_json>\\\" --format json`. Agent-owned semantic normalization is mandatory: raw lexicon ranking and `agent_normalization` are only bootstrap signals, not route decisions. If `agent_normalization.required=true`, every raw candidate is `score=0`, or the prompt is localized, mixed-language, CJK, colloquial, or symptom-first, extract embedded project terms and write `semantic_intake` from the alias catalog before selecting or rejecting concepts. If `agent_normalization` is omitted, treat it as `required=false`; CJK or mixed CJK\u002FASCII input still requires agent normalization even when positive raw lexical matches exist because embedded project tokens do not translate the surrounding user language. The agent still owns translation; `agent_normalization` is advisory guidance, not a route decision. This includes mixed-language or CJK text. (raw lexicon ranking is only a bootstrap; action: write_semantic_intake_from_alias_catalog) Derive project-language search terms from the alias catalog before source search. Do not search only the raw user words; include component names, state names, file names, command names, UI labels, and route names from candidates, aliases, matched_terms, colloquial_matches, returned paths, `normalized_query`, and `expanded_queries`. Use these project-language search terms before broad repository search. For implementation or remediation analysis, the concrete advanced query command is `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe query --intent implement --query-plan \\\"\u003Cquery_plan_json>\\\" --format json`.\n- If readiness is `needs_rebuild`, continue with live repository evidence where workflow policy allows and recommend `\u002Fsp-map-scan`, then `\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, missing or invalid alias_index, explicit_rebuild_requested, or baseline_identity_invalid. Block only when the user explicitly requested cognition repair or analysis truly cannot proceed without a usable baseline.\n- If compass coverage is too weak for the touched area, use live evidence and record whether a follow-up `\u002Fsp-map-update` is useful for external map maintenance.\n- Use map-update for ordinary existing-baseline gaps. Use map-scan -> map-build only for first\u002Fmissing\u002Funusable baseline, schema failure, schema v1 or old broad-schema rebuild-required readiness, zero active-generation path_index rows, missing or invalid alias_index, explicit_rebuild_requested, or baseline_identity_invalid.\n- If readiness is `review`, inspect only the returned `minimal_live_reads` before trusting the runtime for analysis.\n- Carry selected\u002Frejected concepts, `selection_reason`, `route_pack`, and\n  `minimal_live_reads` into the analysis report and `workflow-state.md`\n  blocker bundle whenever cognition evidence affects routing or blocker\n  severity.\n- Treat task-relevant coverage as insufficient when the touched area is named only vaguely, lacks ownership or placement guidance, or lacks workflow, constraint, integration, or regression-sensitive testing guidance.\n- If task-relevant coverage is insufficient for the current analysis request, inspect the returned targeted live evidence; refresh through `\u002Fsp-map-update` with changed paths or affected surfaces, and rebuild through `\u002Fsp-map-scan`, then `\u002Fsp-map-build` only for the explicit rebuild conditions above.\n\n### 3. Load Artifacts (Progressive Disclosure)\n\nLoad only the minimal necessary context from each artifact:\n\n**From project cognition runtime:**\n\n- Consume the `project-cognition query` bundle.\n- Preserve `selected_concepts`, `rejected_concepts`, `selection_reason`,\n  `route_pack`, and `minimal_live_reads` as blocker evidence inputs.\n- Preserve cognition-backed blocker evidence when classifying whether issues\n  belong to `plan`, `clarify`, `deep-research`, or task-layer remediation. The\n  analysis report and `workflow-state.md` blocker bundle must keep the selected\n  capability, boundary fact, ambiguity, or verification evidence that justified\n  the route.\n- Inspect only returned `minimal_live_reads` when the bundle does not fully cover ownership, propagation, or verification routes.\n- If topical coverage is missing, stale, too broad, or task-relevant coverage is insufficient, use `\u002Fsp-map-update` with changed paths or affected surfaces; rebuild through `\u002Fsp-map-scan` followed by `\u002Fsp-map-build` only for the explicit rebuild conditions above, then inspect the minimum live files still needed to replace guesswork with evidence\n\n**From spec-contract.json first (open spec.md\u002Fcontext.md only for a named detail or contradiction):**\n\n- Overview\u002FContext\n- Functional Requirements\n- Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)\n- User Stories\n- Edge Cases (if present)\n\n**From conditional context view when referenced:**\n\n- Locked Decisions\n- Claude Discretion\n- Canonical References\n- Existing Code Insights\n- Specific User Signals\n- Outstanding Questions\n\n**From plan-contract.json first (open plan.md or conditional design artifacts only for a named detail or contradiction):**\n\n- Architecture\u002Fstack choices\n- Locked Planning Decisions\n- Implementation Constitution\n- Alignment Inputs\n- Data Model references\n- Phases\n- Technical constraints\n\n**From task-index.json, or tasks.md for light direct work:**\n\n- Task IDs\n- Descriptions\n- Phase grouping\n- Parallel markers [P]\n- Referenced file paths\n\n**From delegated planning lanes when present:**\n\n- Read `planning\u002Flane-manifest.json` and only the accepted lane results it names.\n- Verify each accepted result is consumed by `plan-contract.json` or a referenced conditional artifact, or is explicitly deferred or blocked.\n- Treat an accepted planning handoff with no downstream consumer as a plan-layer blocker, not harmless leftover evidence.\n\n**From delegated task-generation lanes when present:**\n\n- Read `task-generation\u002Flane-manifest.json` and only the accepted lane results it names.\n- Verify each accepted result is consumed by `task-index.json` or the light direct task list, or is explicitly deferred, escalated, or blocked.\n- Treat an accepted task-generation handoff with no downstream consumer as a task-layer blocker before implementation can proceed.\n\n**From constitution:**\n\n- Load `.specify\u002Fmemory\u002Fconstitution.md` for principle validation\n\n### 4. Build Semantic Models\n\nCreate internal representations (do not include raw artifacts in output):\n\n- **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-\u002FSC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., \"User can upload file\" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., \"Reduce support tickets by 50%\").\n- **Locked decision inventory**: Collect locked decisions from `spec.md`, `context.md`, and `plan.md`, then track whether each one survives into the task layer\n- **Reference behavior inventory**: When `Fidelity Requirements` exist, collect each reference behavior item and track whether it survives into the plan and task layers\n- **Boundary-sensitivity inventory**: Record established boundary patterns, framework-owned surfaces, required implementation references, and any signal that this feature should carry explicit implementation guardrails\n- **User story\u002Faction inventory**: Discrete user actions with acceptance criteria\n- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword \u002F explicit reference patterns like IDs or key phrases)\n- **Constitution rule set**: Extract principle names and MUST\u002FSHOULD normative statements\n\n### 5. Detection Passes (Token-Efficient Analysis)\n\nFocus on high-signal findings in the report body and include every unique actionable finding. Repetitive non-blocking observations may be grouped only when the group preserves their evidence, owner, and repair route. Never omit blockers from the durable gate result: `Blocker Bundle` and `workflow-state.md` MUST enumerate every blocking finding.\n\n#### A. Duplication Detection\n\n- Identify near-duplicate requirements\n- Mark lower-quality phrasing for consolidation\n\n#### B. Ambiguity Detection\n\n- Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria\n- Flag unresolved placeholders (TODO, TKTK, ???, `\u003Cplaceholder>`, etc.)\n\n#### C. Underspecification\n\n- Requirements with verbs but missing object or measurable outcome\n- User stories missing acceptance criteria alignment\n- Tasks referencing files or components not defined in spec\u002Fplan\n\n#### D. Constitution Alignment\n\n- Any requirement or plan element conflicting with a MUST principle\n- Missing mandated sections or quality gates from constitution\n\n#### E. Coverage Gaps\n\n- Requirements with zero associated tasks\n- Tasks with no mapped requirement\u002Fstory\n- Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks\n- Preserved or redesigned reference behavior items with zero associated plan handling or task coverage\n\n#### F. Locked Decision Drift\n\n- Locked decisions present in `spec.md` but absent from `context.md`\n- Locked decisions present in `context.md` but missing from `plan.md`\n- Locked decisions present in `plan.md` but not preserved by `tasks.md`\n- Cases where a decision appears to have been silently weakened, deferred, or renamed without acknowledgment\n\n#### G. Inconsistency\n\n- Terminology drift (same concept named differently across files)\n- Data entities referenced in plan but absent in spec (or vice versa)\n- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)\n- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)\n\n#### H. Boundary Guardrail Gaps\n\n- Detect cases where `spec.md`, `context.md`, or `tasks.md` clearly imply a boundary-sensitive implementation area, but later workflow artifacts fail to preserve the needed guardrails\n- Use this stable issue family so downstream tooling and reviewers can key off one consistent signal set:\n  - `BG1`: missing `Implementation Constitution` for a boundary-sensitive feature area\n  - `BG2`: `tasks.md` lacks explicit implementation guardrails even though `plan.md` declares a boundary-sensitive constitution rule\n  - `BG3`: implementation guidance does not require confirming the owning framework, defining reference files, or forbidden drift before code-writing work begins\n  - `DP1`: subagent execution path lacks compiled hard rules, validation gates, or done criteria in its task packet\n  - `DP2`: subagent execution path lacks required references or forbidden drift in its task packet\n  - `DP3`: subagent completion lacks required validation evidence or rule acknowledgement\n- Treat these signals as triggers:\n  - established framework-owned boundary or adapter pattern\n  - native bridge, plugin surface, protocol seam, generated API surface, or other contract-heavy boundary\n  - explicit required implementation references or boundary-defining files\n  - implementation guardrail tasks in `tasks.md` with no matching constitution rule in `plan.md`\n- Map findings to codes as follows:\n  - `BG1` when the plan is missing the constitution layer\n  - `BG2` when the task layer fails to preserve that constitution as implementation guardrails\n  - `BG3` when execution guidance fails to force pre-dispatch boundary confirmation\n- Report when a generic implementation instinct would likely drift away from the repository's established pattern because the plan left the constraint as background context only\n\n#### I. Consequence Preservation Analysis\n\n- Detect every `CA-###` consequence obligation in `spec.md`, `context.md`, `references.md`, `alignment.md`, `plan.md`, `tasks.md`, `plan-contract.json`, `task-index.json`, and task packets when present.\n- Verify each consequence obligation keeps its claim, affected objects, lifecycle state behavior, dependency impact, recovery and validation contract, owner workflow, latest resolve phase, status, and stop-and-reopen condition across downstream artifacts.\n- Flag any obligation that disappears, is renamed without traceability, loses validation evidence, lacks task or packet coverage, or is treated as resolved without proof.\n- Must not drop consequence obligations from the analysis report or blocker bundle. If an upstream artifact omitted one, report the omission and route to the highest invalid workflow stage that can restore it.\n- Treat unresolved or unmapped `CA-###` obligations as blockers when implementation would otherwise continue through lifecycle, running-state, destructive-operation, shared-state, or downstream-consumer ambiguity.\n- If the consequence model is complete and every stop-and-reopen condition is mapped or resolved, record the gate as cleared for implementation; otherwise keep implementation paused.\n\n### 6. Severity Assignment\n\nUse this heuristic to prioritize findings:\n\n- **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality\n- **HIGH**: Duplicate or conflicting requirement, ambiguous security\u002Fperformance attribute, untestable acceptance criterion, a locked decision silently dropped between artifacts, or a missing `Implementation Constitution` for a clearly boundary-sensitive feature area\n- **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case\n- **LOW**: Style\u002Fwording improvements, minor redundancy not affecting execution order\n\n### 7. Produce Compact Analysis Report\n\nOutput a Markdown report (no file writes) with the following structure:\n\n## Specification Analysis Report\n\n| ID | Signal Code | Category | Severity | Location(s) | Summary | Recommendation |\n|----|-------------|----------|----------|-------------|---------|----------------|\n| A1-001 | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |\n| BG1-001 | BG1 | Boundary Guardrail Gap | HIGH | plan.md, tasks.md | Boundary-sensitive area lacks `Implementation Constitution` in the plan | Re-run `\u002Fsp-plan` to add the constitution, then `\u002Fsp-tasks` if guardrail tasks need regeneration |\n| BG2-001 | BG2 | Boundary Guardrail Gap | HIGH | tasks.md | Plan declares a boundary-sensitive constitution rule, but tasks do not preserve it as implementation guardrails | Re-run `\u002Fsp-tasks` or edit `tasks.md` so guardrail tasks exist before setup or feature work |\n| BG3-001 | BG3 | Boundary Guardrail Gap | HIGH | implement guidance | Execution guidance does not force boundary confirmation before code-writing work starts | Update implementation guidance so the owning framework, required references, and forbidden drift are confirmed before dispatch |\n| DP1-001 | DP1 | Dispatch Packet Gap | HIGH | implement guidance, runtime payload | Delegated execution path is missing compiled hard rules, validation gates, or done criteria | Compile and validate a `WorkerTaskPacket` before dispatch |\n| DP2-001 | DP2 | Dispatch Packet Gap | HIGH | plan.md, tasks.md, runtime payload | Delegated execution path is missing required references or forbidden drift | Add packet references\u002Fforbidden drift to planning artifacts, then recompile |\n| DP3-001 | DP3 | Dispatch Result Gap | HIGH | subagent result, join point | Subagent completion lacks validation evidence or rule acknowledgement | Reject the subagent result and require a packet-compliant rerun |\n\n(Add one row per finding. Each row uses a stable fingerprint-first finding ID, and keeps BG\u002FDP values as signal codes where applicable.)\n\n**Blocker Bundle:**\n\nThe `Blocker Bundle` MUST enumerate every blocking finding. Do not hide blocking findings inside grouped summaries.\n\n| Invalid Stage | Blocking Finding IDs | Required Re-entry | Notes |\n|---------------|----------------------|-------------------|-------|\n| clarify | [IDs or none] | `\u002Fsp-clarify` | Reopen spec\u002Fcontext truth, then regenerate downstream artifacts |\n| deep-research | [IDs or none] | `\u002Fsp-deep-research` | Prove unresolved implementation chain before planning |\n| plan | [IDs or none] | `\u002Fsp-plan` | Repair planning truth, then regenerate tasks |\n| tasks | [IDs or none] | `\u002Fsp-tasks` | Repair task decomposition and rerun analyze |\n| execution-only | [IDs or none] | `\u002Fsp-implement` or `\u002Fsp-debug` | No upstream artifact regeneration required |\n\n**Coverage Summary Table:**\n\n| Requirement Key | Has Task? | Task IDs | Notes |\n|-----------------|-----------|----------|-------|\n\n**Locked Decision Preservation Table:**\n\n| Locked Decision | In Context? | In Plan? | In Tasks? | Notes |\n|-----------------|-------------|----------|-----------|-------|\n\n**Reference Behavior Preservation Table:** (if any)\n\n| Behavior ID | In Spec Fidelity? | In Plan? | In Tasks? | Notes |\n|-------------|-------------------|----------|-----------|-------|\n\n**Boundary Guardrail Table:** (if any)\n\n| Boundary Signal | Seen In Spec\u002FContext? | Seen In Plan Constitution? | Seen In Tasks Guardrails? | Notes |\n|-----------------|-----------------------|----------------------------|---------------------------|-------|\n\n**Constitution Alignment Issues:** (if any)\n\n**Unmapped Tasks:** (if any)\n\n**Metrics:**\n\n- Total Requirements\n- Total Tasks\n- Coverage % (requirements with >=1 task)\n- Ambiguity Count\n- Duplication Count\n- Critical Issues Count\n- Boundary Guardrail Gap Count\n\n### 8. Provide Next Actions\n\nAt the end of the report, output exactly one `Recommended Next Command` based on the highest invalid workflow stage.\n\n- If the highest-impact unresolved issue lives in `spec.md` or `context.md`, `Recommended Next Command` MUST be `\u002Fsp-clarify`.\n- If the highest-impact unresolved issue is a clear requirement whose implementation chain is still unproven, `Recommended Next Command` MUST be `\u002Fsp-deep-research`.\n- If the highest-impact unresolved issue lives in `plan.md`, `Recommended Next Command` MUST be `\u002Fsp-plan`.\n- If the highest-impact unresolved issue lives only in `tasks.md`, `Recommended Next Command` MUST be `\u002Fsp-tasks`.\n- If no upstream artifact is invalid and the remaining issue is execution-only, `Recommended Next Command` MUST be `\u002Fsp-implement` or `\u002Fsp-debug`, whichever matches the recorded execution problem.\n- Do not output multiple alternative next commands for the same analysis result.\n\n### 9. Define Workflow Re-entry\n\nAfter `Next Actions`, output a short `Recommended Re-entry` block that names:\n- the single highest workflow stage that must be reopened\n- the minimum downstream regeneration path from that stage\n\nRules:\n- If the highest invalid stage is `clarify`, the re-entry chain MUST be `\u002Fsp-clarify -> \u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `deep-research`, the re-entry chain MUST be `\u002Fsp-deep-research -> \u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `plan`, the re-entry chain MUST be `\u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `tasks`, the re-entry chain MUST be `\u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the remaining issue is execution-only, the re-entry chain MUST begin at `\u002Fsp-implement` or `\u002Fsp-debug`.\n- Do not output multiple alternative re-entry chains for the same result.\n\n### 9.5 Persist Workflow Gate Result\n\nBefore the final completion text, write or update `WORKFLOW_STATE_FILE` so it records the gate outcome:\n\nAlways update or preserve the `Analyze Gate` section in `WORKFLOW_STATE_FILE` with:\n- `gate_status: cleared | blocked`\n- `gate_cycle: [integer]`\n- `highest_invalid_stage: clarify | deep-research | plan | tasks | execution-only | none`\n- `blocker_bundle: [finding ID | invalid stage | status | attribution | compact summary | remediation requirement]`\n- `artifact_fingerprint_basis: [spec.md\u002Fcontext.md\u002Fplan.md\u002Ftasks.md summaries or hashes when available]`\n\nWhen revalidation finds a new blocker, record its attribution on that `blocker_bundle` row using `missed_by_previous_analyze`, `introduced_by_remediation`, `upstream_artifact_changed`, or `detector_scope_changed`.\n\n- When no upstream remediation is required, record the analyze gate as cleared and hand off to implementation.\n- If no upstream remediation is required:\n  - `active_command: sp-analyze`\n  - `phase_mode: analysis-only`\n  - `status: completed`\n  - `next_action: begin implementation from the cleared execution batch`\n  - `next_command: \u002Fsp.implement`\n- If the highest invalid stage is `spec.md` or `context.md`:\n  - `next_action: reopen specification alignment and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.clarify`\n- If the constitution itself must change:\n  - `next_action: amend project principles first, then reopen the highest affected downstream stage and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.constitution`\n- If the highest invalid stage is `plan.md`:\n  - `next_action: reopen planning and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.plan`\n- If the highest invalid stage is only `tasks.md`:\n  - `next_action: regenerate task decomposition before implementation resumes`\n  - `next_command: \u002Fsp.tasks`\n- If execution evidence must be repaired without upstream artifact drift:\n  - `next_action: resume execution-side recovery with the recorded blocker context`\n  - `next_command: \u002Fsp.implement` or `\u002Fsp.debug` as justified by the report\n\n### 10. Offer Remediation\n\nAsk the user: \"Would you like me to draft concrete remediation edits and the exact workflow re-entry path for the top N issues?\" (Do NOT apply them automatically.)\n\n## Operating Principles\n\n### Context Efficiency\n\n- **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation\n- **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis\n- **Signal-efficient output**: Include every unique actionable finding; group only genuinely repetitive non-blocking observations without losing evidence, ownership, or repair routes\n- **Deterministic results**: Rerunning without changes should produce consistent IDs and counts\n\n### Analysis Guidelines\n\n- **NEVER modify files** (this is read-only analysis)\n- **NEVER hallucinate missing sections** (if absent, report them accurately)\n- **Prioritize constitution violations** (these are always CRITICAL)\n- **Use examples over exhaustive rules** (cite specific instances, not generic patterns)\n- **Report zero issues gracefully** (emit success report with coverage statistics)\n\nIf 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## Invocation Context\n\n$ARGUMENTS\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","## 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**: `tasks.md` is available and you need a read-only analysis pass before, during, or after implementation revalidation.\n- **Primary objective**: Identify inconsistencies, ambiguities, drift, and boundary-guardrail gaps across `spec.md`, `context.md`, `plan.md`, and `tasks.md`.\n- **Primary outputs**: A structured analysis report plus workflow-state gate updates. This command does not edit `spec.md`, `context.md`, `plan.md`, or `tasks.md`.\n- **Default handoff**: Route into \u002Fsp.clarify, \u002Fsp.deep-research, \u002Fsp.plan, \u002Fsp.tasks, \u002Fsp.debug, or \u002Fsp.implement based on the findings; if analysis runs after implementation has started or finished, reopen the highest invalid stage and regenerate downstream artifacts before continuing.\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\nPerform a read-only analysis pass that checks whether the current spec, context, plan, and task artifacts still agree strongly enough to support execution.\n\n## Context\n\n- Primary inputs: `spec.md`, `context.md`, `plan.md`, `tasks.md`, passive learning files, the task-local project cognition query bundle with readiness and returned `minimal_live_reads`, and the smallest workflow-local state files needed for the touched area.\n- Treat `spec-contract.json`, `plan-contract.json`, and `task-index.json` as the phase authorities. When delegation occurred, inspect the compact `planning\u002Flane-manifest.json` or `task-generation\u002Flane-manifest.json` and only the accepted lane results needed to verify downstream consumption. Read clarification evidence only when analysis routes back to clarification.\n- The constitution remains the highest local authority for this analysis surface.\n- This command produces findings only; it does not rewrite the artifact set.\n\n## Process\n\n- Load the minimum artifact context needed to evaluate the current request.\n- Compare the planning artifacts for drift, ambiguity, missing constraints, and boundary-guardrail gaps.\n- Verify every accepted delegated lane result named by a compact manifest was consumed into the downstream canonical contract rather than only preserved on disk.\n- Classify findings by severity and report how they should feed back into the workflow.\n\n## Output Contract\n\n- Emit a structured analysis report with concrete findings, severity, and recommended remediation lanes.\n- Keep the result non-destructive and explicit about what command should handle each class of issue.\n- Do not silently fix artifacts from inside `\u002Fsp-analyze`.\n\n## Guardrails\n\n- Stay read-only.\n- Treat constitution conflicts as critical rather than negotiable.\n- Do not rely on stale or insufficient project cognition query coverage when the runtime should inform the analysis.\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## Goal\n\nIdentify inconsistencies, duplications, ambiguities, and underspecified items across the core planning artifacts (`spec.md`, `context.md`, `plan.md`, `tasks.md`) before implementation, during execution, or after implementation when revalidation is needed. This command MUST run only after the canonical `\u002Fsp.tasks` workflow has successfully produced a complete `tasks.md`.\n\n## Operating Constraints\n\n**READ-ONLY FOR PLANNING ARTIFACTS**: Do **not** modify `spec.md`, `context.md`, `plan.md`, or `tasks.md`. Output a structured analysis report. This command may update `workflow-state.md` to record the cleared or blocked gate result. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).\n\nAnalyze must not switch branches, implicitly check out a \"correct\" feature branch, or mutate git state in order to determine scope. If the active feature cannot be identified safely through explicit `FEATURE_DIR` binding or lane resolution, fail closed and tell the user how to repair routing.\n\n**Closed-loop requirement**: Do not present findings as a dead-end audit. The report MUST tell the user which workflow stage to reopen, which downstream artifacts must be regenerated, and whether implementation may continue immediately or must pause until upstream remediation is complete.\nPreserve canonical `\u002Fsp.implement` only in workflow-state fields.\nWhen recommending manual implementation resumption to the user, tell them to run `\u002Fsp-implement`.\n\n**Convergence requirement**: Complete the full detection matrix before selecting the single `Recommended Next Command`. Do not stop analysis after finding enough evidence to route backward. The report must include the complete blocker bundle for the current artifact set, grouped by invalid stage, so downstream remediation does not discover same-artifact blockers one cycle at a time.\n\n**Constitution Authority**: The project constitution (`.specify\u002Fmemory\u002Fconstitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `\u002Fsp.analyze`.\n\n## Workflow Phase Lock\n\n- [AGENT] Create or resume `WORKFLOW_STATE_FILE` before substantial analysis work begins.\n- Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n- If `WORKFLOW_STATE_FILE` is missing, recreate it from the template and the current artifact package instead of relying on chat memory alone.\n- Treat `WORKFLOW_STATE_FILE` as the gate-state source of truth for whether implementation may proceed.\n- Set or update the state for this run with at least:\n  - `active_command: sp-analyze`\n  - `phase_mode: analysis-only`\n  - `forbidden_actions: edit source code, edit tests, edit planning artifacts, start implementation before the gate is cleared`\n- When resuming after compaction, re-read `WORKFLOW_STATE_FILE` before continuing.\n\n## Analyze Gate Convergence Contract\n\n### Stable Finding Identity\n\n- Use stable finding IDs that survive revalidation. Category-only IDs such as `BG2` are too coarse, and run-local sequence numbers are not stable by themselves.\n- Use a fingerprint-first ID contract:\n  - Build a canonical finding fingerprint from category, invalid stage, artifact, requirement or section key when available, normalized summary, and remediation requirement.\n  - Before assigning IDs, load the previous `Analyze Gate` ledger from `workflow-state.md` when it exists.\n  - Match current findings to previous open or recently cleared findings by fingerprint first, and reuse the prior ID when the fingerprint matches.\n  - Allocate a new ID only for a genuinely new fingerprint.\n  - For new fingerprints, allocate the next unused category sequence after sorting by category, artifact, section key, and normalized summary.\n\n### Revalidation Attribution\n\n- When revalidating after a blocked analyze gate, any new blocker must include one attribution:\n  - `missed_by_previous_analyze`: detectable in the prior artifact set and should have been included in the earlier blocker bundle.\n  - `introduced_by_remediation`: remediation changed `tasks.md` or downstream state in a way that introduced the issue.\n  - `upstream_artifact_changed`: an authoritative input changed since the prior analyze pass.\n  - `detector_scope_changed`: the workflow template or analysis instructions changed the detector scope between runs.\n- If there is no evidence for `introduced_by_remediation`, `upstream_artifact_changed`, or `detector_scope_changed`, use `missed_by_previous_analyze`.\n- Persist attribution per new blocking finding in the `Analyze Gate` `blocker_bundle`; report-body attribution without durable blocker-row attribution is not sufficient for revalidation.\n- No more than one task-layer remediation cycle is expected. If revalidation finds new task-layer blockers that were detectable before remediation, classify them as a previous analyze miss or a tasks self-audit failure. Do not treat repeated task\u002Fanalyze loops as normal workflow.\n\n## Workflow Quality Requirements\n\n- Confirm project cognition freshness and valid workflow entry before deeper analysis begins.\n- Keep `workflow-state.md` current as the durable gate-state source of truth for whether implementation may proceed, which stage must reopen, and what evidence supports the decision.\n- Verify the analysis report, cleared or blocked gate result, and any durable artifact outcomes before final reporting instead of relying on chat narration.\n- Update durable analysis state before compaction-risk transitions, large findings synthesis, remediation handoffs, or any stop where resume will depend on more than the visible conversation.\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\n## Execution Steps\n\n### 1. Initialize Analysis Context\n\nRun `.specify\u002Fscripts\u002Fpowershell\u002Fcheck-prerequisites.ps1 -Json -RequireTasks -IncludeTasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:\n\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 analyze --ensure-worktree` before guessing from branch-only context.\n- When lane resolution returns a materialized lane worktree, continue analysis from that isolated worktree context so downstream gate decisions stay attached to the same lane boundary.\n\n- SPEC_CONTRACT = FEATURE_DIR\u002Fspec-contract.json\n- PLAN_CONTRACT = FEATURE_DIR\u002Fplan-contract.json\n- TASK_INDEX = FEATURE_DIR\u002Ftask-index.json for standard\u002Fheavy work, otherwise TASKS = FEATURE_DIR\u002Ftasks.md\n- PLANNING_LANE_MANIFEST = FEATURE_DIR\u002Fplanning\u002Flane-manifest.json when present\n- TASK_GENERATION_LANE_MANIFEST = FEATURE_DIR\u002Ftask-generation\u002Flane-manifest.json when present\n\nAbort with an error message if any required file is missing (instruct the user to run missing prerequisite command).\nFor single quotes in args like \"I'm Groot\", use escape syntax: e.g 'I'\\''m Groot' (or double-quote if possible: \"I'm Groot\").\n\n- Set `WORKFLOW_STATE_FILE` to `FEATURE_DIR\u002Fworkflow-state.md`.\n- [AGENT] Create or resume `WORKFLOW_STATE_FILE` before substantial analysis work begins.\n- Read `.specify\u002Ftemplates\u002Fworkflow-state-template.md`.\n- If `WORKFLOW_STATE_FILE` already exists, read it first and preserve still-valid authoritative file references and gate notes instead of relying on chat memory alone.\n\n### 2. Ensure project cognition runtime exists\n\n- Choose the cognition intent before querying: use `plan` when analyzing planning-only artifacts or upstream spec\u002Fplan drift, use `implement` when analyzing task execution, remediation, or code-change blockers, and preserve the originating workflow intent when this command is reviewing another `sp-*` workflow's output.\n- Query project cognition with `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent plan --query=\\\"$ARGUMENTS\\\" --format json` or `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe compass --intent implement --query=\\\"$ARGUMENTS\\\" --format json` according to that chosen intent. Read top-level `minimal_live_reads` first, then use lane-level `first_pass_paths` reasons, `verification_hints`, `followup_surfaces`, and `before_fix_claim`. Treat `coverage_diagnostics` as confidence and closeout signals, do not infer final edit scope from first-pass reads, and use `project-cognition expand` only when the packet's coverage state or live evidence requires it.\n- Preserve the advanced `lexicon -> semantic_intake -> query` flow for explicit concept decisions or unresolved coverage. In that escalation, write `semantic_intake` from the alias catalog, select candidates by facet coverage, write `concept_decisions` with `covered_facets`, `missing_facets`, and `match_sources`, carry `lexicon_generation_id`, then generate a `query_plan` containing `semantic_intake`, `selected_concepts`, `rejected_concepts`, `concept_decisions`, `lexicon_generation_id`, `expanded_queries`, `repository_search_terms`, and justified `paths`, then run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe query --intent \u003Cchosen-intent> --query-plan \\\"\u003Cquery_plan_json>\\\" --format json`. Agent-owned semantic normalization is mandatory: raw lexicon ranking and `agent_normalization` are only bootstrap signals, not route decisions. If `agent_normalization.required=true`, every raw candidate is `score=0`, or the prompt is localized, mixed-language, CJK, colloquial, or symptom-first, extract embedded project terms and write `semantic_intake` from the alias catalog before selecting or rejecting concepts. If `agent_normalization` is omitted, treat it as `required=false`; CJK or mixed CJK\u002FASCII input still requires agent normalization even when positive raw lexical matches exist because embedded project tokens do not translate the surrounding user language. The agent still owns translation; `agent_normalization` is advisory guidance, not a route decision. This includes mixed-language or CJK text. (raw lexicon ranking is only a bootstrap; action: write_semantic_intake_from_alias_catalog) Derive project-language search terms from the alias catalog before source search. Do not search only the raw user words; include component names, state names, file names, command names, UI labels, and route names from candidates, aliases, matched_terms, colloquial_matches, returned paths, `normalized_query`, and `expanded_queries`. Use these project-language search terms before broad repository search. For implementation or remediation analysis, the concrete advanced query command is `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe query --intent implement --query-plan \\\"\u003Cquery_plan_json>\\\" --format json`.\n- If readiness is `needs_rebuild`, continue with live repository evidence where workflow policy allows and recommend `\u002Fsp-map-scan`, then `\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, missing or invalid alias_index, explicit_rebuild_requested, or baseline_identity_invalid. Block only when the user explicitly requested cognition repair or analysis truly cannot proceed without a usable baseline.\n- If compass coverage is too weak for the touched area, use live evidence and record whether a follow-up `\u002Fsp-map-update` is useful for external map maintenance.\n- Use map-update for ordinary existing-baseline gaps. Use map-scan -> map-build only for first\u002Fmissing\u002Funusable baseline, schema failure, schema v1 or old broad-schema rebuild-required readiness, zero active-generation path_index rows, missing or invalid alias_index, explicit_rebuild_requested, or baseline_identity_invalid.\n- If readiness is `review`, inspect only the returned `minimal_live_reads` before trusting the runtime for analysis.\n- Carry selected\u002Frejected concepts, `selection_reason`, `route_pack`, and\n  `minimal_live_reads` into the analysis report and `workflow-state.md`\n  blocker bundle whenever cognition evidence affects routing or blocker\n  severity.\n- Treat task-relevant coverage as insufficient when the touched area is named only vaguely, lacks ownership or placement guidance, or lacks workflow, constraint, integration, or regression-sensitive testing guidance.\n- If task-relevant coverage is insufficient for the current analysis request, inspect the returned targeted live evidence; refresh through `\u002Fsp-map-update` with changed paths or affected surfaces, and rebuild through `\u002Fsp-map-scan`, then `\u002Fsp-map-build` only for the explicit rebuild conditions above.\n\n### 3. Load Artifacts (Progressive Disclosure)\n\nLoad only the minimal necessary context from each artifact:\n\n**From project cognition runtime:**\n\n- Consume the `project-cognition query` bundle.\n- Preserve `selected_concepts`, `rejected_concepts`, `selection_reason`,\n  `route_pack`, and `minimal_live_reads` as blocker evidence inputs.\n- Preserve cognition-backed blocker evidence when classifying whether issues\n  belong to `plan`, `clarify`, `deep-research`, or task-layer remediation. The\n  analysis report and `workflow-state.md` blocker bundle must keep the selected\n  capability, boundary fact, ambiguity, or verification evidence that justified\n  the route.\n- Inspect only returned `minimal_live_reads` when the bundle does not fully cover ownership, propagation, or verification routes.\n- If topical coverage is missing, stale, too broad, or task-relevant coverage is insufficient, use `\u002Fsp-map-update` with changed paths or affected surfaces; rebuild through `\u002Fsp-map-scan` followed by `\u002Fsp-map-build` only for the explicit rebuild conditions above, then inspect the minimum live files still needed to replace guesswork with evidence\n\n**From spec-contract.json first (open spec.md\u002Fcontext.md only for a named detail or contradiction):**\n\n- Overview\u002FContext\n- Functional Requirements\n- Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)\n- User Stories\n- Edge Cases (if present)\n\n**From conditional context view when referenced:**\n\n- Locked Decisions\n- Claude Discretion\n- Canonical References\n- Existing Code Insights\n- Specific User Signals\n- Outstanding Questions\n\n**From plan-contract.json first (open plan.md or conditional design artifacts only for a named detail or contradiction):**\n\n- Architecture\u002Fstack choices\n- Locked Planning Decisions\n- Implementation Constitution\n- Alignment Inputs\n- Data Model references\n- Phases\n- Technical constraints\n\n**From task-index.json, or tasks.md for light direct work:**\n\n- Task IDs\n- Descriptions\n- Phase grouping\n- Parallel markers [P]\n- Referenced file paths\n\n**From delegated planning lanes when present:**\n\n- Read `planning\u002Flane-manifest.json` and only the accepted lane results it names.\n- Verify each accepted result is consumed by `plan-contract.json` or a referenced conditional artifact, or is explicitly deferred or blocked.\n- Treat an accepted planning handoff with no downstream consumer as a plan-layer blocker, not harmless leftover evidence.\n\n**From delegated task-generation lanes when present:**\n\n- Read `task-generation\u002Flane-manifest.json` and only the accepted lane results it names.\n- Verify each accepted result is consumed by `task-index.json` or the light direct task list, or is explicitly deferred, escalated, or blocked.\n- Treat an accepted task-generation handoff with no downstream consumer as a task-layer blocker before implementation can proceed.\n\n**From constitution:**\n\n- Load `.specify\u002Fmemory\u002Fconstitution.md` for principle validation\n\n### 4. Build Semantic Models\n\nCreate internal representations (do not include raw artifacts in output):\n\n- **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-\u002FSC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., \"User can upload file\" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., \"Reduce support tickets by 50%\").\n- **Locked decision inventory**: Collect locked decisions from `spec.md`, `context.md`, and `plan.md`, then track whether each one survives into the task layer\n- **Reference behavior inventory**: When `Fidelity Requirements` exist, collect each reference behavior item and track whether it survives into the plan and task layers\n- **Boundary-sensitivity inventory**: Record established boundary patterns, framework-owned surfaces, required implementation references, and any signal that this feature should carry explicit implementation guardrails\n- **User story\u002Faction inventory**: Discrete user actions with acceptance criteria\n- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword \u002F explicit reference patterns like IDs or key phrases)\n- **Constitution rule set**: Extract principle names and MUST\u002FSHOULD normative statements\n\n### 5. Detection Passes (Token-Efficient Analysis)\n\nFocus on high-signal findings in the report body and include every unique actionable finding. Repetitive non-blocking observations may be grouped only when the group preserves their evidence, owner, and repair route. Never omit blockers from the durable gate result: `Blocker Bundle` and `workflow-state.md` MUST enumerate every blocking finding.\n\n#### A. Duplication Detection\n\n- Identify near-duplicate requirements\n- Mark lower-quality phrasing for consolidation\n\n#### B. Ambiguity Detection\n\n- Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria\n- Flag unresolved placeholders (TODO, TKTK, ???, `\u003Cplaceholder>`, etc.)\n\n#### C. Underspecification\n\n- Requirements with verbs but missing object or measurable outcome\n- User stories missing acceptance criteria alignment\n- Tasks referencing files or components not defined in spec\u002Fplan\n\n#### D. Constitution Alignment\n\n- Any requirement or plan element conflicting with a MUST principle\n- Missing mandated sections or quality gates from constitution\n\n#### E. Coverage Gaps\n\n- Requirements with zero associated tasks\n- Tasks with no mapped requirement\u002Fstory\n- Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks\n- Preserved or redesigned reference behavior items with zero associated plan handling or task coverage\n\n#### F. Locked Decision Drift\n\n- Locked decisions present in `spec.md` but absent from `context.md`\n- Locked decisions present in `context.md` but missing from `plan.md`\n- Locked decisions present in `plan.md` but not preserved by `tasks.md`\n- Cases where a decision appears to have been silently weakened, deferred, or renamed without acknowledgment\n\n#### G. Inconsistency\n\n- Terminology drift (same concept named differently across files)\n- Data entities referenced in plan but absent in spec (or vice versa)\n- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)\n- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)\n\n#### H. Boundary Guardrail Gaps\n\n- Detect cases where `spec.md`, `context.md`, or `tasks.md` clearly imply a boundary-sensitive implementation area, but later workflow artifacts fail to preserve the needed guardrails\n- Use this stable issue family so downstream tooling and reviewers can key off one consistent signal set:\n  - `BG1`: missing `Implementation Constitution` for a boundary-sensitive feature area\n  - `BG2`: `tasks.md` lacks explicit implementation guardrails even though `plan.md` declares a boundary-sensitive constitution rule\n  - `BG3`: implementation guidance does not require confirming the owning framework, defining reference files, or forbidden drift before code-writing work begins\n  - `DP1`: subagent execution path lacks compiled hard rules, validation gates, or done criteria in its task packet\n  - `DP2`: subagent execution path lacks required references or forbidden drift in its task packet\n  - `DP3`: subagent completion lacks required validation evidence or rule acknowledgement\n- Treat these signals as triggers:\n  - established framework-owned boundary or adapter pattern\n  - native bridge, plugin surface, protocol seam, generated API surface, or other contract-heavy boundary\n  - explicit required implementation references or boundary-defining files\n  - implementation guardrail tasks in `tasks.md` with no matching constitution rule in `plan.md`\n- Map findings to codes as follows:\n  - `BG1` when the plan is missing the constitution layer\n  - `BG2` when the task layer fails to preserve that constitution as implementation guardrails\n  - `BG3` when execution guidance fails to force pre-dispatch boundary confirmation\n- Report when a generic implementation instinct would likely drift away from the repository's established pattern because the plan left the constraint as background context only\n\n#### I. Consequence Preservation Analysis\n\n- Detect every `CA-###` consequence obligation in `spec.md`, `context.md`, `references.md`, `alignment.md`, `plan.md`, `tasks.md`, `plan-contract.json`, `task-index.json`, and task packets when present.\n- Verify each consequence obligation keeps its claim, affected objects, lifecycle state behavior, dependency impact, recovery and validation contract, owner workflow, latest resolve phase, status, and stop-and-reopen condition across downstream artifacts.\n- Flag any obligation that disappears, is renamed without traceability, loses validation evidence, lacks task or packet coverage, or is treated as resolved without proof.\n- Must not drop consequence obligations from the analysis report or blocker bundle. If an upstream artifact omitted one, report the omission and route to the highest invalid workflow stage that can restore it.\n- Treat unresolved or unmapped `CA-###` obligations as blockers when implementation would otherwise continue through lifecycle, running-state, destructive-operation, shared-state, or downstream-consumer ambiguity.\n- If the consequence model is complete and every stop-and-reopen condition is mapped or resolved, record the gate as cleared for implementation; otherwise keep implementation paused.\n\n### 6. Severity Assignment\n\nUse this heuristic to prioritize findings:\n\n- **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality\n- **HIGH**: Duplicate or conflicting requirement, ambiguous security\u002Fperformance attribute, untestable acceptance criterion, a locked decision silently dropped between artifacts, or a missing `Implementation Constitution` for a clearly boundary-sensitive feature area\n- **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case\n- **LOW**: Style\u002Fwording improvements, minor redundancy not affecting execution order\n\n### 7. Produce Compact Analysis Report\n\nOutput a Markdown report (no file writes) with the following structure:\n\n## Specification Analysis Report\n\n| ID | Signal Code | Category | Severity | Location(s) | Summary | Recommendation |\n|----|-------------|----------|----------|-------------|---------|----------------|\n| A1-001 | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |\n| BG1-001 | BG1 | Boundary Guardrail Gap | HIGH | plan.md, tasks.md | Boundary-sensitive area lacks `Implementation Constitution` in the plan | Re-run `\u002Fsp-plan` to add the constitution, then `\u002Fsp-tasks` if guardrail tasks need regeneration |\n| BG2-001 | BG2 | Boundary Guardrail Gap | HIGH | tasks.md | Plan declares a boundary-sensitive constitution rule, but tasks do not preserve it as implementation guardrails | Re-run `\u002Fsp-tasks` or edit `tasks.md` so guardrail tasks exist before setup or feature work |\n| BG3-001 | BG3 | Boundary Guardrail Gap | HIGH | implement guidance | Execution guidance does not force boundary confirmation before code-writing work starts | Update implementation guidance so the owning framework, required references, and forbidden drift are confirmed before dispatch |\n| DP1-001 | DP1 | Dispatch Packet Gap | HIGH | implement guidance, runtime payload | Delegated execution path is missing compiled hard rules, validation gates, or done criteria | Compile and validate a `WorkerTaskPacket` before dispatch |\n| DP2-001 | DP2 | Dispatch Packet Gap | HIGH | plan.md, tasks.md, runtime payload | Delegated execution path is missing required references or forbidden drift | Add packet references\u002Fforbidden drift to planning artifacts, then recompile |\n| DP3-001 | DP3 | Dispatch Result Gap | HIGH | subagent result, join point | Subagent completion lacks validation evidence or rule acknowledgement | Reject the subagent result and require a packet-compliant rerun |\n\n(Add one row per finding. Each row uses a stable fingerprint-first finding ID, and keeps BG\u002FDP values as signal codes where applicable.)\n\n**Blocker Bundle:**\n\nThe `Blocker Bundle` MUST enumerate every blocking finding. Do not hide blocking findings inside grouped summaries.\n\n| Invalid Stage | Blocking Finding IDs | Required Re-entry | Notes |\n|---------------|----------------------|-------------------|-------|\n| clarify | [IDs or none] | `\u002Fsp-clarify` | Reopen spec\u002Fcontext truth, then regenerate downstream artifacts |\n| deep-research | [IDs or none] | `\u002Fsp-deep-research` | Prove unresolved implementation chain before planning |\n| plan | [IDs or none] | `\u002Fsp-plan` | Repair planning truth, then regenerate tasks |\n| tasks | [IDs or none] | `\u002Fsp-tasks` | Repair task decomposition and rerun analyze |\n| execution-only | [IDs or none] | `\u002Fsp-implement` or `\u002Fsp-debug` | No upstream artifact regeneration required |\n\n**Coverage Summary Table:**\n\n| Requirement Key | Has Task? | Task IDs | Notes |\n|-----------------|-----------|----------|-------|\n\n**Locked Decision Preservation Table:**\n\n| Locked Decision | In Context? | In Plan? | In Tasks? | Notes |\n|-----------------|-------------|----------|-----------|-------|\n\n**Reference Behavior Preservation Table:** (if any)\n\n| Behavior ID | In Spec Fidelity? | In Plan? | In Tasks? | Notes |\n|-------------|-------------------|----------|-----------|-------|\n\n**Boundary Guardrail Table:** (if any)\n\n| Boundary Signal | Seen In Spec\u002FContext? | Seen In Plan Constitution? | Seen In Tasks Guardrails? | Notes |\n|-----------------|-----------------------|----------------------------|---------------------------|-------|\n\n**Constitution Alignment Issues:** (if any)\n\n**Unmapped Tasks:** (if any)\n\n**Metrics:**\n\n- Total Requirements\n- Total Tasks\n- Coverage % (requirements with >=1 task)\n- Ambiguity Count\n- Duplication Count\n- Critical Issues Count\n- Boundary Guardrail Gap Count\n\n### 8. Provide Next Actions\n\nAt the end of the report, output exactly one `Recommended Next Command` based on the highest invalid workflow stage.\n\n- If the highest-impact unresolved issue lives in `spec.md` or `context.md`, `Recommended Next Command` MUST be `\u002Fsp-clarify`.\n- If the highest-impact unresolved issue is a clear requirement whose implementation chain is still unproven, `Recommended Next Command` MUST be `\u002Fsp-deep-research`.\n- If the highest-impact unresolved issue lives in `plan.md`, `Recommended Next Command` MUST be `\u002Fsp-plan`.\n- If the highest-impact unresolved issue lives only in `tasks.md`, `Recommended Next Command` MUST be `\u002Fsp-tasks`.\n- If no upstream artifact is invalid and the remaining issue is execution-only, `Recommended Next Command` MUST be `\u002Fsp-implement` or `\u002Fsp-debug`, whichever matches the recorded execution problem.\n- Do not output multiple alternative next commands for the same analysis result.\n\n### 9. Define Workflow Re-entry\n\nAfter `Next Actions`, output a short `Recommended Re-entry` block that names:\n- the single highest workflow stage that must be reopened\n- the minimum downstream regeneration path from that stage\n\nRules:\n- If the highest invalid stage is `clarify`, the re-entry chain MUST be `\u002Fsp-clarify -> \u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `deep-research`, the re-entry chain MUST be `\u002Fsp-deep-research -> \u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `plan`, the re-entry chain MUST be `\u002Fsp-plan -> \u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the highest invalid stage is `tasks`, the re-entry chain MUST be `\u002Fsp-tasks -> \u002Fsp-analyze -> \u002Fsp-implement`.\n- If the remaining issue is execution-only, the re-entry chain MUST begin at `\u002Fsp-implement` or `\u002Fsp-debug`.\n- Do not output multiple alternative re-entry chains for the same result.\n\n### 9.5 Persist Workflow Gate Result\n\nBefore the final completion text, write or update `WORKFLOW_STATE_FILE` so it records the gate outcome:\n\nAlways update or preserve the `Analyze Gate` section in `WORKFLOW_STATE_FILE` with:\n- `gate_status: cleared | blocked`\n- `gate_cycle: [integer]`\n- `highest_invalid_stage: clarify | deep-research | plan | tasks | execution-only | none`\n- `blocker_bundle: [finding ID | invalid stage | status | attribution | compact summary | remediation requirement]`\n- `artifact_fingerprint_basis: [spec.md\u002Fcontext.md\u002Fplan.md\u002Ftasks.md summaries or hashes when available]`\n\nWhen revalidation finds a new blocker, record its attribution on that `blocker_bundle` row using `missed_by_previous_analyze`, `introduced_by_remediation`, `upstream_artifact_changed`, or `detector_scope_changed`.\n\n- When no upstream remediation is required, record the analyze gate as cleared and hand off to implementation.\n- If no upstream remediation is required:\n  - `active_command: sp-analyze`\n  - `phase_mode: analysis-only`\n  - `status: completed`\n  - `next_action: begin implementation from the cleared execution batch`\n  - `next_command: \u002Fsp.implement`\n- If the highest invalid stage is `spec.md` or `context.md`:\n  - `next_action: reopen specification alignment and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.clarify`\n- If the constitution itself must change:\n  - `next_action: amend project principles first, then reopen the highest affected downstream stage and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.constitution`\n- If the highest invalid stage is `plan.md`:\n  - `next_action: reopen planning and regenerate downstream artifacts`\n  - `next_command: \u002Fsp.plan`\n- If the highest invalid stage is only `tasks.md`:\n  - `next_action: regenerate task decomposition before implementation resumes`\n  - `next_command: \u002Fsp.tasks`\n- If execution evidence must be repaired without upstream artifact drift:\n  - `next_action: resume execution-side recovery with the recorded blocker context`\n  - `next_command: \u002Fsp.implement` or `\u002Fsp.debug` as justified by the report\n\n### 10. Offer Remediation\n\nAsk the user: \"Would you like me to draft concrete remediation edits and the exact workflow re-entry path for the top N issues?\" (Do NOT apply them automatically.)\n\n## Operating Principles\n\n### Context Efficiency\n\n- **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation\n- **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis\n- **Signal-efficient output**: Include every unique actionable finding; group only genuinely repetitive non-blocking observations without losing evidence, ownership, or repair routes\n- **Deterministic results**: Rerunning without changes should produce consistent IDs and counts\n\n### Analysis Guidelines\n\n- **NEVER modify files** (this is read-only analysis)\n- **NEVER hallucinate missing sections** (if absent, report them accurately)\n- **Prioritize constitution violations** (these are always CRITICAL)\n- **Use examples over exhaustive rules** (cite specific instances, not generic patterns)\n- **Report zero issues gracefully** (emit success report with coverage statistics)\n\nIf 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## Invocation Context\n\n$ARGUMENTS\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",{"name":5,"metadata":24,"description":7,"argument-hint":27,"compatibility":28,"user-invocable":29},{"author":25,"source":26},"github-spec-kit","templates\u002Fcommands\u002Fanalyze.md","Optional focus areas for analysis, such as boundary guardrail drift (BG1\u002FBG2\u002FBG3)","Requires spec-kit project structure with .specify\u002F directory",true,"main","021f5cbe02157229460a577e9a585f2da6d78cb0",".claude\u002Fskills\u002Fsp-analyze","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-analyze",{"tool":42,"command":43},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill sp-analyze",{"tool":45,"command":46},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill sp-analyze","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-analyze\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-analyze\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-analyze\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",[],[]]