specweave 1.0.256 → 1.0.259

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 (113) hide show
  1. package/CLAUDE.md +56 -221
  2. package/README.md +31 -0
  3. package/bin/specweave.js +17 -0
  4. package/dist/src/adapters/README.md +4 -4
  5. package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
  6. package/dist/src/adapters/agents-md-generator.js +0 -2
  7. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  8. package/dist/src/adapters/claude/README.md +3 -3
  9. package/dist/src/adapters/claude/adapter.js +3 -3
  10. package/dist/src/adapters/claude-md-generator.js +1 -1
  11. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  12. package/dist/src/adapters/registry.yaml +1 -1
  13. package/dist/src/cli/commands/create-increment.d.ts +24 -0
  14. package/dist/src/cli/commands/create-increment.d.ts.map +1 -0
  15. package/dist/src/cli/commands/create-increment.js +53 -0
  16. package/dist/src/cli/commands/create-increment.js.map +1 -0
  17. package/dist/src/cli/commands/init.d.ts.map +1 -1
  18. package/dist/src/cli/commands/init.js +48 -31
  19. package/dist/src/cli/commands/init.js.map +1 -1
  20. package/dist/src/cli/commands/update.d.ts.map +1 -1
  21. package/dist/src/cli/commands/update.js +36 -0
  22. package/dist/src/cli/commands/update.js.map +1 -1
  23. package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
  24. package/dist/src/cli/helpers/init/directory-structure.js +13 -1
  25. package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
  26. package/dist/src/cli/helpers/init/summary-banner.d.ts +11 -0
  27. package/dist/src/cli/helpers/init/summary-banner.d.ts.map +1 -1
  28. package/dist/src/cli/helpers/init/summary-banner.js +49 -3
  29. package/dist/src/cli/helpers/init/summary-banner.js.map +1 -1
  30. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  31. package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
  32. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  33. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  34. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +6 -2
  35. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  36. package/dist/src/core/ac-progress-sync.d.ts +13 -0
  37. package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
  38. package/dist/src/core/ac-progress-sync.js +28 -0
  39. package/dist/src/core/ac-progress-sync.js.map +1 -1
  40. package/dist/src/core/config/types.d.ts +24 -1
  41. package/dist/src/core/config/types.d.ts.map +1 -1
  42. package/dist/src/core/config/types.js +6 -1
  43. package/dist/src/core/config/types.js.map +1 -1
  44. package/dist/src/core/doctor/checkers/project-structure-checker.d.ts +1 -0
  45. package/dist/src/core/doctor/checkers/project-structure-checker.d.ts.map +1 -1
  46. package/dist/src/core/doctor/checkers/project-structure-checker.js +53 -3
  47. package/dist/src/core/doctor/checkers/project-structure-checker.js.map +1 -1
  48. package/dist/src/core/fabric/security-scanner.d.ts.map +1 -1
  49. package/dist/src/core/fabric/security-scanner.js +70 -9
  50. package/dist/src/core/fabric/security-scanner.js.map +1 -1
  51. package/dist/src/core/increment/increment-utils.d.ts +6 -0
  52. package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
  53. package/dist/src/core/increment/increment-utils.js +5 -0
  54. package/dist/src/core/increment/increment-utils.js.map +1 -1
  55. package/dist/src/core/living-docs/discovery.d.ts +2 -0
  56. package/dist/src/core/living-docs/discovery.d.ts.map +1 -1
  57. package/dist/src/core/living-docs/discovery.js +91 -17
  58. package/dist/src/core/living-docs/discovery.js.map +1 -1
  59. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +5 -0
  60. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -1
  61. package/dist/src/core/living-docs/intelligent-analyzer/index.js +3 -3
  62. package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -1
  63. package/dist/src/core/living-docs/lsp-bootstrapper.d.ts +64 -0
  64. package/dist/src/core/living-docs/lsp-bootstrapper.d.ts.map +1 -0
  65. package/dist/src/core/living-docs/lsp-bootstrapper.js +118 -0
  66. package/dist/src/core/living-docs/lsp-bootstrapper.js.map +1 -0
  67. package/dist/src/core/project/project-service.d.ts +10 -1
  68. package/dist/src/core/project/project-service.d.ts.map +1 -1
  69. package/dist/src/core/project/project-service.js +37 -2
  70. package/dist/src/core/project/project-service.js.map +1 -1
  71. package/dist/src/core/universal-auto-create.d.ts +64 -0
  72. package/dist/src/core/universal-auto-create.d.ts.map +1 -0
  73. package/dist/src/core/universal-auto-create.js +228 -0
  74. package/dist/src/core/universal-auto-create.js.map +1 -0
  75. package/package.json +1 -1
  76. package/plugins/specweave/PLUGIN.md +0 -3
  77. package/plugins/specweave/commands/living-docs.md +0 -2
  78. package/plugins/specweave/hooks/stop-sync.sh +34 -5
  79. package/plugins/specweave/hooks/user-prompt-submit.sh +115 -326
  80. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +19 -5
  81. package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +14 -4
  82. package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +181 -0
  83. package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -2
  84. package/plugins/specweave/scripts/skill-context.sh +160 -0
  85. package/plugins/specweave/skills/architect/SKILL.md +1 -1
  86. package/plugins/specweave/skills/archive-increments/SKILL.md +13 -3
  87. package/plugins/specweave/skills/auto/SKILL.md +92 -1038
  88. package/plugins/specweave/skills/do/SKILL.md +66 -1106
  89. package/plugins/specweave/skills/docs/SKILL.md +124 -56
  90. package/plugins/specweave/skills/done/SKILL.md +76 -1406
  91. package/plugins/specweave/skills/framework/SKILL.md +1 -1
  92. package/plugins/specweave/skills/increment/SKILL.md +1 -1
  93. package/plugins/specweave/skills/increment-planner/SKILL.md +29 -19
  94. package/plugins/specweave/skills/jobs/SKILL.md +52 -0
  95. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +1 -1
  96. package/plugins/specweave/skills/save/SKILL.md +51 -1372
  97. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +1 -1
  98. package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +1 -1
  99. package/plugins/specweave/skills/validate/SKILL.md +65 -848
  100. package/plugins/specweave-backend/skills/database-optimizer/SKILL.md +1 -1
  101. package/plugins/specweave-backend/skills/graphql/SKILL.md +1 -1
  102. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +1 -1
  103. package/plugins/specweave-frontend/skills/frontend/SKILL.md +1 -1
  104. package/plugins/specweave-frontend/skills/frontend-architect/SKILL.md +1 -1
  105. package/plugins/specweave-frontend/skills/frontend-design/SKILL.md +1 -1
  106. package/plugins/specweave-frontend/skills/i18n-expert/SKILL.md +1 -1
  107. package/plugins/specweave-payments/skills/billing-automation/SKILL.md +1 -1
  108. package/plugins/specweave-testing/skills/accessibility-testing/SKILL.md +1 -1
  109. package/src/templates/CLAUDE.md.template +50 -356
  110. package/src/templates/config.json.template +5 -1
  111. package/plugins/specweave/commands/brownfield-analyzer.md +0 -408
  112. package/plugins/specweave/commands/brownfield-onboarder.md +0 -837
  113. package/plugins/specweave/commands/export-skills.md +0 -179
