strikethroo 3.14.2 → 3.15.0

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 (74) hide show
  1. package/README.md +15 -6
  2. package/dist/__tests__/fixtures/review-gate.d.ts +59 -0
  3. package/dist/__tests__/fixtures/review-gate.d.ts.map +1 -0
  4. package/dist/__tests__/fixtures/review-gate.js +150 -0
  5. package/dist/__tests__/fixtures/review-gate.js.map +1 -0
  6. package/dist-web/assets/{arc-3h4SrJcP.js → arc-DXuQKY5O.js} +1 -1
  7. package/dist-web/assets/{architectureDiagram-3BPJPVTR-CHXVDgZv.js → architectureDiagram-3BPJPVTR-DaQd1Ie5.js} +1 -1
  8. package/dist-web/assets/{blockDiagram-GPEHLZMM-ByT2aIDh.js → blockDiagram-GPEHLZMM-BTAxxxkx.js} +1 -1
  9. package/dist-web/assets/{c4Diagram-AAUBKEIU-BpSMEH5T.js → c4Diagram-AAUBKEIU-DHuDwl7F.js} +1 -1
  10. package/dist-web/assets/channel-CKed0YrQ.js +1 -0
  11. package/dist-web/assets/{chunk-2J33WTMH-B00rt2rz.js → chunk-2J33WTMH-BD4uHGPG.js} +1 -1
  12. package/dist-web/assets/{chunk-4BX2VUAB-CUD0iXK7.js → chunk-4BX2VUAB-BqVSB0Q4.js} +1 -1
  13. package/dist-web/assets/{chunk-55IACEB6-KUROX5a_.js → chunk-55IACEB6-F-aB1oSz.js} +1 -1
  14. package/dist-web/assets/{chunk-727SXJPM-DdA9k_le.js → chunk-727SXJPM-iIr2R3ax.js} +1 -1
  15. package/dist-web/assets/{chunk-AQP2D5EJ-B4lS13Tr.js → chunk-AQP2D5EJ-UpIWfDiq.js} +1 -1
  16. package/dist-web/assets/{chunk-FMBD7UC4-C6DHs6Wv.js → chunk-FMBD7UC4-DeG5uTRD.js} +1 -1
  17. package/dist-web/assets/{chunk-ND2GUHAM-Nia1N7VP.js → chunk-ND2GUHAM-Tkl5amOh.js} +1 -1
  18. package/dist-web/assets/{chunk-QZHKN3VN-BKYt-ImO.js → chunk-QZHKN3VN-B3Af5I7v.js} +1 -1
  19. package/dist-web/assets/classDiagram-4FO5ZUOK-CD2fBLcy.js +1 -0
  20. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CD2fBLcy.js +1 -0
  21. package/dist-web/assets/{cose-bilkent-S5V4N54A-uxuOqDzC.js → cose-bilkent-S5V4N54A-uuts3r-t.js} +1 -1
  22. package/dist-web/assets/{dagre-BM42HDAG-CUr1pLbj.js → dagre-BM42HDAG-CHrjnY3X.js} +1 -1
  23. package/dist-web/assets/{diagram-2AECGRRQ-BCeBLzM-.js → diagram-2AECGRRQ-BjEnf2q8.js} +1 -1
  24. package/dist-web/assets/{diagram-5GNKFQAL-DuM6xmJY.js → diagram-5GNKFQAL-BzvzvRAO.js} +1 -1
  25. package/dist-web/assets/{diagram-KO2AKTUF-Cf1eoQYh.js → diagram-KO2AKTUF-DNx6lZaA.js} +1 -1
  26. package/dist-web/assets/{diagram-LMA3HP47-Buo60yAm.js → diagram-LMA3HP47-BQUKKiM4.js} +1 -1
  27. package/dist-web/assets/{diagram-OG6HWLK6-D54wh40p.js → diagram-OG6HWLK6-MgImJXDh.js} +1 -1
  28. package/dist-web/assets/{erDiagram-TEJ5UH35-59J8tJG_.js → erDiagram-TEJ5UH35-D79fXG1m.js} +1 -1
  29. package/dist-web/assets/{flowDiagram-I6XJVG4X-DfDuK7uP.js → flowDiagram-I6XJVG4X-DQDtqM9F.js} +1 -1
  30. package/dist-web/assets/{ganttDiagram-6RSMTGT7-CbA5p8Mi.js → ganttDiagram-6RSMTGT7-rbAdz41p.js} +1 -1
  31. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-1WxXLmxX.js → gitGraphDiagram-PVQCEYII-C-ppoVQN.js} +1 -1
  32. package/dist-web/assets/{index-Cao1t6Aj.js → index-BpEA2dcR.js} +1 -1
  33. package/dist-web/assets/{index-DHgmc9MH.js → index-COfqZ5qw.js} +4 -4
  34. package/dist-web/assets/{index-CyyNP5mv.js → index-D8Y-LZu5.js} +1 -1
  35. package/dist-web/assets/{infoDiagram-5YYISTIA-C5SUQ2SF.js → infoDiagram-5YYISTIA-DVx4rmpa.js} +1 -1
  36. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-dU3aWKbh.js → ishikawaDiagram-YF4QCWOH-Bwo2Fe41.js} +1 -1
  37. package/dist-web/assets/{journeyDiagram-JHISSGLW-CMDkGbgV.js → journeyDiagram-JHISSGLW-Cpk1cbVU.js} +1 -1
  38. package/dist-web/assets/{kanban-definition-UN3LZRKU-mD1rJCc5.js → kanban-definition-UN3LZRKU-DT5hIyrL.js} +1 -1
  39. package/dist-web/assets/{linear-CUGnyMnk.js → linear-BHILOJgo.js} +1 -1
  40. package/dist-web/assets/{mermaid.core-Cpmiqmbf.js → mermaid.core-BYlMWjDD.js} +4 -4
  41. package/dist-web/assets/{mindmap-definition-RKZ34NQL-CDfl1B-m.js → mindmap-definition-RKZ34NQL-CjhPuIMr.js} +1 -1
  42. package/dist-web/assets/{pieDiagram-4H26LBE5-Cuo3mXQK.js → pieDiagram-4H26LBE5-BzD5r6aw.js} +1 -1
  43. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DnFnsvpl.js → quadrantDiagram-W4KKPZXB-ieE6W8Lz.js} +1 -1
  44. package/dist-web/assets/{requirementDiagram-4Y6WPE33-DCIMxgro.js → requirementDiagram-4Y6WPE33-B6Z6Nlwn.js} +1 -1
  45. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DfxERVIc.js → sankeyDiagram-5OEKKPKP-BAz2Fhdr.js} +1 -1
  46. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-vKVzidDz.js → sequenceDiagram-3UESZ5HK-Dce-js6I.js} +1 -1
  47. package/dist-web/assets/{stateDiagram-AJRCARHV-OMYutbra.js → stateDiagram-AJRCARHV-DGx4tUMu.js} +1 -1
  48. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-kMJLTVIN.js +1 -0
  49. package/dist-web/assets/{timeline-definition-PNZ67QCA-Ca2z9OPS.js → timeline-definition-PNZ67QCA-B8KWHkBS.js} +1 -1
  50. package/dist-web/assets/{vennDiagram-CIIHVFJN-DBrJv-N8.js → vennDiagram-CIIHVFJN-ByWUGcRD.js} +1 -1
  51. package/dist-web/assets/{wardley-L42UT6IY-C80ot0sX.js → wardley-L42UT6IY-C1B0dt0L.js} +1 -1
  52. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CzvhVwCG.js → wardleyDiagram-YWT4CUSO-BrCqwemc.js} +1 -1
  53. package/dist-web/assets/{xychartDiagram-2RQKCTM6-DFrhJySN.js → xychartDiagram-2RQKCTM6-Br_yjZmA.js} +1 -1
  54. package/dist-web/index.html +1 -1
  55. package/package.json +1 -1
  56. package/templates/harness/skills/st-code-review/SKILL.md +309 -0
  57. package/templates/harness/skills/st-code-review/scripts/code-review.cjs +1539 -0
  58. package/templates/harness/skills/st-code-review/scripts/find-strikethroo-root.cjs +116 -0
  59. package/templates/harness/skills/st-code-review/scripts/validate-plan-blueprint.cjs +429 -0
  60. package/templates/harness/skills/st-execute-blueprint/SKILL.md +49 -2
  61. package/templates/harness/skills/st-execute-blueprint/scripts/capture-base-commit.cjs +325 -0
  62. package/templates/harness/skills/st-execute-blueprint/scripts/create-feature-branch.cjs +9 -7
  63. package/templates/harness/skills/st-execute-blueprint/scripts/dispatch-task-execution.cjs +46 -26
  64. package/templates/harness/skills/st-execute-task/scripts/dispatch-task-execution.cjs +46 -26
  65. package/templates/harness/skills/st-full-workflow/SKILL.md +49 -2
  66. package/templates/harness/skills/st-full-workflow/scripts/capture-base-commit.cjs +325 -0
  67. package/templates/harness/skills/st-full-workflow/scripts/create-feature-branch.cjs +9 -7
  68. package/templates/harness/skills/st-full-workflow/scripts/dispatch-task-execution.cjs +46 -26
  69. package/templates/strikethroo/config/hooks/CODE_REVIEW.md +60 -0
  70. package/templates/strikethroo/config/schemas/self-review-v2.xsd +437 -0
  71. package/dist-web/assets/channel-DVGz7-Ij.js +0 -1
  72. package/dist-web/assets/classDiagram-4FO5ZUOK-BuW_hD8R.js +0 -1
  73. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BuW_hD8R.js +0 -1
  74. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-2bqmqQl-.js +0 -1
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/skill-scripts/find-strikethroo-root.ts
31
+ var find_strikethroo_root_exports = {};
32
+ __export(find_strikethroo_root_exports, {
33
+ main: () => main
34
+ });
35
+ module.exports = __toCommonJS(find_strikethroo_root_exports);
36
+
37
+ // src/skill-scripts/shared/root.ts
38
+ var fs = __toESM(require("fs"));
39
+ var path = __toESM(require("path"));
40
+ var EXPECTED_SCHEMA = true ? 4 : 4;
41
+ var isValidStrikethrooRoot = (strikethrooPath) => {
42
+ try {
43
+ if (!fs.existsSync(strikethrooPath)) return false;
44
+ if (!fs.lstatSync(strikethrooPath).isDirectory()) return false;
45
+ const metadataPath = path.join(strikethrooPath, ".init-metadata.json");
46
+ if (!fs.existsSync(metadataPath)) return false;
47
+ const metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
48
+ return metadata && typeof metadata === "object" && "version" in metadata;
49
+ } catch (_err) {
50
+ return false;
51
+ }
52
+ };
53
+ var getStrikethrooAt = (directory) => {
54
+ const strikethrooPath = path.join(directory, ".ai", "strikethroo");
55
+ return isValidStrikethrooRoot(strikethrooPath) ? strikethrooPath : null;
56
+ };
57
+ var getParentPaths = (currentPath, acc = []) => {
58
+ const absolutePath = path.resolve(currentPath);
59
+ const nextAcc = [...acc, absolutePath];
60
+ const parentPath = path.dirname(absolutePath);
61
+ if (parentPath === absolutePath) return nextAcc;
62
+ return getParentPaths(parentPath, nextAcc);
63
+ };
64
+ var checkWorkspaceSchema = (metadataPath) => {
65
+ let metadata;
66
+ try {
67
+ metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
68
+ } catch {
69
+ return;
70
+ }
71
+ const actual = typeof metadata.workspaceSchemaVersion === "number" ? metadata.workspaceSchemaVersion : 1;
72
+ if (actual === EXPECTED_SCHEMA) return;
73
+ if (actual < EXPECTED_SCHEMA) {
74
+ process.stderr.write(
75
+ `Workspace schema v${actual} is older than this skill requires (v${EXPECTED_SCHEMA}). Re-run \`npx strikethroo init\` with the latest CLI to update.
76
+ `
77
+ );
78
+ } else {
79
+ process.stderr.write(
80
+ `This skill (built for workspace schema v${EXPECTED_SCHEMA}) is older than the workspace (v${actual}). Re-run \`npx skills add e0ipso/strikethroo\` to update skills.
81
+ `
82
+ );
83
+ }
84
+ process.exit(1);
85
+ };
86
+ var findStrikethrooRoot = (startPath = process.cwd()) => {
87
+ const paths = getParentPaths(startPath);
88
+ const found = paths.find((p) => getStrikethrooAt(p));
89
+ if (!found) return null;
90
+ const root = getStrikethrooAt(found);
91
+ if (root) checkWorkspaceSchema(path.join(root, ".init-metadata.json"));
92
+ return root;
93
+ };
94
+
95
+ // src/skill-scripts/find-strikethroo-root.ts
96
+ var main = () => {
97
+ const startPath = process.argv[2] || process.cwd();
98
+ const root = findStrikethrooRoot(startPath);
99
+ if (!root) {
100
+ process.stderr.write(
101
+ `Could not find .ai/strikethroo root from ${startPath} or any parent directory.
102
+ `
103
+ );
104
+ process.exit(1);
105
+ }
106
+ process.stdout.write(`${root}
107
+ `);
108
+ process.exit(0);
109
+ };
110
+ if (require.main === module) {
111
+ main();
112
+ }
113
+ // Annotate the CommonJS export names for ESM import in node:
114
+ 0 && (module.exports = {
115
+ main
116
+ });
@@ -0,0 +1,429 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/skill-scripts/validate-plan-blueprint.ts
31
+ var validate_plan_blueprint_exports = {};
32
+ __export(validate_plan_blueprint_exports, {
33
+ main: () => main
34
+ });
35
+ module.exports = __toCommonJS(validate_plan_blueprint_exports);
36
+
37
+ // src/skill-scripts/shared/root.ts
38
+ var fs = __toESM(require("fs"));
39
+ var path = __toESM(require("path"));
40
+ var EXPECTED_SCHEMA = true ? 4 : 4;
41
+ var isValidStrikethrooRoot = (strikethrooPath) => {
42
+ try {
43
+ if (!fs.existsSync(strikethrooPath)) return false;
44
+ if (!fs.lstatSync(strikethrooPath).isDirectory()) return false;
45
+ const metadataPath = path.join(strikethrooPath, ".init-metadata.json");
46
+ if (!fs.existsSync(metadataPath)) return false;
47
+ const metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
48
+ return metadata && typeof metadata === "object" && "version" in metadata;
49
+ } catch (_err) {
50
+ return false;
51
+ }
52
+ };
53
+ var getStrikethrooAt = (directory) => {
54
+ const strikethrooPath = path.join(directory, ".ai", "strikethroo");
55
+ return isValidStrikethrooRoot(strikethrooPath) ? strikethrooPath : null;
56
+ };
57
+ var getParentPaths = (currentPath, acc = []) => {
58
+ const absolutePath = path.resolve(currentPath);
59
+ const nextAcc = [...acc, absolutePath];
60
+ const parentPath = path.dirname(absolutePath);
61
+ if (parentPath === absolutePath) return nextAcc;
62
+ return getParentPaths(parentPath, nextAcc);
63
+ };
64
+ var checkWorkspaceSchema = (metadataPath) => {
65
+ let metadata;
66
+ try {
67
+ metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
68
+ } catch {
69
+ return;
70
+ }
71
+ const actual = typeof metadata.workspaceSchemaVersion === "number" ? metadata.workspaceSchemaVersion : 1;
72
+ if (actual === EXPECTED_SCHEMA) return;
73
+ if (actual < EXPECTED_SCHEMA) {
74
+ process.stderr.write(
75
+ `Workspace schema v${actual} is older than this skill requires (v${EXPECTED_SCHEMA}). Re-run \`npx strikethroo init\` with the latest CLI to update.
76
+ `
77
+ );
78
+ } else {
79
+ process.stderr.write(
80
+ `This skill (built for workspace schema v${EXPECTED_SCHEMA}) is older than the workspace (v${actual}). Re-run \`npx skills add e0ipso/strikethroo\` to update skills.
81
+ `
82
+ );
83
+ }
84
+ process.exit(1);
85
+ };
86
+ var findStrikethrooRoot = (startPath = process.cwd()) => {
87
+ const paths = getParentPaths(startPath);
88
+ const found = paths.find((p) => getStrikethrooAt(p));
89
+ if (!found) return null;
90
+ const root = getStrikethrooAt(found);
91
+ if (root) checkWorkspaceSchema(path.join(root, ".init-metadata.json"));
92
+ return root;
93
+ };
94
+
95
+ // src/skill-scripts/shared/plan-scan.ts
96
+ var fs2 = __toESM(require("fs"));
97
+ var path2 = __toESM(require("path"));
98
+
99
+ // src/skill-scripts/shared/frontmatter.ts
100
+ var ID_PATTERNS = [
101
+ /^\s*["']?id["']?\s*:\s*["']?([+-]?\d+)["']?\s*(?:#.*)?$/im,
102
+ /^\s*id\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
103
+ /^\s*["']?id["']?\s*:\s*"([+-]?\d+)"\s*(?:#.*)?$/im,
104
+ /^\s*["']?id["']?\s*:\s*'([+-]?\d+)'\s*(?:#.*)?$/im,
105
+ /^\s*["']id["']\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
106
+ /^\s*id\s*:\s*[|>]\s*([+-]?\d+)\s*$/im
107
+ ];
108
+ var validateId = (rawId) => {
109
+ const id = parseInt(rawId, 10);
110
+ if (Number.isNaN(id) || id < 0 || id > Number.MAX_SAFE_INTEGER) return null;
111
+ return id;
112
+ };
113
+ var extractIdFromMarkdown = (content) => {
114
+ const frontmatterMatch = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---/);
115
+ if (!frontmatterMatch || !frontmatterMatch[1]) return null;
116
+ const block = frontmatterMatch[1];
117
+ for (const pattern of ID_PATTERNS) {
118
+ const match = block.match(pattern);
119
+ if (match && match[1]) {
120
+ const id = validateId(match[1]);
121
+ if (id !== null) return id;
122
+ }
123
+ }
124
+ return null;
125
+ };
126
+ var extractPlanId = (content, _filePath) => {
127
+ return extractIdFromMarkdown(content);
128
+ };
129
+
130
+ // src/skill-scripts/shared/plan-scan.ts
131
+ var PLAN_EXTENSIONS = [".md"];
132
+ var scanPlanDir = (planDirPath, dirName, isArchive) => {
133
+ let entries;
134
+ try {
135
+ entries = fs2.readdirSync(planDirPath, { withFileTypes: true });
136
+ } catch (_err) {
137
+ return [];
138
+ }
139
+ return entries.filter((e) => e.isFile() && PLAN_EXTENSIONS.some((ext) => e.name.endsWith(ext))).flatMap((e) => {
140
+ const filePath = path2.join(planDirPath, e.name);
141
+ try {
142
+ const content = fs2.readFileSync(filePath, "utf8");
143
+ const id = extractPlanId(content, filePath);
144
+ if (id === null) return [];
145
+ return [{ id, file: filePath, dir: planDirPath, isArchive, name: dirName }];
146
+ } catch (_err) {
147
+ return [];
148
+ }
149
+ });
150
+ };
151
+ var getAllPlans = (taskManagerRoot) => {
152
+ const sources = [
153
+ { dir: path2.join(taskManagerRoot, "plans"), isArchive: false },
154
+ { dir: path2.join(taskManagerRoot, "archive"), isArchive: true }
155
+ ];
156
+ return sources.flatMap(({ dir, isArchive }) => {
157
+ if (!fs2.existsSync(dir)) return [];
158
+ let entries;
159
+ try {
160
+ entries = fs2.readdirSync(dir, { withFileTypes: true });
161
+ } catch (_err) {
162
+ return [];
163
+ }
164
+ return entries.filter((e) => e.isDirectory()).flatMap((e) => scanPlanDir(path2.join(dir, e.name), e.name, isArchive));
165
+ });
166
+ };
167
+
168
+ // src/skill-scripts/shared/plan-resolve.ts
169
+ var fs3 = __toESM(require("fs"));
170
+ var path3 = __toESM(require("path"));
171
+ var isValidRootDir = (strikethrooPath) => {
172
+ try {
173
+ if (!fs3.existsSync(strikethrooPath)) return false;
174
+ if (!fs3.lstatSync(strikethrooPath).isDirectory()) return false;
175
+ const metadataPath = path3.join(strikethrooPath, ".init-metadata.json");
176
+ if (!fs3.existsSync(metadataPath)) return false;
177
+ const metadata = JSON.parse(fs3.readFileSync(metadataPath, "utf8"));
178
+ return metadata && typeof metadata === "object" && "version" in metadata;
179
+ } catch (_err) {
180
+ return false;
181
+ }
182
+ };
183
+ var checkStandardRootShortcut = (filePath) => {
184
+ const planDir = path3.dirname(filePath);
185
+ const parentDir = path3.dirname(planDir);
186
+ const possibleRoot = path3.dirname(parentDir);
187
+ const parentBase = path3.basename(parentDir);
188
+ if (parentBase !== "plans" && parentBase !== "archive") return null;
189
+ if (path3.basename(possibleRoot) !== "strikethroo") return null;
190
+ const dotAiDir = path3.dirname(possibleRoot);
191
+ if (path3.basename(dotAiDir) !== ".ai") return null;
192
+ return isValidRootDir(possibleRoot) ? possibleRoot : null;
193
+ };
194
+ var resolveByPath = (absolutePath) => {
195
+ let content;
196
+ try {
197
+ content = fs3.readFileSync(absolutePath, "utf8");
198
+ } catch (_err) {
199
+ return null;
200
+ }
201
+ const planId = extractPlanId(content, absolutePath);
202
+ if (planId === null) return null;
203
+ const tmRoot = checkStandardRootShortcut(absolutePath) || findStrikethrooRoot(path3.dirname(absolutePath));
204
+ if (!tmRoot) return null;
205
+ return {
206
+ planFile: absolutePath,
207
+ planDir: path3.dirname(absolutePath),
208
+ strikethrooRoot: tmRoot,
209
+ planId
210
+ };
211
+ };
212
+ var resolveByIdInAncestry = (planId, startPath, searched = /* @__PURE__ */ new Set()) => {
213
+ const tmRoot = findStrikethrooRoot(startPath);
214
+ if (!tmRoot) return null;
215
+ const normalized = path3.normalize(tmRoot);
216
+ if (searched.has(normalized)) return null;
217
+ searched.add(normalized);
218
+ const plans = getAllPlans(tmRoot);
219
+ const match = plans.find((p) => p.id === planId);
220
+ if (match) {
221
+ return {
222
+ planFile: match.file,
223
+ planDir: match.dir,
224
+ strikethrooRoot: tmRoot,
225
+ planId
226
+ };
227
+ }
228
+ const parentOfRoot = path3.dirname(path3.dirname(tmRoot));
229
+ if (parentOfRoot === tmRoot) return null;
230
+ return resolveByIdInAncestry(planId, parentOfRoot, searched);
231
+ };
232
+ var resolvePlan = (input, startPath = process.cwd()) => {
233
+ if (input === null || input === void 0 || input === "") return null;
234
+ const inputStr = String(input);
235
+ if (inputStr.startsWith("/")) {
236
+ return resolveByPath(inputStr);
237
+ }
238
+ const planId = parseInt(inputStr, 10);
239
+ if (Number.isNaN(planId)) return null;
240
+ return resolveByIdInAncestry(planId, startPath);
241
+ };
242
+
243
+ // src/skill-scripts/shared/blueprint-detection.ts
244
+ var fs4 = __toESM(require("fs"));
245
+ var hasExecutionBlueprint = (planFile) => {
246
+ try {
247
+ const content = fs4.readFileSync(planFile, "utf8");
248
+ return /^## Execution Blueprint/m.test(content);
249
+ } catch (_err) {
250
+ return false;
251
+ }
252
+ };
253
+
254
+ // src/skill-scripts/shared/task-count.ts
255
+ var fs5 = __toESM(require("fs"));
256
+ var path4 = __toESM(require("path"));
257
+ var countTaskFiles = (planDir) => {
258
+ const tasksDir = path4.join(planDir, "tasks");
259
+ if (!fs5.existsSync(tasksDir)) return 0;
260
+ try {
261
+ const stat = fs5.lstatSync(tasksDir);
262
+ if (!stat.isDirectory()) return 0;
263
+ return fs5.readdirSync(tasksDir).filter((f) => f.endsWith(".md")).length;
264
+ } catch (_err) {
265
+ return 0;
266
+ }
267
+ };
268
+
269
+ // src/skill-scripts/shared/task-complexity.ts
270
+ var fs6 = __toESM(require("fs"));
271
+ var path5 = __toESM(require("path"));
272
+
273
+ // src/skill-scripts/shared/complexity-score.ts
274
+ var validateComplexityScore = (value) => {
275
+ const trimmed = value.trim();
276
+ if (!/^\d+$/.test(trimmed)) {
277
+ return { valid: false, reason: "non-integer" };
278
+ }
279
+ const parsed = Number.parseInt(trimmed, 10);
280
+ if (parsed < 1 || parsed > 10) {
281
+ return { valid: false, reason: "out-of-range", value: parsed };
282
+ }
283
+ return { valid: true, value: parsed };
284
+ };
285
+
286
+ // src/skill-scripts/shared/task-file.ts
287
+ var extractFrontmatter = (content) => {
288
+ const match = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---/);
289
+ return match && match[1] ? match[1] : null;
290
+ };
291
+
292
+ // src/skill-scripts/shared/task-complexity.ts
293
+ var validateTaskComplexityScores = (planDir) => {
294
+ const tasksDir = path5.join(planDir, "tasks");
295
+ if (!fs6.existsSync(tasksDir)) return [];
296
+ let files;
297
+ try {
298
+ if (!fs6.lstatSync(tasksDir).isDirectory()) return [];
299
+ files = fs6.readdirSync(tasksDir).filter((f) => f.endsWith(".md")).sort();
300
+ } catch (_err) {
301
+ return [];
302
+ }
303
+ const invalid = [];
304
+ for (const file of files) {
305
+ let content;
306
+ try {
307
+ content = fs6.readFileSync(path5.join(tasksDir, file), "utf8");
308
+ } catch (_err) {
309
+ invalid.push(`${file}: unreadable`);
310
+ continue;
311
+ }
312
+ const frontmatter = extractFrontmatter(content);
313
+ const match = frontmatter ? frontmatter.match(/^\s*complexity_score\s*:\s*(.*?)\s*(?:#.*)?$/im) : null;
314
+ if (!match || match[1] === void 0) {
315
+ invalid.push(`${file}: missing complexity_score`);
316
+ continue;
317
+ }
318
+ const raw = match[1].trim();
319
+ const result = validateComplexityScore(raw);
320
+ if (result.valid) continue;
321
+ if (result.reason === "non-integer") {
322
+ invalid.push(`${file}: non-integer complexity_score "${raw}"`);
323
+ continue;
324
+ }
325
+ invalid.push(`${file}: complexity_score ${result.value} out of range 1-10`);
326
+ }
327
+ return invalid;
328
+ };
329
+
330
+ // src/skill-scripts/validate-plan-blueprint.ts
331
+ var VALID_FIELDS = [
332
+ "planFile",
333
+ "planDir",
334
+ "taskCount",
335
+ "blueprintExists",
336
+ "strikethrooRoot",
337
+ "planId",
338
+ "complexityScoresValid",
339
+ "invalidComplexityTasks"
340
+ ];
341
+ var usage = () => {
342
+ const lines = [
343
+ "Plan ID or absolute path is required",
344
+ "",
345
+ "Usage: node validate-plan-blueprint.cjs <plan-id-or-path> [field-name]",
346
+ "",
347
+ "Examples:",
348
+ " node validate-plan-blueprint.cjs 47",
349
+ " node validate-plan-blueprint.cjs /path/to/plan.md",
350
+ " node validate-plan-blueprint.cjs 47 planFile",
351
+ " node validate-plan-blueprint.cjs 47 blueprintExists"
352
+ ];
353
+ lines.forEach((l) => process.stderr.write(`[ERROR] ${l}
354
+ `));
355
+ };
356
+ var listAvailablePlans = (startPath) => {
357
+ const tmRoot = findStrikethrooRoot(startPath);
358
+ if (!tmRoot) return [];
359
+ const plans = getAllPlans(tmRoot);
360
+ return plans.map((p) => p.name).sort((a, b) => {
361
+ const aMatch = a.match(/^(\d+)--/);
362
+ const bMatch = b.match(/^(\d+)--/);
363
+ if (!aMatch || !bMatch || !aMatch[1] || !bMatch[1]) return 0;
364
+ return parseInt(aMatch[1], 10) - parseInt(bMatch[1], 10);
365
+ });
366
+ };
367
+ var main = () => {
368
+ const inputId = process.argv[2];
369
+ const fieldName = process.argv[3];
370
+ if (!inputId) {
371
+ usage();
372
+ process.exit(1);
373
+ }
374
+ const numericInput = parseInt(inputId, 10);
375
+ const isNumeric = !Number.isNaN(numericInput);
376
+ const isAbsolutePath = inputId.startsWith("/");
377
+ if (!isNumeric && !isAbsolutePath) {
378
+ process.stderr.write(`[ERROR] Invalid plan ID: "${inputId}" is not a valid number
379
+ `);
380
+ process.exit(1);
381
+ }
382
+ const resolved = resolvePlan(inputId);
383
+ if (!resolved) {
384
+ process.stderr.write(`[ERROR] Plan ID ${inputId} not found or invalid
385
+ `);
386
+ process.stderr.write("[ERROR] \n");
387
+ const available = listAvailablePlans(process.cwd());
388
+ if (available.length > 0) {
389
+ process.stderr.write("[ERROR] Available plans:\n");
390
+ available.forEach((name) => process.stderr.write(`[ERROR] ${name}
391
+ `));
392
+ }
393
+ process.exit(1);
394
+ }
395
+ const invalidComplexity = validateTaskComplexityScores(resolved.planDir);
396
+ const result = {
397
+ planFile: resolved.planFile,
398
+ planDir: resolved.planDir,
399
+ strikethrooRoot: resolved.strikethrooRoot,
400
+ planId: resolved.planId,
401
+ taskCount: countTaskFiles(resolved.planDir),
402
+ blueprintExists: hasExecutionBlueprint(resolved.planFile) ? "yes" : "no",
403
+ complexityScoresValid: invalidComplexity.length === 0 ? "yes" : "no",
404
+ invalidComplexityTasks: invalidComplexity.join("; ")
405
+ };
406
+ if (fieldName) {
407
+ if (!VALID_FIELDS.includes(fieldName)) {
408
+ process.stderr.write(`[ERROR] Invalid field name: ${fieldName}
409
+ `);
410
+ process.stderr.write(`[ERROR] Valid fields: ${VALID_FIELDS.join(", ")}
411
+ `);
412
+ process.exit(1);
413
+ }
414
+ const value = result[fieldName];
415
+ process.stdout.write(`${String(value)}
416
+ `);
417
+ } else {
418
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
419
+ `);
420
+ }
421
+ process.exit(0);
422
+ };
423
+ if (require.main === module) {
424
+ main();
425
+ }
426
+ // Annotate the CommonJS export names for ESM import in node:
427
+ 0 && (module.exports = {
428
+ main
429
+ });
@@ -64,7 +64,9 @@ If generation still leaves the plan without tasks or a blueprint, stop and repor
64
64
 
65
65
  ### 5. Optionally create a feature branch
66
66
 
67
- Run `scripts/create-feature-branch.cjs <plan-id>` once before phase execution. Branch creation is best-effort: when the script reports that it skipped creation (for example, not on `main`/`master`), continue on the current branch and do not retry or create a branch manually. When the script exits with an error (for example, uncommitted changes on `main`/`master`), halt and report the error. Do not treat a skipped branch as a failure or spend effort working around a skip.
67
+ Run `scripts/create-feature-branch.cjs <plan-id>` once before phase execution. Branch creation is best-effort: when the script reports that it skipped creation (for example, not on `main`/`master`), continue on the current branch and do not retry or create a branch manually. Uncommitted or untracked changes are permitted only when every change is inside the repository-root `.ai/strikethroo` subtree, so a newly generated plan and tasks can remain uncommitted before execution. When the script exits with an error—including changes anywhere outside that subtree or an inability to inspect Git status on `main`/`master`—halt and report the error. Do not treat a skipped branch as a failure or spend effort working around a skip.
68
+
69
+ After the branch step, run `scripts/capture-base-commit.cjs <plan-id>` once. It records the commit the review gate diffs against. A `skipped` result is not a failure — continue execution and note that the review gate will skip. Only an `error` result halts.
68
70
 
69
71
  ### 6. Load project context and execution blueprint
70
72
 
@@ -162,6 +164,51 @@ Read `<root>/config/hooks/POST_EXECUTION.md` and execute its instructions. If va
162
164
 
163
165
  Before declaring execution complete, apply the evidence gate in `<root>/config/shared/verification-gate.md` to the plan's Success Criteria and Self Validation steps.
164
166
 
167
+ #### Run the code review gate
168
+
169
+ After `POST_EXECUTION.md` reports green and before appending the execution summary, follow the `st-code-review` skill and run one review round with its bundled mechanism:
170
+
171
+ ```text
172
+ code-review.cjs <plan-id> <current-harness> <round>
173
+ ```
174
+
175
+ `code-review.cjs` ships with the `st-code-review` skill and lives in that skill's own `scripts` directory, a sibling of this one. Resolve it there; it is not bundled with this skill. If the `st-code-review` skill is not installed on this harness, record that as the review outcome in the execution summary and continue to the summary and archival.
176
+
177
+ `<current-harness>` is the exact supported harness identifier running this skill. `<round>` is `1` on the first invocation, and thereafter the exact `decision.nextRound` the previous round returned. The command emits exactly one JSON line on stdout. Read its `kind`, then — when `kind` is `reviewed` — its `decision.kind`, and do exactly what the matching row states.
178
+
179
+ | Result | What you do |
180
+ | --- | --- |
181
+ | `skipped` | The gate is disabled or unconfigured. Record `reason` and `detail` verbatim in the execution summary, then continue to the summary and archival. A skip is never a failure. |
182
+ | `reviewed`, `decision.kind` = `gate-passed` | The gate passed. Record `findingsGate.recorded` and `findingsGate.aboveFloorWithoutSuggestion` — real findings deliberately not applied — then continue to the summary and archival. |
183
+ | `reviewed`, `decision.kind` = `fix-and-continue` | Apply the `actionable` set from `<plan-dir>/review/round-<n>/findings.json` on the implementer route. Re-run `POST_EXECUTION.md` in full. Then run the gate again with `<round>` set to `decision.nextRound`. |
184
+ | `reviewed`, `decision.kind` = `budget-exhausted` | Halt exactly as any mechanical gate failure. Leave the plan in `plans/`, do not append a completion summary, do not archive, and report the outstanding findings with actionable next steps. |
185
+ | `reviewed`, `decision.kind` = `round-failed` | The round was not certified — the findings document was absent or invalid, or no validator was available. Halt and report `decision.detail`. Never report an uncertified round as clean. |
186
+ | `budget-exhausted` | A round past the enforced budget was requested and no reviewer was dispatched. Halt exactly as `decision.kind` = `budget-exhausted` above. |
187
+ | `launched-failure` | The reviewer harness exited non-zero. Halt and report `detail`. |
188
+ | `fallback` | The reviewer never ran — the harness was unavailable or authentication failed. Record `reason` and `detail` verbatim in the execution summary, then continue to the summary and archival. |
189
+ | `infrastructure-failure` | A real error. Halt and report `detail`. Do not retry on a different route. |
190
+
191
+ <details>
192
+ <summary>Applying an actionable finding</summary>
193
+
194
+ `<plan-dir>/review/round-<n>/findings.json` holds that round's partition. Its `actionable` array is the only set you apply. Its `recorded` array is inspection material and is never applied.
195
+
196
+ Each actionable entry names a file, a location, and a suggestion whose `original-code` was copied verbatim from that file. Apply it as an exact text replacement of `original-code` by `proposed-code`, and change nothing else. When `original-code` no longer matches the file, record the finding as not applied and move to the next one. Do not reconstruct the fix, widen it, or refactor around it.
197
+
198
+ Dispatch every fix on the implementer route. Earlier rounds' rulings are carried into the next round by the mechanism itself, which reads the partitions it already wrote; do not pass them back on the command line.
199
+
200
+ </details>
201
+
202
+ Hard rules:
203
+
204
+ - The gate creates no task files.
205
+ - The gate never mutates the Execution Blueprint.
206
+ - The gate is terminal only — never per phase, never per task.
207
+ - The reviewer never fixes its own findings. Detection runs on the reviewer route, fixes run on the implementer route.
208
+ - Any applied fix invalidates the green build that preceded it. Re-run `POST_EXECUTION.md` in full — lint, tests, and Self Validation — before the gate runs again. Never re-verify against the prior green build.
209
+ - Whether another round runs is `decision.kind`'s to state and yours to obey. Do not count rounds, reason about the budget, or invoke a round the mechanism did not name.
210
+ - A green gate is not a correctness guarantee. It reduces the exposure a human PR approval reduces, and it leaves the same exposure behind.
211
+
165
212
  ### 9. Append execution summary
166
213
 
167
214
  Append an execution summary section to the plan document using the format described in `<root>/config/templates/EXECUTION_SUMMARY_TEMPLATE.md`. Populate:
@@ -169,7 +216,7 @@ Append an execution summary section to the plan document using the format descri
169
216
  - **Status**: Completed Successfully
170
217
  - **Completed Date**: current date
171
218
  - **Results**: brief summary of deliverables
172
- - **Noteworthy Events**: all decisions, issues, and outcomes encountered during execution. If none occurred, state "No significant issues encountered."
219
+ - **Noteworthy Events**: all decisions, issues, and outcomes encountered during execution. Always record the review gate's outcome here: the reviewer harness, the number of rounds run, and the counts of findings recorded versus applied — or, when the gate did not run, its `reason` and `detail` verbatim. If nothing else occurred, state "No significant issues encountered." after the review outcome.
173
220
  - **Necessary follow-ups**: any follow-up actions or optimizations
174
221
 
175
222
  ### 10. Archive the plan