sp-auto
Use when you want one state-driven entrypoint that resumes the recommended next Spec Kit Plus workflow step without manually naming the exact command.
- License 许可
- MIT
- 最近更新
- 2026-08-07
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- sp-auto
- metadata
- { "author": "github-spec-kit", "source": "templates/commands/auto.md" }
- description
- Use when you want one state-driven entrypoint that resumes the recommended next Spec Kit Plus workflow step without manually naming the exact command.
- compatibility
- Requires spec-kit project structure with .specify/ directory
03 SKILL.md 正文
Invocation Syntax
- In this integration, invoke workflow skills with
$sp-plan-style syntax. - References such as
/sp.plan,/sp.tasks, ornext_command: /sp.planare canonical workflow-state identifiers and handoff values. - Preserve those canonical state tokens exactly in artifacts and workflow state; do not rewrite them to this integration's invocation syntax.
Blocked Exit Contract
If blocked after safe recovery, read and follow
.specify/templates/workflow-blocker-template.md and its JSON schema. Never
return only an error or “ask a human”; preserve state and keep agent-capable
repair agent-owned. Set human_action_required: true only for authority,
credentials, protected systems, human decisions/reviews, or physical access.
Tailor steps, expected results, failure paths, evidence, and resume action to
CI, visual review, or product decisions. Never claim completion.
For a feature runtime blocker, do not invent resume_argv or overwrite an
existing blocker. The CLI returns a read-only show_argv and structured
resolution_action; next_argv stays empty while evidence is missing. After
the criteria are proven, attach sanitized evidence using the action's declared
input and execute its base argv. It restores the same owner and keeps the full
blocker audit.
Workflow Contract Summary
- Execution note: This summary is routing metadata only. Follow the full contract below end-to-end rather than inferring behavior from the description alone.
Project Learning
The CLI is the only agent-facing Learning read surface:
- Run
uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify learning start --command '<classic-command-name>' --format jsonbefore deeper non-trivial work. - Select summaries by applicability and triggers; use
uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify learning list --command '<classic-command-name>' --format jsononly to filter or page. - Execute one matching card's
show_argv. Do not parse Learning storage.
After minimal live inspection identifies a reused operation or changed entry point, rerun targeted recall with current code, tests, and task/contract evidence, for example uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify learning list --command '<classic-command-name>' --context 'operation_owner=<owner>' --context 'consumer_owner=<consumer>' --context 'outcome=<result-family>' --format json. Do not derive these facets from archived specifications. An exact operation-owner match may surface a cross-command candidate even when the new consumer differs; treat it as a candidate, expand one show_argv, verify it against live evidence, and do not auto-apply it.
When the entrypoint outcome audit is triggered, persist the live facets as learning_context, the contextual invocation as learning_search_refs, and returned refs as learning_candidate_refs. Record exactly one applied, not_applicable, or deferred item in learning_dispositions for every candidate. Do not silently ignore a candidate: applied Learning traces to requirement/consequence refs, not-applicable needs current evidence, and deferred needs an explicit deferral ref.
start, list, and show are read-only. Current repository evidence,
.specify/memory/constitution.md, and explicit user direction override stale or
candidate Learning.
At closeout, corrections, retries, route changes, recovery, false leads, hidden
dependencies, validation/tooling/state/cognition gaps, constraints, and near
misses are capture signals. Prefer uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify learning capture-auto
from owning state; manual capture includes summary, problem, action, triggers,
success criteria, avoid items, exceptions, and evidence.
fast: skip unless the task escalates.accept,analyze,ask,auto,constitution,explain,implement-teams,taskstoissues, andteam: consume-only; do not violate their write boundaries to capture.- Other non-trivial workflows: consume before deeper work; capture reusable signals at closeout or record a no-learning decision.
The policy returned by the CLI is authoritative when prompt wording drifts.
Mandatory Subagent Execution
All substantive tasks in ordinary sp-* workflows default to and must use subagents.
The leader orchestrates: route, split tasks, prepare task contracts, dispatch subagents, wait for structured handoffs, integrate results, verify, and update state.
Before dispatch, every subagent lane needs a task contract with objective, authoritative inputs, allowed read/write scope, forbidden paths, acceptance checks, verification evidence, and structured handoff format.
Use execution_model: subagent-mandatory.
Use dispatch_shape: one-subagent | parallel-subagents.
Use execution_surface: native-subagents.
Objective
Use sp-auto as a resume entrypoint and launcher/router, not as a competing workflow.
Its job is to read current repository state, identify the recommended next Spec Kit Plus workflow step, and continue under that workflow's existing contract.
Context
- Primary inputs are the repository's authoritative workflow state surfaces, not chat memory.
- Use the lane registry as a candidate-discovery cache, not as the truth source.
sp-autodoes not create a new long-lived state file of its own.- It exists to continue the already-canonical workflow step recorded elsewhere.
Process
- For every feature-bearing candidate, first run
uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify workflow show --feature-dir '<feature-dir>' --format json, thenuvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify workflow next --feature-dir '<feature-dir>' --format json.FEATURE_DIR/workflow-runtime.jsonis the required-stage phase lock. Consume the returned structurednext_argv; never reconstruct or infer the required phase action from Markdown fields. - When
next_argvnamesworkflow complete-stage, route to the current required-stage owner so it can finish and validate that stage. When it namesworkflow transition --to <stage>, route to that destination stage and pass the exact argv. When activeacceptreturnsworkflow closeout, route to the current accept owner so human acceptance can resume; only completedaccepthas no successor. - A blocked runtime intentionally has no
next_argv. Preserve its tutorial and wait for the declared evidence; once present, fill only the required evidence input indata.resolution_actionand execute its runtime-owned base argv.show_argvrefreshes state but never resolves it. - Inspect the current repository state surfaces in priority order.
- When concurrent lanes exist, resolve candidates by command semantics first and run reconcile before any resume decision.
- If the selected lane has a materialized worktree, continue from that isolated worktree context instead of assuming the leader workspace is the active feature root.
- Resolve exactly one safe canonical next command.
- Continue under that command's full shared contract instead of improvising a blended workflow.
Output Contract
- Report the routed command and the state file that justified it.
- Preserve the downstream workflow's canonical
next_commandand artifact semantics. - If no safe route exists, return a read-only diagnostic plus a self-unblock recommendation explaining the missing or conflicting state and the safest repair or canonical command.
Guardrails
sp-autodoes not replacesp-specify,sp-plan,sp-tasks,sp-analyze,sp-implement,sp-review,sp-accept,sp-debug,sp-quick, orsp-fast.sp-automust never invent a new phase progression from chat memory when repository state already records the next step.- Always obey the recorded upstream gate.
- Do not rewrite the underlying workflow state to
/sp.auto; preserve the canonical downstreamnext_commandsuch as/sp.plan,/sp.tasks,/sp.implement,/sp.review,/sp.accept,/sp.debug,/sp.quick,/sp.fast,/sp.clarify, or/sp.deep-research. Preserve/sp.analyzeonly when an existing state file explicitly records that legacy or diagnostic route. - If state is missing, stale, conflicting, or cannot identify one safe next step, stop in read-only diagnosis and report the exact blocker instead of improvising a route.
- Do not guess when multiple resumable lanes exist.
- Never auto-resume an
uncertainlane.
Operating Rules
Authoritative State Surfaces
Inspect the available state surfaces in this order and prefer the most specific active truth source that does not violate an upstream gate:
-
Active feature phase runtime and rich state
- Treat
FEATURE_DIR/workflow-runtime.jsonplusworkflow show/workflow nextas the primary required-stage phase lock.FEATURE_DIR/workflow-state.mdis rich workflow-owned resume/evidence context and may add an auxiliary gate, but it cannot skip or reverse the runtime stage. - Use only the runtime's structured
next_argvforcomplete-stage, forwardtransition, blocker resume, or terminal status. Legacynext_commandandactive_commandfields are fallback hints only when no runtime file exists for a noncanonical auxiliary workflow. - Clean completed task-generation state with
active_command: sp-tasks,status: completed,phase_mode: task-generation-only, andnext_command: /sp.implementshould route directly to/sp.implement; preserve/sp.analyzeonly when a feature-level state file explicitly records that legacy or diagnostic route. - If a feature-level
workflow-state.mdcontains evidence that explicitly invalidates an upstream stage, do not jump around the CLI phase lock. Useworkflow reopenwith the current revision, reason, evidence, and complete invalidated-artifact set when that evidence is sufficient. A mapped stage already active resumes its owner; the same completed stage is reactivated through reopen. Otherwise route to analyze or the current owner to produce a valid reopen decision.
- Treat
-
Active implementation execution state
- Read
FEATURE_DIR/implement-tracker.mdtogether withworkflow-state.md. - If execution is still active and
workflow-state.mdallows/sp.implement, resume the canonical/sp.implementroute. - If trusted execution is completed and
next_command: /sp.review, route to canonical/sp.review; do not repeat implementation or skip system Review. - If
workflow-state.mdstill requires/sp.analyze,/sp.plan,/sp.tasks,/sp.clarify, or/sp.deep-research, reconcile that gate with the CLI runtime. Execute an evidence-backedworkflow reopenfor a backward move or same-completed-stage reactivation; do not route to an upstream command while the runtime still owns a later stage.
- Read
-
Post-implementation system Review state
- If trusted implementation closeout exists and
review-state.jsonis absent,reviewing,repairing,blocked, failed, or stale, route to canonical/sp.reviewbefore human acceptance. - Treat Review as approved only when the implementation fingerprint is fresh, every mandatory real-entrypoint scenario passes with required integrated evidence, and no blocking finding remains.
- If trusted implementation closeout exists and
-
Post-Review human acceptance state
- If trusted Review closeout exists and
human-acceptance.jsonisdraft,ready,in_progress,blocked,rejected, orstale, route to canonical/sp.acceptbefore integration or delivery. - Treat
acceptedas complete only when the frozen Human Acceptance Universe has zero uncovered required obligations, the approved Review/summary fingerprint and Review-owned runtime-target digest are fresh, every required scenario has structured human PASS evidence against its ready Review-approved runtime target, no acceptance finding is open, and the explicit human decision is accept.
- If trusted Review closeout exists and
-
Quick-task state
- Read unfinished
.planning/quick/*/STATUS.mdfiles. - If one active quick task clearly owns the next action, route to the canonical
/sp.quicktoken. - If the recorded next command is a bounded local repair lane, canonical
/sp.fastis allowed only when the state explicitly justifies that smaller route.
- Read unfinished
-
Debug session state
- Read active
.planning/debug/*.mdsession files. - If a live investigation owns the current next action, route to the canonical
/sp.debugtoken.
- Read active
-
Discussion handoff state
- Read active
.specify/discussions/*/discussion-state.jsonfiles when no higher-authority feature, implementation, quick, or debug state has already selected a unique route; use Markdown only for legacy recovery. - Treat
status: handoff-readyplusnext_command: /sp.specifyorsp-specifyas a/sp.specifycandidate only whenhandoff_consumption_statusis notconsumed. - If
handoff_consumption_status: consumed,status: completed,consumed_by_feature_diris populated, ornext_command: none, do not count that discussion as a resumable candidate. - If a handoff-ready discussion's
handoff-to-specify.jsonpath is already referenced by a featurebrainstorming/handoff-to-specify.jsonassource_contract, treat it as a consumed-stale cleanup item, not a competing route. Recommenduvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify discussion mark-consumed '<slug>' --feature-dir '<feature-dir>'as the repair evidence, or perform that repair only when the active workflow allows state cleanup before routing. - If multiple unconsumed handoff-ready discussions remain, stop and ask for a specific slug instead of guessing.
- Read active
Route Resolution
Choose exactly one routed command.
- If lane state exists, consult the lane registry first to discover candidate lanes, then reconcile against real workflow artifacts before selecting a route.
- Auto-resume only when there is exactly one unique safe candidate.
- If multiple candidates remain after reconcile, stop and present a minimal choice instead of guessing.
- Prefer the route that is already recorded in the highest-authority active state file.
- If multiple state surfaces are active, prefer the more execution-proximate surface only when it does not conflict with an explicit upstream
next_command. - Never bypass canonical upstream gates such as
/sp.clarify,/sp.deep-research,/sp.plan, or/sp.tasksjust because downstream artifacts already exist. Treat/sp.analyzeas an upstream gate only when persisted workflow state explicitly records that legacy or diagnostic route. - Never treat
sp-autoitself as the next recorded workflow step. It is only the entrypoint the user uses instead of typing the canonical command manually.
Execution Contract
Once the routed command is chosen:
- Announce the routed command and the state file that justified it.
- Carry a temporary routed-pass mode named
auto_default_recommendation: trueinto the target command. This is an execution hint for this turn only; do not persist it as the target workflow's canonicalnext_command. - Read
.specify/templates/commands/<target>.mdwhen available, or follow the routed command's shared contract from the generated local integration surface if that is the active source of truth. - Continue under the routed command's rules, artifacts, validations, delegation policy, and completion criteria for the rest of the turn.
- Do not blend multiple workflows into one ad hoc pass. Route once, then execute that workflow faithfully.
Recommended Default Continuation
When auto_default_recommendation: true is active, the routed command must auto-resolve a question or confirmation gate by accepting the recommended/default continuation when all of these are true:
- The target workflow would otherwise stop only to ask the user to answer a bounded question, choose from a bounded list, or confirm a previously presented safe default.
- The list or confirmation gate has one single explicitly recommended option or one safe default continuation.
- The recommended/default option preserves the user's current stated intent, keeps the current scope, and does not discard or defer an upstream capability signal.
- There is no explicit user disagreement, no unresolved planning-critical ambiguity, no out-of-scope conflict, no scope reduction, no security-sensitive decision, no destructive or irreversible action, and no external-cost or credential-affecting decision.
If those conditions hold, record the recommended option as accepted by sp-auto in the routed workflow's state or summary and continue. Do not invoke a structured question tool, do not render a textual question block, and do not stop only to ask the user to reply 1, 2, or 3 when the only safe pending action is accepting that single recommended option.
If the recommended/default continuation cannot satisfy every condition, do not guess and do not wait silently for user input. Write a self-unblock recommendation that names the blocker, the safest recommended user decision or canonical command, the evidence that would make automatic continuation safe next time, and any reversible repair the agent can perform before stopping under the routed workflow's normal confirmation gate.
Diagnostic Fallback
If no safe route can be selected:
- stay read-only
- report which state files were checked
- report what was missing or conflicting
- perform any reversible state-inspection or reconcile step allowed by this contract before giving up
- tell the user which canonical workflow must be run manually or which state artifact must be repaired first
- include the exact evidence that would let a future
sp-autorun continue automatically
Expected Routed Outcomes
Typical canonical targets include:
/sp.clarify/sp.deep-research/sp.plan/sp.tasks/sp.analyze/sp.implement/sp.review/sp.accept/sp.debug/sp.quick/sp.fast/sp.specify
Use canonical /sp.specify only when repository state or the absence of any usable downstream state makes a new or re-opened requirement-alignment pass the safest truthful next step.
When no safe route can be selected and the user must invoke that fallback manually, tell them to run $sp-specify.
Codex Subagent Capability Discovery
- Execution model: preserve the workflow's existing
subagent-mandatory,subagents-first,adaptive, orsubagent-assistedpolicy. - Dispatch shape: preserve the workflow's existing dispatch shape; use
subagent-blockedonly after the discovery step below fails or is unsafe. - Execution surface: prefer
native-subagentswhen the current runtime supports it; usenoneonly after recording the unavailable or unsafe surface. - Native subagent capability discovery: Before recording
subagent-blocked, confirm the current runtime exposesspawn_agent,wait_agent, andclose_agent; if they are not visible, use the active tool discovery mechanism for multi-agent or subagent tools first. - Do not record
subagent-blockeduntil this capability discovery step is complete and the exact unavailable or unsafe surface is recorded. - Native subagent dispatch: Dispatch bounded subagents through
spawn_agent. - Join behavior: Rejoin with
wait_agent, integrate, thenclose_agent. - Preserve this workflow's existing packet, handoff, artifact, and result schema; this section only governs capability discovery before dispatch or blocked-state recording.
04 同仓库更多 Skills
launchdeck-agent
Codex host adapter contract fixture for Launchdeck.
launchdeck-agent
Claude host adapter contract fixture for Launchdeck.
launchdeck-agent
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.
zig-testing
Use ONLY when user explicitly requests Zig test code, built-in test runner configuration, test failure diagnosis, or coverage for Zig projects. Triggers: "write test zig", "zig test", "testing.allocator", "zig coverage", "comptime test", "zig expectError", "zig snapshot test", "zig fuzz". Do NOT activate for: general Zig coding without test context, build.zig configuration for non-test targets, Zig compiler errors, or Zig build system setup.
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.
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