@@ -1,103 +1,171 @@
1
1
  ---
2
- description: Browse and load SpecWeave living docs (public, internal, architecture, ADRs). Use when saying "show docs", "browse docs", "find docs about", "load docs", or "read ADR".
3
- argument-hint: "[topic] [--public] [--internal] [--adr] [--list]"
2
+ description: Documentation hub - browse, search, serve living docs. Use for "show docs", "browse docs", "find docs", "load docs", "read ADR", "serve docs", "preview docs", "docs status".
3
+ argument-hint: "[topic] [--serve] [--status] [--public] [--internal] [--adr] [--list]"
4
4
  ---
5
5
 
6
- # Living Docs Browser
6
+ # Documentation Hub
7
7
 
8
8
  ## Project Overrides
9
9
 
10
10
  !`s="docs"; for d in .specweave/skill-memories .claude/skill-memories "$HOME/.claude/skill-memories"; do p="$d/$s.md"; [ -f "$p" ] && awk '/^## Learnings$/{ok=1;next}/^## /{ok=0}ok' "$p" && break; done 2>/dev/null; true`
11
11
 
12
- Browse, search, and load SpecWeave living documentation into the conversation.
12
+ Browse, search, load, and serve SpecWeave living documentation.
13
13
 
14
- ## Documentation Structure
14
+ ## Config-Driven Directories
15
15
 
16
+ Read configured doc directories before any operation:
17
+
18
+ ```bash
19
+ # Read configured doc directories (default: .specweave/docs)
20
+ DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
21
+ [ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"
16
22
  ```
