sdtk-kit 0.3.9 → 1.0.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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -177
  3. package/bin/sdtk-code.js +6 -0
  4. package/bin/sdtk-design.js +6 -0
  5. package/bin/sdtk-ops.js +6 -0
  6. package/bin/sdtk-spec.js +12 -0
  7. package/bin/sdtk-wiki.js +6 -0
  8. package/package.json +60 -46
  9. package/scripts/postinstall.js +40 -0
  10. package/assets/manifest/toolkit-bundle.manifest.json +0 -473
  11. package/assets/manifest/toolkit-bundle.sha256.txt +0 -93
  12. package/assets/toolkit/toolkit/AGENTS.md +0 -131
  13. package/assets/toolkit/toolkit/install.ps1 +0 -310
  14. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +0 -54
  15. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +0 -32
  16. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +0 -261
  17. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +0 -169
  18. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +0 -189
  19. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +0 -139
  20. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +0 -116
  21. package/assets/toolkit/toolkit/sdtk.config.json +0 -28
  22. package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +0 -50
  23. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +0 -84
  24. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +0 -22
  25. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  26. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +0 -20
  27. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +0 -732
  28. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +0 -43
  29. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  30. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +0 -20
  31. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/YAML_CREATION_RULES.md +0 -128
  32. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +0 -83
  33. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +0 -22
  34. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  35. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +0 -20
  36. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  37. package/assets/toolkit/toolkit/skills/sdtk-arch/references/YAML_CREATION_RULES.md +0 -128
  38. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +0 -29
  39. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +0 -52
  40. package/assets/toolkit/toolkit/skills/sdtk-design-layout/scripts/render_design_layout_images.py +0 -246
  41. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +0 -90
  42. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/code-quality-reviewer.md +0 -35
  43. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/implementer.md +0 -61
  44. package/assets/toolkit/toolkit/skills/sdtk-dev/prompts/spec-reviewer.md +0 -42
  45. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +0 -21
  46. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +0 -19
  47. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +0 -80
  48. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +0 -30
  49. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +0 -53
  50. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +0 -86
  51. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  52. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +0 -51
  53. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +0 -54
  54. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +0 -28
  55. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +0 -136
  56. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +0 -414
  57. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +0 -74
  58. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +0 -129
  59. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +0 -97
  60. package/assets/toolkit/toolkit/skills/skills.catalog.yaml +0 -302
  61. package/assets/toolkit/toolkit/skills-claude/api-design-spec/SKILL.md +0 -90
  62. package/assets/toolkit/toolkit/skills-claude/api-doc/SKILL.md +0 -47
  63. package/assets/toolkit/toolkit/skills-claude/arch/SKILL.md +0 -59
  64. package/assets/toolkit/toolkit/skills-claude/ba/SKILL.md +0 -50
  65. package/assets/toolkit/toolkit/skills-claude/design-layout/SKILL.md +0 -57
  66. package/assets/toolkit/toolkit/skills-claude/dev/SKILL.md +0 -45
  67. package/assets/toolkit/toolkit/skills-claude/dev-backend/SKILL.md +0 -20
  68. package/assets/toolkit/toolkit/skills-claude/dev-frontend/SKILL.md +0 -18
  69. package/assets/toolkit/toolkit/skills-claude/orchestrator/SKILL.md +0 -63
  70. package/assets/toolkit/toolkit/skills-claude/pm/SKILL.md +0 -52
  71. package/assets/toolkit/toolkit/skills-claude/qa/SKILL.md +0 -48
  72. package/assets/toolkit/toolkit/skills-claude/screen-design-spec/SKILL.md +0 -90
  73. package/assets/toolkit/toolkit/skills-claude/test-case-spec/SKILL.md +0 -61
  74. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +0 -124
  75. package/assets/toolkit/toolkit/templates/README.md +0 -63
  76. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +0 -80
  77. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +0 -22
  78. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +0 -67
  79. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md +0 -468
  80. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +0 -229
  81. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +0 -20
  82. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +0 -20
  83. package/assets/toolkit/toolkit/templates/docs/api/YAML_CREATION_RULES.md +0 -128
  84. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +0 -12
  85. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +0 -109
  86. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +0 -175
  87. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +0 -60
  88. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +0 -73
  89. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +0 -50
  90. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +0 -66
  91. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +0 -98
  92. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +0 -61
  93. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +0 -129
  94. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +0 -104
  95. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +0 -139
  96. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +0 -220
  97. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +0 -197
  98. package/assets/toolkit/toolkit/templates/handoffs/ARCH_TO_DEV.md +0 -31
  99. package/assets/toolkit/toolkit/templates/handoffs/BA_TO_ARCH.md +0 -28
  100. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE1_SPEC_REVIEW.md +0 -26
  101. package/assets/toolkit/toolkit/templates/handoffs/DEV_STAGE2_CODE_QUALITY_REVIEW.md +0 -20
  102. package/assets/toolkit/toolkit/templates/handoffs/DEV_TO_QA.md +0 -23
  103. package/assets/toolkit/toolkit/templates/handoffs/PM_TO_BA.md +0 -26
  104. package/assets/toolkit/toolkit/templates/handoffs/QA_RELEASE_DECISION.md +0 -21
  105. package/bin/sdtk.js +0 -15
  106. package/src/commands/auth.js +0 -85
  107. package/src/commands/generate.js +0 -177
  108. package/src/commands/help.js +0 -101
  109. package/src/commands/init.js +0 -97
  110. package/src/commands/runtime.js +0 -217
  111. package/src/index.js +0 -59
  112. package/src/lib/args.js +0 -116
  113. package/src/lib/errors.js +0 -41
  114. package/src/lib/github-access.js +0 -68
  115. package/src/lib/powershell.js +0 -85
  116. package/src/lib/scope.js +0 -68
  117. package/src/lib/state.js +0 -83
  118. package/src/lib/toolkit-payload.js +0 -99
