agentleFS
Pixel-Process-UGPixel-Process-UG/superkit-agents/templates/CLAUDE.md

superkit-agents / templates

CLAUDE.md2 starsChanged 9 months agoMITView on GitHub

See using-toolkit skill for identity, hard-gates, workflow state machines, and full command reference. Core (6): using-toolkit, self-learning /learn, resilient-execution, circuit-breaker, auto-improvement, verification-before-completion /verify Process (9): planning /plan, brainstorming /brainstorm, task-management, executing-plans /execute, subagent-driven-development, dispatching-parallel-agents, autonomous-loop /ralph /loop, ralph-status, task-decomposition /decompose QA (17): code-review /review, test-driven-development /tdd, testing-strategy, systematic-debugging /debug, security-review, performance-optimization, acceptance-testing, llm-as-judge, senior-frontend /frontend, senior-backend /backend, senior-architect /architect, senior-fullstack /fullstack, clean-code /clean, react-best-practices, webapp-testing, senior-prompt-engineer, senior-data-scientist Docs (5): prd-generation /prd, tech-docs-generator /docs, writing-skills, spec-writing /specs, reverse-engineering-specs Design (3): api-design,…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

21 rules. About 0 are common, 17 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Rigid skills: Follow exactly. Flexible skills: Adapt to context.

    line 33
  2. Distinctive:

    [HARD-GATE:STATUS]: Every loop iteration ends with:

    line 112
  3. Distinctive:

    All three must be satisfied for a release.

    line 195
  4. Distinctive:

    Document actual behavior (bugs = "documented features")

    line 203
  5. Distinctive:

    Run completeness checklist (all entry points, branches, errors documented)

    line 204
  6. Distinctive:

    RED: Write a failing test that defines desired behavior

    line 236
  7. Distinctive:

    GREEN: Write minimal code to make test pass

    line 237
  8. Distinctive:

    [HARD-GATE:TDD]: No production code without a failing test first.

    line 240
  9. Distinctive:

    Remove patterns that no longer match the codebase

    line 292
  10. Distinctive:

    Update tech stack info when dependencies change

    line 293
  11. Very specific:

    Before any destructive operation (rm, git clean, git checkout .):

    line 330
  12. Distinctive:

    Check if operation targets protected files

    line 332
  13. Distinctive:

    If yes: ABORT and report

    line 333
  14. Distinctive:

    If no: Proceed with caution

    line 334
  15. Distinctive:

    After operation: Verify protected files still exist

    line 335
  16. Very specific:

    All subagent dispatch uses the Agent tool.

    line 343
  17. Very specific:

    When parallel Agent tool calls return:

    line 388
  18. Distinctive:

    Check for conflicts or contradictions

    line 391
  19. Very specific:

    Use finishing-a-development-branch skill for structured options:

    line 426
  20. Distinctive:

    Always: use conventional commit format

    line 437
  21. Distinctive:

    When toolkit skills don't cover a specific need:

    line 472

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

@pixelandprocess/superkit-agents — Agent Operating Manual

See using-toolkit skill for identity, hard-gates, workflow state machines, and full command reference.


§4 SKILL CATALOG (64 Skills)

Core (6): using-toolkit, self-learning /learn, resilient-execution, circuit-breaker, auto-improvement, verification-before-completion /verify

Process (9): planning /plan, brainstorming /brainstorm, task-management, executing-plans /execute, subagent-driven-development, dispatching-parallel-agents, autonomous-loop /ralph /loop, ralph-status, task-decomposition /decompose

QA (17): code-review /review, test-driven-development /tdd, testing-strategy, systematic-debugging /debug, security-review, performance-optimization, acceptance-testing, llm-as-judge, senior-frontend /frontend, senior-backend /backend, senior-architect /architect, senior-fullstack /fullstack, clean-code /clean, react-best-practices, webapp-testing, senior-prompt-engineer, senior-data-scientist

Docs (5): prd-generation /prd, tech-docs-generator /docs, writing-skills, spec-writing /specs, reverse-engineering-specs

Design (3): api-design, frontend-ui-design, database-schema-design

Ops (7): deployment, using-git-worktrees /worktree, finishing-a-development-branch, git-commit-helper /commit, senior-devops /devops, mcp-builder /mcp, agent-development /agent

Creative (6): ui-ux-pro-max /ui-ux, ui-design-system /design-system, canvas-design, mobile-design /mobile, ux-researcher-designer, artifacts-builder

Business (3): seo-optimizer /seo, content-research-writer, content-creator

