sdtk-spec-kit 0.4.4 → 0.4.6
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 +369 -376
- package/assets/atlas/build_atlas.py +880 -880
- package/assets/atlas/doc_atlas_viewer_template.html +3796 -3782
- package/assets/atlas/vendor/mermaid.min.js +2029 -2029
- package/assets/keys/spec-entitlement-public.pem +11 -11
- package/assets/manifest/toolkit-bundle.manifest.json +178 -178
- package/assets/manifest/toolkit-bundle.sha256.txt +83 -83
- package/assets/toolkit/toolkit/AGENTS.md +247 -245
- package/assets/toolkit/toolkit/README.md +50 -50
- package/assets/toolkit/toolkit/SDTK_TOOLKIT.md +207 -208
- package/assets/toolkit/toolkit/install.ps1 +21 -21
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +92 -92
- package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +70 -70
- package/assets/toolkit/toolkit/scripts/agents/run-claude-task.ps1 +332 -332
- package/assets/toolkit/toolkit/scripts/agents/run-codex-task.ps1 +618 -618
- package/assets/toolkit/toolkit/scripts/agents/validate-mailbox-formal-artifact.py +86 -86
- package/assets/toolkit/toolkit/scripts/init-feature.ps1 +262 -262
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +209 -209
- package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +139 -139
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +143 -143
- package/assets/toolkit/toolkit/sdtk-spec.config.json +27 -27
- package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +49 -49
- package/assets/toolkit/toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md +47 -47
- package/assets/toolkit/toolkit/session/SDTK_AGENT_WORKING_RULES.md +49 -49
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +111 -111
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +732 -732
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +79 -79
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +85 -85
- package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +46 -46
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +91 -91
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +246 -246
- package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +34 -34
- package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +60 -60
- package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +41 -41
- package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +80 -80
- package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +80 -80
- package/assets/toolkit/toolkit/skills/sdtk-mailbox-dispatch/SKILL.md +2 -2
- package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +17 -17
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +106 -106
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +50 -50
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +53 -53
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +28 -28
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -136
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +414 -414
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +110 -110
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -97
- package/assets/toolkit/toolkit/skills/skills.catalog.yaml +330 -330
- package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +116 -116
- package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +87 -87
- package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +59 -59
- package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +67 -67
- package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +91 -91
- package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +73 -73
- package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +73 -73
- package/assets/toolkit/toolkit/skills-claude/mailbox-dispatch/SKILL.md +2 -2
- package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +40 -40
- package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +88 -88
- package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +58 -58
- package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +112 -112
- package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +115 -115
- package/assets/toolkit/toolkit/templates/README.md +68 -68
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +21 -21
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +67 -67
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +468 -468
- package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +228 -228
- package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -20
- package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +20 -20
- package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +128 -128
- package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -12
- package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +107 -107
- package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +60 -60
- package/assets/toolkit/toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md +369 -369
- package/assets/toolkit/toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md +155 -155
- package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -50
- package/assets/toolkit/toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md +276 -276
- package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -66
- package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -98
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -129
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -104
- package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -139
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +197 -197
- package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +31 -31
- package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +28 -28
- package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +26 -26
- package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +20 -20
- package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +33 -33
- package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +29 -29
- package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +26 -26
- package/assets/toolkit/toolkit/templates/mailbox/AGENT_TASK_TEMPLATE.md +76 -76
- package/bin/sdtk.js +15 -15
- package/package.json +48 -48
- package/src/commands/activate.js +90 -90
- package/src/commands/analyze.js +11 -0
- package/src/commands/atlas.js +341 -352
- package/src/commands/auth.js +85 -85
- package/src/commands/entitlement.js +163 -163
- package/src/commands/generate.js +209 -147
- package/src/commands/help.js +41 -33
- package/src/commands/init.js +15 -15
- package/src/commands/project.js +51 -51
- package/src/commands/runtime.js +239 -239
- package/src/index.js +9 -6
- package/src/lib/activation-state.js +68 -68
- package/src/lib/args.js +116 -116
- package/src/lib/atlas-config.js +200 -200
- package/src/lib/atlas-runner.js +435 -355
- package/src/lib/browser-open.js +39 -39
- package/src/lib/capabilities.js +92 -92
- package/src/lib/design-handoff-provenance.js +189 -0
- package/src/lib/entitlements.js +238 -238
- package/src/lib/errors.js +41 -41
- package/src/lib/github-access.js +143 -143
- package/src/lib/legacy-auth-migration.js +55 -55
- package/src/lib/license-activation.js +375 -375
- package/src/lib/powershell.js +85 -85
- package/src/lib/premium-loader.js +126 -126
- package/src/lib/premium-packs.js +331 -331
- package/src/lib/premium-sync.js +235 -235
- package/src/lib/project-audit.js +332 -332
- package/src/lib/project-config.js +108 -108
- package/src/lib/project-ingest.js +450 -450
- package/src/lib/project-refresh.js +666 -666
- package/src/lib/requirement-analysis.js +472 -0
- package/src/lib/scope.js +83 -83
- package/src/lib/state.js +73 -73
- package/src/lib/suite-state.js +70 -70
- package/src/lib/toolkit-payload.js +99 -99
- package/src/lib/atlas-ask.js +0 -170
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const crypto = require("crypto");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const { ensureGeneratedScaffold } = require("../commands/generate");
|
|
7
|
+
const { parseFlags, requireFlag, validatePattern } = require("./args");
|
|
8
|
+
const { ValidationError } = require("./errors");
|
|
9
|
+
|
|
10
|
+
const FEATURE_KEY_REGEX = /^[A-Z][A-Z0-9_]*$/;
|
|
11
|
+
|
|
12
|
+
const FLAG_DEFS = {
|
|
13
|
+
source: { type: "string" },
|
|
14
|
+
"feature-key": { type: "string" },
|
|
15
|
+
"feature-name": { type: "string" },
|
|
16
|
+
"project-path": { type: "string" },
|
|
17
|
+
force: { type: "boolean" },
|
|
18
|
+
json: { type: "boolean" },
|
|
19
|
+
verbose: { type: "boolean" },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ANALYSIS_STATUS = "SOURCE_INTAKE_READY_FOR_AGENT_ANALYSIS";
|
|
23
|
+
const DESIGN_HANDOFF_ARTIFACTS = [
|
|
24
|
+
"docs/design/SCREEN_INVENTORY_<KEY>.md",
|
|
25
|
+
"docs/design/SCREEN_INVENTORY_<KEY>.json",
|
|
26
|
+
"docs/design/USER_FLOWS_<KEY>.md",
|
|
27
|
+
"docs/design/USER_FLOWS_<KEY>.json",
|
|
28
|
+
"docs/specs/DOMAIN_MODEL_<KEY>.md",
|
|
29
|
+
"docs/specs/DOMAIN_MODEL_<KEY>.json",
|
|
30
|
+
"docs/design/SPEC_TO_DESIGN_HANDOFF_<KEY>.json",
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const MOJIBAKE_MARKERS = [
|
|
34
|
+
"テ",
|
|
35
|
+
"ト",
|
|
36
|
+
"ニ",
|
|
37
|
+
"蘯",
|
|
38
|
+
"盻",
|
|
39
|
+
"黛",
|
|
40
|
+
"笏",
|
|
41
|
+
"竊",
|
|
42
|
+
"冢",
|
|
43
|
+
"\uFFFD",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
function sha256(buffer) {
|
|
47
|
+
return crypto.createHash("sha256").update(buffer).digest("hex");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function ensureDir(dirPath) {
|
|
51
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function writeFileSafe(filePath, content, force) {
|
|
55
|
+
if (fs.existsSync(filePath) && !force) {
|
|
56
|
+
throw new ValidationError(
|
|
57
|
+
`Refusing to overwrite existing file: ${filePath}. Re-run with --force if replacement is intended.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
ensureDir(path.dirname(filePath));
|
|
61
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function copyFileSafe(sourcePath, targetPath, force) {
|
|
65
|
+
if (fs.existsSync(targetPath) && !force) {
|
|
66
|
+
throw new ValidationError(
|
|
67
|
+
`Refusing to overwrite existing source copy: ${targetPath}. Re-run with --force if replacement is intended.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
ensureDir(path.dirname(targetPath));
|
|
71
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function normalizeNewlines(text) {
|
|
75
|
+
return text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function countMarker(text, marker) {
|
|
79
|
+
let count = 0;
|
|
80
|
+
let idx = text.indexOf(marker);
|
|
81
|
+
while (idx !== -1) {
|
|
82
|
+
count++;
|
|
83
|
+
idx = text.indexOf(marker, idx + marker.length);
|
|
84
|
+
}
|
|
85
|
+
return count;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function detectEncodingDiagnostics(text) {
|
|
89
|
+
const markerCounts = {};
|
|
90
|
+
let totalMarkers = 0;
|
|
91
|
+
for (const marker of MOJIBAKE_MARKERS) {
|
|
92
|
+
const count = countMarker(text, marker);
|
|
93
|
+
if (count > 0) {
|
|
94
|
+
markerCounts[marker] = count;
|
|
95
|
+
totalMarkers += count;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
readEncoding: "utf8",
|
|
100
|
+
likelyMojibake: totalMarkers >= 10,
|
|
101
|
+
mojibakeMarkerCount: totalMarkers,
|
|
102
|
+
mojibakeMarkers: markerCounts,
|
|
103
|
+
recommendation:
|
|
104
|
+
totalMarkers >= 10
|
|
105
|
+
? "Source text contains many mojibake markers. Preserve raw source, keep line traceability, and request a clean UTF-8 export when exact wording matters."
|
|
106
|
+
: "No high-volume mojibake marker pattern detected by the deterministic scanner.",
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function buildRequirementIntakeMarkdown(featureKey, featureName, sourceInfo, diagnostics, scaffold) {
|
|
111
|
+
const lines = [
|
|
112
|
+
`# Requirement Intake ${featureKey}`,
|
|
113
|
+
"",
|
|
114
|
+
"## Intake Status",
|
|
115
|
+
"",
|
|
116
|
+
`- Analysis status: ${ANALYSIS_STATUS}`,
|
|
117
|
+
`- Scaffold status: ${scaffold.status}`,
|
|
118
|
+
"- Runtime boundary: source intake only; semantic PM/BA/ARCH analysis is performed by agents in the scaffold artifacts.",
|
|
119
|
+
"",
|
|
120
|
+
"## Source",
|
|
121
|
+
"",
|
|
122
|
+
`- Feature: ${featureName}`,
|
|
123
|
+
`- Source path: ${sourceInfo.sourcePath}`,
|
|
124
|
+
`- Preserved copy: ${sourceInfo.preservedCopyRelativePath}`,
|
|
125
|
+
`- SHA-256: ${sourceInfo.sha256}`,
|
|
126
|
+
`- Preserved copy SHA-256: ${sourceInfo.preservedCopySha256}`,
|
|
127
|
+
`- Size bytes: ${sourceInfo.sizeBytes}`,
|
|
128
|
+
`- Line count: ${sourceInfo.lineCount}`,
|
|
129
|
+
"",
|
|
130
|
+
"## Encoding Diagnostics",
|
|
131
|
+
"",
|
|
132
|
+
`- Read encoding: ${diagnostics.readEncoding}`,
|
|
133
|
+
`- Likely mojibake: ${diagnostics.likelyMojibake}`,
|
|
134
|
+
`- Mojibake marker count: ${diagnostics.mojibakeMarkerCount}`,
|
|
135
|
+
`- Recommendation: ${diagnostics.recommendation}`,
|
|
136
|
+
"",
|
|
137
|
+
"## Generated Scaffold",
|
|
138
|
+
"",
|
|
139
|
+
"- `sdtk-spec generate` remains the 17-file scaffold source of truth.",
|
|
140
|
+
"- The generated files are structural scaffolds with placeholders until PM/BA/ARCH/DEV/QA agents fill them.",
|
|
141
|
+
`- Missing scaffold files before analyze: ${scaffold.missingBefore.length}`,
|
|
142
|
+
`- Missing scaffold files after analyze: ${scaffold.missingAfter.length}`,
|
|
143
|
+
"",
|
|
144
|
+
"## Next Action",
|
|
145
|
+
"",
|
|
146
|
+
`- Use task packet: .sdtk/spec/tasks/${featureKey}/README.md`,
|
|
147
|
+
"- Run the SDTK-SPEC PM/BA/ARCH/DEV/QA workflow against the preserved source and generated scaffold.",
|
|
148
|
+
"- Cite source lines or source sections where possible.",
|
|
149
|
+
"- Mark missing or low-confidence details as open questions instead of inventing screens, fields, APIs, data models, or visual constraints.",
|
|
150
|
+
"",
|
|
151
|
+
"## Open Questions",
|
|
152
|
+
"",
|
|
153
|
+
"- OQ-INTAKE-01: PM/BA must confirm product scope from the preserved source.",
|
|
154
|
+
"- OQ-INTAKE-02: BA/ARCH must extract screens, flows, domain model, APIs, data model, design constraints, and non-goals from source evidence.",
|
|
155
|
+
"- OQ-INTAKE-03: Any unclear source language or encoding risk must be resolved before downstream implementation handoff.",
|
|
156
|
+
"",
|
|
157
|
+
];
|
|
158
|
+
return lines.join("\n");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function taskHeader(featureKey, featureName, sourceInfo) {
|
|
162
|
+
return [
|
|
163
|
+
`Feature key: ${featureKey}`,
|
|
164
|
+
`Feature name: ${featureName}`,
|
|
165
|
+
`Preserved source: ${sourceInfo.preservedCopyRelativePath}`,
|
|
166
|
+
`Source SHA-256: ${sourceInfo.sha256}`,
|
|
167
|
+
"Inputs allowed: requirements/**. Forbidden: docs/ui/**",
|
|
168
|
+
].join("\n");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function artifactListForFeature(featureKey) {
|
|
172
|
+
return DESIGN_HANDOFF_ARTIFACTS.map((item) => item.replace("<KEY>", featureKey));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function buildInputBoundarySection() {
|
|
176
|
+
return [
|
|
177
|
+
"## Input Boundary",
|
|
178
|
+
"",
|
|
179
|
+
"Inputs allowed: requirements/**. Forbidden: docs/ui/**",
|
|
180
|
+
"",
|
|
181
|
+
"- Allowed before handoff completion: requirement source files, the preserved `.sdtk/spec/requirements/sources/**` copy, and generated SPEC scaffold artifacts under `docs/**`.",
|
|
182
|
+
"- Forbidden before handoff completion: `docs/ui/**`, reference sample HTML/PNG exports, copied sample layouts, and visual benchmark outputs.",
|
|
183
|
+
"- `docs/ui/**` is evaluation-only after SDTK output generation/handoff; it must not be used as a generation input.",
|
|
184
|
+
"- If worker history shows reads under `docs/ui/**` before `SPEC_TO_DESIGN_HANDOFF` is complete, the lane validator must report `PROVENANCE_VIOLATION`.",
|
|
185
|
+
"",
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function buildRequiredDesignHandoffSection(featureKey) {
|
|
190
|
+
return [
|
|
191
|
+
"## Required Design Handoff Artifacts",
|
|
192
|
+
"",
|
|
193
|
+
...artifactListForFeature(featureKey).map((item) => `- \`${item}\``),
|
|
194
|
+
"",
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function buildProvenanceContractSection(featureKey) {
|
|
199
|
+
return [
|
|
200
|
+
"## SPEC To DESIGN Provenance Contract",
|
|
201
|
+
"",
|
|
202
|
+
`Every screen in \`docs/design/SPEC_TO_DESIGN_HANDOFF_${featureKey}.json\` must include:`,
|
|
203
|
+
"",
|
|
204
|
+
"- `id`",
|
|
205
|
+
"- `title`",
|
|
206
|
+
"- `source_quote`: at least 30 Unicode code points copied literally from the requirement source",
|
|
207
|
+
"- `source_line_range`: `[start_line, end_line]` using 1-based source line numbers",
|
|
208
|
+
"",
|
|
209
|
+
"Deterministic verifier requirements:",
|
|
210
|
+
"",
|
|
211
|
+
"- `source_quote` must exist literally in the requirement source after UTF-8 BOM stripping and CRLF-to-LF newline normalization.",
|
|
212
|
+
"- `source_line_range` must be inside the source file bounds and must contain the quoted text.",
|
|
213
|
+
"- Screen `id` and `title` must not match an explicit post-generation sample filename/name list supplied to the verifier.",
|
|
214
|
+
"- Missing screens, malformed JSON, missing fields, invalid ranges, or copied sample-derived names must fail as `PROVENANCE_VIOLATION`.",
|
|
215
|
+
"- Runtime must not infer screens, fields, routes, palette, or ecommerce semantics from the raw requirement text.",
|
|
216
|
+
"",
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function buildTaskPacketFiles(featureKey, featureName, sourceInfo) {
|
|
221
|
+
const header = taskHeader(featureKey, featureName, sourceInfo);
|
|
222
|
+
return {
|
|
223
|
+
"README.md": [
|
|
224
|
+
`# Agent Task Packet ${featureKey}`,
|
|
225
|
+
"",
|
|
226
|
+
header,
|
|
227
|
+
"",
|
|
228
|
+
"## Purpose",
|
|
229
|
+
"",
|
|
230
|
+
"This packet routes source analysis to the SDTK-SPEC agent pipeline. Runtime `analyze` preserved the source and bootstrapped the standard 17-file scaffold; agents now perform the actual PM/BA/ARCH/DEV/QA analysis.",
|
|
231
|
+
"",
|
|
232
|
+
...buildInputBoundarySection(),
|
|
233
|
+
...buildRequiredDesignHandoffSection(featureKey),
|
|
234
|
+
...buildProvenanceContractSection(featureKey),
|
|
235
|
+
"## Required Agent Sequence",
|
|
236
|
+
"",
|
|
237
|
+
"1. PM/BA: read the preserved source and `docs/discovery/REQUIREMENT_<KEY>.md`.",
|
|
238
|
+
"2. PM/BA: fill project initiation, BA spec, PRD, backlog, and open questions using source evidence.",
|
|
239
|
+
"3. ARCH: extract screens, flows, domain model, APIs, data model, design constraints, and non-goals from source evidence.",
|
|
240
|
+
"4. DEV/QA: prepare implementation and test handoffs only after PM/BA/ARCH artifacts are evidence-backed.",
|
|
241
|
+
"5. All roles: update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` before handoff.",
|
|
242
|
+
"",
|
|
243
|
+
"## Guardrails",
|
|
244
|
+
"",
|
|
245
|
+
"- Do not invent screens, fields, APIs, data models, visual constraints, or acceptance criteria without source evidence or user confirmation.",
|
|
246
|
+
"- Do not read `docs/ui/**` or sample layout exports before `SPEC_TO_DESIGN_HANDOFF` is complete.",
|
|
247
|
+
"- Cite source lines or sections where possible.",
|
|
248
|
+
"- Mark low-confidence or missing details as open questions.",
|
|
249
|
+
"",
|
|
250
|
+
].join("\n"),
|
|
251
|
+
"01_REQUIREMENT_TO_PM_BA.md": [
|
|
252
|
+
`# 01 Requirement To PM/BA ${featureKey}`,
|
|
253
|
+
"",
|
|
254
|
+
header,
|
|
255
|
+
"",
|
|
256
|
+
...buildInputBoundarySection(),
|
|
257
|
+
"## PM Tasks",
|
|
258
|
+
"",
|
|
259
|
+
"- Read the preserved source and intake requirement artifact.",
|
|
260
|
+
"- Fill `docs/product/PROJECT_INITIATION_<KEY>.md`.",
|
|
261
|
+
"- Fill `docs/product/PRD_<KEY>.md` and `docs/product/BACKLOG_<KEY>.md` only with source-backed requirements or explicit decisions.",
|
|
262
|
+
"- Record unresolved items as `OQ-*` open questions.",
|
|
263
|
+
"",
|
|
264
|
+
"## BA Tasks",
|
|
265
|
+
"",
|
|
266
|
+
"- Fill `docs/specs/BA_SPEC_<KEY>.md` with business rules, use cases, acceptance criteria, non-functional requirements, and traceability.",
|
|
267
|
+
"- Preserve original VI/JP source excerpts in an appendix when needed and add literal English translation for traceability.",
|
|
268
|
+
"- Update `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` before ARCH handoff.",
|
|
269
|
+
"",
|
|
270
|
+
].join("\n"),
|
|
271
|
+
"02_BA_TO_ARCH_SCREEN_FLOW_DOMAIN.md": [
|
|
272
|
+
`# 02 BA To ARCH Screen Flow Domain ${featureKey}`,
|
|
273
|
+
"",
|
|
274
|
+
header,
|
|
275
|
+
"",
|
|
276
|
+
...buildInputBoundarySection(),
|
|
277
|
+
...buildRequiredDesignHandoffSection(featureKey),
|
|
278
|
+
...buildProvenanceContractSection(featureKey),
|
|
279
|
+
"## ARCH Tasks",
|
|
280
|
+
"",
|
|
281
|
+
"- Extract screens, user flows, domain entities, data model, APIs, and design constraints from the preserved source and BA artifact.",
|
|
282
|
+
"- Fill `docs/specs/<KEY>_FLOW_ACTION_SPEC.md`.",
|
|
283
|
+
"- Fill `docs/architecture/ARCH_DESIGN_<KEY>.md`.",
|
|
284
|
+
"- Fill `docs/database/DATABASE_SPEC_<KEY>.md`.",
|
|
285
|
+
"- Fill `docs/api/<Pascal>_API.yaml`, `docs/api/<KEY>_ENDPOINTS.md`, `docs/api/<KEY>_API_DESIGN_DETAIL.md`, and `docs/api/<snake>_api_flow_list.txt` when API scope is source-backed.",
|
|
286
|
+
"- Fill `docs/design/DESIGN_LAYOUT_<KEY>.md` only with source-backed layout constraints or explicit decisions.",
|
|
287
|
+
"- Fill `docs/design/SPEC_TO_DESIGN_HANDOFF_<KEY>.json` only from explicit source evidence and include `source_quote` plus `source_line_range` for every screen.",
|
|
288
|
+
"",
|
|
289
|
+
"## Evidence Rule",
|
|
290
|
+
"",
|
|
291
|
+
"- Every screen, flow, entity, field, API, and design constraint must cite source evidence or be marked as an open question.",
|
|
292
|
+
"",
|
|
293
|
+
].join("\n"),
|
|
294
|
+
"03_ARCH_TO_DEV_QA_HANDOFF.md": [
|
|
295
|
+
`# 03 ARCH To DEV/QA Handoff ${featureKey}`,
|
|
296
|
+
"",
|
|
297
|
+
header,
|
|
298
|
+
"",
|
|
299
|
+
...buildInputBoundarySection(),
|
|
300
|
+
"## DEV Planning Tasks",
|
|
301
|
+
"",
|
|
302
|
+
"- Fill `docs/dev/FEATURE_IMPL_PLAN_<KEY>.md` after PM/BA/ARCH artifacts are reviewed.",
|
|
303
|
+
"- Keep `/dev` output bounded to planning and CODE handoff readiness.",
|
|
304
|
+
"- Do not start SDTK-CODE implementation until source-backed scope and blockers are clear.",
|
|
305
|
+
"",
|
|
306
|
+
"## QA Tasks",
|
|
307
|
+
"",
|
|
308
|
+
"- Fill `docs/qa/<KEY>_TEST_CASE.md` and `docs/qa/QA_RELEASE_REPORT_<KEY>.md` from source-backed acceptance criteria and downstream implementation evidence.",
|
|
309
|
+
"- Confirm `SHARED_PLANNING.md` and `QUALITY_CHECKLIST.md` are updated before release decision.",
|
|
310
|
+
"",
|
|
311
|
+
"## Handoff Rule",
|
|
312
|
+
"",
|
|
313
|
+
"- Missing source evidence remains a blocker or open question; do not convert uncertainty into implementation scope.",
|
|
314
|
+
"",
|
|
315
|
+
].join("\n"),
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function writeTaskPacket(projectPath, featureKey, featureName, sourceInfo, force) {
|
|
320
|
+
const taskRootRel = path.join(".sdtk", "spec", "tasks", featureKey);
|
|
321
|
+
const taskRoot = path.join(projectPath, taskRootRel);
|
|
322
|
+
const files = buildTaskPacketFiles(featureKey, featureName, sourceInfo);
|
|
323
|
+
const written = {};
|
|
324
|
+
for (const [fileName, content] of Object.entries(files)) {
|
|
325
|
+
const rel = path.join(taskRootRel, fileName).replace(/\\/g, "/");
|
|
326
|
+
writeFileSafe(path.join(taskRoot, fileName), `${content}\n`, force);
|
|
327
|
+
written[fileName] = rel;
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
root: taskRootRel.replace(/\\/g, "/"),
|
|
331
|
+
files: written,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function buildState(featureKey, featureName, sourceInfo, diagnostics, scaffold, artifacts, taskPacket) {
|
|
336
|
+
return {
|
|
337
|
+
schemaVersion: "sdtk.spec.requirementIntake.v1",
|
|
338
|
+
featureKey,
|
|
339
|
+
featureName,
|
|
340
|
+
generatedAt: new Date().toISOString(),
|
|
341
|
+
source: sourceInfo,
|
|
342
|
+
encodingDiagnostics: diagnostics,
|
|
343
|
+
scaffoldStatus: scaffold.status,
|
|
344
|
+
scaffold: {
|
|
345
|
+
expectedFileCount: scaffold.expectedFiles.length,
|
|
346
|
+
expectedFiles: scaffold.expectedFiles.map((item) => item.replace(/\\/g, "/")),
|
|
347
|
+
missingBefore: scaffold.missingBefore,
|
|
348
|
+
missingAfter: scaffold.missingAfter,
|
|
349
|
+
},
|
|
350
|
+
analysisStatus: ANALYSIS_STATUS,
|
|
351
|
+
artifacts,
|
|
352
|
+
taskPacket,
|
|
353
|
+
designHandoffContract: {
|
|
354
|
+
requiredArtifacts: artifactListForFeature(featureKey).map((item) => item.replace(/\\/g, "/")),
|
|
355
|
+
requiredScreenFields: ["id", "title", "source_quote", "source_line_range"],
|
|
356
|
+
sourceQuoteMinimumCodePoints: 30,
|
|
357
|
+
forbiddenInputPattern: "docs/ui/**",
|
|
358
|
+
violationCode: "PROVENANCE_VIOLATION",
|
|
359
|
+
},
|
|
360
|
+
nextRecommendedAction:
|
|
361
|
+
`Open ${taskPacket.files["README.md"]} and run the PM/BA/ARCH/DEV/QA agent workflow against the preserved source.`,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
async function runRequirementAnalyze(args) {
|
|
366
|
+
const { flags } = parseFlags(args, FLAG_DEFS);
|
|
367
|
+
|
|
368
|
+
const sourcePath = path.resolve(requireFlag(flags, "source", "source"));
|
|
369
|
+
const featureKey = requireFlag(flags, "feature-key", "feature-key");
|
|
370
|
+
const featureName = requireFlag(flags, "feature-name", "feature-name");
|
|
371
|
+
validatePattern(
|
|
372
|
+
featureKey,
|
|
373
|
+
FEATURE_KEY_REGEX,
|
|
374
|
+
"feature-key",
|
|
375
|
+
"Must be UPPER_SNAKE_CASE (e.g., CUSTOMER_PORTAL, ORDER_MANAGEMENT)."
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
if (!fs.existsSync(sourcePath) || !fs.statSync(sourcePath).isFile()) {
|
|
379
|
+
throw new ValidationError(`Requirement source file does not exist: ${sourcePath}`);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const projectPath = flags["project-path"] ? path.resolve(flags["project-path"]) : process.cwd();
|
|
383
|
+
ensureDir(projectPath);
|
|
384
|
+
|
|
385
|
+
const scaffold = await ensureGeneratedScaffold({
|
|
386
|
+
featureKey,
|
|
387
|
+
featureName,
|
|
388
|
+
projectPath,
|
|
389
|
+
force: Boolean(flags.force),
|
|
390
|
+
verbose: Boolean(flags.verbose),
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
const sourceBuffer = fs.readFileSync(sourcePath);
|
|
394
|
+
const sourceText = normalizeNewlines(sourceBuffer.toString("utf8"));
|
|
395
|
+
const lines = sourceText.split("\n");
|
|
396
|
+
const diagnostics = detectEncodingDiagnostics(sourceText);
|
|
397
|
+
const sourceHash = sha256(sourceBuffer);
|
|
398
|
+
const sourceCopyRel = path.join(
|
|
399
|
+
".sdtk",
|
|
400
|
+
"spec",
|
|
401
|
+
"requirements",
|
|
402
|
+
"sources",
|
|
403
|
+
featureKey,
|
|
404
|
+
path.basename(sourcePath)
|
|
405
|
+
);
|
|
406
|
+
const sourceCopyPath = path.join(projectPath, sourceCopyRel);
|
|
407
|
+
|
|
408
|
+
copyFileSafe(sourcePath, sourceCopyPath, flags.force);
|
|
409
|
+
|
|
410
|
+
const sourceInfo = {
|
|
411
|
+
sourcePath,
|
|
412
|
+
preservedCopyRelativePath: sourceCopyRel.replace(/\\/g, "/"),
|
|
413
|
+
preservedCopySha256: sha256(fs.readFileSync(sourceCopyPath)),
|
|
414
|
+
sha256: sourceHash,
|
|
415
|
+
sizeBytes: sourceBuffer.length,
|
|
416
|
+
lineCount: lines.length,
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const requirementRel = path.join("docs", "discovery", `REQUIREMENT_${featureKey}.md`);
|
|
420
|
+
const stateRel = path.join(".sdtk", "spec", "requirements", `ANALYSIS_STATE_${featureKey}.json`);
|
|
421
|
+
const requirementPath = path.join(projectPath, requirementRel);
|
|
422
|
+
const statePath = path.join(projectPath, stateRel);
|
|
423
|
+
|
|
424
|
+
const taskPacket = writeTaskPacket(projectPath, featureKey, featureName, sourceInfo, flags.force);
|
|
425
|
+
const artifacts = {
|
|
426
|
+
requirement: requirementRel.replace(/\\/g, "/"),
|
|
427
|
+
state: stateRel.replace(/\\/g, "/"),
|
|
428
|
+
sourceCopy: sourceCopyRel.replace(/\\/g, "/"),
|
|
429
|
+
};
|
|
430
|
+
const state = buildState(featureKey, featureName, sourceInfo, diagnostics, scaffold, artifacts, taskPacket);
|
|
431
|
+
|
|
432
|
+
writeFileSafe(
|
|
433
|
+
requirementPath,
|
|
434
|
+
buildRequirementIntakeMarkdown(featureKey, featureName, sourceInfo, diagnostics, scaffold),
|
|
435
|
+
flags.force
|
|
436
|
+
);
|
|
437
|
+
writeFileSafe(statePath, `${JSON.stringify(state, null, 2)}\n`, flags.force);
|
|
438
|
+
|
|
439
|
+
const result = {
|
|
440
|
+
analyze: {
|
|
441
|
+
featureKey,
|
|
442
|
+
featureName,
|
|
443
|
+
projectPath,
|
|
444
|
+
sourcePath,
|
|
445
|
+
artifacts,
|
|
446
|
+
taskPacket,
|
|
447
|
+
scaffoldStatus: scaffold.status,
|
|
448
|
+
analysisStatus: ANALYSIS_STATUS,
|
|
449
|
+
encodingDiagnostics: diagnostics,
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
if (flags.json) {
|
|
454
|
+
console.log(JSON.stringify(result, null, 2));
|
|
455
|
+
} else {
|
|
456
|
+
console.log("[analyze] Requirement source intake complete.");
|
|
457
|
+
console.log(` Requirement: ${result.analyze.artifacts.requirement}`);
|
|
458
|
+
console.log(` State: ${result.analyze.artifacts.state}`);
|
|
459
|
+
console.log(` Source copy: ${result.analyze.artifacts.sourceCopy}`);
|
|
460
|
+
console.log(` Task packet: ${result.analyze.taskPacket.root}`);
|
|
461
|
+
console.log(` Scaffold: ${result.analyze.scaffoldStatus}`);
|
|
462
|
+
console.log(` Analysis: ${result.analyze.analysisStatus}`);
|
|
463
|
+
console.log(` Mojibake: ${diagnostics.likelyMojibake} (${diagnostics.mojibakeMarkerCount} markers)`);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
module.exports = {
|
|
470
|
+
runRequirementAnalyze,
|
|
471
|
+
detectEncodingDiagnostics,
|
|
472
|
+
};
|
package/src/lib/scope.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const os = require("os");
|
|
5
|
-
|
|
6
|
-
const VALID_SCOPES = ["project", "user"];
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Returns the default scope for a given runtime.
|
|
10
|
-
* Claude defaults to project-local, Codex defaults to user/global.
|
|
11
|
-
*/
|
|
12
|
-
function defaultScope(runtime) {
|
|
13
|
-
return runtime === "claude" ? "project" : "user";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns true if the given runtime supports project-local scope.
|
|
18
|
-
*/
|
|
19
|
-
function isProjectScopeSupported(runtime) {
|
|
20
|
-
return runtime === "claude" || runtime === "codex";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function resolveCodexProjectHome(projectPath) {
|
|
24
|
-
return path.join(projectPath || process.cwd(), ".codex");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function resolveCodexUserHome() {
|
|
28
|
-
return process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function resolveCodexHome(scope, projectPath) {
|
|
32
|
-
return scope === "project"
|
|
33
|
-
? resolveCodexProjectHome(projectPath)
|
|
34
|
-
: resolveCodexUserHome();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Resolves the skills directory for a given runtime, scope, and project path.
|
|
39
|
-
*/
|
|
40
|
-
function resolveSkillsDir(runtime, scope, projectPath) {
|
|
41
|
-
if (runtime === "claude") {
|
|
42
|
-
if (scope === "user") {
|
|
43
|
-
return path.join(os.homedir(), ".claude", "skills");
|
|
44
|
-
}
|
|
45
|
-
return path.join(projectPath || process.cwd(), ".claude", "skills");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const codexHome = resolveCodexHome(scope, projectPath);
|
|
49
|
-
return path.join(codexHome, "skills");
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* SDTK-managed skill directory names per runtime.
|
|
54
|
-
* Used by runtime status to distinguish SDTK skills from unrelated user skills.
|
|
55
|
-
*/
|
|
56
|
-
const MANAGED_CODEX_SKILLS = [
|
|
57
|
-
"sdtk-api-design-spec", "sdtk-api-doc", "sdtk-arch", "sdtk-ba",
|
|
58
|
-
"sdtk-design-layout", "sdtk-dev", "sdtk-dev-backend", "sdtk-dev-frontend",
|
|
59
|
-
"sdtk-orchestrator", "sdtk-pm", "sdtk-qa", "sdtk-screen-design-spec",
|
|
60
|
-
"sdtk-test-case-spec",
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
const MANAGED_CLAUDE_SKILLS = [
|
|
64
|
-
"api-design-spec", "api-doc", "arch", "ba",
|
|
65
|
-
"design-layout", "dev", "dev-backend", "dev-frontend",
|
|
66
|
-
"orchestrator", "pm", "qa", "screen-design-spec",
|
|
67
|
-
"test-case-spec",
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
function managedSkillNames(runtime) {
|
|
71
|
-
return runtime === "claude" ? MANAGED_CLAUDE_SKILLS : MANAGED_CODEX_SKILLS;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
module.exports = {
|
|
75
|
-
VALID_SCOPES,
|
|
76
|
-
defaultScope,
|
|
77
|
-
isProjectScopeSupported,
|
|
78
|
-
resolveCodexHome,
|
|
79
|
-
resolveCodexProjectHome,
|
|
80
|
-
resolveCodexUserHome,
|
|
81
|
-
resolveSkillsDir,
|
|
82
|
-
managedSkillNames,
|
|
83
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const os = require("os");
|
|
5
|
+
|
|
6
|
+
const VALID_SCOPES = ["project", "user"];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns the default scope for a given runtime.
|
|
10
|
+
* Claude defaults to project-local, Codex defaults to user/global.
|
|
11
|
+
*/
|
|
12
|
+
function defaultScope(runtime) {
|
|
13
|
+
return runtime === "claude" ? "project" : "user";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if the given runtime supports project-local scope.
|
|
18
|
+
*/
|
|
19
|
+
function isProjectScopeSupported(runtime) {
|
|
20
|
+
return runtime === "claude" || runtime === "codex";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function resolveCodexProjectHome(projectPath) {
|
|
24
|
+
return path.join(projectPath || process.cwd(), ".codex");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function resolveCodexUserHome() {
|
|
28
|
+
return process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function resolveCodexHome(scope, projectPath) {
|
|
32
|
+
return scope === "project"
|
|
33
|
+
? resolveCodexProjectHome(projectPath)
|
|
34
|
+
: resolveCodexUserHome();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Resolves the skills directory for a given runtime, scope, and project path.
|
|
39
|
+
*/
|
|
40
|
+
function resolveSkillsDir(runtime, scope, projectPath) {
|
|
41
|
+
if (runtime === "claude") {
|
|
42
|
+
if (scope === "user") {
|
|
43
|
+
return path.join(os.homedir(), ".claude", "skills");
|
|
44
|
+
}
|
|
45
|
+
return path.join(projectPath || process.cwd(), ".claude", "skills");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const codexHome = resolveCodexHome(scope, projectPath);
|
|
49
|
+
return path.join(codexHome, "skills");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* SDTK-managed skill directory names per runtime.
|
|
54
|
+
* Used by runtime status to distinguish SDTK skills from unrelated user skills.
|
|
55
|
+
*/
|
|
56
|
+
const MANAGED_CODEX_SKILLS = [
|
|
57
|
+
"sdtk-api-design-spec", "sdtk-api-doc", "sdtk-arch", "sdtk-ba",
|
|
58
|
+
"sdtk-design-layout", "sdtk-dev", "sdtk-dev-backend", "sdtk-dev-frontend",
|
|
59
|
+
"sdtk-orchestrator", "sdtk-pm", "sdtk-qa", "sdtk-screen-design-spec",
|
|
60
|
+
"sdtk-test-case-spec",
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const MANAGED_CLAUDE_SKILLS = [
|
|
64
|
+
"api-design-spec", "api-doc", "arch", "ba",
|
|
65
|
+
"design-layout", "dev", "dev-backend", "dev-frontend",
|
|
66
|
+
"orchestrator", "pm", "qa", "screen-design-spec",
|
|
67
|
+
"test-case-spec",
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
function managedSkillNames(runtime) {
|
|
71
|
+
return runtime === "claude" ? MANAGED_CLAUDE_SKILLS : MANAGED_CODEX_SKILLS;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = {
|
|
75
|
+
VALID_SCOPES,
|
|
76
|
+
defaultScope,
|
|
77
|
+
isProjectScopeSupported,
|
|
78
|
+
resolveCodexHome,
|
|
79
|
+
resolveCodexProjectHome,
|
|
80
|
+
resolveCodexUserHome,
|
|
81
|
+
resolveSkillsDir,
|
|
82
|
+
managedSkillNames,
|
|
83
|
+
};
|