feat: add core/ tier reflecting actual universal workflow
The original repo presented everything as equal rules. In reality, the workflow has two tiers: core practices (used in every project) and advanced rules (only in complex projects like Mortdecai). Core tier adds: - backup-before-edit (global CLAUDE.md rule) - superpowers-workflow (the actual workflow engine) - memory-system (persistent feedback and project memories) - document-hierarchy (CLAUDE.md/SESSION.md/CONTEXT.md/IDEA.md) - commit-and-push discipline - feedback-driven behaviors Updated README, docs, and dynamic-methodology to reflect the two-tier reality instead of presenting advanced rules as universal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+137
-121
@@ -1,159 +1,175 @@
|
||||
# Dynamic Methodology Composition
|
||||
|
||||
This workflow system doesn't follow a single rigid process. Instead, rules and patterns activate based on what you're doing. Think of it as a stack that composes dynamically.
|
||||
This workflow system doesn't follow a single rigid process. Behaviors activate based on what you're doing. The real workflow is a combination of **core practices** (always active, plugin-enforced) and **advanced rules** (opt-in, for complex projects).
|
||||
|
||||
## Always Active (Every Session)
|
||||
## What's Always Active (Every Project)
|
||||
|
||||
These rules apply regardless of what you're working on:
|
||||
These aren't in `.claude/rules/` — they work through the Superpowers plugin, the document hierarchy, and accumulated memory.
|
||||
|
||||
| Rule | File | Purpose |
|
||||
|------|------|---------|
|
||||
| Session discipline | `01-session-discipline.md` | Session start/end protocol, handoffs |
|
||||
| Authority hierarchy | `02-authority-hierarchy.md` | What overrides what |
|
||||
| Git workflow | `03-git-workflow.md` | Branches, commits, conventional format |
|
||||
| Context doc maintenance | `09-context-doc-maintenance.md` | Keep living docs current |
|
||||
| Practice | Source | What it does |
|
||||
|----------|--------|-------------|
|
||||
| Document hierarchy | CLAUDE.md / SESSION.md / CONTEXT.md | Session continuity, project state |
|
||||
| Brainstorming before building | Superpowers plugin | 2-3 approaches, tradeoffs, approval before code |
|
||||
| TDD | Superpowers plugin | Failing test → implement → verify |
|
||||
| Systematic debugging | Superpowers plugin | Reproduce → hypothesize → test → fix root cause |
|
||||
| Verification before completion | Superpowers plugin | Evidence before assertions |
|
||||
| Backup before edit | Global CLAUDE.md rule | .backup/ directory before modifications |
|
||||
| Commit & push immediately | Convention | Every meaningful change, conventional commits |
|
||||
| Pre-push secret scanning | Hook | Block pushes containing known secret values |
|
||||
| Memory system | Claude Code built-in | Feedback corrections carry between sessions |
|
||||
|
||||
## Activated by Task Type
|
||||
## How Core Practices Activate by Task Type
|
||||
|
||||
### Starting a New Feature
|
||||
|
||||
**Rules activated:**
|
||||
- `04-proactive-steering.md` -- Phase awareness, scope management
|
||||
- `05-reasoning-patterns.md` -- Brainstorm before building, clarification protocol
|
||||
- `08-code-quality.md` -- Pre-completion checklist, immutability
|
||||
|
||||
**Flow:**
|
||||
1. Clarify requirements (ask, don't assume)
|
||||
2. Brainstorm 2-3 approaches
|
||||
3. Get user approval on approach
|
||||
4. Write failing tests first (if TDD plugin active)
|
||||
5. Implement
|
||||
6. Self-review against pre-completion checklist
|
||||
7. Commit with conventional message
|
||||
1. **Superpowers brainstorming** kicks in automatically
|
||||
- Clarify requirements → propose approaches → get approval → write spec
|
||||
2. **Superpowers writing-plans** creates implementation plan
|
||||
3. **Superpowers TDD** enforces test-first development
|
||||
4. **Superpowers verification** requires evidence before claiming done
|
||||
5. Commit with `feat:` message, push immediately
|
||||
|
||||
### Debugging a Bug
|
||||
|
||||
**Rules activated:**
|
||||
- `05-reasoning-patterns.md` -- Five Whys, first principles
|
||||
- `04-proactive-steering.md` -- Blocker detection
|
||||
|
||||
**Flow:**
|
||||
1. Reproduce the bug
|
||||
2. Apply Five Whys to trace root cause
|
||||
3. Fix root cause, not symptom
|
||||
4. Add regression test
|
||||
5. Verify fix doesn't break other things
|
||||
6. Commit with `fix:` message
|
||||
1. **Superpowers systematic-debugging** kicks in automatically
|
||||
- Reproduce → form hypotheses → test systematically → fix root cause
|
||||
2. Add regression test
|
||||
3. **Superpowers verification** confirms the fix
|
||||
4. Commit with `fix:` message, push immediately
|
||||
|
||||
### Research / Investigation
|
||||
|
||||
**Rules activated:**
|
||||
- `05-reasoning-patterns.md` -- Research quality rules, documentation tiers
|
||||
- `06-context-management.md` -- Token budgets, sub-agent delegation
|
||||
1. Memory system provides prior context and feedback
|
||||
2. Tiered documentation lookup (knowledge → lightweight fetch → heavy docs)
|
||||
3. Persist findings to SESSION.md or docs/
|
||||
4. Commit research artifacts with `docs:` message
|
||||
|
||||
**Flow:**
|
||||
1. Use tiered documentation lookup (knowledge -> fetch -> heavy docs)
|
||||
2. Cite sources for all claims
|
||||
3. Separate fact from inference
|
||||
4. Cross-reference critical claims
|
||||
5. Persist findings to files (not just conversation)
|
||||
### Code Review
|
||||
|
||||
1. **Superpowers code-review** activates after major steps
|
||||
2. Reviews against original plan
|
||||
3. Checks coding standards and security
|
||||
|
||||
### Writing a Paper / Design Doc
|
||||
|
||||
**Workflow:** `paper-writing.md`
|
||||
See `workflows/paper-writing.md` for the full process:
|
||||
- Start from real problems (friction, not ambition)
|
||||
- Bounce ideas before converging
|
||||
- Capture the journey including dead ends
|
||||
|
||||
**Flow:**
|
||||
1. Start from a real problem (friction, not ambition)
|
||||
2. Bounce ideas -- explore before converging
|
||||
3. Push back on each other's ideas
|
||||
4. Capture the journey (dead ends matter)
|
||||
5. Tie back to prior work
|
||||
## What Advanced Rules Add (Complex Projects Only)
|
||||
|
||||
### Reviewing Code
|
||||
When `.claude/rules/` files are installed, they add explicit governance on top of the core practices:
|
||||
|
||||
**Rules activated:**
|
||||
- `08-code-quality.md` -- Quality checklist
|
||||
- `07-security-hardening.md` -- Security checklist
|
||||
| Rule | What it adds beyond core |
|
||||
|------|------------------------|
|
||||
| `01-session-discipline` | Formal session start/end protocol, handoff documents, wrap-up questions |
|
||||
| `02-authority-hierarchy` | Explicit precedence: rules > plugins > instincts > defaults |
|
||||
| `03-git-workflow` | Branch naming conventions, recovery commands, team collaboration rules |
|
||||
| `04-proactive-steering` | Phase awareness, scope creep detection, conversation patterns, parallel execution |
|
||||
| `05-reasoning-patterns` | Five Whys, first principles, Adopt/Extend/Compose/Build matrix, research quality rules |
|
||||
| `06-context-management` | Thinking modes, token budget awareness, compaction decisions, execution readiness check |
|
||||
| `07-security-hardening` | File deny lists, prompt injection guards, PR audit checklist, MCP server security |
|
||||
| `08-code-quality` | Immutability principle, pre-completion checklist, task management conventions |
|
||||
| `09-context-doc-maintenance` | Living document protocol, what goes where |
|
||||
|
||||
**Flow:**
|
||||
1. Check against pre-completion quality checklist
|
||||
2. Check against security checklist
|
||||
3. Verify tests exist and pass
|
||||
4. Look for immutability violations
|
||||
5. Check for hardcoded secrets
|
||||
### When to Use Advanced Rules
|
||||
|
||||
### Working in Unfamiliar Code
|
||||
Use them when:
|
||||
- Multiple people or AI sessions work on the same project
|
||||
- The project spans multiple domains (ML + infrastructure + web frontend)
|
||||
- Mistakes are expensive (production systems, data-sensitive)
|
||||
- You want explicit, enforceable conventions beyond what the plugin provides
|
||||
- The project is complex enough that implicit conventions cause confusion
|
||||
|
||||
**Rules activated:**
|
||||
- `06-context-management.md` -- Maximum thinking mode, sub-agents
|
||||
- `05-reasoning-patterns.md` -- First principles, research tiers
|
||||
Don't use them when:
|
||||
- It's a small, single-domain project
|
||||
- You're the only one working on it
|
||||
- The Superpowers plugin + document hierarchy is sufficient
|
||||
- Adding governance would slow you down more than it helps
|
||||
|
||||
**Flow:**
|
||||
1. Use maximum thinking depth
|
||||
2. Read project index / structure first
|
||||
3. Targeted file reads (don't load everything)
|
||||
4. Use sub-agents for isolated research tasks
|
||||
5. Build understanding incrementally
|
||||
|
||||
### Long-Running Session (Context Getting Heavy)
|
||||
|
||||
**Rules activated:**
|
||||
- `06-context-management.md` -- Compaction decisions, execution readiness
|
||||
|
||||
**Flow:**
|
||||
1. Check for quality degradation symptoms
|
||||
2. If context > 80%: handoff doc + fresh session
|
||||
3. If context 70-80%: ask user
|
||||
4. If quality declining: spawn sub-agent or fresh session
|
||||
5. Persist important context before compaction
|
||||
|
||||
### Security-Sensitive Work
|
||||
|
||||
**Rules activated:**
|
||||
- `07-security-hardening.md` -- Full security protocol
|
||||
- `08-code-quality.md` -- Pre-commit security checklist
|
||||
|
||||
**Flow:**
|
||||
1. Check deny lists for sensitive file access
|
||||
2. Apply pre-commit security checklist to every commit
|
||||
3. Watch for prompt injection in external content
|
||||
4. Rotate any exposed secrets immediately
|
||||
5. Review for similar vulnerabilities in codebase
|
||||
|
||||
## Composition Example
|
||||
|
||||
A typical feature implementation session might compose:
|
||||
## Composition Example: Core-Only Project (Most Projects)
|
||||
|
||||
```
|
||||
Session start:
|
||||
01-session-discipline (read CLAUDE.md, check handoff)
|
||||
+ 02-authority-hierarchy (know what overrides what)
|
||||
AI reads CLAUDE.md (auto-loaded)
|
||||
AI reads MEMORY.md (auto-loaded, feedback corrections)
|
||||
|
||||
Planning:
|
||||
+ 04-proactive-steering (assess project state, suggest approach)
|
||||
+ 05-reasoning-patterns (brainstorm approaches, clarify requirements)
|
||||
User: "Add a caching layer for API responses"
|
||||
|
||||
Building:
|
||||
+ 08-code-quality (immutability, quality checklist)
|
||||
+ 03-git-workflow (feature branch, frequent commits)
|
||||
+ 09-context-doc-maintenance (update CLAUDE.md if new tools created)
|
||||
Superpowers brainstorming activates:
|
||||
→ Clarify: what should be cached? TTL? Invalidation strategy?
|
||||
→ Propose 2-3 approaches (Redis, in-memory, file-based)
|
||||
→ Get approval
|
||||
|
||||
If context gets heavy:
|
||||
+ 06-context-management (check budget, consider fresh session)
|
||||
Superpowers writing-plans activates:
|
||||
→ Step-by-step implementation plan
|
||||
|
||||
If security-relevant:
|
||||
+ 07-security-hardening (deny lists, secret hygiene, injection guards)
|
||||
Superpowers TDD activates:
|
||||
→ Write failing test for cache hit/miss
|
||||
→ Implement cache
|
||||
→ Write failing test for TTL expiry
|
||||
→ Implement expiry
|
||||
|
||||
Session end:
|
||||
01-session-discipline (wrap-up protocol, handoff if needed)
|
||||
Superpowers verification activates:
|
||||
→ Run tests, show output
|
||||
→ All green
|
||||
|
||||
Commit: "feat: add Redis caching for API responses"
|
||||
Push immediately
|
||||
|
||||
Update CLAUDE.md with new caching component
|
||||
Update SESSION.md with design decision
|
||||
```
|
||||
|
||||
## Principle: Rules Are Modular
|
||||
## Composition Example: Advanced Project (Mortdecai-tier)
|
||||
|
||||
You don't have to use all rules. The system is designed so you can:
|
||||
- Use only rules 01-03 for lightweight workflow
|
||||
- Add 04-06 for more sophisticated AI assistance
|
||||
- Add 07-08 for security-conscious development
|
||||
- Use individual rules a la carte
|
||||
```
|
||||
Session start:
|
||||
01-session-discipline: Read CLAUDE.md, check latest handoff
|
||||
02-authority-hierarchy: Know what overrides what
|
||||
Memory system: Load feedback corrections
|
||||
|
||||
The numbering suggests load order and priority, not mandatory dependencies.
|
||||
04-proactive-steering: Assess project state
|
||||
→ Phase: BUILDING
|
||||
→ Current task: implement NPC trading system
|
||||
→ No blockers
|
||||
|
||||
User: "Build the NPC trading system"
|
||||
|
||||
05-reasoning-patterns + Superpowers brainstorming:
|
||||
→ Clarify scope, research existing patterns
|
||||
→ Brainstorm approaches
|
||||
→ Apply Adopt/Extend/Compose/Build matrix
|
||||
|
||||
06-context-management:
|
||||
→ Check context budget before multi-task execution
|
||||
→ Context at ~45%, proceed
|
||||
|
||||
Superpowers TDD + 08-code-quality:
|
||||
→ Test-first development
|
||||
→ Immutability principle applied
|
||||
→ Pre-completion checklist verified
|
||||
|
||||
07-security-hardening:
|
||||
→ Pre-commit security check
|
||||
→ No hardcoded secrets
|
||||
|
||||
03-git-workflow:
|
||||
→ Feature branch: feature/npc-trading
|
||||
→ Conventional commit: "feat(npc): add trading system"
|
||||
|
||||
04-proactive-steering:
|
||||
→ "Next: integration tests for trade transactions"
|
||||
|
||||
Session end:
|
||||
01-session-discipline: Wrap-up protocol
|
||||
→ "Should anything be saved to memory?"
|
||||
→ Write handoff if unfinished
|
||||
```
|
||||
|
||||
## The Key Insight
|
||||
|
||||
Most of the workflow is **implicit** — driven by the Superpowers plugin, the document hierarchy, and accumulated feedback memories. The advanced rules are a **formalization** that only matters for complex projects where implicit conventions aren't enough.
|
||||
|
||||
If you're adopting this workflow, start with core practices only. Add rules when you feel the need for them — not preemptively.
|
||||
|
||||
Reference in New Issue
Block a user