specweave 0.28.1 → 0.28.5

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.
Files changed (57) hide show
  1. package/README.md +34 -95
  2. package/dist/src/core/living-docs/feature-consistency-validator.d.ts +129 -0
  3. package/dist/src/core/living-docs/feature-consistency-validator.d.ts.map +1 -0
  4. package/dist/src/core/living-docs/feature-consistency-validator.js +445 -0
  5. package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -0
  6. package/dist/src/core/living-docs/index.d.ts +1 -0
  7. package/dist/src/core/living-docs/index.d.ts.map +1 -1
  8. package/dist/src/core/living-docs/index.js +1 -0
  9. package/dist/src/core/living-docs/index.js.map +1 -1
  10. package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -0
  11. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  12. package/dist/src/core/living-docs/living-docs-sync.js +50 -0
  13. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  14. package/dist/src/core/repo-structure/platform-registry.d.ts.map +1 -1
  15. package/dist/src/core/repo-structure/platform-registry.js +3 -2
  16. package/dist/src/core/repo-structure/platform-registry.js.map +1 -1
  17. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  18. package/dist/src/core/repo-structure/prompt-consolidator.js +4 -2
  19. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  20. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  21. package/dist/src/core/repo-structure/repo-structure-manager.js +18 -32
  22. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  23. package/dist/src/utils/auth-helpers.d.ts.map +1 -1
  24. package/dist/src/utils/auth-helpers.js +13 -1
  25. package/dist/src/utils/auth-helpers.js.map +1 -1
  26. package/package.json +1 -1
  27. package/plugins/specweave/commands/specweave-validate-features.md +203 -0
  28. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  29. package/plugins/specweave/hooks/hooks.json +10 -0
  30. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  31. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  32. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  33. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  34. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  35. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  36. package/plugins/specweave/hooks/post-metadata-change.sh +18 -0
  37. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  38. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  39. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  40. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  41. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  42. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  43. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  44. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  45. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  46. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
  47. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  48. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1104 -0
  49. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  50. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  51. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  52. package/plugins/specweave-kafka/skills/kafka-mcp-integration/SKILL.md +17 -0
  53. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +3 -1
  54. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1017 -0
  55. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  56. package/plugins/specweave-ui/commands/ui-automate.md +5 -28
  57. package/src/templates/AGENTS.md.template +92 -9
@@ -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
@@ -11,10 +11,11 @@ Create and execute automated browser workflows using Playwright. Generate script
11
11
  ## What I Do
12
12
 
13
13
  1. **Workflow Planning**: Define step-by-step browser automation sequences
