specweave 1.0.22 â 1.0.24
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 +95 -378
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +8 -26
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/core/living-docs/cross-project-sync.d.ts +2 -0
- package/dist/src/core/living-docs/cross-project-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/cross-project-sync.js +14 -4
- package/dist/src/core/living-docs/cross-project-sync.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +6 -2
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/package.json +3 -3
- package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
- package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
- package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
- package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
- package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
- package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1262 -0
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1254 -0
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Post-Increment-Completion Hook - DORA Metrics Tracking
|
|
3
|
+
#
|
|
4
|
+
# Fires after: /specweave:done completes
|
|
5
|
+
# Purpose: Automatically track DORA metrics and update living docs dashboard
|
|
6
|
+
#
|
|
7
|
+
# Integration: plugins/specweave-release/hooks/hooks.json
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# Constants
|
|
12
|
+
SPECWEAVE_ROOT="${SPECWEAVE_ROOT:-$(pwd)}"
|
|
13
|
+
METRICS_DIR="${SPECWEAVE_ROOT}/.specweave/metrics"
|
|
14
|
+
HISTORY_FILE="${METRICS_DIR}/dora-history.jsonl"
|
|
15
|
+
DASHBOARD_FILE="${SPECWEAVE_ROOT}/.specweave/docs/internal/delivery/dora-dashboard.md"
|
|
16
|
+
DORA_CALCULATOR="${SPECWEAVE_ROOT}/dist/src/metrics/dora-calculator.js"
|
|
17
|
+
LATEST_FILE="${METRICS_DIR}/dora-latest.json"
|
|
18
|
+
|
|
19
|
+
# Logging
|
|
20
|
+
LOG_FILE="${SPECWEAVE_ROOT}/.specweave/logs/dora-tracking.log"
|
|
21
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
22
|
+
|
|
23
|
+
log() {
|
|
24
|
+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$LOG_FILE"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
log "đ¯ Post-Increment-Completion Hook Triggered"
|
|
28
|
+
|
|
29
|
+
# Check if DORA calculator exists
|
|
30
|
+
if [[ ! -f "$DORA_CALCULATOR" ]]; then
|
|
31
|
+
log "â ī¸ DORA calculator not found at $DORA_CALCULATOR"
|
|
32
|
+
log " Run: npm run build"
|
|
33
|
+
exit 0 # Non-blocking
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Check if GitHub token is available
|
|
37
|
+
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
|
|
38
|
+
log "â ī¸ GITHUB_TOKEN not set. DORA metrics require GitHub API access."
|
|
39
|
+
log " Set GITHUB_TOKEN in environment or .env file"
|
|
40
|
+
exit 0 # Non-blocking
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Step 1: Calculate DORA metrics
|
|
44
|
+
log "đ Calculating DORA metrics..."
|
|
45
|
+
if ! node "$DORA_CALCULATOR"; then
|
|
46
|
+
log "â Failed to calculate DORA metrics"
|
|
47
|
+
exit 0 # Non-blocking
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Step 2: Append to history (JSONL format)
|
|
51
|
+
log "đž Appending metrics to history..."
|
|
52
|
+
mkdir -p "$METRICS_DIR"
|
|
53
|
+
|
|
54
|
+
if [[ -f "$LATEST_FILE" ]]; then
|
|
55
|
+
cat "$LATEST_FILE" >> "$HISTORY_FILE"
|
|
56
|
+
log " â Appended to $HISTORY_FILE"
|
|
57
|
+
else
|
|
58
|
+
log "â ī¸ Latest metrics file not found: $LATEST_FILE"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# Step 3: Update living docs dashboard
|
|
62
|
+
log "đ Updating DORA dashboard..."
|
|
63
|
+
DASHBOARD_GENERATOR="${SPECWEAVE_ROOT}/dist/plugins/specweave-release/lib/dashboard-generator.js"
|
|
64
|
+
|
|
65
|
+
if [[ -f "$DASHBOARD_GENERATOR" ]]; then
|
|
66
|
+
if node "$DASHBOARD_GENERATOR"; then
|
|
67
|
+
log " â Dashboard updated: $DASHBOARD_FILE"
|
|
68
|
+
else
|
|
69
|
+
log "â ī¸ Failed to update dashboard"
|
|
70
|
+
fi
|
|
71
|
+
else
|
|
72
|
+
log "â ī¸ Dashboard generator not found: $DASHBOARD_GENERATOR"
|
|
73
|
+
log " Manual dashboard update required"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# Step 4: Check for degradation (optional)
|
|
77
|
+
log "đ Checking for metric degradation..."
|
|
78
|
+
|
|
79
|
+
# Calculate 30-day average and compare with current
|
|
80
|
+
# (This would be implemented in a TypeScript utility)
|
|
81
|
+
# For now, we'll just log a reminder
|
|
82
|
+
log " âšī¸ Degradation detection: Manual review recommended"
|
|
83
|
+
log " See: $DASHBOARD_FILE for trends"
|
|
84
|
+
|
|
85
|
+
# Step 5: Update main DORA metrics doc
|
|
86
|
+
DORA_METRICS_DOC="${SPECWEAVE_ROOT}/.specweave/docs/internal/delivery/dora-metrics.md"
|
|
87
|
+
if [[ -f "$DORA_METRICS_DOC" && -f "$LATEST_FILE" ]]; then
|
|
88
|
+
log "đ Updating dora-metrics.md with latest values..."
|
|
89
|
+
|
|
90
|
+
# Extract current values from latest metrics
|
|
91
|
+
# (This is a simplified version - production would use jq for proper parsing)
|
|
92
|
+
TIMESTAMP=$(date '+%Y-%m-%d %H:%M UTC')
|
|
93
|
+
|
|
94
|
+
# Update "Last Calculated" timestamp
|
|
95
|
+
if command -v sed &> /dev/null; then
|
|
96
|
+
sed -i.bak "s/Last Calculated: .*/Last Calculated: $TIMESTAMP/" "$DORA_METRICS_DOC" 2>/dev/null || true
|
|
97
|
+
rm -f "${DORA_METRICS_DOC}.bak" 2>/dev/null || true
|
|
98
|
+
log " â Updated timestamp in dora-metrics.md"
|
|
99
|
+
fi
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
log "â
DORA metrics tracking complete!"
|
|
103
|
+
log ""
|
|
104
|
+
log "đ Next steps:"
|
|
105
|
+
log " 1. Review dashboard: $DASHBOARD_FILE"
|
|
106
|
+
log " 2. Check trends: Are metrics improving?"
|
|
107
|
+
log " 3. Take action: Address any degradation"
|
|
108
|
+
log ""
|
|
109
|
+
|
|
110
|
+
exit 0
|