agileflow 2.77.0 → 2.79.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 (128) hide show
  1. package/README.md +6 -6
  2. package/package.json +6 -1
  3. package/scripts/agileflow-configure.js +174 -2
  4. package/scripts/agileflow-statusline.sh +171 -78
  5. package/scripts/agileflow-welcome.js +88 -64
  6. package/scripts/auto-self-improve.js +23 -45
  7. package/scripts/check-update.js +35 -42
  8. package/scripts/damage-control/bash-tool-damage-control.js +257 -0
  9. package/scripts/damage-control/edit-tool-damage-control.js +279 -0
  10. package/scripts/damage-control/patterns.yaml +227 -0
  11. package/scripts/damage-control/write-tool-damage-control.js +274 -0
  12. package/scripts/damage-control-bash.js +232 -0
  13. package/scripts/damage-control-edit.js +243 -0
  14. package/scripts/damage-control-write.js +243 -0
  15. package/scripts/obtain-context.js +22 -3
  16. package/scripts/ralph-loop.js +191 -63
  17. package/scripts/screenshot-verifier.js +213 -0
  18. package/scripts/session-manager.js +12 -33
  19. package/src/core/agents/accessibility.md +124 -53
  20. package/src/core/agents/adr-writer.md +192 -52
  21. package/src/core/agents/analytics.md +139 -60
  22. package/src/core/agents/api.md +173 -63
  23. package/src/core/agents/ci.md +139 -57
  24. package/src/core/agents/compliance.md +159 -68
  25. package/src/core/agents/configuration/damage-control.md +356 -0
  26. package/src/core/agents/configuration-damage-control.md +248 -0
  27. package/src/core/agents/database.md +162 -61
  28. package/src/core/agents/datamigration.md +179 -66
  29. package/src/core/agents/design.md +179 -57
  30. package/src/core/agents/devops.md +160 -3
  31. package/src/core/agents/documentation.md +204 -60
  32. package/src/core/agents/epic-planner.md +147 -55
  33. package/src/core/agents/integrations.md +197 -69
  34. package/src/core/agents/mentor.md +158 -57
  35. package/src/core/agents/mobile.md +159 -67
  36. package/src/core/agents/monitoring.md +154 -65
  37. package/src/core/agents/multi-expert.md +115 -43
  38. package/src/core/agents/orchestrator.md +77 -24
  39. package/src/core/agents/performance.md +130 -75
  40. package/src/core/agents/product.md +151 -55
  41. package/src/core/agents/qa.md +162 -74
  42. package/src/core/agents/readme-updater.md +178 -76
  43. package/src/core/agents/refactor.md +148 -95
  44. package/src/core/agents/research.md +143 -72
  45. package/src/core/agents/security.md +154 -65
  46. package/src/core/agents/testing.md +176 -97
  47. package/src/core/agents/ui.md +170 -79
  48. package/src/core/commands/adr/list.md +171 -0
  49. package/src/core/commands/adr/update.md +235 -0
  50. package/src/core/commands/adr/view.md +252 -0
  51. package/src/core/commands/adr.md +207 -50
  52. package/src/core/commands/agent.md +16 -0
  53. package/src/core/commands/assign.md +148 -44
  54. package/src/core/commands/auto.md +18 -1
  55. package/src/core/commands/babysit.md +391 -38
  56. package/src/core/commands/baseline.md +14 -0
  57. package/src/core/commands/blockers.md +170 -51
  58. package/src/core/commands/board.md +144 -66
  59. package/src/core/commands/changelog.md +15 -0
  60. package/src/core/commands/ci.md +179 -69
  61. package/src/core/commands/compress.md +18 -0
  62. package/src/core/commands/configure.md +16 -0
  63. package/src/core/commands/context/export.md +193 -4
  64. package/src/core/commands/context/full.md +191 -18
  65. package/src/core/commands/context/note.md +248 -4
  66. package/src/core/commands/debt.md +17 -0
  67. package/src/core/commands/deploy.md +208 -65
  68. package/src/core/commands/deps.md +15 -0
  69. package/src/core/commands/diagnose.md +16 -0
  70. package/src/core/commands/docs.md +196 -64
  71. package/src/core/commands/epic/list.md +170 -0
  72. package/src/core/commands/epic/view.md +242 -0
  73. package/src/core/commands/epic.md +192 -69
  74. package/src/core/commands/feedback.md +191 -71
  75. package/src/core/commands/handoff.md +162 -48
  76. package/src/core/commands/help.md +9 -0
  77. package/src/core/commands/ideate.md +446 -0
  78. package/src/core/commands/impact.md +16 -0
  79. package/src/core/commands/metrics.md +141 -37
  80. package/src/core/commands/multi-expert.md +77 -0
  81. package/src/core/commands/packages.md +16 -0
  82. package/src/core/commands/pr.md +161 -67
  83. package/src/core/commands/readme-sync.md +16 -0
  84. package/src/core/commands/research/analyze.md +568 -0
  85. package/src/core/commands/research/ask.md +345 -20
  86. package/src/core/commands/research/import.md +562 -19
  87. package/src/core/commands/research/list.md +173 -5
  88. package/src/core/commands/research/view.md +181 -8
  89. package/src/core/commands/retro.md +135 -48
  90. package/src/core/commands/review.md +219 -47
  91. package/src/core/commands/session/end.md +209 -0
  92. package/src/core/commands/session/history.md +210 -0
  93. package/src/core/commands/session/init.md +116 -0
  94. package/src/core/commands/session/new.md +296 -0
  95. package/src/core/commands/session/resume.md +166 -0
  96. package/src/core/commands/session/status.md +166 -0
  97. package/src/core/commands/setup/visual-e2e.md +462 -0
  98. package/src/core/commands/skill/create.md +115 -17
  99. package/src/core/commands/skill/delete.md +117 -0
  100. package/src/core/commands/skill/edit.md +104 -0
  101. package/src/core/commands/skill/list.md +128 -0
  102. package/src/core/commands/skill/test.md +135 -0
  103. package/src/core/commands/skill/upgrade.md +542 -0
  104. package/src/core/commands/sprint.md +17 -1
  105. package/src/core/commands/status.md +133 -21
  106. package/src/core/commands/story/list.md +176 -0
  107. package/src/core/commands/story/view.md +265 -0
  108. package/src/core/commands/story-validate.md +101 -1
  109. package/src/core/commands/story.md +204 -51
  110. package/src/core/commands/template.md +16 -1
  111. package/src/core/commands/tests.md +226 -64
  112. package/src/core/commands/update.md +17 -1
  113. package/src/core/commands/validate-expertise.md +16 -0
  114. package/src/core/commands/velocity.md +140 -36
  115. package/src/core/commands/verify.md +14 -0
  116. package/src/core/commands/whats-new.md +30 -0
  117. package/src/core/skills/_learnings/README.md +91 -0
  118. package/src/core/skills/_learnings/_template.yaml +106 -0
  119. package/src/core/skills/_learnings/code-review.yaml +118 -0
  120. package/src/core/skills/_learnings/commit.yaml +69 -0
  121. package/src/core/skills/_learnings/story-writer.yaml +71 -0
  122. package/src/core/templates/damage-control-patterns.yaml +234 -0
  123. package/src/core/templates/skill-template.md +53 -11
  124. package/tools/cli/commands/start.js +180 -0
  125. package/tools/cli/installers/ide/claude-code.js +127 -0
  126. package/tools/cli/tui/Dashboard.js +66 -0
  127. package/tools/cli/tui/StoryList.js +69 -0
  128. package/tools/cli/tui/index.js +16 -0
