anotherben/claude-enterprise-skills/enterprise-build
Claude Code and agent skill by anotherben/claude-enterprise-skills
- community
Checking that the SKILL.md file is still in the repository.
Strict TDD implementation following the contract. Write test first, watch it fail, write minimal code to pass. No production code without a failing test. Interleave RED→GREEN cycles — one test, one piece of code, repeat. Supports Solo, Subagent, and Swarm execution modes.
Install
npx vskill@latest install anotherben/claude-enterprise-skills/enterprise-buildSKILL.md
The same SKILL.md was published earlier as anotherben/claude-enterprise-skills/enterprise-build.
Enterprise Build
You are implementing code from a contract. Every postcondition becomes a test. Every test is written BEFORE the code it tests. This is non-negotiable.
THE IRON LAW
Write code before the test? Delete it. Start over. Not "keep as reference." Not "adapt it." Delete.
ARTIFACT VALIDATION (Before Starting)
Before writing ANY code, verify upstream artifacts exist:
If either check fails: STOP. Do not write code without a locked contract.
STACK RESOLUTION
Read .claude/enterprise-state/stack-profile.json at skill start. Extract:
$TEST_CMD=commands.test_all$TEST_SINGLE=commands.test_single$TEST_FRAMEWORK=commands.test_framework$SOURCE_DIR=structure.source_dirs.backend$TENANT_FIELD=multi_tenancy.field$TENANT_ENABLED=multi_tenancy.enabled
If no profile exists: BLOCKED — run /enterprise-discover first.
GREENFIELD BOOTSTRAP (First Test Ever)
If the codebase has NO existing tests for the module you're building:
- Check test infrastructure:
``bash $TEST_FRAMEWORK --version 2>/dev/null || echo "Test framework not installed" ls jest.config* 2>/dev/null || echo "No jest config found" ``
- If missing, create minimal test setup:
``javascript // Verify test infrastructure works before TDD test('test infrastructure works', () => { expect(1 + 1).toBe(2); }); ``
- Run it:
$TEST_SINGLEwith pattern "infrastructure" - Only after it passes: proceed with normal TDD sequence
This prevents wasting a RED→GREEN cycle on "Jest isn't configured" instead of "feature is missing."
CONTEXT PRESERVATION (Before Starting)
Before writing any code:
- Save session state (use whichever memory backend is available — Memora MCP, Muninn MCP, or filesystem fallback to
docs/handovers/):
`` MEMORY: save task context — TDD: [slug], contract: [path], current PC: PC-1 ``
- Verify the save if using an MCP backend — recall to confirm persistence
- Read contract postconditions — these are your task list
- Read the plan — this tells you the order and exact code
- Check memory for prior context if resuming after context loss
EXECUTION MODES
Solo Mode (Single Agent)
Execute the TDD sequence yourself. Self-review acceptable for Micro/Small tier.
Subagent Mode (Fresh Agent Per Task)
For each task in the plan:
1. Spawn implementer agent with this exact handoff:
2. Implementer returns code + tests
3. Spawn spec-reviewer agent:
Loop until spec reviewer returns SPEC PASS.
4. Spawn quality-reviewer agent:
Loop until quality reviewer returns QUALITY PASS.
5. Move to next task
Critical: Spec compliance BEFORE code quality. Wrong order = failure.
Swarm Mode (Persistent Teammates)
For Large tier with independent workstreams:
- Create team with named roles (e.g., "api-builder", "frontend-builder", "test-writer")
- Create shared task list from plan with dependency markers
- Teammates claim tasks from queue, execute TDD sequence
- Dependency blocking: task B waits until task A completes
- Integration checkpoint after all parallel streams complete
THE TDD SEQUENCE (Per Postcondition)
This is mechanical. Follow exactly.
Step 1: WRITE the test
One test. One behavior. One postcondition.
Save the test file.
Step 2: RUN the test — show RED
You MUST see the test FAIL. Paste the failure output.
If the test PASSES → you wrote a useless test. Delete it. Write one that tests something missing. If the test ERRORS (syntax, import) → fix the test until it fails for the RIGHT reason (missing feature, not missing import).
Step 3: WRITE minimal production code
Make the test pass. Nothing more. No "while I'm here" additions.
Before writing:
- Verify every import exists (read the file)
- Verify every function signature matches
- Verify data shapes match the contract's consumer map
Step 4: RUN the test — show GREEN
You MUST see the test PASS. Paste the pass output.
If it FAILS → fix the production code (not the test).
Step 5: REFACTOR (if needed)
Improve code quality without changing behavior. Run tests again — still green.
Step 6: COMMIT
Step 7: SAVE PROGRESS (memory + JSON)
Save progress to both memory and the JSON postcondition registry:
Update the postcondition registry JSON to mark this PC as passing:
Only set `passes: true` AFTER the test runner output confirms the test passed. Do not set it based on belief or expectation — evidence only.
Also update the pipeline state at BUILD start and completion:
Step 8: REPEAT for next postcondition
IMPLEMENTATION ORDER
- Migration first (if needed) —
IF NOT EXISTS,TIMESTAMPTZ,$TENANT_FIELD(if$TENANT_ENABLED) - Backend tests + code — service layer, then routes
- Frontend tests + code — hooks, then components
- Integration checkpoint — everything wires together
Do NOT write all tests first then all code. Interleave: RED → GREEN → RED → GREEN.
Frontend Testing Guidance
For React/frontend TDD patterns, read references/frontend-testing.md. It covers:
- Component testing with React Testing Library (render, interact, assert)
- Hook testing with
renderHook - E2E testing with Playwright
- What NOT to test (don't test library internals or CSS)
- Frontend-specific RED→GREEN cycle examples
- Common gotchas (act() warnings, async updates, mock boundaries)
BUILD RULES
- Read before import — verify every function exists, signature matches, return type is right
- Scope lock — implement ONLY what the contract specifies
- No god files — 400 line soft limit. Approaching it? Extract first.
- Existing patterns — use what the codebase already uses
- Permission checks — every new write endpoint needs auth + permission scoping
- Multi-tenant — if
$TENANT_ENABLED: every INSERT needs$TENANT_FIELD, every query scopes to tenant - Verify every consumer — after changing a data source, read every file that consumes it
RATIONALIZATIONS THAT MEAN STOP
| Thought | Reality | |
|---|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. | |
| "I'll test after" | Tests passing immediately prove nothing. | |
| "I already know the fix" | Prove it by writing the test first. | |
| "Need to explore first" | Fine. Throw away exploration, start with TDD. | |
| "Test is hard to write" | Hard to test = hard to use. Fix the design. | |
| "TDD slows me down" | TDD is faster than debugging. Every time. | |
| "Just this once" | There is no "just this once." |
BUG FIX TDD SEQUENCE
For bugs, the sequence proves three things: bug existed, test catches it, fix resolves it.
- Write test that reproduces the bug (assert the WRONG behavior)
- Run it — watch it PASS (proving the bug exists)
- Invert the assertion to correct behavior
- Run it — watch it FAIL (proving the fix isn't applied yet)
- Write the fix
- Run it — watch it PASS (proving the fix works)
CONTEXT LOSS RECOVERY
If context is lost mid-build:
- Check JSON state first:
cat .claude/enterprise-state/<slug>-postconditions.json— shows exactly which PCs pass and which are still pending - Check pipeline state:
cat .claude/enterprise-state/<slug>.json— confirms you're in BUILD stage - Check memory for semantic context about decisions made
- Read the contract — postconditions are the task list
- Run existing tests — verify the JSON state matches reality
- Resume from first PC where `"passes": false`
- Save progress after each PC to both memory and JSON
The JSON postcondition registry is the authoritative state. A new agent reads it and knows exactly where to resume.
Security
- Security scanPassed, 98 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/enterprise-build/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anotherben/claude-enterprise-skills/enterprise-build)