14
- 2. **Script Generation**: Create Playwright TypeScript/JavaScript code
15
- 3. **MCP Integration**: Use Playwright MCP server for browser control
16
- 4. **Error Handling**: Add retry logic, timeouts, and fallbacks
17
- 5. **Output Collection**: Capture screenshots, data, and validation results
14
+ 2. **Script Generation**: Create Playwright TypeScript/JavaScript code (code-first approach)
15
+ 3. **Error Handling**: Add retry logic, timeouts, and fallbacks
16
+ 4. **Output Collection**: Capture screenshots, data, and validation results
17
+
18
+ > **Why Code-First?** Anthropic research shows [code execution beats MCP tool calls](https://www.anthropic.com/engineering/code-execution-with-mcp) with 98% token reduction. Playwright code is reusable, committable, CI-runnable, and deterministic.
18
19
 
19
20
  ## Workflow Types
20
21
 
@@ -108,30 +109,6 @@ async function automateWorkflow() {
108
109
  automateWorkflow();
109
110
  ```
110
111
 
111
- ## MCP Server Integration
112
-
113
- Uses Playwright MCP server for enhanced capabilities:
114
- - **Session Management**: Reuse browser contexts
115
- - **Network Interception**: Mock APIs, block resources
116
- - **Performance Metrics**: Collect timing data
117
- - **Video Recording**: Capture automation runs
118
- - **Parallel Execution**: Run multiple automations concurrently
119
-
120
- ### MCP Configuration
121
-
122
- Add to `.claude/mcp_server_config.json`:
123
- ```json
124
- {
125
- "playwright": {
126
- "command": "npx",
127
- "args": ["playwright-mcp-server"],
128
- "env": {
129
- "PLAYWRIGHT_BROWSERS_PATH": "~/.cache/playwright"
130
- }
131
- }
132
- }
133
- ```
134
-
135
112
  ## Use Cases
136
113
 
137
114
  ### 1. Regression Testing
@@ -77,6 +77,48 @@
77
77
 
78
78
  **CRITICAL**: Claude Code has automatic hooks. Other tools DO NOT.
79
79
 
80
+ ### Code-First Approach (MANDATORY for Non-Claude Tools)
81
+
82
+ > **Engineering insight**: [Anthropic research](https://www.anthropic.com/engineering/code-execution-with-mcp) shows code execution achieves **98% token reduction** vs MCP tool calls.
83
+ >
84
+ > **For non-Claude tools, this is even MORE important** - MCP support varies, but `npx` works everywhere!
85
+
86
+ **Rule**: Always prefer direct code execution over MCP:
87
+
88
+ ```bash
89
+ # ❌ DON'T: Use Playwright MCP for testing
90
+ # ✅ DO: Write Playwright tests and run with npx
91
+ npx playwright test
92
+
93
+ # ❌ DON'T: Use Kafka MCP for messaging
94
+ # ✅ DO: Write kafkajs code
95
+ import { Kafka } from 'kafkajs';
96
+ const kafka = new Kafka({ brokers: ['localhost:9092'] });
97
+
98
+ # ❌ DON'T: Chain multiple MCP tool calls
99
+ # ✅ DO: Write a script that does all the work
100
+ npx ts-node scripts/process-data.ts
101
+ ```
102
+
103
+ **Why code is better**:
104
+ | Aspect | MCP | Code (`npx`) |
105
+ |--------|-----|--------------|
106
+ | Token cost | High (tool defs + data duplication) | Low (only results) |
107
+ | Reusability | Ephemeral | Committed to git |
108
+ | CI/CD | Usually can't run | Native execution |
109
+ | Debugging | Limited | Full stack traces |
110
+ | Works with | Tools with MCP support | ANY tool |
111
+
112
+ **Pattern for non-Claude tools**:
113
+ ```
114
+ 1. AI writes code (test, script, automation)
115
+ 2. You run: npx <command>
116
+ 3. AI analyzes output
117
+ 4. Repeat
118
+ ```
119
+
120
+ This gives you the SAME experience as Claude Code with MCP, but deterministic and reusable!
121
+
80
122
  ### What's Different
81
123
 
82
124
  | Feature | Claude Code | Cursor/Copilot |
@@ -327,7 +369,40 @@ max_context_tokens: 10000
327
369
 
328
370
  {SKILLS_SECTION}
329
371
 
330
- **Usage**: Check SKILLS-INDEX.md, match task to skill, follow workflow.
372
+ **Usage for Claude Code**: Skills auto-activate based on keywords in your prompt.
373
+
374
+ **Usage for Non-Claude Tools (Cursor, Copilot, etc.)**:
375
+ Skills don't auto-activate. You must manually load them:
376
+
377
+ ```bash
378
+ # Step 1: Find relevant skill
379
+ ls plugins/specweave*/skills/
380
+
381
+ # Step 2: Read the skill file
382
+ cat plugins/specweave/skills/increment-planner/SKILL.md
383
+
384
+ # Step 3: Tell AI to follow the skill's workflow
385
+ "Follow the increment-planner skill workflow to create my feature"
386
+
387
+ # Step 4: AI reads skill content and follows instructions
388
+ ```
389
+
390
+ **Skill Simulation Pattern**:
391
+ ```
392
+ Non-Claude AI Tools simulate skills by:
393
+ 1. Reading SKILL.md files from plugins/ folder
394
+ 2. Following the workflow instructions inside
395
+ 3. Using the patterns and templates provided
396
+ 4. Running `npx` commands instead of MCP tools (code-first!)
397
+ ```
398
+
399
+ **Example** - Creating increment with Cursor:
400
+ ```
401
+ User: "Create an increment for user authentication"
402
+ AI: [Reads plugins/specweave/skills/increment-planner/SKILL.md]
403
+ AI: [Follows PM workflow: research → spec → plan → tasks]
404
+ AI: [Creates .specweave/increments/0001-auth/spec.md, plan.md, tasks.md]
405
+ ```
331
406
 
332
407
  ---
333
408
 
@@ -436,20 +511,28 @@ Or run: `/specweave:sync-tasks`
436
511
 
437
512
  ### Skills/Agents Not Activating
438
513
 
439
- **Non-Claude tools**: Skills don't auto-activate.
514
+ **Non-Claude tools**: Skills don't auto-activate. This is EXPECTED.
440
515
 
441
- **Manual activation**:
516
+ **Manual activation (Cursor, Copilot, Windsurf, etc.)**:
442
517
  ```bash
443
- # 1. Check skills index
444
- cat .claude/skills/SKILLS-INDEX.md
518
+ # 1. Find skills in plugins folder (NOT .claude/)
519
+ ls plugins/specweave*/skills/
520
+
521
+ # 2. Read the skill file
522
+ cat plugins/specweave/skills/e2e-playwright/SKILL.md
445
523
 
446
- # 2. Match your task to a skill
447
- # 3. Load the skill manually
448
- cat .claude/skills/increment-planner/SKILL.md
524
+ # 3. Tell AI to follow it
525
+ "Read the e2e-playwright skill and write tests for my login page"
449
526
 
450
- # 4. Follow the skill's workflow
527
+ # 4. AI writes code, YOU run it (code-first!)
528
+ npx playwright test
451
529
  ```
452
530
 
531
+ **Remember**: Non-Claude tools get SAME functionality by:
532
+ - Reading skill files manually
533
+ - Following the workflows inside
534
+ - Running `npx` instead of MCP tools (better anyway!)
535
+
453
536
  ---
454
537
 
455
538
  ## Documentation