/erpaval:erpavalfrom erpaval
Autonomous software development workflow with classifiers routing scope, complexity, and spec readiness through Explore/Research/Plan/Act/Validate phases, persisting lessons for future sessions.
Ships in erpaval. 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.
| Reference | When to load |
|---|---|
references/flow.md | The graph — intake, build loop, validate/compound, cycles |
references/classifiers.md | Prompt text for each CL-* classifier |
references/fan-out.md | Per-phase subagent counts + the one-message parallel-launch rule |
references/glossary.md | CP-*, CL-*, gates, cycles, zones, placeholder tokens |
${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/references/roles/hmw-framer.md | HMW substep (hard-dep on product-discovery; run when CL-RIGOR asks for HMW) |
${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/references/roles/ears-specifier.md | EARS substep (hard-dep on product-discovery; run when CL-RIGOR asks for EARS) |
references/orchestrator.md | Per-phase runbook — Task-tool lifecycle, Agent patterns |
references/context-packets.md | Per-packet YAML schemas + two-gate review + auto-merge rules |
references/write-protocol.md | Canonical write-protocol block (copied into every Act prompt) |
references/validation-playbook.md | 3-layer validation + closed-loop toolchain |
references/compound.md | Dual-track lesson schema + recall retrieval algorithm |
templates/session/worklog-skeleton.md | Per-task packet skeleton with embedded write protocol |
templates/session/ | YAML schemas the orchestrator seeds into .erpaval/sessions/<id>/ at runtime |
templates/specs/ | EARS spec and task-list skeletons for the Framing substep |
templates/solutions/ | Lesson templates (bug, knowledge) the Compound phase writes from |
templates/brainstorms/ | HMW requirement skeletons for the Framing substep |
templates/INDEX.md | Recall-phase index of lessons by category, read at session start |
A six-phase workflow with two framing substeps and a compounding tail. The orchestrator (main Claude Code session) runs classifiers to decide which phases apply, delegates implementation to subagents, and persists Markdown + YAML packets under .erpaval/ so future sessions start smarter than this one.
flowchart LR
IN[Intake + Recall bootstrap] --> SCOPE{Scope?}
SCOPE -->|coding| COMPLEX{Complexity?}
SCOPE -->|non-coding| ROUTE[Upstream skill]
COMPLEX -->|1-file fix| DIRECT[Direct fix]
COMPLEX -->|multi-module or rebuild| RESUME{New or resume?}
RESUME -->|new| NEW[erpaval-new.py]
RESUME -->|resume| PRIOR[Load prior session]
NEW --> DIR{Dir state?}
PRIOR --> DIR
DIR --> RIGOR{Rigor?}
RIGOR -.->|fuzzy| HMW[HMW frame]
RIGOR -.->|contract unclear| EARS[EARS spec]
HMW --> EARS
EARS --> ER[Explore + Research]
RIGOR -->|crisp| ER
ER --> PLAN[Plan]
PLAN --> G1{Gate 1}
G1 -.->|revise| PLAN
G1 -->|approved| ACT[Act · waves]
ACT --> VAL[Validate]
VAL -.->|fail| ACT
VAL -->|pass| G2{Gate 2}
G2 --> MERGE[Merge]
MERGE --> COMP[Compound · extract lessons]
COMP --> DONE([Done])
Full three-view graph with every cycle is in references/flow.md. Dashed edges are named cycles.
Each phase has a completion gate enforced by the TaskCreate / TaskUpdate / TaskList todo-list tool family (distinct from the Agent subagent-launcher). Every implementation task is wired with addBlockedBy so the task system itself prevents out-of-order execution. No skipping, no parallel execution across gates, no early starts.
The todo-list tools hold authoritative state. YAML packets under .erpaval/sessions/ are read-only hints that inform which tasks to create and what goes in their prompt. Per-task Markdown packets at .erpaval/sessions/<id>/tasks/T-AC-X-Y.md double as subagent work logs — the agent edits them section-by-section per write-protocol.md, and the orchestrator monitors with wc -l. Partial progress on disk survives timeouts and SendMessage interrupts; state held in working memory does not.
See references/orchestrator.md for the per-phase runbook.
Two steps the orchestrator always runs before Explore, so Compound can actually fire at the end of the session.
uv run ${CLAUDE_PLUGIN_ROOT}/skills/erpaval/tools/erpaval-recall.py bootstrap surfaces category counts + INDEX.md path. Cold repos print no prior lessons and proceed. The SessionStart hook also emits this via additionalContext, but the tool call is the authoritative record — run it.CL-COMPLEXITY returns multi-module / rebuild). CL-RESUME reads the request, ls .erpaval/sessions/session-*/ (sorted by mtime), and the top-5 prior session.yaml files, then emits one of:
uv run ${CLAUDE_PLUGIN_ROOT}/skills/erpaval/tools/erpaval-new.py --request "<raw_request>". Creates .erpaval/sessions/session-<hex>/intake.yaml, ensures .gitignore and INDEX.md. Required — without a session-<hex>/ dir, the Stop hook's six-gate check never clears and Compound silently no-ops.session.yaml + latest tasks/*.md, append the new ask to intake.yaml.raw_request, continue from the last completed gate. Do not scaffold a new session-<hex>/.For 1-file fixes, CL-COMPLEXITY exits the flow before Session 0 step 2 — recall-only is correct; no session dir needed.
See references/classifiers.md for the CL-RESUME prompt and references/orchestrator.md for the runbook.
Before Explore starts, the orchestrator runs classifiers to decide which phases to run. Claude judges — the user never picks from a menu.
| Classifier | Question | Skips / routes |
|---|---|---|
| CL-SCOPE | Is this a coding task? | Non-coding → route to /research, /product-discovery, /product-strategy, /working-backwards, /customer-research, etc. |
| CL-COMPLEXITY | 1-file fix · multi-module · rip-and-replace? | 1-file → skip ERPAVal, just fix |
| CL-RESUME | New session or resume a prior one? | new → erpaval-new.py; resume → read prior session-<hex>/ and continue. Runs only when CL-COMPLEXITY is multi-module / rebuild |
| CL-DIR | Empty dir · existing code · rebuild-in-place? | Empty → skip Explore, start at Research |
| CL-RIGOR | Problem crisp, or needs HMW / EARS? | Crisp → skip both; fuzzy → HMW; contract-unclear → EARS; both when needed |
| CL-SPEC | PRD / stack / concept ready? | Missing → loop through /product-discovery, /build-stack (product-discovery covers PRD drafting and design-thinking methodology) |
| CL-VALIDATE | All 3 validation layers green? | Fail → C4 back to Act |
| CL-C2 | Attempt-4 escalation in a stuck subagent? | fix-directly / respawn / missing-prereq (C3) |
| CL-LESSONS | Session produced novel learnings? | Yes → write to .erpaval/solutions/; no → skip |
See references/classifiers.md for each classifier's prompt text.
CL-RIGOR decides whether to run these substeps. Both are well-suited to subagent delegation (bounded creative task, durable file output). erpaval hard-deps on product-discovery for these substeps: the orchestrator seeds brainstorms/NNN-<slug>-requirements.md or specs/NNN-<slug>/spec.md from ${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/templates/hmw-skeleton.md / ears-spec-skeleton.md and spawns one general-purpose Task per substep that reads ${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/references/roles/hmw-framer.md (or ears-specifier.md) as its role prompt.
[P] (parallel-safe) or Dependencies: AC-X-Y. Plan derives tasks directly.Skip both when the ask names a specific user segment, an observable outcome with a metric, and no solution verbs — see ${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/references/frameworks/how-might-we.md (HMW skip test) and ${CLAUDE_PLUGIN_ROOT}/skills/product-discovery/references/frameworks/ears.md (EARS skip test).
| Phase | Purpose | Execution method | Parallelizable with |
|---|---|---|---|
| Explore | Build mental model of the codebase | 4–7 parallel Explore agents (one per perspective) | Research |
| Research | Fetch live API docs, versions, patterns | Parallel researcher agents — one per domain | Explore |
| Plan | Derive tasks from EARS spec + deps | Orchestrator + TaskCreate/TaskUpdate | None (needs E+R) |
| Act | Implement via parallel Agent calls | All wave tasks in one message, run_in_background | Per dependency graph |
| Validate | Verify correctness, quality, security | 4–8 parallel Opus dimension agents + static tools | Partially |
| Compound | Extract lessons from session | Orchestrator + compound.md procedure | None (post-merge) |
Subagent counts per phase live in references/fan-out.md. Every phase except
Plan and Compound fans out to multiple parallel Agent calls launched in one
message — current Claude models under-delegate by default, so running a
fan-out phase as a single agent (or inline in the orchestrator thread) is a bug,
not a shortcut.
Two standing rules govern every session. Both counteract failure modes the orchestrator falls into when left to its own defaults.
references/fan-out.md. The orchestrator
coordinates; the subagents do the work.resolve-library-id → query-docs) for library work, then the
search MCP fleet per ${CLAUDE_PLUGIN_ROOT}/skills/research/references/search-strategies.md.
An un-grounded version pin or API surface in CP-RESEARCH blocks Plan. See
references/orchestrator.md § Research for the mandate.CL-COMPLEXITY decides before committing to the full flow.
| Scenario | Classifier verdict |
|---|---|
| Feature touching multiple modules | multi-module → full flow |
| Bug fix in a single file | 1-file-fix → skip ERPAVal |
| Greenfield project setup | multi-module + CL-DIR=empty → skip E |
| Rip-and-replace rebuild | rebuild → full E+R + destructive Wave 1 |
| Refactoring with behavioral preservation | multi-module → full flow |
| Integrating a new dependency or API | multi-module → heavy Research phase |
| Quick script or one-off tool | 1-file-fix → skip ERPAVal |
.erpaval/ directory — two-zone layoutPlaceholder tokens (NNN, <hex>, <slug>, <domain>, T-AC-X-Y) are defined in references/glossary.md.
.erpaval/
INDEX.md committed — pointer from CLAUDE.md
solutions/ committed — dual-track lessons
<category>/ one folder per entry in
references/solution-categories.yaml
brainstorms/ committed — HMW outputs
NNN-<slug>-requirements.md
specs/ committed — EARS specs + derived tasks.md
NNN-<slug>/
spec.md
tasks.md
sessions/ gitignored — orchestrator-coupled, ephemeral
.nudged persistent ledger of session-ids already
nudged by compound_nudge.py (one line per id)
session-<hex>/
intake.yaml
recall.yaml
explore.yaml
research-<domain>.yaml
tasks/T-AC-X-Y.md
validation.yaml
lessons.yaml
session.yaml
Single .gitignore line: .erpaval/sessions/. The durables compound across team. Session state is orchestrator-coupled (subagent types, tool IDs, task schema) and a secrets surface — archive to object storage if audit is needed.
Every session starts by reading prior lessons and ends by writing new ones:
SessionStart hook (hooks/session_start_bootstrap.py) emits category counts from .erpaval/solutions/ as additionalContext. Fires once per session; no-ops for projects without .erpaval/.erpaval-recall.py per task during Plan → Act, populating each packet's Prior Lessons section via tag / module scoring.solutions/<category>/<slug>.md, updates INDEX.md, adds the CLAUDE.md pointer if missing, records sessions/<id>/lessons.yaml. The Stop hook (hooks/compound_nudge.py) fires a one-shot decision: block when all six gates hold (see Tools and hooks table); once fired, the session-id is written to .erpaval/sessions/.nudged and won't re-fire.Compound can also run ad-hoc when the user wants to force-extract lessons mid-session. See references/compound.md for the dual-track schema, scoring formula, and operating sequence.
| Skill | When to use first |
|---|---|
Product Discovery (/product-discovery) | Define what to build before planning how (PRD drafting, HMW, EARS, user stories, JTBD) |
Tech Stack Builder (/build-stack) | Select technologies for greenfield projects |
Product Strategy (/product-strategy) | Business strategy frameworks (Rumelt, Wardley, Minto, Working Backwards) |
CL-SPEC loops through these automatically if any are missing.
| Phase | Agent used |
|---|---|
| Explore | 4–7 parallel built-in Explore subagents, one per perspective |
| Research | Parallel plugin researcher agents, one per library/domain |
| Act | general-purpose subagents (haiku/sonnet/opus per task), all wave tasks in parallel |
| Validate | 4–8 parallel opus subagents, one per quality/security dimension |
| Compound | Orchestrator + compound.md procedure (invokes opus for CL-LESSONS) |
Hooks live at hooks/ and are UV-shebang Python scripts built on framework.py. All three hooks are fail-open via framework.run_hook — any uncaught exception logs to stderr and exits 0, so a broken hook cannot wedge a session.
| Hook | Event | Role |
|---|---|---|
session_start_bootstrap.py | SessionStart | Emit .erpaval/solutions/ category counts via additionalContext. Fires once per session and only when a sessions/session-<hex>/ dir was modified in the last 24h — cold repos stay silent. |
validate_packet.py | PostToolUse | Pydantic schema-check writes under .erpaval/. Early-exits on non-erpaval paths. Also drops /tmp/claude-erpaval-active-<session_id> as a cross-hook "this Claude session touched ERPAVal" marker. |
compound_nudge.py | Stop | One-shot decision: block when Compound is pending. Six gates: erpaval-active marker, session-<hex> name, fresh validation.yaml (<2h), no lessons.yaml, not nudged this session (HookState), not in .erpaval/sessions/.nudged persistent ledger. |
Imperative tools under tools/ — PEP 723 scripts invoked via uv run by the orchestrator:
| Tool | Purpose | Invoked by |
|---|---|---|
erpaval-new.py | Scaffold .erpaval/sessions/session-<hex>/ + seed intake.yaml | Orchestrator at session start |
erpaval-recall.py | Tag-scored grep over .erpaval/solutions/**.md | Orchestrator per Act task |
erpaval-validate.py | Pydantic schema check on YAML packet writes (CLI version) | Manual / CI — hook is primary |
references/classifiers.md (opens in a new tab)references/compound.md (opens in a new tab)references/context-packets.md (opens in a new tab)references/fan-out.md (opens in a new tab)references/flow.md (opens in a new tab)references/glossary.md (opens in a new tab)references/orchestrator.md (opens in a new tab)references/solution-categories.yaml (opens in a new tab)references/validation-playbook.md (opens in a new tab)references/write-protocol.md (opens in a new tab)templates/INDEX.md (opens in a new tab)templates/brainstorms/requirements.md (opens in a new tab)templates/session/explore.yaml (opens in a new tab)templates/session/intake.yaml (opens in a new tab)templates/session/lessons.yaml (opens in a new tab)templates/session/recall.yaml (opens in a new tab)templates/session/research.yaml (opens in a new tab)templates/session/session.yaml (opens in a new tab)templates/session/validation.yaml (opens in a new tab)templates/session/worklog-skeleton.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub laithalsaadoon/erpaval --plugin erpaval11 skills in this plugin
/agent-ux-patternsAgent UX patterns and human-in-the-loop design: Twilio A2H protocol, Levels of Autonomy (L0-L5), inbox pattern, progressive trust, decision journal, gate reviews, autonomous work reports. Six-phase methodology from vague pain point to concrete data model via landscape research and multi-direction brainstorming. Use when the user asks to design agent UX, pick an autonomy level, build a human-in-the-loop flow, structure an agent inbox, design approval gates, or mentions A2H, autonomy level, progressive trust, inbox pattern, approval gate, decision journal, or agentic design. Do NOT use for PRD drafting — use product-discovery. Do NOT use for frontend components — use frontend-design. Do NOT use for building agents with a specific SDK — use claude-agent-sdk, strands-sdk, langgraph-langchain, or mastra-vercel-ai.
/customer-researchCustomer research and problem framing using the research-design discipline: hypothesis, null hypothesis, MECE questions, methods, findings. Produces Pyramid-base-shaped output ready for downstream composition into PR/FAQs, long-form narratives, or PRDs. Use when the user asks to design user research, run customer interviews, synthesize research findings, frame a problem statement, build a customer journey map, plan a VoC study, or mentions pain-point analysis, research plan, hypothesis testing, customer insights, jobs-to-be-done, or voice of customer.
/meta-prompt-optimizerAudit and rewrite prompts against Claude Opus 4.7 instruction-following best practices. Produces a scored audit plus a rewritten prompt. Use when the user asks to audit, review, critique, rewrite, improve, optimize, tighten, score, fix, migrate, or draft a prompt — including system prompts, CLAUDE.md files, Claude Code agent definitions, slash commands, SKILL.md files, Jinja2 prompt templates, or tool/parameter descriptions in Pydantic v2 or Zod schemas. Trigger on phrases like "is this prompt any good", "why isn't Claude following this", "why isn't my agent triggering", "my CLAUDE.md is being ignored", "rewrite this for Opus 4.7", "cache hit rate is low on my prompt", "the model keeps picking the wrong tool", or on pasted prompt text asking for feedback. Also trigger on mentions of prompt engineering, prompt best practices, or instruction-following problems. Use this skill whenever the task involves editing, reviewing, or writing the text of a prompt — even if the user doesn't say "prompt".
/product-design-sharedShared canonical references for product-design frameworks — Pyramid Principle, Working Backwards, Double Diamond, research design, methodology selection. Consumed by `product-discovery`, `product-strategy`, `working-backwards`, and `customer-research` via `${CLAUDE_PLUGIN_ROOT}/skills/product-design-shared/references/`. Do NOT invoke this skill directly — it has no orchestrator and no templates. Load the upstream skill that owns your task (`product-discovery` for PRD / HMW / EARS, `product-strategy` for Rumelt / Wardley / Minto, etc.) and let it pull from this pool as needed.
/product-discoveryFile-first orchestrator for product discovery and spec frameworks. Frames the problem with a Discovery Lead / Product Analyst / System Architect role, spawns parallel framework agents (Double Diamond, How Might We, Jobs to Be Done, user stories + INVEST, EARS for AI-coder specs, Gherkin), synthesizes into a PRD or discovery memo, runs a critic pass. Absorbs prd-drafter (idea to PRD via 3 parallel research roles) and design-thinking (pain-point excavation, landscape research, brainstorm). Ships per-framework references, role prompts, templates for PRDs, HMW outputs, job stories, EARS specs. Use when the user asks to write a PRD, draft requirements, run discovery, brainstorm a product, turn insights into HMW questions, write job stories, spec a feature in EARS for Kiro or Spec Kit, define user stories with INVEST, run a Double Diamond round, or mentions JTBD, acceptance criteria, Kiro spec format. Do NOT use for business strategy (Rumelt, Wardley, PR-FAQ as leadership artifact) — use product-strategy.
/product-strategyFile-first orchestrator for business and product strategy frameworks. Frames the challenge with a CPO / CSO / VP Design role, spawns parallel framework agents (Rumelt kernel + Crux, Wardley Maps, Minto Pyramid as thinking structure, Working Backwards PR-FAQ as discovery artifact), synthesizes outputs into one strategy memo, runs a critic pass. Ships per-framework references, leadership role prompts, templates for strategy memos, PR-FAQs, Wardley maps, Minto arguments. Use when the user asks to do strategy work, run a Rumelt kernel, build a Wardley map, decide build-vs-buy, articulate the crux of a challenge, draft a PR-FAQ as discovery, write an executive strategy memo, structure an argument with Minto Pyramid, think from the CPO / CSO / VP Design perspective, or mentions Good Strategy Bad Strategy, The Crux, Rumelt, Simon Wardley, SCQA, or strategy thesis. Do NOT use for PRDs or HMW framing — use product-discovery.
Other plugins' skills for the same job