Is It Working?
The protocol is passive. You know it's running when you see narration like this.
There is no dashboard and no daemon. The session agent classifies each task and delegates in the background, narrating as it goes. If you see phrases like these, it's working.
example session narration
Routing this through orchestration-planner first...
Spawning architect to produce a plan...
Handing the architect's plan to engineer...
Spawning engineer to implement the cache layer...
Handing off to skeptic for adversarial review...
Spawning debugger on the failing test...
QA engineer verifying acceptance criteria in the browser...
If you see none of this, the task was classified as a small, reversible Direct action and handled in the main thread without a subagent. That is the protocol working correctly on a cheap task, not a sign that it is off.
Tuning Skeptic overhead: the default profile works for most projects. Add
agentic-engineering-profile: relaxed to a project's
AGENTS.md for faster iteration with less review, or
strict when correctness is paramount. See
Risk Profiles for the full breakdown.
Skill-based entry point auto-triggered for engineering tasks
Every setting you can tune - what it does, your options, and how to set it. Full list of every key: configuration-reference.md.
Just ask your session agent. You can set any of these by describing what you want in plain language - say something like “set the risk profile to relaxed” and the agent applies it for you via /ds-config or directly. No config file editing required.
Risk profile
Controls how aggressively work triggers independent Skeptic review - relaxed means less overhead, strict means broader coverage.
Options: relaxed / default / strict Default: default
Set: install - bash .claude/install.sh --profile=<v>; post-install - profile in ~/.claude/agentic-engineering.json, or agentic-engineering-profile: in AGENTS.md
Just ask “set the risk profile to relaxed”
Activation mode
Whether the methodology runs everywhere by default (opt-out) or stays dormant until a project opts in (opt-in).
Options: opt-out / opt-in Default: opt-out
Set: mode in ~/.claude/agentic-engineering.json, or agentic-engineering: marker in AGENTS.md
Just ask “set activation mode to opt-out”
Auto-merge on green CI
Whether the conductor squash-merges a PR automatically once CI passes and it is approved.
Options: true / false Default: false
Set: auto_merge_on_ci_green in .agentic/config.json
Just ask “turn on auto-merge when CI is green”
Commit telemetry
Whether per-developer session logs are committed to the PR branch as a separate commit.
Options: true / false Default: true
Set: commit_telemetry in .agentic/config.json
Just ask “turn off commit telemetry”
Capability preflight
Whether a spawn with missing required agent tools warns and proceeds (advisory) or is refused until the dep is available (blocking).
Options: advisory / blocking Default: blocking
Set: capability_preflight_mode in .agentic/config.json
Just ask “set capability preflight to advisory”
Abdication guard
Whether a Stop hook blocks conductor turns that end by asking permission for a non-destructive next step.
Options: true / false Default: false
Set: abdication_guard_enabled in .agentic/config.json; disable per-session: export AE_ABDICATION_GUARD_DISABLE=1
Just ask “enable the abdication guard”
Ticket-driven
Whether new work creates a tracker ticket before the first implementer spawns - off skips the gate, offer prompts with a proceed default, require hard-blocks until a ticket exists.
Options: off / offer / require Default: offer if a tracker is connected, else off
Set: ticket_driven in .agentic/config.json
Just ask “set ticket-driven to require”
Guard kill-switches
Per-session env vars that disable individual enforcement hooks or silence activation output.
Vars: AE_SINGULARITY_GUARD_DISABLE / AE_TIER_GUARD_DISABLE / AGENTIC_QUIET Default: unset
Set: in-session - export <VAR>=1 before launching
Identity handle
The developer handle used to attribute per-session telemetry logs.
Options: any string Default: none (absent file = no attribution; run agentic-identity auto to derive from GitHub login)
Set: agentic-identity auto / agentic-identity init <handle> / agentic-identity confirm
File settings (agentic-engineering.json, .agentic/config.json, AGENTS.md) take effect at the next session start. exported env vars apply to the current session. Full reference: configuration-reference.md.
The system uses a skill-based architecture. The global ~/.claude/[AGENTS|CLAUDE].md is minimal - just personal preferences and pointers to available domain skills. The real entry point is the /agentic-engineering skill, which auto-triggers when engineering tasks are detected and loads all rules and protocol references. This keeps always-loaded context small while giving the full methodology to sessions that need it.
~/.claude/[AGENTS|CLAUDE].md always loaded
- Minimal global file - personal preferences and a list of available domain skills.
- Does not contain the full methodology. Keeps always-loaded context small.
- Contains behavioral overrides: complete tasks fully before stopping, no PR footer emoji
- Exempt from the 40-line limit that applies to project root AGENTS.md files
~/.claude/skills/agentic-engineering/SKILL.md always loaded (on engineering tasks)
The /agentic-engineering skill is the actual entry point. It auto-triggers when engineering tasks are detected and loads the three rules files and reference docs via the skill directory. Canonical source in ~/DinoStack/.claude/skills/agentic-engineering/. Content detailed in the Protocol Layer below.
Skill directory layout: ~/DinoStack/.claude/skills/agentic-engineering/METHODOLOGY.md (top-level - delegation, risk classification, task decomposition), ~/DinoStack/.claude/skills/agentic-engineering/rules/ (code-standards.md, conventions.md, module-manifest.md) and ~/DinoStack/.claude/skills/agentic-engineering/references/ (skeptic-protocol.md, subagent-protocol.md, agent-team.md, design-goals.md, regression-test-obligation.md, qa-regression-obligation.md, doc-sync-obligation.md)
Multi-adapter: The ~/DinoStack repo ships adapters for Claude Code (.claude/), Cursor (.cursor/), Codex CLI (.codex/), Gemini CLI (.gemini/), Kimi Code CLI (.kimi/), OpenCode (.opencode/), Pi coding agent (.pi/), oh-my-pi (.omp/), Hermes (.hermes/), OpenClaw (.openclaw/), and VS Code Copilot (.copilot/) - the same methodology in each tool's native format.
Per-project override: Each project has its own root AGENTS.md (~40 lines) + subdirectory AGENTS.md files for deeper context. AGENTS.md files can override any global rule. The global layer provides the foundation; the project layer customizes it.
Activation modes: the installer writes
~/.claude/agentic-engineering.json with
{ "mode": "opt-out" | "opt-in", "profile": "relaxed" | "default" | "strict", "set_at": "<ISO8601>" }.
opt-out (default) runs the methodology everywhere except projects that declare
agentic-engineering: opt-out in their root
AGENTS.md.
opt-in keeps the methodology dormant until a project declares
agentic-engineering: opt-in. The per-project marker is a single case-insensitive line, matched as a whole line with optional leading
- . A short Activation preflight at the top of every skill and
/-command reads the config plus the project marker; if the combination says inactive, the skill no-ops silently and falls back to default tool behavior for that session. Missing config or missing
AGENTS.md both resolve to "mode=opt-out, marker=none" - the methodology proceeds, preserving behavior for users who installed before this feature existed. The
profile field controls Skeptic overhead - see
Risk Profiles below.
First-activation notice (Step 5): on first activation in a TTY session, the preflight prints a one-line notice naming the resolved
mode,
marker, and
profile, and points users at
/ds-status and
/ds-disable. The notice is gated on a race-safe per-project sentinel at
.agentic/.activated - exactly one of N concurrent subagents wins the create-only write and prints; losers stay silent. The TTY/QUIET gate (
AGENTIC_QUIET=1 or
not sys.stdout.isatty()) suppresses BOTH the notice and the sentinel write in CI, headless, and eval-harness contexts. Deleting the sentinel re-arms the notice only - it does not change activation state.
AGENTS.md - the cross-tool standard: AGENTS.md is the single source of project instructions. It is the cross-tool convention supported natively by OpenAI Codex CLI (
OpenAI AGENTS.md guide,
agents.md) and importable by Claude Code via its
@file import syntax (
Anthropic import-syntax docs).
Claude Code users: create a
CLAUDE.md at the repo root containing two import lines -
@AGENTS.md and
@MEMORY.md - and Claude Code will import both
AGENTS.md and
MEMORY.md transparently.
Codex CLI users: Codex reads
AGENTS.md natively with no extra setup.
Result: one content source drives all adapters. No duplication.
Protocol Documents
Deep dive into the five canonical spec files in ~/DinoStack/.claude/skills/agentic-engineering/references/
design-goals.md on demand
Why the System Exists - 4 goals and explicit non-goals, written for evaluators and auditors.
The Four Goals
- Goal 1 - Responsiveness. Conductor stays free to respond. All work backgrounds. Spawn threshold is intentionally low. Never implement inline.
- Goal 2 - Adversarial accuracy. LLMs are systematically overconfident about their own outputs. Fresh Skeptic counters anchoring bias. Brief passed verbatim. No self-review path for Elevated work.
- Goal 3 - Cross-session continuity. Three tiers: context.md (ephemeral), MEMORY.md (stable facts), AGENTS.md (architecture). Stop hook auto-writes. /ds-wrap enriches. No ceremony required from user.
- Goal 4 - Context window efficiency. Always-loaded files must be minimal. Trigger-pointer pattern: risk signals inline (chicken-and-egg), protocol details deferred until triggered.
Explicit Non-Goals
- No persistent memory of personal facts or preferences (project-affecting info only)
- Does not replace proper documentation (MEMORY.md is not a design doc)
- Does not automate irreversible operations at git/infrastructure boundary (human confirms)
- Does not guarantee correctness (defense in depth, not proof)
- Does not eliminate need for human judgment (escalation paths exist for ambiguity)
- Does not manage infrastructure or secrets
Evaluator questions for each goal:
G1: Does the main agent ever block or do substantial work inline?
G2: Is the Skeptic actually fresh each round? Is the brief verbatim?
G3: Is the Stop hook firing? Is MEMORY.md accurate? Is AGENTS.md lean?
G4: Would removing this line cause a wrong classification?
skeptic-protocol.md
on demand slides
The Adversarial Review Methodology - 14 sections. The core quality mechanism.
The Core Loop (Sections 1-5)
- Worker implements → fresh Skeptic critiques → findings routed back → repeat until clean sign-off
- Fresh Skeptic every round - never continued from prior round. Independence requires clean context (no anchoring to Worker's justifications)
- Global-context input set (Section 4.5) - every Skeptic spawn prompt includes: architect plan, Brief/Plan artifact,
qa_criteria block, per-consumer impact table, related files, diff under review. Step 0 validates completeness before any review content is produced; incomplete inputs return BLOCKED. Supplemental reviewers (security-auditor, perf-analyst) receive a lexically distinct Supplemental-context block with no Step-0 enforcement.
- Resolved Issues Preflight prevents re-raising fixed items, but Skeptic can contest insufficient resolutions
- Same finding contested 2+ re-routes → escalate to human (prevents infinite loops)
- Simple/targeted changes: capped at 1 Skeptic round. Standard Elevated: 2-re-route limit
Findings Classification (Section 6)
- Critical - blocks sign-off. Security vulns, correctness failures, data loss paths
- Major - blocks sign-off unless Worker provides compelling documented reason to defer. Missing error handling, edge cases, design issues
- Minor - never blocks sign-off. Applied by a separate Worker after sign-off, no follow-up Skeptic needed
- Unclassified findings default to Major
Persistence Loop (inside /ds-implement-ticket)
- Loop-aware, not one-shot -
/ds-implement-ticket runs Engineer → Skeptic → QA as a bounded loop, not a single pass. Re-routes are a named primitive, not ad-hoc conductor judgment.
- Max 3 fix passes per phase - Skeptic loop (Phase 6) and QA loop (Phase 6b) each have an independent 3-pass cap. Hitting the cap escalates to the human; the conductor does not spawn a fourth pass.
- Findings accumulate - the
findings_log carries forward across iterations. A finding closed in iteration 1 cannot be silently re-raised as new in iteration 2; the Skeptic must explicitly contest the claimed fix using a [PREV: id] tag.
- Convergence failure - one re-raise of a Critical finding after a claimed fix triggers immediate escalation (does not consume remaining iteration budget). Signals a design-level conflict requiring human arbitration.
- Explicit escalation contract - the loop exits with a structured stall report (
cap_reached, convergence_failure, or blocked) listing open findings and recommended actions.
- Durable state - loop state is written per ticket to
.agentic/loop-state-<LOOP_KEY>.json at every phase transition (atomic write), superseding the single legacy .agentic/loop-state.json, which is still read and adopted when present. Keying per ticket means two sessions working two different tickets in one checkout each keep their own bookkeeping instead of contending for one file. Long-running loops survive rate limits and session exits: on the next /ds-implement-ticket invocation the conductor detects the interrupted state for that ticket's own key, applies a rate-limit wait if needed, and resumes from the last committed phase boundary. Schema includes brief_path, plan_path, and promotion_tier fields that record the planning artifact tier for the active task (used for mid-flight promotion and auto-promotion at the 3rd resume). No work is lost.
- Learning extraction - at Phase 6 clean exit (Skeptic sign-off), the
learning-extractor agent reads the resolved findings_log and writes structured fix-pattern entries to .agentic/learnings.md (append-only, dedup, cap 5/run). Each entry has ID LRN-YYYYMMDD-XXX, severity, domain tag, pattern description, fix guidance, and source reference. These entries feed into wrap-ticket at Phase 11b for richer MEMORY.md/decisions.md appends. Soft-fail only; never blocks the loop. During active sessions, the learnings-agent captures learning events in real-time (error→fix cycles, resolved Skeptic findings, discovered workarounds) and writes them immediately to .agentic/learnings.md, reducing reliance on manual /ds-wrap.
- Task coordination surface - multi-unit orchestration plans use
.agentic/tasks.jsonl as a durable task coordination surface; the conductor tracks task status, dependencies, and loop state across the plan lifecycle. Applies to plans with 2+ tasks; single-unit spawns use in-context state only.
- Context-size preflight - at the top of
/ds-implement-ticket, before any Phase 1 work, a two-level guard checks session load: if the turn count is at or above the soft limit (15–20 conductor turns) with substantive tool-call results in context, or a prior subagent result block of substantive size is visible from this session, it prints a warning with the recommended /ds-wrap → new session → re-invoke pattern and waits for operator confirmation; above the hard limit, it refuses further implementation and subagent spawns unconditionally. Silent on clean sessions.
- Phase 12b: Operator Runbook - after all tickets in a session complete, the conductor prints a structured handoff: what PRs landed (✓ PR #N → url), the next copy-pasteable
/ds-implement-ticket command (extracted from the most recent triage artifact's Kickoff prompts), and any blockers or deferred items. Soft-fail throughout; skipped when no PR was opened, when Phase 12a already printed a pause summary, or when Phase 12a’s goal-met short-circuit already printed a terminal summary.
Parallel Fan-out slides
- N engineers in one message - when
orchestration-planner returns 2+ independent units, /ds-implement-ticket Phase 5 fans out: one worktree-isolated engineer per unit, all spawned in a single message (parallel). N=1 falls through to the standard path.
- Per-unit P0 loops - each unit runs its own Engineer → Skeptic persistence loop inside its worktree. "Done" means Skeptic signed off, not first commit. The conductor joins only after every unit reaches a terminal state.
- Skeptic strategy driven by planner -
skeptic_strategy: per-unit: independent units each get their own Skeptic (can run in parallel). skeptic_strategy: integration: interdependent units share one Skeptic reviewing the combined diff - replaces Phase 6, not layers on top. skeptic_strategy: multi-dimensional: for high-stakes Elevated units (auth, payments, migrations, crypto) - fans out correctness-Skeptic, security-auditor, and perf-analyst in a single message on the same diff; all three must clear before sign-off.
- Join conditions - all-done (merge in
merge_order), partial success (merge green units, retry failed once at depth=1), total failure (escalate), blocked (escalate immediately).
- Sequential
--no-ff merge - unit branches merged in planner-specified merge_order. Conflict at any step: abort, stop remaining merges, spawn single engineer for sequential re-implementation. Post-merge integration quality check catches cross-unit failures.
- Task state in
.agentic/tasks.jsonl - conductor writes all entries (pending → in_progress → done/failed/blocked). Workers return summaries only. Crash recovery: in_progress entries on resume treated as failed, re-spawned with original brief from inputs field.
Cost-Aware Tier Routing
- Conductors declare Tier 1/2/3 at spawn time - routes lightweight tasks to faster models and critical reviews to max-capability models
- Tier 1 - cheap/fast (Haiku). Declare explicitly for shallow reads, existence checks, format-only tasks, and mechanical transformations
- Tier 2 - implementation default (Sonnet). Most spawns land here: engineer, investigator, qa-engineer, and other implementation roles
- Tier 3 - review default (Opus). Skeptic and security-auditor default to Tier 3 via frontmatter; upgrade architect/engineer to Tier 3 for novel architecture or high-blast-radius units; on Plan+ADR-tier units (cross-track / architecture-constraining), the authoring architect/adr-generator/product-discovery must also be Tier 3, conductor-declared via explicit
model: opus and backstopped by enforce-tier.py
- Tier is a required field - every Elevated spawn carries a
Tier: line below Risk:. Each agent's frontmatter model: sets the model when the spawn-call param is omitted; the param overrides for upgrades or budget-mode downgrades (never for mandated-Tier-3 Skeptics). Declaration without the tool-call param produces frontmatter-default behavior, not Tier 2
- Codex/Gemini resolve tiers from
~/.agentic/tier-map.yml - Claude Code uses a built-in enum (haiku/sonnet/opus); no tier-map lookup needed for Claude
- Pi/oh-my-pi can resolve roles from
~/.agentic/role-models.yml - opt-in per-role model strings plus antagonist reviewer diversity for skeptic and security-auditor; if absent, Pi uses session defaults
Domain Adversarial Briefs (Section 8)
- Smart contracts: reentrancy, access control, signature replay, fee bypass
- Auth/sessions: session fixation, token replay, privilege escalation
- API endpoints: malformed inputs, race conditions, missing validation
- Crypto: weak randomness, domain separation, algorithm confusion
- DB/migrations: idempotency, partial failure, rollback paths
- Data pipelines: double-processing, silent failures, state divergence
- Doc synthesis: internal consistency, assumptions, completeness gaps
- General code: logic errors, edge cases, incorrect assumptions
Elevated + Cleanup Path (Section 12)
- Worker → Skeptic sign-off →
/simplify → narrow-scope Skeptic
- For substantial implementations where code hygiene matters
- Second Skeptic reviews only the /simplify diff (behavioral preservation check)
New Skeptic Obligations
- Module manifest check - tiered enforcement on non-trivial modules (exports a public symbol, ~50+ LOC, or side-effecting): missing manifests are Minor (comprehension hygiene, non-blocking); stale manifests (no longer reflect purpose, public API, dependencies, or failure modes) are Major (blocks sign-off absent a compelling documented reason to defer); stale manifests whose inaccuracy could mislead a caller on a correctness or security path are Critical. The result is now output-required via a fixed
Manifest check: sign-off line.
- New-test-CI-wiring check - for each new test file in the diff, verifies a matching reference exists in a CI workflow (an exact file reference, a covering glob, or an auto-discovering runner). A new test file wired into no CI workflow is a Major finding - a test that never runs provides no regression protection. The result is output-required via a fixed
Test-CI-wiring check: sign-off line.
- Regression test verification - before granting sign-off when a Critical/Major finding was fixed, verifies a regression test was added (or a documented exception given). Missing test without explanation is a Major finding. The same verification applies to QA-fix iterations: a fix engineer addressing a qa-engineer FAIL must add a regression test or append a documented exception to
.agentic/qa-regressions.md (see qa-regression-obligation.md).
Cognitive Surrender Check
- A Skeptic that agrees with the Worker on every point with zero findings across two iterations is a possible rubber-stamp - the failure mode of treating the LLM as System 3 and outsourcing judgment rather than offloading mechanics.
- Cure: an audit-note Minor finding attesting that the Skeptic re-read the diff end-to-end with independent attention. The note documents what was checked, not what was wrong.
- Audit-note Minors are exempt from the
/ds-implement-ticket Phase 6 re-raise and convergence-failure detection - they are bookkeeping, not contested findings, and must not stall the loop.
Calibration Layer (Section 13)
- The audit-note Minor is the per-spawn rubber-stamp defense. The calibration layer is the long-horizon backstop - aggregate drift detection without enlarging the per-spawn review surface.
- Findings counters in
events.jsonl - every Skeptic spawn_complete carries findings_count, diff_lines, signed_off, and iteration inside data. Conductor builds the merged JSON inline; subagents never write to .agentic/.
- 5% sampled meta-Skeptic - deterministic
hash(task_id+iteration) % 100 < 5. Background fire-and-forget; conductor declares the unit complete without waiting. Meta-Skeptic returns text only; conductor parses and emits meta_review_complete.
- Surfacing - Critical/Major divergence on a sampled spawn surfaces as one inline
META-DIVERGENCE: line at the next turn boundary. Original sign-off remains binding; the notice is advisory. Dual triggers: in-session (Phase 6 boundaries) and session-start sweep (catches async returns from prior sessions). The sweep paginates via .meta-divergence-last-sweep timestamp tracker — reads only events newer than the last sweep, capped to 100 lines on first run.
bin/agentic-calibrate - density (findings per 100 diff-lines, excludes zero-diff rows) and divergence (meta-Skeptic rubber-stamp rate). Warming-up line shown until 10 qualifying spawns observed.
- Threat model: drift detection in a non-adversarial conductor relationship. Not cheating-prevention - a compromised conductor can mis-emit counts. Target is operator self-deception over time, not adversarial spoofing.
Planning Artifacts slides
Planning artifacts
Brief or Plan, decided mechanically
How much planning a task needs is a mechanical gate, not a guess
The promotion gate sits between orchestration-planner output and the first engineer spawn, validating the plan before any code is written. The trigger is purely mechanical, counting Elevated units: 0-1 needs no artifact and the conductor spawns engineers directly; 2-5 requires a one-screen Brief covering problem, success criteria, and constraints; 6+ units, or cross-track or multi-session work, requires a full Plan-tier directory with an architect plan and risk register, and architecture-constraining work adds an ADR.
- Promotion gate (mechanical) - sits between orchestration-planner output and the first engineer spawn. Trigger table: 0-1 Elevated units = no artifact; 2-5 Elevated units = Brief required; 6+ Elevated units OR cross-track OR multi-session = Plan required. Trivial units do not count toward thresholds. "Cross-track" = distinct depth-1 directories each with their own
AGENTS.md; cross-track or architecture-decision-constraining work additionally requires an ADR alongside the Plan.
- Brief template - one-screen (~15-20 lines) at
docs/planning/<slug>.md. Fields: Problem, Success criteria (max 4 bullets), Non-goals (max 3 bullets), Constraints (hard only), Verification (single non-skippable line - "cannot specify" blocks sign-off), Linked artifacts.
- Plan-tier directory -
docs/planning/<slug>/ containing brief.md, architect-plan.md, orchestration.jsonl, risk-register.md (<=10 lines), rollback.md (<=10 lines), verification-gate.md. Assembled from existing artifacts plus three short conductor-authored coverage docs.
- Verification gate non-skippable -
verification-gate.md owns the trigger (signal that verification failed); rollback.md owns the procedure. Any "cannot specify" entry blocks Skeptic sign-off until the planning gap is resolved.
- Mid-flight retroactive Brief - in-flight engineer is allowed to return; already-completed units are not retroactively re-reviewed; retroactive Brief is authored before the next engineer spawn and governs all subsequent units.
- 3rd-resume auto-promotion - a Brief-tier task on its 3rd resume per that ticket's own
.agentic/loop-state-<LOOP_KEY>.json resume_count (legacy: .agentic/loop-state.json) auto-promotes to Plan tier (mechanical, regardless of operator notice).
- Engineer contract additions -
brief_path and plan_path fields added to the Worker execution contract; engineer reads the Brief or Plan and treats success criteria + verification gate as authoritative alongside the architect plan.
- Interactive /ds-brief path - Brief can also be authored interactively via
/ds-brief before architect and engineer are spawned. When brief_path is pre-populated from a /ds-brief session (brief_source: operator), the conductor skips Brief authoring at the promotion gate and uses a completeness-only Skeptic variant instead of the full framing review.
Core thesis: "The value of an adversarial reviewer is independence. A reviewer who has already heard the implementer's justifications is no longer independent."
The brief must be passed verbatim - never softened. Sign-off requires 6 elements: Reviewed, Findings, Active search attestation, Manifest check, Test-CI-wiring check, and explicit sign-off statement.
Regression Test Obligation: Every Critical or Major finding that gets fixed without a regression test is a latent regression. The Worker adds a test that would have caught the failure; the Skeptic verifies it exists before sign-off. The test lives in the project's normal test suite, alongside existing tests for the affected module, so the same bug cannot silently reappear in a future change.
QA Regression Test Obligation: The symmetric rule for qa-engineer FAILs. When a fix engineer addresses a QA failure, it adds a unit/integration/e2e test that would have caught the failing scenario; the parallel Skeptic on the QA-fix iteration verifies it exists before sign-off. When a regression test is genuinely infeasible (visual conformance failure with no headless-testable observable, etc.), the engineer appends a curated entry to .agentic/qa-regressions.md so architects re-check the surface on future tickets via qa_criteria.scenarios[]. Canonical statement in qa-regression-obligation.md.
subagent-protocol.md on demand
The Orchestration Methodology - 11 sections. The outer frame governing delegation.
The Seven Rules
- Rule 1 - Always background. Most critical rule. Foreground blocks the conductor entirely. All delegated work runs in background.
- Rule 2 - Parallel by default. Independent tasks spawn simultaneously. "Can I start B before A finishes?"
- Rule 3 - Spawn threshold. Elevated risk → spawn. Low risk → direct action. When in doubt, Elevated.
- Rule 4 - Agent type discipline: spawn an agent type that exists. No subagent can spawn subagents (a platform property of every subagent). Low-risk shell/git is conductor-direct - there is no shell-only agent type.
- Rule 5 - Skeptic Protocol orchestrated by main agent. Architect plans must receive Skeptic review before acting on them.
- Rule 6 - Check in, don't disappear. Status updates immediately after spawning. Proactive reporting when tasks complete.
- Rule 7 - Direct actions permitted. Reads, git status, screenshots, memory answers, synthesizing returned results.
Composition Pattern (Section 6)
- Decompose into atomic units (one agent, one task, one prompt)
- Classify risk per unit independently
- Spawn in parallel for independent units
- Review scope: independent units get per-unit Skeptics; interdependent units get one integration Skeptic (sees combined diff)
- Mid-task re-decomposition if Worker discovers scope is too broad
Worktree Isolation (Section 7)
- Parallel agents writing to same repo MUST use
isolation: "worktree"
- Without it: concurrent
git checkout silently corrupts both agents' work
- Not needed for: single agents, separate repos, read-only agents
Anti-Patterns (Section 8)
- Foreground blocking (most critical violation)
- Sequential when parallel is possible
- Treating risky shell/git as conductor-direct to dodge review
- Main agent doing implementation work
- "Looks simple" rationalization
- Softening adversarial briefs
Core principle: "The main agent is a conductor, never an implementer. The conductor is the main session agent: it decomposes work, spawns subagents that do the implementation and investigation, stays available to the user, and synthesizes results when those subagents report back."
The Subagent Protocol is the outer frame (should I delegate?). The Skeptic Protocol is the inner loop (is the output correct?).
agent-team.md on demand
The Team Playbook - 18 named agents, 5 composed flows, decision rules, and spawn instructions.
The Team
18 named agents (investigator, debugger, security-auditor, architect, orchestration-planner, engineer, skeptic, qa-engineer, adr-generator, adr-drift-detector, perf-analyst, product-discovery, release-orchestrator, dependency-auditor, learning-extractor, goal-condition-evaluator, wrap-ticket, learnings-agent). Most agents are read-only. Engineer, release-orchestrator, learnings-agent, and wrap-ticket write files. Full descriptions in the Agent Layer section below.
Decision Rules
- orchestration-planner when task is complex, agents/sequencing unclear, multiple phases
- architect when meaningful design decisions, unfamiliar codebase, multi-subsystem feature
- security-auditor when touching auth, sessions, tokens, secrets, privilege boundaries
- debugger when root cause not obvious, stack trace needs diagnosis
- Skip architect for well-understood changes → straight to engineer
- Skip debugger for already-understood bugs → straight to engineer
Spawn Requirements
- engineer: architect's plan + file paths + acceptance criteria + session context
- skeptic (plan review): adversarial brief verbatim + architect's complete plan + architectural constraints
- skeptic (code review): adversarial brief + engineer output + resolved issues preflight
- security-auditor: files changed + domain description + known mitigations
- All agents spawn in background. Main session is the sole orchestrator.
Mandatory gate: Architect plan output MUST receive Skeptic review before the plan is acted on. Do not spawn engineers or run the orchestration-planner until the Skeptic grants sign-off. A flawed plan propagates errors through every downstream Worker.
Per-project state that survives across sessions
The self-improving loop
knowledge compounds
The system gets harder to fool over time
Two phases keep knowledge alive. Real-time capture: a learnings-agent records error-fix cycles and resolved findings, and a learning-extractor distills fix patterns into a central learnings file, while the wrap-ticket agent enriches the project's intent layer from session summaries and diffs. Knowledge promotion: durable facts and conventions are persisted into the core memory triad - MEMORY.md (facts), AGENTS.md (conventions), and context.md (state) - so future sessions avoid repeating past mistakes instead of restarting cold.
Persistence Hierarchy
<cwd>/MEMORY.md always loaded - canonical durable facts about the project, committed to the repo and loaded at session start via the @MEMORY.md import in the project root CLAUDE.md. Stable architecture, key paths, and preferences with rationale.
.agentic/context.md on demand - primary session-continuity store, read at session start. Written by the Stop hook (basic) or /ds-wrap (enriched). Supports rolling-window merge across 10 sessions. Legacy fallback: ~/.claude/projects/[hash]/context.md, used only when .agentic/context.md is absent.
- memory/*.md on demand - individual memory files with frontmatter (name, description, type). Read on-demand when relevant to the current task.
- Tasks - in-session progress tracking. Not persisted across sessions.
- Plans - in-session alignment with user. Not persisted.
Memory Types
- user - role, goals, preferences, knowledge level. Helps tailor collaboration (senior engineer vs first-time coder).
- feedback - corrections and confirmations. "Don't mock the database" or "yes, the bundled PR was right." Includes Why and How to apply.
- project - ongoing work, goals, deadlines, decisions. "Merge freeze begins 2026-03-05." Includes Why and How to apply.
- reference - pointers to external systems. "Pipeline bugs tracked in Linear project INGEST." Where to look, not what's there.
What NOT to save in memory
- Code patterns, architecture, file paths (derive from reading the code)
- Git history, recent changes (use
git log / git blame)
- Debugging solutions (the fix is in the code; the commit message has context)
- Anything already in AGENTS.md files
- Ephemeral task details or current conversation context
The Intent Layer. Orthogonal to the per-session / cross-session / project tiers above is the question of which artifacts capture what the project means to be. AGENTS.md, MEMORY.md, decisions.md, .agentic/qa.md, module manifest headers, and the optional glossary.md together form the project's intent layer - the source of truth for architecture, conventions, domain terms, and review obligations. Drift between code and intent is intent debt: a separate failure mode from technical debt (in the code) and cognitive debt (in the people), and the one most likely to silently degrade an agent-driven workflow. The Skeptic applies tiered enforcement to manifests (missing = Minor, stale = Major, stale-on-correctness/security path = Critical) and flags synonym-of-existing-term drift as Minor, so the layer self-heals as work passes through review without blocking sign-off on cosmetic gaps.
glossary.md - Ubiquitous Language (optional). A flat file at the project root listing the domain terms the project actually uses. Agents prefer existing terms over inventing synonyms; the Skeptic flags synonym-of-existing-term as a Minor finding. Borrowed from DDD's Ubiquitous Language idea - one shared vocabulary across code, docs, and conversation keeps the intent layer coherent across sessions.
⚠
Project Directory Is The Project Identity
How cross-session continuity actually works
Claude Code derives a project's persistence directory from the current working directory it was launched in. Every project's AGENTS.md, MEMORY.md, session history, and /ds-wrap outputs live under ~/.claude/projects/[slug-of-cwd]/. The only thing you need to do to return to the same persistent state is start claude from the same directory.
The command:
terminal
$ cd ~/projects/myproject
$ claude
Optional: a shell alias to jump into the project and launch:
~/.zshrc
alias claude-myproject='cd ~/projects/myproject && claude -n myproject'
- →context.md stacks - the Stop hook writes to the same
~/.claude/projects/[cwd-slug]/context.md every time. /ds-wrap's rolling-window merge works because the project slug is stable as long as you launch from the same directory.
- →MEMORY.md compounds - same cwd means the same project directory means the same memory files. Stable facts accumulate in one place rather than starting fresh each time.
- →The harness improves itself - this is the
/ds-init-project -> work -> /ds-wrap feedback loop. Each session reads richer AGENTS.md files and memory than the last because every session starts from the same directory and therefore loads the same files.
- →Multi-project coordination - different projects live under different cwds, so each gets cleanly separated persistence automatically. Running
/ds-wrap on one project does not touch the other's state.
Naming and resuming are ergonomic, not load-bearing.
Claude Code's -n, --name flag attaches a display label to the session - useful in the /resume picker and in your terminal title, but it has no effect on which persistence directory is read or written. Two runs of claude -n myproject in the same directory create two independent sessions that share the same project persistence. The label is a finder, not an identifier.
-r, --resume is similarly narrow: it replays a specific prior session's conversation history. That is valuable when you got interrupted mid-task and the agent had working state that wasn't yet captured to memory, but it is not how cross-session continuity works under the protocol. The protocol prefers fresh sessions: one focused goal per session, /ds-wrap at the end to commit learnings to memory, and the next session starts clean and reads those learnings via the normal cwd-based load. The Skeptic agent is the canonical example - it is explicitly never resumed, because a fresh context is sharper than a replayed one.
The thing that silently breaks continuity is not forgetting to name or resume a session - it is launching claude from the wrong directory. That points at a different project slug, which reads and writes a different, empty persistence directory. The fix is muscle memory: always cd into the project before starting Claude Code. An alias that bundles the cd and the launch is the cleanest way to make that automatic.
Tune Skeptic overhead to match your workflow
Profiles let you dial how aggressively the system triggers Skeptic review. Set once globally and override per project. Three levels: relaxed for rapid iteration with less overhead, default for balanced day-to-day work, and strict for when correctness is paramount.
relaxed
For rapid iteration on well-understood UI or local bug fixes.
- Single-file locally-scoped behavioral edits: Low (no Skeptic)
- Multi-file pure-UI-only changes: Low (no Skeptic)
- Everything else unchanged from default
default
The starting point for all projects. Right for most day-to-day work.
- Single-file locally-scoped behavioral edits: Low (no Skeptic)
- All other legacy Elevated signals remain Elevated
- Multi-file UI-only changes: Elevated (Skeptic runs)
strict
For when correctness is paramount - payments, auth, shared infrastructure.
- UI-only copy changes: Elevated (Skeptic runs)
- File renaming: Elevated (Skeptic runs)
- Targeted wording fixes to already-reviewed content: Elevated (Skeptic runs)
- Diagnostic-only logging changes: Low with self-check (not unconditionally direct)
- Documentation-only file creation (new .md files that are pure lists/notes): Low with self-check (not unconditionally direct)
Token spend: The Elevated classification is the dominant cost driver. Each Elevated task fans out to a Worker + Skeptic - and often an architect, orchestration-planner, and QA engineer - each re-reading full context. Moving from strict or default toward relaxed reclassifies more small work as Low (conductor direct action, no spawns), removing that pipeline overhead entirely. Accept the tradeoff: relaxed trades independent review for speed; keep default or strict wherever a mistake is hard to reverse.
how to set your profile
# At install time
bash .claude/install.sh --profile=relaxed
# Edit ~/.claude/agentic-engineering.json directly
{ "mode": "opt-out", "profile": "strict" }
# Per-project override in root AGENTS.md
agentic-engineering-profile: strict
For a complete list of every setting and its default, see configuration-reference.md.
Other Adapters
Translating the methodology to Codex, Cursor, Gemini, Kimi, and OpenCode
The methodology is portable. The doc above uses Claude Code paths and slash commands. Other harnesses share the same delegation model, classification rules, and review protocol - but read from different paths and have different command and hook mechanics. Use this appendix to translate.
Codex CLI
Native AGENTS.md support - TOML agent format - hook system requires opt-in flag
Recommended trusted-work permissions are documented in codex-permissions.md.
| Surface | Codex equivalent |
| Project instructions | AGENTS.md at project root - read natively, no shim needed |
| Global instructions | ~/.codex/AGENTS.md |
| Skill location | ~/.agents/skills/agentic-engineering/SKILL.md |
| Slash commands | Not first-class. Command files live in .codex/commands/*.md but must be pasted or referenced manually - no auto-invocation via /ds-wrap etc. |
| Agents | ~/.codex/agents/*.toml - TOML format (different from Claude Code's prompt-based spawn) |
| Hooks | ~/.codex/hooks.json - requires codex_hooks = true in user config to enable the installer-managed hooks |
| Stop hook / context save | stop-context-codex.js writes to ~/.codex/projects/[hash]/context.md |
| Activation config | Shared: ~/.claude/agentic-engineering.json |
| Tier resolution | ~/.agentic/tier-map.yml - no built-in Haiku/Sonnet/Opus enum; models resolved from the map |
What's different: Slash commands (/ds-wrap, /ds-init-project, etc.) do not auto-trigger. Reference the command files manually or paste their contents. The hook system is off by default - set codex_hooks = true in user config before expecting installer-managed Stop-hook context saves.
Cursor
Rule-file based setup - slash commands work - no native agent system
| Surface | Cursor equivalent |
| Project instructions | AGENTS.md (manual) or .cursor/rules/*.mdc files |
| Global instructions | ~/.cursor/rules/*.mdc with alwaysApply: true in frontmatter - no single global file |
| Skill location | No skill system. Rules are .mdc files in ~/.cursor/rules/ |
| Slash commands | ~/.cursor/commands/*.md - slash commands work natively in Cursor |
| Agents | Not available - Cursor has no native sub-agent system |
| Hooks | .cursor/hooks.json - beforeSubmitPrompt event for the risk-reminder equivalent |
| Stop hook / context save | Stop hook writes to the Claude Code path (~/.claude/projects/...) - not surfaced in Cursor sessions. Rely on manual context.md maintenance. |
| Activation config | Shared: ~/.claude/agentic-engineering.json |
| Tier resolution | Inherits the session model - no tier-map lookup |
What's different: No sub-agent spawn primitive. The conductor pattern works as a prompt strategy, but Cursor cannot fan out parallel Workers natively. Session context saves require manual maintenance - the Stop hook does not fire in a Cursor session.
Gemini CLI
GEMINI.md project file - TOML slash commands - agent files via @name mention
| Surface | Gemini equivalent |
| Project instructions | GEMINI.md at project root |
| Global instructions | ~/.gemini/GEMINI.md |
| Skill location | No skill system. Rules are inlined into ~/.gemini/GEMINI.md |
| Slash commands | ~/.gemini/commands/*.toml - first-class TOML slash commands; reload with /commands reload |
| Agents | ~/.gemini/agents/*.md with YAML frontmatter (kind: local) - invoked via @agent-name |
| Hooks | ~/.gemini/settings.json hooks key - BeforeAgent and SessionEnd events |
| Stop hook / context save | stop-context-gemini.js writes to ~/.gemini/projects/[hash]/context.md - fires on /exit only |
| Activation config | Shared: ~/.claude/agentic-engineering.json |
| Tier resolution | ~/.agentic/tier-map.yml - same as Codex, no built-in tier enum |
What's different: Context save only fires on /exit - force-closing the terminal loses the session context write. Commands use TOML format instead of Markdown. Agent mentions via @agent-name are the invocation primitive (no Agent tool call).
Kimi Code CLI
Project instructions in .kimi/ directory - skill invocation via natural language - hooks fully manual
| Surface | Kimi equivalent |
| Project instructions | .kimi/AGENTS.md inside the project's .kimi/ directory (loaded by Kimi via $KIMI_AGENTS_MD) |
| Global instructions | No global AGENTS.md equivalent. Global footprint is the skill at ~/.kimi/skills/agentic-engineering/SKILL.md (installed via install.sh) |
| Skill location | ~/.kimi/skills/agentic-engineering/SKILL.md - invoke via /skill:agentic-engineering or natural language |
| Slash commands | No custom slash commands. Use /skill:agentic-engineering <name> or natural language ("run wrap") |
| Agents | Built-in types only: coder, explore, plan. Agent files serve as reference prompts mapped to those types. |
| Hooks | ~/.kimi/config.toml [[hooks]] blocks - fully manual; the installer does not write this |
| Stop hook / context save | Manual - script path must be set by the user in the hooks config |
| Activation config | Shared: ~/.claude/agentic-engineering.json |
| Tier resolution | Inherits the built-in sub-agent type; optional ~/.agentic/role-models.yml can map roles and antagonist reviewers to concrete model strings |
What's different: No custom slash commands. No installer-written hooks - you must add [[hooks]] blocks manually to ~/.kimi/config.toml and configure the Stop hook script path yourself. Session context saves will not work until this is set up.
OpenCode
Native AGENTS.md support - per-adapter activation config - no hook system at all
| Surface | OpenCode equivalent |
| Project instructions | AGENTS.md at project root - read natively |
| Global instructions | ~/.config/opencode/AGENTS.md and/or instructions field in opencode.json |
| Skill location | .opencode/skills/agentic-engineering/SKILL.md (project-local) or ~/.config/opencode/skills/ (global) |
| Slash commands | ~/.config/opencode/commands/*.md - slash commands work natively |
| Agents | ~/.config/opencode/agents/*.md with mode: subagent and permission: frontmatter |
| Hooks | Not available - OpenCode has no hook system |
| Stop hook / context save | Not available - no session context save. Context must be managed manually. |
| Activation config | Per-adapter path: ~/.config/opencode/agentic-engineering.json (the only adapter with a dedicated config path) |
| Permissions | permission: per-agent in agent frontmatter; instructions: in opencode.json for global rules |
What's different: No hook system. The risk-reminder that fires on UserPromptSubmit in Claude Code is instead embedded in the skill content - there is no event-driven trigger. Session context is never auto-saved; manual context.md maintenance is required. Activation config lives at a per-adapter path rather than the shared ~/.claude/ location.