agileflow 3.0.0 → 3.0.2
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.
- package/CHANGELOG.md +10 -0
- package/README.md +6 -6
- package/lib/api-server.js +3 -2
- package/lib/dashboard-server.js +131 -50
- package/lib/flag-detection.js +4 -2
- package/lib/git-operations.js +4 -2
- package/lib/process-executor.js +24 -9
- package/lib/skill-loader.js +11 -3
- package/package.json +1 -1
- package/scripts/agileflow-welcome.js +65 -25
- package/scripts/archive-completed-stories.sh +3 -0
- package/scripts/ci-summary.js +294 -0
- package/scripts/claude-smart.sh +18 -0
- package/scripts/claude-tmux.sh +50 -20
- package/scripts/damage-control-multi-agent.js +14 -10
- package/scripts/lib/bus-utils.js +3 -1
- package/scripts/lib/configure-detect.js +89 -8
- package/scripts/lib/configure-features.js +77 -10
- package/scripts/lib/configure-repair.js +6 -5
- package/scripts/lib/context-formatter.js +13 -3
- package/scripts/lib/damage-control-utils.js +5 -1
- package/scripts/lib/lifecycle-detector.js +5 -3
- package/scripts/lib/process-cleanup.js +8 -4
- package/scripts/lib/scale-detector.js +47 -8
- package/scripts/lib/signal-detectors.js +117 -59
- package/scripts/lib/task-registry.js +5 -1
- package/scripts/lib/team-events.js +4 -4
- package/scripts/messaging-bridge.js +7 -1
- package/scripts/precompact-context.sh +3 -0
- package/scripts/ralph-loop.js +10 -8
- package/scripts/smart-detect.js +32 -11
- package/scripts/team-manager.js +1 -1
- package/scripts/tmux-task-name.sh +75 -0
- package/scripts/tmux-task-watcher.sh +177 -0
- package/src/core/commands/babysit.md +75 -42
- package/src/core/commands/blockers.md +7 -7
- package/src/core/commands/configure.md +49 -63
- package/src/core/commands/discovery/brief.md +363 -0
- package/src/core/commands/discovery/new.md +395 -0
- package/src/core/commands/ideate/new.md +5 -5
- package/src/core/commands/logic/audit.md +5 -5
- package/src/core/commands/review.md +7 -1
- package/src/core/commands/rpi.md +61 -26
- package/src/core/commands/sprint.md +7 -6
- package/src/core/templates/product-brief.md +136 -0
- package/tools/cli/installers/ide/claude-code.js +67 -2
- package/src/core/agents/configuration/archival.md +0 -350
- package/src/core/agents/configuration/attribution.md +0 -343
- package/src/core/agents/configuration/ci.md +0 -1103
- package/src/core/agents/configuration/damage-control.md +0 -375
- package/src/core/agents/configuration/git-config.md +0 -537
- package/src/core/agents/configuration/hooks.md +0 -623
- package/src/core/agents/configuration/precompact.md +0 -302
- package/src/core/agents/configuration/status-line.md +0 -557
- package/src/core/agents/configuration/verify.md +0 -618
- package/src/core/agents/configuration-damage-control.md +0 -259
- package/src/core/agents/configuration-visual-e2e.md +0 -339
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: precompact
|
|
3
|
-
description: Configure PreCompact hook for context preservation during conversation compacts
|
|
4
|
-
tools:
|
|
5
|
-
- Read
|
|
6
|
-
- Write
|
|
7
|
-
- Edit
|
|
8
|
-
- Bash
|
|
9
|
-
- Glob
|
|
10
|
-
- Grep
|
|
11
|
-
- AskUserQuestion
|
|
12
|
-
model: haiku
|
|
13
|
-
team_role: teammate
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## STEP 0: Gather Context
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
node .agileflow/scripts/obtain-context.js configuration-precompact
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
# PreCompact Configuration Agent
|
|
26
|
-
|
|
27
|
-
Configures the PreCompact hook to preserve critical project context when Claude Code compacts conversations.
|
|
28
|
-
|
|
29
|
-
## Prompt
|
|
30
|
-
|
|
31
|
-
ROLE: PreCompact Configuration Specialist
|
|
32
|
-
|
|
33
|
-
OBJECTIVE
|
|
34
|
-
Set up the PreCompact hook system that outputs important project context before Claude compacts a conversation. This ensures critical information survives summarization.
|
|
35
|
-
|
|
36
|
-
## What is PreCompact?
|
|
37
|
-
|
|
38
|
-
When a Claude Code conversation fills its context window, it "compacts" (summarizes) to make room. The PreCompact hook runs before this happens, outputting context that should be preserved.
|
|
39
|
-
|
|
40
|
-
**Benefits:**
|
|
41
|
-
- Project conventions survive compacts (commit rules, file locations)
|
|
42
|
-
- Active work context is preserved (current story, branch)
|
|
43
|
-
- Key file paths are remembered
|
|
44
|
-
- Team conventions don't get lost
|
|
45
|
-
- **Active command rules are preserved** (e.g., babysit's AskUserQuestion requirement)
|
|
46
|
-
|
|
47
|
-
## Active Command Preservation
|
|
48
|
-
|
|
49
|
-
Commands like `/agileflow:babysit` have specific behavioral rules (e.g., "MUST use AskUserQuestion"). When a compact happens mid-command, these rules would normally be lost.
|
|
50
|
-
|
|
51
|
-
**How it works:**
|
|
52
|
-
1. Commands register themselves in `docs/09-agents/session-state.json` under `active_commands[]` array
|
|
53
|
-
2. Commands define Compact Summary sections between `<!-- COMPACT_SUMMARY_START -->` and `<!-- COMPACT_SUMMARY_END -->` markers
|
|
54
|
-
3. PreCompact hook reads ALL active commands and outputs their summaries
|
|
55
|
-
4. Rules survive the compact and Claude continues following them
|
|
56
|
-
|
|
57
|
-
**Note (v2.40.0+):** Multiple commands can be active simultaneously (e.g., `/babysit` then `/epic`). All active command summaries are preserved.
|
|
58
|
-
|
|
59
|
-
**Example frontmatter in a command:**
|
|
60
|
-
```yaml
|
|
61
|
-
---
|
|
62
|
-
description: Interactive mentor
|
|
63
|
-
compact_context:
|
|
64
|
-
priority: critical
|
|
65
|
-
preserve_rules:
|
|
66
|
-
- "MUST use AskUserQuestion for all decisions"
|
|
67
|
-
- "MUST track progress with TaskCreate/TaskUpdate"
|
|
68
|
-
---
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Configuration Steps
|
|
72
|
-
|
|
73
|
-
### Step 1: Check Prerequisites
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# Verify .claude/settings.json exists (hooks system must be configured)
|
|
77
|
-
if [ ! -f .claude/settings.json ]; then
|
|
78
|
-
echo "ERROR: Hooks system not configured. Run /agileflow:configure and select 'Hooks System' first."
|
|
79
|
-
exit 1
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
# Check if PreCompact already configured
|
|
83
|
-
if grep -q "PreCompact" .claude/settings.json 2>/dev/null; then
|
|
84
|
-
echo "PreCompact hook already configured"
|
|
85
|
-
ALREADY_CONFIGURED=true
|
|
86
|
-
else
|
|
87
|
-
echo "PreCompact hook not yet configured"
|
|
88
|
-
ALREADY_CONFIGURED=false
|
|
89
|
-
fi
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Step 2: Create PreCompact Script
|
|
93
|
-
|
|
94
|
-
Copy from AgileFlow template or create `scripts/precompact-context.sh`:
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Copy from .agileflow/templates/precompact-context.sh if available
|
|
98
|
-
cp .agileflow/templates/precompact-context.sh scripts/precompact-context.sh 2>/dev/null || \
|
|
99
|
-
echo "Template not found - creating from scratch"
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The script should include:
|
|
103
|
-
|
|
104
|
-
1. **Project status** (version, branch, active stories, WIP count)
|
|
105
|
-
2. **Active command detection** - reads `docs/09-agents/session-state.json` for `active_command`
|
|
106
|
-
3. **Command rules extraction** - if active command found, extracts `compact_context.preserve_rules` from command's frontmatter
|
|
107
|
-
4. **Key conventions** from CLAUDE.md
|
|
108
|
-
5. **Post-compact action reminders**
|
|
109
|
-
|
|
110
|
-
**Key section for multi-command detection (v2.40.0+):**
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
# ============================================================
|
|
114
|
-
# ACTIVE COMMANDS DETECTION (supports multiple commands)
|
|
115
|
-
# ============================================================
|
|
116
|
-
COMMAND_SUMMARIES=""
|
|
117
|
-
|
|
118
|
-
if [ -f "docs/09-agents/session-state.json" ]; then
|
|
119
|
-
# Get all active command names as space-separated list
|
|
120
|
-
ACTIVE_COMMANDS=$(node -p "
|
|
121
|
-
const s = require('./docs/09-agents/session-state.json');
|
|
122
|
-
(s.active_commands || []).map(c => c.name).join(' ');
|
|
123
|
-
" 2>/dev/null || echo "")
|
|
124
|
-
|
|
125
|
-
for ACTIVE_COMMAND in $ACTIVE_COMMANDS; do
|
|
126
|
-
# Look for the command file (source first for development)
|
|
127
|
-
COMMAND_FILE=""
|
|
128
|
-
if [ -f "packages/cli/src/core/commands/${ACTIVE_COMMAND}.md" ]; then
|
|
129
|
-
COMMAND_FILE="packages/cli/src/core/commands/${ACTIVE_COMMAND}.md"
|
|
130
|
-
elif [ -f ".agileflow/commands/${ACTIVE_COMMAND}.md" ]; then
|
|
131
|
-
COMMAND_FILE=".agileflow/commands/${ACTIVE_COMMAND}.md"
|
|
132
|
-
elif [ -f ".claude/commands/agileflow/${ACTIVE_COMMAND}.md" ]; then
|
|
133
|
-
COMMAND_FILE=".claude/commands/agileflow/${ACTIVE_COMMAND}.md"
|
|
134
|
-
fi
|
|
135
|
-
|
|
136
|
-
if [ ! -z "$COMMAND_FILE" ]; then
|
|
137
|
-
# Extract Compact Summary between markers
|
|
138
|
-
SUMMARY=$(node -e "
|
|
139
|
-
const fs = require('fs');
|
|
140
|
-
const content = fs.readFileSync('$COMMAND_FILE', 'utf8');
|
|
141
|
-
const match = content.match(/<!-- COMPACT_SUMMARY_START[\\s\\S]*?-->([\\s\\S]*?)<!-- COMPACT_SUMMARY_END -->/);
|
|
142
|
-
if (match) {
|
|
143
|
-
console.log('## ACTIVE COMMAND: /agileflow:${ACTIVE_COMMAND}');
|
|
144
|
-
console.log('');
|
|
145
|
-
console.log(match[1].trim());
|
|
146
|
-
}
|
|
147
|
-
" 2>/dev/null || echo "")
|
|
148
|
-
|
|
149
|
-
if [ ! -z "$SUMMARY" ]; then
|
|
150
|
-
COMMAND_SUMMARIES="${COMMAND_SUMMARIES}\n\n${SUMMARY}"
|
|
151
|
-
fi
|
|
152
|
-
fi
|
|
153
|
-
done
|
|
154
|
-
fi
|
|
155
|
-
|
|
156
|
-
# Output all active command summaries
|
|
157
|
-
if [ ! -z "$COMMAND_SUMMARIES" ]; then
|
|
158
|
-
echo -e "$COMMAND_SUMMARIES"
|
|
159
|
-
fi
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
See `scripts/precompact-context.sh` for the full implementation.
|
|
163
|
-
|
|
164
|
-
### Step 3: Make Script Executable
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
chmod +x scripts/precompact-context.sh
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Step 4: Add PreCompact Hook to Settings
|
|
171
|
-
|
|
172
|
-
Read current `.claude/settings.json` and add PreCompact hook:
|
|
173
|
-
|
|
174
|
-
```json
|
|
175
|
-
{
|
|
176
|
-
"hooks": {
|
|
177
|
-
"PreCompact": [
|
|
178
|
-
{
|
|
179
|
-
"matcher": "",
|
|
180
|
-
"hooks": [
|
|
181
|
-
{
|
|
182
|
-
"type": "command",
|
|
183
|
-
"command": "bash .agileflow/scripts/precompact-context.sh"
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
**Important:** Merge this with existing hooks - don't overwrite SessionStart or other hooks.
|
|
193
|
-
|
|
194
|
-
### Step 5: Update Metadata with Version
|
|
195
|
-
|
|
196
|
-
Record the configured version in metadata for version tracking:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
node -e "
|
|
200
|
-
const fs = require('fs');
|
|
201
|
-
const metaPath = 'docs/00-meta/agileflow-metadata.json';
|
|
202
|
-
const meta = JSON.parse(fs.readFileSync(metaPath, 'utf8'));
|
|
203
|
-
|
|
204
|
-
// Initialize features object if needed
|
|
205
|
-
meta.features = meta.features || {};
|
|
206
|
-
|
|
207
|
-
// Record precompact configuration
|
|
208
|
-
meta.features.precompact = {
|
|
209
|
-
enabled: true,
|
|
210
|
-
configured_version: '2.40.0',
|
|
211
|
-
configured_at: new Date().toISOString()
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
meta.updated = new Date().toISOString();
|
|
215
|
-
fs.writeFileSync(metaPath, JSON.stringify(meta, null, 2));
|
|
216
|
-
console.log('Updated metadata with precompact version 2.40.0');
|
|
217
|
-
"
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
**Why version tracking?** Users with older configurations will see warnings in the welcome screen if their PreCompact is outdated (e.g., using old single-command pattern instead of multi-command support).
|
|
221
|
-
|
|
222
|
-
### Step 6: Test the Hook
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
bash .agileflow/scripts/precompact-context.sh
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
Should output project context. Verify it shows:
|
|
229
|
-
- Project name and version
|
|
230
|
-
- Current git branch
|
|
231
|
-
- Active story (if any)
|
|
232
|
-
- Key conventions from CLAUDE.md
|
|
233
|
-
- Key directories
|
|
234
|
-
|
|
235
|
-
### Step 7: Document in CLAUDE.md
|
|
236
|
-
|
|
237
|
-
Add to CLAUDE.md:
|
|
238
|
-
|
|
239
|
-
```markdown
|
|
240
|
-
## PreCompact Hook
|
|
241
|
-
|
|
242
|
-
**Purpose**: Preserve critical project context during conversation compacts.
|
|
243
|
-
|
|
244
|
-
**Script**: `scripts/precompact-context.sh`
|
|
245
|
-
|
|
246
|
-
**When it runs**: Automatically before Claude compacts the conversation (either manually via `/compact` or automatically when context fills).
|
|
247
|
-
|
|
248
|
-
**What it preserves**:
|
|
249
|
-
- Project version, git branch, active stories, WIP count
|
|
250
|
-
- Active epics list and practices list
|
|
251
|
-
- Key conventions from CLAUDE.md
|
|
252
|
-
- Recent agent activity from bus/log.jsonl
|
|
253
|
-
- Post-compact action reminders
|
|
254
|
-
|
|
255
|
-
**To customize**: Edit `scripts/precompact-context.sh` to change what context is preserved.
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## User Customization Options
|
|
259
|
-
|
|
260
|
-
Ask the user what to include in the PreCompact output:
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
What information should be preserved during compacts?
|
|
264
|
-
|
|
265
|
-
1. Project basics (version, branch, active story) - RECOMMENDED
|
|
266
|
-
2. Full CLAUDE.md conventions
|
|
267
|
-
3. Recent git commits
|
|
268
|
-
4. Custom context (specify)
|
|
269
|
-
|
|
270
|
-
Select options (default: 1):
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
## Output
|
|
274
|
-
|
|
275
|
-
After configuration:
|
|
276
|
-
|
|
277
|
-
```
|
|
278
|
-
✅ PreCompact Hook Configured!
|
|
279
|
-
|
|
280
|
-
Created: scripts/precompact-context.sh
|
|
281
|
-
Updated: .claude/settings.json
|
|
282
|
-
|
|
283
|
-
What happens now:
|
|
284
|
-
- Before any compact, the hook runs automatically
|
|
285
|
-
- Critical project context is output and preserved
|
|
286
|
-
- Your conventions and current work survive summarization
|
|
287
|
-
|
|
288
|
-
Test it now:
|
|
289
|
-
bash .agileflow/scripts/precompact-context.sh
|
|
290
|
-
|
|
291
|
-
To trigger a compact manually:
|
|
292
|
-
/compact "Additional focus areas to preserve"
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
## Rules
|
|
296
|
-
|
|
297
|
-
- REQUIRE hooks system to be configured first
|
|
298
|
-
- CREATE scripts/precompact-context.sh with intelligent defaults
|
|
299
|
-
- MERGE PreCompact hook into existing settings.json (don't overwrite)
|
|
300
|
-
- TEST the script before confirming success
|
|
301
|
-
- DOCUMENT in CLAUDE.md for future reference
|
|
302
|
-
- OFFER customization options for what to preserve
|