AGENT SKILL

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, or next_command: /sp.plan are 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:

  1. Run uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify learning start --command '<classic-command-name>' --format json before deeper non-trivial work.
  2. 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 json only to filter or page.
  3. 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, and team: 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-auto does 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, then uvx --from git+https://github.com/chenziyang110/spec-kit-plus.git@6fbbf08a0b6833bb783ec6b418d567776b197ae4 specify workflow next --feature-dir '<feature-dir>' --format json. FEATURE_DIR/workflow-runtime.json is the required-stage phase lock. Consume the returned structured next_argv; never reconstruct or infer the required phase action from Markdown fields.
  • When next_argv names workflow complete-stage, route to the current required-stage owner so it can finish and validate that stage. When it names workflow transition --to <stage>, route to that destination stage and pass the exact argv. When active accept returns workflow closeout, route to the current accept owner so human acceptance can resume; only completed accept has 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 in data.resolution_action and execute its runtime-owned base argv. show_argv refreshes 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_command and 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-auto does not replace sp-specify, sp-plan, sp-tasks, sp-analyze, sp-implement, sp-review, sp-accept, sp-debug, sp-quick, or sp-fast.
  • sp-auto must 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 downstream next_command such 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.analyze only 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 uncertain lane.

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:

  1. Active feature phase runtime and rich state

    • Treat FEATURE_DIR/workflow-runtime.json plus workflow show/workflow next as the primary required-stage phase lock. FEATURE_DIR/workflow-state.md is 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_argv for complete-stage, forward transition, blocker resume, or terminal status. Legacy next_command and active_command fields 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, and next_command: /sp.implement should route directly to /sp.implement; preserve /sp.analyze only when a feature-level state file explicitly records that legacy or diagnostic route.
    • If a feature-level workflow-state.md contains evidence that explicitly invalidates an upstream stage, do not jump around the CLI phase lock. Use workflow reopen with 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.
  2. Active implementation execution state

    • Read FEATURE_DIR/implement-tracker.md together with workflow-state.md.
    • If execution is still active and workflow-state.md allows /sp.implement, resume the canonical /sp.implement route.
    • 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.md still requires /sp.analyze, /sp.plan, /sp.tasks, /sp.clarify, or /sp.deep-research, reconcile that gate with the CLI runtime. Execute an evidence-backed workflow reopen for a backward move or same-completed-stage reactivation; do not route to an upstream command while the runtime still owns a later stage.
  3. Post-implementation system Review state

    • If trusted implementation closeout exists and review-state.json is absent, reviewing, repairing, blocked, failed, or stale, route to canonical /sp.review before 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.
  4. Post-Review human acceptance state

    • If trusted Review closeout exists and human-acceptance.json is draft, ready, in_progress, blocked, rejected, or stale, route to canonical /sp.accept before integration or delivery.
    • Treat accepted as 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.
  5. Quick-task state

    • Read unfinished .planning/quick/*/STATUS.md files.
    • If one active quick task clearly owns the next action, route to the canonical /sp.quick token.
    • If the recorded next command is a bounded local repair lane, canonical /sp.fast is allowed only when the state explicitly justifies that smaller route.
  6. Debug session state

    • Read active .planning/debug/*.md session files.
    • If a live investigation owns the current next action, route to the canonical /sp.debug token.
  7. Discussion handoff state

    • Read active .specify/discussions/*/discussion-state.json files 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-ready plus next_command: /sp.specify or sp-specify as a /sp.specify candidate only when handoff_consumption_status is not consumed.
    • If handoff_consumption_status: consumed, status: completed, consumed_by_feature_dir is populated, or next_command: none, do not count that discussion as a resumable candidate.
    • If a handoff-ready discussion's handoff-to-specify.json path is already referenced by a feature brainstorming/handoff-to-specify.json as source_contract, treat it as a consumed-stale cleanup item, not a competing route. Recommend uvx --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.

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.tasks just because downstream artifacts already exist. Treat /sp.analyze as an upstream gate only when persisted workflow state explicitly records that legacy or diagnostic route.
  • Never treat sp-auto itself 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:

  1. Announce the routed command and the state file that justified it.
  2. Carry a temporary routed-pass mode named auto_default_recommendation: true into the target command. This is an execution hint for this turn only; do not persist it as the target workflow's canonical next_command.
  3. Read .specify/templates/commands/<target>.md when available, or follow the routed command's shared contract from the generated local integration surface if that is the active source of truth.
  4. Continue under the routed command's rules, artifacts, validations, delegation policy, and completion criteria for the rest of the turn.
  5. 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-auto run 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, or subagent-assisted policy.
  • Dispatch shape: preserve the workflow's existing dispatch shape; use subagent-blocked only after the discovery step below fails or is unsafe.
  • Execution surface: prefer native-subagents when the current runtime supports it; use none only after recording the unavailable or unsafe surface.
  • Native subagent capability discovery: Before recording subagent-blocked, confirm the current runtime exposes spawn_agent, wait_agent, and close_agent; if they are not visible, use the active tool discovery mechanism for multi-agent or subagent tools first.
  • Do not record subagent-blocked until 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, then close_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

chenziyang110
chenziyang110/launchdeck

launchdeck-agent

Codex host adapter contract fixture for Launchdeck.

★ 0
chenziyang110
chenziyang110/launchdeck

launchdeck-agent

Claude host adapter contract fixture for Launchdeck.

★ 0
chenziyang110
chenziyang110/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.

★ 0
chenziyang110
chenziyang110/launchdeck

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.

★ 0
chenziyang110
chenziyang110/launchdeck

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.

★ 0
chenziyang110
chenziyang110/launchdeck

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

★ 0