Doc Processing (3): docx-processing, pdf-processing, xlsx-processing

Productivity (1): file-organizer

Communication (1): email-composer /email

Frameworks (3): laravel-specialist /laravel, php-specialist /php, laravel-boost

Rigid skills: Follow exactly. Flexible skills: Adapt to context.


§5 AGENT DISPATCH TABLE (20 Agents)

AgentPurposeWhen to DispatchExpected Output
plannerCreate implementation plansBefore any multi-step feature workPrioritized task list with file paths and TDD steps
code-reviewerReview code qualityAfter task completion, before mergeCategorized issues (Critical/Important/Suggestions) with fixes
prd-writerGenerate PRDsWhen product requirements need documentationStructured PRD with user stories, requirements (P0/P1/P2)
doc-generatorGenerate technical docsWhen code needs documentationAPI references, architecture overviews, getting-started guides
spec-reviewerVerify spec complianceAfter implementation, before reviewCompliance report with gaps and violations
quality-reviewerAssess code qualityDuring review phaseQuality assessment covering patterns, performance, security
loop-orchestratorManage autonomous loopsDuring Ralph-style iterative developmentRALPH_STATUS blocks, task selection, exit evaluation
spec-writerWrite specificationsWhen features need behavioral specsJTBD specs with Given/When/Then acceptance criteria
acceptance-judgeEvaluate subjective qualityWhen objective tests aren't sufficientScored rubric with pass/fail and improvement suggestions
frontend-developerThree-phase frontend dev with context discoveryFrontend feature workComponent code with tests
ui-ux-designerDesign system generation, component specsDesign system creationStyle guides, component specs
backend-architectService boundaries, contract-first APIService architectureAPI contracts, scaling plan
context-managerProject context tracking, dependency mappingContext discoveryDependency map, tech stack summary
database-architectMulti-DB strategy, event sourcingDatabase designSchema, migrations, indexes
architect-reviewerArchitecture review, tech debt assessmentArchitecture decisionsADR, scalability assessment
typescript-proAdvanced type patterns, branded typesTypeScript type designType definitions, utility types
task-decomposerHierarchical task breakdownTask planningTask tree, dependency graph
mobile-developerCross-platform mobile patternsMobile developmentPlatform-specific code
laravel-developerLaravel specialist with Eloquent, Blade, Livewire, PestLaravel project workLaravel-specific code
php-developerModern PHP 8.x with PSR compliance, static analysisPHP project workPHP-specific code

§6 COMMAND REFERENCE

See using-toolkit skill for full command list (31 commands).


§7 RALPH AUTONOMOUS LOOP PROTOCOL

Architecture

The Ralph loop is an iterative development cycle inspired by Geoffrey Huntley's technique. Each iteration loads identical context, executes one focused task, and persists state to disk.

"ONE Task Per Loop" Principle

Each iteration selects and completes exactly ONE task from IMPLEMENTATION_PLAN.md. This reduces context switching and enables clear progress measurement.

Context Efficiency

ResourceBudgetStrategy
Main context window40-60% utilizationThe "smart zone" — enough room to think
Read subagentsUp to 500 parallelVia Agent tool with subagent_type="Explore"
Build subagents1 at a timeVia Agent tool with subagent_type="general-purpose"
Token formatPrefer Markdown~30% more efficient than JSON

Steering Mechanisms

Upstream Steering (shaping inputs):

  • Detailed specs loaded first (~5,000 tokens)
  • Identical PROMPT + AGENTS files each iteration
  • Existing code patterns guide new generation

Downstream Steering (validation gates):

  • Tests → reject invalid implementations
  • Builds → catch compilation errors
  • Linters → enforce style consistency
  • Typecheckers → verify contracts
  • LLM-as-judge → evaluate subjective criteria

RALPH_STATUS Block

[HARD-GATE:STATUS] Every loop iteration ends with:

---RALPH_STATUS---
STATUS: [IN_PROGRESS | COMPLETE | BLOCKED]
TASKS_COMPLETED_THIS_LOOP: [number]
FILES_MODIFIED: [number]
TESTS_STATUS: [PASSING | FAILING | NOT_RUN]
WORK_TYPE: [IMPLEMENTATION | TESTING | DOCUMENTATION | REFACTORING]
EXIT_SIGNAL: [false | true]
RECOMMENDATION: [one-line next action or completion summary]
---END_RALPH_STATUS---

Dual-Condition Exit Gate

