@avesta-hq/prevention 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.avesta/statusLine.js +143 -0
  2. package/.claude/agents/avesta-acceptance-stage.md +17 -0
  3. package/.claude/agents/avesta-acceptance-writer.md +17 -0
  4. package/.claude/agents/avesta-bug-fixer.md +17 -0
  5. package/.claude/agents/avesta-commit-stage.md +17 -0
  6. package/.claude/agents/avesta-committer.md +17 -0
  7. package/.claude/agents/avesta-cycle-runner.md +17 -0
  8. package/.claude/agents/avesta-dependency-reviewer.md +17 -0
  9. package/.claude/agents/avesta-dora-init.md +17 -0
  10. package/.claude/agents/avesta-dora-reporter.md +17 -0
  11. package/.claude/agents/avesta-driver-builder.md +17 -0
  12. package/.claude/agents/avesta-dsl-builder.md +17 -0
  13. package/.claude/agents/avesta-enhancer.md +17 -0
  14. package/.claude/agents/avesta-green.md +17 -0
  15. package/.claude/agents/avesta-help.md +31 -0
  16. package/.claude/agents/avesta-init.md +17 -0
  17. package/.claude/agents/avesta-layer-worker.md +27 -0
  18. package/.claude/agents/avesta-layer.md +17 -0
  19. package/.claude/agents/avesta-mutation-tester.md +17 -0
  20. package/.claude/agents/avesta-planner.md +17 -0
  21. package/.claude/agents/avesta-red.md +17 -0
  22. package/.claude/agents/avesta-refactorer.md +17 -0
  23. package/.claude/agents/avesta-release-stage.md +17 -0
  24. package/.claude/agents/avesta-reviewer.md +17 -0
  25. package/.claude/agents/avesta-scaffolder.md +17 -0
  26. package/.claude/agents/avesta-shipper.md +17 -0
  27. package/.claude/agents/avesta-spiker.md +17 -0
  28. package/.claude/agents/avesta-tech-debt-assessor.md +17 -0
  29. package/.claude/agents/avesta-visionary.md +17 -0
  30. package/.claude/commands/avesta-acceptance-stage.md +8 -0
  31. package/.claude/commands/avesta-acceptance-test.md +8 -0
  32. package/.claude/commands/avesta-bug-fix.md +8 -0
  33. package/.claude/commands/avesta-code-review.md +8 -0
  34. package/.claude/commands/avesta-commit-stage.md +8 -0
  35. package/.claude/commands/avesta-commit.md +8 -0
  36. package/.claude/commands/avesta-cycle.md +8 -0
  37. package/.claude/commands/avesta-dependency-review.md +7 -0
  38. package/.claude/commands/avesta-dora-init.md +8 -0
  39. package/.claude/commands/avesta-dora-report.md +8 -0
  40. package/.claude/commands/avesta-driver.md +8 -0
  41. package/.claude/commands/avesta-dsl.md +8 -0
  42. package/.claude/commands/avesta-enhance.md +8 -0
  43. package/.claude/commands/avesta-green.md +8 -0
  44. package/.claude/commands/avesta-help.md +5 -0
  45. package/.claude/commands/avesta-init.md +8 -0
  46. package/.claude/commands/avesta-layer.md +31 -0
  47. package/.claude/commands/avesta-mutation-testing.md +8 -0
  48. package/.claude/commands/avesta-plan.md +8 -0
  49. package/.claude/commands/avesta-red.md +8 -0
  50. package/.claude/commands/avesta-refactor.md +8 -0
  51. package/.claude/commands/avesta-release-stage.md +8 -0
  52. package/.claude/commands/avesta-scaffold.md +8 -0
  53. package/.claude/commands/avesta-ship.md +8 -0
  54. package/.claude/commands/avesta-spike.md +8 -0
  55. package/.claude/commands/avesta-tech-debt.md +8 -0
  56. package/.claude/commands/avesta-vision.md +8 -0
  57. package/CLAUDE.md +88 -0
  58. package/README.md +113 -0
  59. package/bin/cli.js +643 -0
  60. package/package.json +59 -0
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: avesta-visionary
3
+ description: Define product vision with problem statement, users, and success metrics
4
+ model: inherit
5
+ tools: Read, Write, Edit
6
+ maxTurns: 20
7
+ ---
8
+
9
+ # avesta-visionary
10
+
11
+ Load your system prompt and skills from the Prevention server:
12
+
13
+ 1. Call `avesta_get_prompt("visionary")` to receive your full instructions
14
+ 2. For each skill in the response's `skills_to_load`, call `avesta_get_skill("{skill-key}")`
15
+ 3. Follow the received instructions exactly
16
+
17
+ You are operating as a specialized Prevention. Do not proceed without loading your prompt.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Set up acceptance stage workflow with version-based test execution"
3
+ argument-hint: "[project name or context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="acceptance-stage")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Write an Executable Specification (Test Case) in problem-domain language"
3
+ argument-hint: "[behavior to specify]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="acceptance-test")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Bug fix workflow - reproduce, failing test, fix, verify"
3
+ argument-hint: "<description of the bug to fix>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="bug-fix")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Review code for XP/CD best practices and Clean Architecture"
3
+ argument-hint: "[file path or PR number]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="code-review")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Set up commit stage CI/CD pipeline with test pyramid enforcement"
3
+ argument-hint: "[project name or context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="commit-stage")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Create a git commit following conventional commit standards"
3
+ argument-hint: "[optional commit description]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="commit")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Execute complete feature implementation (Phases 2-5) with TDD and review gates"
3
+ argument-hint: "[feature name or continue from context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="cycle")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: "Review dependencies and generate gradual update plan"
3
+ ---
4
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="dependency-review")`.
5
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
6
+ - If blocked: Show the `error_message` to the user and stop.
7
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Initialize DORA metrics tracking for the project"
3
+ argument-hint: "[project name or context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="dora-init")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Display DORA metrics report for the project"
3
+ argument-hint: "[time range or metric focus]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="dora-report")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Implement Protocol Driver for acceptance tests"
3
+ argument-hint: "[driver type: ui, api, or specific channel]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="driver")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Implement Domain Specific Language for acceptance tests"
3
+ argument-hint: "[DSL method or domain to implement]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="dsl")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Enhancement workflow - extend existing functionality"
3
+ argument-hint: "<description of the enhancement>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="enhance")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "TDD Green Phase - Write MINIMAL code to pass the failing test"
3
+ argument-hint: "[implementation hint]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="green")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: "Show Prevention status, available commands, and next steps"
3
+ ---
4
+ Call `avesta_get_status()` and display the `display_banner` from the response verbatim in a code block.
5
+ Then show phase-specific commands and next action from the response.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Initialize Prevention workflow tracking for a project"
3
+ argument-hint: "[project-type: backend, frontend, fullstack]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="avesta-init")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: "Implement a full layer - all tests first, then all production code"
3
+ argument-hint: "[layer: domain | application | infrastructure | presentation] [backend | frontend]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="layer")`.
6
+
7
+ If blocked: Show the `error_message` to the user and stop.
8
+
9
+ If `gate_check.allowed` is true, orchestrate per-layer workers:
10
+
11
+ 1. **Parse arguments** from `$ARGUMENTS`:
12
+ - **Layer(s)**: If a specific layer is named (`domain`, `application`, `infrastructure`, `presentation`), implement only that layer. If `all` or no layer specified, implement all four in order: domain, application, infrastructure, presentation.
13
+ - **Project type**: If `backend` or `frontend` is specified, use it. Default: `backend`.
14
+
15
+ 2. **For each layer** (in the determined order), spawn a subagent:
16
+ - Use the `avesta-layer-worker` agent
17
+ - Pass a structured prompt: `"LAYER: <layer_name>\nPROJECT_TYPE: <project_type>\nFEATURE: $ARGUMENTS"`
18
+ - Wait for the worker to complete before starting the next layer
19
+ - After each worker completes, briefly report which layer finished and how many tests passed
20
+
21
+ 3. **After all layers complete**, show a summary:
22
+ ```
23
+ LAYER IMPLEMENTATION COMPLETE
24
+ - Domain: [status]
25
+ - Application: [status]
26
+ - Infrastructure: [status]
27
+ - Presentation: [status]
28
+ Next: /commit or /layer [next layer]
29
+ ```
30
+
31
+ 4. If `approve_gate` is present in the dispatch response, call `avesta_approve_gate` with that gate name after all layers complete.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Analyze test effectiveness with mutation testing"
3
+ argument-hint: "<branch or files to analyze>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="mutation-testing")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Create implementation plan using Example Mapping and behavioral analysis"
3
+ argument-hint: "<feature description, user story, or JIRA ticket>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="plan")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "TDD Red Phase - Write ONE failing test"
3
+ argument-hint: "[behavior to test]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="red")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "TDD Refactor Phase - Improve code structure while keeping tests green"
3
+ argument-hint: "[refactoring focus]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="refactor")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Set up release stage CI/CD pipeline with contract verification and deployment"
3
+ argument-hint: "[project name or context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="release-stage")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Scaffold project structure, dependencies, and config files"
3
+ argument-hint: "[project-type: backend, frontend, fullstack]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="scaffold")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Merge completed work to main branch"
3
+ argument-hint: "[optional PR title]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="ship")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Technical exploration - disposable code for learning"
3
+ argument-hint: "<technical question to explore>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="spike")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Tech debt workflow - approval tests first, then refactor"
3
+ argument-hint: "<description of the tech debt to address>"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="tech-debt")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: "Define product vision with problem statement, users, and success metrics"
3
+ argument-hint: "[product or feature context]"
4
+ ---
5
+ Call `avesta_dispatch(user_input="$ARGUMENTS", current_command="vision")`.
6
+ - If `gate_check.allowed` is true: Spawn the agent named in the `agent` field to handle this task. Pass `$ARGUMENTS` as context.
7
+ - If blocked: Show the `error_message` to the user and stop.
8
+ - After the agent completes successfully: If `approve_gate` is present in the response, call `avesta_approve_gate` with that gate name.
package/CLAUDE.md ADDED
@@ -0,0 +1,88 @@
1
+ # Prevention: Continuous Delivery as a Learning System
2
+
3
+ > An opinionated AI development agent that embeds XP/CD best practices to achieve Elite DORA metrics.
4
+ > **Build the product right. Ship value fast. Learn continuously.**
5
+
6
+ ## Vision
7
+
8
+ **Problem**: AI amplifies existing organizational patterns—both good and bad. Without engineering discipline, AI accelerates chaos.
9
+
10
+ **Solution**: This agent encodes proven XP/CD practices directly into the development workflow through TDD, Clean Architecture, and comprehensive testing.
11
+
12
+ **Goal**: Elite DORA metrics — on-demand deployment, <1hr lead time, 0-15% failure rate, <1hr restore time.
13
+
14
+ ## Target Users
15
+
16
+ - **CTOs/Engineering Managers**: Engineering transformation and AI ROI
17
+ - **Tech Leads**: Best practices at team level
18
+ - **Individual Developers**: Features with built-in quality
19
+
20
+ ---
21
+
22
+ ## Technical Stack
23
+
24
+ ### Backend
25
+
26
+ - **Language**: TypeScript
27
+ - **Runtime**: Node.js
28
+ - **Framework**: Express
29
+ - **Testing**: Jest (unit/component/contract), Supertest
30
+ - **Contract Testing**: Pact (Provider)
31
+
32
+ ### Frontend
33
+
34
+ - **Language**: TypeScript
35
+ - **Framework**: Next.js (App Router)
36
+ - **UI Library**: shadcn/ui + Radix UI
37
+ - **Styling**: Tailwind CSS
38
+ - **Testing**: Jest + React Testing Library
39
+ - **Contract Testing**: Pact (Consumer)
40
+
41
+ ### Shared
42
+
43
+ - **Package Manager**: pnpm
44
+ - **Linting**: ESLint + Prettier
45
+ - **Acceptance Testing**: Cucumber + Playwright
46
+ - **External System Mocking**: [Scenarist](https://scenarist.io/)
47
+
48
+ ---
49
+
50
+ ## Rules for Claude
51
+
52
+ ### General
53
+
54
+ - Use pnpm for package management
55
+ - Follow conventional commits (feat:, fix:, refactor:, test:, docs:)
56
+ - Never mention TDD in code comments or commit messages—the process is invisible
57
+ - All code must have tests at the appropriate pyramid level
58
+ - **NO "WHAT" comments**: Only add "WHY" comments when business logic or technical decisions are non-obvious
59
+
60
+ ### File Naming
61
+
62
+ - Use kebab-case for files: `add-project.use-case.ts`
63
+ - Tests co-located with implementation: `*.test.ts`
64
+ - Use `.types.ts` for type definitions
65
+ - Use `.factory.ts` for composition root (in `presentation/factories/`, NOT in `application/`)
66
+
67
+ ---
68
+
69
+ ## MCP Server Integration
70
+
71
+ This project uses Prevention as an MCP server with 12 tools, 27 agents, and 27 skills that provide all methodology knowledge (TDD, Clean Architecture, test pyramid, CI/CD, etc.) on demand.
72
+
73
+ **When starting work:**
74
+
75
+ 1. Run `/avesta-help` to see current status and next steps
76
+ 2. The workflow tracks your phase (vision → plan → atdd → tdd → review → ship)
77
+ 3. Gates enforce that prerequisites are met before advancing
78
+
79
+ **Key tools:**
80
+
81
+ - `avesta_get_status` — Current phase, gates, next action
82
+ - `avesta_dispatch` — Route tasks to the right workflow step
83
+ - `avesta_get_catalog` — All available commands and skills
84
+ - `avesta_get_skill` — Deep knowledge on any practice (testing, architecture, CI/CD)
85
+
86
+ **All detailed methodology is in skills** — use `avesta_get_skill` or `avesta_get_catalog` to access TDD rules, Clean Architecture patterns, test strategies, CI/CD pipeline templates, etc.
87
+
88
+
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # Prevention
2
+
3
+ > **AI development agent that embeds XP/CD best practices to achieve Elite DORA metrics.**
4
+
5
+ Build the product right. Ship value fast. Learn continuously.
6
+
7
+ ---
8
+
9
+ ## What is Prevention?
10
+
11
+ Prevention turns [Claude Code](https://claude.ai/claude-code) into a disciplined engineering partner. Instead of just generating code, it enforces **TDD, Clean Architecture, ATDD, and Continuous Delivery** — the practices that separate elite teams from the rest.
12
+
13
+ One command to set up. Slash commands to drive the workflow. Gates to keep you honest.
14
+
15
+ ---
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ cd your-project
21
+ npx @avesta-hq/prevention init
22
+ ```
23
+
24
+ Then start Claude Code and run `/avesta-help` to see your status and available commands.
25
+
26
+ ---
27
+
28
+ ## Workflow
29
+
30
+ Prevention guides you through a proven delivery workflow:
31
+
32
+ ```
33
+ vision → plan → acceptance tests → TDD → driver → review → ship
34
+ ```
35
+
36
+ Each phase has gates that ensure prerequisites are met before you move forward. You can't skip writing tests before shipping, or ship without a review.
37
+
38
+ ---
39
+
40
+ ## Commands
41
+
42
+ 27 slash commands organized by workflow phase:
43
+
44
+ | Phase | Command | Purpose |
45
+ | -------------------- | --------------------------------- | ---------------------------------------------------- |
46
+ | **Setup** | `/avesta-init [type]` | Initialize workflow tracking |
47
+ | | `/avesta-scaffold` | Scaffold project structure (greenfield) |
48
+ | | `/avesta-help` | Show status, gates, and next steps |
49
+ | **Vision** | `/avesta-vision` | Define product vision, success metrics, scope |
50
+ | **Planning** | `/avesta-plan <feature>` | Break feature into TDD-ready tasks (Example Mapping) |
51
+ | | `/avesta-spike <question>` | Technical exploration (disposable code) |
52
+ | **Acceptance Tests** | `/avesta-acceptance-test` | Write Executable Specification |
53
+ | | `/avesta-dsl` | Implement Domain Specific Language layer |
54
+ | | `/avesta-driver` | Implement Protocol Drivers (UI/API) |
55
+ | **TDD** | `/avesta-red <behavior>` | Write ONE failing test |
56
+ | | `/avesta-green` | Minimal code to make it pass |
57
+ | | `/avesta-refactor` | Improve structure (tests must stay green) |
58
+ | | `/avesta-cycle <behavior>` | Full red-green-refactor cycle |
59
+ | | `/avesta-layer` | All tests first, then all production code |
60
+ | **Change Types** | `/avesta-bug-fix <description>` | Bug fix workflow |
61
+ | | `/avesta-enhance <description>` | Enhancement workflow |
62
+ | | `/avesta-tech-debt <description>` | Tech debt workflow (approval tests) |
63
+ | **Review & Ship** | `/avesta-code-review` | Domain-specific code review |
64
+ | | `/avesta-commit` | Conventional commit |
65
+ | | `/avesta-ship` | Merge to main |
66
+ | **CI/CD** | `/avesta-commit-stage` | Set up commit stage pipeline |
67
+ | | `/avesta-release-stage` | Set up release stage pipeline |
68
+ | | `/avesta-acceptance-stage` | Set up acceptance stage pipeline |
69
+ | **Metrics** | `/avesta-dora-init` | Initialize DORA metrics tracking |
70
+ | | `/avesta-dora-report` | Generate DORA metrics report |
71
+ | **Maintenance** | `/avesta-dependency-review` | Review deps and generate update plan |
72
+ | | `/avesta-mutation-testing` | Analyze test effectiveness |
73
+
74
+ ---
75
+
76
+ ## License Tiers
77
+
78
+ | Feature | Free | Pro |
79
+ | -------------------- | -------------------------------------------------- | -------------------- |
80
+ | **Core TDD** | `/avesta-red`, `/avesta-green`, `/avesta-refactor` | All 27 commands |
81
+ | **Setup** | `/avesta-init`, `/avesta-scaffold`, `/avesta-help` | All 28 agents |
82
+ | **Skills** | - | 27 contextual skills |
83
+ | **Gate enforcement** | - | Automated gates |
84
+ | **Projects** | 1 | Unlimited |
85
+
86
+ Free tier gives you the core TDD loop. Pro unlocks the full workflow with all commands, skills, and gate enforcement.
87
+
88
+ ---
89
+
90
+ ## Manual MCP Setup
91
+
92
+ If you prefer to configure the MCP server manually, create `.mcp.json` at your project root:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "prevention": {
98
+ "command": "npx",
99
+ "args": ["@avesta-hq/prevention", "serve"]
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ Then restart Claude Code.
106
+
107
+ ---
108
+
109
+ ## Requirements
110
+
111
+ - Node.js >= 18
112
+ - [Claude Code](https://claude.ai/claude-code) CLI
113
+