@@ -1,6 +1,18 @@
1
1
  ---
2
2
  description: Bootstrap CI/CD workflow with testing and quality checks
3
3
  argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "CI setup creates .github/workflows/ci.yml with lint/typecheck/test jobs"
8
+ - "MUST parse OWNERS input (comma-separated GitHub handles or team names)"
9
+ - "MUST create CODEOWNERS file with owner mappings for src/ and docs/03-decisions/"
10
+ - "ALWAYS show diff-first preview before creating files (YES/NO confirmation required)"
11
+ - "Concurrency control and minimal permissions are required for security"
12
+ state_fields:
13
+ - owners_input
14
+ - workflow_created
15
+ - codeowners_created
4
16
  ---
5
17
 
6
18
  # ci-setup
@@ -15,92 +27,190 @@ If the user confirms they want the full details, continue. Otherwise, stop here.
15
27
  Bootstrap minimal CI workflow and CODEOWNERS.
16
28
 
17
29
  <!-- COMPACT_SUMMARY_START -->
18
- ## Compact Summary
19
30
 
20
- **Purpose**: Bootstrap minimal CI/CD workflow with testing and quality checks
31
+ ## ⚠️ COMPACT SUMMARY - /agileflow:ci-setup IS ACTIVE
21
32
 
22
- **Quick Usage**:
23
- ```
24
- /agileflow:ci-setup OWNERS=@username,@team
25
- ```
26
-
27
- **What It Does**:
28
- 1. Creates `.github/workflows/ci.yml` with lint/typecheck/test jobs
29
- 2. Creates `CODEOWNERS` file with owner mappings
30
- 3. Shows preview and waits for YES/NO confirmation
31
- 4. Provides notes for enabling required checks in GitHub
32
-
33
- **Required Inputs**:
34
- - `OWNERS=<@handles>` - GitHub usernames or team handles (comma-separated)
35
-
36
- **Optional Inputs**:
37
- - None
33
+ **CRITICAL**: You are bootstrapping CI/CD workflow. All steps must complete to create production-ready CI.
38
34
 