[HARD-GATE:EXIT] Both must be true to exit:

  1. Completion indicators — "done" language appears >= 2 times in recent output
  2. Explicit EXIT_SIGNAL — EXIT_SIGNAL: true in status block

EXIT_SIGNAL is true ONLY when: no remaining tasks, all tests pass, no errors, no meaningful work left.

Circuit Breaker Thresholds

ConditionThresholdAction
No progress3 consecutive loops, 0 tasks completedOPEN circuit
Identical errors5 consecutive identical errorsOPEN circuit
Output decline70% decline in output volumeOPEN circuit
Cooldown30 minutesBefore retry after OPEN

File Protection

[HARD-GATE:PROTECT] These paths must NEVER be deleted during autonomous operations:

  • .ralph/, .ralphrc, IMPLEMENTATION_PLAN.md, AGENTS.md
  • .claude/, CLAUDE.md, specs/

§8 SPECIFICATION METHODOLOGY

JTBD → Topics → Specs → Story Map

  1. Identify Jobs: "When [situation], I want to [motivation], so I can [outcome]."
  2. Break into Topics: Apply "One Sentence Without 'And'" test
  3. Write Specs: Given/When/Then acceptance criteria, no implementation details
  4. Organize: Story map with capabilities × release slices

The Cardinal Rule

[HARD-GATE:SPEC] Specs must NEVER contain implementation details:

ForbiddenAllowed
Code blocks, function namesBehavioral descriptions
Technology choicesCapability requirements
Algorithm suggestionsSuccess criteria with measurable targets

Acceptance Criteria Format

### [Criterion Name]
- Given [precondition]
- When [action]
- Then [observable behavioral outcome]

SLC Release Criteria

CriterionQuestion
SimpleCan it ship fast with narrow scope?
LovableWill people actually want to use it?
CompleteDoes it fully accomplish a job?

All three must be satisfied for a release.

Reverse Engineering (Brownfield)

For existing codebases without specs:

  1. Exhaustively trace every code path, data flow, state mutation
  2. Produce specs stripped of implementation details
  3. Document actual behavior (bugs = "documented features")
  4. Run completeness checklist (all entry points, branches, errors documented)

§9 QUALITY & VALIDATION PROTOCOL

The Backpressure Chain

SPECS ──derives──▶ TESTS ──validates──▶ CODE
  ▲                                       │
  └──────── backpressure ─────────────────┘
  (if tests fail, fix code — not specs or tests)

Validation Gates (all must pass before completion)

GateToolRequired
Unit testsTest runnerAlways
Integration testsTest runnerWhen applicable
Acceptance testsTest runner (from spec AC)Always
BuildBuild toolAlways
LintLinterAlways
TypecheckType checkerWhen applicable
LLM-as-judgeSubagent evaluationFor subjective criteria
Code reviewcode-reviewer agentBefore merge

TDD RED-GREEN-REFACTOR

  1. RED: Write a failing test that defines desired behavior
  2. GREEN: Write minimal code to make test pass
  3. REFACTOR: Clean up while keeping tests green

[HARD-GATE:TDD] No production code without a failing test first.

LLM-as-Judge Pattern

For subjective criteria (tone, aesthetics, UX, readability):

  1. Define rubric dimensions with weights (sum to 1.0)
  2. Set anchor points (1=worst, 5=adequate, 10=best)
  3. Set passing threshold (5.0 minimum viable, 7.0 production, 8.5 excellence)
  4. Evaluate artifact against rubric
  5. Score, reason, suggest improvements
  6. Pass/fail against threshold

Code Review Checklist

  1. Plan alignment — Does code match the approved plan?
  2. Code quality — Clean, readable, maintainable?
  3. Architecture — Consistent with existing patterns?
  4. Tests — Adequate coverage? Acceptance tests present?
  5. Documentation — Updated where needed?

Issue categorization: Critical (must fix) | Important (should fix) | Suggestions (consider)


§10 MEMORY MANAGEMENT PROTOCOL

Memory Files

FilePurposeUpdated By
project-context.mdTech stack, architecture, dependenciesself-learning, manual
learned-patterns.mdCoding conventions and patternsself-learning, code-review
user-preferences.mdCommunication and workflow preferencesself-learning, manual
decisions-log.mdArchitectural decisions with rationaleplanning, brainstorming

Auto-Loading

Memory files are loaded on every session start via the session-start hook. They persist across conversations.

