specweave 0.9.1 → 0.10.1

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 (75) hide show
  1. package/CLAUDE.md +153 -13
  2. package/README.md +97 -251
  3. package/bin/install-agents.sh +1 -1
  4. package/bin/install-commands.sh +1 -1
  5. package/bin/install-hooks.sh +1 -1
  6. package/bin/install-skills.sh +1 -1
  7. package/bin/specweave.js +32 -0
  8. package/dist/cli/commands/init.d.ts.map +1 -1
  9. package/dist/cli/commands/init.js +29 -1
  10. package/dist/cli/commands/init.js.map +1 -1
  11. package/dist/cli/commands/validate-jira.d.ts +35 -0
  12. package/dist/cli/commands/validate-jira.d.ts.map +1 -0
  13. package/dist/cli/commands/validate-jira.js +112 -0
  14. package/dist/cli/commands/validate-jira.js.map +1 -0
  15. package/dist/cli/commands/validate-plugins.d.ts +41 -0
  16. package/dist/cli/commands/validate-plugins.d.ts.map +1 -0
  17. package/dist/cli/commands/validate-plugins.js +171 -0
  18. package/dist/cli/commands/validate-plugins.js.map +1 -0
  19. package/dist/core/types/sync-profile.d.ts +177 -29
  20. package/dist/core/types/sync-profile.d.ts.map +1 -1
  21. package/dist/core/types/sync-profile.js +48 -1
  22. package/dist/core/types/sync-profile.js.map +1 -1
  23. package/dist/hooks/lib/translate-living-docs.d.ts.map +1 -1
  24. package/dist/hooks/lib/translate-living-docs.js +16 -7
  25. package/dist/hooks/lib/translate-living-docs.js.map +1 -1
  26. package/dist/metrics/dora-calculator.d.ts +7 -3
  27. package/dist/metrics/dora-calculator.d.ts.map +1 -1
  28. package/dist/metrics/dora-calculator.js +19 -6
  29. package/dist/metrics/dora-calculator.js.map +1 -1
  30. package/dist/metrics/report-generator.d.ts +17 -0
  31. package/dist/metrics/report-generator.d.ts.map +1 -0
  32. package/dist/metrics/report-generator.js +403 -0
  33. package/dist/metrics/report-generator.js.map +1 -0
  34. package/dist/utils/external-resource-validator.d.ts +102 -0
  35. package/dist/utils/external-resource-validator.d.ts.map +1 -0
  36. package/dist/utils/external-resource-validator.js +400 -0
  37. package/dist/utils/external-resource-validator.js.map +1 -0
  38. package/dist/utils/plugin-validator.d.ts +161 -0
  39. package/dist/utils/plugin-validator.d.ts.map +1 -0
  40. package/dist/utils/plugin-validator.js +565 -0
  41. package/dist/utils/plugin-validator.js.map +1 -0
  42. package/package.json +2 -1
  43. package/plugins/specweave/commands/specweave-do.md +47 -0
  44. package/plugins/specweave/commands/specweave-increment.md +82 -0
  45. package/plugins/specweave/commands/specweave-next.md +47 -0
  46. package/plugins/specweave/hooks/post-increment-planning.sh +117 -38
  47. package/plugins/specweave/hooks/pre-tool-use.sh +133 -0
  48. package/plugins/specweave/plugin.json +22 -0
  49. package/plugins/specweave/skills/SKILLS-INDEX.md +23 -2
  50. package/plugins/specweave/skills/plugin-installer/SKILL.md +340 -0
  51. package/plugins/specweave/skills/plugin-validator/SKILL.md +427 -0
  52. package/plugins/specweave-ado/.claude-plugin/plugin.json +2 -4
  53. package/plugins/specweave-ado/lib/ado-board-resolver.ts +328 -0
  54. package/plugins/specweave-ado/lib/ado-hierarchical-sync.ts +484 -0
  55. package/plugins/specweave-ado/plugin.json +20 -0
  56. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +15 -2
  57. package/plugins/specweave-backend/.claude-plugin/plugin.json +15 -2
  58. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +14 -2
  59. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +14 -2
  60. package/plugins/specweave-docs/.claude-plugin/plugin.json +13 -2
  61. package/plugins/specweave-figma/.claude-plugin/plugin.json +14 -2
  62. package/plugins/specweave-frontend/.claude-plugin/plugin.json +15 -2
  63. package/plugins/specweave-github/lib/github-board-resolver.ts +164 -0
  64. package/plugins/specweave-github/lib/github-hierarchical-sync.ts +344 -0
  65. package/plugins/specweave-github/plugin.json +19 -0
  66. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +15 -2
  67. package/plugins/specweave-jira/.claude-plugin/plugin.json +14 -2
  68. package/plugins/specweave-jira/lib/jira-board-resolver.ts +127 -0
  69. package/plugins/specweave-jira/lib/jira-hierarchical-sync.ts +283 -0
  70. package/plugins/specweave-jira/plugin.json +20 -0
  71. package/plugins/specweave-jira/skills/jira-resource-validator/SKILL.md +647 -0
  72. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +14 -2
  73. package/plugins/specweave-payments/.claude-plugin/plugin.json +14 -2
  74. package/plugins/specweave-testing/.claude-plugin/plugin.json +14 -2
  75. package/plugins/specweave-tooling/.claude-plugin/plugin.json +13 -2
