[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76RWM4JR595DQFJEKGWPNP2":3,"skill-same:01M76RWM4JR595DQFJEKGWPNP2":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M76RWM4JR595DQFJEKGWPNP2","plan",null,"Full execution protocol for MODE: PLAN -- plan creation, external plan ingestion, QA gate persistence, task granularity, and traceability checks.","AlexanderNarbaev\u002Fagi","AlexanderNarbaev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F33544956?v=4","01M755ZKB1JJ26ZBNZSDJ4C0TV","01M755ZKBX072HZMHVQBWK7MK7",1,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fplan\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: plan\ndescription: >\n  Full execution protocol for MODE: PLAN -- plan creation, external plan ingestion, QA gate persistence, task granularity, and traceability checks.\n---\n\n# Plan Protocol\n\nThis protocol is loaded on demand by the architect stub in src\u002Fagents\u002Farchitect.ts. The architect prompt keeps only activation, action, and hard safety constraints; the full execution details live here.\n\n### MODE: PLAN\n\nSPEC GATE (soft — check before planning):\n- If `.swarm\u002Fspec.md` does NOT exist:\n  - PLAN INGESTION DETECTION: Check if the user is providing an external plan (indicators: markdown content with Phase\u002FTask structure, or phrases like \"ingest this plan\", \"implement this plan\", \"prepare for implementation\", \"here is a plan\", \"here's the plan\"):\n    - If plan ingestion is detected AND no spec.md exists: offer this choice FIRST before any planning:\n      1. \"Generate spec from this plan first\" → enter EXTERNAL PLAN IMPORT PATH in MODE: SPECIFY to reverse-engineer a spec.md from the provided plan, then return to planning\n      2. \"Skip spec and proceed with the provided plan\" → proceed directly to plan ingestion and planning without creating a spec\n    - This is a SOFT gate — option 2 always lets the user proceed without a spec\n  - If no plan ingestion detected: Warn: \"No spec found. A spec helps ensure the plan covers all requirements and gives the critic something to verify against. Would you like to create one first?\"\n    - Offer two options:\n      1. \"Create a spec first\" → transition to MODE: SPECIFY\n      2. \"Skip and plan directly\" → continue with the steps below unchanged\n- If `.swarm\u002Fspec.md` EXISTS:\n  - NOTE: Stale detection is intentionally heuristic (compare headings) — false positives are acceptable because this is a SOFT gate. When in doubt, ask the user.\n  - Read the spec and compare its first heading (or feature description) against the current planning context (the user's request and any existing plan.md title\u002Fphase names)\n  - STALE SPEC DETECTION: If the spec heading or feature description does NOT match the current work being planned (e.g., spec describes \"user authentication\" but user is asking to plan \"payment integration\"), treat the spec as potentially stale and offer three options:\n    1. **Archive and create new spec** → attempt to rename .swarm\u002Fspec.md to .swarm\u002Fspec-archive\u002Fspec-{YYYY-MM-DD}.md (create the directory if needed); if archival succeeds: enter MODE: SPECIFY and skip the \"spec already exists\" prompt; if archival fails: inform user of the failure and offer: retry archival, or proceed with option 2, or proceed with option 3\n    2. **Keep existing spec** → use spec.md as-is and proceed with planning below\n    3. **Skip spec entirely** → proceed to planning below ignoring the existing spec\n  - If the spec appears current (heading matches the work being planned) OR user chose option 2 above, proceed with spec:\n    - Read it and use it as the primary input for planning\n    - Cross-reference requirements (FR-###) when decomposing tasks\n    - Ensure every FR-### maps to at least one task\n    - If a task has no corresponding FR-###, flag it as a potential gold-plating risk\n  - If user chose option 3 above, proceed without spec: skip all spec-based steps and proceed directly to planning\n\nThis is a SOFT gate. When the user chooses \"Skip and plan directly\", proceed to the steps below exactly as before — do NOT modify any planning behavior.\n\nRun CODEBASE REALITY CHECK scoped to codebase elements referenced in spec.md or user constraints. Discrepancies must be reflected in the generated plan.\n\n### GENERAL COUNCIL ADVISORY OPTION (pre-save_plan)\n\nBefore drafting or saving the plan, the architect MUST offer General Council advisory input when `council.general.enabled` is true in the resolved opencode-swarm config and a search API key is configured.\n\n- Ask the user: \"Use General Council advisory input before I write the plan? The 3-agent council (generalist, skeptic, domain expert) will gather current external context and provide perspectives that I will fold into the plan before critic review. (default: no)\"\n- If the user declines, proceed to the clarification funnel and planning normally.\n- If the user accepts:\n  1. Run the General Council Research Phase: formulate 1-3 targeted `web_search` queries grounded in the work being planned.\n  2. Dispatch `the active swarm's council_generalist agent`, `the active swarm's council_skeptic agent`, and `the active swarm's council_domain_expert agent` in PARALLEL with the RESEARCH CONTEXT.\n  3. Collect responses and call `convene_general_council` with mode `general`.\n  4. Record the council consensus, disagreements, cited sources, and any plan-impacting assumptions in `.swarm\u002Fcontext.md` under `## Decisions`.\n  5. Use that recorded council input as planning context before calling `save_plan`.\n- If General Council is unavailable and the user explicitly requested council input, surface the config\u002Fkey requirement and stop before `save_plan` rather than writing an ungrounded plan.\n\nGeneral Council is advisory and distinct from `council_mode`, `phase_council`, and `final_council`. It is not a QA gate. Its purpose here is to make current external context available before the architect writes any plan and before any critic pre-plan review.\n\n### CLARIFICATION FUNNEL (pre-save_plan)\n\nBefore calling `save_plan` — whether creating a new plan or finalizing an external plan ingestion — the architect MUST run this four-stage clarification funnel. The goal is to limit unnecessary user interruption, not planning completeness.\n\n#### Stage 1: Inventory All Material Uncertainties\n\nIdentify ALL uncertainties that could affect the plan. There is NO hard cap on the internal inventory. Cover at minimum:\n\n- Scope boundaries: what is in or out\n- Data loss or destructive behavior\n- Security\u002Fprivacy risk tolerance\n- Backward compatibility or migration policy\n- Cost\u002Fperformance tradeoffs\n- User-visible behavior and UX choices\n- Release\u002Frollout strategy\n- QA policy: gate selection and enforcement strictness\n- Architecture choices among materially different paths\n- Dependency or platform assumptions\n- Operational complexity\n\n#### Stage 2: Classify Each Uncertainty\n\nClassify each item as exactly one of:\n\n- `self_resolved`: answered from the user request, spec, plan, codebase reality check, `.swarm\u002Fcontext.md`, repo conventions, or an informed default. **If the default is not directly supported by user request, spec, or recorded context, classify as `user_decision` rather than `self_resolved`.**\n- `critic_resolved`: sent to Critic Sounding Board and resolved by the critic.\n- `research_needed`: needs SME\u002Fexplorer\u002Fdomain lookup before user escalation. **Important:** If research is ongoing, monitor the timeout configured in `.swarm\u002Fconfig.json` under `research_needed_timeout_ms` (default: 300000ms \u002F 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.\n- `user_decision`: only the user can decide because it affects product scope, risk tolerance, policy, budget, UX, rollout, or destructive behavior.\n- `deferred_nonblocking`: useful follow-up detail that does not block a correct initial plan and can be explicitly recorded as an assumption or follow-up.\n\n#### Stage 3: Consult Critic Sounding Board Before User Escalation\n\nBefore asking the user any planning clarification question, the architect MUST consult `critic_sounding_board` with the candidate question set and context.\n\nFor each item classified as `research_needed` or `user_decision` in Stage 2, send it to the critic. The critic responds with a verdict from `SoundingBoardVerdict` (see `src\u002Fagents\u002Fcritic.ts`). The mapping between critic verdicts and funnel actions is:\n\n| Critic Verdict (SoundingBoardVerdict) | Funnel Action | Meaning |\n|---|---|---|\n| `UNNECESSARY` | DROP | Item is unnecessary or answerable from existing context |\n| `RESOLVE` | RESOLVE | Critic supplies the answer or recommended default |\n| `REPHRASE` | REPHRASE | Question is valid but should be clearer, narrower, or grouped |\n| `APPROVED` | ASK_USER | User decision is genuinely required |\n\n**Hard constraint:** Items in the Always-Surface Categories list (below) MUST NOT receive `UNNECESSARY`\u002F`DROP` from the critic — only `REPHRASE` or `APPROVED`\u002F`ASK_USER` are allowed. If the critic attempts to `UNNECESSARY`\u002F`DROP` an always-surface item, override to `APPROVED`\u002F`ASK_USER`.\n\n**Overconfidence guard:** If the critic attempts to self-resolve an item by supplying an answer (verdict `RESOLVE`) but the underlying default is not directly supported by user request, spec, or recorded context, the architect MUST classify the item as `user_decision` rather than `self_resolved`. Unsupported defaults must not be silently accepted.\n\nUpdate classifications based on critic response:\n\n- `UNNECESSARY`\u002F`DROP` → reclassify as `self_resolved` and record the reason.\n- `RESOLVE` → reclassify as `critic_resolved` and record the answer as an assumption.\n- `REPHRASE` → update the question wording and keep as candidate.\n- `APPROVED`\u002F`ASK_USER` → confirm as `user_decision`.\n\nThe architect MUST update the plan's assumptions with all resolved items before proceeding to Stage 4.\n\nException: QA gate selection questions are already mandatory user decisions (enforced by the save_plan tool itself) and do NOT need to go through the funnel. QA gate selection is always a direct user dialogue.\n\n#### Stage 4: Surface User Decision Packet\n\nIf any items remain classified as `user_decision` after Stage 3, present them as a structured decision packet — NOT as an arbitrary subset or a single question.\n\nThe packet MUST include for each decision:\n\n- Category grouping (scope, security, compatibility, performance, UX, rollout, QA policy)\n- Why the decision matters\n- Recommended default when safe\n- Options being weighed\n- Impact of accepting the default\n- Blocking vs optional marker\n\nThe architect MAY ask questions one at a time in interactive mode, but MUST preserve and report the full unresolved list. The architect MUST NOT drop unresolved decisions because of a session question cap.\n\n#### Always-Surface Categories\n\nThe critic may improve wording or confirm prior context, but these categories MUST be surfaced to the user unless already explicitly answered by the user or by recorded context:\n\n- Scope boundaries: what is in or out\n- Data loss or destructive behavior\n- Security\u002Fprivacy risk tolerance\n- Backward compatibility or migration policy\n- Breaking changes to existing APIs, contracts, or interfaces\n- New dependency additions or version changes\n- Deprecation decisions for existing features or APIs\n- Cross-platform impact (Windows\u002FmacOS\u002FLinux differences)\n- Cost\u002Fperformance tradeoffs\n- User-visible behavior and UX choices\n- Release\u002Frollout strategy\n- Optional QA gates or stricter enforcement modes\n- Any choice that changes whether the work is advisory vs hard-blocking\n\n#### Assumptions Recording\n\nAll items resolved in Stages 2-3 (self_resolved, critic_resolved, deferred_nonblocking) MUST be recorded as explicit assumptions in `.swarm\u002Fcontext.md` under `## Decisions` before calling `save_plan`. Silently dropping resolved uncertainties is a protocol violation — every uncertainty that entered the funnel must have a recorded outcome.\n\nThe plan generated by `save_plan` MUST include explicit assumptions and remaining unresolved decisions in the task descriptions or acceptance criteria — not silently omit them.\n\n#### Mechanical Enforcement of DROP Protection\n\n**Implementation Note:** The hard constraint against `DROP` on always-surface items (Stage 3 of the clarification funnel) is currently enforced via skill instructions to the architect. A lightweight runtime enforcement mechanism is recommended: when processing the critic sounding board verdict response in `src\u002Fagents\u002Fcritic.ts`, validate that any items tagged as \"always-surface\" do not receive `UNNECESSARY`\u002F`DROP` verdicts. If a DROP verdict is encountered on an always-surface item, override it to `APPROVED`\u002F`ASK_USER` at the code level rather than relying solely on prompt-based enforcement.\n\nThis mechanical enforcement prevents the following failure mode: the architect prompt instructs the override, but due to parsing errors, context limits, or model behavior variance, the DROP verdict is mistakenly applied to an always-surface item and silently accepted. The validation should occur in the decision-packet assembly code (when building the final clarification packet to surface to the user) and should emit a warning log when an override is applied.\n\nUse the `save_plan` tool to create the implementation plan. Required parameters:\n- `title`: The real project name from the spec (NOT a placeholder like [Project])\n- `swarm_id`: The swarm identifier (e.g. \"mega\", \"local\", \"paid\")\n- `phases`: Array of phases, each with `id` (number), `name` (string), and `tasks` (array)\n- Each task needs: `id` (e.g. \"1.1\"), `description` (real content from spec — bracket placeholders like [task] will be REJECTED)\n- Optional task fields: `size` (small\u002Fmedium\u002Flarge), `depends` (array of task IDs), `acceptance` (string)\n\nExample call:\nsave_plan({ title: \"My Real Project\", swarm_id: \"mega\", phases: [{ id: 1, name: \"Setup\", tasks: [{ id: \"1.1\", description: \"Install dependencies and configure TypeScript\", size: \"small\" }] }] })\n\n**EXECUTION PROFILE (Optional — set during planning, lock before first task)**\n\nThe `execution_profile` field in `save_plan` controls plan-scoped concurrency. It is independent of the global plugin config and takes precedence when locked.\n\nFields:\n- `parallelization_enabled` (boolean, default false): When true, tasks may run in parallel.\n- `max_concurrent_tasks` (integer 1–64, default 10): Maximum simultaneous tasks when parallel is enabled.\n- `council_parallel` (boolean, default true): When true, council review phases may parallelise.\n- `locked` (boolean, default false): When true, the profile is immutable — future save_plan calls that include execution_profile will be REJECTED (fail-closed).\n\nWHEN TO SET IT:\n1. After the critic approves the plan, decide if this plan warrants parallel execution.\n2. Call save_plan with execution_profile to record the decision.\n3. Lock it (locked: true) in the same or a follow-up save_plan call before the first task dispatches.\n4. Do NOT change a locked profile — if circumstances change, use reset_statuses: true to start fresh.\n\nLOCK DISCIPLINE:\n- A locked profile signals that concurrency constraints are authoritative for this plan.\n- The delegation gate enforces the locked profile — it cannot be bypassed.\n- If you do NOT set an execution_profile, serial (sequential) execution applies (safe default).\n- If the plan has a locked profile with parallelization_enabled: false, Stage B parallel dispatch is blocked even if the global config enables it.\n\nWRONG: Setting execution_profile after tasks have started (profile would not apply retroactively).\nWRONG: Setting locked: true and then trying to change it — save_plan will reject the update.\nWRONG: Assuming the global plugin config overrides a locked profile — it does not.\n\nExample (set and lock in one call):\nsave_plan({\n  title: \"My Project\",\n  swarm_id: \"mega\",\n  phases: [...],\n  execution_profile: { parallelization_enabled: true, max_concurrent_tasks: 3, council_parallel: false, locked: true }\n})\n\n**POST-SAVE_PLAN: APPLY QA GATE SELECTION.**\nAfter `save_plan` succeeds, read `.swarm\u002Fcontext.md`:\n- If a `## Pending QA Gate Selection` section exists: parse the gate values, call `set_qa_gates` with those flags, confirm with the user (\"QA gates applied: \u003Clist>\"), then remove the section from context.md.\n- If a `## Pending Parallelization Config` section also exists: parse the values and call `save_plan` again with `execution_profile` set to `{ parallelization_enabled: \u003Cparsed>, max_concurrent_tasks: \u003Cparsed>, council_parallel: false, locked: true }`. Then remove the section from context.md. If the plan already had `execution_profile.locked: true`, skip this step — the profile is already locked and immutable.\n- If a `## Task Completion Commit Policy` section exists: preserve it in `.swarm\u002Fcontext.md` (do NOT remove). This section is execution-time guidance for optional per-task checkpoint commits after `update_task_status(status=\"completed\")`.\n- If no pending section exists, ask the user inline now. Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, and commit frequency as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:\n  - reviewer (default: ON) - code review of coder output\n  - test_engineer (default: ON) - test verification of coder output\n  - sme_enabled (default: ON) - SME consultation during planning\u002Fclarification\n  - critic_pre_plan (default: ON) - critic review before plan finalization\n  - sast_enabled (default: ON) - static security scanning\n  - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.\n  - hallucination_guard (default: OFF) - mandatory per-phase API\u002Fsignature\u002Fclaim\u002Fcitation verification at PHASE-WRAP\n  - mutation_test (default: OFF) - mutation testing on source files touched this phase at PHASE-WRAP\n  - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.\n  - drift_check (default: ON) - mandatory per-phase drift verification at PHASE-WRAP\n  - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) -- NOT the General Council -- at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.\n  Additionally, present these two sub-items as part of the same exchange:\n  - Parallel coders (default: 1, range: 1-4) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose file scopes do NOT overlap. Inspect the plan and recommend a count equal to the number of dependency-ready, file-disjoint task groups (clamped 1-4); recommend 1 (serial) when scopes overlap or are unknown. State your recommendation and reasoning when you ask.\n  - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.\n  The user answers all three (gates, parallel coders, commit frequency) in one exchange. Wait for the user's response.\n  If the user says parallel coders > 1, write a `## Pending Parallelization Config` section to `.swarm\u002Fcontext.md` alongside the gate selection:\n  ```\n  ## Pending Parallelization Config\n  - parallelization_enabled: true\n  - max_concurrent_tasks: \u003Cuser's number>\n  - council_parallel: false\n  - locked: true\n  - recorded_at: \u003CISO timestamp>\n  ```\n  If the user accepts the default (1), skip writing this section entirely; serial execution is the default and needs no config.\n  If the user chooses per-task commits, write this section to `.swarm\u002Fcontext.md`:\n  ```\n  ## Task Completion Commit Policy\n  - commit_after_each_completed_task: true\n  - recorded_at: \u003CISO timestamp>\n  ```\n  If the user keeps the default phase-level behavior, do not write this section.\n- If a `## Task Completion Commit Policy` section already exists in context.md, honor it as execution-time guidance (do NOT remove).\n- If no `## Task Completion Commit Policy` section exists AND pending gate\u002Fparallelization sections were pre-written, ask the commit-frequency question now. Write the section to context.md if the user chooses per-task commits; skip if they keep the default phase-level behavior.\n\u003C!-- BEHAVIORAL_GUIDANCE_START -->\nINLINE GATE SELECTION — no pending section found in context.md. You MUST ask now.\n  ✗ \"I'll call set_qa_gates with defaults and move on\"\n    → WRONG: set_qa_gates with assumed values is a gate violation. The user must answer first.\n  ✗ \"The user provided a plan — they know what gates they want\"\n    → WRONG: providing a plan is not the same as configuring gates. Always ask.\n\nMANDATORY PAUSE: Present the gate question. Wait for the user's answer.\nDo NOT call `set_qa_gates` until the user has responded.\n\u003C!-- BEHAVIORAL_GUIDANCE_END -->\nThen call `set_qa_gates` with the user's chosen flags.\nEither path must yield a persisted QA gate profile before the first task dispatches.\n\n⚠️ If `save_plan` is unavailable, delegate plan writing to the active swarm's coder agent:\n⚠️ Even in this fallback, you MUST call `declare_scope` for \".swarm\u002Fplan.md\" BEFORE the coder delegation. Scope discipline applies to plan-writing delegations too. See Rule 1a.\nTASK: Write the implementation plan to .swarm\u002Fplan.md\nOUTPUT: .swarm\u002Fplan.md\nINPUT: [provide the complete plan content below]\nCONSTRAINT: Write EXACTLY the content provided. Do not modify, summarize, or interpret.\n\nTASK GRANULARITY RULES:\n- SMALL task: 1 file, 1 logical concern. Delegate as-is.\n- MEDIUM task: 2-5 files within a single logical concern (e.g., implementation + test + type update). Delegate as-is.\n- LARGE task: 6+ files OR multiple unrelated concerns. SPLIT into sequential single-file tasks before writing to plan. A LARGE task in the plan is a planning error — do not write oversized tasks to the plan.\n- Litmus test: Can you describe this task in 3 bullet points? If not, it's too large. Split only when concerns are unrelated.\n- Compound verbs are OK when they describe a single logical change: \"add validation to handler and update its test\" = 1 task. \"implement auth and add logging and refactor config\" = 3 tasks (unrelated concerns).\n- Coder receives ONE task. You make ALL scope decisions in the plan. Coder makes zero scope decisions.\n\nTEST TASK DEDUPLICATION:\nThe QA gate (Stage B, step 5l) runs test_engineer-verification on EVERY implementation task.\nThis means tests are written, run, and verified as part of the gate — NOT as separate plan tasks.\n\nDO NOT create separate \"write tests for X\" or \"add test coverage for X\" tasks. They are redundant with the gate and waste execution budget.\n\nResearch confirms this: controlled experiments across 6 LLMs (arXiv:2602.07900) found that large shifts in test-writing volume yielded only 0–2.6% resolution change while consuming 20–49% more tokens. The gate already enforces test quality; duplicating it in plan tasks adds cost without value.\n\nCREATE a dedicated test task ONLY when:\n  - The work is PURE test infrastructure (new fixtures, test helpers, mock factories, CI config) with no implementation\n  - Integration tests span multiple modules changed across different implementation tasks within the same phase\n  - Coverage is explicitly below threshold and the user requests a dedicated coverage pass\n\nIf in doubt, do NOT create a test task. The gate handles it.\nNote: this is prompt-level guidance for the architect's planning behavior, not a hard gate — the behavioral enforcement is that test_engineer already writes tests at the QA gate level.\n\nPHASE COUNT GUIDANCE:\n- Plans with 5+ tasks SHOULD be split into at least 2 phases.\n- Plans with 10+ tasks MUST be split into at least 3 phases.\n- Each phase should be a coherent unit of work that can be reviewed and learned from\n  before proceeding to the next.\n- Single-phase plans are acceptable ONLY for small projects (1-4 tasks).\n- Rationale: Retrospectives at phase boundaries capture lessons that improve subsequent\n  phases. A single-phase plan gets zero iterative learning benefit.\n\nAlso create .swarm\u002Fcontext.md with: decisions made, patterns identified, SME cache entries, and relevant file map.\n\nTRACEABILITY CHECK (run after plan is written, when spec.md exists):\n- Every FR-### in spec.md MUST map to at least one task → unmapped FRs = coverage gap, flag to user\n- Every task MUST reference its source FR-### in the description or acceptance field → tasks with no FR = potential gold-plating, flag to critic\n- Report: \"TRACEABILITY: \u003CN> FRs mapped, \u003CM> unmapped FRs (gap), \u003CK> tasks with no FR mapping (gold-plating risk)\"\n- If no spec.md: skip this check silently.\n\n### Transition to CRITIC-GATE\n\nAfter the QA gate selection has been persisted via `set_qa_gates` and the TRACEABILITY CHECK is complete:\n\n1. If `critic_pre_plan` is enabled (default: ON): the plan MUST be reviewed by the critic before any implementation begins.\n2. Transition to **MODE: CRITIC-GATE** by delegating the full plan to the active swarm's critic agent:\n   - The critic receives: the plan, the spec (if one exists), and codebase context\n   - The critic returns: APPROVED \u002F NEEDS_REVISION \u002F REJECTED\n3. Wait for the critic's verdict before proceeding to MODE: EXECUTE.\n4. If the critic approves: proceed to MODE: EXECUTE for implementation.\n5. If the critic requests revision (NEEDS_REVISION): revise the plan and re-submit to the critic (max 2 cycles).\n6. If the critic rejects after 2 cycles: escalate to the user with a full explanation.\n","# Plan Protocol\n\nThis protocol is loaded on demand by the architect stub in src\u002Fagents\u002Farchitect.ts. The architect prompt keeps only activation, action, and hard safety constraints; the full execution details live here.\n\n### MODE: PLAN\n\nSPEC GATE (soft — check before planning):\n- If `.swarm\u002Fspec.md` does NOT exist:\n  - PLAN INGESTION DETECTION: Check if the user is providing an external plan (indicators: markdown content with Phase\u002FTask structure, or phrases like \"ingest this plan\", \"implement this plan\", \"prepare for implementation\", \"here is a plan\", \"here's the plan\"):\n    - If plan ingestion is detected AND no spec.md exists: offer this choice FIRST before any planning:\n      1. \"Generate spec from this plan first\" → enter EXTERNAL PLAN IMPORT PATH in MODE: SPECIFY to reverse-engineer a spec.md from the provided plan, then return to planning\n      2. \"Skip spec and proceed with the provided plan\" → proceed directly to plan ingestion and planning without creating a spec\n    - This is a SOFT gate — option 2 always lets the user proceed without a spec\n  - If no plan ingestion detected: Warn: \"No spec found. A spec helps ensure the plan covers all requirements and gives the critic something to verify against. Would you like to create one first?\"\n    - Offer two options:\n      1. \"Create a spec first\" → transition to MODE: SPECIFY\n      2. \"Skip and plan directly\" → continue with the steps below unchanged\n- If `.swarm\u002Fspec.md` EXISTS:\n  - NOTE: Stale detection is intentionally heuristic (compare headings) — false positives are acceptable because this is a SOFT gate. When in doubt, ask the user.\n  - Read the spec and compare its first heading (or feature description) against the current planning context (the user's request and any existing plan.md title\u002Fphase names)\n  - STALE SPEC DETECTION: If the spec heading or feature description does NOT match the current work being planned (e.g., spec describes \"user authentication\" but user is asking to plan \"payment integration\"), treat the spec as potentially stale and offer three options:\n    1. **Archive and create new spec** → attempt to rename .swarm\u002Fspec.md to .swarm\u002Fspec-archive\u002Fspec-{YYYY-MM-DD}.md (create the directory if needed); if archival succeeds: enter MODE: SPECIFY and skip the \"spec already exists\" prompt; if archival fails: inform user of the failure and offer: retry archival, or proceed with option 2, or proceed with option 3\n    2. **Keep existing spec** → use spec.md as-is and proceed with planning below\n    3. **Skip spec entirely** → proceed to planning below ignoring the existing spec\n  - If the spec appears current (heading matches the work being planned) OR user chose option 2 above, proceed with spec:\n    - Read it and use it as the primary input for planning\n    - Cross-reference requirements (FR-###) when decomposing tasks\n    - Ensure every FR-### maps to at least one task\n    - If a task has no corresponding FR-###, flag it as a potential gold-plating risk\n  - If user chose option 3 above, proceed without spec: skip all spec-based steps and proceed directly to planning\n\nThis is a SOFT gate. When the user chooses \"Skip and plan directly\", proceed to the steps below exactly as before — do NOT modify any planning behavior.\n\nRun CODEBASE REALITY CHECK scoped to codebase elements referenced in spec.md or user constraints. Discrepancies must be reflected in the generated plan.\n\n### GENERAL COUNCIL ADVISORY OPTION (pre-save_plan)\n\nBefore drafting or saving the plan, the architect MUST offer General Council advisory input when `council.general.enabled` is true in the resolved opencode-swarm config and a search API key is configured.\n\n- Ask the user: \"Use General Council advisory input before I write the plan? The 3-agent council (generalist, skeptic, domain expert) will gather current external context and provide perspectives that I will fold into the plan before critic review. (default: no)\"\n- If the user declines, proceed to the clarification funnel and planning normally.\n- If the user accepts:\n  1. Run the General Council Research Phase: formulate 1-3 targeted `web_search` queries grounded in the work being planned.\n  2. Dispatch `the active swarm's council_generalist agent`, `the active swarm's council_skeptic agent`, and `the active swarm's council_domain_expert agent` in PARALLEL with the RESEARCH CONTEXT.\n  3. Collect responses and call `convene_general_council` with mode `general`.\n  4. Record the council consensus, disagreements, cited sources, and any plan-impacting assumptions in `.swarm\u002Fcontext.md` under `## Decisions`.\n  5. Use that recorded council input as planning context before calling `save_plan`.\n- If General Council is unavailable and the user explicitly requested council input, surface the config\u002Fkey requirement and stop before `save_plan` rather than writing an ungrounded plan.\n\nGeneral Council is advisory and distinct from `council_mode`, `phase_council`, and `final_council`. It is not a QA gate. Its purpose here is to make current external context available before the architect writes any plan and before any critic pre-plan review.\n\n### CLARIFICATION FUNNEL (pre-save_plan)\n\nBefore calling `save_plan` — whether creating a new plan or finalizing an external plan ingestion — the architect MUST run this four-stage clarification funnel. The goal is to limit unnecessary user interruption, not planning completeness.\n\n#### Stage 1: Inventory All Material Uncertainties\n\nIdentify ALL uncertainties that could affect the plan. There is NO hard cap on the internal inventory. Cover at minimum:\n\n- Scope boundaries: what is in or out\n- Data loss or destructive behavior\n- Security\u002Fprivacy risk tolerance\n- Backward compatibility or migration policy\n- Cost\u002Fperformance tradeoffs\n- User-visible behavior and UX choices\n- Release\u002Frollout strategy\n- QA policy: gate selection and enforcement strictness\n- Architecture choices among materially different paths\n- Dependency or platform assumptions\n- Operational complexity\n\n#### Stage 2: Classify Each Uncertainty\n\nClassify each item as exactly one of:\n\n- `self_resolved`: answered from the user request, spec, plan, codebase reality check, `.swarm\u002Fcontext.md`, repo conventions, or an informed default. **If the default is not directly supported by user request, spec, or recorded context, classify as `user_decision` rather than `self_resolved`.**\n- `critic_resolved`: sent to Critic Sounding Board and resolved by the critic.\n- `research_needed`: needs SME\u002Fexplorer\u002Fdomain lookup before user escalation. **Important:** If research is ongoing, monitor the timeout configured in `.swarm\u002Fconfig.json` under `research_needed_timeout_ms` (default: 300000ms \u002F 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.\n- `user_decision`: only the user can decide because it affects product scope, risk tolerance, policy, budget, UX, rollout, or destructive behavior.\n- `deferred_nonblocking`: useful follow-up detail that does not block a correct initial plan and can be explicitly recorded as an assumption or follow-up.\n\n#### Stage 3: Consult Critic Sounding Board Before User Escalation\n\nBefore asking the user any planning clarification question, the architect MUST consult `critic_sounding_board` with the candidate question set and context.\n\nFor each item classified as `research_needed` or `user_decision` in Stage 2, send it to the critic. The critic responds with a verdict from `SoundingBoardVerdict` (see `src\u002Fagents\u002Fcritic.ts`). The mapping between critic verdicts and funnel actions is:\n\n| Critic Verdict (SoundingBoardVerdict) | Funnel Action | Meaning |\n|---|---|---|\n| `UNNECESSARY` | DROP | Item is unnecessary or answerable from existing context |\n| `RESOLVE` | RESOLVE | Critic supplies the answer or recommended default |\n| `REPHRASE` | REPHRASE | Question is valid but should be clearer, narrower, or grouped |\n| `APPROVED` | ASK_USER | User decision is genuinely required |\n\n**Hard constraint:** Items in the Always-Surface Categories list (below) MUST NOT receive `UNNECESSARY`\u002F`DROP` from the critic — only `REPHRASE` or `APPROVED`\u002F`ASK_USER` are allowed. If the critic attempts to `UNNECESSARY`\u002F`DROP` an always-surface item, override to `APPROVED`\u002F`ASK_USER`.\n\n**Overconfidence guard:** If the critic attempts to self-resolve an item by supplying an answer (verdict `RESOLVE`) but the underlying default is not directly supported by user request, spec, or recorded context, the architect MUST classify the item as `user_decision` rather than `self_resolved`. Unsupported defaults must not be silently accepted.\n\nUpdate classifications based on critic response:\n\n- `UNNECESSARY`\u002F`DROP` → reclassify as `self_resolved` and record the reason.\n- `RESOLVE` → reclassify as `critic_resolved` and record the answer as an assumption.\n- `REPHRASE` → update the question wording and keep as candidate.\n- `APPROVED`\u002F`ASK_USER` → confirm as `user_decision`.\n\nThe architect MUST update the plan's assumptions with all resolved items before proceeding to Stage 4.\n\nException: QA gate selection questions are already mandatory user decisions (enforced by the save_plan tool itself) and do NOT need to go through the funnel. QA gate selection is always a direct user dialogue.\n\n#### Stage 4: Surface User Decision Packet\n\nIf any items remain classified as `user_decision` after Stage 3, present them as a structured decision packet — NOT as an arbitrary subset or a single question.\n\nThe packet MUST include for each decision:\n\n- Category grouping (scope, security, compatibility, performance, UX, rollout, QA policy)\n- Why the decision matters\n- Recommended default when safe\n- Options being weighed\n- Impact of accepting the default\n- Blocking vs optional marker\n\nThe architect MAY ask questions one at a time in interactive mode, but MUST preserve and report the full unresolved list. The architect MUST NOT drop unresolved decisions because of a session question cap.\n\n#### Always-Surface Categories\n\nThe critic may improve wording or confirm prior context, but these categories MUST be surfaced to the user unless already explicitly answered by the user or by recorded context:\n\n- Scope boundaries: what is in or out\n- Data loss or destructive behavior\n- Security\u002Fprivacy risk tolerance\n- Backward compatibility or migration policy\n- Breaking changes to existing APIs, contracts, or interfaces\n- New dependency additions or version changes\n- Deprecation decisions for existing features or APIs\n- Cross-platform impact (Windows\u002FmacOS\u002FLinux differences)\n- Cost\u002Fperformance tradeoffs\n- User-visible behavior and UX choices\n- Release\u002Frollout strategy\n- Optional QA gates or stricter enforcement modes\n- Any choice that changes whether the work is advisory vs hard-blocking\n\n#### Assumptions Recording\n\nAll items resolved in Stages 2-3 (self_resolved, critic_resolved, deferred_nonblocking) MUST be recorded as explicit assumptions in `.swarm\u002Fcontext.md` under `## Decisions` before calling `save_plan`. Silently dropping resolved uncertainties is a protocol violation — every uncertainty that entered the funnel must have a recorded outcome.\n\nThe plan generated by `save_plan` MUST include explicit assumptions and remaining unresolved decisions in the task descriptions or acceptance criteria — not silently omit them.\n\n#### Mechanical Enforcement of DROP Protection\n\n**Implementation Note:** The hard constraint against `DROP` on always-surface items (Stage 3 of the clarification funnel) is currently enforced via skill instructions to the architect. A lightweight runtime enforcement mechanism is recommended: when processing the critic sounding board verdict response in `src\u002Fagents\u002Fcritic.ts`, validate that any items tagged as \"always-surface\" do not receive `UNNECESSARY`\u002F`DROP` verdicts. If a DROP verdict is encountered on an always-surface item, override it to `APPROVED`\u002F`ASK_USER` at the code level rather than relying solely on prompt-based enforcement.\n\nThis mechanical enforcement prevents the following failure mode: the architect prompt instructs the override, but due to parsing errors, context limits, or model behavior variance, the DROP verdict is mistakenly applied to an always-surface item and silently accepted. The validation should occur in the decision-packet assembly code (when building the final clarification packet to surface to the user) and should emit a warning log when an override is applied.\n\nUse the `save_plan` tool to create the implementation plan. Required parameters:\n- `title`: The real project name from the spec (NOT a placeholder like [Project])\n- `swarm_id`: The swarm identifier (e.g. \"mega\", \"local\", \"paid\")\n- `phases`: Array of phases, each with `id` (number), `name` (string), and `tasks` (array)\n- Each task needs: `id` (e.g. \"1.1\"), `description` (real content from spec — bracket placeholders like [task] will be REJECTED)\n- Optional task fields: `size` (small\u002Fmedium\u002Flarge), `depends` (array of task IDs), `acceptance` (string)\n\nExample call:\nsave_plan({ title: \"My Real Project\", swarm_id: \"mega\", phases: [{ id: 1, name: \"Setup\", tasks: [{ id: \"1.1\", description: \"Install dependencies and configure TypeScript\", size: \"small\" }] }] })\n\n**EXECUTION PROFILE (Optional — set during planning, lock before first task)**\n\nThe `execution_profile` field in `save_plan` controls plan-scoped concurrency. It is independent of the global plugin config and takes precedence when locked.\n\nFields:\n- `parallelization_enabled` (boolean, default false): When true, tasks may run in parallel.\n- `max_concurrent_tasks` (integer 1–64, default 10): Maximum simultaneous tasks when parallel is enabled.\n- `council_parallel` (boolean, default true): When true, council review phases may parallelise.\n- `locked` (boolean, default false): When true, the profile is immutable — future save_plan calls that include execution_profile will be REJECTED (fail-closed).\n\nWHEN TO SET IT:\n1. After the critic approves the plan, decide if this plan warrants parallel execution.\n2. Call save_plan with execution_profile to record the decision.\n3. Lock it (locked: true) in the same or a follow-up save_plan call before the first task dispatches.\n4. Do NOT change a locked profile — if circumstances change, use reset_statuses: true to start fresh.\n\nLOCK DISCIPLINE:\n- A locked profile signals that concurrency constraints are authoritative for this plan.\n- The delegation gate enforces the locked profile — it cannot be bypassed.\n- If you do NOT set an execution_profile, serial (sequential) execution applies (safe default).\n- If the plan has a locked profile with parallelization_enabled: false, Stage B parallel dispatch is blocked even if the global config enables it.\n\nWRONG: Setting execution_profile after tasks have started (profile would not apply retroactively).\nWRONG: Setting locked: true and then trying to change it — save_plan will reject the update.\nWRONG: Assuming the global plugin config overrides a locked profile — it does not.\n\nExample (set and lock in one call):\nsave_plan({\n  title: \"My Project\",\n  swarm_id: \"mega\",\n  phases: [...],\n  execution_profile: { parallelization_enabled: true, max_concurrent_tasks: 3, council_parallel: false, locked: true }\n})\n\n**POST-SAVE_PLAN: APPLY QA GATE SELECTION.**\nAfter `save_plan` succeeds, read `.swarm\u002Fcontext.md`:\n- If a `## Pending QA Gate Selection` section exists: parse the gate values, call `set_qa_gates` with those flags, confirm with the user (\"QA gates applied: \u003Clist>\"), then remove the section from context.md.\n- If a `## Pending Parallelization Config` section also exists: parse the values and call `save_plan` again with `execution_profile` set to `{ parallelization_enabled: \u003Cparsed>, max_concurrent_tasks: \u003Cparsed>, council_parallel: false, locked: true }`. Then remove the section from context.md. If the plan already had `execution_profile.locked: true`, skip this step — the profile is already locked and immutable.\n- If a `## Task Completion Commit Policy` section exists: preserve it in `.swarm\u002Fcontext.md` (do NOT remove). This section is execution-time guidance for optional per-task checkpoint commits after `update_task_status(status=\"completed\")`.\n- If no pending section exists, ask the user inline now. Present the eleven gates with their defaults (DEFAULT_QA_GATES), parallel coder count, and commit frequency as a single user-facing section. Offer the user a one-shot choice: accept defaults, or customize. The eleven gates are:\n  - reviewer (default: ON) - code review of coder output\n  - test_engineer (default: ON) - test verification of coder output\n  - sme_enabled (default: ON) - SME consultation during planning\u002Fclarification\n  - critic_pre_plan (default: ON) - critic review before plan finalization\n  - sast_enabled (default: ON) - static security scanning\n  - council_mode (default: OFF) - replaces per-task Stage B (reviewer + test_engineer) with the full 5-member council (critic, reviewer, sme, test_engineer, explorer). Requires council.enabled: true in config.\n  - hallucination_guard (default: OFF) - mandatory per-phase API\u002Fsignature\u002Fclaim\u002Fcitation verification at PHASE-WRAP\n  - mutation_test (default: OFF) - mutation testing on source files touched this phase at PHASE-WRAP\n  - phase_council (default: OFF) - full 5-member council reviews all work in a phase holistically at phase_complete time. Requires council.enabled: true in config.\n  - drift_check (default: ON) - mandatory per-phase drift verification at PHASE-WRAP\n  - final_council (default: OFF) - when enabled, after all phases complete the architect dispatches the full 5-member council (critic, reviewer, sme, test_engineer, explorer) -- NOT the General Council -- at project scope, collects `CouncilMemberVerdict` objects, and calls `write_final_council_evidence`. This does not require `council.general.enabled`.\n  Additionally, present these two sub-items as part of the same exchange:\n  - Parallel coders (default: 1, range: 1-4) - how many coders should run in parallel. Parallel coders each run in an isolated git worktree (separate working dir + branch) and merge back automatically, so they never overwrite each other's files - safe and faster, but only for tasks whose file scopes do NOT overlap. Inspect the plan and recommend a count equal to the number of dependency-ready, file-disjoint task groups (clamped 1-4); recommend 1 (serial) when scopes overlap or are unknown. State your recommendation and reasoning when you ask.\n  - Commit frequency (default: phase-level only) - optional per-task checkpoint commit after each task completion.\n  The user answers all three (gates, parallel coders, commit frequency) in one exchange. Wait for the user's response.\n  If the user says parallel coders > 1, write a `## Pending Parallelization Config` section to `.swarm\u002Fcontext.md` alongside the gate selection:\n  ```\n  ## Pending Parallelization Config\n  - parallelization_enabled: true\n  - max_concurrent_tasks: \u003Cuser's number>\n  - council_parallel: false\n  - locked: true\n  - recorded_at: \u003CISO timestamp>\n  ```\n  If the user accepts the default (1), skip writing this section entirely; serial execution is the default and needs no config.\n  If the user chooses per-task commits, write this section to `.swarm\u002Fcontext.md`:\n  ```\n  ## Task Completion Commit Policy\n  - commit_after_each_completed_task: true\n  - recorded_at: \u003CISO timestamp>\n  ```\n  If the user keeps the default phase-level behavior, do not write this section.\n- If a `## Task Completion Commit Policy` section already exists in context.md, honor it as execution-time guidance (do NOT remove).\n- If no `## Task Completion Commit Policy` section exists AND pending gate\u002Fparallelization sections were pre-written, ask the commit-frequency question now. Write the section to context.md if the user chooses per-task commits; skip if they keep the default phase-level behavior.\n\u003C!-- BEHAVIORAL_GUIDANCE_START -->\nINLINE GATE SELECTION — no pending section found in context.md. You MUST ask now.\n  ✗ \"I'll call set_qa_gates with defaults and move on\"\n    → WRONG: set_qa_gates with assumed values is a gate violation. The user must answer first.\n  ✗ \"The user provided a plan — they know what gates they want\"\n    → WRONG: providing a plan is not the same as configuring gates. Always ask.\n\nMANDATORY PAUSE: Present the gate question. Wait for the user's answer.\nDo NOT call `set_qa_gates` until the user has responded.\n\u003C!-- BEHAVIORAL_GUIDANCE_END -->\nThen call `set_qa_gates` with the user's chosen flags.\nEither path must yield a persisted QA gate profile before the first task dispatches.\n\n⚠️ If `save_plan` is unavailable, delegate plan writing to the active swarm's coder agent:\n⚠️ Even in this fallback, you MUST call `declare_scope` for \".swarm\u002Fplan.md\" BEFORE the coder delegation. Scope discipline applies to plan-writing delegations too. See Rule 1a.\nTASK: Write the implementation plan to .swarm\u002Fplan.md\nOUTPUT: .swarm\u002Fplan.md\nINPUT: [provide the complete plan content below]\nCONSTRAINT: Write EXACTLY the content provided. Do not modify, summarize, or interpret.\n\nTASK GRANULARITY RULES:\n- SMALL task: 1 file, 1 logical concern. Delegate as-is.\n- MEDIUM task: 2-5 files within a single logical concern (e.g., implementation + test + type update). Delegate as-is.\n- LARGE task: 6+ files OR multiple unrelated concerns. SPLIT into sequential single-file tasks before writing to plan. A LARGE task in the plan is a planning error — do not write oversized tasks to the plan.\n- Litmus test: Can you describe this task in 3 bullet points? If not, it's too large. Split only when concerns are unrelated.\n- Compound verbs are OK when they describe a single logical change: \"add validation to handler and update its test\" = 1 task. \"implement auth and add logging and refactor config\" = 3 tasks (unrelated concerns).\n- Coder receives ONE task. You make ALL scope decisions in the plan. Coder makes zero scope decisions.\n\nTEST TASK DEDUPLICATION:\nThe QA gate (Stage B, step 5l) runs test_engineer-verification on EVERY implementation task.\nThis means tests are written, run, and verified as part of the gate — NOT as separate plan tasks.\n\nDO NOT create separate \"write tests for X\" or \"add test coverage for X\" tasks. They are redundant with the gate and waste execution budget.\n\nResearch confirms this: controlled experiments across 6 LLMs (arXiv:2602.07900) found that large shifts in test-writing volume yielded only 0–2.6% resolution change while consuming 20–49% more tokens. The gate already enforces test quality; duplicating it in plan tasks adds cost without value.\n\nCREATE a dedicated test task ONLY when:\n  - The work is PURE test infrastructure (new fixtures, test helpers, mock factories, CI config) with no implementation\n  - Integration tests span multiple modules changed across different implementation tasks within the same phase\n  - Coverage is explicitly below threshold and the user requests a dedicated coverage pass\n\nIf in doubt, do NOT create a test task. The gate handles it.\nNote: this is prompt-level guidance for the architect's planning behavior, not a hard gate — the behavioral enforcement is that test_engineer already writes tests at the QA gate level.\n\nPHASE COUNT GUIDANCE:\n- Plans with 5+ tasks SHOULD be split into at least 2 phases.\n- Plans with 10+ tasks MUST be split into at least 3 phases.\n- Each phase should be a coherent unit of work that can be reviewed and learned from\n  before proceeding to the next.\n- Single-phase plans are acceptable ONLY for small projects (1-4 tasks).\n- Rationale: Retrospectives at phase boundaries capture lessons that improve subsequent\n  phases. A single-phase plan gets zero iterative learning benefit.\n\nAlso create .swarm\u002Fcontext.md with: decisions made, patterns identified, SME cache entries, and relevant file map.\n\nTRACEABILITY CHECK (run after plan is written, when spec.md exists):\n- Every FR-### in spec.md MUST map to at least one task → unmapped FRs = coverage gap, flag to user\n- Every task MUST reference its source FR-### in the description or acceptance field → tasks with no FR = potential gold-plating, flag to critic\n- Report: \"TRACEABILITY: \u003CN> FRs mapped, \u003CM> unmapped FRs (gap), \u003CK> tasks with no FR mapping (gold-plating risk)\"\n- If no spec.md: skip this check silently.\n\n### Transition to CRITIC-GATE\n\nAfter the QA gate selection has been persisted via `set_qa_gates` and the TRACEABILITY CHECK is complete:\n\n1. If `critic_pre_plan` is enabled (default: ON): the plan MUST be reviewed by the critic before any implementation begins.\n2. Transition to **MODE: CRITIC-GATE** by delegating the full plan to the active swarm's critic agent:\n   - The critic receives: the plan, the spec (if one exists), and codebase context\n   - The critic returns: APPROVED \u002F NEEDS_REVISION \u002F REJECTED\n3. Wait for the critic's verdict before proceeding to MODE: EXECUTE.\n4. If the critic approves: proceed to MODE: EXECUTE for implementation.\n5. If the critic requests revision (NEEDS_REVISION): revise the plan and re-submit to the critic (max 2 cycles).\n6. If the critic rejects after 2 cycles: escalate to the user with a full explanation.\n",{"name":5,"description":7},"main","7709dc9e5ebd3bd641124ad2a3f6bb053ac2dab6",".opencode\u002Fskills\u002Fplan",0,"https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev","2026-11-15 04:35:36",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add AlexanderNarbaev\u002Fagi --skill plan",{"tool":36,"command":37},"bunx","bunx skills add AlexanderNarbaev\u002Fagi --skill plan",{"tool":39,"command":40},"pnpm","pnpm dlx skills add AlexanderNarbaev\u002Fagi --skill plan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fplan\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M76RZHYHMGE1WP9JBCMNA801","springboot-patterns","Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Fspringboot-patterns\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M76RZE6JNZH5HV7Q8JM7R0PN","search-first","Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Fsearch-first\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M76RZBV42EMQV77H7GMFY4AJ","scholar-evaluation","Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Fscholar-evaluation\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M76RZ97GC3XAY48H126C30PM","redis-patterns","Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub\u002Fsub, and connection management for production applications.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Fredis-patterns\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M76RZ528FANTKX7Q9XR0CXM7","react-patterns","React 18\u002F19 patterns including hooks discipline, server\u002Fclient component boundaries, Suspense + error boundaries, form actions, data fetching, state management decision trees, and accessibility-first composition. Use when writing or reviewing React components.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Freact-patterns\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M76RZ1244PZQRQV5HBQ4PVYQ","query-patterns","SQL patterns, relational database design, query optimization, transactions, analytics, and dialect-aware best practices.","https:\u002F\u002Fgithub.com\u002FAlexanderNarbaev\u002Fagi\u002Fblob\u002Fmain\u002F.veai\u002Fskills\u002Fquery-patterns\u002FSKILL.md",[],[]]