Update Triggers

  • **/learn** — Full project scan, populate all memory files
  • User correction — Update learned-patterns.md or user-preferences.md
  • Architectural decision — Update decisions-log.md
  • New discovery — Update project-context.md

Decay Rules

  • Review memory files periodically for outdated information
  • Remove patterns that no longer match the codebase
  • Update tech stack info when dependencies change
  • Decisions log is append-only (historical record)

§11 ERROR HANDLING & RECOVERY

Error Classification

TypeExampleStrategy
TransientNetwork timeout, rate limitRetry with backoff
PermanentMissing dependency, wrong APIChange approach
UnknownUnexpected error formatInvestigate, classify, then act

Retry Strategy (resilient-execution)

[HARD-GATE:RETRY] Try at least 3 different approaches before escalating:

  1. Approach 1: Direct solution (most obvious fix)
  2. Approach 2: Alternative method (different technique)
  3. Approach 3: Workaround (solve the underlying problem differently)
  4. Escalate: Report with full context — what was tried, what failed, why

Circuit Breaker Recovery

When circuit opens:

  1. Regenerate plan (fresh PLANNING iteration)
  2. Change approach (try alternative strategy)
  3. Reduce scope (break stuck task into subtasks)
  4. Escalate (report blockage for human review)

File Protection During Cleanup

Before any destructive operation (rm, git clean, git checkout .):

  1. Check if operation targets protected files
  2. If yes: ABORT and report
  3. If no: Proceed with caution
  4. After operation: Verify protected files still exist

§12 SUBAGENT DISPATCH RULES

How to Dispatch Subagents

All subagent dispatch uses the Agent tool. To run multiple agents in parallel, invoke multiple Agent tool calls in a single message.

Key parameters:

ParameterDescription
promptDetailed task description with all necessary context
descriptionShort label (3-5 words)
subagent_type"Explore" (fast codebase search), "Plan" (architecture), "general-purpose" (default)
run_in_backgroundtrue for async — you'll be notified on completion
modelOptional override: "sonnet", "opus", "haiku"

When to Dispatch vs Do Inline

ScenarioAction
2+ independent tasks with no shared stateAgent tool — multiple parallel calls in one message
Single focused taskDo inline
Heavy reading/searching across codebaseAgent tool with subagent_type="Explore"
Build or test executionAgent tool — 1 at a time only
Code reviewAgent tool dispatching code-reviewer agent
Quality evaluationAgent tool dispatching acceptance-judge agent

Parallelism Limits

OperationMax ParallelRationale
File reading/searching500I/O bound, safe to parallelize
Spec auditing/updating100Independent file operations
Building/testing1Must serialize to detect failures
Code review1Needs holistic view of changes

Two-Stage Review Gates (subagent-driven-development)

  1. Stage 1: Spec Review — Does implementation match specification?
  2. Stage 2: Quality Review — Does code meet quality standards?

Both gates must pass before task is marked complete.

Result Aggregation

When parallel Agent tool calls return:

  1. Collect all results
  2. Check for conflicts or contradictions
  3. Synthesize into unified view
  4. Report any disagreements for human review

§13 GIT & BRANCH PROTOCOLS

Conventional Commits

<type>(<scope>): <description>

Types: feat, fix, docs, test, refactor, chore, style, perf, ci, build

Examples:

  • feat(auth): add OAuth2 login flow
  • fix(api): handle null response from payment gateway
  • test(user): add acceptance tests for registration
  • docs(readme): update installation instructions

Ralph-Friendly Work Branches

Scope autonomous work to feature branches:

git checkout -b ralph/<scope>

Each branch gets its own IMPLEMENTATION_PLAN.md. Only tasks for that scope are included.

Branch Completion

Use finishing-a-development-branch skill for structured options:

  • Merge to main/develop
  • Create pull request
  • Cleanup and archive

Safety Rules

  • Never skip hooks (--no-verify)
  • Never force-push without explicit user confirmation
  • Never amend published commits without confirmation
  • Always use conventional commit format
  • Always include rationale in commit messages

§14 ANTI-PATTERNS & RATIONALIZATION PREVENTION

These thoughts mean STOP — you are rationalizing:

