specweave 1.0.551 â 1.0.552
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/bin/specweave.js +23 -1
- package/dist/src/cli/commands/hook.d.ts +15 -0
- package/dist/src/cli/commands/hook.d.ts.map +1 -0
- package/dist/src/cli/commands/hook.js +61 -0
- package/dist/src/cli/commands/hook.js.map +1 -0
- package/dist/src/config/types.d.ts +2 -2
- package/dist/src/core/hooks/handlers/hook-router.d.ts +19 -0
- package/dist/src/core/hooks/handlers/hook-router.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/hook-router.js +75 -0
- package/dist/src/core/hooks/handlers/hook-router.js.map +1 -0
- package/dist/src/core/hooks/handlers/index.d.ts +10 -0
- package/dist/src/core/hooks/handlers/index.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/index.js +9 -0
- package/dist/src/core/hooks/handlers/index.js.map +1 -0
- package/dist/src/core/hooks/handlers/post-tool-use-analytics.d.ts +11 -0
- package/dist/src/core/hooks/handlers/post-tool-use-analytics.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/post-tool-use-analytics.js +73 -0
- package/dist/src/core/hooks/handlers/post-tool-use-analytics.js.map +1 -0
- package/dist/src/core/hooks/handlers/post-tool-use.d.ts +11 -0
- package/dist/src/core/hooks/handlers/post-tool-use.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/post-tool-use.js +76 -0
- package/dist/src/core/hooks/handlers/post-tool-use.js.map +1 -0
- package/dist/src/core/hooks/handlers/pre-compact.d.ts +11 -0
- package/dist/src/core/hooks/handlers/pre-compact.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/pre-compact.js +77 -0
- package/dist/src/core/hooks/handlers/pre-compact.js.map +1 -0
- package/dist/src/core/hooks/handlers/pre-tool-use.d.ts +11 -0
- package/dist/src/core/hooks/handlers/pre-tool-use.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/pre-tool-use.js +318 -0
- package/dist/src/core/hooks/handlers/pre-tool-use.js.map +1 -0
- package/dist/src/core/hooks/handlers/session-start.d.ts +9 -0
- package/dist/src/core/hooks/handlers/session-start.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/session-start.js +111 -0
- package/dist/src/core/hooks/handlers/session-start.js.map +1 -0
- package/dist/src/core/hooks/handlers/stop-auto.d.ts +16 -0
- package/dist/src/core/hooks/handlers/stop-auto.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/stop-auto.js +122 -0
- package/dist/src/core/hooks/handlers/stop-auto.js.map +1 -0
- package/dist/src/core/hooks/handlers/stop-reflect.d.ts +14 -0
- package/dist/src/core/hooks/handlers/stop-reflect.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/stop-reflect.js +43 -0
- package/dist/src/core/hooks/handlers/stop-reflect.js.map +1 -0
- package/dist/src/core/hooks/handlers/stop-sync.d.ts +15 -0
- package/dist/src/core/hooks/handlers/stop-sync.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/stop-sync.js +68 -0
- package/dist/src/core/hooks/handlers/stop-sync.js.map +1 -0
- package/dist/src/core/hooks/handlers/types.d.ts +63 -0
- package/dist/src/core/hooks/handlers/types.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/types.js +27 -0
- package/dist/src/core/hooks/handlers/types.js.map +1 -0
- package/dist/src/core/hooks/handlers/user-prompt-submit.d.ts +14 -0
- package/dist/src/core/hooks/handlers/user-prompt-submit.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/user-prompt-submit.js +173 -0
- package/dist/src/core/hooks/handlers/user-prompt-submit.js.map +1 -0
- package/dist/src/core/hooks/handlers/utils.d.ts +25 -0
- package/dist/src/core/hooks/handlers/utils.d.ts.map +1 -0
- package/dist/src/core/hooks/handlers/utils.js +64 -0
- package/dist/src/core/hooks/handlers/utils.js.map +1 -0
- package/dist/src/init/research/types.d.ts +1 -1
- package/dist/src/sync/sync-target-resolver.js.map +1 -1
- package/dist/src/utils/lock-manager.d.ts.map +1 -1
- package/dist/src/utils/lock-manager.js +5 -0
- package/dist/src/utils/lock-manager.js.map +1 -1
- package/dist/src/utils/plugin-copier.d.ts.map +1 -1
- package/dist/src/utils/plugin-copier.js +3 -30
- package/dist/src/utils/plugin-copier.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/hooks.json +10 -10
- package/plugins/specweave/hooks/README.md +0 -493
- package/plugins/specweave/hooks/_archive/stop-auto-v4-legacy.sh +0 -1319
- package/plugins/specweave/hooks/lib/common-setup.sh +0 -144
- package/plugins/specweave/hooks/lib/hook-errors.sh +0 -414
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh +0 -245
- package/plugins/specweave/hooks/lib/resolve-package.sh +0 -146
- package/plugins/specweave/hooks/lib/scheduler-startup.sh +0 -135
- package/plugins/specweave/hooks/lib/score-increment.sh +0 -87
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +0 -193
- package/plugins/specweave/hooks/lib/update-active-increment.sh +0 -95
- package/plugins/specweave/hooks/lib/update-status-line.sh +0 -233
- package/plugins/specweave/hooks/lib/validate-spec-status.sh +0 -171
- package/plugins/specweave/hooks/llm-judge-validator.sh +0 -219
- package/plugins/specweave/hooks/log-decision.sh +0 -168
- package/plugins/specweave/hooks/pre-compact.sh +0 -64
- package/plugins/specweave/hooks/startup-health-check.sh +0 -64
- package/plugins/specweave/hooks/stop-auto-v5.sh +0 -276
- package/plugins/specweave/hooks/stop-reflect.sh +0 -336
- package/plugins/specweave/hooks/stop-sync.sh +0 -283
- package/plugins/specweave/hooks/tests/test-auto-context-integration.sh +0 -126
- package/plugins/specweave/hooks/tests/test-stop-auto-enriched.sh +0 -128
- package/plugins/specweave/hooks/universal/dispatcher.mjs +0 -336
- package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +0 -325
- package/plugins/specweave/hooks/universal/hook-wrapper.cmd +0 -26
- package/plugins/specweave/hooks/universal/hook-wrapper.sh +0 -69
- package/plugins/specweave/hooks/universal/run-hook.sh +0 -20
- package/plugins/specweave/hooks/universal/session-start.cmd +0 -16
- package/plugins/specweave/hooks/universal/session-start.ps1 +0 -16
- package/plugins/specweave/hooks/user-prompt-submit.sh +0 -2550
- package/plugins/specweave/hooks/v2/detectors/lifecycle-detector.sh +0 -87
- package/plugins/specweave/hooks/v2/detectors/us-completion-detector.sh +0 -186
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use-analytics.sh +0 -83
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +0 -447
- package/plugins/specweave/hooks/v2/dispatchers/pre-tool-use.sh +0 -104
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +0 -270
- package/plugins/specweave/hooks/v2/guards/completion-guard.sh +0 -14
- package/plugins/specweave/hooks/v2/guards/increment-duplicate-guard.sh +0 -14
- package/plugins/specweave/hooks/v2/guards/increment-existence-guard.sh +0 -240
- package/plugins/specweave/hooks/v2/guards/interview-enforcement-guard.sh +0 -171
- package/plugins/specweave/hooks/v2/guards/metadata-json-guard.sh +0 -14
- package/plugins/specweave/hooks/v2/guards/skill-chain-enforcement-guard.sh +0 -222
- package/plugins/specweave/hooks/v2/guards/spec-template-enforcement-guard.sh +0 -21
- package/plugins/specweave/hooks/v2/guards/spec-validation-guard.sh +0 -14
- package/plugins/specweave/hooks/v2/guards/status-completion-guard.sh +0 -84
- package/plugins/specweave/hooks/v2/guards/task-ac-sync-guard.sh +0 -475
- package/plugins/specweave/hooks/v2/guards/tdd-enforcement-guard.sh +0 -268
- package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +0 -332
- package/plugins/specweave/hooks/v2/handlers/ac-validation-handler.sh +0 -50
- package/plugins/specweave/hooks/v2/handlers/github-sync-handler.sh +0 -347
- package/plugins/specweave/hooks/v2/handlers/living-docs-handler.sh +0 -83
- package/plugins/specweave/hooks/v2/handlers/living-specs-handler.sh +0 -268
- package/plugins/specweave/hooks/v2/handlers/project-bridge-handler.sh +0 -104
- package/plugins/specweave/hooks/v2/handlers/status-line-handler.sh +0 -165
- package/plugins/specweave/hooks/v2/handlers/status-update.sh +0 -61
- package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +0 -270
- package/plugins/specweave/hooks/v2/integrations/ado-post-living-docs-update.sh +0 -367
- package/plugins/specweave/hooks/v2/integrations/ado-post-task.sh +0 -179
- package/plugins/specweave/hooks/v2/integrations/github-auto-create-handler.sh +0 -553
- package/plugins/specweave/hooks/v2/integrations/github-post-task.sh +0 -345
- package/plugins/specweave/hooks/v2/integrations/jira-post-task.sh +0 -180
- package/plugins/specweave/hooks/v2/lib/check-provider-enabled.sh +0 -52
- package/plugins/specweave/hooks/v2/queue/enqueue.sh +0 -81
- package/plugins/specweave/hooks/v2/session-end.sh +0 -139
- package/plugins/specweave/hooks/validate-skill-activations.sh +0 -227
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# SpecWeave Azure DevOps Sync Hook
|
|
4
|
-
# Runs after task completion to sync progress to Azure DevOps Work Items
|
|
5
|
-
#
|
|
6
|
-
# This hook is part of the specweave-ado plugin and handles:
|
|
7
|
-
# - Syncing task completion state to Azure DevOps work items
|
|
8
|
-
# - Updating ADO work item status based on increment progress
|
|
9
|
-
#
|
|
10
|
-
# Dependencies:
|
|
11
|
-
# - Node.js for running sync scripts
|
|
12
|
-
# - jq for JSON parsing
|
|
13
|
-
# - metadata.json must have .external_sync.ado.workItemId field (fallback: .ado.item)
|
|
14
|
-
# - Azure DevOps PAT in .env
|
|
15
|
-
|
|
16
|
-
set +e # EMERGENCY FIX: Prevents Claude Code crashes
|
|
17
|
-
|
|
18
|
-
# EMERGENCY KILL SWITCH
|
|
19
|
-
if [[ "${SPECWEAVE_DISABLE_HOOKS:-0}" == "1" ]]; then
|
|
20
|
-
exit 0
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
# ============================================================================
|
|
24
|
-
# PROJECT ROOT DETECTION (CRITICAL - must NOT fallback to pwd!)
|
|
25
|
-
# ============================================================================
|
|
26
|
-
|
|
27
|
-
# Find project root by searching upward for .specweave/ directory
|
|
28
|
-
find_project_root() {
|
|
29
|
-
local dir="$1"
|
|
30
|
-
while [ "$dir" != "/" ]; do
|
|
31
|
-
if [ -f "$dir/.specweave/config.json" ]; then
|
|
32
|
-
echo "$dir"
|
|
33
|
-
return 0
|
|
34
|
-
fi
|
|
35
|
-
dir="$(dirname "$dir")"
|
|
36
|
-
done
|
|
37
|
-
return 1 # NOT FOUND - do NOT fallback to pwd (prevents .specweave pollution)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
PROJECT_ROOT="$(find_project_root "$(pwd)")"
|
|
41
|
-
if [[ -z "$PROJECT_ROOT" ]]; then
|
|
42
|
-
# NOT a SpecWeave project - exit silently without creating any files
|
|
43
|
-
exit 0
|
|
44
|
-
fi
|
|
45
|
-
cd "$PROJECT_ROOT" 2>/dev/null || exit 0
|
|
46
|
-
|
|
47
|
-
# ============================================================================
|
|
48
|
-
# CONFIGURATION
|
|
49
|
-
# ============================================================================
|
|
50
|
-
|
|
51
|
-
LOGS_DIR=".specweave/logs"
|
|
52
|
-
DEBUG_LOG="$LOGS_DIR/hooks-debug.log"
|
|
53
|
-
|
|
54
|
-
mkdir -p "$LOGS_DIR" 2>/dev/null || true
|
|
55
|
-
|
|
56
|
-
# ============================================================================
|
|
57
|
-
# PRECONDITIONS CHECK
|
|
58
|
-
# ============================================================================
|
|
59
|
-
|
|
60
|
-
echo "[$(date)] [ADO] đ Azure DevOps sync hook fired" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
61
|
-
|
|
62
|
-
# Detect current increment
|
|
63
|
-
CURRENT_INCREMENT=$(ls -td .specweave/increments/*/ 2>/dev/null | xargs -n1 basename | grep -v "_backlog" | grep -v "_archive" | grep -v "_working" | head -1)
|
|
64
|
-
|
|
65
|
-
if [ -z "$CURRENT_INCREMENT" ]; then
|
|
66
|
-
echo "[$(date)] [ADO] âšī¸ No active increment, skipping ADO sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
67
|
-
cat <<EOF
|
|
68
|
-
{
|
|
69
|
-
"continue": true
|
|
70
|
-
}
|
|
71
|
-
EOF
|
|
72
|
-
exit 0
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
# Check for metadata.json
|
|
76
|
-
METADATA_FILE=".specweave/increments/$CURRENT_INCREMENT/metadata.json"
|
|
77
|
-
|
|
78
|
-
if [ ! -f "$METADATA_FILE" ]; then
|
|
79
|
-
echo "[$(date)] [ADO] âšī¸ No metadata.json for $CURRENT_INCREMENT, skipping ADO sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
80
|
-
cat <<EOF
|
|
81
|
-
{
|
|
82
|
-
"continue": true
|
|
83
|
-
}
|
|
84
|
-
EOF
|
|
85
|
-
exit 0
|
|
86
|
-
fi
|
|
87
|
-
|
|
88
|
-
# Check for ADO work item link
|
|
89
|
-
if ! command -v jq &> /dev/null; then
|
|
90
|
-
echo "[$(date)] [ADO] â ī¸ jq not found, skipping ADO sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
91
|
-
cat <<EOF
|
|
92
|
-
{
|
|
93
|
-
"continue": true
|
|
94
|
-
}
|
|
95
|
-
EOF
|
|
96
|
-
exit 0
|
|
97
|
-
fi
|
|
98
|
-
|
|
99
|
-
ADO_ITEM=$(jq -r '.external_sync.ado.workItemId // .ado.item // empty' "$METADATA_FILE" 2>/dev/null)
|
|
100
|
-
|
|
101
|
-
if [ -z "$ADO_ITEM" ]; then
|
|
102
|
-
echo "[$(date)] [ADO] âšī¸ No Azure DevOps work item linked to $CURRENT_INCREMENT, skipping sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
103
|
-
cat <<EOF
|
|
104
|
-
{
|
|
105
|
-
"continue": true
|
|
106
|
-
}
|
|
107
|
-
EOF
|
|
108
|
-
exit 0
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
# Check for Node.js
|
|
112
|
-
if ! command -v node &> /dev/null; then
|
|
113
|
-
echo "[$(date)] [ADO] â ī¸ Node.js not found, skipping ADO sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
114
|
-
cat <<EOF
|
|
115
|
-
{
|
|
116
|
-
"continue": true
|
|
117
|
-
}
|
|
118
|
-
EOF
|
|
119
|
-
exit 0
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
# Check for ADO sync script
|
|
123
|
-
if [ ! -f "dist/commands/ado-sync.js" ]; then
|
|
124
|
-
echo "[$(date)] [ADO] â ī¸ ado-sync.js not found, skipping ADO sync" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
125
|
-
cat <<EOF
|
|
126
|
-
{
|
|
127
|
-
"continue": true
|
|
128
|
-
}
|
|
129
|
-
EOF
|
|
130
|
-
exit 0
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
# ============================================================================
|
|
134
|
-
# AZURE DEVOPS SYNC LOGIC
|
|
135
|
-
# ============================================================================
|
|
136
|
-
|
|
137
|
-
echo "[$(date)] [ADO] đ Syncing to Azure DevOps work item $ADO_ITEM" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
138
|
-
|
|
139
|
-
# Run ADO sync command (non-blocking)
|
|
140
|
-
node dist/commands/ado-sync.js "$CURRENT_INCREMENT" 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
|
|
141
|
-
echo "[$(date)] [ADO] â ī¸ Failed to sync to Azure DevOps (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
echo "[$(date)] [ADO] â
Azure DevOps sync complete" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
145
|
-
|
|
146
|
-
# ============================================================================
|
|
147
|
-
# SPEC COMMIT SYNC (NEW!)
|
|
148
|
-
# ============================================================================
|
|
149
|
-
|
|
150
|
-
echo "[$(date)] [ADO] đ Checking for spec commit sync..." >> "$DEBUG_LOG" 2>/dev/null || true
|
|
151
|
-
|
|
152
|
-
# Call TypeScript CLI to sync commits
|
|
153
|
-
if command -v node &> /dev/null && [ -f "$PROJECT_ROOT/dist/cli/commands/sync-spec-commits.js" ]; then
|
|
154
|
-
echo "[$(date)] [ADO] đ Running spec commit sync..." >> "$DEBUG_LOG" 2>/dev/null || true
|
|
155
|
-
|
|
156
|
-
node "$PROJECT_ROOT/dist/cli/commands/sync-spec-commits.js" \
|
|
157
|
-
--increment "$PROJECT_ROOT/.specweave/increments/$CURRENT_INCREMENT" \
|
|
158
|
-
--provider ado \
|
|
159
|
-
2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
|
|
160
|
-
echo "[$(date)] [ADO] â ī¸ Spec commit sync failed (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
echo "[$(date)] [ADO] â
Spec commit sync complete" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
164
|
-
else
|
|
165
|
-
echo "[$(date)] [ADO] âšī¸ Spec commit sync not available (node or script not found)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
# ============================================================================
|
|
169
|
-
# OUTPUT TO CLAUDE
|
|
170
|
-
# ============================================================================
|
|
171
|
-
|
|
172
|
-
cat <<EOF
|
|
173
|
-
{
|
|
174
|
-
"continue": true
|
|
175
|
-
}
|
|
176
|
-
EOF
|
|
177
|
-
|
|
178
|
-
# ALWAYS exit 0 - NEVER let hook errors crash Claude Code
|
|
179
|
-
exit 0
|