17
- .specweave/docs/
18
- public/ # User-facing docs (guides, workflows, troubleshooting, API)
19
- internal/ # Developer docs (specs, architecture, ADRs, operations)
20
- ```
23
+
24
+ All search/list commands below MUST iterate over `$DOC_DIRS` instead of hardcoding `.specweave/docs`.
21
25
 
22
26
  ## Behavior
23
27
 
24
- ### 1. No arguments or `--list`: Show available topics
28
+ ### 1. No arguments: Show documentation dashboard
29
+
30
+ Run these diagnostic commands:
25
31
 
26
32
  ```bash
27
- echo "=== Public Docs ==="
28
- ls .specweave/docs/public/ 2>/dev/null || echo "(none)"
33
+ # Read configured doc directories
34
+ DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
35
+ [ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"
36
+
37
+ # Count documents across all directories
38
+ DOC_COUNT=0
39
+ for dir in $DOC_DIRS; do
40
+ if [ -d "$dir" ]; then
41
+ C=$(find "$dir" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
42
+ DOC_COUNT=$((DOC_COUNT + C))
43
+ fi
44
+ done
45
+ echo "DOC_COUNT:$DOC_COUNT"
46
+
47
+ # Check Docusaurus install status
48
+ [ -d ".specweave/docs-site-internal/node_modules" ] && echo "DOCUSAURUS:installed" || echo "DOCUSAURUS:not_installed"
49
+
50
+ # Check if docs server is running
51
+ SERVER_INFO=$(lsof -i :3000-3010 -sTCP:LISTEN 2>/dev/null | grep -i node | head -1 | awk '{print $9}' | cut -d: -f2)
52
+ [ -n "$SERVER_INFO" ] && echo "SERVER:running:$SERVER_INFO" || echo "SERVER:stopped"
53
+
54
+ # List topics per directory
55
+ for dir in $DOC_DIRS; do
56
+ echo "=== $dir ==="
57
+ if [ -d "$dir/public" ]; then
58
+ echo " Public:"
59
+ ls "$dir/public/" 2>/dev/null || echo " (none)"
60
+ fi
61
+ if [ -d "$dir/internal" ]; then
62
+ echo " Internal:"
63
+ ls "$dir/internal/" 2>/dev/null || echo " (none)"
64
+ fi
65
+ if [ -d "$dir/internal/architecture/adr" ]; then
66
+ echo " ADRs:"
67
+ ls "$dir/internal/architecture/adr/" 2>/dev/null || echo " (none)"
68
+ fi
69
+ # For non-standard directories (e.g., docs/), list top-level folders
70
+ if [ "$dir" != ".specweave/docs" ] && [ -d "$dir" ]; then
71
+ echo " Folders:"
72
+ ls -d "$dir"/*/ 2>/dev/null | xargs -I{} basename {} || echo " (none)"
73
+ fi
74
+ done
75
+ ```
29
76
 
30
- echo ""
31
- echo "=== Internal Docs ==="
32
- ls .specweave/docs/internal/ 2>/dev/null || echo "(none)"
77
+ Present as a clean dashboard.
33
78
 
34
- echo ""
35
- echo "=== Architecture ==="
36
- ls .specweave/docs/internal/architecture/ 2>/dev/null || echo "(none)"
79
+ **Then ALWAYS include serve guidance** (same as `--serve` behavior):
80
+ - If server is already running: "Docs server running at http://localhost:<port>"
81
+ - If server is NOT running: Show the `specweave docs preview` instructions (see section 4 below)
37
82
 
38
- echo ""
39
- echo "=== ADRs ==="
40
- ls .specweave/docs/internal/architecture/adr/ 2>/dev/null || echo "(none)"
41
- ```
83
+ This ensures every `/sw:docs` invocation gives the user a clear path to browse docs in their browser.
84
+
85
+ ### 2. `--list`: List topics only
42
86
 
43
- Present as a clean table with folder names and brief descriptions.
87
+ Same as dashboard but skip server/Docusaurus diagnostics. Just list folder names with descriptions.
44
88
 
45
- ### 2. Topic argument: Load relevant docs
89
+ ### 3. Topic argument: Search and load docs
46
90
 
47
91
  When user provides a topic (e.g., `/sw:docs sync`, `/sw:docs troubleshooting`):
48
92
 
49
- 1. **Search** for matching docs:
93
+ 1. **Search** across all configured directories:
50
94
  ```bash
51
- # Find matching directories
52
- find .specweave/docs -type d -iname "*<topic>*" -maxdepth 4
53
-
54
- # Find matching files
55
- find .specweave/docs -type f -iname "*<topic>*.md" -maxdepth 5
95
+ DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
96
+ [ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"
97
+ for dir in $DOC_DIRS; do
98
+ find "$dir" -type d -iname "*<topic>*" -maxdepth 4 2>/dev/null
99
+ find "$dir" -type f -iname "*<topic>*.md" -maxdepth 5 2>/dev/null
100
+ done
56
101
  ```
57
102
 
58
103
  2. **If found**: Read the most relevant files (up to 3-5) and present a summary
59
104
  3. **If not found**: Search file contents with Grep for the topic keyword, then present matches
60
105
 
61
- ### 3. Flags
106
+ ### 4. `--serve` or serve intent: Browser preview guide
107
+
108
+ Detect serve intent from: `--serve`, `--preview`, or phrases like "serve", "preview", "browser", "open docs", "start server".
109
+
110
+ 1. Check if server is already running:
111
+ ```bash
112
+ lsof -i :3000-3010 -sTCP:LISTEN 2>/dev/null | grep -i node
113
+ ```
114
+
115
+ 2. **If running**: "Docs server already running at http://localhost:<port>"
116
+ 3. **If not running**: Display:
117
+ ```
118
+ To view docs in browser with hot reload, run in your terminal:
119
+
120
+ specweave docs preview
121
+
122
+ First run auto-installs Docusaurus (~30-60 seconds).
123
+ Subsequent runs start instantly.
124
+
125
+ Options:
126
+ specweave docs preview --port 3005 Use specific port
127
+ specweave docs preview --no-browser Don't auto-open browser
128
+
129
+ To stop: Ctrl+C in terminal, or: specweave docs kill
130
+ ```
131
+
132
+ ### 5. `--status`: Full status report
133
+
134
+ Run and display output of:
135
+ ```bash
136
+ specweave docs status
137
+ ```
138
+
139
+ ### 6. Flags
62
140
 
63
141
  | Flag | Behavior |
64
142
  |------|----------|
65
143
  | `--public` | Only search public docs |
66
144
  | `--internal` | Only search internal docs |
67
145
  | `--adr` | List and load ADRs specifically |
68
- | `--list` | Just list available topics, don't load content |
146
+ | `--list` | List topics without diagnostics |
147
+ | `--serve` | Browser preview guide |
148
+ | `--status` | Run `specweave docs status` |
69
149
 
70
- ### 4. ADR Mode (`--adr` or "ADR" in topic)
150
+ ### 7. ADR Mode (`--adr` or "ADR" in topic)
71
151
 
72
- List all ADRs with their titles:
152
+ List all ADRs with their titles across all directories:
73
153
  ```bash
74
- for f in .specweave/docs/internal/architecture/adr/*.md; do
75
- echo "$(basename "$f"): $(head -1 "$f" | sed 's/^# //')"
154
+ DOC_DIRS=$(jq -r '(.documentation.directories // [".specweave/docs"])[]' .specweave/config.json 2>/dev/null)
155
+ [ -z "$DOC_DIRS" ] && DOC_DIRS=".specweave/docs"
156
+ for dir in $DOC_DIRS; do
157
+ for f in "$dir"/internal/architecture/adr/*.md; do
158
+ [ -f "$f" ] && echo "$(basename "$f"): $(head -1 "$f" | sed 's/^# //')"
159
+ done
76
160
  done
77
161
  ```
78
162
 
79
163
  If a specific ADR number is given, read and present it.
80
164
 
81
- ## Output Format
165
+ ## Output Footer
166
+
167
+ Always append to any output:
82
168
 
83
- When listing topics:
84
169
  ```
85
- Living Docs
86
-
87
- Public:
88
- guides/ - Getting started, core concepts, mobile
89
- workflows/ - Development workflows
90
- troubleshooting/ - Common issues and fixes
91
- api/ - API documentation
92
- integrations/ - External tool integration guides
93
-
94
- Internal:
95
- specs/ - Feature specifications
96
- architecture/ - ADRs, HLD, diagrams, concepts
97
- operations/ - Operational runbooks
98
- repos/ - Repository module documentation
99
-
100
- Use: /sw:docs <topic> to load specific docs
170
+ Tip: Run `specweave docs preview` in your terminal to view all docs in browser with hot reload.
101
171
  ```
102
-
103
- When loading docs, present content with clear headers and file paths for reference.