|
| 1 | +# LevelUp Extension |
| 2 | + |
| 3 | +Discover and contribute context modules (rules, personas, examples, skills) to team-ai-directives using Context Decision Records (CDRs). |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The LevelUp extension helps brownfield projects analyze their codebase and contribute reusable context modules back to the team's shared AI directives repository. It introduces **Context Decision Records (CDRs)** - similar to Architecture Decision Records (ADRs) - for tracking what, why, and how context is being contributed. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +| Command | Purpose | |
| 12 | +|---------|---------| |
| 13 | +| `/levelup.init` | Scan codebase and discover CDRs (like `/architect.init`) | |
| 14 | +| `/levelup.clarify` | Resolve ambiguities in discovered CDRs (like `/architect.clarify`) | |
| 15 | +| `/levelup.spec` | Refine CDRs using current feature spec context | |
| 16 | +| `/levelup.skills` | Build a single skill from accepted CDRs | |
| 17 | +| `/levelup.implement` | Compile accepted CDRs into a PR to team-ai-directives | |
| 18 | + |
| 19 | +## Quick Start |
| 20 | + |
| 21 | +### 1. Initialize CDR Discovery |
| 22 | + |
| 23 | +Scan your codebase for patterns that could become team-wide directives: |
| 24 | + |
| 25 | +```bash |
| 26 | +/levelup.init |
| 27 | +``` |
| 28 | + |
| 29 | +This creates CDRs in `.specify/memory/cdr.md` with status "Discovered". |
| 30 | + |
| 31 | +### 2. Clarify and Accept CDRs |
| 32 | + |
| 33 | +Review discovered CDRs and resolve ambiguities: |
| 34 | + |
| 35 | +```bash |
| 36 | +/levelup.clarify |
| 37 | +``` |
| 38 | + |
| 39 | +This validates patterns and updates CDR statuses to "Accepted" or "Rejected". |
| 40 | + |
| 41 | +### 3. Build Skills (Optional) |
| 42 | + |
| 43 | +Build a skill from accepted CDRs: |
| 44 | + |
| 45 | +```bash |
| 46 | +/levelup.skills python-error-handling |
| 47 | +``` |
| 48 | + |
| 49 | +This creates a skill in `.specify/drafts/skills/`. |
| 50 | + |
| 51 | +### 4. Create PR |
| 52 | + |
| 53 | +Compile accepted CDRs into a PR to team-ai-directives: |
| 54 | + |
| 55 | +```bash |
| 56 | +/levelup.implement |
| 57 | +``` |
| 58 | + |
| 59 | +This creates a draft PR with all accepted contributions. |
| 60 | + |
| 61 | +## Context Decision Records (CDRs) |
| 62 | + |
| 63 | +CDRs are stored in `.specify/memory/cdr.md` and track: |
| 64 | + |
| 65 | +- **Target Module**: Where the contribution goes in team-ai-directives |
| 66 | +- **Context Type**: Rule, Persona, Example, Constitution Amendment, or Skill |
| 67 | +- **Status**: Discovered → Proposed → Accepted/Rejected → Implemented |
| 68 | +- **Evidence**: Links to code, commits, and discussions |
| 69 | + |
| 70 | +### CDR Status Values |
| 71 | + |
| 72 | +| Status | Description | |
| 73 | +|--------|-------------| |
| 74 | +| **Discovered** | Inferred from codebase during brownfield analysis | |
| 75 | +| **Proposed** | Suggested for review, awaiting validation | |
| 76 | +| **Accepted** | Approved for implementation | |
| 77 | +| **Rejected** | Not accepted (reason documented) | |
| 78 | +| **Implemented** | PR created to team-ai-directives | |
| 79 | + |
| 80 | +## Configuration |
| 81 | + |
| 82 | +### Team AI Directives Path |
| 83 | + |
| 84 | +The extension resolves the team-ai-directives path in this order: |
| 85 | + |
| 86 | +1. `SPECIFY_TEAM_DIRECTIVES` environment variable |
| 87 | +2. `.specify/team-ai-directives` (submodule - recommended) |
| 88 | +3. `.specify/memory/team-ai-directives` (clone - legacy) |
| 89 | + |
| 90 | +### Extension Config |
| 91 | + |
| 92 | +Optional configuration in `.specify/extensions/levelup/levelup-config.yml`: |
| 93 | + |
| 94 | +```yaml |
| 95 | +cdr: |
| 96 | + heuristic: "surprising" # surprising | all | minimal |
| 97 | + location: ".specify/memory/cdr.md" |
| 98 | + |
| 99 | +skills: |
| 100 | + drafts_location: ".specify/drafts/skills" |
| 101 | + |
| 102 | +discovery: |
| 103 | + rules: true |
| 104 | + personas: true |
| 105 | + examples: true |
| 106 | + constitution: true |
| 107 | + skills: true |
| 108 | + |
| 109 | +pull_request: |
| 110 | + draft: true |
| 111 | + branch_prefix: "levelup/" |
| 112 | + target_branch: "main" |
| 113 | +``` |
| 114 | +
|
| 115 | +## Command Flow |
| 116 | +
|
| 117 | +``` |
| 118 | +levelup.init levelup.clarify levelup.skills levelup.implement |
| 119 | +(Discover CDRs) ───▶ (Resolve Ambiguities) ───▶ (Build Skills) ───▶ (Create PR) |
| 120 | + │ │ │ │ |
| 121 | + │ [handoff] │ [handoff] │ │ |
| 122 | + └──▶ levelup.spec ◀────┘ │ │ |
| 123 | + (Refine from │ │ |
| 124 | + feature context) │ │ |
| 125 | +``` |
| 126 | + |
| 127 | +## Related Issues |
| 128 | + |
| 129 | +- [#56](https://github.com/tikalk/agentic-sdlc-spec-kit/issues/56) - Feature request for this extension |
| 130 | +- [#49](https://github.com/tikalk/agentic-sdlc-spec-kit/issues/49) - Skills discovery (format compatibility) |
| 131 | +- [#53](https://github.com/tikalk/agentic-sdlc-spec-kit/issues/53) - Git submodule for team-ai-directives |
| 132 | +- [#36](https://github.com/tikalk/agentic-sdlc-spec-kit/issues/36) - Convert architect commands to extension (pattern reference) |
| 133 | + |
| 134 | +## License |
| 135 | + |
| 136 | +MIT |
0 commit comments