Disciplined engineering workflow for Claude Code: consistent exploration, planning, implementation, verification, and guardrails against drift.
# Add the marketplace
claude plugin marketplace add shintaii/claude-powermode
# Install the plugin
claude plugin install powermode@claude-powermode
# Verify
claude plugin list | grep powermodeclaude plugin update powermode@claude-powermode| I have... | I want... | Use |
|---|---|---|
| An idea/goal | A detailed plan + PRD files | /pm-plan add user authentication |
| An existing document (spec, issue, PRD) | Split into implementable PRDs | /pm-plan @path/to/doc.md |
| An existing project folder | See structure and next steps | /pm-plan @.powermode/projects/my-project/ |
| A project/feature ready to implement | Implementation (auto-detects team mode) | /powermode @.powermode/projects/my-project/ |
| Started work, want methodology | Enable powermode workflow | /powermode |
| Doubt about current progress | Check alignment with plan | /pm-checkpoint |
| Want project dashboard | See status of all features/tasks | /pm-status |
| Need to re-verify recent changes | Manual verification run | /pm-review |
| Want a second opinion on code | Codex (GPT-5.4) code review | /pm-codex-review |
Enables the disciplined explore → plan → implement → verify → simplify workflow. Lists available agents and enables all guardrails.
/powermode
> Now help me refactor the auth module
Can also resume a project directly: /powermode my-project-slug
Auto-detects input type and acts accordingly:
| Input | Mode | Example |
|---|---|---|
| Plain text goal | Plans from scratch | /pm-plan add user authentication |
@ document reference |
Transforms doc into PRDs | /pm-plan @docs/payment-spec.md |
@ folder reference |
Shows existing structure | /pm-plan @.powermode/projects/auth/ |
Workflow: Analyser → Powerplanner → Planreviewer (max 3 review iterations) → PRD files written to .powermode/projects/.
Compares current state to the plan. Identifies drift or missed steps.
Shows status of all projects, features, and tasks with completion percentages. Detects drift between status.json and feature READMEs.
Runs pm-verifier on recent changes. Use when verification was skipped, after manual fixes, or to re-check work.
Copies all project markdown files to a user-specified folder, preserving structure.
Lists open issues tracked in project issues.md files. Can convert issues to new task PRDs.
Runs OpenAI's Codex CLI (GPT-5.4) as an independent reviewer, then optionally feeds findings to pm-implementer.
| Usage | What it reviews |
|---|---|
/pm-codex-review |
All uncommitted changes |
/pm-codex-review staged |
Only staged changes |
/pm-codex-review pr |
Current branch's PR |
/pm-codex-review pr 42 |
PR #42 |
/pm-codex-review commit abc123 |
Specific commit (any git ref) |
/pm-codex-review branch |
All commits since main |
/pm-codex-review branch develop |
All commits since develop |
/pm-codex-review src/foo.py |
Specific files |
Flags: --model <model>, --effort <level>. Free-text after the mode is treated as additional review instructions.
Requires Codex CLI (npm install -g @openai/codex).
Comprehensive UI/UX review, audit, and implementation using the powermode workflow. Reviews existing interfaces or builds new ones.
| Agent | Model | Purpose |
|---|---|---|
| pm-explorer | Haiku | Fast codebase search, finding files and patterns |
| pm-researcher | Sonnet | External docs, library research, OSS examples |
| pm-analyser | Opus | Pre-planning gap analysis, hidden requirements |
| pm-powerplanner | Opus | Strategic planning, comprehensive work plans |
| pm-planreviewer | Sonnet | Plan review, iterates until quality bar met |
| pm-oracle | Opus | Architecture decisions, deep reasoning, stuck debugging |
| pm-implementer | Opus | Focused code implementation (auto-commits per task) |
| pm-verifier | Sonnet | Quality verification with evidence |
| pm-uat-runner | Sonnet | UAT via Playwright MCP — browser-based user journey tests |
Every task follows this strict sequence (steps c-e are hook-enforced):
a. EXPLORE with pm-explorer (if needed)
b. IMPLEMENT with pm-implementer → auto-commits, returns agentId
c. VERIFY with pm-verifier — MANDATORY, enforced by hook
d. If FAIL → resume implementer via SendMessage(to=agentId) → re-verify (max 3 attempts)
e. CODEX SECOND-OPINION → /pm-codex-review on changes (skipped if codex not installed)
f. After verification → /simplify for code quality polish
g. Move to next task
Verification is hook-enforced: starting a new pm-implementer without running pm-verifier first is automatically BLOCKED. SendMessage resume calls (fix cycles) bypass this check since they use a different tool.
After 3 consecutive verification failures: stop → revert → consult pm-oracle → ask user.
The planner classifies each task as needing tests or not. Cleanup, config, and docs tasks skip the test-writer step automatically.
For feature and project scopes, planning generates UAT_SCENARIOS.md with browser-based user journey tests. After all tasks pass verification, pm-uat-runner executes scenarios via Playwright MCP with a fix-and-retry loop. Task-scoped work skips UAT.
Powermode uses hierarchical planning: Project → Feature → Task.
.powermode/projects/
├── index.json # Master index of all projects
└── my-project/
├── project.md # Scope, goals, high-level requirements
├── status.json # Machine-readable state (features, tasks, completion)
├── decisions.md # Decision log (append-only)
├── issues.md # Issues/gaps tracker
└── features/
├── 01-auth/
│ ├── README.md # Feature index with dependency table
│ ├── 01-database-schema.md # Task PRD
│ ├── 02-api-endpoints.md # Task PRD (depends on 01)
│ ├── 03-frontend-ui.md # Task PRD (depends on 02)
│ └── NOTES.md # Implementation discoveries
└── 02-payments/
├── README.md
└── 01-stripe-setup.md
- Features are numbered for implementation order
- Each task PRD contains scope, requirements, acceptance criteria, test focus, and dependencies
status.jsontracks completion state per feature and task- Runtime files (
.powermode/*.json) are gitignored; project files are committed
1. /pm-plan add payment processing
2. Review generated PRDs in .powermode/projects/payments/
3. /powermode @.powermode/projects/payments/
4. (automatic) implement → verify → simplify per task, auto-commits
1. /pm-plan @docs/payment-spec.md
2. Review generated PRDs
3. /powermode @.powermode/projects/payments/
1. /powermode
2. "Fix the null pointer in auth.py line 42"
3. (uses pm-explorer → pm-implementer → pm-verifier → /simplify)
1. /powermode my-project-slug
2. (picks up from last completed task)
These run automatically — you don't invoke them:
| Hook | What It Does |
|---|---|
| Stop validator | Blocks exit if todos incomplete (escape hatch after 3 attempts) |
| PRD enforcement | Blocks exit if referenced PRD wasn't updated |
| Verification tracker | Clears pending-verification flag when pm-verifier finishes |
| Context monitor | Tracks token usage, warns at 70% |
| Session recovery | Saves/restores state across compaction |
| CLAUDE.md enforcer | Reminds of project rules on each prompt |
| Delegation enforcer | Blocks direct Edit/Write in Power Mode (must use pm-implementer) |
| Task containment | Injects scope constraints into subagent prompts; blocks new implementer if verification pending |
| Implementer lifecycle | Manages implementer sessions via SubagentStart/Stop; sets verification-pending flag |
| Subagent context | Injects role reminders when any pm-* agent spawns |
| PRD index injector | Auto-injects PRD structure when @ references are used |
| Keyword detector | Detects powermode-related keywords and activates workflow |
| Failure accountability | Forces investigation of test/build failures — prevents dismissing as "pre-existing" |
| Post-compact reset | Resets context-state.json after compaction to avoid stale token warnings |
| Task completion guard | Blocks task completion if uncommitted changes or TODO/stub patterns remain |
| Teammate idle guard | Forces teammates with uncommitted changes to commit before going idle |
- Context tracking writes
.powermode/context-state.jsonin the current workspace - Stop hook reads the session transcript and blocks stop if todos are pending/in_progress
- Escape hatch auto-approves after 3 consecutive stop attempts with a warning
- Session recovery stores
.powermode/recovery.jsonon SessionEnd/PreCompact and restores on SessionStart - PRD enforcement blocks stop when referenced PRDs were not updated
- Verification enforcement blocks new pm-implementer calls until pm-verifier has run
- Auto-commit implementer commits after each task PRD completion (local only, no push)
- Post-verify polish
/simplifyis called by the orchestrator after verification completes — any verdict (PASS, or after PASS WITH NOTES/FAIL fix cycles). 3 parallel review agents: code reuse, quality, efficiency - Agent-aware hooks hooks check
agent_typeto distinguish subagent vs orchestrator — subagents (powermode:*) bypass stop/todo checks - Context limits optimized for Opus 4.6 1M context window (warns at 500K tokens)
# Stop hook
echo '{"cwd":"/tmp","transcript_path":"/path/to/session.jsonl"}' | python3 hooks/stop-validator.py
# Context monitor
echo '{"session_id":"test","cwd":"/tmp","tool_name":"Bash","tool_input":{},"tool_response":{}}' | python3 hooks/context-monitor.py
# Task containment
echo '{"tool_name":"Task","tool_input":{"prompt":"test","subagent_type":"pm-implementer"},"cwd":"/tmp","session_id":"test"}' | python3 hooks/task-containment-enforcer.py
# Verification tracker
echo '{"hook_event_name":"SubagentStop","agent_type":"powermode:pm-verifier","cwd":"/tmp"}' | python3 hooks/verification-tracker.py- Cause: invalid schema in PostToolUse output
- Fix: ensure
hookSpecificOutputuses correct event name
- Cause: wrong transcript parsing
- Fix:
stop-validator.pymust readtoolUseResult.newTodosfrom JSONL transcripts
- Cause:
plugin.jsonincludes"hooks": "./hooks/hooks.json" - Fix: remove that key — hooks auto-load from
hooks/hooks.json
Claude Code auto-loads hooks/hooks.json. Do NOT reference it in plugin.json or you will get:
Hook load failed: Duplicate hooks file detected
Heavily inspired by oh-my-opencode — thank you for the foundational ideas.
MIT — see LICENSE