@@ -1,26 +0,0 @@
1
- # PM to BA Handoff
2
-
3
- ## Required Inputs
4
- - `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
5
- - source requirement notes or attachments
6
- - current `SHARED_PLANNING.md`
7
-
8
- ## Required Outputs
9
- - `docs/specs/BA_SPEC_[FEATURE_KEY].md`
10
- - updated `SHARED_PLANNING.md`
11
- - updated `QUALITY_CHECKLIST.md`
12
-
13
- ## Mandatory Checks
14
- - `REQ-xx` scope is explicit and testable.
15
- - in-scope and out-of-scope are visible.
16
- - unresolved ambiguities are logged as `OQ-xx`, not hidden.
17
-
18
- ## Forbidden Shortcuts
19
- - Do not skip glossary, BR, UC, AC, or traceability expectations.
20
- - Do not invent missing stakeholder decisions without logging them.
21
-
22
- ## Handoff Message Shape
23
- - Feature: `[FEATURE_KEY]`
24
- - PM scope summary: 3 to 7 bullets
25
- - Known open questions: `OQ-xx` list or `None`
26
- - Expected BA focus: rules, use cases, acceptance criteria, NFRs
@@ -1,21 +0,0 @@
1
- # QA Release Decision
2
-
3
- ## Required Inputs
4
- - `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
5
- - Stage 1 and Stage 2 DEV review PASS evidence
6
- - fresh proving checks or benchmark-mode evidence
7
- - open defect list with severity
8
-
9
- ## Required Outputs
10
- - `APPROVED` or `REJECTED`
11
- - explicit evidence summary
12
- - unresolved risks and assumptions list
13
-
14
- ## Mandatory Checks
15
- - verdict is backed by fresh command evidence or benchmark policy
16
- - specification quotes are used for requirement-based validation
17
- - defects and known gaps are visible in the decision
18
-
19
- ## Forbidden Shortcuts
20
- - Do not issue `APPROVED` based on planned checks.
21
- - Do not hide environment limitations; state when runtime verification was not possible.
package/bin/sdtk.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- "use strict";
4
-
5
- const { run } = require("../src/index");
6
-
7
- run(process.argv.slice(2))
8
- .then((exitCode) => {
9
- process.exitCode = Number.isInteger(exitCode) ? exitCode : 0;
10
- })
11
- .catch((error) => {
12
- console.error(`sdtk: ${error.message}`);
13
- process.exitCode =
14
- typeof error.exitCode === "number" ? error.exitCode : 4;
15
- });
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- const { clearAuthState, readAuthState, writeAuthState } = require("../lib/state");
4
- const { parseFlags } = require("../lib/args");
5
- const { checkRepoAccess } = require("../lib/github-access");
6
- const { ValidationError } = require("../lib/errors");
7
-
8
- const FLAG_DEFS = {
9
- token: { type: "string" },
10
- status: { type: "boolean" },
11
- logout: { type: "boolean" },
12
- verify: { type: "boolean" },
13
- };
14
-
15
- /**
16
- * Redact a token for safe display (show first 4 chars only).
17
- */
18
- function redactToken(token) {
19
- if (!token || token.length < 8) return "****";
20
- return token.slice(0, 4) + "****";
21
- }
22
-
23
- async function cmdAuth(args) {
24
- const { flags } = parseFlags(args, FLAG_DEFS);
25
-
26
- if (flags.status) {
27
- const state = readAuthState();
28
- if (!state.authenticated) {
29
- console.log("Auth status: not authenticated");
30
- console.log('Run "sdtk auth --token <value>" to authenticate.');
31
- return 1;
32
- }
33
- console.log("Auth status: authenticated");
34
- console.log(`Token: ${redactToken(state.token)}`);
35
- return 0;
36
- }
37
-
38
- if (flags.logout) {
39
- clearAuthState();
40
- console.log("Auth state cleared.");
41
- return 0;
42
- }
43
-
44
- // Process --token first, then optionally --verify in the same invocation.
45
- // This supports: sdtk auth --token <value> --verify
46
- if (flags.token) {
47
- const { path: authFile, hardened } = writeAuthState(flags.token);
48
- if (hardened) {
49
- console.log("Token stored securely.");
50
- } else {
51
- console.log("Token stored (file permission hardening was not applied).");
52
- }
53
- console.log(`Auth file: ${authFile}`);
54
-
55
- if (flags.verify) {
56
- console.log("");
57
- console.log("Verifying repository access...");
58
- const result = await checkRepoAccess(flags.token);
59
- console.log(result.message);
60
- return result.hasAccess ? 0 : 1;
61
- }
62
-
63
- console.log('Run "sdtk auth --verify" to check repository access.');
64
- return 0;
65
- }
66
-
67
- if (flags.verify) {
68
- const state = readAuthState();
69
- if (!state.authenticated) {
70
- console.log("Not authenticated. Store a token first with --token.");
71
- return 1;
72
- }
73
- const result = await checkRepoAccess(state.token);
74
- console.log(result.message);
75
- return result.hasAccess ? 0 : 1;
76
- }
77
-
78
- throw new ValidationError(
79
- "Usage: sdtk auth --token <value> [--verify] | --status | --logout"
80
- );
81
- }
82
-
83
- module.exports = {
84
- cmdAuth,
85
- };
@@ -1,177 +0,0 @@
1
- "use strict";
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const { parseFlags, requireFlag, validatePattern } = require("../lib/args");
6
- const { verify, resolvePayloadFile } = require("../lib/toolkit-payload");
7
- const { runScript } = require("../lib/powershell");
8
- const { ValidationError } = require("../lib/errors");
9
-
10
- /**
11
- * Expected 17 output files from generate.
12
- * Placeholders: {KEY} = UPPER_SNAKE_CASE, {PASCAL} = PascalCase, {SNAKE} = lower_snake_case
13
- */
14
- const EXPECTED_OUTPUT_FILES = [
15
- "SHARED_PLANNING.md",
16
- "QUALITY_CHECKLIST.md",
17
- "docs/product/PROJECT_INITIATION_{KEY}.md",
18
- "docs/specs/BA_SPEC_{KEY}.md",
19
- "docs/specs/{KEY}_FLOW_ACTION_SPEC.md",
20
- "docs/product/PRD_{KEY}.md",
21
- "docs/product/BACKLOG_{KEY}.md",
22
- "docs/architecture/ARCH_DESIGN_{KEY}.md",
23
- "docs/database/DATABASE_SPEC_{KEY}.md",
24
- "docs/api/{PASCAL}_API.yaml",
25
- "docs/api/{KEY}_ENDPOINTS.md",
26
- "docs/api/{KEY}_API_DESIGN_DETAIL.md",
27
- "docs/api/{SNAKE}_api_flow_list.txt",
28
- "docs/design/DESIGN_LAYOUT_{KEY}.md",
29
- "docs/dev/FEATURE_IMPL_PLAN_{KEY}.md",
30
- "docs/qa/{KEY}_TEST_CASE.md",
31
- "docs/qa/QA_RELEASE_REPORT_{KEY}.md",
32
- ];
33
-
34
- /**
35
- * Convert text to PascalCase.
36
- * Mirrors init-feature.ps1 ConvertTo-PascalCase: split on non-alphanumeric,
37
- * capitalize first letter of each part, preserve rest of casing per part.
38
- * e.g. "Order Management" -> "OrderManagement", "USER_PROFILE" -> "UserProfile"
39
- */
40
- function toPascalCase(text) {
41
- const parts = text.split(/[^A-Za-z0-9]+/).filter((p) => p.length > 0);
42
- return parts
43
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
44
- .join("");
45
- }
46
-
47
- /**
48
- * Derive PascalCase matching init-feature.ps1 logic:
49
- * prefer featureName, fallback to featureKey.
50
- */
51
- function derivePascalCase(featureName, featureKey) {
52
- const fromName = toPascalCase(featureName);
53
- return fromName || toPascalCase(featureKey);
54
- }
55
-
56
- /**
57
- * Convert UPPER_SNAKE_CASE to lower_snake_case.
58
- */
59
- function toSnakeCase(upperSnake) {
60
- return upperSnake.toLowerCase();
61
- }
62
-
63
- /**
64
- * Expand placeholders and return list of expected file paths relative to project root.
65
- */
66
- function expandExpectedFiles(featureKey, featureName) {
67
- const pascal = derivePascalCase(featureName, featureKey);
68
- const snake = toSnakeCase(featureKey);
69
- return EXPECTED_OUTPUT_FILES.map((tmpl) =>
70
- tmpl.replace(/\{KEY\}/g, featureKey).replace(/\{PASCAL\}/g, pascal).replace(/\{SNAKE\}/g, snake)
71
- );
72
- }
73
-
74
- /**
75
- * Verify all 17 expected output files exist under projectPath.
76
- * Returns list of missing files (empty if all present).
77
- */
78
- function verifyOutputContract(projectPath, featureKey, featureName) {
79
- const expected = expandExpectedFiles(featureKey, featureName);
80
- const missing = [];
81
- for (const rel of expected) {
82
- const full = path.join(projectPath, rel);
83
- if (!fs.existsSync(full)) {
84
- missing.push(rel);
85
- }
86
- }
87
- return missing;
88
- }
89
-
90
- const FLAG_DEFS = {
91
- "feature-key": { type: "string" },
92
- "feature-name": { type: "string" },
93
- "project-path": { type: "string" },
94
- force: { type: "boolean" },
95
- "validate-only": { type: "boolean" },
96
- verbose: { type: "boolean" },
97
- };
98
-
99
- const FEATURE_KEY_REGEX = /^[A-Z][A-Z0-9_]*$/;
100
-
101
- async function cmdGenerate(args) {
102
- const { flags } = parseFlags(args, FLAG_DEFS);
103
-
104
- // Validate required flags
105
- const featureKey = requireFlag(flags, "feature-key", "feature-key");
106
- const featureName = requireFlag(flags, "feature-name", "feature-name");
107
-
108
- // Validate feature key format
109
- validatePattern(
110
- featureKey,
111
- FEATURE_KEY_REGEX,
112
- "feature-key",
113
- "Must be UPPER_SNAKE_CASE (e.g., USER_PROFILE, ORDER_MANAGEMENT)."
114
- );
115
-
116
- // Resolve project path
117
- const projectPath = flags["project-path"]
118
- ? path.resolve(flags["project-path"])
119
- : process.cwd();
120
-
121
- // Verify payload integrity before proceeding
122
- verify();
123
-
124
- // Resolve bundled init-feature.ps1
125
- const generateScript = resolvePayloadFile(
126
- "toolkit/scripts/init-feature.ps1"
127
- );
128
-
129
- // Build PowerShell parameters
130
- const params = {
131
- FeatureKey: featureKey,
132
- FeatureName: featureName,
133
- ProjectPath: projectPath,
134
- };
135
- if (flags.force) params.Force = true;
136
- if (flags["validate-only"]) params.ValidateOnly = true;
137
-
138
- console.log(`Generating documentation for feature: ${featureKey}`);
139
- console.log(` Feature name: ${featureName}`);
140
- console.log(` Project path: ${projectPath}`);
141
- if (flags["validate-only"]) {
142
- console.log(" Mode: validate-only (no files will be written)");
143
- }
144
- console.log("");
145
-
146
- const result = await runScript(generateScript, params, { silent: !flags.verbose });
147
-
148
- if (result.exitCode !== 0) {
149
- if (result.stderr) {
150
- console.error(result.stderr);
151
- }
152
- throw new ValidationError(
153
- `Generation failed (exit code ${result.exitCode}).`
154
- );
155
- }
156
-
157
- // Enforce 17-file output contract (skip for validate-only mode)
158
- if (!flags["validate-only"]) {
159
- const missing = verifyOutputContract(projectPath, featureKey, featureName);
160
- if (missing.length > 0) {
161
- console.error("\nOutput contract violation -- missing files:");
162
- for (const f of missing) {
163
- console.error(` - ${f}`);
164
- }
165
- throw new ValidationError(
166
- `Expected 17 output files but ${missing.length} missing. See list above.`
167
- );
168
- }
169
- console.log("\nAll 17 expected output files verified.");
170
- }
171
-
172
- return 0;
173
- }
174
-
175
- module.exports = {
176
- cmdGenerate,
177
- };
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- function cmdHelp() {
4
- const text = [
5
- "SDTK CLI -- deterministic documentation toolkit",
6
- "",
7
- "Usage:",
8
- " sdtk <command> [options]",
9
- "",
10
- "Commands:",
11
- " init Initialize SDTK workspace (runtime adapter + config)",
12
- " runtime Manage runtime asset installation (install, uninstall, status)",
13
- " auth Manage GitHub authentication and entitlement",
14
- " generate Scaffold feature documentation from templates (17 files)",
15
- "",
16
- "Init options:",
17
- " --runtime <codex|claude> Runtime adapter (default: codex)",
18
- " --runtime-scope <project|user> Install scope (default: project for claude, user for codex)",
19
- " --project-path <path> Target project directory (default: cwd)",
20
- " --force Overwrite existing files",
21
- " --skip-runtime-assets Skip runtime asset installation",
22
- " --skip-skills (deprecated, use --skip-runtime-assets)",
23
- " --verbose Show detailed PowerShell script output",
24
- "",
25
- "Runtime subcommands:",
26
- " sdtk runtime install --runtime <codex|claude> [--scope <project|user>]",
27
- " sdtk runtime uninstall --runtime <codex|claude> [--scope <project|user>] [--all]",
28
- " sdtk runtime status --runtime <codex|claude>",
29
- "",
30
- "Runtime options:",
31
- " --runtime <codex|claude> Target runtime (required)",
32
- " --scope <project|user> Install scope (default: project for claude, user for codex)",
33
- " --project-path <path> Target project directory (default: cwd)",
34
- " --force Overwrite existing skills",
35
- " --all Uninstall all managed skills",
36
- " --verbose Show detailed script output",
37
- "",
38
- "Scope behavior:",
39
- " project Skills are installed inside the repo (Claude only: .claude/skills/)",
40
- " user Skills are installed in the runtime home (~/.claude/skills/ or ~/.codex/skills/)",
41
- " Note: Codex supports user scope only. Project scope is not available for Codex.",
42
- "",
43
- "Auth options:",
44
- " --token <value> Store GitHub PAT",
45
- " --verify Check private repo access",
46
- " --status Show authentication status",
47
- " --logout Clear stored credentials",
48
- "",
49
- "Generate options:",
50
- " --feature-key <KEY> Feature identifier (UPPER_SNAKE_CASE, required)",
51
- " --feature-name \"<text>\" Human-readable feature name (required)",
52
- " --project-path <path> Target project directory (default: cwd)",
53
- " --force Overwrite existing files",
54
- " --validate-only Validate templates without writing files",
55
- " --verbose Show detailed PowerShell script output",
56
- "",
57
- "Generate behavior:",
58
- " The generate command creates 17 scaffold files with TBD placeholders.",
59
- " Scaffolds define document structure for each SDLC phase.",
60
- " Content is filled in by agents or manually (PM -> BA -> ARCH -> DEV -> QA).",
61
- " Output is written to docs/ subdirectories under the project path.",
62
- "",
63
- "Global options:",
64
- " -h, --help Show this help",
65
- " -v, --version Show version",
66
- "",
67
- "Exit codes:",
68
- " 0 Success",
69
- " 1 Validation or user error",
70
- " 2 Dependency error (e.g., PowerShell not found)",
71
- " 3 Integrity error (payload hash mismatch)",
72
- " 4 Unexpected internal error",
73
- "",
74
- "Environment variables:",
75
- " SDTK_ENTITLEMENT_REPO Override default entitlement repo (owner/repo format)",
76
- "",
77
- "Examples:",
78
- " sdtk init --runtime codex",
79
- " sdtk init --runtime claude --project-path ./my-project",
80
- " sdtk auth --token ghp_xxxxxxxxxxxx",
81
- " sdtk auth --verify",
82
- ' sdtk generate --feature-key USER_PROFILE --feature-name "User Profile"',
83
- " sdtk generate --feature-key ORDER_MGMT --feature-name \"Order Management\" --validate-only",
84
- " sdtk init --runtime claude --runtime-scope user",
85
- " sdtk runtime install --runtime claude --scope project",
86
- " sdtk runtime install --runtime codex --scope user",
87
- " sdtk runtime status --runtime claude",
88
- " sdtk runtime uninstall --runtime claude --scope project --all",
89
- "",
90
- " # Override entitlement repo (bash/zsh):",
91
- " export SDTK_ENTITLEMENT_REPO=owner/repo",
92
- " # Override entitlement repo (PowerShell):",
93
- ' $env:SDTK_ENTITLEMENT_REPO="owner/repo"',
94
- ];
95
- console.log(text.join("\n"));
96
- return 0;
97
- }
98
-
99
- module.exports = {
100
- cmdHelp,
101
- };
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- const path = require("path");
4
- const { parseFlags, validateChoice } = require("../lib/args");
5
- const { verify, resolvePayloadFile } = require("../lib/toolkit-payload");
6
- const { runScript } = require("../lib/powershell");
7
- const { ValidationError } = require("../lib/errors");
8
- const { VALID_SCOPES, defaultScope, isProjectScopeSupported } = require("../lib/scope");
9
-
10
- const FLAG_DEFS = {
11
- runtime: { type: "string" },
12
- "project-path": { type: "string" },
13
- "runtime-scope": { type: "string" },
14
- force: { type: "boolean" },
15
- "skip-skills": { type: "boolean" },
16
- "skip-runtime-assets": { type: "boolean" },
17
- verbose: { type: "boolean" },
18
- };
19
-
20
- const VALID_RUNTIMES = ["codex", "claude"];
21
-
22
- async function cmdInit(args) {
23
- const { flags } = parseFlags(args, FLAG_DEFS);
24
-
25
- // Validate runtime
26
- const runtime = flags.runtime || "codex";
27
- validateChoice(runtime, VALID_RUNTIMES, "runtime");
28
-
29
- // Resolve scope
30
- const scope = flags["runtime-scope"] || defaultScope(runtime);
31
- validateChoice(scope, VALID_SCOPES, "runtime-scope");
32
-
33
- // Gate C0: Codex does not support project-local skills
34
- if (scope === "project" && !isProjectScopeSupported(runtime)) {
35
- throw new ValidationError(
36
- "Codex does not support project-local skills. Use --runtime-scope user instead."
37
- );
38
- }
39
-
40
- // Handle deprecated --skip-skills
41
- const skipAssets = flags["skip-runtime-assets"] || flags["skip-skills"];
42
- if (flags["skip-skills"] && !flags["skip-runtime-assets"]) {
43
- console.warn(
44
- "Warning: --skip-skills is deprecated. Use --skip-runtime-assets instead."
45
- );
46
- }
47
-
48
- // Resolve project path
49
- const projectPath = flags["project-path"]
50
- ? path.resolve(flags["project-path"])
51
- : process.cwd();
52
-
53
- // Verify payload integrity before proceeding
54
- verify();
55
-
56
- // Resolve bundled install.ps1
57
- const installScript = resolvePayloadFile("toolkit/install.ps1");
58
-
59
- // Build PowerShell parameters
60
- const params = {
61
- ProjectPath: projectPath,
62
- Runtime: runtime,
63
- Scope: scope,
64
- };
65
- if (flags.force) params.Force = true;
66
- if (skipAssets) params.SkipRuntimeAssets = true;
67
- if (!flags.verbose) params.Quiet = true;
68
-
69
- console.log(`Initializing SDTK workspace...`);
70
- console.log(` Runtime: ${runtime}`);
71
- console.log(` Scope: ${scope}`);
72
- console.log(` Project: ${projectPath}`);
73
- console.log("");
74
-
75
- const result = await runScript(installScript, params, { silent: !flags.verbose });
76
-
77
- if (result.exitCode !== 0) {
78
- if (result.stderr) {
79
- console.error(result.stderr);
80
- }
81
- throw new ValidationError(
82
- `Initialization failed (exit code ${result.exitCode}).`
83
- );
84
- }
85
-
86
- console.log("");
87
- console.log("SDTK workspace initialized successfully.");
88
- console.log("");
89
- console.log("Next steps:");
90
- console.log(" 1. Review and customize sdtk.config.json for your project stack.");
91
- console.log(' 2. Run "sdtk generate --feature-key <KEY> --feature-name <name>" to scaffold docs.');
92
- return 0;
93
- }
94
-
95
- module.exports = {
96
- cmdInit,
97
- };