strikethroo 3.0.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/dist/cli.d.ts +9 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +187 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/conflict-detector.d.ts +24 -0
  8. package/dist/conflict-detector.d.ts.map +1 -0
  9. package/dist/conflict-detector.js +130 -0
  10. package/dist/conflict-detector.js.map +1 -0
  11. package/dist/index.d.ts +22 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +344 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/metadata.d.ts +40 -0
  16. package/dist/metadata.d.ts.map +1 -0
  17. package/dist/metadata.js +121 -0
  18. package/dist/metadata.js.map +1 -0
  19. package/dist/plan-utils.d.ts +35 -0
  20. package/dist/plan-utils.d.ts.map +1 -0
  21. package/dist/plan-utils.js +123 -0
  22. package/dist/plan-utils.js.map +1 -0
  23. package/dist/plan.d.ts +27 -0
  24. package/dist/plan.d.ts.map +1 -0
  25. package/dist/plan.js +279 -0
  26. package/dist/plan.js.map +1 -0
  27. package/dist/prompts.d.ts +21 -0
  28. package/dist/prompts.d.ts.map +1 -0
  29. package/dist/prompts.js +132 -0
  30. package/dist/prompts.js.map +1 -0
  31. package/dist/status.d.ts +73 -0
  32. package/dist/status.d.ts.map +1 -0
  33. package/dist/status.js +375 -0
  34. package/dist/status.js.map +1 -0
  35. package/dist/types.d.ts +274 -0
  36. package/dist/types.d.ts.map +1 -0
  37. package/dist/types.js +9 -0
  38. package/dist/types.js.map +1 -0
  39. package/dist/utils.d.ts +53 -0
  40. package/dist/utils.d.ts.map +1 -0
  41. package/dist/utils.js +158 -0
  42. package/dist/utils.js.map +1 -0
  43. package/package.json +94 -0
  44. package/templates/harness/agents/plan-creator.md +95 -0
  45. package/templates/harness/skills/st-create-plan/SKILL.md +120 -0
  46. package/templates/harness/skills/st-create-plan/scripts/find-strikethroo-root.cjs +116 -0
  47. package/templates/harness/skills/st-create-plan/scripts/get-next-plan-id.cjs +197 -0
  48. package/templates/harness/skills/st-execute-blueprint/SKILL.md +147 -0
  49. package/templates/harness/skills/st-execute-blueprint/scripts/create-feature-branch.cjs +359 -0
  50. package/templates/harness/skills/st-execute-blueprint/scripts/find-strikethroo-root.cjs +116 -0
  51. package/templates/harness/skills/st-execute-blueprint/scripts/validate-plan-blueprint.cjs +358 -0
  52. package/templates/harness/skills/st-execute-task/SKILL.md +195 -0
  53. package/templates/harness/skills/st-execute-task/scripts/check-task-dependencies.cjs +420 -0
  54. package/templates/harness/skills/st-execute-task/scripts/find-strikethroo-root.cjs +116 -0
  55. package/templates/harness/skills/st-execute-task/scripts/validate-plan-blueprint.cjs +358 -0
  56. package/templates/harness/skills/st-full-workflow/SKILL.md +413 -0
  57. package/templates/harness/skills/st-full-workflow/scripts/create-feature-branch.cjs +359 -0
  58. package/templates/harness/skills/st-full-workflow/scripts/find-strikethroo-root.cjs +116 -0
  59. package/templates/harness/skills/st-full-workflow/scripts/get-next-plan-id.cjs +197 -0
  60. package/templates/harness/skills/st-full-workflow/scripts/get-next-task-id.cjs +295 -0
  61. package/templates/harness/skills/st-full-workflow/scripts/validate-plan-blueprint.cjs +358 -0
  62. package/templates/harness/skills/st-generate-tasks/SKILL.md +244 -0
  63. package/templates/harness/skills/st-generate-tasks/scripts/find-strikethroo-root.cjs +116 -0
  64. package/templates/harness/skills/st-generate-tasks/scripts/get-next-task-id.cjs +295 -0
  65. package/templates/harness/skills/st-generate-tasks/scripts/validate-plan-blueprint.cjs +358 -0
  66. package/templates/harness/skills/st-refine-plan/SKILL.md +205 -0
  67. package/templates/harness/skills/st-refine-plan/scripts/find-strikethroo-root.cjs +116 -0
  68. package/templates/harness/skills/st-refine-plan/scripts/validate-plan-blueprint.cjs +358 -0
  69. package/templates/strikethroo/README.md +7 -0
  70. package/templates/strikethroo/config/STRIKETHROO.md +76 -0
  71. package/templates/strikethroo/config/hooks/POST_ERROR_DETECTION.md +46 -0
  72. package/templates/strikethroo/config/hooks/POST_EXECUTION.md +25 -0
  73. package/templates/strikethroo/config/hooks/POST_PHASE.md +24 -0
  74. package/templates/strikethroo/config/hooks/POST_PLAN.md +5 -0
  75. package/templates/strikethroo/config/hooks/POST_TASK_GENERATION_ALL.md +41 -0
  76. package/templates/strikethroo/config/hooks/PRE_PHASE.md +21 -0
  77. package/templates/strikethroo/config/hooks/PRE_PLAN.md +42 -0
  78. package/templates/strikethroo/config/hooks/PRE_TASK_ASSIGNMENT.md +32 -0
  79. package/templates/strikethroo/config/hooks/PRE_TASK_EXECUTION.md +1 -0
  80. package/templates/strikethroo/config/templates/BLUEPRINT_TEMPLATE.md +24 -0
  81. package/templates/strikethroo/config/templates/EXECUTION_SUMMARY_TEMPLATE.md +13 -0
  82. package/templates/strikethroo/config/templates/PLAN_TEMPLATE.md +109 -0
  83. package/templates/strikethroo/config/templates/TASK_TEMPLATE.md +36 -0
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: plan-creator
3
+ description: |
4
+ Use this agent to create comprehensive strategic plan documents combining business strategy and technical architecture. Specializes in context gathering, YAGNI enforcement, and producing actionable blueprints with visual communication.
5
+ ---
6
+
7
+ You are a strategic planning specialist who creates actionable plan documents that balance comprehensive context with disciplined scope control.
8
+
9
+ ## Core Mission
10
+
11
+ Create strategic blueprints that define WHAT to build and WHY, not HOW. Your plans must:
12
+ - Gather complete context through targeted clarification
13
+ - Enforce YAGNI (reduce scope by 20-30%)
14
+ - Use mermaid diagrams for visual clarity
15
+ - Follow template structure precisely
16
+ - Define measurable success criteria
17
+
18
+ ## Critical Workflow
19
+
20
+ **1. Context Gathering**
21
+ - Read project instructions (AGENTS.md, README.md, or equivalent)
22
+ - Search codebase for similar patterns
23
+ - Ask specific, categorized clarification questions when gaps exist
24
+ - STOP and wait for answers before planning
25
+
26
+ **2. YAGNI Enforcement**
27
+ For each component ask: Is this explicitly required? If not, exclude it.
28
+
29
+ Eliminate these anti-patterns:
30
+ - Over-engineering: ❌ "Add comprehensive analytics" → ✅ "Log core events"
31
+ - Premature optimization: ❌ "Implement caching/load balancing/CDN" → ✅ "Structure for future caching"
32
+ - Feature speculation: ❌ "Users might want X" → ✅ Only explicit requirements, or ask for clarifications
33
+ - Gold-plating: ❌ "15+ admin features" → ✅ "3 specified operations"
34
+
35
+ **3. Plan Structure** (follow template exactly)
36
+ - **Executive Summary**: 2-3 paragraphs (what/why/how/benefits)
37
+ - **Context**: Current state, target state, background
38
+ - **Technical Approach**: 3-7 components with objectives and architectural decisions
39
+ - **Risks**: 3-5 risks with mitigation strategies
40
+ - **Success Criteria**: Measurable, verifiable metrics
41
+ - **Mermaid Diagrams**: 1-2 diagrams (architecture/flow/state/data model)
42
+
43
+ **4. Quality Standards**
44
+ - Use active voice and specific terms
45
+ - Detail level: ✅ "JWT with 15-min tokens" ✅ "Rate limit: 5 fails = 15-min lockout"
46
+ - Detail level: ❌ "function authenticateUser(username, password)" (too detailed) ❌ "Build auth system" (too vague)
47
+
48
+ ## Absolute Prohibitions
49
+
50
+ **NEVER Include**:
51
+ - Time estimates ("2-3 weeks", "Phase 1 (Week 1-2)")
52
+ - Task lists ("Task 1: Create schema, Task 2: Build API")
53
+ - Code snippets or function signatures
54
+ - Specific variable names or file paths
55
+ - Speculative "nice to have" features
56
+
57
+ ## Template Compliance Checklist
58
+
59
+ - [ ] YAML frontmatter: id, summary, created
60
+ - [ ] Original Work Order (verbatim quote)
61
+ - [ ] Plan Clarifications (if asked questions)
62
+ - [ ] Executive Summary (2-3 paragraphs)
63
+ - [ ] Context (current/target/background)
64
+ - [ ] Technical Implementation (3-7 components with objectives)
65
+ - [ ] Risks (3-5 with mitigations)
66
+ - [ ] Success Criteria (measurable)
67
+ - [ ] Resource Requirements
68
+ - [ ] 1-2 mermaid diagrams
69
+ - [ ] Structured output summary
70
+
71
+ ## Execution Steps
72
+
73
+ 1. Execute PRE_PLAN.md hook if exists
74
+ 2. Analyze user input and search codebase
75
+ 3. Ask clarification questions if needed (STOP until answered)
76
+ 4. Generate Plan ID: scan `.ai/strikethroo/plans/` and `.ai/strikethroo/archive/` for existing plan directories, extract the highest numeric `id` from their YAML frontmatter, and add 1. If no plans exist, use ID 1.
77
+ 5. Create plan at `.ai/strikethroo/plans/[ID]--[name]/plan-[ID]--[name].md`
78
+ 6. Execute POST_PLAN.md hook if exists
79
+ 7. Output:
80
+ ```
81
+ ---
82
+ Plan Summary:
83
+ - Plan ID: [numeric-id]
84
+ - Plan File: [full-path]
85
+ ```
86
+
87
+ ## Excellence Markers
88
+
89
+ ✅ Strategic clarity (what/why clear to all readers)
90
+ ✅ Technical soundness (well-reasoned architecture)
91
+ ✅ Scope discipline (only necessary features)
92
+ ✅ Risk awareness (challenges + mitigations)
93
+ ✅ Visual communication (diagrams clarify complexity)
94
+ ✅ Measurable success (verifiable criteria)
95
+ ✅ Template adherence (precise structure)
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: st-create-plan
3
+ description: Create a new Strikethroo plan for this repository. Use when the user asks to draft, plan, or scope a new strikethroo plan — discovers the local .ai/strikethroo root, runs the project's plan hooks, gathers clarifications, allocates the next plan ID, and writes a Markdown plan conforming to PLAN_TEMPLATE.md. Do not use for generic brainstorming or work outside Strikethroo.
4
+ ---
5
+
6
+ # st-create-plan
7
+
8
+ Drive the end-to-end creation of a new Strikethroo plan for the user's
9
+ repository. The skill is assistant-agnostic and self-contained: every script
10
+ it invokes lives under this skill's `scripts/` directory and is referenced
11
+ by relative path.
12
+
13
+ ## Inputs
14
+
15
+ The user's request supplies the work order. Treat it as the only authoritative
16
+ source of intent. Do not invent answers to clarifying questions — prompt the
17
+ user instead.
18
+
19
+ ## Operating Procedure
20
+
21
+ ### 1. Locate the strikethroo root
22
+
23
+ Run `scripts/find-strikethroo-root.cjs` from the user's working directory.
24
+ The script walks up looking for `.ai/strikethroo/.init-metadata.json` and
25
+ prints the absolute path of the resolved root on success.
26
+
27
+ If the script exits non-zero, the working directory is not inside an
28
+ initialized strikethroo workspace. Stop and ask the user to run the project
29
+ initializer (e.g. `npx strikethroo init`) before continuing. Do
30
+ not attempt to create a plan outside of a valid root.
31
+
32
+ For every subsequent step, treat the path printed by this script as `<root>`.
33
+
34
+ ### 2. Load project context
35
+
36
+ Read `<root>/config/STRIKETHROO.md` for the directory structure conventions
37
+ this project uses. Read `<root>/config/hooks/PRE_PLAN.md` and execute the
38
+ instructions it contains before proceeding. Read
39
+ `<root>/config/templates/PLAN_TEMPLATE.md` so the plan you emit conforms
40
+ to its structure.
41
+
42
+ ### 3. Analyze the work order
43
+
44
+ Identify:
45
+
46
+ - Objective and end goal.
47
+ - Scope and explicit boundaries.
48
+ - Success criteria.
49
+ - Dependencies, prerequisites, blockers.
50
+ - Technical requirements and constraints.
51
+
52
+ ### 4. Clarification loop
53
+
54
+ If any critical context is missing, ask the user targeted questions. Keep
55
+ looping until you have no further questions. Explicitly confirm whether
56
+ backwards compatibility is required. Never invent answers; never paper over
57
+ a missing answer.
58
+
59
+ If the user declines to clarify a blocking question, stop and report the
60
+ plan as needing clarification. Do not produce a partial plan.
61
+
62
+ ### 5. Allocate the next plan ID
63
+
64
+ Run `scripts/get-next-plan-id.cjs` to obtain the next available plan ID.
65
+ Pass `<root>` as the first argument when invoking the script from a working
66
+ directory that is not inside the project, otherwise no argument is required.
67
+ The script prints a single integer.
68
+
69
+ Compute the zero-padded form for directory naming (`{padded-id}--{slug}`)
70
+ and use the unpadded integer in the plan frontmatter and the final summary.
71
+
72
+ ### 6. Emit the plan
73
+
74
+ Write the plan to:
75
+
76
+ ```
77
+ <root>/plans/{padded-id}--{slug}/plan-{padded-id}--{slug}.md
78
+ ```
79
+
80
+ The output must:
81
+
82
+ - Conform to `<root>/config/templates/PLAN_TEMPLATE.md`, including required
83
+ YAML frontmatter fields (at minimum `id`, `summary`, `created`).
84
+ - Contain the standard sections from the template body.
85
+ - Use Markdown, not free-form prose.
86
+ - Avoid time estimates, task lists, or code samples — those belong to the
87
+ later task-generation phase.
88
+
89
+ The `<slug>` is derived from the plan summary: lowercase, alphanumeric and
90
+ hyphens only, collapsed, trimmed.
91
+
92
+ ### 7. Run post-plan hook
93
+
94
+ Execute `<root>/config/hooks/POST_PLAN.md` after the plan file is written.
95
+
96
+ ### 8. Emit the structured summary
97
+
98
+ Conclude with exactly this block as the final output:
99
+
100
+ ```
101
+ ---
102
+
103
+ Plan Summary:
104
+ - Plan ID: [numeric-id]
105
+ - Plan File: [absolute-path-to-plan-file]
106
+ ```
107
+
108
+ The summary is consumed by downstream automation; keep the format exact.
109
+
110
+ ## Failure Modes
111
+
112
+ - **No strikethroo root found.** Stop, instruct the user to initialize the
113
+ project. Do not write any files.
114
+ - **User refuses to answer a clarifying question that blocks planning.**
115
+ Report `needs-clarification` and stop. Do not produce a plan.
116
+ - **Plan ID script fails.** Re-check the resolved root and re-run. If it
117
+ continues to fail, surface stderr to the user and stop — do not guess an ID.
118
+ - **Plan directory already exists for the allocated ID.** Re-run the
119
+ next-plan-id script (a concurrent run may have advanced it) and retry once.
120
+ If the conflict persists, stop and report.
@@ -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 ? 1 : 1;
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,197 @@
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/get-next-plan-id.ts
31
+ var get_next_plan_id_exports = {};
32
+ __export(get_next_plan_id_exports, {
33
+ main: () => main
34
+ });
35
+ module.exports = __toCommonJS(get_next_plan_id_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 ? 1 : 1;
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
+ var computeNextPlanId = (taskManagerRoot) => {
168
+ const plans = getAllPlans(taskManagerRoot);
169
+ return plans.reduce((max, p) => Math.max(max, p.id), 0) + 1;
170
+ };
171
+
172
+ // src/skill-scripts/get-next-plan-id.ts
173
+ var main = () => {
174
+ const rootArg = process.argv[2];
175
+ let root;
176
+ if (rootArg) {
177
+ root = rootArg;
178
+ } else {
179
+ root = findStrikethrooRoot(process.cwd());
180
+ }
181
+ if (!root) {
182
+ process.stderr.write(
183
+ "No .ai/strikethroo root found. Run this from inside an initialized strikethroo workspace.\n"
184
+ );
185
+ process.exit(1);
186
+ }
187
+ process.stdout.write(`${computeNextPlanId(root)}
188
+ `);
189
+ process.exit(0);
190
+ };
191
+ if (require.main === module) {
192
+ main();
193
+ }
194
+ // Annotate the CommonJS export names for ESM import in node:
195
+ 0 && (module.exports = {
196
+ main
197
+ });
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: st-execute-blueprint
3
+ description: Execute a Strikethroo plan blueprint for this repository. Use when the user asks to run, implement, or carry out a specific plan ID — discovers the local .ai/strikethroo root, resolves the plan, validates or auto-generates tasks and the execution blueprint, optionally creates a feature branch, runs phases with lifecycle hooks, enforces validation gates, appends an execution summary, and archives the completed plan. Do not use for generic development work outside Strikethroo.
4
+ ---
5
+
6
+ # st-execute-blueprint
7
+
8
+ Drive the end-to-end execution of an existing Strikethroo plan blueprint. The skill is assistant-agnostic and self-contained: every script it invokes lives under this skill's `scripts/` directory and is referenced by relative path.
9
+
10
+ ## Critical Rules
11
+
12
+ 1. **Never skip validation gates** — a phase is not complete until `POST_PHASE.md` succeeds.
13
+ 2. **Preserve dependency order** — never execute a task before all of its dependencies are completed.
14
+ 3. **Maximize parallelism within each phase** — run all tasks whose dependencies are satisfied simultaneously.
15
+ 4. **Fail safely and document everything** — halt on unrecoverable errors, and record all decisions, issues, and outcomes under "Noteworthy Events" in the execution summary.
16
+
17
+ ## Inputs
18
+
19
+ The user supplies the numeric plan ID conversationally. Treat it as the only authoritative source of intent. Do not invent answers to clarifying questions — prompt the user instead.
20
+
21
+ ## Operating Procedure
22
+
23
+ ### 1. Locate the strikethroo root
24
+
25
+ Run `scripts/find-strikethroo-root.cjs` from the user's working directory.
26
+ The script walks up looking for `.ai/strikethroo/.init-metadata.json` and
27
+ prints the absolute path of the resolved root on success.
28
+
29
+ If the script exits non-zero, the working directory is not inside an
30
+ initialized strikethroo workspace. Stop and ask the user to run the project
31
+ initializer (e.g. `npx strikethroo init`) before continuing. Do
32
+ not attempt to execute a plan outside of a valid root.
33
+
34
+ For every subsequent step, treat the path printed by this script as `<root>`.
35
+
36
+ ### 2. Resolve the plan
37
+
38
+ Run `scripts/validate-plan-blueprint.cjs <plan-id> planFile` to obtain the
39
+ absolute path of the plan file. The same script also accepts these field
40
+ names (single-field output mode) and exposes them on demand:
41
+
42
+ - `planDir` — absolute path of the plan directory
43
+ - `taskCount` — number of existing task files in that plan's `tasks/`
44
+ - `blueprintExists` — `yes` or `no`
45
+ - `taskManagerRoot` — absolute path of `<root>`
46
+ - `planId` — the resolved numeric plan ID
47
+
48
+ If the script exits non-zero, stop and ask the user to confirm the plan ID.
49
+ Do not guess a different ID.
50
+
51
+ ### 3. Validate tasks and blueprint existence
52
+
53
+ Inspect the `taskCount` and `blueprintExists` values returned by the validation script.
54
+
55
+ ### 4. Auto-generate tasks and blueprint if missing
56
+
57
+ If `taskCount` is 0 or `blueprintExists` is `no`:
58
+
59
+ - Notify the user: "Tasks or execution blueprint not found. Generating tasks automatically..."
60
+ - Follow the `st-generate-tasks` skill for this plan ID. Execute its operating procedure in full, including running `POST_TASK_GENERATION_ALL.md` to produce the execution blueprint.
61
+ - After generation completes, re-run `scripts/validate-plan-blueprint.cjs <plan-id> planFile` (and the other fields) to refresh the resolved paths and counts.
62
+
63
+ If generation still leaves the plan without tasks or a blueprint, stop and report failure. Do not attempt execution without a valid blueprint.
64
+
65
+ ### 5. Optionally create a feature branch
66
+
67
+ Run `scripts/create-feature-branch.cjs <plan-id>`. The script creates a branch named after the plan and prints the branch name. Continue execution regardless of whether a branch is created (some projects may skip this step).
68
+
69
+ ### 6. Load project context and execution blueprint
70
+
71
+ Read these files, in order:
72
+
73
+ - `<root>/config/STRIKETHROO.md` — directory conventions and project context.
74
+ - The plan document at the path returned by step 2.
75
+ - The plan's Execution Blueprint section — this defines the phase groupings and task dispatch order.
76
+
77
+ ### 7. Execute phases in order
78
+
79
+ Use an internal task or todo tracker to monitor progress. For each phase defined in the Execution Blueprint:
80
+
81
+ #### 7a. Phase pre-execution
82
+ Read `<root>/config/hooks/PRE_PHASE.md` and execute its instructions before starting the phase.
83
+
84
+ #### 7b. Task dispatch
85
+ Identify all tasks scheduled for this phase whose dependencies are fully satisfied. Read `<root>/config/hooks/PRE_TASK_EXECUTION.md` and execute its instructions before starting any implementation work.
86
+
87
+ Deploy all selected agents simultaneously using your internal Task tool. Each agent MUST:
88
+
89
+ 1. Read and execute `<root>/config/hooks/PRE_TASK_EXECUTION.md` before starting any implementation work.
90
+ 2. Execute the task according to its requirements.
91
+ 3. Monitor execution progress and capture outputs and artifacts.
92
+ 4. Update task status in real-time.
93
+
94
+ Maximize parallelism within each phase. Run every task that is ready at the same time.
95
+
96
+ #### 7c. Phase completion verification
97
+ Ensure every task in the phase has status `completed`. Collect and review all task outputs. Document any issues or exceptions encountered.
98
+
99
+ #### 7d. Phase post-execution
100
+ Read `<root>/config/hooks/POST_PHASE.md` and execute its instructions. Do not proceed to the next phase until this hook succeeds.
101
+
102
+ Update the phase status to `completed` in the plan's Execution Blueprint section.
103
+
104
+ Repeat for the next phase until all phases are complete.
105
+
106
+ ### 8. Post-execution validation
107
+
108
+ Read `<root>/config/hooks/POST_EXECUTION.md` and execute its instructions. If validation fails, halt execution. The plan remains in `plans/` for debugging.
109
+
110
+ ### 9. Append execution summary
111
+
112
+ Append an execution summary section to the plan document using the format described in `<root>/config/templates/EXECUTION_SUMMARY_TEMPLATE.md`. Populate:
113
+
114
+ - **Status**: Completed Successfully
115
+ - **Completed Date**: current date
116
+ - **Results**: brief summary of deliverables
117
+ - **Noteworthy Events**: all decisions, issues, and outcomes encountered during execution. If none occurred, state "No significant issues encountered."
118
+ - **Necessary follow-ups**: any follow-up actions or optimizations
119
+
120
+ ### 10. Archive the plan
121
+
122
+ Move the completed plan directory from `<root>/plans/<plan-folder>` to `<root>/archive/<plan-folder>`.
123
+
124
+ Preserve the entire folder structure (including all tasks and subdirectories) to maintain referential integrity. If the move fails, log the error but do not fail the overall execution — the implementation work is complete.
125
+
126
+ ## Failure Modes
127
+
128
+ - **No strikethroo root found.** Stop and instruct the user to initialize the project. Do not execute any tasks.
129
+ - **Plan ID does not resolve.** Stop and surface the script's stderr to the user. Do not guess a different ID.
130
+ - **Missing blueprint after auto-generation.** If the `st-generate-tasks` skill fails to produce tasks or a blueprint, stop and report failure. Do not attempt execution without a blueprint.
131
+ - **Hook failure.** If `PRE_PHASE.md`, `POST_PHASE.md`, or `POST_EXECUTION.md` fails, halt execution. The plan remains in `plans/` for debugging and potential re-execution.
132
+ - **Execution errors.** If a task fails, read `<root>/config/hooks/POST_ERROR_DETECTION.md`, document the error in Noteworthy Events, halt the phase, and request user direction before continuing.
133
+
134
+ ## Execution Summary
135
+
136
+ Conclude with exactly this block as the final output:
137
+
138
+ ```
139
+ ---
140
+ Execution Summary:
141
+ - Plan ID: [numeric-id]
142
+ - Status: Archived
143
+ - Location: [absolute path to archive directory]
144
+ ---
145
+ ```
146
+
147
+ The summary is consumed by downstream automation; keep the format exact.