/forgewright:production-gradefrom forgewright
Orchestrates multi-role engineering workflows including builds, features, debugging, code reviews, testing, security hardening, deploys, design, and game builds. Routes work to specialized skills based on project context.
Ships in forgewright. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
PIPELINE_CONTEXT preflight/audit (skills/_shared/protocols/pipeline-operating-contract.md), progressive specialist loading (.forgewright/skills-config.json), phase dispatch, conflict resolution, and completion verification (VERIFY.md Schema v2).QUICK tasks (kernel/SOLVE.md 2.5).HARD Gate: Any task touching payment, billing, IAP/in-app purchase, receipt validation, entitlements, subscription, or checkout is mandatory HARD and DEEP regardless of file count (kernel/SOLVE.md, kernel/VERIFY.md) — requiring contract/runtime/E2E negative paths, controlled mutation backcheck, and independent keyless review-2.git status, .forgewright/, and .production-grade.yaml directly when present before selecting modes or creating workspace state.Adaptive meta-skill orchestrator for software/product delivery. It analyzes the user's request and current project evidence, selects only the capabilities needed, builds a minimal task graph, and executes — from a single local review to a multi-role greenfield build.
One manifest-driven orchestrator. Resolve the current skill inventory from project truth (product-manifest.json / kernel/INDEX.md) and load only what the request needs. No forced full-pipeline execution for everyday tasks.
All skills are bundled in this plugin. Single install, everything included.
If you are running in an environment with the Forgewright MCP Server connected, YOU MUST explicitly manage the pipeline state using the exposed fw_* tools. This ensures any connected IDE or Dashboard accurately tracks your progress.
fw_start_pipeline when starting a new goal/session.QUICK work does not need artificial phase transitions.fw_request_gate_approval only for an actual human-approval contract, not merely because a phase exists.
If state telemetry is unavailable, report the observability degradation when material; do not convert it into a false product failure.Keep the canonical orchestrator provider-neutral. Use skills/_shared/protocols/model-tier.md and runtime-advertised capabilities/IDs for provider-specific parameters. Never assume a model family, temperature, thinking parameter, or provider feature from stale prose.
Every skill invocation is wrapped by an ordered middleware chain. Implementation details are in skills/production-grade/middleware/:
Pre-Skill: ① SessionData → ② ContextLoader → ②b OperatingPreflight → ③b DryRunContext → ③ SkillRegistry → ④ Guardrail → ⑤ Summarization
═══ SPECIALIST SKILL EXECUTION ═══
Post-Skill: ⑥ QualityGate → ⑥b OperatingAudit → ⑦ BrownfieldSafety → ⑧ TaskTracking → ⑨ Memory → ⑩ GracefulFailure → ⑪ RecoveryResearch → ⑫ CircuitBreaker → ⑬ Bulkhead → ⑭ Verification
| # | Middleware | File | Hook | Purpose |
|---|---|---|---|---|
| ① | SessionData | middleware/01-session-data.md | before_skill | Matching context when needed |
| ② | ContextLoader | middleware/02-context-loader.md | before_skill | Optional bounded lookup |
| ②b | OperatingPreflight | skills/_shared/protocols/pipeline-operating-contract.md | before_skill | Build/refresh PIPELINE_CONTEXT: outcome, safe scope, risk ownership, research plus evidence-bound visual basis |
| ③b | DryRunContext | skills/_shared/protocols/dryrun-interceptor.md | before_skill | Dry-run mode system prompt injection |
| ③ | SkillRegistry | middleware/03-skill-registry.md | before_skill | Progressive skill loading |
| ④ | Guardrail | middleware/04-guardrail.md | before_tool | Pre-tool authorization |
| ⑤ | Summarization | middleware/05-summarization.md | before_skill | Context compression |
| ⑥ | QualityGate | middleware/06-quality-gate.md | after_skill | Specialist/domain + acceptance validation |
| ⑥b | OperatingAudit | skills/_shared/protocols/pipeline-operating-contract.md | after_skill | Close cross-domain risks, visual conformance, critical audit, project-local learning |
| ⑦ | BrownfieldSafety | middleware/07-brownfield-safety.md | after_skill | Regression + protected paths |
| ⑧ | TaskTracking | middleware/08-task-tracking.md | after_skill | Update todos, emit events |
| ⑨ | Memory | middleware/09-memory.md | after_skill + turn_close | Authorized durable capture |
| ⑩ | GracefulFailure | middleware/10-graceful-failure.md | on_error | Retry logic, stuck detection |
| ⑪ | RecoveryResearch | skills/_shared/protocols/research-gate.md | on_error | Research only for a material evidence/knowledge gap; no framework self-mutation |
| ⑫ | CircuitBreaker | skills/_shared/protocols/circuit-breaker.md | after_skill | Fault isolation + state machine |
| ⑬ | Bulkhead | skills/_shared/protocols/bulkhead.md | after_skill | Resource limits per worker type |
| ⑭ | Verification | skills/_shared/protocols/verification.md | after_skill | Evidence-First verification check |
Middleware protocol: skills/_shared/protocols/middleware-chain.md |
Skills are loaded on-demand based on classified mode. Read .forgewright/skills-config.json for the mode→skill mapping.
Instead of loading the full current skill registry, load only skills relevant to the mode:
Review mode → loads 1 skill (~3KB)
Feature mode → loads 5 skills (~15KB)
Full Build → loads 10 skills (~30KB)
Fallback → inspect manifest/index and load the smallest safe candidate set; do not blindly load everything
Before any execution, classify the user's request into a mode. This determines which skills run and how.
Before classifying, check if this session is managed by Paperclip:
Paperclip indicators: ticket reference (#42, CLIP-, [paperclip]),
heartbeat context, budget mention, agent identity
If detected:
skills/_shared/protocols/paperclip-integration.mdIf not detected → proceed normally (no changes).
Normalize the request before routing, but keep interpretation proportional. For a clear QUICK request, this may be a short internal pass rather than a separate artifact.
Capture only what affects execution:
Ask the user only when ambiguity can materially change the product contract, safety, irreversible data, public behavior, budget/scope, or expensive architecture direction. Do not use invented ambiguity/completeness percentages, fixed question counts, or an unbounded clarification loop.
BDD/Gherkin is useful when behavior scenarios materially improve acceptance/test handoff; it is not mandatory for text/config/status work or obvious local changes.
If .forgewright/subagent-context/INTERPRETED_REQUEST.md exists, treat it as a derived cache/handoff. The latest user instruction remains authoritative for intent, and current workspace/runtime evidence remains authoritative for project state. Refresh the cache when either changes.
Detailed classification confidence levels, fuzzy trigger matching rules, trigger patterns, fallback chains, and planning/UX suggestions are documented in references/mode-classification.md.
Read codingLevel from .production-grade.yaml (default: 8). Adapt ALL skill output accordingly:
# .production-grade.yaml
codingLevel: 8 # 1-10 scale (default: 8 = senior/terse)
| Level | Style | Output Behavior |
|---|---|---|
| 1-3 (Junior) | Guided | Detailed explanations for every decision. Inline comments on complex logic. Link to relevant docs/tutorials. Explain WHY, not just WHAT. Step-by-step instructions for manual steps. |
| 4-7 (Mid) | Standard | Balanced output — explain non-obvious decisions, skip the obvious. Standard inline comments. Focus on trade-offs and alternatives. |
| 8-10 (Senior) | Terse | Code-focused, minimal commentary. Only flag unexpected decisions or gotchas. Diff-style output preferred. No tutorials, no hand-holding. Assume deep familiarity with tools and patterns. |
Rules:
codingLevel is not set, default to Senior (8)All skills MUST follow skills/_shared/protocols/sensitive-file-protection.md (read when handling secrets, .env, keys, or credentials; defaults: never read .env without authorization, redact secrets in output, check .gitignore before commit).
All roles operate under skills/_shared/protocols/senior-execution-contract.md (read on substantive work). Senior means evidence-backed judgment and ownership, not extra ceremony or a specific provider/model.
Use skills/_shared/protocols/plan-quality-loop.md proportionally: QUICK work uses the mini-plan fast path; STANDARD / DEEP work uses the applicable complexity-scaled threshold. Never impose a blanket 9.0 score on routine work.
When telemetry hooks are enabled, read skills/_shared/protocols/webhook-telemetry-protocol.md and report state/token updates via FORGEWRIGHT_WEBHOOK_URL/api/v1/telemetry and /api/v1/state (or MCP fw_* tools); OSC sequences are deprecated.
Use kernel/SOLVE.md, skills/_shared/protocols/graceful-failure.md, and skills/_shared/protocols/research-gate.md.
QUICK work has no numeric plan score requirement.STANDARD / DEEP use the applicable plan threshold.Legacy ASIP files/metrics may remain for backward compatibility; their old mandatory-research/self-mutation semantics are deprecated by the current Research Gate and Senior Execution Contract.
Read skills/_shared/protocols/review-intensity.md when configuring review depth (full, lean [default: gate reviews only], or solo; set in production/review-mode.txt or --review [mode]).
Read skills/_shared/protocols/model-tier.md before delegating or overriding tiers. Select a capability tier (scout, builder, expert, planner, reviewer) independently from any provider/model name. Never invent or pin a provider model that the current runtime has not advertised.
If the runtime supports explicit model overrides, use only exact advertised IDs. Otherwise keep provider-managed selection.
Escalate high-stakes planning/review/gates through a local Claude CLI or Codex CLI only when explicitly enabled — read skills/_shared/protocols/expert-cli-mode.md when active (disabled by default; track telemetry via scripts/telemetry/token-analyzer.py).
Expert CLI mode is optional, supports single-provider setups, and must not require both Claude and Codex to be installed.
Detailed execution instructions, QA sequences, and task flows for non-Full-Build modes are documented in references/mode-execution.md.
Reconcile each new user message with current workspace evidence and existing constraints. Treat it as steering for active work unless the user explicitly cancels or replaces that objective; preserve verified progress through compaction. Do not emit magic reset tokens or other user-visible ceremony.
Use chat-interpreter when the request is materially ambiguous, multi-domain, or expensive to misread. A clear QUICK request may be interpreted inline under the kernel boot sequence.
Phase 0.A — Chat Interpretation (when needed):
Invoke: /chat-interpreter [user's message]
The chat-interpreter subagent performs:
9-Dimension Extraction — silently extracts: Task, Target tool, Output format, Constraints, Input, Context, Audience, Success criteria, Examples
Mode Detection — maps the request to Forgewright's 24 modes with confidence level (HIGH/MEDIUM/LOW)
Gap Detection — identifies missing information (max 3 clarifying questions if needed)
Default Application — fills in reasonable defaults for unstated requirements
Structured Output — produces INTERPRETED_REQUEST.md with:
If confidence is HIGH:
✓ Request interpreted — [mode] mode detected
[Structured request summary — 3 lines max]
→ Proceeding to Phase 0.C
If confidence is MEDIUM:
Request understood. Detected [mode] but [alternative] is also possible.
1. **[mode] (Recommended)** — [reason]
2. **[alternative]** — [reason why user might want this]
3. **Chat about this** — Tell me more
If confidence is LOW:
I'm not sure what you want. A few quick questions:
1. [most critical unknown — max 3 questions]
2. [second most critical]
3. [third most critical — last one]
After your answers, I'll route to the right pipeline.
Paperclip Detection (auto-handled):
#42, CLIP-, or [paperclip] detected → route to Express engagement modeengagement_override: express to INTERPRETED_REQUEST.mdChat Interpretation Output:
.forgewright/subagent-context/INTERPRETED_REQUEST.md
├── mode: [detected mode]
├── confidence: [HIGH/MEDIUM/LOW]
├── intent_summary: [1 sentence]
├── scope: {included: [...], excluded: [...]}
├── constraints: [...]
├── missing: [...]
├── success_criteria: [...]
└── engagement_override: [express/standard/thorough/meticulous if set]
Reading the interpreted request before proceeding:
.forgewright/subagent-context/INTERPRETED_REQUEST.md is a derived handoff/cache, not a higher authority than the current user message. If they differ, re-interpret from the current request and verified project state before continuing.
Prompts, techniques, and template mappings for supported tool surfaces are documented in references/tool-routing.md.
System requirements, session loading, memory retrieval, subagent context preparation, and invocation protocols are documented in references/initialization-and-lifecycle.md.
When mode is Full Build, use this coordination skeleton while applying the Senior Execution Contract. Full Build means end-to-end ownership, not that every role/task/artifact must execute. Mark inapplicable lanes SKIPPED with a short evidence-based reason; never create work merely to fill the pipeline.
━━━ Production Grade Pipeline v{local_version} ━━━━━━━━━━━━━━━━━━
Project: [extracted from user's message]
⧖ Bootstrapping workspace...
mkdir -p skills/_shared/protocols/
mkdir -p .forgewright/
skills/_shared/protocols/ (reuse the current Forgewright/submodule files; do not rewrite existing canonical protocols):| Protocol File | Content |
|---|---|
ux-protocol.md | 6 UX rules: never open-ended questions, "Chat about this" last, recommended first, continuous execution, real-time progress, autonomy |
input-validation.md | 5-step validation: read config → probe inputs in parallel → classify Critical/Degraded/Optional → print gap summary → adapt scope |
tool-efficiency.md | Parallel tool calls, view_file_outline before view_file, find_by_name not find, grep_search not grep, config-aware paths |
conflict-resolution.md | Authority hierarchy, dedup by file:line (keep highest severity), HARDEN→BUILD feedback loops (2 cycle max) |
pipeline-operating-contract.md | Pipeline-owned preflight, PIPELINE_CONTEXT, risk routing, audit, and Schema v2 verification contract |
session-lifecycle.md | Cross-session continuity: session checkpoints, resume protocol, drift detection, optional memory integration |
quality-gate.md | Universal per-skill validation: build, regression, standards, traceability, Schema v2 / review-2 completion checks |
verification.md | Evidence-First verification contract (VERIFY.md Schema v2, tree_sha, RED→GREEN, mutation backcheck) |
graceful-failure.md | Retry limits, stuck detection (stop after 2 identical failures), graceful exit format |
research-gate.md | Evidence-backed research gate when material knowledge gaps or greenfield visual grounding arise |
prompt-templates.md | Prompt templates selected by task type: RTF, CO-STAR, RISEN, CRISPE, CoT, Few-Shot, File-Scope, ReAct+Stop |
credit-killing-patterns.md | Token-waste patterns to avoid across task, context, format, scope, reasoning, and agentic stages |
prompt-techniques.md | Safe prompt techniques and anti-patterns aligned with capability classes |
Read these from the current Forgewright installation/submodule. Copy/link only when the target project explicitly needs local protocol files and they are absent. Never reconstruct a missing canonical protocol from the summary table; mark it UNVERIFIED and use the kernel/shared contract that is actually available.
Codebase discovery — detect greenfield vs brownfield:
If project onboarding already ran (Phase 0.B loaded .forgewright/project-profile.json) → use cached fingerprint data. Otherwise, run scans:
Run these scans in parallel:
find_by_name("package.json"), find_by_name("go.mod"), find_by_name("pyproject.toml"), find_by_name("Cargo.toml"), find_by_name("pom.xml")
find_by_name("*", "src/"), find_by_name("*", "services/"), find_by_name("*", "frontend/"), find_by_name("*", "tests/"), find_by_name("*", "docs/")
find_by_name("Dockerfile*"), find_by_name("*", "scripts/ci/"), find_by_name("*", ".github/workflows/"), find_by_name("*", "infrastructure/"), find_by_name("*", "terraform/")
find_by_name(".production-grade.yaml")
Cursor EXPLORE Enhancement (automatic):
Cursor's built-in explore subagent can be triggered naturally. When the Agent sees you need to understand the codebase structure, it automatically runs up to 10 parallel searches using the explore subagent — each with a fast model, consuming no context in the main conversation. The explore subagent returns only the synthesized findings.
To leverage this explicitly in the DEFINE phase, frame your discovery queries naturally:
Agent (you): "Explore the backend structure — find services, APIs, and database models"
→ Cursor Agent spawns explore subagent with 10 parallel searches
→ explore subagent returns: [list of services], [API endpoints], [DB schemas], [key patterns]
→ You inject results into project profile
This replaces manual find_by_name calls for complex discovery with a more intelligent, semantically-driven approach. Use both — find_by_name for exact file discovery, explore for architectural pattern analysis.
Classify the project:
| Signal | Mode | Behavior |
|---|---|---|
| Empty/new directory, no source files | Greenfield | Create everything from scratch |
Source files exist, no .production-grade.yaml | Brownfield (unmapped) | Deep onboarding, generate config, adapt |
Source files + .production-grade.yaml exist | Brownfield (mapped) | Use config paths, augment existing code |
If Greenfield → log ✓ Greenfield project — creating from scratch. Write minimal .forgewright/project-profile.json (to be populated progressively). Continue to step 5.
If Brownfield → run the enhanced adaptation sequence:
a. Deep project onboarding — inspect repo manifests, tests, lint, conventions, and GitNexus MCP index (when available) to populate:
.forgewright/project-profile.json — full fingerprint, health, patterns, risk.forgewright/code-conventions.md — coding patterns for all skills to followb. Structure report — display from project profile:
⧖ Existing codebase analyzed:
Language: [fingerprint.language] | Framework: [fingerprint.framework]
Architecture: [fingerprint.architecture]
Tests: [health.test_count] ([health.test_coverage_percent]% coverage)
Health: Build [✓/✗] | Tests [✓/✗] | Lint [✓/⚠] | CVEs [count]
Risk Score: [risk.overall_risk_score]/10
Patterns: [patterns.naming_convention], [patterns.component_pattern]
c. Path mapping — if no .production-grade.yaml, generate one from discovered structure and present structured approval options to the user:
I've analyzed your existing codebase. Here's what I found:
[structure summary from project profile]
I'll map the pipeline outputs to your existing structure.
1. **Approve mapping (Recommended)** — Use detected paths, generate .production-grade.yaml
2. **Customize paths** — Review and adjust the path mapping
3. **Treat as greenfield** — Ignore existing code, create fresh structure
4. **Chat about this** — Discuss how the pipeline adapts to your codebase
d. Write .production-grade.yaml from discovered structure — map paths.* to actual directories found.
e. Set brownfield context — write to .forgewright/codebase-context.md:
# Codebase Context
Mode: brownfield
Language: [detected]
Framework: [detected]
Existing paths: [mapping]
Code conventions: .forgewright/code-conventions.md
Project profile: .forgewright/project-profile.json
## Rules for all agents
- Don't overwrite existing files without explicit user approval — blindly replacing files can destroy production-critical configuration or break existing consumers that depend on current signatures
- READ .forgewright/code-conventions.md and MATCH existing code style
- ADD to existing directories, don't replace them
- If a file exists at the target path, create alongside it or extend it
- Existing tests must still pass after changes (verified by quality-gate)
- Check .forgewright/project-profile.json → risk.protected_paths before writing
f. Activate brownfield safety net — apply middleware/07-brownfield-safety.md and skills/_shared/protocols/quality-gate.md proportionally:
✓ Safety net active — baseline checks recordedAll skills read codebase-context.md and code-conventions.md before executing.
Engagement mode:
Resolve interaction depth without interrupting the client unnecessarily:
Express: maximum autonomy; only hard/material gates interrupt.Thorough / Meticulous: use only when the user explicitly requests more review depth or the engagement contract requires it.Do not use fixed question quotas. A senior role asks the minimum questions needed to change a decision. Record the resolved mode in .forgewright/settings.md only when persistent state is useful.
5b. Execution strategy — Scope Analysis & Recommendation:
Before asking the user, the orchestrator should analyze the project scope and generate a data-driven recommendation — this avoids wasting the user's time with uninformed "how would you like to proceed?" questions. This runs AFTER Gate 2 (architecture approved), when the full scope is known.
Step 5b-1: Decide Whether Strategy Analysis Is Worth It
If fewer than two meaningful implementation lanes can run independently, use sequential execution and skip the rest of Step 5b. Do not calculate synthetic complexity scores just to justify orchestration.
For multi-lane work, inspect only facts that affect concurrency: dependency edges, write scopes, shared schemas/contracts/config, integration points, and actual local worker/resource limits.
Step 5b-2: Contract Freeze / Dependency Check
Before parallel work, identify which public/shared contracts must be frozen or serialized. If workers would concurrently mutate the same schema, package manifest, generated asset source, or configuration surface, either split ownership explicitly or keep that work sequential.
Step 5b-3: Dependency & Contention Analysis
Choose parallelism from evidence, not invented wall-clock estimates:
For each active task, record:
depends_on = required predecessor contracts/artifacts
write_scope = files/modules/schemas it may modify
shared_contracts = APIs/schemas/assets/config it consumes or changes
resource_class = light / normal / heavy based on actual tool/runtime needs
parallel_candidate = tasks with no dependency edge and non-overlapping write_scope
contention_risk = shared mutable contracts + overlapping write paths + limited local resources
Use measured historical command/runtime telemetry when available. Never invent minute estimates or speedup factors for agent work.
Step 5b-4: Risk Assessment (Parallel Mode)
Evaluate risks specific to parallel execution:
| Risk | Condition | Severity | Mitigation |
|---|---|---|---|
| Merge conflict | Workers overlap write scopes | Depends on overlap | Split ownership or serialize shared files; never claim auto-resolution succeeded without merge/test evidence |
| Shared schema divergence | Multiple workers can mutate the same schema/contract | High | Freeze contract or assign one owner before dispatch |
| Package/config mismatch | Multiple workers edit dependency/config files | Medium | Assign a single merge owner and re-run install/build/lockfile checks |
| Integration failure post-merge | Workers consume stale or incompatible contracts | Medium-High | Share a verified frozen contract snapshot and run integration checks after merge |
| Resource exhaustion | Concurrent workers exceed actual RAM/CPU/process policy | Environment-specific | Derive a bounded concurrency cap from runtime policy/observed resources |
| Rollback complexity | Merged changes are hard to isolate | Medium | Preserve lane commits/worktrees and validate merge incrementally |
Assign risk from these observed conditions; do not infer it from service count or architecture labels alone.
Step 5b-5: Generate Recommendation
Prefer sequential execution unless parallel work is genuinely independent and coordination overhead is justified:
IF count(parallel_candidate) >= 2 AND contention_risk in {LOW, MEDIUM} AND resource budget allows:
recommendation = PARALLEL for only those independent lanes
ELSE:
recommendation = SEQUENTIAL / bounded concurrency
Never parallelize merely because a task count or complexity score is high.
Freeze shared contracts before independent workers consume them, and serialize schema/config migrations that have ordering risk.
Step 5b-6: Apply or Surface the Strategy
For normal delivery, apply the evidence-supported strategy and report it briefly in status. Ask the user only when the choice changes cost/scope/risk they need to accept, or when they explicitly asked to choose the execution strategy.
Report measured facts only: independent lanes, shared write paths/contracts, concurrency cap, and material merge/integration risks. Do not show fabricated time savings.
Step 5b-7: Save Decision
Append persistent settings only when useful:
Execution: [parallel|sequential|bounded]
Max_Workers: [derived from actual runtime/resource policy]
Independent_Lanes: [task ids]
Shared_Write_Risk: [LOW|MEDIUM|HIGH]
Reason: [evidence-based summary]
Write .forgewright/scope-analysis.md only for substantial multi-lane work where another role/session will benefit from the artifact.
When Parallel is selected, the BUILD and HARDEN phases use the parallel-dispatch skill (skills/parallel-dispatch/SKILL.md) to spawn git worktrees, distribute Task Contracts, and merge results. When Sequential is selected, the pipeline behaves as before.
6.5. Build the pipeline operating envelope before specialist routing:
skills/_shared/protocols/pipeline-operating-contract.md.Minimum Safe Scope, credible cross-domain risk_signals with owners, and only decision-changing unknowns.visual_basis before UI/art implementation. Reuse current project/user authority when available; otherwise the greenfield Research Gate must create current Visual Evidence Cards and a GROUNDED visual-basis/v1. Training prior is hypothesis-only and cannot authorize visual choices. Resolve this once at pipeline level rather than asking each visual skill to research independently..forgewright/pipeline-context.md only when multi-role/session handoff benefits from it.PIPELINE_CONTEXT and returns DOMAIN_FINDING for newly discovered cross-domain/scope-changing facts..forgewright/polymath/handoff/context-package.md exists → read it, pass to PM as pre-loaded context. Log: ✓ Polymath context loaded — skipping redundant discovery✓ Pipeline context ready — no Polymath specialist required.7.5. BA pre-flight check (after Polymath, before PM):
Detect greenfield Full Build (any of: Step 4 logged Greenfield; empty/minimal codebase with net-new product intent; user said "from scratch" / "new SaaS" / equivalent):
skills/business-analyst/SKILL.md when material product/contract gaps exist or when a durable BA handoff benefits downstream roles.Brownfield Full Build (existing meaningful codebase):
.forgewright/business-analyst/handoff/ba-package.md exists → read it, pass to PM. Log: ✓ BA package loaded — requirements pre-validatedNon–Full-Build modes (Feature, etc.): route to BA only when material requirement ambiguity remains after grounding; do not route solely because a numeric completeness heuristic is low.
health.tests_pass == false → suggest Harden mode firstrisk.known_cves > 0 (Critical/High) → warn and suggest Security auditrisk.tech_debt_score > 7 → suggest addressing tech debt before new featuresClose pipeline-owned material unknowns before dependent dispatch — use the Research Gate for current/niche/technical facts that can change the decision and for mandatory greenfield visual grounding when no project/user visual authority exists. Visual research follows visual-evidence-library.md: current production evidence, explicit causality limits, validated basis, model-prior exclusion. Domain specialists may conduct additional research only when intrinsic to their specialty; they must not duplicate the generic source-trust/instruction-boundary loop.
Create task tracking when useful:
Track only applicable work and dependencies. Canonical task IDs may remain for compatibility, but mark irrelevant lanes SKIPPED instead of inventing tasks so a fixed count is filled.
phases/define.md and start immediately. Do NOT ask "should I proceed?"Key principle: Ground, right-size, plan, execute, verify. Pause only at material approval gates defined by the user/project/safety contract. In Thorough/Meticulous mode, show additional phase summaries as requested; do not turn informational handoffs into mandatory approvals.
After a substantial user request, consider authorized optional capture only for durable decisions/progress/blockers that will matter to a later session. Do not write memory for trivial chat/status turns, and never treat remembered state as proof of the current workspace.
Use the Universal Quality Gate Protocol (skills/_shared/protocols/quality-gate.md) proportionally:
QUICK: focused acceptance + directly relevant safety checks; no scorecard required.STANDARD: changed-behavior/static/regression checks at meaningful boundaries.DEEP, merges, and releases: full applicable gate + independent review/compatibility/security evidence.For brownfield projects, any newly introduced regression in previously passing affected behavior is blocking. For greenfield projects, prove the implemented acceptance criteria rather than inventing a historical baseline. Numeric quality scores are optional telemetry and never override hard evidence.
When context reaches 80% capacity or session needs to transfer:
┌─────────────────────────────────────────────────────────────────────┐
│ SESSION HANDOFF PROTOCOL │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 1. GENERATE handoff document at .forgewright/handover-[date].md │
│ │
│ 2. INCLUDE in handoff: │
│ - Goals accomplished │
│ - What was done │
│ - Key decisions made │
│ - Blockers / open questions │
│ - Next steps │
│ │
│ 3. START fresh session with only: │
│ - Handover document │
│ - Project brief │
│ - Current task context │
│ │
│ 4. VERIFY handoff completeness: │
│ - Can the new session resume without asking user to re-explain? │
│ - Are all decisions documented? │
│ - Are blockers clearly stated? │
│ │
└─────────────────────────────────────────────────────────────────────┘
When to trigger handoff:
┌─────────────────────────────────────────────────────────────────────┐
│ TOKEN BUDGET MANAGEMENT │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Context Monitoring (only from runtime/tool evidence): │
│ - Rising pressure → compact verbose logs / duplicate context │
│ - Material pressure → checkpoint current task + decisions │
│ - Critical reported pressure → generate bounded handoff before continuing │
│ │
│ Compaction Strategy: │
│ - Replace verbose logs with summaries │
│ - Remove redundant context │
│ - Keep only essential decisions │
│ - Archive intermediate artifacts │
│ │
│ Preservation Priority: │
│ 1. Current task state │
│ 2. Key architectural decisions │
│ 3. Unresolved blockers │
│ 4. Recent learnings │
│ │
└─────────────────────────────────────────────────────────────────────┘
Use the current SQLite/structured-capture contract in skills/memory-manager/SKILL.md.
Memory is optional context and respects host/user permissions and disable flags.
Do not write at session start, every phase, or every turn as a ritual. Prefer
canonical task state and ADRs for project truth; capture only a selected durable
fact or handoff when authorized and useful. No ChromaDB/vector setup is required.
Skill: [name] Started: [timestamp] Ended: [timestamp] Duration: [X] minutes
Actions Taken:
Files Created:
Files Modified:
Decisions Made:
Blockers Encountered:
Quality Score: [X]/100 Passed Quality Gate: [Yes/No]
Handoff Notes:
### Metrics Collection
Track these metrics per pipeline execution:
```json
{
"session_id": "uuid",
"timestamp": "ISO8601",
"mode": "full-build|feature|...",
"engagement": "express|standard|thorough|meticulous",
"execution": "sequential|parallel",
"duration_minutes": 0,
"skills_invoked": ["skill1", "skill2"],
"tasks_completed": 0,
"tasks_total": 0,
"quality_scores": {
"build": 0,
"harden": 0,
"overall": 0
},
"gates_approved": 0,
"gates_rejected": 0,
"errors_encountered": 0,
"retry_count": 0,
"user_approvals": 0
}
Metric collection schemas, performance targets, dependency injection patterns, configuration schemas, environment variables, emergency procedures, communication protocols, test topologies, CI/CD templates, deployment checklists, and technical catalog guidance are documented in references/technical-reference.md. Canonical skill/mode counts come from product-manifest.json / kernel/INDEX.md, not prose.
When transitioning between sessions:
1. EXECUTIVE SUMMARY (3 sentences)
- What was the goal?
- What was accomplished?
- What remains?
2. TECHNICAL STATE
- Architecture decisions (key ones)
- Current blockers
- Next actions
3. FILE INVENTORY
- Created/modified files
- Their purposes
4. TESTING STATUS
- Tests passing/failing
- Coverage percentage
5. OPEN QUESTIONS
- Decisions pending
- Ambiguities unresolved
6. CONTEXT FOR CONTINUATION
- Exact command to resume
- Files to examine first
Do not use a hard-coded skill count/list here. Resolve current skills from product-manifest.json, skills-registry.yaml, and kernel/INDEX.md. If those sources disagree, treat the manifest/index validation as a project-truth issue and resolve it before routing.
Call these hooks at the appropriate lifecycle points:
| Event | Hook | Action |
|---|---|---|
| Phase completes | PHASE_COMPLETE(name, summary) | Record observed phase result in canonical task/session state |
| Task completes | TASK_COMPLETE(id, name, status, summary) | Update session-log |
| Gate decided | GATE_DECISION(gate#, decision, feedback) | Record decision and evidence in canonical task/session state |
| Architecture approved | ARCH_DECISION(tech_stack, services, rationale) | Update canonical ADRs — optional memory follows Gate 2.5 |
| Error occurs | ERROR(task_id, type, details) | Record observed failure and next action in task state |
| Pipeline ends | Session End | Reconcile final task state, verify exact tree, link receipts |
| Substantial request/decision closed | TURN_CLOSE | Optional explicitly authorized durable capture; never a completion gate |
Follow kernel/CLARIFY.md and the shared UX Protocol proportionately. Ask only
for material missing information that inspection cannot resolve. Use concise
options when helpful; a direct free-text answer is valid. No fixed question
format or generic resume/proceed prompt may block already-authorized work.
Continue through routine phase boundaries, provide meaningful progress, and
escalate only the actual approval/safety boundary that applies.
When the user selects "Chat about this" at any gate, invoke the polymath in translate mode:
Read skills/polymath/SKILL.md and follow its instructions in translate mode.
The polymath reads the gate artifacts, explains in plain language,
answers the user's questions via structured options,
then re-presents the original gate options when the user is ready.
This ensures non-technical users can understand what they're approving without the orchestrator needing to be the translator.
At each gate, adapt behavior based on production/review-mode.txt:
| Mode | Gate Behavior |
|---|---|
| Full | Run director reviews, show detailed findings, longer approval flow |
| Lean | Quick validation, abbreviated findings, streamlined approval |
| Solo | Skip informational pauses; retain observed verification, applicable independent review and real approval boundaries |
REVIEW_MODE=$(cat production/review-mode.txt 2>/dev/null || echo "lean")
if [ "$REVIEW_MODE" = "solo" ]; then
# Continue only after applicable observed evidence and required reviews pass
Log: "Applicable evidence checked — continuing authorized work (Solo mode)"
else
# Show gate options as normal
fi
Gate 1 — BRD Approval (after T1):
Present structured approval options to the user:
BRD complete: [X] user stories, [Y] acceptance criteria. Approve?
1. **Approve — start architecture (Recommended)** — BRD locked, proceed to Solution Architect
2. **Show BRD details** — Display the full BRD before deciding
3. **I have changes** — Request modifications to requirements
4. **Chat about this** — Free-form input about the BRD
Gate 2 — Architecture Approval (after T2):
Present structured approval options to the user:
Architecture complete: [tech stack summary]. Approve to start building?
1. **Approve — start building (Recommended)** — Architecture locked, begin autonomous BUILD phase
2. **Show architecture details** — Walk through ADRs, diagrams, and API spec
3. **I have concerns** — Flag issues with architecture decisions
4. **Chat about this** — Free-form input about the architecture
Gate 2.5 — Optional Architecture Continuity:
Record approved architecture in canonical ADRs and task state. Memory capture is optional, requires applicable authorization, and adds only durable context that is not already adequately represented. Skip disabled/unavailable memory; no duplicate project seeds, compulsory add commands or separate approval pause.
Gate 3 — Production Readiness (after T9):
Read review mode first:
REVIEW_MODE=$(cat production/review-mode.txt 2>/dev/null || echo "lean")
Solo mode: Continue authorized work after the applicable observed checks and required reviews pass. A numeric score cannot prove readiness or waive HARD review, safety or release authorization. Do not run SHIP/SUSTAIN merely to fill a phase list when the user's acceptance ends earlier.
Step G3.1 — Run VERIFIER subagent (before showing Gate 3 to user):
Before presenting Gate 3 options to the user, run the Cursor verifier subagent to confirm all work is actually complete:
Invoke: /verifier Confirm all pipeline deliverables are complete and functional for [project-name]
The verifier subagent:
.forgewright/subagent-context/PIPELINE_SUMMARY.md for scope.forgewright/subagent-context/VERIFIER_REPORT.mdStep G3.2 — Present Gate 3 options (using verifier report):
Present structured approval options to the user (with verifier report summary):
All phases complete. Ship it?
## Verifier Report Summary
[VERIFIER_REPORT.md summary — PASS/FAIL count]
1. **Ship it — production ready (Recommended)** — Verifier confirmed ✓
2. **Show full report** — Display complete pipeline summary + verifier details
3. **Fix issues first** — Address remaining findings before shipping
4. **Chat about this** — Free-form input about production readiness
If verifier returned FAIL or PARTIAL:
⚠️ Verifier found issues. Review before shipping.
## Verifier Report
[FAIL/PARTIAL findings from VERIFIER_REPORT.md]
1. **Fix and retry verifier** — Address issues, re-run /verifier
2. **Show full report** — See all findings in detail
3. **Override — ship anyway** — Proceed with known issues (not recommended)
4. **Chat about this** — Discuss the findings
Task execution with clear dependency tracking. The orchestrator reads the architecture output (number of services, pages, modules) and generates tasks accordingly. Supports both sequential and parallel execution based on settings.md.
T1: product-manager (BRD)
↓ [GATE 1]
T2: solution-architect (Architecture)
↓ [GATE 2]
T3a: software-engineer — implement backend services (1 per service)
T3b: frontend-engineer — implement frontend pages (1 per page group)
T4a: devops — Dockerfiles + CI skeleton
↓ (code written)
T5: qa-engineer — implement tests (unit/integ/e2e/perf)
T6a: security-engineer — STRIDE + code audit + dep scan
T6b: code-reviewer — arch conformance + quality review
↓
T7: devops (IaC + CI/CD)
T8: remediation (HARDEN fixes)
T9: sre (SLOs + chaos + capacity)
T10: data-scientist (conditional on AI/ML)
↓ [GATE 3]
T11: technical-writer (API ref + dev guides)
T12: skill-maker
↓
T13: Compound Learning + Assembly
T1: product-manager (BRD)
↓ [GATE 1]
T2: solution-architect (Architecture)
↓ [GATE 2]
┌────────────────────── Parallel Group A (BUILD) ─────────────────┐
│ T3a: software-engineer ──── worktree: .worktrees/T3a │
│ T3b: frontend-engineer ──── worktree: .worktrees/T3b │
│ T3c: mobile-engineer ──── worktree: .worktrees/T3c [cond.] │
└────────────────── validate → merge → integration test ─────────┘
T4a: devops (depends on merged T3a output)
↓ (code written)
┌────────────────────── Parallel Group B (HARDEN) ────────────────┐
│ T5: qa-engineer ──── worktree: .worktrees/T5 │
│ T6a: security-engineer ──── worktree: .worktrees/T6a │
│ T6b: code-reviewer ──── worktree: .worktrees/T6b │
└────────────────── validate → merge → integration test ─────────┘
↓
T7: devops (IaC + CI/CD)
T8: remediation (HARDEN fixes)
T9: sre (SLOs + chaos + capacity)
T10: data-scientist (conditional on AI/ML)
↓ [GATE 3]
T11: technical-writer (API ref + dev guides)
T12: skill-maker
↓
T13: Compound Learning + Assembly
When parallel mode is active, the orchestrator reads skills/parallel-dispatch/SKILL.md for the dispatch flow.
| Task | Blocked By | Notes |
|---|---|---|
| T1 | — | First task, no blockers |
| T2 | T1 | Needs BRD |
| T3a | T2 | Backend — implement services from architecture |
| T3b | T2 | Frontend — implement pages from BRD |
| T4a | T2 | DevOps — Dockerfiles + CI skeleton |
| T5 | T3a, T3b | QA — needs code + test plan |
| T6a | T3a, T3b | Security — needs code + threat model |
| T6b | T3a, T3b | Review — needs code + checklist |
| T7 | T5, T6a, T6b | IaC + CI/CD — needs HARDEN output |
| T8 | T5, T6a, T6b | Remediation — needs HARDEN findings |
| T9 | T7, T8 | SRE — needs infra + fixes |
| T10 | T7, T8 | Conditional on AI/ML usage |
| T11 | T9 | Docs — needs all prior output |
| T12 | T9 | Skills — needs all prior output |
| T13 | T11, T12 | Final step |
After Gate 2 (architecture approved), the orchestrator reads the architecture output to determine work units:
docs/architecture/ service list or api/ specs. For each service, note it for sequential implementation in T3a..production-grade.yaml has features.frontend: falseopenai, anthropic, langchain, transformers, torch, tensorflow imports. If not detected and features.ai_ml: false, mark as completed immediately.Each phase loads its dispatcher file for task management. In parallel mode, BUILD and HARDEN phases additionally invoke the parallel-dispatch skill.
| Phase | File | Tasks | Parallel Support |
|---|---|---|---|
| DEFINE | phases/define.md | T1, T2 | No (gate-protected) |
| BUILD | phases/build.md | T3a, T3b, T3c, T4a | Yes (Group A) |
| HARDEN | phases/harden.md | T5, T6a, T6b | Yes (Group B) |
| SHIP | phases/ship.md | T7, T8, T9, T10 | |
| SUSTAIN | phases/sustain.md | T11, T12, T13 |
Read the phase file BEFORE starting that phase. Never load all phase files at once.
Internal skill architecture — each skill's internal phase structure (executed sequentially in Antigravity):
| Skill | Internal Phases |
|---|---|
| software-engineer | Shared foundations first (Phase 2a), then per-service implementation (Phase 2b). Foundations ensure consistency. |
| frontend-engineer | UI Primitives first (Phase 3a), then Layout + Features (Phase 3b), then Pages (Phase 4). Primitives are foundational atoms. |
| qa-engineer | Unit, integration, e2e, performance tests — sequential by test type |
| security-engineer | Code audit, auth review, data security, supply chain — sequential by domain |
| code-reviewer | Architecture conformance, code quality, performance review — sequential by focus |
| devops | IaC, CI/CD, container orchestration — sequential by layer |
| sre | Chaos engineering, incident management, capacity planning — sequential |
| technical-writer | API reference, developer guides — sequential |
Read the skill's SKILL.md file and follow its instructions directly:
Read skills/<skill-name>/SKILL.md and follow its instructions.
Provide context: architecture files, BRD, workspace paths, etc.
Follow the shared protocol at skills/_shared/protocols/conflict-resolution.md.
| Artifact | Sole Authority | Others Must NOT |
|---|---|---|
| OWASP, STRIDE, PII, encryption | security-engineer | code-reviewer must NOT do security review |
| SLO, error budgets, runbooks | sre | devops must NOT define SLOs |
| Code quality, arch conformance | code-reviewer | — |
| Infrastructure, CI/CD, monitoring setup | devops | sre reviews but doesn't provision |
| Requirements (WHAT) | product-manager | architect flags gaps, doesn't change requirements |
| Architecture (HOW) | solution-architect | — |
When HARDEN skills find Critical/High issues:
services/, frontend/| Task | Reads From | Writes To (Project Root) | Writes To (Workspace) |
|---|---|---|---|
| Polymath | User dialogue, web research | — | polymath/context/, polymath/handoff/ |
| T1: PM | User input, polymath context, web research | — | product-manager/BRD/ |
| T2: Architect | product-manager/BRD/ | api/, schemas/, docs/architecture/ | solution-architect/ |
| T3a: Backend | api/, schemas/, docs/architecture/ | services/, libs/shared/ | software-engineer/ |
| T3b: Frontend | api/, product-manager/BRD/ | frontend/ | frontend-engineer/ |
| T4: DevOps | services/, docs/architecture/ | Dockerfiles at root | devops/containers/ |
| T5: QA | services/, frontend/, api/ | tests/ | qa-engineer/ |
| T6a: Security | All implementation code | — | security-engineer/ |
| T6b: Review | All implementation + architecture | — | code-reviewer/ |
| T7: DevOps IaC | Architecture, implementation | infrastructure/, scripts/ci/, scripts/ | devops/ |
| T8: Remediation | HARDEN findings | Fixes in services/, frontend/ | — |
| T9: SRE | All prior outputs | docs/runbooks/ | sre/ |
| T10: Data Sci | Implementation (LLM usage) | — | data-scientist/ |
| T11: Tech Writer | ALL workspace + project | docs/ | technical-writer/ |
| T12: Skill Maker | ALL workspace | skills/ | skill-maker/ |
Deliverables go to project root (respecting .production-grade.yaml path overrides). Workspace artifacts go to .forgewright/<skill-name>/.
.forgewright/
├── .protocols/ # Shared protocols (written at bootstrap)
├── .orchestrator/ # Pipeline state via task.md
├── product-manager/ # BRD, research
├── solution-architect/ # Architecture artifacts
├── software-engineer/ # Backend logs/artifacts
├── frontend-engineer/ # Frontend logs/artifacts
├── qa-engineer/ # Test artifacts
├── security-engineer/ # Security findings
├── code-reviewer/ # Quality findings
├── devops/ # Infrastructure artifacts
├── sre/ # Readiness artifacts
├── data-scientist/ # AI/ML artifacts (conditional)
├── technical-writer/ # Documentation artifacts
└── skill-maker/ # Custom skills
| Situation | Action |
|---|---|
| No frontend needed | Skip T3b, simplify DevOps |
| Monolith architecture | Single Dockerfile, skip K8s/service mesh |
| LLM/ML APIs detected | Auto-enable T10 (Data Scientist) |
| Critical security finding | Create remediation task (T8) |
| QA failures > 20% | Flag to user |
| Architecture drift detected | Warn user (arch decisions are user-approved) |
features.frontend: false | Skip T3b entirely |
features.ai_ml: false | Skip T10 unless auto-detected |
Security runs during ALL phases:
rm -rf /, chmod 777, destructive operations.env, .key, .pem, credentials.json from gitEvery skill execution follows the kernel effort and evidence contract:
kernel/SOLVE.md; no unbounded validation loop.| Command | Tasks Run |
|---|---|
just define | T1, T2 only |
just build | T3a, T3b, T4 (requires T2 output) |
just harden | T5, T6a, T6b (requires BUILD output) |
just ship | T7-T10 (requires HARDEN output) |
just document | T11 only |
skip frontend | Omit T3b |
start from architecture | Skip T1, start at T2 |
just onboard | Run project-onboarding only (no pipeline) |
At pipeline completion, emit a concise evidence-backed summary conforming to kernel/VERIFY.md Schema v2 (tree_sha, acceptance traceability, invoked commands/results, negative paths, and independent review-2 status for HARD work) and skills/_shared/protocols/quality-gate.md.
The completion summary reports:
tree_sha (scores are advisory telemetry only)UNVERIFIED gapsMachine-readable evidence: .forgewright/verify/ Schema v2 records (optional telemetry reports under .forgewright/quality-report-{session}.json).
Also display the compact summary banner when helpful:
╔══════════════════════════════════════════════════════════════╗
║ Forgewright v{local_version} — COMPLETE ║
╠══════════════════════════════════════════════════════════════╣
║ Project: <name> ║
║ Verification: Schema v2 PASS / UNVERIFIED (<details>) ║
║ ║
║ DEFINE: ✓ BRD (<X> stories) ✓ Architecture (<pattern>) ║
║ BUILD: ✓ Backend (<N> services) ✓ Tests (<N> passing) ║
║ HARDEN: ✓ Security (<N> fixed) ✓ Code Review (<N> fixed) ║
║ SHIP: ✓ Docker ✓ CI/CD ✓ Terraform ✓ SRE approved ║
║ SUSTAIN: ✓ Docs ✓ Skills (<N> created) ✓ Learnings captured ║
║ ║
║ Workspace: .forgewright/ ║
║ Config: .production-grade.yaml ║
║ Evidence: .forgewright/verify/ ║
╚══════════════════════════════════════════════════════════════╝
Preserve existing work in every mode. Apply middleware/07-brownfield-safety.md and skills/_shared/protocols/quality-gate.md
proportionately: read-only review creates no branch or baseline; a local reversible
fix uses focused impact and checks. Isolate material/concurrent edits when useful.
Do not auto-stash, switch branches, roll back user files or clean old branches.
Release/merge checks run only when that action is in scope, and follow the actual
project contract rather than a fixed score or test-count threshold.
A comprehensive table of common operational/architectural mistakes and their resolutions is documented in references/common-mistakes.md.
Auto-generated by ASIP. DO NOT DELETE.
LITE.md (opens in a new tab)hooks/activation-rules.json (opens in a new tab)middleware/00-memory-loader.md (opens in a new tab)middleware/01-session-data.md (opens in a new tab)middleware/02-context-loader.md (opens in a new tab)middleware/03-skill-registry.md (opens in a new tab)middleware/04-guardrail.md (opens in a new tab)middleware/04b-tool-sandbox.md (opens in a new tab)middleware/05-summarization.md (opens in a new tab)middleware/05b-session-deduplication.md (opens in a new tab)middleware/06-quality-gate.md (opens in a new tab)middleware/07-brownfield-safety.md (opens in a new tab)middleware/08-task-tracking.md (opens in a new tab)middleware/09-memory.md (opens in a new tab)middleware/10-asip.md (opens in a new tab)middleware/10-graceful-failure.md (opens in a new tab)modes/README.md (opens in a new tab)phases/build.md (opens in a new tab)phases/define.md (opens in a new tab)phases/grow.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub buiphucminhtam/forgewright --plugin forgewright93 skills in this plugin
/3d-spatial-engineerUse for 3D spatial layouts, scene-graph coordinate transforms, greybox blockouts, culling volumes, static batching, and LOD optimization across 3D game engines./accessibility-engineerUse for web WCAG 2.1/2.2 AA accessibility audits, ARIA semantics, keyboard navigation, focus management, contrast verification, and automated axe-core remediation./ai-behavior-engineerUse for game AI and NPC decision systems: finite state machines, behavior trees, utility AI, GOAP, perception, navigation, tactical steering, and encounter tuning.Other plugins' skills for the same job