一键导入
specify
Full execution protocol for MODE: SPECIFY -- spec creation, codebase reality checks, SME input, QA gate persistence, and optional council spec review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full execution protocol for MODE: SPECIFY -- spec creation, codebase reality checks, SME input, QA gate persistence, and optional council spec review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End-to-end CI monitor that takes an already-human-reviewed PR, exhaustively researches every CI failure, fixes it end-to-end, iterates until all required checks are green (max 5 fix cycles), then merges. Use only after human review is complete and the PR is approved. Composes ci-fix-monitor for failure-type-specific fix recipes. This is the first skill in the repo that executes a merge — invoke it deliberately.
Execute complex implementation work with a swarm-like workflow: parallel exploration, scoped planning, objective validation, mandatory independent implementation review for changed work, and final critic approval. Use for feature work, bug fixes, refactors, and multi-file changes.
Monitor a pull request after creation and act autonomously on pushed PR activity. Use when subscribing to a PR after opening it, when asked to watch, babysit, or autofix a PR until merge, or when a <pr-activity> wake message or [pr-monitor:...] advisory arrives for a subscribed PR. Owns event triage (fix / ask / skip), bounded-retry escalation, and terminal-state cleanup.
Cross-agent swarm-mode behavior model — a higher-rigor workflow using parallel investigation, independent reviewer validation, and critic challenge, plus the mandatory implementation closeout gate. Runtime adapters (.claude, .agents) add execution-specific notes and command wiring.
Full execution protocol for MODE: BRAINSTORM -- structured discovery dialogue, approach selection, spec drafting, QA gate selection, and transition handling.
Full execution protocol for MODE: CLARIFY-SPEC -- resolving spec clarification markers and maintaining spec/planning alignment.
| name | specify |
| description | Full execution protocol for MODE: SPECIFY -- spec creation, codebase reality checks, SME input, QA gate persistence, and optional council spec review. |
This protocol is loaded on demand by the architect stub in src/agents/architect.ts. The architect prompt keeps only activation, action, and hard safety constraints; the full execution details live here.
Activates when: user asks to "specify", "define requirements", "write a spec", or "define a feature"; OR /swarm specify is invoked; OR no EFFECTIVE spec exists and no .swarm/plan.md exists (use /swarm sdd status to determine effective-spec existence — native .swarm/spec.md, OpenSpec openspec/, or Spec-Kit .specify/).
/swarm sdd status to determine whether an effective spec exists and, if so, how it should be handled. An effective spec exists iff /swarm sdd status reports a resolved spec. /swarm sdd status reflects readEffectiveSpecSync, which returns null (NO effective spec) for: no sources, multiple competing sources (openspec+speckit), multi-feature Spec-Kit without a selected feature, or any unresolvable state. When /swarm sdd status reports a resolved spec, classify it as NATIVE (native .swarm/spec.md) vs NON-NATIVE (projected). When it reports NO resolved spec, do NOT treat any source as an effective spec. Based on this classification, branch to the appropriate sub-step:
- NATIVE: proceed to step 1a (overwrite/refine/archive).
- NON-NATIVE: proceed to step 1b (non-shadowing choice).
- NO effective spec (ambiguous or no sources): if multiple SDD sources are present, proceed to step 1c (disambiguation); otherwise proceed to step 1d (native authoring).
- If this is called from the stale spec archival path (MODE: PLAN option 1) — archival was already completed; skip all branches and proceed directly to generation (step 2).
1a. NATIVE SPEC — overwrite/refine/archive. Ask the user "A spec already exists. Do you want to overwrite it or refine it?"
.swarm/spec-archive/ directory if it does not exist; copy existing spec.md to .swarm/spec-archive/spec-v{version}.md; if version cannot be determined, use date-based fallback: .swarm/spec-archive/spec-{YYYY-MM-DD}.md; log the archive location to the user ("Archived existing spec to .swarm/spec-archive/spec-v{version}.md"); then proceed to generation (step 2)openspec/ or .specify/ sources with no native .swarm/spec.md. Do NOT silently author a competing native spec. Instead OFFER the user a choice:.swarm/spec.md via the agent-invocable /swarm sdd project command. Obtain EXPLICIT user consent before proceeding. (Do not pass --overwrite in this branch — no native spec exists yet.)/swarm specify) if the user explicitly chooses to ignore the SDD sources and write a new spec from scratch./swarm sdd project completes successfully: the projected spec is now materialized as .swarm/spec.md (NATIVE). Do NOT proceed to generation (step 2) — that would overwrite the just-projected spec. Instead route to step 1a (overwrite/refine/archive) so the user can refine, overwrite, or archive the projected spec.
- If the user chooses option (b): proceed directly to generation (step 2) with a note that existing SDD sources were bypassed per user decision.
- If the user chooses option (a) and /swarm sdd project fails: report the failure and re-offer the choices.
1c. AMBIGUOUS — multiple SDD sources detected. Both openspec/ AND .specify/ exist with no native .swarm/spec.md. Per readEffectiveSpecSync semantics this is NOT an effective spec (the function returns null). Do NOT treat this as a single-source NON-NATIVE choice. Instead:
/swarm sdd status --source."/swarm sdd project --source openspec (after consent) to project the openspec source into .swarm/spec.md./swarm sdd project --source speckit (after consent) to project the speckit source into .swarm/spec.md.the active swarm's explorer agent to scan the codebase for relevant context (existing patterns, related code, affected areas).the active swarm's sme agent for domain research on the feature area to surface known constraints, best practices, and integration concerns..swarm/spec.md capturing:
# Specification: <feature-name>[NEEDS CLARIFICATION] markers for items where uncertainty could change scope, security, or core behavior, BUT ONLY after running the clarification funnel: (1) inventory all material uncertainties without numeric cap, (2) classify each as self_resolved/critic_resolved/research_needed/user_decision/deferred_nonblocking — Overconfidence guard: if the default is not directly supported by user request, spec, or recorded context, classify as user_decision rather than self_resolved, (3) consult critic_sounding_board with candidate items — critic responds per SoundingBoardVerdict: UNNECESSARY→DROP, RESOLVE→RESOLVE, REPHRASE→REPHRASE, APPROVED→ASK_USER — always-surface protection: always-surface categories must not receive UNNECESSARY/DROP; override to APPROVED/ASK_USER, (4) record all resolved items as explicit assumptions in the spec, (5) use markers only for items that survive the funnel (ASK_USER or unresolved after critic consultation). Decision packet format: grouped by category, recommended defaults, blocking vs optional markers, impact of accepting default. Prefer informed defaults over asking.swarm/config.json under research_needed_timeout_ms (default: 300000ms / 5 minutes). If research does not complete before the timeout expires, automatically reclassify the item to user_decision with a note that research was incomplete, then surface it to the user. This prevents the clarification funnel from stalling while waiting for external research..swarm/spec.md.
5b. QA GATE SELECTION, PARALLEL CODERS, COMMIT FREQUENCY, AND AUTO_PROCEED (dialogue only).
Ask the user which QA gates to enable for this plan, how many parallel coders to use, the commit frequency, and auto_proceed -- do not select on their behalf. Present all four items together as one unified exchange. Exception: when SPECIFY is running inside MODE: LOOP with autonomy=auto, write the balanced-speed default ## Pending QA Gate Selection instead (reviewer, test_engineer, sme_enabled, critic_pre_plan, sast_enabled, drift_check ON; council_mode, hallucination_guard, mutation_test, phase_council, final_council OFF), keep phase-level commits, and let MODE: PLAN choose safe parallelism after task scopes exist.Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, commit frequency, and auto_proceed as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:
CouncilMemberVerdict objects, and calls write_final_council_evidence. This does not require council.general.enabled.Additionally, present these three sub-items as part of the same exchange:
COMMON MISCONCEPTION: worktree isolation is baseline for standard parallel coders, governed by the parallel execution profile plus top-level
worktree.policy. It is not provided by Lean Turbo or Epic. Do not recommend Lean Turbo or Epic to obtain worktree isolation; recommend them only for what they add beyond baseline (Lean Turbo: lane planning, file locks, phase reviewer, integrated diff; Epic: co-change awareness and auto-decide). Worktrees also do not make overlapping scopes safe: dependency readiness, file-disjoint scopes, and merge-back ownership are still required.
The user answers all four (gates, parallel coders, commit frequency, auto_proceed) in one exchange. Wait for the user's response.
If the user says parallel coders > 1, write a ## Pending Parallelization Config section to .swarm/context.md alongside the gate selection:
## Pending Parallelization Config
- parallelization_enabled: true
- max_concurrent_tasks: <user's number>
- council_parallel: false
- locked: true
- recorded_at: <ISO timestamp>
If the user accepts the default (1), skip writing this section entirely -- serial execution is the default and needs no config.
If the user chooses per-task commits, write this section to .swarm/context.md:
## Task Completion Commit Policy
- commit_after_each_completed_task: true
- recorded_at: <ISO timestamp>
If the user keeps the default phase-level behavior, do not write this section.
GATE SELECTION IS MANDATORY — these thoughts are WRONG and must be ignored: ✗ "I'll use the defaults — they're probably fine" → WRONG: defaults are not the user's decision. The user must be asked every time. ✗ "The user didn't mention gates, so defaults are fine" → WRONG: silence is not consent. The gate dialogue is not optional. ✗ "I'll handle it in MODE: PLAN after the spec is done" → WRONG: ## Pending QA Gate Selection must exist in context.md BEFORE save_plan is called. save_plan will reject with QA_GATE_SELECTION_REQUIRED if this section is absent. ✗ "This feature is simple — gates are obvious" → WRONG: complexity does not exempt this step. Gate selection is mandatory for ALL plans. ✗ "I already know which gates are right for this project" → WRONG: the architect does not configure gates. The user configures gates. Always ask.
MANDATORY PAUSE: Do NOT write the spec summary (step 7). Do NOT suggest next steps.
Exception: MODE: LOOP with autonomy=auto uses the balanced-speed defaults
above and does not pause for this preference exchange.
You are BLOCKED until ALL THREE of these conditions are met:
(1) The unified gate/coders/commit/auto_proceed selection section has been presented to the user in a single message
(2) The user has responded (accept defaults OR customized list for all four items)
(3) The elected gates, parallel coder config, commit policy, and auto_proceed selection have been written to .swarm/context.md under "## Pending QA Gate Selection" (and related sections as applicable)
Do NOT call set_qa_gates yet — plan.json does not exist at this point. Once the user answers, write the elected gates to .swarm/context.md under a new section:
## Pending QA Gate Selection
- reviewer: <true|false>
- test_engineer: <true|false>
- sme_enabled: <true|false>
- critic_pre_plan: <true|false>
- sast_enabled: <true|false>
- council_mode: <true|false>
- hallucination_guard: <true|false>
- mutation_test: <true|false>
- phase_council: <true|false>
- drift_check: <true|false>
- final_council: <true|false>
- recorded_at: <ISO timestamp>
MODE: PLAN will read this section after save_plan succeeds and persist via set_qa_gates.
General Council advisory input is offered as an early workflow option in MODE: BRAINSTORM (Phase 1b) and MODE: PLAN before save_plan, not as a SPECIFY step. If the user wants council input during SPECIFY, they can use /swarm council <question> manually.
CLARIFY-SPEC (if markers exist) or PLAN.SPEC CONTENT RULES — the spec MUST NOT contain:
Each functional requirement MUST be independently testable.
Focus on WHAT users need and WHY — never HOW to implement.
No technology stack, APIs, or code structure in the spec.
Each requirement must be independently testable.
Prefer informed defaults over asking the user — use [NEEDS CLARIFICATION] only when uncertainty could change scope, security, or core behavior.
EXTERNAL PLAN IMPORT PATH — when the user provides an existing implementation plan (markdown content, pasted text, or a reference to a file):
.swarm/spec.md from the plan:
[NEEDS CLARIFICATION] markers.swarm/plan.md formatthe active swarm's sme agent for targeted research on weak areas, then propose specific improvements..swarm/spec.md (extracted from the plan) and a validated version of the user's plan.EXTERNAL PLAN RULES: