agileflow 2.41.0 → 2.42.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.
|
@@ -1,531 +1,285 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Configure advanced AgileFlow features (git, hooks, archival, CI, status line)
|
|
3
|
-
argument-hint:
|
|
3
|
+
argument-hint: [--profile=full|basic|minimal|none] [--enable/--disable=features] [--migrate]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- COMPACT_SUMMARY_START
|
|
7
|
-
This section is extracted by the PreCompact hook to preserve essential context across conversation compacts.
|
|
8
|
-
-->
|
|
6
|
+
<!-- COMPACT_SUMMARY_START -->
|
|
9
7
|
|
|
10
8
|
## Compact Summary
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
Configuration management with **profiles**, **enable/disable**, and **format migration**.
|
|
13
11
|
|
|
14
|
-
###
|
|
12
|
+
### Workflow (MUST FOLLOW)
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **Spawn agents in PARALLEL** (single message) when no dependencies exist
|
|
20
|
-
- **Respect agent dependencies**: Hooks System MUST run before Auto-Archival, Status Line, and PreCompact
|
|
21
|
-
- **Reminder required**: If hooks or status line configured, display "🔴 RESTART CLAUDE CODE NOW!"
|
|
22
|
-
- **Be idempotent**: Safe to run multiple times, reconfiguration allowed
|
|
14
|
+
1. **Run detection**: `node scripts/agileflow-configure.js --detect`
|
|
15
|
+
2. **If ⚠️ INVALID FORMAT shown**: Ask user to fix with `--migrate` BEFORE anything else
|
|
16
|
+
3. **Present options**: Profiles, enable/disable, or check status
|
|
23
17
|
|
|
24
|
-
###
|
|
18
|
+
### Quick Commands
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Available Configuration Agents
|
|
35
|
-
|
|
36
|
-
- **git-config**: Initialize git repo and add remote
|
|
37
|
-
- **attribution**: Configure CLAUDE.md AI attribution policy
|
|
38
|
-
- **hooks**: Deploy hooks system (SessionStart welcome, PreCompact context preservation, activity logging)
|
|
39
|
-
- **archival**: Auto-archive completed stories (threshold-based)
|
|
40
|
-
- **ci**: Set up GitHub Actions/GitLab CI/CircleCI workflows
|
|
41
|
-
- **status-line**: Custom Claude Code status bar (story/WIP/completion)
|
|
20
|
+
```bash
|
|
21
|
+
node scripts/agileflow-configure.js --detect # Check status
|
|
22
|
+
node scripts/agileflow-configure.js --migrate # Fix format issues
|
|
23
|
+
node scripts/agileflow-configure.js --profile=full # Enable all
|
|
24
|
+
node scripts/agileflow-configure.js --profile=none # Disable all
|
|
25
|
+
node scripts/agileflow-configure.js --enable=stop # Enable specific
|
|
26
|
+
node scripts/agileflow-configure.js --disable=archival # Disable specific
|
|
27
|
+
```
|
|
42
28
|
|
|
43
|
-
###
|
|
29
|
+
### Features
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
- Status Line → Hooks System (requires .claude/settings.json)
|
|
47
|
-
- Git Config, Attribution, CI/CD → Independent (no dependencies)
|
|
31
|
+
`sessionstart`, `precompact`, `stop`, `archival`, `statusline`
|
|
48
32
|
|
|
49
|
-
###
|
|
33
|
+
### Critical Rules
|
|
50
34
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- `scripts/agileflow-welcome.js` - SessionStart welcome script (hooks agent)
|
|
55
|
-
- `scripts/precompact-context.sh` - PreCompact context preservation (hooks agent)
|
|
56
|
-
- `scripts/archive-completed-stories.sh` - Archival script
|
|
57
|
-
- `scripts/agileflow-statusline.sh` - Status line script
|
|
58
|
-
- `.github/workflows/ci.yml` - GitHub Actions workflow (CI agent)
|
|
35
|
+
- **Check for format issues FIRST** - offer to fix before other options
|
|
36
|
+
- **Backup created** on migrate: `.claude/settings.json.backup`
|
|
37
|
+
- **Restart required** - always show red banner after changes
|
|
59
38
|
|
|
60
39
|
<!-- COMPACT_SUMMARY_END -->
|
|
61
40
|
|
|
62
41
|
# configure
|
|
63
42
|
|
|
64
|
-
|
|
43
|
+
Manage AgileFlow features with profiles, enable/disable, and format migration.
|
|
65
44
|
|
|
66
45
|
## Prompt
|
|
67
46
|
|
|
68
|
-
ROLE: Configuration
|
|
69
|
-
|
|
70
|
-
🔴 **AskUserQuestion Format**: NEVER ask users to "type" anything. Use proper options with XML invoke format. See `docs/02-practices/ask-user-question.md`.
|
|
71
|
-
|
|
72
|
-
OBJECTIVE
|
|
73
|
-
Guide users through interactive configuration of advanced AgileFlow features by spawning specialized configuration agents. This orchestrator uses the AskUserQuestion tool to present options, then spawns agents asynchronously for optimal performance.
|
|
47
|
+
ROLE: Configuration Manager
|
|
74
48
|
|
|
75
|
-
|
|
49
|
+
## STEP 1: Always Run Detection First
|
|
76
50
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
1. Detects current configuration status
|
|
81
|
-
2. Presents interactive menu using **AskUserQuestion tool**
|
|
82
|
-
3. Spawns specialized **configuration agents** for selected features
|
|
83
|
-
4. Runs agents **asynchronously** (parallel execution for speed)
|
|
84
|
-
5. Reports results from each agent
|
|
51
|
+
```bash
|
|
52
|
+
node scripts/agileflow-configure.js --detect
|
|
53
|
+
```
|
|
85
54
|
|
|
86
|
-
|
|
55
|
+
**CRITICAL**: Check the output for format issues (⚠️ INVALID FORMAT).
|
|
87
56
|
|
|
88
|
-
|
|
89
|
-
- **Git Config** (`AgileFlow:agents:configuration:git-config`) - Repository initialization and remote setup
|
|
90
|
-
- **Attribution** (`AgileFlow:agents:configuration:attribution`) - CLAUDE.md attribution preferences
|
|
91
|
-
- **Hooks System** (`AgileFlow:agents:configuration:hooks`) - Event-driven automation
|
|
92
|
-
- **Auto-Archival** (`AgileFlow:agents:configuration:archival`) - Status.json size management
|
|
93
|
-
- **CI/CD** (`AgileFlow:agents:configuration:ci`) - Automated testing and quality checks
|
|
94
|
-
- **Status Line** (`AgileFlow:agents:configuration:status-line`) - Custom Claude Code status bar with AgileFlow context
|
|
95
|
-
- **PreCompact** (`AgileFlow:agents:configuration:precompact`) - Context preservation during conversation compacts
|
|
57
|
+
## STEP 2: If Format Issues Detected → Offer Migration FIRST
|
|
96
58
|
|
|
97
|
-
|
|
59
|
+
If you see `⚠️ INVALID FORMAT` in the detection output, **immediately ask user about fixing**:
|
|
98
60
|
|
|
99
|
-
|
|
61
|
+
```xml
|
|
62
|
+
<invoke name="AskUserQuestion">
|
|
63
|
+
<parameter name="questions">[{
|
|
64
|
+
"question": "Format issues detected in your settings! These will cause Claude Code errors. Fix them now?",
|
|
65
|
+
"header": "Fix Issues",
|
|
66
|
+
"multiSelect": false,
|
|
67
|
+
"options": [
|
|
68
|
+
{"label": "Yes, fix format issues (Recommended)", "description": "Migrate old formats to new Claude Code format. Creates backup first."},
|
|
69
|
+
{"label": "No, skip for now", "description": "Continue with configuration (issues will remain)"}
|
|
70
|
+
]
|
|
71
|
+
}]</parameter>
|
|
72
|
+
</invoke>
|
|
73
|
+
```
|
|
100
74
|
|
|
75
|
+
If user says yes:
|
|
101
76
|
```bash
|
|
102
|
-
|
|
103
|
-
echo "===================================="
|
|
104
|
-
|
|
105
|
-
# Check git initialization
|
|
106
|
-
if [ -d .git ]; then
|
|
107
|
-
echo "✅ Git initialized"
|
|
108
|
-
GIT_INIT=true
|
|
109
|
-
else
|
|
110
|
-
echo "❌ Git not initialized"
|
|
111
|
-
GIT_INIT=false
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
# Check git remote
|
|
115
|
-
if git remote -v 2>/dev/null | grep -q origin; then
|
|
116
|
-
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
|
|
117
|
-
echo "✅ Git remote configured: $REMOTE_URL"
|
|
118
|
-
GIT_REMOTE=true
|
|
119
|
-
else
|
|
120
|
-
echo "⚠️ Git remote not configured"
|
|
121
|
-
GIT_REMOTE=false
|
|
122
|
-
fi
|
|
123
|
-
|
|
124
|
-
# Check CLAUDE.md
|
|
125
|
-
if [ -f CLAUDE.md ]; then
|
|
126
|
-
echo "✅ CLAUDE.md exists"
|
|
127
|
-
if grep -q "NO AI Attribution" CLAUDE.md 2>/dev/null; then
|
|
128
|
-
echo " Attribution: DISABLED"
|
|
129
|
-
ATTRIBUTION_CONFIGURED=true
|
|
130
|
-
else
|
|
131
|
-
echo " Attribution: ENABLED (default)"
|
|
132
|
-
ATTRIBUTION_CONFIGURED=true
|
|
133
|
-
fi
|
|
134
|
-
CLAUDE_EXISTS=true
|
|
135
|
-
else
|
|
136
|
-
echo "⚠️ CLAUDE.md not found"
|
|
137
|
-
CLAUDE_EXISTS=false
|
|
138
|
-
ATTRIBUTION_CONFIGURED=false
|
|
139
|
-
fi
|
|
140
|
-
|
|
141
|
-
# Check hooks system
|
|
142
|
-
if [ -d .claude ] && [ -f .claude/settings.json ]; then
|
|
143
|
-
echo "✅ Hooks system configured"
|
|
144
|
-
HOOKS_CONFIGURED=true
|
|
145
|
-
else
|
|
146
|
-
echo "❌ Hooks system not configured"
|
|
147
|
-
HOOKS_CONFIGURED=false
|
|
148
|
-
fi
|
|
149
|
-
|
|
150
|
-
# Check auto-archival
|
|
151
|
-
if [ -f scripts/archive-completed-stories.sh ] && grep -q "archive-completed-stories.sh" .claude/settings.json 2>/dev/null; then
|
|
152
|
-
THRESHOLD=$(jq -r '.archival.threshold_days // "not configured"' docs/00-meta/agileflow-metadata.json 2>/dev/null)
|
|
153
|
-
echo "✅ Auto-archival configured (threshold: $THRESHOLD days)"
|
|
154
|
-
ARCHIVAL_CONFIGURED=true
|
|
155
|
-
else
|
|
156
|
-
echo "❌ Auto-archival not configured"
|
|
157
|
-
ARCHIVAL_CONFIGURED=false
|
|
158
|
-
fi
|
|
159
|
-
|
|
160
|
-
# Check CI/CD
|
|
161
|
-
if [ -d .github/workflows ] && [ "$(ls -A .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null | wc -l)" -gt 0 ]; then
|
|
162
|
-
echo "✅ CI/CD configured (GitHub Actions)"
|
|
163
|
-
CI_CONFIGURED=true
|
|
164
|
-
elif [ -f .gitlab-ci.yml ]; then
|
|
165
|
-
echo "✅ CI/CD configured (GitLab CI)"
|
|
166
|
-
CI_CONFIGURED=true
|
|
167
|
-
elif [ -f .circleci/config.yml ]; then
|
|
168
|
-
echo "✅ CI/CD configured (CircleCI)"
|
|
169
|
-
CI_CONFIGURED=true
|
|
170
|
-
else
|
|
171
|
-
echo "❌ CI/CD not configured"
|
|
172
|
-
CI_CONFIGURED=false
|
|
173
|
-
fi
|
|
174
|
-
|
|
175
|
-
# Check status line
|
|
176
|
-
if [ -f scripts/agileflow-statusline.sh ] && grep -q "statusLine" .claude/settings.json 2>/dev/null; then
|
|
177
|
-
echo "✅ Status line configured"
|
|
178
|
-
STATUSLINE_CONFIGURED=true
|
|
179
|
-
else
|
|
180
|
-
echo "❌ Status line not configured"
|
|
181
|
-
STATUSLINE_CONFIGURED=false
|
|
182
|
-
fi
|
|
183
|
-
|
|
184
|
-
# Check PreCompact hook (part of hooks system)
|
|
185
|
-
if [ -f scripts/precompact-context.sh ] && grep -q "PreCompact" .claude/settings.json 2>/dev/null; then
|
|
186
|
-
PRECOMPACT_VERSION=$(jq -r '.features.precompact.configured_version // "unknown"' docs/00-meta/agileflow-metadata.json 2>/dev/null)
|
|
187
|
-
if [ "$PRECOMPACT_VERSION" = "unknown" ] || [ "$PRECOMPACT_VERSION" = "null" ]; then
|
|
188
|
-
echo " └─ PreCompact: ⚠️ configured (version unknown)"
|
|
189
|
-
else
|
|
190
|
-
echo " └─ PreCompact: ✅ v$PRECOMPACT_VERSION"
|
|
191
|
-
fi
|
|
192
|
-
else
|
|
193
|
-
echo " └─ PreCompact: ❌ not enabled"
|
|
194
|
-
fi
|
|
195
|
-
|
|
196
|
-
echo "===================================="
|
|
197
|
-
echo ""
|
|
77
|
+
node scripts/agileflow-configure.js --migrate
|
|
198
78
|
```
|
|
199
79
|
|
|
200
|
-
##
|
|
201
|
-
|
|
202
|
-
After detection, present configuration options using the **AskUserQuestion tool**:
|
|
80
|
+
## STEP 3: Configuration Options
|
|
203
81
|
|
|
204
|
-
|
|
82
|
+
After fixing issues (or if no issues), present main options:
|
|
205
83
|
|
|
206
|
-
The AskUserQuestion tool allows you to prompt the user for input. It requires XML invocation format with JSON-structured parameters.
|
|
207
|
-
|
|
208
|
-
**Required Format**:
|
|
209
84
|
```xml
|
|
210
85
|
<invoke name="AskUserQuestion">
|
|
211
86
|
<parameter name="questions">[{
|
|
212
|
-
"question": "
|
|
213
|
-
"header": "
|
|
87
|
+
"question": "What would you like to do?",
|
|
88
|
+
"header": "Configure",
|
|
214
89
|
"multiSelect": false,
|
|
215
90
|
"options": [
|
|
216
|
-
{"label": "
|
|
217
|
-
{"label": "
|
|
91
|
+
{"label": "Quick setup (full profile)", "description": "Enable all features: hooks, archival, status line"},
|
|
92
|
+
{"label": "Basic setup", "description": "SessionStart + PreCompact + Archival"},
|
|
93
|
+
{"label": "Enable specific features", "description": "Choose which features to enable"},
|
|
94
|
+
{"label": "Disable specific features", "description": "Choose which features to disable"},
|
|
95
|
+
{"label": "Check current status only", "description": "Already done - no changes needed"}
|
|
218
96
|
]
|
|
219
97
|
}]</parameter>
|
|
220
98
|
</invoke>
|
|
221
99
|
```
|
|
222
100
|
|
|
223
|
-
|
|
101
|
+
## Profile Commands
|
|
102
|
+
|
|
103
|
+
**Use a profile:**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Full - all features
|
|
107
|
+
node scripts/agileflow-configure.js --profile=full
|
|
108
|
+
|
|
109
|
+
# Basic - essential hooks + archival
|
|
110
|
+
node scripts/agileflow-configure.js --profile=basic
|
|
111
|
+
|
|
112
|
+
# Minimal - welcome + archival
|
|
113
|
+
node scripts/agileflow-configure.js --profile=minimal
|
|
114
|
+
|
|
115
|
+
# None - disable all AgileFlow features
|
|
116
|
+
node scripts/agileflow-configure.js --profile=none
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Option B: Enable/disable specific features**
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Enable features
|
|
123
|
+
node scripts/agileflow-configure.js --enable=sessionstart,precompact,stop
|
|
124
|
+
|
|
125
|
+
# Disable features
|
|
126
|
+
node scripts/agileflow-configure.js --disable=statusline
|
|
127
|
+
|
|
128
|
+
# Both at once
|
|
129
|
+
node scripts/agileflow-configure.js --enable=stop --disable=archival
|
|
130
|
+
|
|
131
|
+
# With custom archival days
|
|
132
|
+
node scripts/agileflow-configure.js --enable=archival --archival-days=14
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Profile Details
|
|
136
|
+
|
|
137
|
+
| Profile | SessionStart | PreCompact | Stop | Archival | StatusLine |
|
|
138
|
+
|---------|-------------|------------|------|----------|------------|
|
|
139
|
+
| `full` | ✅ | ✅ | ✅ | ✅ 7 days | ✅ |
|
|
140
|
+
| `basic` | ✅ | ✅ | ❌ | ✅ 7 days | ❌ |
|
|
141
|
+
| `minimal` | ✅ | ❌ | ❌ | ✅ 7 days | ❌ |
|
|
142
|
+
| `none` | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
143
|
+
|
|
144
|
+
## Interactive Mode (via /configure command)
|
|
145
|
+
|
|
146
|
+
When user runs `/configure` without arguments, present options:
|
|
147
|
+
|
|
224
148
|
```xml
|
|
225
149
|
<invoke name="AskUserQuestion">
|
|
226
150
|
<parameter name="questions">[{
|
|
227
|
-
"question": "
|
|
228
|
-
"header": "
|
|
151
|
+
"question": "What would you like to do?",
|
|
152
|
+
"header": "Configure",
|
|
229
153
|
"multiSelect": false,
|
|
230
154
|
"options": [
|
|
231
|
-
{"label": "
|
|
232
|
-
{"label": "
|
|
233
|
-
{"label": "
|
|
234
|
-
{"label": "
|
|
155
|
+
{"label": "Quick setup (full profile)", "description": "Enable all features: hooks, archival, status line"},
|
|
156
|
+
{"label": "Basic setup", "description": "SessionStart + PreCompact + Archival"},
|
|
157
|
+
{"label": "Fix format issues", "description": "Migrate old/invalid settings formats"},
|
|
158
|
+
{"label": "Enable specific features", "description": "Choose which features to enable"},
|
|
159
|
+
{"label": "Disable specific features", "description": "Choose which features to disable"},
|
|
160
|
+
{"label": "Check current status", "description": "See what's currently configured"}
|
|
235
161
|
]
|
|
236
162
|
}]</parameter>
|
|
237
163
|
</invoke>
|
|
238
164
|
```
|
|
239
165
|
|
|
240
|
-
|
|
166
|
+
Based on selection, run appropriate command.
|
|
167
|
+
|
|
168
|
+
## Feature Selection (when Enable/Disable selected)
|
|
169
|
+
|
|
241
170
|
```xml
|
|
242
171
|
<invoke name="AskUserQuestion">
|
|
243
172
|
<parameter name="questions">[{
|
|
244
|
-
"question": "Which features
|
|
173
|
+
"question": "Which features?",
|
|
245
174
|
"header": "Features",
|
|
246
175
|
"multiSelect": true,
|
|
247
176
|
"options": [
|
|
248
|
-
{"label": "
|
|
249
|
-
{"label": "
|
|
250
|
-
{"label": "
|
|
251
|
-
{"label": "
|
|
177
|
+
{"label": "SessionStart Hook", "description": "Welcome display with project status"},
|
|
178
|
+
{"label": "PreCompact Hook", "description": "Context preservation on compact"},
|
|
179
|
+
{"label": "Stop Hook", "description": "Warns about uncommitted git changes"},
|
|
180
|
+
{"label": "Archival", "description": "Auto-archive old completed stories"},
|
|
181
|
+
{"label": "Status Line", "description": "Custom status bar"}
|
|
252
182
|
]
|
|
253
183
|
}]</parameter>
|
|
254
184
|
</invoke>
|
|
255
185
|
```
|
|
256
186
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
Use AskUserQuestion to let user select features:
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
Which features would you like to configure?
|
|
267
|
-
|
|
268
|
-
Available options:
|
|
269
|
-
1. Git Repository (initialize and add remote)
|
|
270
|
-
2. Attribution Settings (CLAUDE.md git attribution policy)
|
|
271
|
-
3. Hooks System (event-driven automation - includes SessionStart, PreCompact, logging)
|
|
272
|
-
4. Auto-Archival (status.json size management)
|
|
273
|
-
5. CI/CD (automated testing and quality checks)
|
|
274
|
-
6. Status Line (custom status bar with story/WIP/context info)
|
|
275
|
-
|
|
276
|
-
You can select multiple options. Features already configured are marked with ✅.
|
|
277
|
-
|
|
278
|
-
Current status:
|
|
279
|
-
- Git Repository: [✅ Configured / ❌ Not configured]
|
|
280
|
-
- Attribution: [✅ Configured / ⚠️ Needs setup]
|
|
281
|
-
- Hooks System: [✅ Configured / ❌ Not configured]
|
|
282
|
-
└─ PreCompact: [✅ Enabled / ❌ Not enabled]
|
|
283
|
-
- Auto-Archival: [✅ Configured / ❌ Not configured]
|
|
284
|
-
- CI/CD: [✅ Configured / ❌ Not configured]
|
|
285
|
-
- Status Line: [✅ Configured / ❌ Not configured]
|
|
286
|
-
|
|
287
|
-
Select features to configure:
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**Important**: Use the AskUserQuestion tool with `"multiSelect": true` in the JSON parameters to allow users to select multiple features at once.
|
|
187
|
+
Map selections:
|
|
188
|
+
- "SessionStart Hook" → `sessionstart`
|
|
189
|
+
- "PreCompact Hook" → `precompact`
|
|
190
|
+
- "Stop Hook" → `stop`
|
|
191
|
+
- "Archival" → `archival`
|
|
192
|
+
- "Status Line" → `statusline`
|
|
291
193
|
|
|
292
|
-
##
|
|
194
|
+
## Format Migration Details
|
|
293
195
|
|
|
294
|
-
|
|
196
|
+
The script handles these migrations automatically:
|
|
295
197
|
|
|
296
|
-
|
|
198
|
+
**Hook string format:**
|
|
199
|
+
```json
|
|
200
|
+
// OLD (invalid)
|
|
201
|
+
"PreCompact": "./scripts/precompact-context.sh"
|
|
297
202
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
```javascript
|
|
301
|
-
Task({
|
|
302
|
-
subagent_type: "AgileFlow:agents:configuration:git-config",
|
|
303
|
-
description: "Configure git repository",
|
|
304
|
-
prompt: "Set up git repository initialization and remote configuration for this AgileFlow project. Detect current git status, ask user for remote URL if needed, and update metadata."
|
|
305
|
-
})
|
|
203
|
+
// NEW (valid)
|
|
204
|
+
"PreCompact": [{"matcher": "", "hooks": [{"type": "command", "command": "bash ./scripts/precompact-context.sh"}]}]
|
|
306
205
|
```
|
|
307
206
|
|
|
308
|
-
|
|
207
|
+
**StatusLine missing type:**
|
|
208
|
+
```json
|
|
209
|
+
// OLD (invalid)
|
|
210
|
+
"statusLine": {"command": "./scripts/statusline.sh", "refreshInterval": 5000}
|
|
309
211
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
subagent_type: "AgileFlow:agents:configuration:attribution",
|
|
313
|
-
description: "Configure attribution policy",
|
|
314
|
-
prompt: "Configure CLAUDE.md with user's git attribution preferences. Ask if they want to disable Claude Code attribution in commits, then create or update CLAUDE.md accordingly."
|
|
315
|
-
})
|
|
212
|
+
// NEW (valid)
|
|
213
|
+
"statusLine": {"type": "command", "command": "./scripts/statusline.sh", "padding": 0}
|
|
316
214
|
```
|
|
317
215
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
216
|
+
## Metadata Tracking
|
|
217
|
+
|
|
218
|
+
The script updates `docs/00-meta/agileflow-metadata.json`:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"version": "2.41.0",
|
|
223
|
+
"updated": "2025-12-22T...",
|
|
224
|
+
"archival": {
|
|
225
|
+
"enabled": true,
|
|
226
|
+
"threshold_days": 7
|
|
227
|
+
},
|
|
228
|
+
"features": {
|
|
229
|
+
"sessionstart": {"enabled": true, "version": "2.41.0", "at": "..."},
|
|
230
|
+
"precompact": {"enabled": true, "version": "2.41.0", "at": "..."},
|
|
231
|
+
"stop": {"enabled": true, "version": "2.41.0", "at": "..."},
|
|
232
|
+
"archival": {"enabled": true, "version": "2.41.0", "at": "..."},
|
|
233
|
+
"statusline": {"enabled": true, "version": "2.41.0", "at": "..."}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
326
236
|
```
|
|
327
237
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
```javascript
|
|
331
|
-
Task({
|
|
332
|
-
subagent_type: "AgileFlow:agents:configuration:archival",
|
|
333
|
-
description: "Configure auto-archival",
|
|
334
|
-
prompt: "Configure auto-archival system for status.json size management. Ask user for archival threshold (3/7/14/30 days), deploy archival scripts, add SessionStart hook, and document in CLAUDE.md."
|
|
335
|
-
})
|
|
336
|
-
```
|
|
238
|
+
## Complex Features (Spawn Agents)
|
|
337
239
|
|
|
338
|
-
|
|
240
|
+
For features needing extra user input, spawn specialized agents:
|
|
339
241
|
|
|
340
242
|
```javascript
|
|
243
|
+
// CI/CD - needs provider and commands
|
|
341
244
|
Task({
|
|
342
245
|
subagent_type: "AgileFlow:agents:configuration:ci",
|
|
343
|
-
description: "Configure CI/CD
|
|
344
|
-
prompt: "Set up CI/CD workflow
|
|
246
|
+
description: "Configure CI/CD",
|
|
247
|
+
prompt: "Set up CI/CD workflow. Ask for provider (GitHub Actions, GitLab CI, CircleCI) and commands."
|
|
345
248
|
})
|
|
346
|
-
```
|
|
347
249
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
```javascript
|
|
250
|
+
// Git config - needs remote URL
|
|
351
251
|
Task({
|
|
352
|
-
subagent_type: "AgileFlow:agents:configuration:
|
|
353
|
-
description: "Configure
|
|
354
|
-
prompt: "Set up
|
|
252
|
+
subagent_type: "AgileFlow:agents:configuration:git-config",
|
|
253
|
+
description: "Configure git",
|
|
254
|
+
prompt: "Set up git remote. Ask for URL."
|
|
355
255
|
})
|
|
356
256
|
```
|
|
357
257
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
**CRITICAL**: Spawn multiple agents in a **single message** for parallel execution:
|
|
361
|
-
|
|
362
|
-
```javascript
|
|
363
|
-
// ✅ CORRECT - All agents run in parallel (fast)
|
|
364
|
-
Task({ subagent_type: "AgileFlow:agents:configuration:git-config", ... })
|
|
365
|
-
Task({ subagent_type: "AgileFlow:agents:configuration:attribution", ... })
|
|
366
|
-
Task({ subagent_type: "AgileFlow:agents:configuration:hooks", ... })
|
|
367
|
-
|
|
368
|
-
// ❌ WRONG - Sequential execution (slow)
|
|
369
|
-
// Spawning agents in separate messages
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
**Exception**: Auto-archival agent REQUIRES hooks system to be configured first (dependency). Run it sequentially AFTER hooks if both are selected.
|
|
373
|
-
|
|
374
|
-
### Agent Dependencies
|
|
375
|
-
|
|
376
|
-
Some agents have dependencies:
|
|
377
|
-
- **Auto-Archival** depends on **Hooks System** (needs .claude/settings.json to exist)
|
|
378
|
-
- **Status Line** depends on **Hooks System** (needs .claude/settings.json to exist)
|
|
379
|
-
- **Git Config**, **Attribution**, and **CI/CD** are independent (can run in parallel)
|
|
380
|
-
|
|
381
|
-
**Note**: PreCompact is now part of the Hooks System agent - users select which hooks to enable during hooks configuration.
|
|
258
|
+
## Rules
|
|
382
259
|
|
|
383
|
-
**
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
4. If user selects all 6: Run Git + Attribution + CI in parallel, wait, then run Hooks, wait, then run Archival + Status Line in parallel
|
|
260
|
+
1. **Always show detection first** - User sees current state before changes
|
|
261
|
+
2. **Auto-migrate on enable** - Script fixes format issues automatically when enabling features
|
|
262
|
+
3. **Backup on migrate** - Creates `.claude/settings.json.backup`
|
|
263
|
+
4. **Restart reminder** - Always show red banner after changes
|
|
388
264
|
|
|
389
|
-
##
|
|
265
|
+
## Output Format
|
|
390
266
|
|
|
391
|
-
After
|
|
267
|
+
After configuration:
|
|
392
268
|
|
|
393
269
|
```
|
|
394
270
|
✅ Configuration Complete!
|
|
395
271
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
└─ SessionStart: [✅ Enabled / ⏭️ Skipped]
|
|
401
|
-
└─ PreCompact: [✅ Enabled / ⏭️ Skipped]
|
|
402
|
-
- Auto-Archival: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
403
|
-
- CI/CD: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
404
|
-
- Status Line: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
405
|
-
|
|
406
|
-
Next steps:
|
|
407
|
-
[Agent-specific next steps from results]
|
|
408
|
-
```
|
|
272
|
+
Enabled:
|
|
273
|
+
✅ sessionstart
|
|
274
|
+
✅ precompact
|
|
275
|
+
✅ stop
|
|
409
276
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
- Still show it in the menu (let user reconfigure)
|
|
414
|
-
- OR filter it out and only show unconfigured features
|
|
415
|
-
|
|
416
|
-
**Recommended**: Show all features but mark configured ones with ✅ in the menu.
|
|
417
|
-
|
|
418
|
-
## Error Handling
|
|
419
|
-
|
|
420
|
-
If an agent fails:
|
|
421
|
-
- Report the failure clearly
|
|
422
|
-
- Continue with other agents (don't abort entire configuration)
|
|
423
|
-
- Suggest manual steps if automated configuration failed
|
|
424
|
-
|
|
425
|
-
## What Gets Configured
|
|
426
|
-
|
|
427
|
-
### 1. Git Repository (git-config agent)
|
|
428
|
-
- Initialize git repository (`git init`)
|
|
429
|
-
- Add remote origin (`git remote add origin <URL>`)
|
|
430
|
-
- Update `docs/00-meta/agileflow-metadata.json` with git config
|
|
431
|
-
- Print next steps (commit, push)
|
|
432
|
-
|
|
433
|
-
### 2. Attribution Settings (attribution agent)
|
|
434
|
-
- Ask user: Disable attribution? (yes/no)
|
|
435
|
-
- Create or update CLAUDE.md with attribution policy
|
|
436
|
-
- If disabled: Add CRITICAL section forbidding AI attribution
|
|
437
|
-
- If enabled: Keep default behavior (or remove disable rule if exists)
|
|
438
|
-
|
|
439
|
-
### 3. Hooks System (hooks agent)
|
|
440
|
-
- Create `.claude/` and `scripts/` directories
|
|
441
|
-
- **Ask user which hooks to enable** (SessionStart, PreCompact, UserPromptSubmit)
|
|
442
|
-
- Deploy selected hook scripts:
|
|
443
|
-
- `scripts/agileflow-welcome.js` - SessionStart welcome display
|
|
444
|
-
- `scripts/precompact-context.sh` - PreCompact context preservation
|
|
445
|
-
- Deploy `scripts/get-env.js` helper
|
|
446
|
-
- Create `.claude/settings.json` with selected hooks
|
|
447
|
-
- Update `.gitignore` with .claude user-specific files
|
|
448
|
-
- Create `.claude/settings.local.example.json` template
|
|
449
|
-
- Document in CLAUDE.md
|
|
450
|
-
- **CRITICAL**: Remind user to restart Claude Code
|
|
451
|
-
|
|
452
|
-
### 4. Auto-Archival (archival agent)
|
|
453
|
-
- Ask user for archival threshold (3/7/14/30 days or custom)
|
|
454
|
-
- Update `docs/00-meta/agileflow-metadata.json` with threshold
|
|
455
|
-
- Deploy `scripts/archive-completed-stories.sh`
|
|
456
|
-
- Deploy `scripts/compress-status.sh` (v2.20.0+)
|
|
457
|
-
- Add SessionStart hook to `.claude/settings.json`
|
|
458
|
-
- Document in CLAUDE.md
|
|
459
|
-
|
|
460
|
-
### 5. CI/CD (ci agent)
|
|
461
|
-
- Ask user for CI provider (GitHub Actions, GitLab CI, CircleCI, or skip)
|
|
462
|
-
- Detect project type and available commands
|
|
463
|
-
- Ask which commands to run in CI (tests, lint, type-check, build)
|
|
464
|
-
- Ask for specific command strings for each selected command
|
|
465
|
-
- Create workflow file (`.github/workflows/ci.yml`, `.gitlab-ci.yml`, or `.circleci/config.yml`)
|
|
466
|
-
- Document in CLAUDE.md with CI status, badge URL, and troubleshooting
|
|
467
|
-
|
|
468
|
-
### 6. Status Line (status-line agent)
|
|
469
|
-
- Ask user which components to display (story, WIP, context %, cost, git branch)
|
|
470
|
-
- Create `scripts/agileflow-statusline.sh` script
|
|
471
|
-
- Add `statusLine` configuration to `.claude/settings.json`
|
|
472
|
-
- Document in CLAUDE.md
|
|
473
|
-
- **CRITICAL**: Remind user to restart Claude Code
|
|
474
|
-
|
|
475
|
-
## Example Workflow
|
|
277
|
+
Disabled:
|
|
278
|
+
❌ archival
|
|
279
|
+
❌ statusline
|
|
476
280
|
|
|
281
|
+
═══════════════════════════════════════════════════════
|
|
282
|
+
🔴 RESTART CLAUDE CODE NOW!
|
|
283
|
+
Quit completely, wait 5 seconds, restart
|
|
284
|
+
═══════════════════════════════════════════════════════
|
|
477
285
|
```
|
|
478
|
-
1. User runs: /agileflow:configure
|
|
479
|
-
|
|
480
|
-
2. Orchestrator detects current status:
|
|
481
|
-
✅ Git initialized
|
|
482
|
-
⚠️ Git remote not configured
|
|
483
|
-
⚠️ CLAUDE.md not found
|
|
484
|
-
❌ Hooks system not configured
|
|
485
|
-
└─ PreCompact: ❌ not enabled
|
|
486
|
-
❌ Auto-archival not configured
|
|
487
|
-
❌ CI/CD not configured
|
|
488
|
-
❌ Status line not configured
|
|
489
|
-
|
|
490
|
-
3. Orchestrator presents menu using AskUserQuestion:
|
|
491
|
-
"Select features to configure: [Git Repository, Attribution Settings, Hooks System, Auto-Archival, CI/CD, Status Line]"
|
|
492
|
-
|
|
493
|
-
4. User selects: ["Attribution Settings", "Hooks System", "CI/CD"]
|
|
494
|
-
|
|
495
|
-
5. Orchestrator spawns agents:
|
|
496
|
-
Phase 1 (parallel): Attribution + CI/CD
|
|
497
|
-
Phase 2 (after phase 1): Hooks
|
|
498
|
-
- AgileFlow:agents:configuration:attribution
|
|
499
|
-
- AgileFlow:agents:configuration:ci
|
|
500
|
-
- AgileFlow:agents:configuration:hooks
|
|
501
|
-
|
|
502
|
-
6. Hooks agent asks user which hooks to enable:
|
|
503
|
-
User selects: [SessionStart, PreCompact]
|
|
504
|
-
|
|
505
|
-
7. Agents complete, orchestrator displays results:
|
|
506
|
-
✅ Attribution Settings configured (disabled AI attribution)
|
|
507
|
-
✅ CI/CD configured (GitHub Actions with tests + lint)
|
|
508
|
-
✅ Hooks System configured
|
|
509
|
-
└─ SessionStart: ✅ Enabled
|
|
510
|
-
└─ PreCompact: ✅ Enabled
|
|
511
|
-
🔴 REMINDER: Restart Claude Code for hooks to take effect!
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
## Rules
|
|
515
|
-
|
|
516
|
-
- ALWAYS run detection phase first
|
|
517
|
-
- Use AskUserQuestion tool for interactive menus
|
|
518
|
-
- Spawn agents in parallel when possible (single message)
|
|
519
|
-
- Respect agent dependencies (hooks before archival, hooks before status-line)
|
|
520
|
-
- Display clear results summary after completion
|
|
521
|
-
- Remind user to restart Claude Code if hooks or status line were configured
|
|
522
|
-
- Be idempotent (safe to run multiple times)
|
|
523
|
-
|
|
524
|
-
## Output
|
|
525
|
-
|
|
526
|
-
- Detection summary (current configuration status)
|
|
527
|
-
- Interactive menu (via AskUserQuestion)
|
|
528
|
-
- Agent spawn confirmations
|
|
529
|
-
- Final results summary
|
|
530
|
-
- Next steps (agent-specific guidance)
|
|
531
|
-
- **CRITICAL reminder** if hooks or status line configured: "🔴 RESTART CLAUDE CODE NOW!"
|