specweave 1.0.21 → 1.0.22
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/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js +79 -13
- package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
- package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
- package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
- package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
- package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
- package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -1262
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
- package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1254
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# Post-Increment-Completion Hook
|
|
4
|
-
# Runs after an increment is marked as complete
|
|
5
|
-
#
|
|
6
|
-
# This hook closes GitHub issues automatically when increments complete
|
|
7
|
-
|
|
8
|
-
set -e
|
|
9
|
-
|
|
10
|
-
HOOK_NAME="post-increment-completion"
|
|
11
|
-
INCREMENT_ID="${1:-}"
|
|
12
|
-
|
|
13
|
-
# Check if increment ID provided
|
|
14
|
-
if [ -z "$INCREMENT_ID" ]; then
|
|
15
|
-
echo "⚠️ $HOOK_NAME: No increment ID provided" >&2
|
|
16
|
-
exit 0
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# Get project root
|
|
20
|
-
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
|
|
21
|
-
INCREMENT_DIR="$PROJECT_ROOT/.specweave/increments/$INCREMENT_ID"
|
|
22
|
-
|
|
23
|
-
# Check if increment exists
|
|
24
|
-
if [ ! -d "$INCREMENT_DIR" ]; then
|
|
25
|
-
echo "⚠️ $HOOK_NAME: Increment $INCREMENT_ID not found" >&2
|
|
26
|
-
exit 0
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
# Read metadata.json
|
|
30
|
-
METADATA_FILE="$INCREMENT_DIR/metadata.json"
|
|
31
|
-
if [ ! -f "$METADATA_FILE" ]; then
|
|
32
|
-
echo "⚠️ $HOOK_NAME: No metadata.json found for $INCREMENT_ID" >&2
|
|
33
|
-
exit 0
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# Extract GitHub issue number
|
|
37
|
-
ISSUE_NUMBER=$(jq -r '.github.issue // empty' "$METADATA_FILE" 2>/dev/null)
|
|
38
|
-
|
|
39
|
-
if [ -z "$ISSUE_NUMBER" ] || [ "$ISSUE_NUMBER" = "null" ]; then
|
|
40
|
-
# No GitHub issue linked - skip GitHub closure but continue with sync
|
|
41
|
-
echo "ℹ️ No GitHub issue linked to increment $INCREMENT_ID"
|
|
42
|
-
SKIP_GITHUB_CLOSURE=true
|
|
43
|
-
else
|
|
44
|
-
SKIP_GITHUB_CLOSURE=false
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
|
-
# ============================================================================
|
|
48
|
-
# GITHUB ISSUE CLOSURE (if linked)
|
|
49
|
-
# ============================================================================
|
|
50
|
-
|
|
51
|
-
if [ "$SKIP_GITHUB_CLOSURE" = "false" ]; then
|
|
52
|
-
# Check if gh CLI is available
|
|
53
|
-
if ! command -v gh &> /dev/null; then
|
|
54
|
-
echo "⚠️ $HOOK_NAME: GitHub CLI (gh) not found - skipping issue closure" >&2
|
|
55
|
-
else
|
|
56
|
-
# Check if issue is already closed
|
|
57
|
-
ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --json state --jq '.state' 2>/dev/null || echo "")
|
|
58
|
-
|
|
59
|
-
if [ "$ISSUE_STATE" = "CLOSED" ]; then
|
|
60
|
-
echo "✓ GitHub issue #$ISSUE_NUMBER already closed"
|
|
61
|
-
else
|
|
62
|
-
# Close the GitHub issue with completion message
|
|
63
|
-
echo "🔗 Closing GitHub issue #$ISSUE_NUMBER for increment $INCREMENT_ID..."
|
|
64
|
-
|
|
65
|
-
# Create completion comment
|
|
66
|
-
COMPLETION_COMMENT="## ✅ Increment Complete
|
|
67
|
-
|
|
68
|
-
Increment \`$INCREMENT_ID\` has been marked as complete.
|
|
69
|
-
|
|
70
|
-
**Completion Details:**
|
|
71
|
-
- Completed: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
72
|
-
- All tasks completed
|
|
73
|
-
- Tests passed
|
|
74
|
-
- Documentation updated
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
🤖 Auto-closed by SpecWeave post-increment-completion hook"
|
|
78
|
-
|
|
79
|
-
# Close issue with comment
|
|
80
|
-
gh issue close "$ISSUE_NUMBER" --comment "$COMPLETION_COMMENT" 2>/dev/null || {
|
|
81
|
-
echo "⚠️ Failed to close issue #$ISSUE_NUMBER" >&2
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
echo "✅ GitHub issue #$ISSUE_NUMBER closed successfully"
|
|
85
|
-
fi
|
|
86
|
-
fi
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
# Update status line cache (increment no longer open)
|
|
90
|
-
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
91
|
-
bash "$HOOK_DIR/lib/update-status-line.sh" 2>/dev/null || true
|
|
92
|
-
|
|
93
|
-
# ============================================================================
|
|
94
|
-
# SYNC LIVING DOCS (NEW in v0.24.0 - Critical Missing Feature)
|
|
95
|
-
# ============================================================================
|
|
96
|
-
# After increment completes, perform FULL living docs sync to ensure:
|
|
97
|
-
# - Feature specs finalized with all user stories marked complete
|
|
98
|
-
# - ADRs created/updated with final architecture decisions
|
|
99
|
-
# - Architecture docs updated with implementation details
|
|
100
|
-
# - Delivery docs updated with what was shipped
|
|
101
|
-
# - Internal/public docs reflect completed work
|
|
102
|
-
#
|
|
103
|
-
# This is the FINAL, COMPREHENSIVE sync that happens once per increment.
|
|
104
|
-
# (Task-level sync in post-task-completion.sh handles incremental updates)
|
|
105
|
-
#
|
|
106
|
-
# Architecture Decision: Non-blocking execution
|
|
107
|
-
# - If sync fails, log error but don't crash hook (GitHub issue already closed)
|
|
108
|
-
# - Living docs can be manually synced later with /specweave:sync-docs
|
|
109
|
-
# - Failure mode: Graceful degradation (increment still completes)
|
|
110
|
-
|
|
111
|
-
if command -v node &> /dev/null; then
|
|
112
|
-
echo ""
|
|
113
|
-
echo "📚 Performing final living docs sync for increment $INCREMENT_ID..."
|
|
114
|
-
|
|
115
|
-
# ========================================================================
|
|
116
|
-
# EXTRACT FEATURE ID (v0.23.0+)
|
|
117
|
-
# ========================================================================
|
|
118
|
-
# Extract epic field from spec.md frontmatter (e.g., epic: FS-047)
|
|
119
|
-
# This ensures sync uses the explicitly defined feature ID rather than
|
|
120
|
-
# auto-generating one, maintaining traceability with living docs structure.
|
|
121
|
-
|
|
122
|
-
FEATURE_ID=""
|
|
123
|
-
SPEC_MD_PATH="$INCREMENT_DIR/spec.md"
|
|
124
|
-
|
|
125
|
-
if [ -f "$SPEC_MD_PATH" ]; then
|
|
126
|
-
# Extract epic field from YAML frontmatter
|
|
127
|
-
FEATURE_ID=$(awk '
|
|
128
|
-
BEGIN { in_frontmatter=0 }
|
|
129
|
-
/^---$/ {
|
|
130
|
-
if (in_frontmatter == 0) {
|
|
131
|
-
in_frontmatter=1; next
|
|
132
|
-
} else {
|
|
133
|
-
exit
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
in_frontmatter == 1 && /^epic:/ {
|
|
137
|
-
gsub(/^epic:[ \t]*/, "");
|
|
138
|
-
gsub(/["'\'']/, "");
|
|
139
|
-
print;
|
|
140
|
-
exit
|
|
141
|
-
}
|
|
142
|
-
' "$SPEC_MD_PATH" | tr -d '\r\n')
|
|
143
|
-
|
|
144
|
-
if [ -n "$FEATURE_ID" ]; then
|
|
145
|
-
echo " 📎 Using feature ID from spec.md: $FEATURE_ID"
|
|
146
|
-
else
|
|
147
|
-
echo " ℹ️ No epic field found in spec.md - will auto-generate feature ID"
|
|
148
|
-
fi
|
|
149
|
-
else
|
|
150
|
-
echo " ⚠️ spec.md not found at $SPEC_MD_PATH" >&2
|
|
151
|
-
fi
|
|
152
|
-
|
|
153
|
-
# ========================================================================
|
|
154
|
-
# EXTRACT PROJECT ID (v0.20.0+)
|
|
155
|
-
# ========================================================================
|
|
156
|
-
# Extract activeProject from config.json (defaults to "default")
|
|
157
|
-
# Supports multi-project mode where specs are organized by project.
|
|
158
|
-
|
|
159
|
-
PROJECT_ID="default"
|
|
160
|
-
CONFIG_PATH="$PROJECT_ROOT/.specweave/config.json"
|
|
161
|
-
|
|
162
|
-
if [ -f "$CONFIG_PATH" ]; then
|
|
163
|
-
if command -v jq >/dev/null 2>&1; then
|
|
164
|
-
ACTIVE_PROJECT=$(jq -r '.activeProject // "default"' "$CONFIG_PATH" 2>/dev/null || echo "default")
|
|
165
|
-
if [ -n "$ACTIVE_PROJECT" ] && [ "$ACTIVE_PROJECT" != "null" ]; then
|
|
166
|
-
PROJECT_ID="$ACTIVE_PROJECT"
|
|
167
|
-
fi
|
|
168
|
-
fi
|
|
169
|
-
fi
|
|
170
|
-
echo " 📁 Project ID: $PROJECT_ID"
|
|
171
|
-
|
|
172
|
-
# ========================================================================
|
|
173
|
-
# LOCATE SYNC SCRIPT
|
|
174
|
-
# ========================================================================
|
|
175
|
-
# Find sync-living-docs.js in order of preference:
|
|
176
|
-
# 1. In-place compiled (development, esbuild output)
|
|
177
|
-
# 2. Local dist (development, tsc output)
|
|
178
|
-
# 3. node_modules (installed as dependency)
|
|
179
|
-
# 4. Plugin marketplace (Claude Code global installation)
|
|
180
|
-
|
|
181
|
-
SYNC_SCRIPT=""
|
|
182
|
-
if [ -f "$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
183
|
-
# Development: Use in-place compiled hooks (esbuild, not tsc)
|
|
184
|
-
SYNC_SCRIPT="$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
185
|
-
echo " 🔧 Using in-place compiled hook (development mode)"
|
|
186
|
-
elif [ -f "$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
187
|
-
# Development: Use project's compiled files (has node_modules)
|
|
188
|
-
SYNC_SCRIPT="$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
189
|
-
echo " 🔧 Using local dist (development mode)"
|
|
190
|
-
elif [ -f "$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
191
|
-
# Installed as dependency: Use node_modules version
|
|
192
|
-
SYNC_SCRIPT="$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
193
|
-
echo " 📦 Using node_modules version"
|
|
194
|
-
elif [ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js" ]; then
|
|
195
|
-
# Fallback: Plugin marketplace (may fail if deps missing)
|
|
196
|
-
SYNC_SCRIPT="${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js"
|
|
197
|
-
echo " 🌐 Using plugin marketplace version"
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
# ========================================================================
|
|
201
|
-
# EXECUTE SYNC
|
|
202
|
-
# ========================================================================
|
|
203
|
-
# Run living docs sync with feature ID and project ID
|
|
204
|
-
# Non-blocking: Errors logged but don't crash hook
|
|
205
|
-
|
|
206
|
-
if [ -n "$SYNC_SCRIPT" ]; then
|
|
207
|
-
# Pass FEATURE_ID and PROJECT_ID as environment variables if available
|
|
208
|
-
if [ -n "$FEATURE_ID" ]; then
|
|
209
|
-
(cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
|
|
210
|
-
echo " ⚠️ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
|
|
211
|
-
}
|
|
212
|
-
else
|
|
213
|
-
# No explicit feature ID - sync will auto-generate
|
|
214
|
-
(cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
|
|
215
|
-
echo " ⚠️ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
|
|
216
|
-
}
|
|
217
|
-
fi
|
|
218
|
-
echo " ✅ Living docs sync complete"
|
|
219
|
-
echo ""
|
|
220
|
-
else
|
|
221
|
-
echo " ⚠️ sync-living-docs.js not found in any location - skipping living docs sync" >&2
|
|
222
|
-
echo " 💡 To manually sync: /specweave:sync-docs update" >&2
|
|
223
|
-
echo ""
|
|
224
|
-
fi
|
|
225
|
-
else
|
|
226
|
-
echo " ⚠️ Node.js not found - skipping living docs sync" >&2
|
|
227
|
-
echo " 💡 Install Node.js to enable automatic living docs sync" >&2
|
|
228
|
-
echo ""
|
|
229
|
-
fi
|
|
230
|
-
|
|
231
|
-
exit 0
|