package/CLAUDE.md CHANGED
@@ -992,6 +992,59 @@ When you create increments (e.g., `/specweave:increment "Add Stripe billing"`):
992
992
  - Install later → Skills won't be available until plugin installed (can add mid-work)
993
993
  - Skip → Increment creation continues (not blocked, but capabilities limited)
994
994
 
995
+ #### Phase 2.5: Just-in-Time Plugin Installation (NEW! v0.10.0+)
996
+
997
+ **The Critical Gap**: Users request features that require plugins (e.g., "preview docs locally"), but those plugins aren't installed yet. Instead of failing silently or recommending manual installation, SpecWeave now **automatically installs plugins just-in-time**.
998
+
999
+ **How it works** (via `plugin-installer` skill):
1000
+
1001
+ 1. **Automatic Detection**
1002
+ - User requests a feature (e.g., "Show me the internal docs in a browser")
1003
+ - `plugin-installer` skill detects keywords: "docs", "browser" → needs `specweave-docs-preview`
1004
+ - Checks if plugin is installed: `/plugin list --installed`
1005
+
1006
+ 2. **Auto-Installation**
1007
+ ```
1008
+ 🔌 Detected need for specweave-docs-preview plugin
1009
+
1010
+ 📦 Installing specweave-docs-preview...
1011
+ This plugin provides: Beautiful Docusaurus UI for browsing .specweave/docs/
1012
+
1013
+ ✅ Plugin installed successfully!
1014
+ You can now:
1015
+ • Browse documentation in beautiful UI
1016
+ • Hot reload when editing markdown files
1017
+ • Render Mermaid diagrams automatically
1018
+
1019
+ Proceeding to launch docs preview server...
1020
+ ```
1021
+
1022
+ 3. **Seamless Execution**
1023
+ - Plugin installed automatically (no manual intervention)
1024
+ - Feature executes immediately
1025
+ - User sees clear notification of what was installed and why
1026
+
1027
+ **Supported Just-in-Time Plugins**:
1028
+
1029
+ | User Keywords | Auto-Installed Plugin | Capabilities |
1030
+ |--------------|----------------------|--------------|
1031
+ | "preview docs", "documentation UI", "Docusaurus" | `specweave-docs-preview` | Beautiful docs UI, hot reload |
1032
+ | "React", "Next.js", "frontend", "UI component" | `specweave-frontend` | Frontend expert, design systems |
1033
+ | "K8s", "Kubernetes", "Helm", "deploy" | `specweave-kubernetes` | K8s expert, manifest generation |
1034
+ | "TensorFlow", "PyTorch", "ML model" | `specweave-ml` | ML pipelines, training, deployment |
1035
+ | "Stripe", "billing", "payment" | `specweave-payments` | Payment expert, Stripe integration |
1036
+ | "Playwright", "E2E testing", "browser automation" | `specweave-testing` | E2E testing infrastructure |
1037
+ | "Figma", "design tokens", "prototype" | `specweave-figma` | Design system integration |
1038
+ | "Mermaid", "C4 model", "architecture diagram" | `specweave-diagrams` | Diagram generation |
1039
+
1040
+ **Key Benefits**:
1041
+ - ✅ **Zero friction**: No manual plugin installation needed
1042
+ - ✅ **Proactive**: Detects requirements automatically based on user request
1043
+ - ✅ **Clear UX**: Users understand what's being installed and why
1044
+ - ✅ **Fail-safe**: Handles installation errors gracefully with troubleshooting steps
1045
+
1046
+ **See**: `plugins/specweave/skills/plugin-installer/SKILL.md` for complete keyword map and workflow
1047
+
995
1048
  #### Phase 3: Implementation (Auto-Activation)
996
1049
 
997
1050
  When plugins are installed:
@@ -1981,6 +2034,35 @@ Solution: Inactivity-based detection
1981
2034
  - `INACTIVITY_THRESHOLD=15` - Seconds of inactivity to assume session ending (adjustable)
1982
2035
  - `DEBOUNCE_SECONDS=2` - Prevents duplicate hook fires
1983
2036
 
