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
package/src/lib/state.js DELETED
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- const fs = require("fs");
4
- const os = require("os");
5
- const path = require("path");
6
- const { execFileSync } = require("child_process");
7
-
8
- function ensureDir(dirPath) {
9
- fs.mkdirSync(dirPath, { recursive: true });
10
- }
11
-
12
- function getAuthFile() {
13
- return path.join(os.homedir(), ".sdtkrc");
14
- }
15
-
16
- /**
17
- * Harden file permissions so only the current user can read/write.
18
- * - POSIX: chmod 600
19
- * - Windows: icacls to grant only current user Full Control
20
- * @returns {boolean} true if hardening succeeded, false otherwise.
21
- */
22
- function hardenFilePermissions(filePath) {
23
- try {
24
- if (process.platform === "win32") {
25
- const username = os.userInfo().username;
26
- execFileSync("icacls", [
27
- filePath,
28
- "/inheritance:r",
29
- "/grant:r",
30
- `${username}:(F)`,
31
- ], { stdio: "ignore" });
32
- } else {
33
- fs.chmodSync(filePath, 0o600);
34
- }
35
- return true;
36
- } catch (_err) {
37
- return false;
38
- }
39
- }
40
-
41
- function readAuthState() {
42
- const authFile = getAuthFile();
43
- if (!fs.existsSync(authFile)) {
44
- return { authenticated: false, token: "" };
45
- }
46
- try {
47
- const payload = JSON.parse(fs.readFileSync(authFile, "utf8"));
48
- const token = payload.github_token || "";
49
- return { authenticated: token.length > 0, token };
50
- } catch (_error) {
51
- return { authenticated: false, token: "" };
52
- }
53
- }
54
-
55
- /**
56
- * Write auth state and harden file permissions.
57
- * @returns {{ path: string, hardened: boolean }}
58
- */
59
- function writeAuthState(token) {
60
- const authFile = getAuthFile();
61
- const payload = {
62
- github_token: token,
63
- updated_at: new Date().toISOString(),
64
- };
65
- fs.writeFileSync(authFile, JSON.stringify(payload, null, 2), "utf8");
66
- const hardened = hardenFilePermissions(authFile);
67
- return { path: authFile, hardened };
68
- }
69
-
70
- function clearAuthState() {
71
- const authFile = getAuthFile();
72
- if (fs.existsSync(authFile)) {
73
- fs.unlinkSync(authFile);
74
- }
75
- }
76
-
77
- module.exports = {
78
- ensureDir,
79
- getAuthFile,
80
- readAuthState,
81
- writeAuthState,
82
- clearAuthState,
83
- };
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const crypto = require("crypto");
6
- const { IntegrityError } = require("./errors");
7
-
8
- const PACKAGE_ROOT = path.resolve(__dirname, "..", "..");
9
- const ASSETS_DIR = path.join(PACKAGE_ROOT, "assets", "toolkit");
10
- const MANIFEST_PATH = path.join(
11
- PACKAGE_ROOT,
12
- "assets",
13
- "manifest",
14
- "toolkit-bundle.manifest.json"
15
- );
16
-
17
- /**
18
- * Load and parse the toolkit bundle manifest.
19
- * @returns {Object} Parsed manifest object.
20
- */
21
- function loadManifest() {
22
- if (!fs.existsSync(MANIFEST_PATH)) {
23
- throw new IntegrityError(
24
- `Toolkit manifest not found: ${MANIFEST_PATH}\n` +
25
- 'Run "npm run build:payload" to sync toolkit assets.'
26
- );
27
- }
28
- try {
29
- const raw = fs.readFileSync(MANIFEST_PATH, "utf-8");
30
- return JSON.parse(raw);
31
- } catch (err) {
32
- throw new IntegrityError(`Failed to parse manifest: ${err.message}`);
33
- }
34
- }
35
-
36
- /**
37
- * Compute SHA256 hash of a file.
38
- * @param {string} filePath
39
- * @returns {string} Lowercase hex hash.
40
- */
41
- function hashFile(filePath) {
42
- const data = fs.readFileSync(filePath);
43
- return crypto.createHash("sha256").update(data).digest("hex");
44
- }
45
-
46
- /**
47
- * Verify payload integrity against manifest.
48
- * Checks all files exist and SHA256 hashes match.
49
- * @throws {IntegrityError} on mismatch or missing file.
50
- */
51
- function verify() {
52
- const manifest = loadManifest();
53
-
54
- if (!manifest.files || !Array.isArray(manifest.files)) {
55
- throw new IntegrityError("Manifest has no files array.");
56
- }
57
-
58
- const errors = [];
59
-
60
- for (const entry of manifest.files) {
61
- const filePath = path.join(ASSETS_DIR, entry.path);
62
-
63
- if (!fs.existsSync(filePath)) {
64
- errors.push(`MISSING: ${entry.path}`);
65
- continue;
66
- }
67
-
68
- const actualHash = hashFile(filePath);
69
- if (actualHash !== entry.sha256) {
70
- errors.push(
71
- `HASH MISMATCH: ${entry.path}\n` +
72
- ` expected: ${entry.sha256}\n` +
73
- ` actual: ${actualHash}`
74
- );
75
- }
76
- }
77
-
78
- if (errors.length > 0) {
79
- throw new IntegrityError(
80
- `Toolkit payload integrity check failed:\n${errors.join("\n")}`
81
- );
82
- }
83
- }
84
-
85
- /**
86
- * Resolve absolute path to a file inside the bundled toolkit payload.
87
- * @param {string} relativePath - Path relative to assets/toolkit/ (e.g., "toolkit/install.ps1").
88
- * @returns {string} Absolute path.
89
- */
90
- function resolvePayloadFile(relativePath) {
91
- return path.join(ASSETS_DIR, relativePath);
92
- }
93
-
94
- module.exports = {
95
- verify,
96
- loadManifest,
97
- resolvePayloadFile,
98
- ASSETS_DIR,
99
- };