Red-Flag ThoughtCorrect Response
"This is just a simple question"Questions are tasks. Check for skills.
"I need more context first"Skill check comes BEFORE clarifying questions.
"Let me explore the codebase first"Skills tell you HOW to explore. Check first.
"This doesn't need a formal skill"If a skill exists, use it. No exceptions.
"I remember this skill"Skills evolve. Read current version via Skill tool.
"The skill is overkill"Simple things become complex. Use it.
"I'll just do this one thing first"Check for skills BEFORE doing anything.
"Tests aren't needed for this"[HARD-GATE:TDD] TDD is not optional. Write the test first.
"I'll review later"[HARD-GATE:REVIEW] Review NOW. No merge without review.
"I can skip verification"[HARD-GATE:VERIFY] Verification is mandatory.
"The loop is stuck, let me skip ahead"Circuit breaker protocol. Don't skip — diagnose.
"The spec is obvious, I'll skip writing it"[HARD-GATE:SPEC] Write it. JTBD methodology.
"I can eyeball the quality"Use deterministic tests or LLM-as-judge. Never eyeball.
"Let me just push this quick fix"Plan → TDD → Review → Verify. Even for "quick" fixes.
"The acceptance criteria are implicit"Make them explicit. Given/When/Then. Always.
"I'll add tests after"RED comes before GREEN. Tests first. Always.
"This refactor doesn't need tests"If behavior changes, tests change. If it doesn't, existing tests protect you.

§15 FIND-SKILLS INTEGRATION

When toolkit skills don't cover a specific need:

Discovery

npx skills find [query]       # Search the skills ecosystem

Quality Verification

CriterionMinimum
Weekly installs1,000+ preferred
Source reputationPrefer vercel-labs, anthropics, microsoft
GitHub starsConsider as secondary signal

Installation

npx skills add <owner/repo@skill> -g -y    # Install globally
npx skills check                            # Check for updates
npx skills update                           # Update all

When to Search

  • Task requires domain-specific knowledge not covered by 64 toolkit skills
  • User asks about capabilities the toolkit doesn't have
  • A specialized framework or technology needs dedicated guidance

§16 WORKFLOW EXAMPLES

New Feature (Full Lifecycle)

1. /brainstorm     → Explore the idea, create design doc
2. /specs          → Write specifications with JTBD methodology
3. /plan           → Create implementation plan with bite-sized tasks
4. /execute        → Execute plan with TDD and tracked progress
5. /review         → Verify against plan and standards
6. /verify         → Confirm everything works with fresh evidence
7. finish-branch   → Merge, PR, or cleanup

Bug Fix

1. /debug          → Systematic 4-phase debugging methodology
2. /tdd            → Write test that reproduces bug, then fix
3. /review         → Verify the fix
4. /verify         → Confirm fix with fresh evidence

Ralph Autonomous Session

1. /specs          → Write or audit specifications
2. /ralph          → Start autonomous loop
   → PLANNING MODE: analyze specs, generate IMPLEMENTATION_PLAN.md
   → BUILDING MODE: select task, implement, test, commit
   → STATUS CHECK: produce RALPH_STATUS, evaluate exit gate
   → LOOP until dual-condition exit gate passes
3. /review         → Final code review
4. /verify         → Verify all acceptance tests pass

Legacy Codebase Onboarding

1. /learn          → Scan and discover project context
2. reverse-engineering-specs → Generate specs from existing code
3. /specs          → Audit and refine generated specs
4. /plan           → Plan improvements or new features
5. /execute        → Implement with full test coverage

API Design & Implementation

1. api-design      → Design endpoints, generate OpenAPI spec
2. /specs          → Write behavioral specifications
3. /plan           → Create implementation plan
4. testing-strategy → Define test approach
5. /tdd            → Implement with tests
6. security-review → Check for vulnerabilities

Frontend Component Development

1. frontend-ui-design → Component architecture, a11y, responsive design
2. /plan              → Create implementation plan
3. /tdd               → Implement with tests
4. performance-opt    → Check bundle size, Web Vitals
5. /review            → Code review

Database Schema Change

1. database-schema-design → Model data, plan migrations, indexing
2. /plan                  → Create implementation plan
3. /tdd                   → Implement with migration tests
4. /verify                → Verify migrations work both directions

Documentation Generation

1. /docs           → Generate technical documentation from code
2. /prd            → Create Product Requirements Documents
3. llm-as-judge    → Evaluate documentation quality

Security Audit

1. security-review → OWASP Top 10, auth patterns, input validation
2. /plan           → Plan remediation
3. /tdd            → Fix vulnerabilities with regression tests
4. /verify         → Confirm all issues resolved

Performance Optimization

1. performance-optimization → Profile, identify bottlenecks
2. /plan                    → Plan optimization approach
3. /tdd                     → Implement with benchmark tests
4. /verify                  → Confirm performance targets met

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.