2037
+ **Pre-Tool-Use Hook** (`.claude/hooks/pre-tool-use.sh`):
2038
+
2039
+ **Purpose**: Detect when Claude asks questions BEFORE task completion
2040
+
2041
+ **The Problem**: The post-task-completion hook only fires after TodoWrite events. If Claude asks a question via AskUserQuestion WITHOUT completing any tasks first, no sound plays and the user doesn't know Claude is waiting for input.
2042
+
2043
+ **The Solution**: The pre-tool-use hook fires BEFORE every tool call, allowing us to detect AskUserQuestion immediately.
2044
+
2045
+ **How It Works**:
2046
+ ```
2047
+ Scenario 1: Question after task completion
2048
+ - 10:00:00 - Task completed (TodoWrite) → post-task-completion hook fires
2049
+ - 10:00:15 - Inactivity threshold reached → SOUND! ✅
2050
+
2051
+ Scenario 2: Question WITHOUT task completion (NEW!)
2052
+ - 10:00:00 - Claude calls AskUserQuestion → pre-tool-use hook fires
2053
+ - 10:00:00 - Detects tool_name="AskUserQuestion" → SOUND! ✅
2054
+ - User is notified IMMEDIATELY, not after 15s
2055
+ ```
2056
+
2057
+ **Key Features**:
2058
+ - ✅ Fires BEFORE any tool call (PreToolUse event)
2059
+ - ✅ Filters for AskUserQuestion specifically
2060
+ - ✅ Plays distinctive sound (Tink.aiff on macOS, dialog-question.oga on Linux)
2061
+ - ✅ Non-blocking and fast (<10ms overhead)
2062
+ - ✅ Complements post-task-completion hook (both work together)
2063
+
2064
+ **Result**: Users are ALWAYS notified when Claude needs input, regardless of whether tasks have been completed or not.
2065
+
1984
2066
  **Manual Actions** (Claude MUST do after each task):
1985
2067
  - Update `CLAUDE.md` when structure changes
1986
2068
  - Update `README.md` for user-facing changes
@@ -2713,30 +2795,54 @@ Your choice [1]:
2713
2795
 
2714
2796
  ### Translation Workflow (Multilingual Support)
2715
2797
 
2716
- **SpecWeave supports multilingual development** via post-generation translation (Increment 0006).
2798
+ **SpecWeave supports multilingual development** via two-phase post-generation translation (Increment 0006).
2717
2799
 
2718
2800
  **Key Concept**: Users work in their native language (great UX), system auto-translates to English (maintainable docs).
2719
2801
 
2802
+ **Two-Phase Translation Architecture**:
2803
+
2804
+ | Phase | Hook | What Gets Translated | When | Coverage |
2805
+ |-------|------|---------------------|------|----------|
2806
+ | **Phase 1** | post-increment-planning | Increment files + Living docs specs | After `/specweave:increment` | 80% of docs |
2807
+ | **Phase 2** | post-task-completion | ADRs, HLDs, diagrams | After each task completion | 20% of docs |
2808
+
2720
2809
  **Workflow**:
2721
2810
 
2722
2811
  ```bash
2723
2812
  # 1. User creates increment in Russian
2724
2813
  /specweave:increment "Добавить пользовательскую аутентификацию"
2725
2814
 
2726
- # 2. PM agent generates spec.md in Russian (natural, user-friendly)
2815
+ # 2. PM agent generates spec.md, plan.md, tasks.md in Russian (natural, user-friendly)
2727
2816
 
2728
- # 3. post-increment-planning hook fires automatically
2729
- # - Detects Russian content
2730
- # - Translates spec.md, plan.md, tasks.md to English (~$0.01 cost)
2731
- # - Files now in English (maintainable)
2817
+ # 3. post-increment-planning hook fires automatically (PHASE 1)
2818
+ # Phase A: Translates increment files (spec.md, plan.md, tasks.md) to English
2819
+ # Phase B: Translates living docs specs to English (NEW!)
2820
+ # - .specweave/docs/internal/specs/spec-*.md
2821
+ # - .specweave/docs/internal/strategy/**/*.md
2822
+ # Cost: ~$0.02 total
2732
2823
 
2733
2824
  # User sees:
2734
2825
  # ✅ Increment created
2735
- # 🌐 Detected Russian content. Translating to English...
2826
+ # 🌐 Detected Russian content. Translating increment files to English...
2736
2827
  # 📄 spec.md... ✅
2737
2828
  # 📄 plan.md... ✅
2738
2829
  # 📄 tasks.md... ✅
2739
- # Translation complete! Cost: ~$0.01
2830
+ # 🌐 Checking living docs for translation...
2831
+ # 📄 Living docs detected: spec-0001-user-auth.md
2832
+ # ✅ Translated 1 living docs file(s) to English
2833
+ # ✅ Translation complete!
2834
+ # Increment files: 3/3
2835
+ # Living docs: 1 file(s)
2836
+ # Estimated cost: ~$0.01-0.02 (using Haiku)
2837
+
2838
+ # 4. During implementation, architect creates ADRs in Russian
2839
+
2840
+ # 5. post-task-completion hook fires after each task (PHASE 2)
2841
+ # - Translates newly created ADRs to English
2842
+ # - Translates HLDs/diagrams to English
2843
+ # Cost: ~$0.01 per file
2844
+
2845
+ # Result: ALL documentation in English (100% coverage)
2740
2846
  ```
