Use plans/project-context.md as the stable reference for agent roster, complexity tiers, semantic risk taxonomy, and shared conventions.
cd evals && npm test # full offline suite: schema + behavior + orchestration + drift
npm run test:structural # schema/P.A.R.T structure only (faster)
npm run test:behavior # prompt-behavior + orchestration-handoff regressions onlyScenarios are in evals/scenarios/. Validate against matching schemas in schemas/.
Agent resource paths are workspace-relative by default. When a file listed in any agent's ## Resources section is not found in the active workspace root:
- Retry the read using the absolute prefix
{{VSCODE_USER_PROMPTS_FOLDER}}/(for example,{{VSCODE_USER_PROMPTS_FOLDER}}/governance/model-routing.json). - If still not found, log the missing path in the gate event and continue with
confidencereduced by 0.1 per missing critical file. - Never fabricate file contents. Never silently proceed as if a missing governance file contained default values.
- Applies to
governance/,schemas/,plans/project-context.md,docs/agent-engineering/, andskills/paths referenced in agent## Resourcessections.
This boot-time rule intentionally duplicates docs/agent-engineering/TOOL-ROUTING.md Rule 8 so global user-level agents can recover before TOOL-ROUTING.md itself is loaded.
When status is FAILED, NEEDS_INPUT, NEEDS_REVISION, or REJECTED, include failure_classification:
transient— Flaky test, network timeout, or temporary tool unavailability; retry with identical scope.fixable— Small correctable issue (typo, missing import, config value); retry with fix hint.needs_replan— Architecture mismatch or missing dependency; delegate to Planner for targeted replan.escalate— Security vulnerability, data integrity risk, or unresolvable blocker; stop and await human approval.model_unavailable— the routed/primary model is unavailable or unreachable; substitute per model-routing fallback and retry up tomodel_unavailable_max(see runtime-policy.json), then escalate. Distinct fromtransient; the PlanAuditor/AssumptionVerifiertransient-exclusion does NOT excludemodel_unavailable.
Maintain/update NOTES.md for persistent state across context resets:
- Active objective and current phase.
- Blockers and unresolved risks.
- Remove stale entries when superseded.
- Keep within the 20-line budget (enforced by
evals/validate.mjsPass 7, style drift checked viavalidateNotesMdStyleinevals/drift-checks.mjs).
See docs/agent-engineering/MEMORY-ARCHITECTURE.md for the canonical three-layer memory model (session / task-episodic / repo-persistent). NOTES.md holds repo-persistent active-objective state only; task-specific history lives in plans/artifacts/<task-slug>/.
Before writing to /memories/repo/ or updating NOTES.md at a phase boundary, load and follow skills/patterns/repo-memory-hygiene.md (dedup checklist + prune routine).
To identify plans ready for archival: cd evals && npm run archive:dry. To execute: npm run archive:apply.
Agent engineering policies are in docs/agent-engineering/:
PART-SPEC.md— P.A.R.T. specification (mandatory section order: Prompt → Archive → Resources → Tools).RELIABILITY-GATES.md— Verification gate requirements (build/tests/lint).CLARIFICATION-POLICY.md— When to invokevscode/askQuestionsvs. returnNEEDS_INPUT.TOOL-ROUTING.md— Routing rules for external tools (fetch, githubRepo, MCP).SCORING-SPEC.md— Quantitative scoring reference.MIGRATION-CORE-FIRST.md— Shared implementation backbone pattern and consolidation exit criteria.PROMPT-BEHAVIOR-CONTRACT.md— Behavioral invariants complementing P.A.R.T structural rules.
- Agent files live at repo root:
<Name>.agent.mdor<Name>-subagent.agent.md. - Artifacts: plans →
plans/, schemas →schemas/, skill patterns →skills/patterns/. - All agent outputs use structured text. Do NOT output raw JSON to chat — it wastes context tokens.
- Skill library is at
skills/index.md. Planner selects ≤3 skills per plan phase. skills/patterns/llm-behavior-guidelines.mdis a meta-skill for preventing systematic agent anti-patterns (scope drift, over-abstraction, silent assumptions, weak success criteria). CoreImplementer, UIImplementer, CodeReviewer, and Planner load it on non-trivial tasks.- Failure taxonomy applies to all agents; PlanAuditor and AssumptionVerifier exclude
transient. - P.A.R.T. section order in every agent file: Prompt → Archive → Resources → Tools (see
PART-SPEC.md). - Orchestrator and Planner must delegate only to project-internal agents documented in
plans/project-context.md; external/third-party agents are strictly prohibited. - Adding/editing agents or skills: follow the agent-contribution process in
CONTRIBUTING.md(create agent file, schema, eval scenarios, register inplans/project-context.md). - Tool and agent permission grants are in
governance/(agent-grants.json,tool-grants.json,runtime-policy.json,rename-allowlist.json). Update these when changing an agent's tool profile.
- Before completing an implementation phase, review the changed code for documentation that preserves non-obvious business rules, invariants, exceptions, constraints, and decision rationale. Comments should explain why the behavior exists or what business condition it protects, not narrate syntax or restate the code.
- For new or materially changed public or extensible symbols that need API documentation, use the language/ecosystem-native format and the project's existing level of detail (for example, XML documentation comments in C#, docstrings in Python, or JSDoc/TSDoc in JavaScript/TypeScript). Document contract details such as parameters, return values, side effects, and expected exceptions only where they are meaningful and consistent with nearby code.
- Match the natural language of the nearest existing code documentation. Use this precedence: the same symbol or type, then the current file/module, then the project's primary documentation language. If no reliable convention exists, use concise English. Do not mix languages within a local documentation block or translate unrelated existing comments unless the task explicitly requires it.
- Do not add comments by quota, boilerplate documentation for self-explanatory code, or documentation churn in untouched areas. Update stale nearby documentation only when the code change makes it inaccurate.
13 agents in the ControlFlow system:
- Orchestration: Orchestrator
- Planning: Planner
- Adversarial Review: PlanAuditor-subagent, AssumptionVerifier-subagent
- Executability Verification: ExecutabilityVerifier-subagent
- Implementation: CoreImplementer-subagent, UIImplementer-subagent, PlatformEngineer-subagent
- Review: CodeReviewer-subagent
- Research: Researcher-subagent, CodeMapper-subagent
- Documentation: TechnicalWriter-subagent
- Testing: BrowserTester-subagent
Complexity tiers: TRIVIAL / SMALL / MEDIUM / LARGE — see plans/project-context.md.
Agent entry points:
| Scenario | Agent |
|---|---|
| Vague goal or idea | @Planner — runs idea interview, produces phased plan |
| Detailed task with clear requirements | @Orchestrator — dispatches subagents, manages gates |
| Deep research question | @Researcher — evidence-based investigation |
| Quick codebase exploration | @CodeMapper — read-only discovery |
After
@Plannerproduces a plan artifact, reviewed execution (PLAN_REVIEW, approvals, todo lifecycle, execution gating) continues through@Orchestrator. Planner authors plans; Orchestrator governs their review and execution.