agileflow 2.51.0 → 2.56.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.
- package/README.md +80 -460
- package/package.json +18 -3
- package/scripts/agileflow-configure.js +134 -63
- package/scripts/agileflow-welcome.js +161 -31
- package/scripts/generators/agent-registry.js +45 -57
- package/scripts/generators/command-registry.js +48 -32
- package/scripts/generators/index.js +2 -6
- package/scripts/generators/inject-babysit.js +9 -2
- package/scripts/generators/inject-help.js +3 -1
- package/scripts/generators/inject-readme.js +7 -3
- package/scripts/generators/skill-registry.js +60 -33
- package/scripts/get-env.js +13 -12
- package/scripts/lib/frontmatter-parser.js +82 -0
- package/scripts/obtain-context.js +79 -26
- package/scripts/session-coordinator.sh +232 -0
- package/scripts/session-manager.js +512 -0
- package/src/core/agents/orchestrator.md +275 -0
- package/src/core/commands/adr.md +38 -16
- package/src/core/commands/agent.md +39 -22
- package/src/core/commands/assign.md +17 -0
- package/src/core/commands/auto.md +60 -46
- package/src/core/commands/babysit.md +302 -637
- package/src/core/commands/baseline.md +20 -0
- package/src/core/commands/blockers.md +33 -48
- package/src/core/commands/board.md +19 -0
- package/src/core/commands/changelog.md +20 -0
- package/src/core/commands/ci.md +17 -0
- package/src/core/commands/context.md +43 -40
- package/src/core/commands/debt.md +76 -45
- package/src/core/commands/deploy.md +20 -0
- package/src/core/commands/deps.md +40 -46
- package/src/core/commands/diagnose.md +24 -18
- package/src/core/commands/docs.md +18 -0
- package/src/core/commands/epic.md +31 -0
- package/src/core/commands/feedback.md +33 -21
- package/src/core/commands/handoff.md +29 -0
- package/src/core/commands/help.md +16 -7
- package/src/core/commands/impact.md +31 -61
- package/src/core/commands/metrics.md +17 -35
- package/src/core/commands/packages.md +21 -0
- package/src/core/commands/pr.md +15 -0
- package/src/core/commands/readme-sync.md +42 -9
- package/src/core/commands/research.md +58 -11
- package/src/core/commands/retro.md +42 -50
- package/src/core/commands/review.md +22 -27
- package/src/core/commands/session/end.md +53 -297
- package/src/core/commands/session/history.md +38 -257
- package/src/core/commands/session/init.md +44 -446
- package/src/core/commands/session/new.md +152 -0
- package/src/core/commands/session/resume.md +51 -447
- package/src/core/commands/session/status.md +32 -244
- package/src/core/commands/sprint.md +33 -0
- package/src/core/commands/status.md +18 -0
- package/src/core/commands/story-validate.md +32 -0
- package/src/core/commands/story.md +21 -6
- package/src/core/commands/template.md +18 -0
- package/src/core/commands/tests.md +22 -0
- package/src/core/commands/update.md +72 -58
- package/src/core/commands/validate-expertise.md +25 -37
- package/src/core/commands/velocity.md +33 -74
- package/src/core/commands/verify.md +16 -0
- package/src/core/experts/documentation/expertise.yaml +16 -2
- package/src/core/skills/agileflow-retro-facilitator/SKILL.md +57 -219
- package/src/core/skills/agileflow-retro-facilitator/cookbook/4ls.md +86 -0
- package/src/core/skills/agileflow-retro-facilitator/cookbook/glad-sad-mad.md +79 -0
- package/src/core/skills/agileflow-retro-facilitator/cookbook/start-stop-continue.md +142 -0
- package/src/core/skills/agileflow-retro-facilitator/prompts/action-items.md +83 -0
- package/src/core/skills/writing-skills/SKILL.md +352 -0
- package/src/core/skills/writing-skills/testing-skills-with-subagents.md +232 -0
- package/tools/cli/agileflow-cli.js +4 -2
- package/tools/cli/commands/config.js +20 -13
- package/tools/cli/commands/doctor.js +25 -9
- package/tools/cli/commands/list.js +10 -6
- package/tools/cli/commands/setup.js +54 -3
- package/tools/cli/commands/status.js +6 -8
- package/tools/cli/commands/uninstall.js +5 -5
- package/tools/cli/commands/update.js +51 -7
- package/tools/cli/installers/core/installer.js +8 -4
- package/tools/cli/installers/ide/_base-ide.js +58 -1
- package/tools/cli/installers/ide/claude-code.js +3 -61
- package/tools/cli/installers/ide/codex.js +440 -0
- package/tools/cli/installers/ide/cursor.js +21 -51
- package/tools/cli/installers/ide/manager.js +2 -6
- package/tools/cli/installers/ide/windsurf.js +20 -50
- package/tools/cli/lib/content-injector.js +26 -49
- package/tools/cli/lib/docs-setup.js +3 -2
- package/tools/cli/lib/npm-utils.js +39 -12
- package/tools/cli/lib/ui.js +31 -10
- package/tools/cli/lib/version-checker.js +3 -3
- package/tools/postinstall.js +2 -3
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# session-coordinator.sh - Automatic multi-session coordination
|
|
3
|
+
# Detects concurrent Claude Code sessions and handles conflicts
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
SESSIONS_DIR=".agileflow/sessions"
|
|
8
|
+
LOCK_TIMEOUT=3600 # 1 hour - stale session threshold
|
|
9
|
+
|
|
10
|
+
# Colors
|
|
11
|
+
RED='\033[0;31m'
|
|
12
|
+
GREEN='\033[0;32m'
|
|
13
|
+
YELLOW='\033[1;33m'
|
|
14
|
+
BLUE='\033[0;34m'
|
|
15
|
+
CYAN='\033[0;36m'
|
|
16
|
+
DIM='\033[2m'
|
|
17
|
+
RESET='\033[0m'
|
|
18
|
+
|
|
19
|
+
# Get current session ID (PID + timestamp for uniqueness)
|
|
20
|
+
SESSION_ID="$$-$(date +%s)"
|
|
21
|
+
SESSION_FILE="$SESSIONS_DIR/session-$SESSION_ID.lock"
|
|
22
|
+
|
|
23
|
+
# Ensure sessions directory exists
|
|
24
|
+
mkdir -p "$SESSIONS_DIR"
|
|
25
|
+
|
|
26
|
+
# Function: Check if a PID is still running
|
|
27
|
+
is_pid_alive() {
|
|
28
|
+
local pid=$1
|
|
29
|
+
if [[ -z "$pid" ]]; then
|
|
30
|
+
return 1
|
|
31
|
+
fi
|
|
32
|
+
kill -0 "$pid" 2>/dev/null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Function: Clean up stale sessions
|
|
36
|
+
cleanup_stale_sessions() {
|
|
37
|
+
local now=$(date +%s)
|
|
38
|
+
|
|
39
|
+
for lockfile in "$SESSIONS_DIR"/session-*.lock 2>/dev/null; do
|
|
40
|
+
[[ -f "$lockfile" ]] || continue
|
|
41
|
+
|
|
42
|
+
# Read lock file
|
|
43
|
+
local lock_pid=$(grep "^pid=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
44
|
+
local lock_time=$(grep "^started=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
45
|
+
|
|
46
|
+
# Check if stale (PID dead or too old)
|
|
47
|
+
if ! is_pid_alive "$lock_pid"; then
|
|
48
|
+
rm -f "$lockfile"
|
|
49
|
+
continue
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Check if expired
|
|
53
|
+
if [[ -n "$lock_time" ]]; then
|
|
54
|
+
local age=$((now - lock_time))
|
|
55
|
+
if [[ $age -gt $LOCK_TIMEOUT ]]; then
|
|
56
|
+
rm -f "$lockfile"
|
|
57
|
+
fi
|
|
58
|
+
fi
|
|
59
|
+
done
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# Function: Get list of active sessions
|
|
63
|
+
get_active_sessions() {
|
|
64
|
+
local sessions=()
|
|
65
|
+
|
|
66
|
+
for lockfile in "$SESSIONS_DIR"/session-*.lock 2>/dev/null; do
|
|
67
|
+
[[ -f "$lockfile" ]] || continue
|
|
68
|
+
|
|
69
|
+
local lock_pid=$(grep "^pid=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
70
|
+
|
|
71
|
+
if is_pid_alive "$lock_pid"; then
|
|
72
|
+
local branch=$(grep "^branch=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
73
|
+
local worktree=$(grep "^worktree=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
74
|
+
local story=$(grep "^story=" "$lockfile" 2>/dev/null | cut -d= -f2)
|
|
75
|
+
sessions+=("$lock_pid:$branch:$worktree:$story")
|
|
76
|
+
fi
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
printf '%s\n' "${sessions[@]}"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Function: Register this session
|
|
83
|
+
register_session() {
|
|
84
|
+
local branch=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
85
|
+
local worktree=$(pwd)
|
|
86
|
+
local story=""
|
|
87
|
+
|
|
88
|
+
# Try to get current story from status.json
|
|
89
|
+
if [[ -f "docs/09-agents/status.json" ]]; then
|
|
90
|
+
story=$(grep -o '"current_story"[[:space:]]*:[[:space:]]*"[^"]*"' docs/09-agents/status.json 2>/dev/null | cut -d'"' -f4 || echo "")
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
cat > "$SESSION_FILE" << EOF
|
|
94
|
+
pid=$$
|
|
95
|
+
started=$(date +%s)
|
|
96
|
+
branch=$branch
|
|
97
|
+
worktree=$worktree
|
|
98
|
+
story=$story
|
|
99
|
+
user=$(whoami)
|
|
100
|
+
EOF
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# Function: Unregister session (called on exit)
|
|
104
|
+
unregister_session() {
|
|
105
|
+
rm -f "$SESSION_FILE"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Function: Create worktree for parallel work
|
|
109
|
+
create_worktree() {
|
|
110
|
+
local branch_name=$1
|
|
111
|
+
local worktree_path="../$(basename $(pwd))-$branch_name"
|
|
112
|
+
|
|
113
|
+
echo -e "${BLUE}Creating worktree at $worktree_path...${RESET}"
|
|
114
|
+
|
|
115
|
+
# Create branch if it doesn't exist
|
|
116
|
+
if ! git show-ref --verify --quiet "refs/heads/$branch_name"; then
|
|
117
|
+
git branch "$branch_name"
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
# Create worktree
|
|
121
|
+
git worktree add "$worktree_path" "$branch_name" 2>/dev/null || {
|
|
122
|
+
echo -e "${RED}Failed to create worktree${RESET}"
|
|
123
|
+
return 1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
echo -e "${GREEN}✓ Worktree created: $worktree_path${RESET}"
|
|
127
|
+
echo -e "${CYAN}Run: cd $worktree_path && claude${RESET}"
|
|
128
|
+
|
|
129
|
+
echo "$worktree_path"
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
# Function: Display session status
|
|
133
|
+
show_session_status() {
|
|
134
|
+
local active_sessions=($(get_active_sessions))
|
|
135
|
+
local count=${#active_sessions[@]}
|
|
136
|
+
|
|
137
|
+
if [[ $count -eq 0 ]]; then
|
|
138
|
+
echo -e "${GREEN}✓ No other active sessions${RESET}"
|
|
139
|
+
return 0
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
echo -e "${YELLOW}⚠ $count other session(s) active:${RESET}"
|
|
143
|
+
echo ""
|
|
144
|
+
|
|
145
|
+
for session in "${active_sessions[@]}"; do
|
|
146
|
+
IFS=':' read -r pid branch worktree story <<< "$session"
|
|
147
|
+
echo -e " ${DIM}PID${RESET} $pid"
|
|
148
|
+
echo -e " ${DIM}Branch${RESET} $branch"
|
|
149
|
+
[[ -n "$story" ]] && echo -e " ${DIM}Story${RESET} $story"
|
|
150
|
+
echo -e " ${DIM}Path${RESET} $worktree"
|
|
151
|
+
echo ""
|
|
152
|
+
done
|
|
153
|
+
|
|
154
|
+
return 1
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# Function: Suggest worktree with command
|
|
158
|
+
suggest_worktree() {
|
|
159
|
+
local suggested_branch="session-$(date +%Y%m%d-%H%M%S)"
|
|
160
|
+
|
|
161
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
|
|
162
|
+
echo -e "${YELLOW}To work in parallel without conflicts:${RESET}"
|
|
163
|
+
echo ""
|
|
164
|
+
echo -e " ${GREEN}Option 1: Create isolated worktree (recommended)${RESET}"
|
|
165
|
+
echo -e " ${DIM}git worktree add ../${PWD##*/}-parallel $suggested_branch${RESET}"
|
|
166
|
+
echo -e " ${DIM}cd ../${PWD##*/}-parallel && claude${RESET}"
|
|
167
|
+
echo ""
|
|
168
|
+
echo -e " ${GREEN}Option 2: Work on different branch${RESET}"
|
|
169
|
+
echo -e " ${DIM}git checkout -b $suggested_branch${RESET}"
|
|
170
|
+
echo ""
|
|
171
|
+
echo -e " ${GREEN}Option 3: Continue anyway (risk conflicts)${RESET}"
|
|
172
|
+
echo -e " ${DIM}Touch different files than other session${RESET}"
|
|
173
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
# Main execution
|
|
177
|
+
main() {
|
|
178
|
+
local mode="${1:-check}"
|
|
179
|
+
|
|
180
|
+
case "$mode" in
|
|
181
|
+
"check")
|
|
182
|
+
# Clean up stale sessions first
|
|
183
|
+
cleanup_stale_sessions
|
|
184
|
+
|
|
185
|
+
# Check for active sessions
|
|
186
|
+
if show_session_status; then
|
|
187
|
+
# No conflicts - register and continue
|
|
188
|
+
register_session
|
|
189
|
+
trap unregister_session EXIT
|
|
190
|
+
else
|
|
191
|
+
# Conflicts detected - show options
|
|
192
|
+
suggest_worktree
|
|
193
|
+
|
|
194
|
+
# Still register (user may proceed anyway)
|
|
195
|
+
register_session
|
|
196
|
+
trap unregister_session EXIT
|
|
197
|
+
fi
|
|
198
|
+
;;
|
|
199
|
+
|
|
200
|
+
"register")
|
|
201
|
+
register_session
|
|
202
|
+
echo -e "${GREEN}✓ Session registered${RESET}"
|
|
203
|
+
;;
|
|
204
|
+
|
|
205
|
+
"unregister")
|
|
206
|
+
unregister_session
|
|
207
|
+
echo -e "${GREEN}✓ Session unregistered${RESET}"
|
|
208
|
+
;;
|
|
209
|
+
|
|
210
|
+
"status")
|
|
211
|
+
cleanup_stale_sessions
|
|
212
|
+
show_session_status
|
|
213
|
+
;;
|
|
214
|
+
|
|
215
|
+
"worktree")
|
|
216
|
+
local branch="${2:-session-$(date +%Y%m%d-%H%M%S)}"
|
|
217
|
+
create_worktree "$branch"
|
|
218
|
+
;;
|
|
219
|
+
|
|
220
|
+
"cleanup")
|
|
221
|
+
cleanup_stale_sessions
|
|
222
|
+
echo -e "${GREEN}✓ Stale sessions cleaned${RESET}"
|
|
223
|
+
;;
|
|
224
|
+
|
|
225
|
+
*)
|
|
226
|
+
echo "Usage: session-coordinator.sh [check|register|unregister|status|worktree|cleanup]"
|
|
227
|
+
exit 1
|
|
228
|
+
;;
|
|
229
|
+
esac
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
main "$@"
|