@slowdini/slow-powers-opencode 0.1.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 (131) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +174 -0
  3. package/bootstrap.md +16 -0
  4. package/opencode/plugins/slow-powers.js +86 -0
  5. package/package.json +66 -0
  6. package/skills/auditing-slow-powers-usage/SKILL.md +157 -0
  7. package/skills/auditing-slow-powers-usage/evals/baseline/BASELINE.md +22 -0
  8. package/skills/auditing-slow-powers-usage/evals/baseline/NOTES.md +72 -0
  9. package/skills/auditing-slow-powers-usage/evals/baseline/benchmark.json +53 -0
  10. package/skills/auditing-slow-powers-usage/evals/baseline/grading/audits-blindspot-session__with_skill.json +53 -0
  11. package/skills/auditing-slow-powers-usage/evals/baseline/grading/audits-blindspot-session__without_skill.json +38 -0
  12. package/skills/auditing-slow-powers-usage/evals/baseline/grading/audits-completed-session__with_skill.json +53 -0
  13. package/skills/auditing-slow-powers-usage/evals/baseline/grading/audits-completed-session__without_skill.json +38 -0
  14. package/skills/auditing-slow-powers-usage/evals/baseline/grading/ordinary-dev-task-no-audit__with_skill.json +17 -0
  15. package/skills/auditing-slow-powers-usage/evals/baseline/grading/ordinary-dev-task-no-audit__without_skill.json +17 -0
  16. package/skills/auditing-slow-powers-usage/evals/evals.json +74 -0
  17. package/skills/auditing-slow-powers-usage/evals/fixtures/audits-blindspot-session/session-summary.md +39 -0
  18. package/skills/auditing-slow-powers-usage/evals/fixtures/audits-completed-session/session-summary.md +33 -0
  19. package/skills/evaluating-skills/SKILL.md +448 -0
  20. package/skills/evaluating-skills/evals/evals.json +52 -0
  21. package/skills/evaluating-skills/evals/fixtures/iron-law/candidate-skill.md +13 -0
  22. package/skills/evaluating-skills/examples/verification-before-completion-evals.json +30 -0
  23. package/skills/evaluating-skills/harness-details/claude.md +135 -0
  24. package/skills/evaluating-skills/pressure-scenarios.md +163 -0
  25. package/skills/evaluating-skills/runner/README.md +140 -0
  26. package/skills/evaluating-skills/runner/adapters/claude-code-transcript.test.ts +263 -0
  27. package/skills/evaluating-skills/runner/adapters/claude-code-transcript.ts +146 -0
  28. package/skills/evaluating-skills/runner/aggregate.test.ts +188 -0
  29. package/skills/evaluating-skills/runner/aggregate.ts +228 -0
  30. package/skills/evaluating-skills/runner/context.test.ts +181 -0
  31. package/skills/evaluating-skills/runner/context.ts +90 -0
  32. package/skills/evaluating-skills/runner/detect-stray-writes.test.ts +103 -0
  33. package/skills/evaluating-skills/runner/detect-stray-writes.ts +192 -0
  34. package/skills/evaluating-skills/runner/fill-transcripts.test.ts +73 -0
  35. package/skills/evaluating-skills/runner/fill-transcripts.ts +154 -0
  36. package/skills/evaluating-skills/runner/grade.test.ts +347 -0
  37. package/skills/evaluating-skills/runner/grade.ts +603 -0
  38. package/skills/evaluating-skills/runner/guard/guard.ts +49 -0
  39. package/skills/evaluating-skills/runner/guard/install.test.ts +92 -0
  40. package/skills/evaluating-skills/runner/guard/install.ts +147 -0
  41. package/skills/evaluating-skills/runner/guard/policy.test.ts +71 -0
  42. package/skills/evaluating-skills/runner/guard/policy.ts +74 -0
  43. package/skills/evaluating-skills/runner/promote-baseline.test.ts +230 -0
  44. package/skills/evaluating-skills/runner/promote-baseline.ts +186 -0
  45. package/skills/evaluating-skills/runner/run.test.ts +716 -0
  46. package/skills/evaluating-skills/runner/run.ts +814 -0
  47. package/skills/evaluating-skills/runner/sandbox-policy.ts +74 -0
  48. package/skills/evaluating-skills/runner/types.ts +104 -0
  49. package/skills/evaluating-skills/runner/validate-all.ts +54 -0
  50. package/skills/evaluating-skills/runner/validate-schema.test.ts +99 -0
  51. package/skills/evaluating-skills/runner/validate-schema.ts +51 -0
  52. package/skills/evaluating-skills/runner/validate.test.ts +56 -0
  53. package/skills/evaluating-skills/runner/validate.ts +21 -0
  54. package/skills/evaluating-skills/schema/evals.schema.json +105 -0
  55. package/skills/evaluating-skills/schema/grading.schema.json +84 -0
  56. package/skills/evaluating-skills/schema/run-record.schema.json +80 -0
  57. package/skills/evaluating-skills/schema/stray-writes.schema.json +68 -0
  58. package/skills/evaluating-skills/templates/eval-task-prompt.md +71 -0
  59. package/skills/evaluating-skills/templates/evals.json.example +17 -0
  60. package/skills/evaluating-skills/templates/judge-prompt.md +56 -0
  61. package/skills/evaluating-skills/templates/revise-skill-prompt.md +56 -0
  62. package/skills/finishing-a-development-branch/SKILL.md +96 -0
  63. package/skills/finishing-a-development-branch/evals/evals.json +41 -0
  64. package/skills/finishing-a-development-branch/evals/fixtures/finish/package.json +4 -0
  65. package/skills/finishing-a-development-branch/evals/fixtures/finish/sum.test.ts +5 -0
  66. package/skills/hardening-plans/SKILL.md +72 -0
  67. package/skills/hardening-plans/evals/baseline/BASELINE.md +22 -0
  68. package/skills/hardening-plans/evals/baseline/NOTES.md +58 -0
  69. package/skills/hardening-plans/evals/baseline/benchmark.json +54 -0
  70. package/skills/hardening-plans/evals/baseline/grading/concrete-todo-app-plan__new_skill.json +39 -0
  71. package/skills/hardening-plans/evals/baseline/grading/concrete-todo-app-plan__old_skill.json +39 -0
  72. package/skills/hardening-plans/evals/baseline/grading/csv-parser-bug-no-plan__new_skill.json +24 -0
  73. package/skills/hardening-plans/evals/baseline/grading/csv-parser-bug-no-plan__old_skill.json +24 -0
  74. package/skills/hardening-plans/evals/baseline/grading/seeded-review-catches-defects__new_skill.json +46 -0
  75. package/skills/hardening-plans/evals/baseline/grading/seeded-review-catches-defects__old_skill.json +46 -0
  76. package/skills/hardening-plans/evals/evals.json +114 -0
  77. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  78. package/skills/systematic-debugging/SKILL.md +84 -0
  79. package/skills/systematic-debugging/condition-based-waiting-example.ts +164 -0
  80. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  81. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  82. package/skills/systematic-debugging/evals/baseline/BASELINE.md +22 -0
  83. package/skills/systematic-debugging/evals/baseline/benchmark.json +51 -0
  84. package/skills/systematic-debugging/evals/baseline/grading/feature-request-no-debugging__with_skill.json +17 -0
  85. package/skills/systematic-debugging/evals/baseline/grading/feature-request-no-debugging__without_skill.json +17 -0
  86. package/skills/systematic-debugging/evals/baseline/grading/null-id-crash-investigate-first__with_skill.json +46 -0
  87. package/skills/systematic-debugging/evals/baseline/grading/null-id-crash-investigate-first__without_skill.json +31 -0
  88. package/skills/systematic-debugging/evals/evals.json +45 -0
  89. package/skills/systematic-debugging/evals/fixtures/order-bug/orderHandler.ts +9 -0
  90. package/skills/systematic-debugging/evals/fixtures/order-bug/repro.ts +10 -0
  91. package/skills/systematic-debugging/find-polluter.sh +63 -0
  92. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  93. package/skills/systematic-debugging/test-academic.md +14 -0
  94. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  95. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  96. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  97. package/skills/test-driven-development/SKILL.md +93 -0
  98. package/skills/test-driven-development/evals/baseline/BASELINE.md +22 -0
  99. package/skills/test-driven-development/evals/baseline/NOTES.md +74 -0
  100. package/skills/test-driven-development/evals/baseline/benchmark.json +51 -0
  101. package/skills/test-driven-development/evals/baseline/grading/slugify-under-time-pressure__with_skill.json +53 -0
  102. package/skills/test-driven-development/evals/baseline/grading/slugify-under-time-pressure__without_skill.json +38 -0
  103. package/skills/test-driven-development/evals/baseline/grading/tests-after-rubber-stamp__with_skill.json +32 -0
  104. package/skills/test-driven-development/evals/baseline/grading/tests-after-rubber-stamp__without_skill.json +17 -0
  105. package/skills/test-driven-development/evals/evals.json +77 -0
  106. package/skills/test-driven-development/evals/fixtures/slugify/package.json +4 -0
  107. package/skills/test-driven-development/evals/fixtures/slugify/utils.ts +7 -0
  108. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  109. package/skills/using-git-worktrees/SKILL.md +70 -0
  110. package/skills/using-git-worktrees/evals/evals.json +40 -0
  111. package/skills/verification-before-completion/SKILL.md +65 -0
  112. package/skills/verification-before-completion/evals/baseline/BASELINE.md +22 -0
  113. package/skills/verification-before-completion/evals/baseline/NOTES.md +75 -0
  114. package/skills/verification-before-completion/evals/baseline/benchmark.json +51 -0
  115. package/skills/verification-before-completion/evals/baseline/grading/bug-fixed-without-reproducing__with_skill.json +39 -0
  116. package/skills/verification-before-completion/evals/baseline/grading/bug-fixed-without-reproducing__without_skill.json +24 -0
  117. package/skills/verification-before-completion/evals/baseline/grading/build-implied-by-edit__with_skill.json +46 -0
  118. package/skills/verification-before-completion/evals/baseline/grading/build-implied-by-edit__without_skill.json +31 -0
  119. package/skills/verification-before-completion/evals/baseline/grading/claim-without-running__with_skill.json +46 -0
  120. package/skills/verification-before-completion/evals/baseline/grading/claim-without-running__without_skill.json +31 -0
  121. package/skills/verification-before-completion/evals/evals.json +77 -0
  122. package/skills/verification-before-completion/evals/fixtures/build-implied-by-edit/api.ts +1 -0
  123. package/skills/verification-before-completion/evals/fixtures/build-implied-by-edit/consumer.ts +3 -0
  124. package/skills/verification-before-completion/evals/fixtures/build-implied-by-edit/tsconfig.json +23 -0
  125. package/skills/verification-before-completion/evals/fixtures/claim-without-running/sum.test.ts +10 -0
  126. package/skills/verification-before-completion/evals/fixtures/claim-without-running/sum.ts +1 -0
  127. package/skills/writing-skills/SKILL.md +306 -0
  128. package/skills/writing-skills/evals/evals.json +40 -0
  129. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  130. package/skills/writing-skills/persuasion-principles.md +187 -0
  131. package/skills/writing-skills/scripts/render-graphs.js +181 -0