39
- **Output Files**:
40
- - `.github/workflows/ci.yml` - GitHub Actions workflow
41
- - `CODEOWNERS` - Code ownership mappings
35
+ **ROLE**: CI Bootstrapper - Create GitHub Actions workflow with quality gates (lint/typecheck/test) and code ownership rules
42
36
 
43
- **CI Jobs Created**:
44
- - Lint job (generic placeholder for ESLint, Prettier, etc.)
45
- - Typecheck job (TypeScript, Flow, mypy, etc.)
46
- - Test job (Jest, pytest, cargo test, etc.)
47
- - Minimal permissions (contents: read)
48
- - Concurrency control (cancel in-progress runs)
49
-
50
- **CODEOWNERS Mappings**:
51
- ```
52
- /src/ @owners
53
- /docs/03-decisions/ @owners
54
- ```
37
+ ---
55
38
 
56
- **Tools Used**:
57
- - TodoWrite: Track 5-step setup workflow
39
+ ### 🚨 RULE #1: ALWAYS USE TodoWrite FOR TRACKING
58
40
 
59
- **TodoWrite Example**:
41
+ Track all 5 steps explicitly:
60
42
  ```xml
61
43
  <invoke name="TodoWrite">
62
44
  <parameter name="content">
63
- 1. Parse input (OWNERS)
64
- 2. Create .github/workflows/ci.yml with lint/typecheck/test jobs
65
- 3. Create CODEOWNERS file with owner mappings
66
- 4. Show preview and wait for YES/NO confirmation
67
- 5. Print notes for enabling required checks
45
+ 1. Parse OWNERS input (required, comma-separated)
46
+ 2. Generate .github/workflows/ci.yml with 3 jobs
47
+ 3. Generate CODEOWNERS file with mappings
48
+ 4. Show diff preview (both files side-by-side)
49
+ 5. Create files after YES/NO confirmation
68
50
  </parameter>
69
51
  <parameter name="status">in-progress</parameter>
70
52
  </invoke>
71
53
  ```
72
54
 
73
- **Workflow**:
74
- 1. Parse OWNERS input
75
- 2. Generate CI workflow with generic job placeholders
76
- 3. Generate CODEOWNERS file
77
- 4. Show preview of both files
78
- 5. Ask: "Create these files? (YES/NO)"
79
- 6. If YES: Write files
80
- 7. Display notes for enabling required checks
81
-
82
- **Next Steps**:
83
- - Customize job commands for your project
84
- - Enable branch protection in GitHub settings
85
- - Add required status checks
86
- - Configure merge queue (optional)
87
-
88
- **Example CI Workflow**:
89
- ```yaml
55
+ Mark each step complete as you finish. This ensures nothing is forgotten.
56
+
57
+ ---
58
+
59
+ ### 🚨 RULE #2: REQUIRED PARAMETERS
60
+
61
+ `OWNERS` is required (no default):
62
+ - Format: `@username` or `@org/team-name`
63
+ - Multiple: Comma-separated, no spaces
64
+ - Example: `OWNERS=@alice,@dev-team,@bob`
65
+
66
+ If missing:
67
+ ```
68
+ Missing OWNERS parameter
69
+
70
+ Usage: /agileflow:ci-setup OWNERS=@username,@team
71
+
72
+ Examples:
73
+ /agileflow:ci-setup OWNERS=@alice
74
+ /agileflow:ci-setup OWNERS=@alice,@bob,@dev-team
75
+ ```
76
+
77
+ ---
78
+
79
+ ### 🚨 RULE #3: DIFF-FIRST PATTERN
80
+
81
+ ALWAYS show preview of BOTH files before creating:
82
+
83
+ ```
84
+ Preview of files to create:
85
+
86
+ ========== .github/workflows/ci.yml ==========
90
87
  name: CI
