[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M786CCGWED0E8ZACWMP61FE4":3,"skill-same:01M786CCGWED0E8ZACWMP61FE4":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},"01M786CCGWED0E8ZACWMP61FE4","sp-map-update",null,"Use when a query-backed project cognition baseline already exists and diff-based evidence refresh or user-supplied corrections must update it incrementally.","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-map-update\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"sp-map-update\"\ndescription: \"Use when a query-backed project cognition baseline already exists and diff-based evidence refresh or user-supplied corrections must update it incrementally.\"\nargument-hint: \"Optional changed path, subsystem, or stale cognition area to refresh incrementally\"\ncompatibility: \"Requires spec-kit project structure with .specify\u002F directory\"\nmetadata:\n  author: \"github-spec-kit\"\n  source: \"templates\u002Fcommands\u002Fmap-update.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**: A project cognition baseline exists and repository changes or user supplements must update the runtime without a full rebuild.\n- **Primary objective**: Compute impact closure, refresh affected evidence, update claims and conflicts, and update only the affected SQLite runtime records.\n- **Primary outputs**: `.specify\u002Fproject-cognition\u002Fstatus.json`, `.specify\u002Fproject-cognition\u002Fproject-cognition.db`, and query\u002Fupdate helper readiness metadata.\n- **Default handoff**: Return to the blocked workflow once the affected query scope is green or yellow.\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[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## 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## Objective\n\nRefresh the existing query-backed project cognition baseline incrementally from diff-driven evidence or explicit user corrections.\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## Process\n\n- Query the current project cognition baseline and determine the affected closure before editing runtime outputs.\n- Use the shared semantic intake contract when classifying changed paths or user supplements: build `semantic_intake` from the alias catalog, normalized query, `intent_facets`, `negative_constraints`, and `alias_interpretations`; preserve facet coverage in `concept_decisions` through `covered_facets`, `missing_facets`, and `match_sources`; write `repository_search_terms` derived from project language before source search. 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, symptom-first, or mixed-language or CJK text, extract embedded project terms and write `semantic_intake` from the alias catalog before selecting or rejecting concepts (raw lexicon ranking is only a bootstrap; action: write_semantic_intake_from_alias_catalog). If `agent_normalization` is omitted, treat it as `required=false`; omission does not make raw lexical ranking authoritative. 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. 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. Do not trust top similarity alone when deciding the affected closure.\n- Prefer the smallest update that can truthfully restore readiness.\n- Treat explicit user corrections and user-supplied scope as first-class routing input; user-supplied scope is authoritative for the touched area unless repository evidence disproves it.\n- Dispatch only validated incremental update lanes with bounded affected scope.\n- A tiny localized refresh may stay as one bounded lane even when native subagents are available.\n- If a safe update lane cannot be packetized or delegated, record `subagent-blocked` with the affected paths and the smallest live-read recovery path; this is a dispatch\u002Fruntime blocker, not an excuse to skip the map-update duty.\n- Update the affected runtime records that can be proven, and explicitly mark uncertain edges as partial, low-confidence, stale, or known-unknown instead of claiming the update cannot be performed.\n\n## Git Delta Intake\n\n- Start from Git, not memory: first run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe changes --format json` unless the caller supplied a narrower explicit changed-path list or commit range. For explicit paths, pass each path with `--changed-path`; for a commit range, pass `--since \u003Cbase> --head \u003Chead>`.\n- Consume `next_action`, `changes[].path`, `ignored_paths`, `unknown_paths`, `baseline_commit`, and `head_commit` from the `changes` payload before querying or patching the runtime. Feed `changes[].path` into the update payload's `changed_paths`; keep `ignored_paths` out of update records, known unknowns, `minimal_live_reads`, graph evidence, and route indexes.\n- Filter changed paths through `.cognitionignore` before querying or patching the runtime. The `changes` helper performs the first filter pass; if the agent adds user-supplied paths later, re-check root `.cognitionignore` and `.specify\u002Fproject-cognition\u002F.cognitionignore`. Both use gitignore-compatible syntax.\n- User-supplied changed paths that match `.cognitionignore` are scope notes, not update targets. Report them as ignored unless a later `!` rule re-includes the path or the user explicitly changes the ignore rule.\n- Treat user-supplied changed paths, behavior surfaces, and corrections as authoritative scope hints unless repository evidence contradicts them.\n- Query `project-cognition.db` for each changed path before deciding update scope.\n- For every changed path, look up current owner, consumers, lifecycle\u002Fstate surfaces, shared mutable state, destructive-operation edges, generated-surface propagation, verification routes, conflicts, stale claims, and known unknowns.\n- Expand the update closure through owners, downstream consumers, state surfaces, workflow artifacts, generated surfaces, and verification routes that project cognition already knows.\n- Consume `affected_graph_claims` from structured update output. Changed paths must mark only graph claims linked through affected nodes or claim evidence as `stale`, preserve their prior state in the transition history, and leave unrelated claims unchanged.\n\nEvery changed path must be accounted for as one of: updated, provisionally adopted, ignored with reason, partial with `minimal_live_reads`, blocked with recovery condition, or requiring full rebuild for a reserved rebuild reason.\n\nIgnored `.cognitionignore` paths are reported in ignored-path accounting only. `sp-map-update` must not write `.cognitionignore`-excluded paths into update records, known unknowns, `minimal_live_reads`, graph evidence, or route indexes.\n\n## Update-By-Default Rule\n\n- Ordinary uncertainty is not an update failure.\n- If the affected closure cannot be fully proven, still update the records that can be proven and record the rest as `partial_refresh`, low-confidence claims, conflicts, stale claims, `known_unknowns`, and `minimal_live_reads`.\n- `sp-map-update` must not route to `sp-map-scan -> sp-map-build` merely because the closure is wider than expected, some consumers are ambiguous, or extra live reads are needed.\n- Rebuild is reserved for missing baseline, unusable DB\u002Fstatus\u002Fschema, explicit rebuild request, or repository architecture replacement so broad that the baseline identity is invalid.\n\n## Existing-Baseline Gap Policy\n\nWhen a usable active generation exists, existing-baseline ordinary gaps are `sp-map-update`\nwork and must not route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build` for ordinary path gaps,\npath count, unrelated top-level count, core-surface status, weak ownership,\nmissing `path_index` coverage, or unadoptable-ratio heuristics.\n\nUse `review`, `partial_refresh`, low-confidence claims, conflicts, stale claims,\nknown unknowns, and `minimal_live_reads` to preserve imperfect but useful\nmaintenance state.\n\n`\u002Fsp-map-scan -> \u002Fsp-map-build` is allowed after an existing baseline\nonly for missing or unusable runtime, zero active-generation `path_index` rows,\nschema failure, `explicit_rebuild_requested`, or `baseline_identity_invalid`.\n\n## Incremental Rule\n\n- `sp-map-update` is the normal maintenance entrypoint after baseline build.\n- It must accept both diff-driven and user-supplement-driven updates.\n- It must update the query-backed cognition runtime incrementally.\n- It must treat `.specify\u002Fproject-cognition\u002Fstatus.json` plus `.specify\u002Fproject-cognition\u002Fproject-cognition.db` as the runtime truth source for post-update readiness.\n- It must not silently escalate to a full rebuild without recording why.\n- Generic workflow verification or `result_state=ready` may refresh path coverage but must not re-promote stale or contradicted graph claims. After update returns `affected_graph_claims`, re-promotion is allowed only for an exact stable claim ID backed by decisive claim-specific bounded live evidence. Provide only reconciliation intent: workflow, stable `claim_id`, reason, repository-relative `source_path`, bounded line `span`, `supporting` or `contradicting` role, and optional claim-specific verification. Run `project-cognition claim-reconcile prepare --input \u003Cintent.json> --format json`; the runtime owns every integrity field and the prepared packet path. Execute the returned `apply_argv` exactly (`project-cognition claim-reconcile apply --input \u003Cprepared_packet_path> --format json`). Leave claims without this evidence stale. On ready, rerun Compass once; on partial or blocked output, preserve the stale\u002Fcontradicted route and follow `recommended_next_action`.\n- When changed paths are missing from `path_index`, classify them before escalating: adoptable paths get provisional `path_index` and `alias_index` coverage, uncertain paths return `review` with `minimal_live_reads`, and existing-baseline ordinary gaps stay in `sp-map-update`.\n- Provisional adoption must write valid graph records: an adoption `evidence` row, a `path_index` row with `relation=\"provisional_path\"` and graph confidence `weak` or `partial`, and alias rows for the adopted node title, path material, workflow\u002Fsource terms, and behavior surfaces so future `project-cognition compass` and alias-catalog routing can rediscover the adopted path.\n- It must prefer metadata-only or single-slice updates when those are sufficient.\n- After recording updates, re-evaluate runtime readiness through the shared freshness contract.\n- Before `validate-build` or `complete-refresh`, build a payload or delta session and call:\n\n```text\nproject-cognition update --payload-file \".specify\u002Fproject-cognition\u002Fupdates\u002F\u003Cmap-update-id>.json\" --reason map-update --format json\n```\n\nUse the returned `result_state` as the completion gate, not `status=ok` alone. `ready` plus passing `validate-build` may call `complete-refresh`; `no_op` may call `record-refresh` when only freshness metadata needs to be updated; `partial_refresh` must preserve review data and must not call `complete-refresh`; `needs_rebuild` must route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`; `blocked` must report the blocker and recovery condition.\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- After applying update records, run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe validate-build --format json`.\n- `sp-map-update` must not call `complete-refresh` when `result_state` is `partial_refresh`, `needs_rebuild`, or `blocked`; those states are useful recorded outcomes, not fresh completed baselines.\n- If the update helper returns `needs_rebuild`, `sp-map-update` must not call `complete-refresh`; report the concrete 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` condition and route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`.\n- If `validate-build` reports `identity_reconciliation=blocked` but the blocked set is bounded and path-led, `sp-map-update` must run a focused identity-repair pass before offering rebuild. Treat missing or unexpected `coverage_path` identities, renamed paths, deleted paths, ignored paths, stale DB path rows, and path-derived evidence identities as map-update repair work when they can be explained from git delta, file existence, `.cognitionignore`, existing merge records, or explicit row decisions.\n- During the identity-repair pass, classify every blocked identity as one of: adopted with provisional path\u002Fevidence, merged to a canonical path, rejected with an explicit row decision, ignored by boundary rules, stale\u002Fdeleted, or still blocked with a concrete reason. Then rerun `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe validate-build --format json`.\n- Do not ask the user to choose between focused identity repair and full rebuild when the repair set is bounded and no reserved rebuild reason is present; perform the focused repair first and escalate only if the repair cannot safely explain the identities or validation later reports a reserved rebuild condition.\n- If `validate-build` is blocked after update recording, report `partial_refresh` and preserve the validation errors instead of claiming the runtime is fresh.\n- If the re-evaluated runtime is `fresh` with `readiness=ready`, finalize the successful refresh through `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json` so cognition freshness metadata cannot remain stale.\n- If the update helper returns `ready` and `validate-build` passes, but the shared freshness check still sees the same refreshed source paths only because those source changes are not committed yet, report the incremental update as recorded and baseline-finalization pending. Do not tell the user to run `\u002Fsp-map-scan` or `\u002Fsp-map-build` merely because refreshed source changes are not committed yet.\n- After those source changes are committed, update the git-baseline freshness metadata with `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe record-refresh --reason \\\"map-update\\\" --format json` or `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json` without rerunning `\u002Fsp-map-scan` or `\u002Fsp-map-build`, unless validation reports `needs_rebuild`, the baseline is unusable, or the affected closure cannot be bounded safely.\n- Do not report refresh completion when the runtime remains blocked.\n- A recorded refresh is not automatically a ready refresh: `partial_refresh` means update metadata was written but readiness still failed.\n\n## Required Inputs\n\nAt minimum, read:\n\n- `.specify\u002Fproject-cognition\u002Fstatus.json`\n- `.specify\u002Fproject-cognition\u002Fproject-cognition.db` through the\n  `project-cognition` query\u002Fupdate helpers\n- changed paths or changed commit range\n- user supplement input if provided\n\nDo not read or rewrite raw graph JSON artifacts; they are not runtime truth.\n\n## Output Contract\n\nThe canonical outputs for this command are:\n\n- updated `.specify\u002Fproject-cognition\u002Fstatus.json`\n- updated `.specify\u002Fproject-cognition\u002Fproject-cognition.db`\n- query\u002Fupdate helper readiness metadata\n- the post-recording freshness result, including `freshness`, `readiness`, and `recommended_next_action`\n- when the post-recording freshness result is ready, a completed cognition refresh finalizer via `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json`\n\n## Guardrails\n\n- Do not silently escalate to a full rebuild without recording why.\n- Do not present full rebuild as an equal next option for bounded identity reconciliation debt; run the focused repair pass first.\n- Do not refresh unaffected runtime records just because the touched area is ambiguous; record partial or low-confidence closure for the affected records instead.\n- Do not invent closure when changed paths or user supplements do not support the update.\n- Do not re-read or rewrite raw graph JSON artifacts; use the query\u002Fupdate helpers and the smallest affected runtime records that can truthfully restore readiness.\n- Do not split small localized updates into parallel scan-style lanes just because subagents are available.\n- If the affected update lane cannot be safely packetized or delegated, record `subagent-blocked` with affected paths and recovery evidence; do not describe ordinary ambiguous closure as impossible to update.\n- Do not write `.cognitionignore`-excluded paths into update records, `known_unknowns`, or `minimal_live_reads`; report ignored paths separately so the operator can revise `.cognitionignore` when the exclusion is wrong.\n\n## Escalation Boundary\n\n- Escalate to `sp-map-scan`, then `sp-map-build` only when no query-backed baseline exists, the current baseline is unusable, DB\u002Fstatus\u002Fschema validation fails, zero active-generation `path_index` rows exist, the user explicitly requested a rebuild (`explicit_rebuild_requested`), or the repository architecture changed so broadly that the baseline identity is invalid (`baseline_identity_invalid`).\n- Do not escalate merely because the affected closure is uncertain; record the uncertainty as partial\u002Flow-confidence update data with `known_unknowns` and `minimal_live_reads`.\n- Do not escalate merely because `validate-build` reports bounded path identity reconciliation debt; classify and repair those identities inside `sp-map-update` first.\n- Record the exact reason for escalation, including the failed baseline, DB, schema, explicit-request, or architecture-replacement fact.\n\n## Update Duties\n\n`sp-map-update` must:\n\n- compute diff impact closure\n- refresh affected evidence\n- apply updates as a `patch-in-active-generation` operation against the current\n  query-backed baseline unless validation proves a rebuild is required\n- invalidate affected graph claims with an auditable transition to `stale`; return their stable IDs in `affected_graph_claims`\n- reconcile an affected claim only from claim-specific bounded evidence through `project-cognition claim-reconcile prepare`, then execute its returned `apply_argv` through `project-cognition claim-reconcile apply`; generic verification and `result_state=ready` must not re-promote claims\n- detect and repair stale retrieval signals, including obsolete aliases,\n  colloquial user phrases, concept routes, and ownership hints\n- update or create conflicts\n- preserve or revise `selected_concepts` routing evidence when changed paths,\n  user supplements, or runtime validation show that prior concept selection\n  would now misroute a query\n- preserve or revise `rejected_concepts` routing evidence when user corrections\n  or repository evidence show that a plausible alias belongs to the wrong\n  domain\n- update affected runtime records with proven facts, low-confidence claims, conflicts, stale markers, known unknowns, and minimal live reads\n- must not re-promote a graph claim from workflow finalization alone\n- produce an incremental update record\n- verify the shared freshness contract after the update record is written\n- run the successful-refresh finalizer when that verification proves the runtime ready\n\n## Claude Code Map 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- Keep map packet\u002Fresult schemas from this workflow authoritative; do not substitute implementation `WorkerTaskResult` fields for map scan\u002Fbuild\u002Fupdate packet contracts.\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**: A project cognition baseline exists and repository changes or user supplements must update the runtime without a full rebuild.\n- **Primary objective**: Compute impact closure, refresh affected evidence, update claims and conflicts, and update only the affected SQLite runtime records.\n- **Primary outputs**: `.specify\u002Fproject-cognition\u002Fstatus.json`, `.specify\u002Fproject-cognition\u002Fproject-cognition.db`, and query\u002Fupdate helper readiness metadata.\n- **Default handoff**: Return to the blocked workflow once the affected query scope is green or yellow.\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[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## 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## Objective\n\nRefresh the existing query-backed project cognition baseline incrementally from diff-driven evidence or explicit user corrections.\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## Process\n\n- Query the current project cognition baseline and determine the affected closure before editing runtime outputs.\n- Use the shared semantic intake contract when classifying changed paths or user supplements: build `semantic_intake` from the alias catalog, normalized query, `intent_facets`, `negative_constraints`, and `alias_interpretations`; preserve facet coverage in `concept_decisions` through `covered_facets`, `missing_facets`, and `match_sources`; write `repository_search_terms` derived from project language before source search. 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, symptom-first, or mixed-language or CJK text, extract embedded project terms and write `semantic_intake` from the alias catalog before selecting or rejecting concepts (raw lexicon ranking is only a bootstrap; action: write_semantic_intake_from_alias_catalog). If `agent_normalization` is omitted, treat it as `required=false`; omission does not make raw lexical ranking authoritative. 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. 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. Do not trust top similarity alone when deciding the affected closure.\n- Prefer the smallest update that can truthfully restore readiness.\n- Treat explicit user corrections and user-supplied scope as first-class routing input; user-supplied scope is authoritative for the touched area unless repository evidence disproves it.\n- Dispatch only validated incremental update lanes with bounded affected scope.\n- A tiny localized refresh may stay as one bounded lane even when native subagents are available.\n- If a safe update lane cannot be packetized or delegated, record `subagent-blocked` with the affected paths and the smallest live-read recovery path; this is a dispatch\u002Fruntime blocker, not an excuse to skip the map-update duty.\n- Update the affected runtime records that can be proven, and explicitly mark uncertain edges as partial, low-confidence, stale, or known-unknown instead of claiming the update cannot be performed.\n\n## Git Delta Intake\n\n- Start from Git, not memory: first run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe changes --format json` unless the caller supplied a narrower explicit changed-path list or commit range. For explicit paths, pass each path with `--changed-path`; for a commit range, pass `--since \u003Cbase> --head \u003Chead>`.\n- Consume `next_action`, `changes[].path`, `ignored_paths`, `unknown_paths`, `baseline_commit`, and `head_commit` from the `changes` payload before querying or patching the runtime. Feed `changes[].path` into the update payload's `changed_paths`; keep `ignored_paths` out of update records, known unknowns, `minimal_live_reads`, graph evidence, and route indexes.\n- Filter changed paths through `.cognitionignore` before querying or patching the runtime. The `changes` helper performs the first filter pass; if the agent adds user-supplied paths later, re-check root `.cognitionignore` and `.specify\u002Fproject-cognition\u002F.cognitionignore`. Both use gitignore-compatible syntax.\n- User-supplied changed paths that match `.cognitionignore` are scope notes, not update targets. Report them as ignored unless a later `!` rule re-includes the path or the user explicitly changes the ignore rule.\n- Treat user-supplied changed paths, behavior surfaces, and corrections as authoritative scope hints unless repository evidence contradicts them.\n- Query `project-cognition.db` for each changed path before deciding update scope.\n- For every changed path, look up current owner, consumers, lifecycle\u002Fstate surfaces, shared mutable state, destructive-operation edges, generated-surface propagation, verification routes, conflicts, stale claims, and known unknowns.\n- Expand the update closure through owners, downstream consumers, state surfaces, workflow artifacts, generated surfaces, and verification routes that project cognition already knows.\n- Consume `affected_graph_claims` from structured update output. Changed paths must mark only graph claims linked through affected nodes or claim evidence as `stale`, preserve their prior state in the transition history, and leave unrelated claims unchanged.\n\nEvery changed path must be accounted for as one of: updated, provisionally adopted, ignored with reason, partial with `minimal_live_reads`, blocked with recovery condition, or requiring full rebuild for a reserved rebuild reason.\n\nIgnored `.cognitionignore` paths are reported in ignored-path accounting only. `sp-map-update` must not write `.cognitionignore`-excluded paths into update records, known unknowns, `minimal_live_reads`, graph evidence, or route indexes.\n\n## Update-By-Default Rule\n\n- Ordinary uncertainty is not an update failure.\n- If the affected closure cannot be fully proven, still update the records that can be proven and record the rest as `partial_refresh`, low-confidence claims, conflicts, stale claims, `known_unknowns`, and `minimal_live_reads`.\n- `sp-map-update` must not route to `sp-map-scan -> sp-map-build` merely because the closure is wider than expected, some consumers are ambiguous, or extra live reads are needed.\n- Rebuild is reserved for missing baseline, unusable DB\u002Fstatus\u002Fschema, explicit rebuild request, or repository architecture replacement so broad that the baseline identity is invalid.\n\n## Existing-Baseline Gap Policy\n\nWhen a usable active generation exists, existing-baseline ordinary gaps are `sp-map-update`\nwork and must not route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build` for ordinary path gaps,\npath count, unrelated top-level count, core-surface status, weak ownership,\nmissing `path_index` coverage, or unadoptable-ratio heuristics.\n\nUse `review`, `partial_refresh`, low-confidence claims, conflicts, stale claims,\nknown unknowns, and `minimal_live_reads` to preserve imperfect but useful\nmaintenance state.\n\n`\u002Fsp-map-scan -> \u002Fsp-map-build` is allowed after an existing baseline\nonly for missing or unusable runtime, zero active-generation `path_index` rows,\nschema failure, `explicit_rebuild_requested`, or `baseline_identity_invalid`.\n\n## Incremental Rule\n\n- `sp-map-update` is the normal maintenance entrypoint after baseline build.\n- It must accept both diff-driven and user-supplement-driven updates.\n- It must update the query-backed cognition runtime incrementally.\n- It must treat `.specify\u002Fproject-cognition\u002Fstatus.json` plus `.specify\u002Fproject-cognition\u002Fproject-cognition.db` as the runtime truth source for post-update readiness.\n- It must not silently escalate to a full rebuild without recording why.\n- Generic workflow verification or `result_state=ready` may refresh path coverage but must not re-promote stale or contradicted graph claims. After update returns `affected_graph_claims`, re-promotion is allowed only for an exact stable claim ID backed by decisive claim-specific bounded live evidence. Provide only reconciliation intent: workflow, stable `claim_id`, reason, repository-relative `source_path`, bounded line `span`, `supporting` or `contradicting` role, and optional claim-specific verification. Run `project-cognition claim-reconcile prepare --input \u003Cintent.json> --format json`; the runtime owns every integrity field and the prepared packet path. Execute the returned `apply_argv` exactly (`project-cognition claim-reconcile apply --input \u003Cprepared_packet_path> --format json`). Leave claims without this evidence stale. On ready, rerun Compass once; on partial or blocked output, preserve the stale\u002Fcontradicted route and follow `recommended_next_action`.\n- When changed paths are missing from `path_index`, classify them before escalating: adoptable paths get provisional `path_index` and `alias_index` coverage, uncertain paths return `review` with `minimal_live_reads`, and existing-baseline ordinary gaps stay in `sp-map-update`.\n- Provisional adoption must write valid graph records: an adoption `evidence` row, a `path_index` row with `relation=\"provisional_path\"` and graph confidence `weak` or `partial`, and alias rows for the adopted node title, path material, workflow\u002Fsource terms, and behavior surfaces so future `project-cognition compass` and alias-catalog routing can rediscover the adopted path.\n- It must prefer metadata-only or single-slice updates when those are sufficient.\n- After recording updates, re-evaluate runtime readiness through the shared freshness contract.\n- Before `validate-build` or `complete-refresh`, build a payload or delta session and call:\n\n```text\nproject-cognition update --payload-file \".specify\u002Fproject-cognition\u002Fupdates\u002F\u003Cmap-update-id>.json\" --reason map-update --format json\n```\n\nUse the returned `result_state` as the completion gate, not `status=ok` alone. `ready` plus passing `validate-build` may call `complete-refresh`; `no_op` may call `record-refresh` when only freshness metadata needs to be updated; `partial_refresh` must preserve review data and must not call `complete-refresh`; `needs_rebuild` must route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`; `blocked` must report the blocker and recovery condition.\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- After applying update records, run `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe validate-build --format json`.\n- `sp-map-update` must not call `complete-refresh` when `result_state` is `partial_refresh`, `needs_rebuild`, or `blocked`; those states are useful recorded outcomes, not fresh completed baselines.\n- If the update helper returns `needs_rebuild`, `sp-map-update` must not call `complete-refresh`; report the concrete 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` condition and route to `\u002Fsp-map-scan`, then `\u002Fsp-map-build`.\n- If `validate-build` reports `identity_reconciliation=blocked` but the blocked set is bounded and path-led, `sp-map-update` must run a focused identity-repair pass before offering rebuild. Treat missing or unexpected `coverage_path` identities, renamed paths, deleted paths, ignored paths, stale DB path rows, and path-derived evidence identities as map-update repair work when they can be explained from git delta, file existence, `.cognitionignore`, existing merge records, or explicit row decisions.\n- During the identity-repair pass, classify every blocked identity as one of: adopted with provisional path\u002Fevidence, merged to a canonical path, rejected with an explicit row decision, ignored by boundary rules, stale\u002Fdeleted, or still blocked with a concrete reason. Then rerun `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe validate-build --format json`.\n- Do not ask the user to choose between focused identity repair and full rebuild when the repair set is bounded and no reserved rebuild reason is present; perform the focused repair first and escalate only if the repair cannot safely explain the identities or validation later reports a reserved rebuild condition.\n- If `validate-build` is blocked after update recording, report `partial_refresh` and preserve the validation errors instead of claiming the runtime is fresh.\n- If the re-evaluated runtime is `fresh` with `readiness=ready`, finalize the successful refresh through `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json` so cognition freshness metadata cannot remain stale.\n- If the update helper returns `ready` and `validate-build` passes, but the shared freshness check still sees the same refreshed source paths only because those source changes are not committed yet, report the incremental update as recorded and baseline-finalization pending. Do not tell the user to run `\u002Fsp-map-scan` or `\u002Fsp-map-build` merely because refreshed source changes are not committed yet.\n- After those source changes are committed, update the git-baseline freshness metadata with `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe record-refresh --reason \\\"map-update\\\" --format json` or `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json` without rerunning `\u002Fsp-map-scan` or `\u002Fsp-map-build`, unless validation reports `needs_rebuild`, the baseline is unusable, or the affected closure cannot be bounded safely.\n- Do not report refresh completion when the runtime remains blocked.\n- A recorded refresh is not automatically a ready refresh: `partial_refresh` means update metadata was written but readiness still failed.\n\n## Required Inputs\n\nAt minimum, read:\n\n- `.specify\u002Fproject-cognition\u002Fstatus.json`\n- `.specify\u002Fproject-cognition\u002Fproject-cognition.db` through the\n  `project-cognition` query\u002Fupdate helpers\n- changed paths or changed commit range\n- user supplement input if provided\n\nDo not read or rewrite raw graph JSON artifacts; they are not runtime truth.\n\n## Output Contract\n\nThe canonical outputs for this command are:\n\n- updated `.specify\u002Fproject-cognition\u002Fstatus.json`\n- updated `.specify\u002Fproject-cognition\u002Fproject-cognition.db`\n- query\u002Fupdate helper readiness metadata\n- the post-recording freshness result, including `freshness`, `readiness`, and `recommended_next_action`\n- when the post-recording freshness result is ready, a completed cognition refresh finalizer via `C:\\Users\\11034\\.specify\\bin\\project-cognition.exe complete-refresh --format json`\n\n## Guardrails\n\n- Do not silently escalate to a full rebuild without recording why.\n- Do not present full rebuild as an equal next option for bounded identity reconciliation debt; run the focused repair pass first.\n- Do not refresh unaffected runtime records just because the touched area is ambiguous; record partial or low-confidence closure for the affected records instead.\n- Do not invent closure when changed paths or user supplements do not support the update.\n- Do not re-read or rewrite raw graph JSON artifacts; use the query\u002Fupdate helpers and the smallest affected runtime records that can truthfully restore readiness.\n- Do not split small localized updates into parallel scan-style lanes just because subagents are available.\n- If the affected update lane cannot be safely packetized or delegated, record `subagent-blocked` with affected paths and recovery evidence; do not describe ordinary ambiguous closure as impossible to update.\n- Do not write `.cognitionignore`-excluded paths into update records, `known_unknowns`, or `minimal_live_reads`; report ignored paths separately so the operator can revise `.cognitionignore` when the exclusion is wrong.\n\n## Escalation Boundary\n\n- Escalate to `sp-map-scan`, then `sp-map-build` only when no query-backed baseline exists, the current baseline is unusable, DB\u002Fstatus\u002Fschema validation fails, zero active-generation `path_index` rows exist, the user explicitly requested a rebuild (`explicit_rebuild_requested`), or the repository architecture changed so broadly that the baseline identity is invalid (`baseline_identity_invalid`).\n- Do not escalate merely because the affected closure is uncertain; record the uncertainty as partial\u002Flow-confidence update data with `known_unknowns` and `minimal_live_reads`.\n- Do not escalate merely because `validate-build` reports bounded path identity reconciliation debt; classify and repair those identities inside `sp-map-update` first.\n- Record the exact reason for escalation, including the failed baseline, DB, schema, explicit-request, or architecture-replacement fact.\n\n## Update Duties\n\n`sp-map-update` must:\n\n- compute diff impact closure\n- refresh affected evidence\n- apply updates as a `patch-in-active-generation` operation against the current\n  query-backed baseline unless validation proves a rebuild is required\n- invalidate affected graph claims with an auditable transition to `stale`; return their stable IDs in `affected_graph_claims`\n- reconcile an affected claim only from claim-specific bounded evidence through `project-cognition claim-reconcile prepare`, then execute its returned `apply_argv` through `project-cognition claim-reconcile apply`; generic verification and `result_state=ready` must not re-promote claims\n- detect and repair stale retrieval signals, including obsolete aliases,\n  colloquial user phrases, concept routes, and ownership hints\n- update or create conflicts\n- preserve or revise `selected_concepts` routing evidence when changed paths,\n  user supplements, or runtime validation show that prior concept selection\n  would now misroute a query\n- preserve or revise `rejected_concepts` routing evidence when user corrections\n  or repository evidence show that a plausible alias belongs to the wrong\n  domain\n- update affected runtime records with proven facts, low-confidence claims, conflicts, stale markers, known unknowns, and minimal live reads\n- must not re-promote a graph claim from workflow finalization alone\n- produce an incremental update record\n- verify the shared freshness contract after the update record is written\n- run the successful-refresh finalizer when that verification proves the runtime ready\n\n## Claude Code Map 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- Keep map packet\u002Fresult schemas from this workflow authoritative; do not substitute implementation `WorkerTaskResult` fields for map scan\u002Fbuild\u002Fupdate packet contracts.\n",{"name":5,"metadata":24,"description":7,"argument-hint":27,"compatibility":28,"user-invocable":29},{"author":25,"source":26},"github-spec-kit","templates\u002Fcommands\u002Fmap-update.md","Optional changed path, subsystem, or stale cognition area to refresh incrementally","Requires spec-kit project structure with .specify\u002F directory",true,"main","021f5cbe02157229460a577e9a585f2da6d78cb0",".claude\u002Fskills\u002Fsp-map-update","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-map-update",{"tool":42,"command":43},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill sp-map-update",{"tool":45,"command":46},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill sp-map-update","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-map-update\u002FSKILL.md",[49,55],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002FINDEX.md","REFERENCE","参考文档",609,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-map-update\u002Freferences\u002FINDEX.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fsemantic-work-contract.md",32218,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-map-update\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",[],[]]