specweave 0.17.6 → 0.17.8
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/CLAUDE.md +365 -9
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +9 -4
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +82 -12
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts +2 -2
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +69 -10
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
- package/dist/src/cli/commands/detect-project.d.ts +9 -0
- package/dist/src/cli/commands/detect-project.d.ts.map +1 -0
- package/dist/src/cli/commands/detect-project.js +85 -0
- package/dist/src/cli/commands/detect-project.js.map +1 -0
- package/dist/src/cli/commands/detect-specs.d.ts +9 -0
- package/dist/src/cli/commands/detect-specs.d.ts.map +1 -0
- package/dist/src/cli/commands/detect-specs.js +73 -0
- package/dist/src/cli/commands/detect-specs.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +8 -15
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/core/living-docs/content-classifier.d.ts +83 -0
- package/dist/src/core/living-docs/content-classifier.d.ts.map +1 -0
- package/dist/src/core/living-docs/content-classifier.js +393 -0
- package/dist/src/core/living-docs/content-classifier.js.map +1 -0
- package/dist/src/core/living-docs/content-distributor.d.ts +126 -0
- package/dist/src/core/living-docs/content-distributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/content-distributor.js +339 -0
- package/dist/src/core/living-docs/content-distributor.js.map +1 -0
- package/dist/src/core/living-docs/content-parser.d.ts +140 -0
- package/dist/src/core/living-docs/content-parser.d.ts.map +1 -0
- package/dist/src/core/living-docs/content-parser.js +316 -0
- package/dist/src/core/living-docs/content-parser.js.map +1 -0
- package/dist/src/core/living-docs/cross-linker.d.ts +126 -0
- package/dist/src/core/living-docs/cross-linker.d.ts.map +1 -0
- package/dist/src/core/living-docs/cross-linker.js +374 -0
- package/dist/src/core/living-docs/cross-linker.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +89 -0
- package/dist/src/core/living-docs/index.d.ts.map +1 -0
- package/dist/src/core/living-docs/index.js +169 -0
- package/dist/src/core/living-docs/index.js.map +1 -0
- package/dist/src/core/living-docs/project-detector.d.ts +103 -0
- package/dist/src/core/living-docs/project-detector.d.ts.map +1 -0
- package/dist/src/core/living-docs/project-detector.js +314 -0
- package/dist/src/core/living-docs/project-detector.js.map +1 -0
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.js +51 -22
- package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts +2 -0
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +126 -62
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/spec-content-sync.d.ts +6 -0
- package/dist/src/core/spec-content-sync.d.ts.map +1 -1
- package/dist/src/core/spec-content-sync.js +25 -7
- package/dist/src/core/spec-content-sync.js.map +1 -1
- package/dist/src/core/spec-detector.d.ts +54 -0
- package/dist/src/core/spec-detector.d.ts.map +1 -0
- package/dist/src/core/spec-detector.js +197 -0
- package/dist/src/core/spec-detector.js.map +1 -0
- package/dist/src/core/spec-identifier-detector.d.ts +49 -0
- package/dist/src/core/spec-identifier-detector.d.ts.map +1 -0
- package/dist/src/core/spec-identifier-detector.js +198 -0
- package/dist/src/core/spec-identifier-detector.js.map +1 -0
- package/dist/src/core/types/spec-identifier.d.ts +67 -0
- package/dist/src/core/types/spec-identifier.d.ts.map +1 -0
- package/dist/src/core/types/spec-identifier.js +23 -0
- package/dist/src/core/types/spec-identifier.js.map +1 -0
- package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.js +11 -0
- package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
- package/package.json +2 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/lib/hooks/sync-living-docs.js +61 -5
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +102 -13
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-docs-preview/commands/preview.md +11 -11
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/hooks/post-task-completion.sh +59 -30
- package/plugins/specweave-github/lib/github-spec-content-sync.js +55 -6
- package/plugins/specweave-github/lib/github-spec-content-sync.ts +84 -12
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -4
- package/plugins/specweave-release/.claude-plugin/plugin.json +3 -15
- package/src/templates/AGENTS.md.template +297 -0
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +0 -108
- package/dist/locales/en/cli.json +0 -287
- package/dist/locales/en/errors.json +0 -7
- package/dist/locales/en/templates.json +0 -6
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +0 -41
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +0 -108
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +0 -108
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +0 -108
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +0 -108
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +0 -269
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +0 -108
- package/plugins/specweave/plugin.json +0 -22
- package/plugins/specweave-ado/plugin.json +0 -20
- package/plugins/specweave-github/plugin.json +0 -19
- package/plugins/specweave-jira/plugin.json +0 -20
|
@@ -25,12 +25,54 @@ import fs from 'fs/promises';
|
|
|
25
25
|
|
|
26
26
|
export interface GitHubContentSyncOptions {
|
|
27
27
|
specPath: string;
|
|
28
|
-
owner
|
|
29
|
-
repo
|
|
28
|
+
owner?: string; // Optional: will be auto-detected from project config
|
|
29
|
+
repo?: string; // Optional: will be auto-detected from project config
|
|
30
30
|
dryRun?: boolean;
|
|
31
31
|
verbose?: boolean;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Get GitHub owner/repo from project config
|
|
36
|
+
*/
|
|
37
|
+
async function getGitHubRepoForProject(
|
|
38
|
+
project: string,
|
|
39
|
+
specPath: string
|
|
40
|
+
): Promise<{ owner: string; repo: string } | null> {
|
|
41
|
+
try {
|
|
42
|
+
// Find project root
|
|
43
|
+
let currentDir = path.dirname(specPath);
|
|
44
|
+
let configPath = path.join(currentDir, '.specweave', 'config.json');
|
|
45
|
+
|
|
46
|
+
// Search upward for .specweave/config.json
|
|
47
|
+
while (!await fs.access(configPath).then(() => true).catch(() => false)) {
|
|
48
|
+
const parentDir = path.dirname(currentDir);
|
|
49
|
+
if (parentDir === currentDir) {
|
|
50
|
+
return null; // Reached root
|
|
51
|
+
}
|
|
52
|
+
currentDir = parentDir;
|
|
53
|
+
configPath = path.join(currentDir, '.specweave', 'config.json');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Read config
|
|
57
|
+
const configContent = await fs.readFile(configPath, 'utf-8');
|
|
58
|
+
const config = JSON.parse(configContent);
|
|
59
|
+
|
|
60
|
+
// Get project config
|
|
61
|
+
const projectConfig = config.specs?.projects?.[project];
|
|
62
|
+
|
|
63
|
+
if (!projectConfig?.github) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
owner: projectConfig.github.owner,
|
|
69
|
+
repo: projectConfig.github.repo
|
|
70
|
+
};
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
34
76
|
/**
|
|
35
77
|
* Sync spec content to GitHub issue
|
|
36
78
|
* Creates issue if it doesn't exist, updates if it does
|
|
@@ -38,7 +80,7 @@ export interface GitHubContentSyncOptions {
|
|
|
38
80
|
export async function syncSpecContentToGitHub(
|
|
39
81
|
options: GitHubContentSyncOptions
|
|
40
82
|
): Promise<ContentSyncResult> {
|
|
41
|
-
|
|
83
|
+
let { specPath, owner, repo, dryRun = false, verbose = false } = options;
|
|
42
84
|
|
|
43
85
|
try {
|
|
44
86
|
// 1. Parse spec content
|
|
@@ -52,12 +94,33 @@ export async function syncSpecContentToGitHub(
|
|
|
52
94
|
}
|
|
53
95
|
|
|
54
96
|
if (verbose) {
|
|
55
|
-
console.log(`📄 Parsed spec: ${spec.
|
|
97
|
+
console.log(`📄 Parsed spec: ${spec.identifier.compact}`);
|
|
98
|
+
console.log(` Project: ${spec.project}`);
|
|
56
99
|
console.log(` Title: ${spec.title}`);
|
|
57
100
|
console.log(` User Stories: ${spec.userStories.length}`);
|
|
58
101
|
}
|
|
59
102
|
|
|
60
|
-
// 2.
|
|
103
|
+
// 2. Auto-detect owner/repo from project config if not provided
|
|
104
|
+
if (!owner || !repo) {
|
|
105
|
+
const repoConfig = await getGitHubRepoForProject(spec.project, specPath);
|
|
106
|
+
|
|
107
|
+
if (!repoConfig) {
|
|
108
|
+
return {
|
|
109
|
+
success: false,
|
|
110
|
+
action: 'error',
|
|
111
|
+
error: `No GitHub repository configured for project "${spec.project}". Add specs.projects.${spec.project}.github in config.json`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
owner = repoConfig.owner;
|
|
116
|
+
repo = repoConfig.repo;
|
|
117
|
+
|
|
118
|
+
if (verbose) {
|
|
119
|
+
console.log(` Auto-detected repo: ${owner}/${repo}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 3. Check if issue already exists
|
|
61
124
|
const existingIssueNumber = await hasExternalLink(specPath, 'github');
|
|
62
125
|
|
|
63
126
|
const client = GitHubClientV2.fromRepo(owner, repo);
|
|
@@ -89,8 +152,9 @@ async function createGitHubIssue(
|
|
|
89
152
|
const { specPath, dryRun, verbose } = options;
|
|
90
153
|
|
|
91
154
|
try {
|
|
92
|
-
// Build issue title and body
|
|
93
|
-
|
|
155
|
+
// Build issue title and body using compact format
|
|
156
|
+
// Examples: [BE-JIRA-AUTH-123] User Authentication, [FE-user-login-ui] Login UI
|
|
157
|
+
const title = `[${spec.identifier.compact}] ${spec.title}`;
|
|
94
158
|
const body = buildExternalDescription(spec);
|
|
95
159
|
|
|
96
160
|
if (verbose) {
|
|
@@ -112,8 +176,13 @@ async function createGitHubIssue(
|
|
|
112
176
|
};
|
|
113
177
|
}
|
|
114
178
|
|
|
115
|
-
// Create issue
|
|
116
|
-
const labels = [
|
|
179
|
+
// Create issue with project-specific labels
|
|
180
|
+
const labels = [
|
|
181
|
+
'specweave',
|
|
182
|
+
'spec',
|
|
183
|
+
spec.project, // backend, frontend, mobile, etc.
|
|
184
|
+
spec.metadata.priority || 'P2'
|
|
185
|
+
].filter(Boolean);
|
|
117
186
|
const issue = await client.createEpicIssue(title, body, undefined, labels);
|
|
118
187
|
|
|
119
188
|
if (verbose) {
|
|
@@ -164,8 +233,11 @@ async function updateGitHubIssue(
|
|
|
164
233
|
}
|
|
165
234
|
|
|
166
235
|
// Detect changes
|
|
236
|
+
// Strip any ID prefix from title (flexible format: [BE-JIRA-123], [FE-login-ui], etc.)
|
|
237
|
+
const cleanTitle = issue.title.replace(/^\[[A-Z]{2,4}-[A-Z0-9-]+\]\s*/, '');
|
|
238
|
+
|
|
167
239
|
const changes = detectContentChanges(spec, {
|
|
168
|
-
title:
|
|
240
|
+
title: cleanTitle,
|
|
169
241
|
description: issue.body || '',
|
|
170
242
|
userStoryCount: countUserStoriesInBody(issue.body || ''),
|
|
171
243
|
});
|
|
@@ -190,8 +262,8 @@ async function updateGitHubIssue(
|
|
|
190
262
|
}
|
|
191
263
|
}
|
|
192
264
|
|
|
193
|
-
// Build updated content
|
|
194
|
-
const newTitle = `[${spec.
|
|
265
|
+
// Build updated content using compact format
|
|
266
|
+
const newTitle = `[${spec.identifier.compact}] ${spec.title}`;
|
|
195
267
|
const newBody = buildExternalDescription(spec);
|
|
196
268
|
|
|
197
269
|
if (dryRun) {
|
|
@@ -24,19 +24,7 @@
|
|
|
24
24
|
"independent-release",
|
|
25
25
|
"brownfield-release"
|
|
26
26
|
],
|
|
27
|
-
"repository":
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"directory": "plugins/specweave-release"
|
|
31
|
-
},
|
|
32
|
-
"engines": {
|
|
33
|
-
"node": ">=18.0.0"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"specweave": ">=0.14.0"
|
|
37
|
-
},
|
|
38
|
-
"skills": "skills",
|
|
39
|
-
"agents": "agents",
|
|
40
|
-
"commands": "commands",
|
|
41
|
-
"hooks": "hooks/hooks.json"
|
|
27
|
+
"repository": "https://github.com/anton-abyzov/specweave",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"hooks": "./hooks/hooks.json"
|
|
42
30
|
}
|
|
@@ -985,6 +985,303 @@ cat plugins/specweave-github/commands/github-sync.md
|
|
|
985
985
|
|
|
986
986
|
---
|
|
987
987
|
|
|
988
|
+
## 📖 Documentation Preview with Docusaurus (Port 3016)
|
|
989
|
+
|
|
990
|
+
**IMPORTANT**: SpecWeave supports beautiful documentation preview using Docusaurus. This is NOT just for Claude Code - it works for ALL tools!
|
|
991
|
+
|
|
992
|
+
### Overview
|
|
993
|
+
|
|
994
|
+
The `/specweave-docs-preview:preview` command launches an interactive Docusaurus development server to preview your living documentation at **http://localhost:3016** (NOT port 3000!).
|
|
995
|
+
|
|
996
|
+
**Why Port 3016?**
|
|
997
|
+
- Port 3000 is commonly used by other development servers (React, Next.js, etc.)
|
|
998
|
+
- Port 3016 avoids conflicts with client projects
|
|
999
|
+
- This is the default for ALL SpecWeave documentation preview
|
|
1000
|
+
|
|
1001
|
+
### Quick Start
|
|
1002
|
+
|
|
1003
|
+
**For Claude Code** (slash command):
|
|
1004
|
+
```bash
|
|
1005
|
+
/specweave-docs-preview:preview
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
**For Other Tools** (manual execution):
|
|
1009
|
+
```bash
|
|
1010
|
+
# 1. Read the command file
|
|
1011
|
+
cat plugins/specweave-docs-preview/commands/preview.md
|
|
1012
|
+
|
|
1013
|
+
# 2. Execute the workflow manually (follow the instructions in preview.md)
|
|
1014
|
+
# The command will:
|
|
1015
|
+
# - Install Docusaurus (~30 seconds first time)
|
|
1016
|
+
# - Generate configuration
|
|
1017
|
+
# - Create sidebar from folder structure
|
|
1018
|
+
# - Start server on http://localhost:3016
|
|
1019
|
+
# - Open browser automatically
|
|
1020
|
+
|
|
1021
|
+
# 3. Access the documentation
|
|
1022
|
+
# Open browser to: http://localhost:3016
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
### Common MDX Compilation Errors (MUST READ!)
|
|
1026
|
+
|
|
1027
|
+
**Problem**: Docusaurus uses MDX (Markdown + JSX) which has stricter parsing rules than regular Markdown. Files with certain patterns may cause compilation errors like:
|
|
1028
|
+
|
|
1029
|
+
```
|
|
1030
|
+
Error: MDX compilation failed for file ".../adr-001-signalr-vs-websockets.md"
|
|
1031
|
+
Cause: Unexpected character `1` (U+0031) before name
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
**Solutions** (in order of preference):
|
|
1035
|
+
|
|
1036
|
+
#### Solution 1: Use Frontmatter for Problematic Files
|
|
1037
|
+
|
|
1038
|
+
Add YAML frontmatter to files with numeric prefixes or special characters:
|
|
1039
|
+
|
|
1040
|
+
```markdown
|
|
1041
|
+
---
|
|
1042
|
+
id: adr-001-signalr-vs-websockets
|
|
1043
|
+
title: ADR 001: SignalR vs WebSockets
|
|
1044
|
+
sidebar_label: SignalR vs WebSockets
|
|
1045
|
+
---
|
|
1046
|
+
|
|
1047
|
+
# ADR 001: SignalR vs WebSockets
|
|
1048
|
+
|
|
1049
|
+
[Rest of content...]
|
|
1050
|
+
```
|
|
1051
|
+
|
|
1052
|
+
#### Solution 2: Exclude Problematic Files
|
|
1053
|
+
|
|
1054
|
+
If certain files can't be fixed, exclude them from the build:
|
|
1055
|
+
|
|
1056
|
+
**Edit `.specweave/config.json`:**
|
|
1057
|
+
```json
|
|
1058
|
+
{
|
|
1059
|
+
"documentation": {
|
|
1060
|
+
"preview": {
|
|
1061
|
+
"enabled": true,
|
|
1062
|
+
"port": 3016,
|
|
1063
|
+
"excludeFolders": ["legacy", "node_modules", "problematic-folder"]
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
#### Solution 3: Use MDX1 Compatibility Mode
|
|
1070
|
+
|
|
1071
|
+
The config generator already adds MDX1 compatibility mode to handle most common issues:
|
|
1072
|
+
|
|
1073
|
+
```javascript
|
|
1074
|
+
// This is already in the generated docusaurus.config.js
|
|
1075
|
+
markdown: {
|
|
1076
|
+
mermaid: true,
|
|
1077
|
+
format: 'mdx',
|
|
1078
|
+
mdx1Compat: {
|
|
1079
|
+
comments: true,
|
|
1080
|
+
admonitions: true,
|
|
1081
|
+
headingIds: true,
|
|
1082
|
+
},
|
|
1083
|
+
}
|
|
1084
|
+
```
|
|
1085
|
+
|
|
1086
|
+
#### Solution 4: Fix Special Characters in Content
|
|
1087
|
+
|
|
1088
|
+
MDX interprets `<`, `>`, `{`, `}` as JSX. Escape them in your markdown:
|
|
1089
|
+
|
|
1090
|
+
**Bad** (causes MDX errors):
|
|
1091
|
+
```markdown
|
|
1092
|
+
Use <Component> to render the UI
|
|
1093
|
+
Configure {apiKey} in the settings
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
**Good** (works):
|
|
1097
|
+
```markdown
|
|
1098
|
+
Use `<Component>` to render the UI
|
|
1099
|
+
Configure `{apiKey}` in the settings
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
Or use code blocks:
|
|
1103
|
+
```markdown
|
|
1104
|
+
```
|
|
1105
|
+
Use <Component> to render the UI
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
### Configuration Reference
|
|
1109
|
+
|
|
1110
|
+
**Default Configuration** (`.specweave/config.json`):
|
|
1111
|
+
```json
|
|
1112
|
+
{
|
|
1113
|
+
"documentation": {
|
|
1114
|
+
"preview": {
|
|
1115
|
+
"enabled": true,
|
|
1116
|
+
"autoInstall": true,
|
|
1117
|
+
"port": 3016,
|
|
1118
|
+
"openBrowser": true,
|
|
1119
|
+
"theme": "default",
|
|
1120
|
+
"excludeFolders": ["legacy", "node_modules"]
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
```
|
|
1125
|
+
|
|
1126
|
+
**Configuration Options**:
|
|
1127
|
+
- `enabled`: Enable/disable docs preview (default: true)
|
|
1128
|
+
- `autoInstall`: Auto-install Docusaurus on first run (default: true)
|
|
1129
|
+
- `port`: Port for dev server (default: 3016, NEVER use 3000!)
|
|
1130
|
+
- `openBrowser`: Auto-open browser (default: true)
|
|
1131
|
+
- `theme`: Theme variant ("default", "classic", "dark")
|
|
1132
|
+
- `excludeFolders`: Folders to exclude from build (array)
|
|
1133
|
+
|
|
1134
|
+
### Features
|
|
1135
|
+
|
|
1136
|
+
**What You Get**:
|
|
1137
|
+
- ✅ Auto-generated navigation from folder structure
|
|
1138
|
+
- ✅ Search functionality (instant local search)
|
|
1139
|
+
- ✅ Beautiful theming (light/dark mode)
|
|
1140
|
+
- ✅ Mermaid diagram rendering
|
|
1141
|
+
- ✅ Hot reload (edit markdown, see changes instantly)
|
|
1142
|
+
- ✅ Professional typography and layout
|
|
1143
|
+
- ✅ Mobile responsive design
|
|
1144
|
+
|
|
1145
|
+
**Hot Reload**:
|
|
1146
|
+
- Edit any file in `.specweave/docs/internal/`
|
|
1147
|
+
- Save the file
|
|
1148
|
+
- Browser refreshes automatically
|
|
1149
|
+
- No need to restart server!
|
|
1150
|
+
|
|
1151
|
+
### Troubleshooting
|
|
1152
|
+
|
|
1153
|
+
**Port Already in Use:**
|
|
1154
|
+
```bash
|
|
1155
|
+
# Error: Port 3016 is already in use
|
|
1156
|
+
# Solution 1: Change port in config
|
|
1157
|
+
vim .specweave/config.json
|
|
1158
|
+
# Change "port": 3016 to "port": 3017
|
|
1159
|
+
|
|
1160
|
+
# Solution 2: Stop the service
|
|
1161
|
+
lsof -i :3016 # Find PID
|
|
1162
|
+
kill -9 <PID> # Kill the process
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
**Build Fails with MDX Errors:**
|
|
1166
|
+
```bash
|
|
1167
|
+
# Check which files are causing errors
|
|
1168
|
+
# Look for files with:
|
|
1169
|
+
# - Numeric prefixes (adr-001-, spec-123-)
|
|
1170
|
+
# - Special characters in content (<, >, {, })
|
|
1171
|
+
# - JSX-like syntax
|
|
1172
|
+
|
|
1173
|
+
# Fix using Solution 1-4 above (add frontmatter, exclude files, etc.)
|
|
1174
|
+
```
|
|
1175
|
+
|
|
1176
|
+
**Node.js Version:**
|
|
1177
|
+
```bash
|
|
1178
|
+
# Error: Node.js 18+ required
|
|
1179
|
+
# Solution: Update Node.js
|
|
1180
|
+
nvm install 20 # Using nvm
|
|
1181
|
+
# Or download from nodejs.org
|
|
1182
|
+
node --version # Verify
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
### Best Practices
|
|
1186
|
+
|
|
1187
|
+
**1. Always Use Port 3016** (NOT 3000):
|
|
1188
|
+
```json
|
|
1189
|
+
// ✅ CORRECT
|
|
1190
|
+
{"documentation": {"preview": {"port": 3016}}}
|
|
1191
|
+
|
|
1192
|
+
// ❌ WRONG
|
|
1193
|
+
{"documentation": {"preview": {"port": 3000}}}
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
**2. Add Frontmatter to ADRs/Specs:**
|
|
1197
|
+
```markdown
|
|
1198
|
+
---
|
|
1199
|
+
id: unique-identifier
|
|
1200
|
+
title: Human-Readable Title
|
|
1201
|
+
sidebar_label: Short Label
|
|
1202
|
+
---
|
|
1203
|
+
|
|
1204
|
+
# Your content here
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
**3. Escape Special Characters:**
|
|
1208
|
+
```markdown
|
|
1209
|
+
Use backticks: `<Component>`, `{variable}`
|
|
1210
|
+
Or code blocks for multiline
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
**4. Test Before Committing:**
|
|
1214
|
+
```bash
|
|
1215
|
+
# Start preview locally
|
|
1216
|
+
/specweave-docs-preview:preview
|
|
1217
|
+
|
|
1218
|
+
# Check for errors in console
|
|
1219
|
+
# Fix any MDX compilation errors
|
|
1220
|
+
# Then commit
|
|
1221
|
+
```
|
|
1222
|
+
|
|
1223
|
+
### Integration with SpecWeave Workflow
|
|
1224
|
+
|
|
1225
|
+
**After Creating Increment:**
|
|
1226
|
+
```bash
|
|
1227
|
+
/specweave:increment "User Authentication"
|
|
1228
|
+
# → Creates spec.md, plan.md, tasks.md
|
|
1229
|
+
|
|
1230
|
+
/specweave-docs-preview:preview
|
|
1231
|
+
# → Preview shows new spec in sidebar
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
**After Completing Increment:**
|
|
1235
|
+
```bash
|
|
1236
|
+
/specweave:done 0008
|
|
1237
|
+
# → Syncs spec.md to .specweave/docs/internal/specs/
|
|
1238
|
+
|
|
1239
|
+
# Hot reload automatically shows the new spec!
|
|
1240
|
+
# No need to restart preview server
|
|
1241
|
+
```
|
|
1242
|
+
|
|
1243
|
+
### For Non-Claude Tools: Manual Execution
|
|
1244
|
+
|
|
1245
|
+
**Step-by-Step Workflow:**
|
|
1246
|
+
|
|
1247
|
+
```bash
|
|
1248
|
+
# 1. Load the command
|
|
1249
|
+
cat plugins/specweave-docs-preview/commands/preview.md
|
|
1250
|
+
|
|
1251
|
+
# 2. Create or verify config
|
|
1252
|
+
vim .specweave/config.json
|
|
1253
|
+
# Ensure "documentation.preview.enabled" is true
|
|
1254
|
+
# Ensure "documentation.preview.port" is 3016
|
|
1255
|
+
|
|
1256
|
+
# 3. Run the preview (follow instructions from preview.md)
|
|
1257
|
+
# The command will guide you through:
|
|
1258
|
+
# - Installing Docusaurus (first time only)
|
|
1259
|
+
# - Generating config and sidebar
|
|
1260
|
+
# - Starting server on port 3016
|
|
1261
|
+
# - Opening browser
|
|
1262
|
+
|
|
1263
|
+
# 4. Access documentation
|
|
1264
|
+
# Open: http://localhost:3016
|
|
1265
|
+
|
|
1266
|
+
# 5. Edit docs and see changes live
|
|
1267
|
+
# Edit any file in .specweave/docs/internal/
|
|
1268
|
+
# Browser refreshes automatically!
|
|
1269
|
+
|
|
1270
|
+
# 6. Stop server when done
|
|
1271
|
+
# Press Ctrl+C in terminal
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
### Summary
|
|
1275
|
+
|
|
1276
|
+
- 🌐 **Default Port**: 3016 (NOT 3000!)
|
|
1277
|
+
- 📁 **Source**: `.specweave/docs/internal/`
|
|
1278
|
+
- 🔧 **Config**: `.specweave/config.json`
|
|
1279
|
+
- 🔄 **Hot Reload**: Automatic
|
|
1280
|
+
- ⚠️ **MDX Errors**: Add frontmatter or escape special chars
|
|
1281
|
+
- ✅ **Works for ALL tools** (Claude Code, Cursor, Copilot, etc.)
|
|
1282
|
+
|
|
1283
|
+
---
|
|
1284
|
+
|
|
988
1285
|
## Build & Test Commands
|
|
989
1286
|
|
|
990
1287
|
```bash
|
package/dist/locales/de/.gitkeep
DELETED
|
File without changes
|
package/dist/locales/de/cli.json
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"init": {
|
|
3
|
-
"welcome": "🚀 SpecWeave Initialization",
|
|
4
|
-
"projectName": "Project name:",
|
|
5
|
-
"projectNamePrompt": "Project name (for templates):",
|
|
6
|
-
"projectNameDefault": "my-saas",
|
|
7
|
-
"detectingTool": "Detecting AI tool...",
|
|
8
|
-
"foundClaude": "✅ Found Claude Code",
|
|
9
|
-
"foundCursor": "✅ Found Cursor",
|
|
10
|
-
"foundCopilot": "✅ Found GitHub Copilot",
|
|
11
|
-
"noToolDetected": "No AI tool detected, using Generic adapter",
|
|
12
|
-
"complete": "✨ Initialization complete!",
|
|
13
|
-
"claudeNativeComplete": "✨ Claude Code native installation complete!",
|
|
14
|
-
"claudeNativeBenefits": "✅ Native skills, agents, hooks work out of the box",
|
|
15
|
-
"projectSuccess": "SpecWeave project created successfully!",
|
|
16
|
-
"readyToBuild": "🚀 Ready to build with SpecWeave!",
|
|
17
|
-
"errors": {
|
|
18
|
-
"invalidName": "Project name must contain only lowercase letters, numbers, and hyphens",
|
|
19
|
-
"alreadyExists": ".specweave directory already exists",
|
|
20
|
-
"cancelled": "❌ Initialization cancelled",
|
|
21
|
-
"invalidLanguage": "❌ Invalid language: {{language}}",
|
|
22
|
-
"supportedLanguages": "Supported languages: {{languages}}",
|
|
23
|
-
"nestedNotSupported": "❌ Nested .specweave/ folders are NOT supported!",
|
|
24
|
-
"parentFound": "Found parent .specweave/ at:",
|
|
25
|
-
"projectCreationFailed": "Failed to create project",
|
|
26
|
-
"commandsCopyFailed": "❌ Commands copy failed: {{error}}",
|
|
27
|
-
"agentsCopyFailed": "❌ Agents copy failed: {{error}}",
|
|
28
|
-
"skillsCopyFailed": "❌ Skills copy failed: {{error}}",
|
|
29
|
-
"hooksCopyFailed": "❌ Hooks copy failed: {{error}}"
|
|
30
|
-
},
|
|
31
|
-
"warnings": {
|
|
32
|
-
"invalidDirName": "⚠️ Current directory name '{{dirName}}' contains invalid characters.",
|
|
33
|
-
"directoryNotEmpty": "⚠️ Current directory contains {{count}} file{{plural}}.",
|
|
34
|
-
"skillsIndexWarning": "⚠️ Warning: Could not generate skills index: {{error}}",
|
|
35
|
-
"skillsIndexNote": "Skills will still work, but manual indexing may be needed."
|
|
36
|
-
},
|
|
37
|
-
"prompts": {
|
|
38
|
-
"confirmInitInCurrent": "Initialize SpecWeave in current directory?",
|
|
39
|
-
"overwriteSpecweave": ".specweave directory already exists. Overwrite?",
|
|
40
|
-
"overwriteDirectory": "Directory {{projectName}} already exists. Overwrite?",
|
|
41
|
-
"enablePlugins": "Enable suggested plugins now?"
|
|
42
|
-
},
|
|
43
|
-
"info": {
|
|
44
|
-
"nestedEnforcement": "SpecWeave enforces a single source of truth:",
|
|
45
|
-
"nestedBullet1": "• Use the parent folder for all increments",
|
|
46
|
-
"nestedBullet2": "• Increments can span multiple subdirectories",
|
|
47
|
-
"nestedBullet3": "• See CLAUDE.md section \"Root-Level .specweave/ Folder\"",
|
|
48
|
-
"nestedToFix": "To fix:",
|
|
49
|
-
"suggestedPlugins": "💡 Suggested Plugins:",
|
|
50
|
-
"copiedFiles": "✓ Copied {{count}} command files",
|
|
51
|
-
"copiedAgents": "✓ Copied {{count}} agent directories",
|
|
52
|
-
"copiedSkills": "✓ Copied {{count}} skill directories",
|
|
53
|
-
"copiedHooks": "✓ Copied {{count}} hook files"
|
|
54
|
-
},
|
|
55
|
-
"progress": {
|
|
56
|
-
"creatingProject": "Creating SpecWeave project...",
|
|
57
|
-
"detected": "Detected {{tool}}...",
|
|
58
|
-
"usingTool": "Using {{tool}}...",
|
|
59
|
-
"directoryCreated": "Directory structure created...",
|
|
60
|
-
"templatesCopied": "Base templates copied...",
|
|
61
|
-
"installingComponents": "Installing Claude Code components...",
|
|
62
|
-
"commandsInstalled": "Slash commands installed...",
|
|
63
|
-
"agentsInstalled": "Agents installed...",
|
|
64
|
-
"skillsInstalled": "Skills installed...",
|
|
65
|
-
"hooksInstalled": "Hooks installed...",
|
|
66
|
-
"generatingIndex": "Generating skills index...",
|
|
67
|
-
"indexGenerated": "Skills index generated...",
|
|
68
|
-
"installingAdapter": "Installing {{tool}} adapter...",
|
|
69
|
-
"projectSuccess": "SpecWeave project created successfully!",
|
|
70
|
-
"detectingPlugins": "Detecting plugins...",
|
|
71
|
-
"detectedPlugins": "Detected {{count}} suggested plugins",
|
|
72
|
-
"enablingPlugins": "Enabling plugins...",
|
|
73
|
-
"enabledPlugin": "Enabled {{plugin}}",
|
|
74
|
-
"pluginsEnabled": "Plugins enabled"
|
|
75
|
-
},
|
|
76
|
-
"nextSteps": {
|
|
77
|
-
"header": "🎯 Next steps:",
|
|
78
|
-
"cd": "cd {{projectName}}",
|
|
79
|
-
"footer": "🚀 Ready to build with SpecWeave!",
|
|
80
|
-
"docsLink": "Documentation: https://spec-weave.com",
|
|
81
|
-
"githubLink": "GitHub: https://github.com/anton-abyzov/specweave"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"increment": {
|
|
85
|
-
"creating": "📝 Creating increment: {name}",
|
|
86
|
-
"created": "✅ Increment {id} created successfully!",
|
|
87
|
-
"nextStepDo": "Next: Run /specweave.do to start implementation",
|
|
88
|
-
"errors": {
|
|
89
|
-
"incompleteFound": "Cannot create new increment! Previous increments incomplete"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"progress": {
|
|
93
|
-
"currentIncrement": "Current Increment: {id}",
|
|
94
|
-
"status": "Status: {status}",
|
|
95
|
-
"completion": "Completion: {percent}%"
|
|
96
|
-
},
|
|
97
|
-
"translate": {
|
|
98
|
-
"translating": "🌐 Translating content to {language}...",
|
|
99
|
-
"complete": "✅ Translation complete!"
|
|
100
|
-
},
|
|
101
|
-
"version": {
|
|
102
|
-
"current": "SpecWeave version: {version}"
|
|
103
|
-
},
|
|
104
|
-
"errors": {
|
|
105
|
-
"fileNotFound": "❌ File not found: {path}",
|
|
106
|
-
"invalidConfig": "❌ Invalid configuration: {error}"
|
|
107
|
-
}
|
|
108
|
-
}
|