Skip to content

Commit 137ef11

Browse files
committed
feat(extensions): move trace command to levelup extension
- Move trace command from templates/ to levelup extension - Add trace command to extension.yml with /levelup.trace alias - Create symlinks for trace scripts in extension folder - Move trace-template.md to extension templates - Add pre-installed extension banner to CLI init output - Update catalog.json with trace command - Update roadmap and tests for new locations - Remove extension references from core CLI banner BREAKING: /trace command now requires levelup extension
1 parent 8483e29 commit 137ef11

15 files changed

Lines changed: 172 additions & 44 deletions

File tree

extensions/catalog.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"adlc.levelup.clarify",
2222
"adlc.levelup.spec",
2323
"adlc.levelup.skills",
24-
"adlc.levelup.implement"
24+
"adlc.levelup.implement",
25+
"adlc.levelup.trace"
2526
],
2627
"tags": [
2728
"team-ai-directives",

extensions/levelup/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@ The LevelUp extension helps brownfield projects analyze their codebase and contr
1515
| `/levelup.spec` | Refine CDRs using current feature spec context |
1616
| `/levelup.skills` | Build a single skill from accepted CDRs |
1717
| `/levelup.implement` | Compile accepted CDRs into a PR to team-ai-directives |
18+
| `/levelup.trace` | Generate and validate AI session execution traces |
1819

1920
## Quick Start
2021

21-
### 1. Initialize CDR Discovery
22+
### 1. Generate Session Trace (Optional but Recommended)
23+
24+
After implementing a feature, generate a trace to document the session:
25+
26+
```bash
27+
/levelup.trace
28+
```
29+
30+
This creates `specs/{BRANCH}/trace.md` with execution summary.
31+
32+
### 2. Initialize CDR Discovery
2233

2334
Scan your codebase for patterns that could become team-wide directives:
2435

@@ -114,6 +125,26 @@ pull_request:
114125
115126
## Command Flow
116127
128+
```
129+
levelup.init levelup.clarify levelup.skills levelup.implement
130+
(Discover CDRs) ───▶ (Resolve Ambiguities) ───▶ (Build Skills) ───▶ (Create PR)
131+
│ │ │ │
132+
│ [handoff] │ [handoff] │ │
133+
└──▶ levelup.spec ◀────┘ │ │
134+
(Refine from │ │
135+
feature context) │ │
136+
│ │
137+
┌───────────────────────────────┘ │
138+
│ │
139+
▼ │
140+
levelup.trace ◀───────────────────────────────────────────────┘
141+
(Generate Trace)
142+
143+
│ [handoff]
144+
145+
levelup.spec
146+
(Extract CDRs with
147+
trace enrichment)
117148
```
118149
levelup.init levelup.clarify levelup.skills levelup.implement
119150
(Discover CDRs) ───▶ (Resolve Ambiguities) ───▶ (Build Skills) ───▶ (Create PR)

extensions/levelup/commands/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Extract **Context Directive Records (CDRs)** from the **current feature specific
3333

3434
**Input**:
3535
- Current feature spec, plan, tasks (from `specs/{feature}/`)
36-
- Optional: `trace.md` if generated by `/trace` (enriches CDR extraction)
36+
- Optional: `trace.md` if generated by `/levelup.trace` (enriches CDR extraction)
3737
- Existing CDRs from `.specify/memory/cdr.md` (if any)
3838

3939
**Output**:
Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ validation_script:
1010

1111
## Overview
1212

13-
The `/trace` command generates comprehensive AI session execution traces from implementation metadata and feature artifacts. Traces include a **human-friendly Summary** (Problem → Key Decisions → Final Solution) followed by detailed technical sections for tool integration and learning.
13+
The `/levelup.trace` command generates comprehensive AI session execution traces from implementation metadata and feature artifacts. Traces include a **human-friendly Summary** (Problem → Key Decisions → Final Solution) followed by detailed technical sections for tool integration and learning.
1414

1515
**Purpose**:
1616

@@ -25,14 +25,16 @@ The `/trace` command generates comprehensive AI session execution traces from im
2525

2626
**Structure**: Summary section (3-part narrative) + 5 technical sections (metadata and patterns)
2727

28+
**Note**: This command LevelUp extension. is part of the Run `/levelup.spec` after trace to extract CDRs with enriched context.
29+
2830
## When to Use
2931

30-
Run `/trace` after completing `/implement` to capture the full execution session:
32+
Run `/levelup.trace` after completing `/implement` to capture the full execution session:
3133

3234
```text
3335
/implement → tasks_meta.json created
3436
35-
/trace → Generate session trace
37+
/levelup.trace → Generate session trace
3638
3739
specs/{BRANCH}/trace.md created
3840
@@ -187,10 +189,10 @@ If validation fails (coverage <80%), show warnings and recommendations:
187189

188190
```text
189191
⚠️ Warnings:
190-
- Reusable Patterns section missing or incomplete
191-
192+
- Reusable Patterns section missing or incomplete
193+
192194
💡 Recommendations:
193-
- Identify effective methodologies and applicable contexts
195+
- Identify effective methodologies and applicable contexts
194196
```
195197

196198
## Mode Awareness
@@ -222,7 +224,7 @@ If validation fails (coverage <80%), show warnings and recommendations:
222224

223225
**Idempotent Operation**:
224226

225-
- Re-running `/trace` overwrites previous trace
227+
- Re-running `/levelup.trace` overwrites previous trace
226228
- Always reflects latest execution state
227229
- Single trace.md per feature (latest)
228230

@@ -231,21 +233,22 @@ If validation fails (coverage <80%), show warnings and recommendations:
231233
- `/levelup.spec` reads trace.md if exists (optional)
232234
- `/analyze` can validate trace completeness
233235
- Version-controlled with feature artifacts
236+
- Natural handoff to other LevelUp commands
234237

235238
## Common Scenarios
236239

237240
### Scenario 1: Post-Implementation Trace
238241

239242
```text
240-
User: /trace
243+
User: /levelup.trace
241244
Agent: [Generates trace from tasks_meta.json]
242245
Result: specs/001-feature/trace.md created with 5 sections
243246
```
244247

245248
### Scenario 2: Trace Before Levelup
246249

247250
```text
248-
User: /trace
251+
User: /levelup.trace
249252
Agent: [Generates comprehensive trace]
250253
User: /levelup.spec
251254
Agent: [Reads trace.md for enriched context packet]
@@ -254,7 +257,7 @@ Agent: [Reads trace.md for enriched context packet]
254257
### Scenario 3: Update Existing Trace
255258

256259
```text
257-
User: /trace
260+
User: /levelup.trace
258261
Agent: [Overwrites previous trace with latest execution data]
259262
Result: Updated trace reflects current implementation state
260263
```
@@ -279,7 +282,7 @@ Check execution metadata for corruption.
279282

280283
- Non-blocking: Trace still generated
281284
- Warnings displayed with recommendations
282-
- User can address gaps and re-run `/trace`
285+
- User can address gaps and re-run `/levelup.trace`
283286

284287
## Important Notes
285288

@@ -289,6 +292,7 @@ Check execution metadata for corruption.
289292
- **Spec Mode**: Supported - generates comprehensive traces
290293
- **Optional**: Trace not required for workflow but enhances `/levelup.spec`
291294
- **Version Control**: Commit trace.md with feature implementation
295+
- **Extension**: This command is part of LevelUp extension for team learning
292296

293297
## Success Criteria
294298

@@ -306,4 +310,12 @@ Check execution metadata for corruption.
306310

307311
---
308312

309-
**Next Steps**: After generating trace, optionally run `/levelup.spec` to extract Context Decision Records (CDRs) from your completed feature for team-ai-directives contributions. The trace enriches CDR extraction with detailed execution context.
313+
**Next Steps**: After generating trace, optionally run `/levelup.spec` to extract Context Directive Records (CDRs) from your completed feature for team-ai-directives contributions. The trace enriches CDR extraction with detailed execution context.
314+
315+
## Related Commands
316+
317+
- `/levelup.init` - Discover CDRs from codebase
318+
- `/levelup.clarify` - Resolve ambiguities and accept CDRs
319+
- `/levelup.spec` - Extract CDRs from feature context (uses trace if available)
320+
- `/levelup.skills` - Build skills from accepted CDRs
321+
- `/levelup.implement` - Create PR to team-ai-directives

extensions/levelup/extension.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ provides:
4949
description: "Compile accepted CDRs into a draft PR to team-ai-directives repository"
5050
aliases: ["levelup.implement"]
5151

52+
# Trace - Session execution tracing
53+
- name: "adlc.levelup.trace"
54+
file: "commands/trace.md"
55+
description: "Generate and validate AI session execution traces from implementation metadata"
56+
aliases: ["levelup.trace", "trace"]
57+
5258
config:
5359
- name: "levelup-config.yml"
5460
template: "config-template.yml"
@@ -77,13 +83,21 @@ handoffs:
7783
prompt: "Build skills from accepted CDRs"
7884
send: false
7985

86+
levelup.trace:
87+
- label: "Extract CDRs from Trace"
88+
agent: "levelup.spec"
89+
prompt: "Extract CDRs using trace.md for enriched context"
90+
send: false
91+
8092
tags:
8193
- "team-ai-directives"
8294
- "brownfield"
8395
- "context-modules"
8496
- "skills"
8597
- "cdr"
8698
- "contribution"
99+
- "trace"
100+
- "session-tracing"
87101

88102
defaults:
89103
cdr:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../scripts/bash/generate-trace.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../scripts/bash/validate-trace.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../scripts/powershell/generate-trace.ps1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../scripts/powershell/validate-trace.ps1
File renamed without changes.

0 commit comments

Comments
 (0)