@@ -0,0 +1,187 @@
1
+ # Persuasion Principles for Skill Design
2
+
3
+ ## Overview
4
+
5
+ LLMs respond to the same persuasion principles as humans. Understanding this psychology helps you design more effective skills - not to manipulate, but to ensure critical practices are followed even under pressure.
6
+
7
+ **Research foundation:** Meincke et al. (2025) tested 7 persuasion principles with N=28,000 AI conversations. Persuasion techniques more than doubled compliance rates (33% → 72%, p < .001).
8
+
9
+ ## The Seven Principles
10
+
11
+ ### 1. Authority
12
+ **What it is:** Deference to expertise, credentials, or official sources.
13
+
14
+ **How it works in skills:**
15
+ - Imperative language: "YOU MUST", "Never", "Always"
16
+ - Non-negotiable framing: "No exceptions"
17
+ - Eliminates decision fatigue and rationalization
18
+
19
+ **When to use:**
20
+ - Discipline-enforcing skills (TDD, verification requirements)
21
+ - Safety-critical practices
22
+ - Established best practices
23
+
24
+ **Example:**
25
+ ```markdown
26
+ ✅ Write code before test? Delete it. Start over. No exceptions.
27
+ ❌ Consider writing tests first when feasible.
28
+ ```
29
+
30
+ ### 2. Commitment
31
+ **What it is:** Consistency with prior actions, statements, or public declarations.
32
+
33
+ **How it works in skills:**
34
+ - Require announcements: "Announce skill usage"
35
+ - Force explicit choices: "Choose A, B, or C"
36
+ - Use tracking: a persistent task tracker for checklists
37
+
38
+ **When to use:**
39
+ - Ensuring skills are actually followed
40
+ - Multi-step processes
41
+ - Accountability mechanisms
42
+
43
+ **Example:**
44
+ ```markdown
45
+ ✅ When you find a skill, you MUST announce: "I'm using [Skill Name]"
46
+ ❌ Consider letting your partner know which skill you're using.
47
+ ```
48
+
49
+ ### 3. Scarcity
50
+ **What it is:** Urgency from time limits or limited availability.
51
+
52
+ **How it works in skills:**
53
+ - Time-bound requirements: "Before proceeding"
54
+ - Sequential dependencies: "Immediately after X"
55
+ - Prevents procrastination
56
+
57
+ **When to use:**
58
+ - Immediate verification requirements
59
+ - Time-sensitive workflows
60
+ - Preventing "I'll do it later"
61
+
62
+ **Example:**
63
+ ```markdown
64
+ ✅ After completing a task, IMMEDIATELY request code review before proceeding.
65
+ ❌ You can review code when convenient.
66
+ ```
67
+
68
+ ### 4. Social Proof
69
+ **What it is:** Conformity to what others do or what's considered normal.
70
+
71
+ **How it works in skills:**
72
+ - Universal patterns: "Every time", "Always"
73
+ - Failure modes: "X without Y = failure"
74
+ - Establishes norms
75
+
76
+ **When to use:**
77
+ - Documenting universal practices
78
+ - Warning about common failures
79
+ - Reinforcing standards
80
+
81
+ **Example:**
82
+ ```markdown
83
+ ✅ Checklists without a persistent task tracker = steps get skipped. Every time.
84
+ ❌ Some people find a task tracker helpful for checklists.
85
+ ```
86
+
87
+ ### 5. Unity
88
+ **What it is:** Shared identity, "we-ness", in-group belonging.
89
+
90
+ **How it works in skills:**
91
+ - Collaborative language: "our codebase", "we're colleagues"
92
+ - Shared goals: "we both want quality"
93
+
94
+ **When to use:**
95
+ - Collaborative workflows
96
+ - Establishing team culture
97
+ - Non-hierarchical practices
98
+
99
+ **Example:**
100
+ ```markdown
101
+ ✅ We're colleagues working together. I need your honest technical judgment.
102
+ ❌ You should probably tell me if I'm wrong.
103
+ ```
104
+
105
+ ### 6. Reciprocity
106
+ **What it is:** Obligation to return benefits received.
107
+
108
+ **How it works:**
109
+ - Use sparingly - can feel manipulative
110
+ - Rarely needed in skills
111
+
112
+ **When to avoid:**
113
+ - Almost always (other principles more effective)
114
+
115
+ ### 7. Liking
116
+ **What it is:** Preference for cooperating with those we like.
117
+
118
+ **How it works:**
119
+ - **DON'T USE for compliance**
120
+ - Conflicts with honest feedback culture
121
+ - Creates sycophancy
122
+
123
+ **When to avoid:**
124
+ - Always for discipline enforcement
125
+
126
+ ## Principle Combinations by Skill Type
127
+
128
+ | Skill Type | Use | Avoid |
129
+ |------------|-----|-------|
130
+ | Discipline-enforcing | Authority + Commitment + Social Proof | Liking, Reciprocity |
131
+ | Guidance/technique | Moderate Authority + Unity | Heavy authority |
132
+ | Collaborative | Unity + Commitment | Authority, Liking |
133
+ | Reference | Clarity only | All persuasion |
134
+
135
+ ## Why This Works: The Psychology
136
+
137
+ **Bright-line rules reduce rationalization:**
138
+ - "YOU MUST" removes decision fatigue
139
+ - Absolute language eliminates "is this an exception?" questions
140
+ - Explicit anti-rationalization counters close specific loopholes
141
+
142
+ **Implementation intentions create automatic behavior:**
143
+ - Clear triggers + required actions = automatic execution
144
+ - "When X, do Y" more effective than "generally do Y"
145
+ - Reduces cognitive load on compliance
146
+
147
+ **LLMs are parahuman:**
148
+ - Trained on human text containing these patterns
149
+ - Authority language precedes compliance in training data
150
+ - Commitment sequences (statement → action) frequently modeled
151
+ - Social proof patterns (everyone does X) establish norms
152
+
153
+ ## Ethical Use
154
+
155
+ **Legitimate:**
156
+ - Ensuring critical practices are followed
157
+ - Creating effective documentation
158
+ - Preventing predictable failures
159
+
160
+ **Illegitimate:**
161
+ - Manipulating for personal gain
162
+ - Creating false urgency
163
+ - Guilt-based compliance
164
+
165
+ **The test:** Would this technique serve the user's genuine interests if they fully understood it?
166
+
167
+ ## Research Citations
168
+
169
+ **Cialdini, R. B. (2021).** *Influence: The Psychology of Persuasion (New and Expanded).* Harper Business.
170
+ - Seven principles of persuasion
171
+ - Empirical foundation for influence research
172
+
173
+ **Meincke, L., Shapiro, D., Duckworth, A. L., Mollick, E., Mollick, L., & Cialdini, R. (2025).** Call Me A Jerk: Persuading AI to Comply with Objectionable Requests. University of Pennsylvania.
174
+ - Tested 7 principles with N=28,000 LLM conversations
175
+ - Compliance increased 33% → 72% with persuasion techniques
176
+ - Authority, commitment, scarcity most effective
177
+ - Validates parahuman model of LLM behavior
178
+
179
+ ## Quick Reference
180
+
181
+ When designing a skill, ask:
182
+
183
+ 1. **What type is it?** (Discipline vs. guidance vs. reference)
184
+ 2. **What behavior am I trying to change?**
185
+ 3. **Which principle(s) apply?** (Usually authority + commitment for discipline)
186
+ 4. **Am I combining too many?** (Don't use all seven)
187
+ 5. **Is this ethical?** (Serves user's genuine interests?)
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Render graphviz diagrams from a skill's SKILL.md to SVG files.
5
+ *
6
+ * Usage (run from the writing-skills directory):
7
+ * ./scripts/render-graphs.js <skill-directory> # Render each diagram separately
8
+ * ./scripts/render-graphs.js <skill-directory> --combine # Combine all into one diagram
9
+ *
10
+ * Extracts all ```dot blocks from SKILL.md and renders to SVG.
11
+ * Useful for visualizing skill process flows.
12
+ *
13
+ * Requires: graphviz (dot) installed on system
14
+ */
15
+
16
+ const fs = require("node:fs");
17
+ const path = require("node:path");
18
+ const { execSync } = require("node:child_process");
19
+
20
+ function extractDotBlocks(markdown) {
21
+ const blocks = [];
22
+ const regex = /```dot\n([\s\S]*?)```/g;
23
+ let match;
24
+
25
+ match = regex.exec(markdown);
26
+ while (match !== null) {
27
+ const content = match[1].trim();
28
+
29
+ // Extract digraph name
30
+ const nameMatch = content.match(/digraph\s+(\w+)/);
31
+ const name = nameMatch ? nameMatch[1] : `graph_${blocks.length + 1}`;
32
+
33
+ blocks.push({ name, content });
34
+ match = regex.exec(markdown);
35
+ }
36
+
37
+ return blocks;
38
+ }
39
+
40
+ function extractGraphBody(dotContent) {
41
+ // Extract just the body (nodes and edges) from a digraph
42
+ const match = dotContent.match(/digraph\s+\w+\s*\{([\s\S]*)\}/);
43
+ if (!match) return "";
44
+
45
+ let body = match[1];
46
+
47
+ // Remove rankdir (we'll set it once at the top level)
48
+ body = body.replace(/^\s*rankdir\s*=\s*\w+\s*;?\s*$/gm, "");
49
+
50
+ return body.trim();
51
+ }
52
+
53
+ function combineGraphs(blocks, skillName) {
54
+ const bodies = blocks.map((block, i) => {
55
+ const body = extractGraphBody(block.content);
56
+ // Wrap each subgraph in a cluster for visual grouping
57
+ return ` subgraph cluster_${i} {
58
+ label="${block.name}";
59
+ ${body
60
+ .split("\n")
61
+ .map((line) => ` ${line}`)
62
+ .join("\n")}
63
+ }`;
64
+ });
65
+
66
+ return `digraph ${skillName}_combined {
67
+ rankdir=TB;
68
+ compound=true;
69
+ newrank=true;
70
+
71
+ ${bodies.join("\n\n")}
72
+ }`;
73
+ }
74
+
75
+ function renderToSvg(dotContent) {
76
+ try {
77
+ return execSync("dot -Tsvg", {
78
+ input: dotContent,
79
+ encoding: "utf-8",
80
+ maxBuffer: 10 * 1024 * 1024,
81
+ });
82
+ } catch (err) {
83
+ console.error("Error running dot:", err.message);
84
+ if (err.stderr) console.error(err.stderr.toString());
85
+ return null;
86
+ }
87
+ }
88
+
89
+ function main() {
90
+ const args = process.argv.slice(2);
91
+ const combine = args.includes("--combine");
92
+ const skillDirArg = args.find((a) => !a.startsWith("--"));
93
+
94
+ if (!skillDirArg) {
95
+ console.error(
96
+ "Usage: scripts/render-graphs.js <skill-directory> [--combine]",
97
+ );
98
+ console.error("");
99
+ console.error("Options:");
100
+ console.error(" --combine Combine all diagrams into one SVG");
101
+ console.error("");
102
+ console.error("Example (run from the writing-skills directory):");
103
+ console.error(
104
+ " ./scripts/render-graphs.js ../subagent-driven-development",
105
+ );
106
+ console.error(
107
+ " ./scripts/render-graphs.js ../subagent-driven-development --combine",
108
+ );
109
+ process.exit(1);
110
+ }
111
+
112
+ const skillDir = path.resolve(skillDirArg);
113
+ const skillFile = path.join(skillDir, "SKILL.md");
114
+ const skillName = path.basename(skillDir).replace(/-/g, "_");
115
+
116
+ if (!fs.existsSync(skillFile)) {
117
+ console.error(`Error: ${skillFile} not found`);
118
+ process.exit(1);
119
+ }
120
+
121
+ // Check if dot is available
122
+ try {
123
+ execSync("which dot", { encoding: "utf-8" });
124
+ } catch {
125
+ console.error("Error: graphviz (dot) not found. Install with:");
126
+ console.error(" brew install graphviz # macOS");
127
+ console.error(" apt install graphviz # Linux");
128
+ process.exit(1);
129
+ }
130
+
131
+ const markdown = fs.readFileSync(skillFile, "utf-8");
132
+ const blocks = extractDotBlocks(markdown);
133
+
134
+ if (blocks.length === 0) {
135
+ console.log("No ```dot blocks found in", skillFile);
136
+ process.exit(0);
137
+ }
138
+
139
+ console.log(
140
+ `Found ${blocks.length} diagram(s) in ${path.basename(skillDir)}/SKILL.md`,
141
+ );
142
+
143
+ const outputDir = path.join(skillDir, "diagrams");
144
+ if (!fs.existsSync(outputDir)) {
145
+ fs.mkdirSync(outputDir);
146
+ }
147
+
148
+ if (combine) {
149
+ // Combine all graphs into one
150
+ const combined = combineGraphs(blocks, skillName);
151
+ const svg = renderToSvg(combined);
152
+ if (svg) {
153
+ const outputPath = path.join(outputDir, `${skillName}_combined.svg`);
154
+ fs.writeFileSync(outputPath, svg);
155
+ console.log(` Rendered: ${skillName}_combined.svg`);
156
+
157
+ // Also write the dot source for debugging
158
+ const dotPath = path.join(outputDir, `${skillName}_combined.dot`);
159
+ fs.writeFileSync(dotPath, combined);
160
+ console.log(` Source: ${skillName}_combined.dot`);
161
+ } else {
162
+ console.error(" Failed to render combined diagram");
163
+ }
164
+ } else {
165
+ // Render each separately
166
+ for (const block of blocks) {
167
+ const svg = renderToSvg(block.content);
168
+ if (svg) {
169
+ const outputPath = path.join(outputDir, `${block.name}.svg`);
170
+ fs.writeFileSync(outputPath, svg);
171
+ console.log(` Rendered: ${block.name}.svg`);
172
+ } else {
173
+ console.error(` Failed: ${block.name}`);
174
+ }
175
+ }
176
+ }
177
+
178
+ console.log(`\nOutput: ${outputDir}/`);
179
+ }
180
+
181
+ main();