91
88
  on: [push, pull_request]
92
- jobs:
93
- lint:
94
- runs-on: ubuntu-latest
95
- steps:
96
- - uses: actions/checkout@v4
97
- - run: npm run lint
98
- test:
99
- runs-on: ubuntu-latest
100
- steps:
101
- - uses: actions/checkout@v4
102
- - run: npm test
89
+ ... [full YAML preview]
90
+
91
+ ========== CODEOWNERS ==========
92
+ /src/ @alice @dev-team
93
+ /docs/03-decisions/ @alice @dev-team
94
+ ```
95
+
96
+ Then ask: "Create these files? (YES/NO)"
97
+
98
+ ---
99
+
100
+ ### 🚨 RULE #4: JOBS REQUIRED
101
+
102
+ Always generate these 3 jobs (generic placeholders OK):
103
+ 1. **lint**: `npm run lint` (or project equivalent)
104
+ 2. **typecheck**: `npm run typecheck` (or project equivalent)
105
+ 3. **test**: `npm test` (or project equivalent)
106
+
107
+ Each job:
108
+ - `runs-on: ubuntu-latest`
109
+ - `permissions: { contents: read }` (minimal security)
110
+ - `concurrency: { group: ... cancel-in-progress: true }` (cost control)
111
+
112
+ ---
113
+
114
+ ### 🚨 RULE #5: CODEOWNERS MAPPINGS
115
+
116
+ Required mappings:
117
+ ```
118
+ /src/ @owners # All source code
119
+ /docs/03-decisions/ @owners # ADRs require owner review
120
+ ```
121
+
122
+ Both paths MUST include the parsed OWNERS.
123
+
124
+ ---
125
+
126
+ ### ANTI-PATTERNS (DON'T DO THESE)
127
+
128
+ ❌ Skip diff preview - go directly to file creation
129
+ ❌ Hardcode owners instead of parsing input
130
+ ❌ Create workflow without concurrency control
131
+ ❌ Forget to validate OWNERS parameter format
132
+ ❌ Create CODEOWNERS without /src/ and /docs/03-decisions/ mappings
133
+ ❌ Use overly permissive permissions (contents: write)
134
+
135
+ ### DO THESE INSTEAD
136
+
137
+ ✅ ALWAYS show diff preview first
138
+ ✅ Parse OWNERS parameter, validate format
139
+ ✅ Include concurrency with cancel-in-progress
140
+ ✅ Use minimal permissions (contents: read)
141
+ ✅ Include both required path mappings
142
+ ✅ Track with TodoWrite for safety
143
+
144
+ ---
145
+
146
+ ### WORKFLOW PHASES
147
+
148
+ **Phase 1: Validate Input (Step 1)**
149
+ - Parse OWNERS parameter
150
+ - Validate format (looks like @username or @org/team)
151
+ - If invalid: show error and ask for correction
152
+
153
+ **Phase 2: Generate Files (Steps 2-3)**
154
+ - Create workflow YAML with 3 jobs
155
+ - Create CODEOWNERS with owner mappings
156
+
157
+ **Phase 3: Preview & Confirm (Step 4)**
158
+ - Display both files in unified diff
159
+ - Ask: "Create these files? (YES/NO)"
160
+
161
+ **Phase 4: Complete (Step 5)**
162
+ - Write .github/workflows/ci.yml
163
+ - Write CODEOWNERS
164
+ - Display next steps note
165
+
166
+ ---
167
+
168
+ ### NEXT STEPS TO DISPLAY
169
+
170
+ ```
171
+ ✅ CI setup complete!
172
+
173
+ Next steps:
174
+ 1. Customize job commands for your project:
175
+ - Update lint command (currently: npm run lint)
176
+ - Update typecheck command
177
+ - Update test command
178
+
179
+ 2. Enable branch protection in GitHub:
180
+ - Settings → Branches → Branch protection rules
181
+ - Require "ci" status check
182
+ - Require branches to be up-to-date
183
+
184
+ 3. Optional: Configure merge queue
185
+ - Settings → Branches → Branch protection
186
+ - Enable merge queue for faster merges
187
+
188
+ 4. Optional: Add required checks
189
+ - Each job can be marked as required
103
190
  ```
191
+
192
+ ---
193
+
194
+ ### KEY FILES TO REMEMBER
195
+
196
+ | File | Purpose |
197
+ |------|---------|
198
+ | `.github/workflows/ci.yml` | GitHub Actions workflow with 3 jobs |
199
+ | `CODEOWNERS` | Code ownership rules for PR reviews |
200
+ | Parsed `OWNERS` | Critical - determines who gets PRs routed |
201
+
202
+ ---
203
+
204
+ ### REMEMBER AFTER COMPACTION
205
+
206
+ - `/agileflow:ci-setup` IS ACTIVE - create CI workflow
207
+ - OWNERS parameter is required (validate format)
208
+ - ALWAYS show diff-first before creating files
209
+ - Include lint, typecheck, test jobs
210
+ - Map both /src/ and /docs/03-decisions/ in CODEOWNERS
211
+ - Use TodoWrite to track 5 steps
212
+ - Display next steps for GitHub configuration
213
+
104
214
  <!-- COMPACT_SUMMARY_END -->
105
215
 
106
216
  ## Prompt
@@ -1,6 +1,24 @@
1
1
  ---
2
2
  description: Compress status.json by removing verbose fields and keeping only tracking metadata
3
3
  argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:compress - Status.json compression utility"
8
+ - "CRITICAL: Operates on docs/09-agents/status.json ONLY"
9
+ - "CRITICAL: Creates backup (status.json.backup) BEFORE writing"
10
+ - "MUST remove verbose fields: description, AC, architectureContext, technicalNotes, testingStrategy, devAgentRecord"
11
+ - "MUST keep only tracking: story_id, epic, title, owner, status, estimate, timestamps, dependencies, branch, summary"
12
+ - "MUST validate JSON before/after compression"
13
+ - "MUST calculate and show token estimate (target: <25000 tokens)"
14
+ - "MUST show before/after stats and savings percentage"
15
+ - "Combine with archival for best results (archive old completed stories first, then compress)"
16
+ state_fields:
17
+ - file_path
18
+ - before_size
19
+ - after_size
20
+ - savings_percentage
21
+ - token_estimate
4
22
  ---
5
23
 
6
24
  # compress
@@ -1,6 +1,22 @@
1
1
  ---
2
2
  description: Configure advanced AgileFlow features (git, hooks, archival, CI, status line)
3
3
  argument-hint: [--profile=full|basic|minimal|none] [--enable/--disable=features] [--migrate] [--upgrade] [--repair] [--version] [--list-scripts]
4
+ compact_context:
5
+ priority: critical
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:configure - Configuration manager for AgileFlow features"
8
+ - "CRITICAL: ALWAYS run --detect FIRST to check status before anything else"
9
+ - "CRITICAL: If ⚠️ INVALID FORMAT shown → offer --migrate BEFORE other options"
10
+ - "CRITICAL: If 🔄 OUTDATED shown → offer --upgrade to re-deploy latest scripts"
11
+ - "MUST backup created on migrate: .claude/settings.json.backup"
12
+ - "MUST show RED RESTART banner after ANY changes (quit, wait 5s, restart)"
13
+ - "Features: sessionstart, precompact, ralphloop, selfimprove, archival, statusline, autoupdate"
14
+ - "Stop hooks (ralphloop, selfimprove) run when Claude completes or pauses"
15
+ state_fields:
16
+ - detection_status
17
+ - has_format_issues
18
+ - has_outdated_scripts
19
+ - enabled_features
4
20
  ---
5
21
 
6
22
  <!-- COMPACT_SUMMARY_START -->
@@ -1,6 +1,18 @@
1
1
  ---
2
2
  description: Export concise context excerpt for web AI tools
3
3
  argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: medium
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:context:export - Read-only export command"
8
+ - "READ-ONLY: No file writes, no confirmation needed, no state changes"
9
+ - "OUTPUT LIMIT: ≤300 lines maximum for easy pasting into web AI tools"
10
+ - "REQUIRED INPUT: docs/context.md must exist (run /agileflow:context:full first if missing)"
11
+ - "EXTRACT ONLY: overview, focus, tech, decisions, features, next steps (skip progress, notes)"
12
+ - "NO TodoWrite needed - single-step read-only operation"
13
+ state_fields:
14
+ - context_file_exists
15
+ - output_line_count
4
16
  ---
5
17
 
6
18
  # /agileflow:context:export
@@ -18,11 +30,188 @@ Reads `docs/context.md` and outputs a condensed excerpt (≤300 lines) ready to
18
30
  ---
19
31
 
20
32
  <!-- COMPACT_SUMMARY_START -->
21
- ## Compact Summary
22
33
 
23
- **Command**: `/agileflow:context:export`
24
- **Purpose**: Output concise context brief for pasting into web AI tools
25
- **Key Rule**: Read-only, no file writes, ≤300 lines output
34
+ ## ⚠️ COMPACT SUMMARY - /agileflow:context:export IS ACTIVE
35
+
36
+ **CRITICAL**: You are exporting a condensed context brief from `docs/context.md`. Follow these rules EXACTLY.
37
+
38
+ **PURPOSE**: Extract ≤300 line excerpt ready to paste into ChatGPT, Perplexity, Gemini, or Claude web for immediate context loading.
39
+
40
+ ---
41
+
42
+ ### 🚨 RULE #1: READ-ONLY COMMAND
43
+
44
+ **This command NEVER writes, modifies, or changes state:**
45
+ - ✓ Read docs/context.md
46
+ - ✓ Extract and format
47
+ - ✓ Output to code block
48
+ - ✗ NO file writes
49
+ - ✗ NO Edit tool calls
50
+ - ✗ NO confirmation needed
51
+ - ✗ NO state changes
52
+
53
+ **Purpose**: Simple read → extract → display workflow.
54
+
55
+ ---
56
+
57
+ ### 🚨 RULE #2: OUTPUT LIMIT IS STRICT - ≤300 LINES
58
+
59
+ **Maximum output size is 300 lines.** This is critical for pasting into web AI tools.
60
+
61
+ **If context.md is longer:**
62
+ 1. Extract ONLY these sections (in order):
63
+ - What We're Building (overview)
64
+ - Current Focus (active work)
65
+ - Tech Stack (technologies)
66
+ - Key Decisions (ADRs list only, not full descriptions)
67
+ - Feature Map (one-line-per-epic summary)
68
+ - Next Steps (upcoming work)
69
+
70
+ 2. **SKIP these to save space:**
71
+ - Recent Progress (too verbose)
72
+ - Notes section (too long)
73
+ - Detailed story descriptions
74
+ - Full ADR content
75
+
76
+ 3. **Count lines as you extract** - use line counter to stay under 300
77
+
78
+ **Format as:**
79
+ ```markdown
80
+ # Project Context Brief
81
+ Last updated: [timestamp from context.md]
82
+
83
+ ## What We're Building
84
+ [Max 5 lines]
85
+
86
+ ## Current Focus
87
+ [Max 5 lines]
88
+
89
+ ## Tech Stack
90
+ [Max 8 lines]
91
+
92
+ ## Key Decisions
93
+ [Max 10 lines - ADR titles only]
94
+
95
+ ## Feature Map
96
+ [Max 15 lines - one per epic]
97
+
98
+ ## Next Steps
99
+ [Max 15 lines - ready stories only]
100
+ ```
101
+
102
+ ---
103
+
104
+ ### 🚨 RULE #3: REQUIRED INPUT FILE
105
+
106
+ **docs/context.md MUST exist before exporting.**
107
+
108
+ **If missing:**
109
+ ```
110
+ Error: docs/context.md not found.
111
+
112
+ To create it, run: /agileflow:context:full
113
+
114
+ Then you can export with: /agileflow:context:export
115
+ ```
116
+
117
+ **Do NOT create placeholder or fallback - user must run :full first.**
118
+
119
+ ---
120
+
121
+ ### 🚨 RULE #4: EXTRACTION SEQUENCE
122
+
123
+ **Extract in this EXACT order (don't rearrange):**
124
+
125
+ | Step | Section | Source | Max Lines |
126
+ |------|---------|--------|-----------|
127
+ | 1 | Header | "# Project Context Brief" | 1 |
128
+ | 2 | Timestamp | Last updated: [from context.md] | 1 |
129
+ | 3 | What We're Building | From overview section | 5 |
130
+ | 4 | Current Focus | From overview/focus section | 5 |
131
+ | 5 | Tech Stack | From tech section (short list) | 8 |
132
+ | 6 | Key Decisions | From decisions section (titles only) | 10 |
133
+ | 7 | Feature Map | From features section (one per epic) | 15 |
134
+ | 8 | Next Steps | From next section (ready stories) | 15 |
135
+ | 9 | Footer | Paste instructions | 3 |
136
+ | | | **TOTAL** | **≤300** |
137
+
138
+ ---
139
+
140
+ ### 🚨 RULE #5: CONTENT CONDENSING RULES
141
+
142
+ **When extracting, apply these rules to stay under limit:**
143
+
144
+ | Element | Full Size | Condensed Size | Rule |
145
+ |---------|-----------|----------------|------|
146
+ | ADRs | Full description | Title + status only | "ADR-001: Feature X (Accepted)" |
147
+ | Stories | Title + description | Title + status | "US-0042 (in-progress)" |
148
+ | Tech | Full list + versions | Framework + key deps only | "Next.js 16, TensorFlow.js, Tailwind" |
149
+ | Epics | Title + stories list | Title + story count + status | "EP-001: Auth (3 stories, 1 done)" |
150
+ | Decisions | Full context | One-liner | "JWT instead of sessions" |
151
+
152
+ ---
153
+
154
+ ### 🚨 RULE #6: OUTPUT FORMAT IS EXACT
155
+
156
+ **Always output in code block for easy copying:**
157
+
158
+ ```
159
+ markdown
160
+ # Project Context Brief
161
+ Last updated: [ISO timestamp]
162
+
163
+ [Extracted sections...]
164
+
165
+ ---
166
+ **Paste this into**: ChatGPT, Perplexity, Gemini, or Claude web
167
+ **Purpose**: Load full project context for AI assistance
168
+ **Limit**: This excerpt is ≤300 lines for easy pasting
169
+ ```
170
+
171
+ **DO NOT output as plain text, tables, or separate sections - use single code block for easy selection and copy.**
172
+
173
+ ---
174
+
175
+ ### KEY FILES & STATE TO REMEMBER
176
+
177
+ | File/State | Purpose | Notes |
178
+ |-----------|---------|-------|
179
+ | docs/context.md | Source file | Must exist, read-only |
180
+ | Output limit | Max 300 lines | Count carefully |
181
+ | Line counter | Track total | Update as you extract |
182
+ | Code block | Output format | For easy copy-paste |
183
+
184
+ ---
185
+
186
+ ### ANTI-PATTERNS & CORRECT PATTERNS
187
+
188
+ ❌ **DON'T**: Modify docs/context.md
189
+ ✅ **DO**: Read-only extract only
190
+
191
+ ❌ **DON'T**: Output >300 lines
192
+ ✅ **DO**: Condense to fit limit
193
+
194
+ ❌ **DON'T**: Include full ADR descriptions
195
+ ✅ **DO**: ADR titles + status only
196
+
197
+ ❌ **DON'T**: Include progress/notes sections
198
+ ✅ **DO**: Overview, focus, tech, decisions, features, next only
199
+
200
+ ❌ **DON'T**: Output as plain text
201
+ ✅ **DO**: Single markdown code block for copy-paste
202
+
203
+ ---
204
+
205
+ ### REMEMBER AFTER COMPACTION
206
+
207
+ After this command completes:
208
+ - ✓ Excerpt extracted from docs/context.md (read-only)
209
+ - ✓ Output ≤300 lines (verified count)
210
+ - ✓ Formatted in markdown code block
211
+ - ✓ Ready to paste into ChatGPT, Perplexity, Gemini, Claude web
212
+ - ✓ Use `/agileflow:context:full` to regenerate docs/context.md
213
+ - ✓ Use `/agileflow:context:note` to add timestamped notes to context.md
214
+
26
215
  <!-- COMPACT_SUMMARY_END -->
27
216
 
28
217
  ---