2741
2847
 
2742
2848
  **Configuration** (`.specweave/config.json`):
@@ -2747,7 +2853,7 @@ Your choice [1]:
2747
2853
  "translation": {
2748
2854
  "enabled": true,
2749
2855
  "autoTranslateInternalDocs": true,
2750
- "autoTranslateLivingDocs": false,
2856
+ "autoTranslateLivingDocs": true,
2751
2857
  "keepFrameworkTerms": true,
2752
2858
  "keepTechnicalTerms": true,
2753
2859
  "translationModel": "haiku"
@@ -2757,8 +2863,8 @@ Your choice [1]:
2757
2863
 
2758
2864
  **Key Settings**:
2759
2865
  - `language`: Primary language (en, ru, es, zh, de, fr, ja, ko, pt)
2760
- - `autoTranslateInternalDocs`: Auto-translate spec/plan/tasks to English (default: true)
2761
- - `autoTranslateLivingDocs`: Auto-translate ADRs/HLDs after task completion (default: false)
2866
+ - `autoTranslateInternalDocs`: Auto-translate increment files + living docs specs to English (default: true)
2867
+ - `autoTranslateLivingDocs`: Auto-translate ADRs/HLDs after task completion (default: true)
2762
2868
  - `translationModel`: Model to use (haiku/sonnet/opus, default: haiku)
2763
2869
 
2764
2870
  **Supported Languages**:
@@ -2772,7 +2878,9 @@ Your choice [1]:
2772
2878
  - Korean (ko)
2773
2879
  - Portuguese (pt)
2774
2880
 
2775
- **Cost**: ~$0.01 per increment (3 files, Haiku model)
2881
+ **Cost**: ~$0.02 per increment (5-7 files, Haiku model)
2882
+
2883
+ **Coverage**: 100% (no gaps! All living docs translated)
2776
2884
 
2777
2885
  **Implementation Details**:
2778
2886
  - Language detection: Heuristic-based (<1ms, zero cost)
@@ -2792,10 +2900,42 @@ npm test -- tests/unit/i18n/translation.test.ts
2792
2900
  **Files**:
2793
2901
  - Utilities: `src/utils/translation.ts` (673 lines, 11 languages)
2794
2902
  - CLI Script: `src/hooks/lib/translate-file.ts` (398 lines)
2795
- - Hook: `plugins/specweave/hooks/post-increment-planning.sh` (307 lines)
2903
+ - Hook (Phase 1): `plugins/specweave/hooks/post-increment-planning.sh` (~420 lines)
2904
+ - Hook (Phase 2): `src/hooks/lib/translate-living-docs.ts` (217 lines)
2796
2905
  - Tests: `tests/unit/i18n/translation.test.ts` (705 lines, 67 tests)
2906
+ - E2E Tests: `tests/e2e/i18n/living-docs-translation.spec.ts` (6 test cases)
2797
2907
  - Schema: `src/core/schemas/specweave-config.schema.json`
2798
2908
 
2909
+ **Migrating Existing Non-English Living Docs**:
2910
+
2911
+ For projects with existing non-English living docs, use the one-time migration script:
2912
+
2913
+ ```bash
2914
+ # One-time migration (translates all living docs to English)
2915
+ bash scripts/migrate-living-docs-to-english.sh
2916
+
2917
+ # What it does:
2918
+ # - Scans .specweave/docs/internal/ for non-English files
2919
+ # - Translates each file to English (preserves code blocks, links, framework terms)
2920
+ # - Skips files already in English
2921
+ # - Non-blocking (continues even if some files fail)
2922
+
2923
+ # Estimated time: 1-2 minutes per 100 files
2924
+ # Estimated cost: ~$0.01 per file (using Haiku)
2925
+ ```
2926
+
2927
+ **After migration**:
2928
+ ```bash
2929
+ # Review translated files
2930
+ git diff .specweave/docs/internal/
2931
+
2932
+ # Commit changes
2933
+ git add . && git commit -m "docs: translate living docs to English"
2934
+
2935
+ # Future increments will auto-translate
2936
+ /specweave:increment "Добавить новую функцию" # Auto-translates!
2937
+ ```
2938
+
2799
2939
  ---
2800
2940
 
2801
2941
  ## Troubleshooting