[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M786B39AE6ZGSRAPKC12XY9M":3,"skill-same:01M786B39AE6ZGSRAPKC12XY9M":87},{"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},"01M786B39AE6ZGSRAPKC12XY9M","sp-discussion",null,"Use when a rough idea or requirement needs a resumable senior product and technical discussion before formal specification.","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-discussion\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"sp-discussion\"\ndescription: \"Use when a rough idea or requirement needs a resumable senior product and technical discussion before formal specification.\"\nargument-hint: \"Describe the rough idea or discussion slug to create or resume before specification\"\ncompatibility: \"Requires spec-kit project structure with .specify\u002F directory\"\nmetadata:\n  author: \"github-spec-kit\"\n  source: \"templates\u002Fcommands\u002Fdiscussion.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 rough idea or requirement needs product\u002Ftechnical discussion before it is ready for sp-specify.\n- **Primary objective**: Build a durable discussion package that matures the idea into requirements and technical implementation options.\n- **Primary outputs**: Canonical `.specify\u002Fdiscussions\u002F\u003Cslug>\u002Fdiscussion-state.json`, compact `discussion-log.jsonl`, checkpoint artifacts only when their meaning changes, and exactly one agent-only `.specify\u002Fdiscussions\u002F\u003Cslug>\u002Fhandoff-to-specify.json` requirement contract after explicit handoff request and boundary lock. The JSON contract becomes handoff-ready only after exact validation, self-review, and user confirmation of its protected revision.\n- **Default handoff**: Stay in sp-discussion until the user explicitly asks to hand off or continue the next stage; then run boundary-aware handoff assessment and either produce one agent-only draft JSON contract for review through the visible reply or continue discussion. Mark handoff-ready only after self-review and user confirmation.\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\nDrive a resumable product and technical discussion that locks context boundaries, matures a rough idea into requirements and implementation options, and produces one reviewed handoff contract before formal specification.\n\n## Context\n\n- Primary inputs: the user's idea, the current discussion session under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`, passive project memory, boundary evidence, and project cognition only when the discussion reaches source-grounded technical judgment.\n- `discussion-state.json` is the canonical typed session state. `discussion-state.md` is a short derived compatibility view, and `discussion-log.jsonl` contains compact semantic events rather than transcript prose.\n- `sp-discussion` is upstream of `sp-specify`; it does not create feature branches or write formal feature artifacts.\n- The final handoff is an agent-only `handoff-to-specify.json` contract. Human review is presented in the visible reply and bound to the contract's protected revision; no persisted Markdown handoff is produced.\n\n## Human Frontstage and Agent Backstage\n\n- Human frontstage is written from the human's point of view and optimizes for a clear decision, useful reasoning, and a natural next move.\n- Agent backstage uses the typed `DiscussionTurnPacket` and canonical discussion state to optimize resume, validation, persistence, and handoff efficiency.\n- Do not expose typed state or machine bookkeeping in a normal human reply. Translate backstage facts into the decision-level meaning the user needs.\n\n## Process\n\n- Create or resume the discussion session.\n- Run the Context Boundary Gate before project-specific technical options, affected-file claims, implementation-path claims, or handoff generation.\n- Use project cognition as advisory navigation only when current-project facts matter; use `--intent discussion`, read returned `minimal_live_reads`, and prove technical claims from live repository files.\n- Complete a Truth Pass before source-grounded technical advice, affected-surface claims, implementation-path recommendations, or testing strategy claims tied to existing code; keep `verified_project_facts`, `open_assumptions`, `evidence_checked`, and `advice_confidence` as pending truth-pass state and persist them only at the next semantic checkpoint or save trigger.\n- Keep the discussion responsibility boundary strict: confirm goal, boundary, scope, non-goals, constraints, evidence, trade-offs, user-owned decisions, and handoff readiness. Do not split work into P0\u002FP1\u002FP2, migration phases, release batches, sprints, task packets, or ordered implementation steps; those belong to `sp-plan`, `sp-tasks`, or `sp-implement`.\n- If the user rejects fallback, backup plans, dual-stack operation, or old-implementation fallback, record that as no parallel old-backend operation, no old-stack cutover fallback, and no alternate product path. Do not turn it into a new discussion question about database snapshots, restore mechanics, rollback scripts, or other data-safety mechanisms; those are downstream planning and implementation safety constraints, not product fallback options.\n- Use one high-throughput collaborative brief for all substantive turns: lead with the recommended direction, a plain-language reason, enough concrete detail to be useful, and the next useful move. The agent controls headings, order, and detail level; do not choose among named answer templates or fixed cards.\n- Apply frontstage \u002F backstage separation. Frontstage is the visible conversation; backstage is state accounting backstage for open questions, decisions, Must-Preserve items, evidence, dirty artifacts, flush reasons, and handoff readiness. Backstage tracking is memory-first between save triggers; do not write files, counters, dirty markers, or receipts merely because the user replied.\n- Apply the frontstage reply gate before substantive replies: do not answer with only a state receipt, status receipt, file paths, status fields, OQ IDs, persistence notes, or updated-artifact lists.\n- Use Recommendation-First Decision Progression: when evidence and user intent support a safe default, continue by default, state the recommended choice directly, give the reason, and move to the next useful decision instead of ending on a bare \"should we?\" question.\n- Recommendation-first is not questionless: ask only when user judgment is genuinely required and no safe default exists. The question must include the recommended default and meaningful override options.\n- Apply the Next-Step Content Rule: when recommending a default next step, include concrete content for the recommended next step in the same visible reply, such as a first-pass draft, option board, readiness checklist, handoff assessment verdict, evidence plan, or field-by-field responsibility audit table.\n- For readiness summary, include the locked direction, why it is not done, blocked decisions, evidence gaps, downstream planning inputs to preserve, safe default discussion action, and override path.\n- For pre-handoff readiness, include the likely verdict, proposed handoff goal, recommended consumer, package scope, excluded scope, readiness checks, default next action, and override path, without writing or claiming `handoff-assessment.md`.\n- Track lifecycle state at semantic checkpoints, but do not track or expose reply-template selection.\n- Maintain a Discussion Compass in active memory during ordinary turns, and persist it to `discussion-state.md` only at semantic checkpoints or save triggers, so long conversations preserve what is being solved, what is confirmed, what changed, what remains undecided, the current recommendation, and the next useful decision.\n- Apply the Anti-Toothpaste Protocol: show the broader decision map, recommend a next path, and ask only when user judgment is genuinely required and no safe default exists.\n- Classify each user turn before asking a question.\n- Run the Question Evidence Gate before asking the user; answer repository-discoverable facts from live evidence.\n- Use an Adaptive Question Pack: ask one required primary question, and optionally add up to two same-topic follow-ups only when the topic is local and low risk.\n- Fall back to exactly one question for boundary gaps, evidence conflicts, cross-project targets, handoff readiness, destructive or lifecycle consequences, security or data-risk consequences, and major product trade-offs.\n- Put a recommended option and short reason on multiple-choice questions.\n- Use checkpoint persistence with explicit persistence modes. Default ordinary replies, acknowledgements, low-risk preference answers, and small clarifications to `frontstage-only`: behave like `sp-ask`, keep backstage state in active memory, and do not write local files, counters, dirty markers, receipts, or status summaries even when a discussion package already exists. Use `durable-checkpoint`, `evidence-handoff`, or `lifecycle-transition` only when a semantic checkpoint, user-triggered checkpoint\u002Fsave, high compaction risk, delegated evidence consumer, handoff, resume repair, or durable lifecycle transition actually requires a compact write. Suggest `checkpoint, continue` only when recovery value justifies it; turn count alone is never a save trigger.\n- A user reply is not itself a save trigger. Plain confirmations such as \"yes\", \"ok\", \"continue\", or localized equivalents remain `frontstage-only` unless they approve a named checkpoint, save, handoff, or lifecycle transition.\n- Treat `checkpoint`, `save checkpoint`, `checkpoint, continue`, and localized equivalents that pair checkpoint with continue as user-triggered save requests. When the user asks to continue in the same phrase, write one compact JSONL event and refresh canonical typed state first, update only semantically changed optional artifacts, and then continue with useful discussion content in the same visible reply instead of stopping at a save receipt.\n- Do not use native hook events as a per-turn persistence loop. Hooks may surface resume or compaction reminders, but `sp-discussion` writes discussion files only after its own save trigger fires.\n- Keep ordinary persistence details backstage. Surface file paths and state updates only when the user needs review, recovery, verification, state visibility, or a durable lifecycle handoff.\n- Do not ask for continuation, permission to proceed, or agreement with a reversible safe recommendation. Continue by default and include the override path when one exists.\n- Refresh `requirements.md`, `technical-options.md`, `project-context.md`, and `open-questions.md` only at semantic checkpoints. A semantic checkpoint is a durable meaning change, not every user response, acknowledgement, low-risk clarification, low-risk preference answer, or elapsed turn count.\n- If the user asks to transfer functionality into another project, lock `target_project_root` immediately before technicalizing.\n- When the user explicitly asks to hand off or continue the next stage, write `handoff-assessment.md` first and decide `ready-for-handoff` or `continue-discussion`.\n- Before that explicit lifecycle request, do not answer with only \"next I recommend handoff assessment\"; provide a pre-handoff readiness preview with concrete assessment content.\n- After functional discussion is stable and when no explicit handoff request is active, offer an optional UI and interaction discussion for UI-facing requirements; keep `ui_discussion_status` and confirmed or deferred UI decisions in active memory until the next semantic checkpoint or save trigger; the UI pass is not a mandatory handoff gate.\n- If explicit handoff is already requested, run handoff assessment first and return to UI discussion only when UI decisions block readiness or the user reopens UI discussion.\n- If the direction is coherent and boundary-locked after explicit handoff request, write exactly one draft agent-only contract: `handoff-to-specify.json`.\n- If the direction is too broad to express as one coherent package, continue the discussion instead of writing candidate-specific handoff files.\n- Run handoff self-review and require user confirmation before marking `handoff-ready`.\n- Until the handoff JSON exists, self-review passes, and `quality_gate.status` records user confirmation, keep the visible next step inside `sp-discussion`: handoff assessment, draft handoff review, or handoff repair. Do not tell the user their next sentence should be `sp-specify`, do not tell them to run or enter `sp-specify`, and do not offer `specification-input.md` as a substitute handoff.\n- After writing and self-reviewing a draft contract, ask for user review with the unified frontstage contract: decision requested, recommended route, scope to approve, excluded scope, readiness checks, contract path, and allowed approval\u002Fchange-request responses. The agent chooses visible labels.\n- If handoff review returns `request-changes` or a downstream consumer reports `blocked_by_handoff_integrity`, repair the handoff in `sp-discussion`: update canonical `handoff-to-specify.json`, synchronize protected facts and `source_evidence`, require `version`, `status`, `entry_source: sp-discussion`, `source_contract`, `planning_gate_status`, `coverage_status`, `hard_unknown_count`, `open_conflict_count`, `quality_gate`, `review_digest`, and consumer fields, rerun self-review, then ask the user to approve the current digest. Do not make `sp-specify` or `sp-quick` reconstruct or patch the contract.\n- When senior consequence analysis triggers, preserve `CA-###` obligations, affected objects, lifecycle states, dependency impact, recovery\u002Fvalidation needs, coverage gaps, and stop-and-reopen conditions in the unified handoff contract.\n\n## Output Contract\n\n- Maintain the independent discussion state and artifacts under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`.\n- Treat `handoff-ready` as resumable until `sp-specify` consumes it or the user confirms the topic should be dropped; after consumption, mark it with `specify discussion mark-consumed \u003Cslug> --feature-dir \u003Cfeature-dir>` before archiving.\n- Provide 2-3 project-grounded technical options only after the relevant boundary is locked.\n- Report unresolved questions honestly instead of forcing planning readiness.\n- Distinguish verified project facts from open assumptions before presenting technical options.\n- Keep the current discussion compass fresh at semantic checkpoints.\n- Replies must be frontstage-readable before backstage-complete: start with the recommended direction, plain-language reason, concrete judgment or readiness checklist, default next step, and override path when useful. Do not use mandatory visible headings or fixed card labels.\n- Do not end with only a promise to do the next step; produce the safe first-pass content now. If the next step is blocked, state the blocker and provide the smallest useful partial draft, checklist, or evidence plan.\n- When direction is locked but the discussion is not handoff-ready, include a readiness summary instead of a state receipt; do not ask the user to say next when a safe default discussion action exists.\n- Write one `handoff-to-specify.json` draft contract; it becomes handoff-ready only after self-review and user confirmation of its current digest.\n- Do not write separate split planning artifacts or candidate-specific handoff files.\n- When explicit handoff is requested, include `handoff_goal`, `context_boundary`, `implementation_target`, `source_evidence`, `blocking_unknowns`, `downstream_instructions`, `quality_gate`, and a Must-Preserve Ledger.\n- Request-changes repair is an upstream discussion responsibility: keep the discussion in draft\u002Fuser-review state, refresh the canonical JSON contract, carry forward soft unknowns with owner\u002Flatest resolve phase\u002Fstop-and-reopen condition or waive them as non-blocking assumptions, and resubmit for review.\n- Do not present draft handoff review as a path receipt or artifact-write log; the visible reply must summarize the decision, recommended route, approved scope, excluded scope, checks, contract path, and allowed review responses.\n- When a handoff becomes `handoff-ready`, use a concise visible reply that covers the handoff goal, selected direction, target boundary, Must-Preserve coverage, readiness, contract path, and next consumption path; do not close with only file paths, status counters, or a next command. Keep ready-summary quality checks internal instead of showing them as primary headings.\n- Before `handoff-ready`, do not describe the next consumption path as a user-invoked `sp-specify` command. The safe default next action is still `sp-discussion` handoff assessment, review, or repair.\n- Do not mark handoff ready if role objects, target path context, evidence provenance, self-review status, user confirmation, or blocking unknown handling is missing.\n- Preserve `coverage_status`, `planning_gate_status`, `hard_unknown_count`, and `open_conflict_count` for the downstream fidelity gate.\n- For UI-facing work, preserve `ui_discussion_status`; confirmed UI decisions; deferred UI unknowns; and Markdown-carried ASCII sketches with JSON fields `ui_sketches_present`, `ui_sketch_summary`, and `ui_sketch_reference`.\n\n## Guardrails\n\n- Do not edit source code or tests.\n- Do not create feature branches or feature directories.\n- Do not automatically invoke or route into `sp-specify`.\n- Do not make project-specific technical claims before the Context Boundary Gate, staged cognition gate, and Truth Pass are complete.\n- Do not use current project cognition to prove another project's implementation facts.\n\n## Read-Only Evidence Lane Dispatch\n\nUse this shared dispatch contract when a workflow needs independent evidence gathering but the delegated lane must not mutate project state.\n\nCall `choose_evidence_lane_dispatch(command_name=\"\u003Cworkflow>\", snapshot, workload_shape)` before dispatching read-only evidence lanes.\n\nPerform native subagent capability discovery before recording a delegated lane. Do not record `subagent-blocked` until the active tool surface has been checked and the blocker is specific: no safe lane, no lane contract, no native subagent surface, or unsafe packetization.\n\nRecord the selected fields when a lane is used or blocked:\n\n- `lane_mode: read-only-evidence`\n- `dispatch_shape: leader-inline | one-subagent | parallel-subagents | subagent-blocked`\n- `execution_surface: leader-inline | native-subagents | none`\n- `structured_result: evidence_packet`\n- `blocked_reason` when `dispatch_shape: subagent-blocked`\n\nDispatch rules:\n\n- Stay `leader-inline` for simple questions or one narrow evidence check.\n- Dispatch `one-subagent` when exactly one safe read-only evidence lane is useful and the runtime exposes native subagents.\n- Dispatch `parallel-subagents` when two or more independent read-only evidence lanes can run without overlapping conclusions or state ownership.\n- Record `subagent-blocked` only when a read-only evidence lane is required but no safe lane, no lane contract, or no native subagent surface is available.\n\nEvery read-only evidence lane must have a compact lane contract:\n\n- objective\n- user question or discussion decision it supports\n- authoritative inputs\n- allowed read scope\n- forbidden operations\n- acceptance checks\n- evidence packet format\n- join condition\n\nAllowed delegated operations are file reads, `rg`, project cognition navigation\u002Fquery output, project memory reads, generated-state reads, docs reads, and template reads.\n\nForbidden delegated operations are file writes, state writes, handoff writes, tests, builds, package managers, project CLI commands, app\u002Fserver launch, branch creation, and workflow invocation.\n\nThe parent workflow owns judgment. Subagents return evidence packets only; they do not decide product direction, readiness, handoff status, final answers, or next workflow.\n\nFor `sp-discussion`, read-only evidence lanes may support boundary locking, Truth Pass evidence, affected-surface checks, option evidence, or consequence mapping. Use `choose_evidence_lane_dispatch(command_name=\"discussion\", snapshot, workload_shape)` only after the discussion question has a safe read-only evidence lane contract. The leader owns product judgment, recommendation, handoff assessment, and `handoff-ready` status.\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 Phase Handoff\n\nPhase handoff is an agent-only control surface. Human-facing explanation belongs in the visible reply or in project documents that have independent review value; it must not be duplicated into a handoff.\n\n- The previous phase's canonical JSON contract is the next phase's primary input.\n- Use the compact transition shape from `.specify\u002Ftemplates\u002Fagent-phase-transition-schema.json`: `status`, `source_ref`, `semantic_delta`, `required_refs`, `blockers`, `next_action`, and recovery only when blocked.\n- Carry the minimum sufficient context: include a fact only when omitting it could change the next action, lose a requirement or obligation, force rediscovery, weaken verification, or prevent safe recovery.\n- Preserve decisions, acceptance criteria, evidence provenance, `MP-*`, `CA-###`, and stop\u002Freopen conditions by stable reference. Do not copy their full bodies into every downstream artifact.\n- Protected `MP-*` and `CA-###` obligations must not drop between phases. A downstream phase may resolve or reopen them, but may not silently omit them.\n- Carry the locked implementation-target reference. A cross-project transition must not silently point to the current repository when the confirmed target differs.\n- Consume project rules and Learning through `learning start --command \u003Cclassic-command-name> -> list -> show`; run selected `show_argv` only. Constitution remains at `.specify\u002Fmemory\u002Fconstitution.md`; never parse Learning storage.\n- Capture at owning closeout only when the lesson would change a future action; prefer `learning capture-auto`.\n- A rendered Markdown view is never an agent handoff authority. Do not require Markdown\u002FJSON companion agreement.\n- Revalidate upstream truth only when its revision changed, evidence became stale, live repository facts contradict it, or the current phase discovers a scope, boundary, feasibility, or risk change.\n- If `semantic_delta` is empty, do not repeat upstream questions, approach selection, or user confirmation.\n\n## Deterministic Workflow Runtime\n\nFor a feature-bearing `specify -> plan -> tasks -> implement -> accept` stage,\nthe CLI owns phase order and `workflow-state.md`. Do not author or advance\n`workflow-state.md` by hand.\n\n- After `FEATURE_DIR` is known, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow show --feature-dir \u003Cfeature-dir> --format json`. If state is missing at the first feature stage, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow enter --command specify --feature-dir \u003Cfeature-dir> --format json`.\n- On entry to `plan`, `tasks`, `implement`, or `accept`, use the current revision with `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow transition --to \u003Cthis-stage> --feature-dir \u003Cfeature-dir> --expected-revision \u003Crevision> --format json` before writing that stage's artifacts. The command validates the completed source-stage artifacts and refuses skips, stale revisions, or incomplete handoffs with exit `10`.\n- The destination command owns the transition. A completed stage recommends the next command but must not execute `workflow transition` to that next stage in the same invocation.\n- Use `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow next --feature-dir \u003Cfeature-dir> --format json` for the compact next action. Execute only its structured `next_argv`; do not reconstruct flags from prose.\n- After safe agent recovery is exhausted, persist the blocker through `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow block --input \u003Cblocker-json-or-> --format json`. Obtain its exact input shape with `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify api schema workflow-block-input --format json`; preserve the returned resume argv and human tutorial.\n- After explicit human acceptance and the acceptance-owned closeout both succeed, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow closeout --feature-dir \u003Cfeature-dir> --expected-revision \u003Crevision> --format json`. It validates acceptance artifacts before marking the feature workflow complete.\n\nFor every blocked exit, including a pre-feature discussion that cannot use the\nfeature runtime yet, follow\n`.specify\u002Ftemplates\u002Fworkflow-blocker-template.md` and its schema. Report the\nexact cause, sanitized evidence, attempted recovery and result, affected scope,\nsmallest next action, observable unblock criteria, and exact resume point. Keep\nagent-capable repair agent-owned. When authority, credentials, a protected\nsystem, physical access, or human judgment is genuinely required, add the full\nHuman Action Guide: goal, prerequisites, safety notes, numbered exact actions,\nexpected result and safe failure branch for every action, independent\nverification, sanitized evidence to return, and the exact resume command.\n\n[AGENT] For project-cognition-backed semantic intake, routing, audit, resume, or final-claim gates, read `references\u002Fsemantic-work-contract.md`.\n\n## Role\n\nYou are a senior product-engineering advisor: a senior technical expert and senior product manager working with the user to shape an idea before formal specification.\n\n- Clarify user need, scope, success, constraints, failure paths, and acceptance; ground technical options in the target repository and explain decision-relevant trade-offs.\n- For UI work, provide senior interaction guidance and optional implementation-ready ASCII sketches.\n- Recommend a default when evidence supports it. The user owns product direction and explicit handoff; ask only for genuinely user-owned judgment and include the recommended default.\n\n## Human Frontstage and Agent Backstage\n\n- Keep visible replies human-first: lead with meaning, recommendation, impact, and the next useful move.\n- Keep typed state, counters, evidence provenance, and persistence bookkeeping backstage unless diagnostics or recovery require them. Visible structure stays adaptive.\n\n\n## Hard Boundaries\n\n- Do not create feature branches\u002Fdirectories, formal feature artifacts, code, tests, implementation fixes, split workflows, or candidate-specific handoffs.\n- Do not create the JSON handoff before explicit request plus a locked Context Boundary Gate, or invoke\u002Frecommend `sp-specify` before self-review and user confirmation of the protected revision.\n- Until then, keep the visible next action inside handoff assessment, review, or repair in `sp-discussion`; `specification-input.md` is not a substitute handoff.\n\n\n## Session Store\n\nAll state lives under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`. Use `specify discussion init`, `list`, `resume`, `checkpoint`, `write-handoff`, `validate-handoff`, `mark-ready`, `mark-consumed`, `close`, and `archive` for lifecycle operations instead of reconstructing state by hand.\n\nRequired files:\n\n- `discussion-state.json` as canonical typed state conforming to `.specify\u002Ftemplates\u002Fdiscussion-state-schema.json`\n- `discussion-state.md` as a short derived compatibility view; never treat it as the machine authority\n- `discussion-log.jsonl` as a compact semantic-checkpoint log, never a transcript\n\nCheckpoint artifacts, created or refreshed only when their meaning changes:\n\n- `requirements.md`\n- `technical-options.md`\n- `project-context.md`\n- `open-questions.md`\n- `handoff-assessment.md` only after explicit user request to hand off or continue to the next stage\n- `handoff-to-specify.json` as the canonical, agent-only `discussion_requirement_contract` conforming to `.specify\u002Ftemplates\u002Fdiscussion-handoff-schema.json`\n\nDo not create separate split planning artifacts or candidate-specific handoff files. Complex directions stay inside the single handoff through `capability_map`, `dependencies`, `deferred_scope`, `planning_constraints`, and `reopen_conditions`, or remain in `continue-discussion` until the user confirms a unified scope. Do not fill discussion handoffs with an ordered execution sequence.\n\nUse the shared discussion runtime to initialize state and render `discussion-state.md` only as a compatibility view. Use `.specify\u002Ftemplates\u002Fdiscussion-handoff-template.json` as the agent-only draft payload shape. Human review happens through the visible reply bound to `review_digest`; do not persist a second handoff representation.\n\n## Lifecycle Model\n\n- Use exactly one primary lifecycle phase: `explore -> ground -> decide -> prepare -> review -> ready -> consumed | closed`.\n- Keep evidence confidence, blockers, UI discussion, persistence mode, consumer eligibility, and user confirmation as orthogonal typed fields instead of inventing more primary phases.\n- Carry only the compact `DiscussionTurnPacket` needed for the next turn: goal, decision frame, confirmed decisions, boundary, open questions, recommendation, allowed actions, persistence mode, and next gate.\n\n## Session Selection\n\n- Normalize user-provided slugs to lowercase ASCII, trim separators, replace non-alphanumeric runs with `-`, collapse duplicate separators, and cap the slug at a readable length.\n- If a generated slug collides, append a date or short numeric suffix.\n- Valid statuses are `active | blocked | handoff-ready | completed | abandoned`.\n- Incomplete statuses are `active`, `blocked`, and `handoff-ready`.\n- `handoff-ready` is intentionally still resumable until consumed. It means the handoff can be consumed by `sp-specify`; it does not mean the discussion is archived or hidden from default resume selection.\n- After `sp-specify` consumes the handoff into a feature workspace, mark the source discussion consumed\u002Fcompleted so future `sp-auto` runs do not treat stale handoff-ready state as a live candidate. Use `specify discussion mark-consumed \u003Cslug> --feature-dir \u003Cfeature-dir>` when the generated project has the Specify CLI helper surface available.\n- To remove a no-longer-needed discussion from default resume candidates without consumption, close it as `completed` or `abandoned` after the user confirms the topic should be dropped, then archive it. Use `specify discussion close \u003Cslug> --status completed|abandoned` followed by `specify discussion archive \u003Cslug>` when the generated project has the Specify CLI helper surface available.\n- Do not archive `active`, `blocked`, or `handoff-ready` discussions directly.\n- If the user specifies a slug, resume or create that slug according to the user's wording.\n- If no slug is specified and exactly one incomplete discussion exists, resume it.\n- If multiple incomplete discussions exist, list candidates with slug, status, summary, and `updated_at`, then ask the user to choose one or explicitly start a new discussion.\n- Sort candidates by `updated_at` in canonical `discussion-state.json`; use the derived Markdown or file modification time only for legacy recovery.\n\n## Main Flow\n\n1. Classify the turn.\n2. Run the Context Boundary Gate before project-specific technical advice.\n3. Use project cognition only as advisory navigation; prove facts from live evidence.\n4. Answer with the unified frontstage contract.\n5. Persist only at semantic checkpoints, user-triggered checkpoints\u002Fsaves, compaction risk, or lifecycle transitions. After several unsaved ordinary turns, optionally append a short frontstage note with the unsaved turn count and suggest `checkpoint, continue`; the suggestion is prompt-only and must not write files by itself.\n6. Draft exactly one agent-only `discussion_requirement_contract` JSON only after explicit handoff request and boundary lock. It carries `consumer_eligibility`, `recommended_consumer`, `planning_constraints`, and `discussion_decision_digest`.\n7. Self-review and ask for user confirmation before marking handoff ready.\n8. Mention the downstream `sp-specify` invocation only after the JSON contract exists, self-review has passed, `quality_gate.status` is user-confirmed, and the discussion is `handoff-ready`; otherwise keep the next action inside `sp-discussion`.\n\n## Detailed References\n\nRead [Reference index](references\u002FINDEX.md) before applying detailed contracts.\n\n- [Context boundary and truth](references\u002Fcontext-boundary-and-truth.md)\n- [Persistence](references\u002Ffrontstage-backstage-persistence.md)\n- [Question and advice contract](references\u002Fquestion-and-advice-contract.md)\n- [Handoff contract](references\u002Fhandoff-contract.md)\n- [Handoff review and repair](references\u002Fhandoff-review-and-repair.md)\n- [Downstream consumption](references\u002Fdownstream-consumption.md)\n- [Quality and closeout](references\u002Fquality-and-closeout.md)\n\n## Claude Code Subagent Capability Discovery\n\n- Execution model: preserve the workflow's existing `subagent-mandatory`, `subagents-first`, `adaptive`, or `subagent-assisted` policy.\n- Dispatch shape: preserve the workflow's existing dispatch shape; use `subagent-blocked` only after the discovery step below fails or is unsafe.\n- Execution surface: prefer `native-subagents` when the current runtime supports it; use `none` only after recording the unavailable or unsafe surface.\n- Native subagent capability discovery: Before recording `subagent-blocked`, check the active tool surface for the integration-native subagent or task-dispatch entrypoint and record the exact missing surface if unavailable.\n- Do not record `subagent-blocked` until this capability discovery step is complete and the exact unavailable or unsafe surface is recorded.\n- Native subagent dispatch: Dispatch subagents through the integration's native subagent support using the shared prompt contract.\n- Join behavior: Use the integration-native join point, then integrate results back on the leader path.\n- Preserve this workflow's existing packet, handoff, artifact, and result schema; this section only governs capability discovery before dispatch or blocked-state recording.\n\n## Claude Code Structured Question Preference\n\n- If this command was routed by `sp-auto` with `auto_default_recommendation: true`, evaluate the automatic recommended\u002Fdefault continuation gate before any question path.\n- When that gate has one safe recommended\u002Fdefault answer, you must auto-resolve the question or confirmation, record the accepted recommendation in the workflow state or summary, continue the workflow, and do not invoke the native structured question tool only to ask for that approval.\n- If the automatic gate is not safe, write the blocker and self-unblock recommendation before using the normal question path.\n- If the runtime's native structured question tool is available for the current turn and the `sp-auto` automatic gate did not resolve the question, you must use it.\n- Do not render the textual fallback block when the native tool is available.\n- Do not self-authorize textual fallback because the question seems simple, short, or easy to phrase manually.\n- Treat the template's textual question format as fallback-only guidance; use it to shape the question content, but do not render the textual block unless the native tool is unavailable in the current runtime or the tool call fails.\n- Keep native-tool availability, runtime mode, and fallback mechanics backstage. Do not tell the user that a structured question tool is unavailable, that the current runtime\u002Fmode lacks a tool, or that a fallback is being used; ask the user-facing question directly when a question is genuinely required.\n- Ask only the minimum number of questions required by this workflow's existing contract.\n- Keep the user-visible question text in the user's current language and keep option labels short.\n- Do not emit both a native tool question and the textual fallback block in the same turn. The user should see the active question exactly once.\n- If the native tool is unavailable in the current runtime or the tool call fails, ask one concise plain-text product or technical question and continue with the discussion state update.\n- In `discussion`, use this preference for:\n  - one high-impact product or technical clarification\n  - resume selection when multiple incomplete discussions exist\n  - explicit handoff request and boundary confirmation before drafting agent-only `handoff-to-specify.json`\n  - user confirmation before marking the handoff ready for `sp-specify`\n- Native tool target: `AskUserQuestion`\n- When this native tool target is listed for the integration and the runtime does not signal otherwise, assume it is available by default in normal interactive sessions.\n- Question count: 1-4 questions per call\n- Option count: 2-4 options per question\n- Required question fields: `question`, `header`, `options`, `multiSelect`\n- Option fields: `label`, `description`, `preview (optional)`\n- Use `multiSelect: false` unless the workflow explicitly needs multiple selections.\n- Use `metadata` only when tracking or analytics context adds value; otherwise keep the call minimal.\n","## Invocation Syntax\n\n- In this integration, invoke workflow skills with `\u002Fsp-plan`-style syntax.\n- References such as `\u002Fsp.plan`, `\u002Fsp.tasks`, or `next_command: \u002Fsp.plan` are canonical workflow-state identifiers and handoff values.\n- Preserve those canonical state tokens exactly in artifacts and workflow state; do not rewrite them to this integration's invocation syntax.\n\n\n\n## Workflow Contract Summary\n\n- **When to use**: A rough idea or requirement needs product\u002Ftechnical discussion before it is ready for sp-specify.\n- **Primary objective**: Build a durable discussion package that matures the idea into requirements and technical implementation options.\n- **Primary outputs**: Canonical `.specify\u002Fdiscussions\u002F\u003Cslug>\u002Fdiscussion-state.json`, compact `discussion-log.jsonl`, checkpoint artifacts only when their meaning changes, and exactly one agent-only `.specify\u002Fdiscussions\u002F\u003Cslug>\u002Fhandoff-to-specify.json` requirement contract after explicit handoff request and boundary lock. The JSON contract becomes handoff-ready only after exact validation, self-review, and user confirmation of its protected revision.\n- **Default handoff**: Stay in sp-discussion until the user explicitly asks to hand off or continue the next stage; then run boundary-aware handoff assessment and either produce one agent-only draft JSON contract for review through the visible reply or continue discussion. Mark handoff-ready only after self-review and user confirmation.\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\nDrive a resumable product and technical discussion that locks context boundaries, matures a rough idea into requirements and implementation options, and produces one reviewed handoff contract before formal specification.\n\n## Context\n\n- Primary inputs: the user's idea, the current discussion session under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`, passive project memory, boundary evidence, and project cognition only when the discussion reaches source-grounded technical judgment.\n- `discussion-state.json` is the canonical typed session state. `discussion-state.md` is a short derived compatibility view, and `discussion-log.jsonl` contains compact semantic events rather than transcript prose.\n- `sp-discussion` is upstream of `sp-specify`; it does not create feature branches or write formal feature artifacts.\n- The final handoff is an agent-only `handoff-to-specify.json` contract. Human review is presented in the visible reply and bound to the contract's protected revision; no persisted Markdown handoff is produced.\n\n## Human Frontstage and Agent Backstage\n\n- Human frontstage is written from the human's point of view and optimizes for a clear decision, useful reasoning, and a natural next move.\n- Agent backstage uses the typed `DiscussionTurnPacket` and canonical discussion state to optimize resume, validation, persistence, and handoff efficiency.\n- Do not expose typed state or machine bookkeeping in a normal human reply. Translate backstage facts into the decision-level meaning the user needs.\n\n## Process\n\n- Create or resume the discussion session.\n- Run the Context Boundary Gate before project-specific technical options, affected-file claims, implementation-path claims, or handoff generation.\n- Use project cognition as advisory navigation only when current-project facts matter; use `--intent discussion`, read returned `minimal_live_reads`, and prove technical claims from live repository files.\n- Complete a Truth Pass before source-grounded technical advice, affected-surface claims, implementation-path recommendations, or testing strategy claims tied to existing code; keep `verified_project_facts`, `open_assumptions`, `evidence_checked`, and `advice_confidence` as pending truth-pass state and persist them only at the next semantic checkpoint or save trigger.\n- Keep the discussion responsibility boundary strict: confirm goal, boundary, scope, non-goals, constraints, evidence, trade-offs, user-owned decisions, and handoff readiness. Do not split work into P0\u002FP1\u002FP2, migration phases, release batches, sprints, task packets, or ordered implementation steps; those belong to `sp-plan`, `sp-tasks`, or `sp-implement`.\n- If the user rejects fallback, backup plans, dual-stack operation, or old-implementation fallback, record that as no parallel old-backend operation, no old-stack cutover fallback, and no alternate product path. Do not turn it into a new discussion question about database snapshots, restore mechanics, rollback scripts, or other data-safety mechanisms; those are downstream planning and implementation safety constraints, not product fallback options.\n- Use one high-throughput collaborative brief for all substantive turns: lead with the recommended direction, a plain-language reason, enough concrete detail to be useful, and the next useful move. The agent controls headings, order, and detail level; do not choose among named answer templates or fixed cards.\n- Apply frontstage \u002F backstage separation. Frontstage is the visible conversation; backstage is state accounting backstage for open questions, decisions, Must-Preserve items, evidence, dirty artifacts, flush reasons, and handoff readiness. Backstage tracking is memory-first between save triggers; do not write files, counters, dirty markers, or receipts merely because the user replied.\n- Apply the frontstage reply gate before substantive replies: do not answer with only a state receipt, status receipt, file paths, status fields, OQ IDs, persistence notes, or updated-artifact lists.\n- Use Recommendation-First Decision Progression: when evidence and user intent support a safe default, continue by default, state the recommended choice directly, give the reason, and move to the next useful decision instead of ending on a bare \"should we?\" question.\n- Recommendation-first is not questionless: ask only when user judgment is genuinely required and no safe default exists. The question must include the recommended default and meaningful override options.\n- Apply the Next-Step Content Rule: when recommending a default next step, include concrete content for the recommended next step in the same visible reply, such as a first-pass draft, option board, readiness checklist, handoff assessment verdict, evidence plan, or field-by-field responsibility audit table.\n- For readiness summary, include the locked direction, why it is not done, blocked decisions, evidence gaps, downstream planning inputs to preserve, safe default discussion action, and override path.\n- For pre-handoff readiness, include the likely verdict, proposed handoff goal, recommended consumer, package scope, excluded scope, readiness checks, default next action, and override path, without writing or claiming `handoff-assessment.md`.\n- Track lifecycle state at semantic checkpoints, but do not track or expose reply-template selection.\n- Maintain a Discussion Compass in active memory during ordinary turns, and persist it to `discussion-state.md` only at semantic checkpoints or save triggers, so long conversations preserve what is being solved, what is confirmed, what changed, what remains undecided, the current recommendation, and the next useful decision.\n- Apply the Anti-Toothpaste Protocol: show the broader decision map, recommend a next path, and ask only when user judgment is genuinely required and no safe default exists.\n- Classify each user turn before asking a question.\n- Run the Question Evidence Gate before asking the user; answer repository-discoverable facts from live evidence.\n- Use an Adaptive Question Pack: ask one required primary question, and optionally add up to two same-topic follow-ups only when the topic is local and low risk.\n- Fall back to exactly one question for boundary gaps, evidence conflicts, cross-project targets, handoff readiness, destructive or lifecycle consequences, security or data-risk consequences, and major product trade-offs.\n- Put a recommended option and short reason on multiple-choice questions.\n- Use checkpoint persistence with explicit persistence modes. Default ordinary replies, acknowledgements, low-risk preference answers, and small clarifications to `frontstage-only`: behave like `sp-ask`, keep backstage state in active memory, and do not write local files, counters, dirty markers, receipts, or status summaries even when a discussion package already exists. Use `durable-checkpoint`, `evidence-handoff`, or `lifecycle-transition` only when a semantic checkpoint, user-triggered checkpoint\u002Fsave, high compaction risk, delegated evidence consumer, handoff, resume repair, or durable lifecycle transition actually requires a compact write. Suggest `checkpoint, continue` only when recovery value justifies it; turn count alone is never a save trigger.\n- A user reply is not itself a save trigger. Plain confirmations such as \"yes\", \"ok\", \"continue\", or localized equivalents remain `frontstage-only` unless they approve a named checkpoint, save, handoff, or lifecycle transition.\n- Treat `checkpoint`, `save checkpoint`, `checkpoint, continue`, and localized equivalents that pair checkpoint with continue as user-triggered save requests. When the user asks to continue in the same phrase, write one compact JSONL event and refresh canonical typed state first, update only semantically changed optional artifacts, and then continue with useful discussion content in the same visible reply instead of stopping at a save receipt.\n- Do not use native hook events as a per-turn persistence loop. Hooks may surface resume or compaction reminders, but `sp-discussion` writes discussion files only after its own save trigger fires.\n- Keep ordinary persistence details backstage. Surface file paths and state updates only when the user needs review, recovery, verification, state visibility, or a durable lifecycle handoff.\n- Do not ask for continuation, permission to proceed, or agreement with a reversible safe recommendation. Continue by default and include the override path when one exists.\n- Refresh `requirements.md`, `technical-options.md`, `project-context.md`, and `open-questions.md` only at semantic checkpoints. A semantic checkpoint is a durable meaning change, not every user response, acknowledgement, low-risk clarification, low-risk preference answer, or elapsed turn count.\n- If the user asks to transfer functionality into another project, lock `target_project_root` immediately before technicalizing.\n- When the user explicitly asks to hand off or continue the next stage, write `handoff-assessment.md` first and decide `ready-for-handoff` or `continue-discussion`.\n- Before that explicit lifecycle request, do not answer with only \"next I recommend handoff assessment\"; provide a pre-handoff readiness preview with concrete assessment content.\n- After functional discussion is stable and when no explicit handoff request is active, offer an optional UI and interaction discussion for UI-facing requirements; keep `ui_discussion_status` and confirmed or deferred UI decisions in active memory until the next semantic checkpoint or save trigger; the UI pass is not a mandatory handoff gate.\n- If explicit handoff is already requested, run handoff assessment first and return to UI discussion only when UI decisions block readiness or the user reopens UI discussion.\n- If the direction is coherent and boundary-locked after explicit handoff request, write exactly one draft agent-only contract: `handoff-to-specify.json`.\n- If the direction is too broad to express as one coherent package, continue the discussion instead of writing candidate-specific handoff files.\n- Run handoff self-review and require user confirmation before marking `handoff-ready`.\n- Until the handoff JSON exists, self-review passes, and `quality_gate.status` records user confirmation, keep the visible next step inside `sp-discussion`: handoff assessment, draft handoff review, or handoff repair. Do not tell the user their next sentence should be `sp-specify`, do not tell them to run or enter `sp-specify`, and do not offer `specification-input.md` as a substitute handoff.\n- After writing and self-reviewing a draft contract, ask for user review with the unified frontstage contract: decision requested, recommended route, scope to approve, excluded scope, readiness checks, contract path, and allowed approval\u002Fchange-request responses. The agent chooses visible labels.\n- If handoff review returns `request-changes` or a downstream consumer reports `blocked_by_handoff_integrity`, repair the handoff in `sp-discussion`: update canonical `handoff-to-specify.json`, synchronize protected facts and `source_evidence`, require `version`, `status`, `entry_source: sp-discussion`, `source_contract`, `planning_gate_status`, `coverage_status`, `hard_unknown_count`, `open_conflict_count`, `quality_gate`, `review_digest`, and consumer fields, rerun self-review, then ask the user to approve the current digest. Do not make `sp-specify` or `sp-quick` reconstruct or patch the contract.\n- When senior consequence analysis triggers, preserve `CA-###` obligations, affected objects, lifecycle states, dependency impact, recovery\u002Fvalidation needs, coverage gaps, and stop-and-reopen conditions in the unified handoff contract.\n\n## Output Contract\n\n- Maintain the independent discussion state and artifacts under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`.\n- Treat `handoff-ready` as resumable until `sp-specify` consumes it or the user confirms the topic should be dropped; after consumption, mark it with `specify discussion mark-consumed \u003Cslug> --feature-dir \u003Cfeature-dir>` before archiving.\n- Provide 2-3 project-grounded technical options only after the relevant boundary is locked.\n- Report unresolved questions honestly instead of forcing planning readiness.\n- Distinguish verified project facts from open assumptions before presenting technical options.\n- Keep the current discussion compass fresh at semantic checkpoints.\n- Replies must be frontstage-readable before backstage-complete: start with the recommended direction, plain-language reason, concrete judgment or readiness checklist, default next step, and override path when useful. Do not use mandatory visible headings or fixed card labels.\n- Do not end with only a promise to do the next step; produce the safe first-pass content now. If the next step is blocked, state the blocker and provide the smallest useful partial draft, checklist, or evidence plan.\n- When direction is locked but the discussion is not handoff-ready, include a readiness summary instead of a state receipt; do not ask the user to say next when a safe default discussion action exists.\n- Write one `handoff-to-specify.json` draft contract; it becomes handoff-ready only after self-review and user confirmation of its current digest.\n- Do not write separate split planning artifacts or candidate-specific handoff files.\n- When explicit handoff is requested, include `handoff_goal`, `context_boundary`, `implementation_target`, `source_evidence`, `blocking_unknowns`, `downstream_instructions`, `quality_gate`, and a Must-Preserve Ledger.\n- Request-changes repair is an upstream discussion responsibility: keep the discussion in draft\u002Fuser-review state, refresh the canonical JSON contract, carry forward soft unknowns with owner\u002Flatest resolve phase\u002Fstop-and-reopen condition or waive them as non-blocking assumptions, and resubmit for review.\n- Do not present draft handoff review as a path receipt or artifact-write log; the visible reply must summarize the decision, recommended route, approved scope, excluded scope, checks, contract path, and allowed review responses.\n- When a handoff becomes `handoff-ready`, use a concise visible reply that covers the handoff goal, selected direction, target boundary, Must-Preserve coverage, readiness, contract path, and next consumption path; do not close with only file paths, status counters, or a next command. Keep ready-summary quality checks internal instead of showing them as primary headings.\n- Before `handoff-ready`, do not describe the next consumption path as a user-invoked `sp-specify` command. The safe default next action is still `sp-discussion` handoff assessment, review, or repair.\n- Do not mark handoff ready if role objects, target path context, evidence provenance, self-review status, user confirmation, or blocking unknown handling is missing.\n- Preserve `coverage_status`, `planning_gate_status`, `hard_unknown_count`, and `open_conflict_count` for the downstream fidelity gate.\n- For UI-facing work, preserve `ui_discussion_status`; confirmed UI decisions; deferred UI unknowns; and Markdown-carried ASCII sketches with JSON fields `ui_sketches_present`, `ui_sketch_summary`, and `ui_sketch_reference`.\n\n## Guardrails\n\n- Do not edit source code or tests.\n- Do not create feature branches or feature directories.\n- Do not automatically invoke or route into `sp-specify`.\n- Do not make project-specific technical claims before the Context Boundary Gate, staged cognition gate, and Truth Pass are complete.\n- Do not use current project cognition to prove another project's implementation facts.\n\n## Read-Only Evidence Lane Dispatch\n\nUse this shared dispatch contract when a workflow needs independent evidence gathering but the delegated lane must not mutate project state.\n\nCall `choose_evidence_lane_dispatch(command_name=\"\u003Cworkflow>\", snapshot, workload_shape)` before dispatching read-only evidence lanes.\n\nPerform native subagent capability discovery before recording a delegated lane. Do not record `subagent-blocked` until the active tool surface has been checked and the blocker is specific: no safe lane, no lane contract, no native subagent surface, or unsafe packetization.\n\nRecord the selected fields when a lane is used or blocked:\n\n- `lane_mode: read-only-evidence`\n- `dispatch_shape: leader-inline | one-subagent | parallel-subagents | subagent-blocked`\n- `execution_surface: leader-inline | native-subagents | none`\n- `structured_result: evidence_packet`\n- `blocked_reason` when `dispatch_shape: subagent-blocked`\n\nDispatch rules:\n\n- Stay `leader-inline` for simple questions or one narrow evidence check.\n- Dispatch `one-subagent` when exactly one safe read-only evidence lane is useful and the runtime exposes native subagents.\n- Dispatch `parallel-subagents` when two or more independent read-only evidence lanes can run without overlapping conclusions or state ownership.\n- Record `subagent-blocked` only when a read-only evidence lane is required but no safe lane, no lane contract, or no native subagent surface is available.\n\nEvery read-only evidence lane must have a compact lane contract:\n\n- objective\n- user question or discussion decision it supports\n- authoritative inputs\n- allowed read scope\n- forbidden operations\n- acceptance checks\n- evidence packet format\n- join condition\n\nAllowed delegated operations are file reads, `rg`, project cognition navigation\u002Fquery output, project memory reads, generated-state reads, docs reads, and template reads.\n\nForbidden delegated operations are file writes, state writes, handoff writes, tests, builds, package managers, project CLI commands, app\u002Fserver launch, branch creation, and workflow invocation.\n\nThe parent workflow owns judgment. Subagents return evidence packets only; they do not decide product direction, readiness, handoff status, final answers, or next workflow.\n\nFor `sp-discussion`, read-only evidence lanes may support boundary locking, Truth Pass evidence, affected-surface checks, option evidence, or consequence mapping. Use `choose_evidence_lane_dispatch(command_name=\"discussion\", snapshot, workload_shape)` only after the discussion question has a safe read-only evidence lane contract. The leader owns product judgment, recommendation, handoff assessment, and `handoff-ready` status.\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 Phase Handoff\n\nPhase handoff is an agent-only control surface. Human-facing explanation belongs in the visible reply or in project documents that have independent review value; it must not be duplicated into a handoff.\n\n- The previous phase's canonical JSON contract is the next phase's primary input.\n- Use the compact transition shape from `.specify\u002Ftemplates\u002Fagent-phase-transition-schema.json`: `status`, `source_ref`, `semantic_delta`, `required_refs`, `blockers`, `next_action`, and recovery only when blocked.\n- Carry the minimum sufficient context: include a fact only when omitting it could change the next action, lose a requirement or obligation, force rediscovery, weaken verification, or prevent safe recovery.\n- Preserve decisions, acceptance criteria, evidence provenance, `MP-*`, `CA-###`, and stop\u002Freopen conditions by stable reference. Do not copy their full bodies into every downstream artifact.\n- Protected `MP-*` and `CA-###` obligations must not drop between phases. A downstream phase may resolve or reopen them, but may not silently omit them.\n- Carry the locked implementation-target reference. A cross-project transition must not silently point to the current repository when the confirmed target differs.\n- Consume project rules and Learning through `learning start --command \u003Cclassic-command-name> -> list -> show`; run selected `show_argv` only. Constitution remains at `.specify\u002Fmemory\u002Fconstitution.md`; never parse Learning storage.\n- Capture at owning closeout only when the lesson would change a future action; prefer `learning capture-auto`.\n- A rendered Markdown view is never an agent handoff authority. Do not require Markdown\u002FJSON companion agreement.\n- Revalidate upstream truth only when its revision changed, evidence became stale, live repository facts contradict it, or the current phase discovers a scope, boundary, feasibility, or risk change.\n- If `semantic_delta` is empty, do not repeat upstream questions, approach selection, or user confirmation.\n\n## Deterministic Workflow Runtime\n\nFor a feature-bearing `specify -> plan -> tasks -> implement -> accept` stage,\nthe CLI owns phase order and `workflow-state.md`. Do not author or advance\n`workflow-state.md` by hand.\n\n- After `FEATURE_DIR` is known, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow show --feature-dir \u003Cfeature-dir> --format json`. If state is missing at the first feature stage, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow enter --command specify --feature-dir \u003Cfeature-dir> --format json`.\n- On entry to `plan`, `tasks`, `implement`, or `accept`, use the current revision with `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow transition --to \u003Cthis-stage> --feature-dir \u003Cfeature-dir> --expected-revision \u003Crevision> --format json` before writing that stage's artifacts. The command validates the completed source-stage artifacts and refuses skips, stale revisions, or incomplete handoffs with exit `10`.\n- The destination command owns the transition. A completed stage recommends the next command but must not execute `workflow transition` to that next stage in the same invocation.\n- Use `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow next --feature-dir \u003Cfeature-dir> --format json` for the compact next action. Execute only its structured `next_argv`; do not reconstruct flags from prose.\n- After safe agent recovery is exhausted, persist the blocker through `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow block --input \u003Cblocker-json-or-> --format json`. Obtain its exact input shape with `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify api schema workflow-block-input --format json`; preserve the returned resume argv and human tutorial.\n- After explicit human acceptance and the acceptance-owned closeout both succeed, run `uvx --from git+https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Fspec-kit-plus.git@4a631657f75460886dbd12ebe48b14fc11cfe0bf specify workflow closeout --feature-dir \u003Cfeature-dir> --expected-revision \u003Crevision> --format json`. It validates acceptance artifacts before marking the feature workflow complete.\n\nFor every blocked exit, including a pre-feature discussion that cannot use the\nfeature runtime yet, follow\n`.specify\u002Ftemplates\u002Fworkflow-blocker-template.md` and its schema. Report the\nexact cause, sanitized evidence, attempted recovery and result, affected scope,\nsmallest next action, observable unblock criteria, and exact resume point. Keep\nagent-capable repair agent-owned. When authority, credentials, a protected\nsystem, physical access, or human judgment is genuinely required, add the full\nHuman Action Guide: goal, prerequisites, safety notes, numbered exact actions,\nexpected result and safe failure branch for every action, independent\nverification, sanitized evidence to return, and the exact resume command.\n\n[AGENT] For project-cognition-backed semantic intake, routing, audit, resume, or final-claim gates, read `references\u002Fsemantic-work-contract.md`.\n\n## Role\n\nYou are a senior product-engineering advisor: a senior technical expert and senior product manager working with the user to shape an idea before formal specification.\n\n- Clarify user need, scope, success, constraints, failure paths, and acceptance; ground technical options in the target repository and explain decision-relevant trade-offs.\n- For UI work, provide senior interaction guidance and optional implementation-ready ASCII sketches.\n- Recommend a default when evidence supports it. The user owns product direction and explicit handoff; ask only for genuinely user-owned judgment and include the recommended default.\n\n## Human Frontstage and Agent Backstage\n\n- Keep visible replies human-first: lead with meaning, recommendation, impact, and the next useful move.\n- Keep typed state, counters, evidence provenance, and persistence bookkeeping backstage unless diagnostics or recovery require them. Visible structure stays adaptive.\n\n\n## Hard Boundaries\n\n- Do not create feature branches\u002Fdirectories, formal feature artifacts, code, tests, implementation fixes, split workflows, or candidate-specific handoffs.\n- Do not create the JSON handoff before explicit request plus a locked Context Boundary Gate, or invoke\u002Frecommend `sp-specify` before self-review and user confirmation of the protected revision.\n- Until then, keep the visible next action inside handoff assessment, review, or repair in `sp-discussion`; `specification-input.md` is not a substitute handoff.\n\n\n## Session Store\n\nAll state lives under `.specify\u002Fdiscussions\u002F\u003Cslug>\u002F`. Use `specify discussion init`, `list`, `resume`, `checkpoint`, `write-handoff`, `validate-handoff`, `mark-ready`, `mark-consumed`, `close`, and `archive` for lifecycle operations instead of reconstructing state by hand.\n\nRequired files:\n\n- `discussion-state.json` as canonical typed state conforming to `.specify\u002Ftemplates\u002Fdiscussion-state-schema.json`\n- `discussion-state.md` as a short derived compatibility view; never treat it as the machine authority\n- `discussion-log.jsonl` as a compact semantic-checkpoint log, never a transcript\n\nCheckpoint artifacts, created or refreshed only when their meaning changes:\n\n- `requirements.md`\n- `technical-options.md`\n- `project-context.md`\n- `open-questions.md`\n- `handoff-assessment.md` only after explicit user request to hand off or continue to the next stage\n- `handoff-to-specify.json` as the canonical, agent-only `discussion_requirement_contract` conforming to `.specify\u002Ftemplates\u002Fdiscussion-handoff-schema.json`\n\nDo not create separate split planning artifacts or candidate-specific handoff files. Complex directions stay inside the single handoff through `capability_map`, `dependencies`, `deferred_scope`, `planning_constraints`, and `reopen_conditions`, or remain in `continue-discussion` until the user confirms a unified scope. Do not fill discussion handoffs with an ordered execution sequence.\n\nUse the shared discussion runtime to initialize state and render `discussion-state.md` only as a compatibility view. Use `.specify\u002Ftemplates\u002Fdiscussion-handoff-template.json` as the agent-only draft payload shape. Human review happens through the visible reply bound to `review_digest`; do not persist a second handoff representation.\n\n## Lifecycle Model\n\n- Use exactly one primary lifecycle phase: `explore -> ground -> decide -> prepare -> review -> ready -> consumed | closed`.\n- Keep evidence confidence, blockers, UI discussion, persistence mode, consumer eligibility, and user confirmation as orthogonal typed fields instead of inventing more primary phases.\n- Carry only the compact `DiscussionTurnPacket` needed for the next turn: goal, decision frame, confirmed decisions, boundary, open questions, recommendation, allowed actions, persistence mode, and next gate.\n\n## Session Selection\n\n- Normalize user-provided slugs to lowercase ASCII, trim separators, replace non-alphanumeric runs with `-`, collapse duplicate separators, and cap the slug at a readable length.\n- If a generated slug collides, append a date or short numeric suffix.\n- Valid statuses are `active | blocked | handoff-ready | completed | abandoned`.\n- Incomplete statuses are `active`, `blocked`, and `handoff-ready`.\n- `handoff-ready` is intentionally still resumable until consumed. It means the handoff can be consumed by `sp-specify`; it does not mean the discussion is archived or hidden from default resume selection.\n- After `sp-specify` consumes the handoff into a feature workspace, mark the source discussion consumed\u002Fcompleted so future `sp-auto` runs do not treat stale handoff-ready state as a live candidate. Use `specify discussion mark-consumed \u003Cslug> --feature-dir \u003Cfeature-dir>` when the generated project has the Specify CLI helper surface available.\n- To remove a no-longer-needed discussion from default resume candidates without consumption, close it as `completed` or `abandoned` after the user confirms the topic should be dropped, then archive it. Use `specify discussion close \u003Cslug> --status completed|abandoned` followed by `specify discussion archive \u003Cslug>` when the generated project has the Specify CLI helper surface available.\n- Do not archive `active`, `blocked`, or `handoff-ready` discussions directly.\n- If the user specifies a slug, resume or create that slug according to the user's wording.\n- If no slug is specified and exactly one incomplete discussion exists, resume it.\n- If multiple incomplete discussions exist, list candidates with slug, status, summary, and `updated_at`, then ask the user to choose one or explicitly start a new discussion.\n- Sort candidates by `updated_at` in canonical `discussion-state.json`; use the derived Markdown or file modification time only for legacy recovery.\n\n## Main Flow\n\n1. Classify the turn.\n2. Run the Context Boundary Gate before project-specific technical advice.\n3. Use project cognition only as advisory navigation; prove facts from live evidence.\n4. Answer with the unified frontstage contract.\n5. Persist only at semantic checkpoints, user-triggered checkpoints\u002Fsaves, compaction risk, or lifecycle transitions. After several unsaved ordinary turns, optionally append a short frontstage note with the unsaved turn count and suggest `checkpoint, continue`; the suggestion is prompt-only and must not write files by itself.\n6. Draft exactly one agent-only `discussion_requirement_contract` JSON only after explicit handoff request and boundary lock. It carries `consumer_eligibility`, `recommended_consumer`, `planning_constraints`, and `discussion_decision_digest`.\n7. Self-review and ask for user confirmation before marking handoff ready.\n8. Mention the downstream `sp-specify` invocation only after the JSON contract exists, self-review has passed, `quality_gate.status` is user-confirmed, and the discussion is `handoff-ready`; otherwise keep the next action inside `sp-discussion`.\n\n## Detailed References\n\nRead [Reference index](references\u002FINDEX.md) before applying detailed contracts.\n\n- [Context boundary and truth](references\u002Fcontext-boundary-and-truth.md)\n- [Persistence](references\u002Ffrontstage-backstage-persistence.md)\n- [Question and advice contract](references\u002Fquestion-and-advice-contract.md)\n- [Handoff contract](references\u002Fhandoff-contract.md)\n- [Handoff review and repair](references\u002Fhandoff-review-and-repair.md)\n- [Downstream consumption](references\u002Fdownstream-consumption.md)\n- [Quality and closeout](references\u002Fquality-and-closeout.md)\n\n## Claude Code Subagent Capability Discovery\n\n- Execution model: preserve the workflow's existing `subagent-mandatory`, `subagents-first`, `adaptive`, or `subagent-assisted` policy.\n- Dispatch shape: preserve the workflow's existing dispatch shape; use `subagent-blocked` only after the discovery step below fails or is unsafe.\n- Execution surface: prefer `native-subagents` when the current runtime supports it; use `none` only after recording the unavailable or unsafe surface.\n- Native subagent capability discovery: Before recording `subagent-blocked`, check the active tool surface for the integration-native subagent or task-dispatch entrypoint and record the exact missing surface if unavailable.\n- Do not record `subagent-blocked` until this capability discovery step is complete and the exact unavailable or unsafe surface is recorded.\n- Native subagent dispatch: Dispatch subagents through the integration's native subagent support using the shared prompt contract.\n- Join behavior: Use the integration-native join point, then integrate results back on the leader path.\n- Preserve this workflow's existing packet, handoff, artifact, and result schema; this section only governs capability discovery before dispatch or blocked-state recording.\n\n## Claude Code Structured Question Preference\n\n- If this command was routed by `sp-auto` with `auto_default_recommendation: true`, evaluate the automatic recommended\u002Fdefault continuation gate before any question path.\n- When that gate has one safe recommended\u002Fdefault answer, you must auto-resolve the question or confirmation, record the accepted recommendation in the workflow state or summary, continue the workflow, and do not invoke the native structured question tool only to ask for that approval.\n- If the automatic gate is not safe, write the blocker and self-unblock recommendation before using the normal question path.\n- If the runtime's native structured question tool is available for the current turn and the `sp-auto` automatic gate did not resolve the question, you must use it.\n- Do not render the textual fallback block when the native tool is available.\n- Do not self-authorize textual fallback because the question seems simple, short, or easy to phrase manually.\n- Treat the template's textual question format as fallback-only guidance; use it to shape the question content, but do not render the textual block unless the native tool is unavailable in the current runtime or the tool call fails.\n- Keep native-tool availability, runtime mode, and fallback mechanics backstage. Do not tell the user that a structured question tool is unavailable, that the current runtime\u002Fmode lacks a tool, or that a fallback is being used; ask the user-facing question directly when a question is genuinely required.\n- Ask only the minimum number of questions required by this workflow's existing contract.\n- Keep the user-visible question text in the user's current language and keep option labels short.\n- Do not emit both a native tool question and the textual fallback block in the same turn. The user should see the active question exactly once.\n- If the native tool is unavailable in the current runtime or the tool call fails, ask one concise plain-text product or technical question and continue with the discussion state update.\n- In `discussion`, use this preference for:\n  - one high-impact product or technical clarification\n  - resume selection when multiple incomplete discussions exist\n  - explicit handoff request and boundary confirmation before drafting agent-only `handoff-to-specify.json`\n  - user confirmation before marking the handoff ready for `sp-specify`\n- Native tool target: `AskUserQuestion`\n- When this native tool target is listed for the integration and the runtime does not signal otherwise, assume it is available by default in normal interactive sessions.\n- Question count: 1-4 questions per call\n- Option count: 2-4 options per question\n- Required question fields: `question`, `header`, `options`, `multiSelect`\n- Option fields: `label`, `description`, `preview (optional)`\n- Use `multiSelect: false` unless the workflow explicitly needs multiple selections.\n- Use `metadata` only when tracking or analytics context adds value; otherwise keep the call minimal.\n",{"name":5,"metadata":24,"description":7,"argument-hint":27,"compatibility":28,"user-invocable":29},{"author":25,"source":26},"github-spec-kit","templates\u002Fcommands\u002Fdiscussion.md","Describe the rough idea or discussion slug to create or resume before specification","Requires spec-kit project structure with .specify\u002F directory",true,"main","021f5cbe02157229460a577e9a585f2da6d78cb0",".claude\u002Fskills\u002Fsp-discussion","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-discussion",{"tool":42,"command":43},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill sp-discussion",{"tool":45,"command":46},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill sp-discussion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002FSKILL.md",[49,55,59,63,67,71,75,79,83],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fcontext-boundary-and-truth.md","REFERENCE","参考文档",13622,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fcontext-boundary-and-truth.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fdownstream-consumption.md",1755,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fdownstream-consumption.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Ffrontstage-backstage-persistence.md",5160,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Ffrontstage-backstage-persistence.md",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fhandoff-contract.md",4212,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fhandoff-contract.md",{"path":68,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fhandoff-review-and-repair.md",2554,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fhandoff-review-and-repair.md",{"path":72,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002FINDEX.md",1631,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002FINDEX.md",{"path":76,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fquality-and-closeout.md",3856,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fquality-and-closeout.md",{"path":80,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fquestion-and-advice-contract.md",23060,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fquestion-and-advice-contract.md",{"path":84,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fsemantic-work-contract.md",32218,"https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsp-discussion\u002Freferences\u002Fsemantic-work-contract.md",[88,95,101,107,114,123],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"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":96,"name":90,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"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":102,"name":90,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"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":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"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":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":118,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":122,"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":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"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",[],[]]