@venizia/vulcan 0.4.0 → 0.4.2

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 (141) hide show
  1. package/base/claude/remote-hosts.json +1 -1
  2. package/base/claude/settings.json +75 -3
  3. package/base/hooks/guard-git.ts +55 -0
  4. package/base/hooks/guard-manifest.ts +1 -1
  5. package/base/hooks/guard-outside.ts +66 -0
  6. package/base/hooks/guard-package.ts +3 -2
  7. package/base/hooks/guard-remote-hosts.ts +3 -2
  8. package/base/hooks/guard-writes.ts +1 -1
  9. package/base/hooks/post-tool.ts +36 -0
  10. package/base/hooks/prompt-submit.ts +52 -0
  11. package/base/hooks/stop.ts +38 -0
  12. package/base/hooks/subagent-start.ts +18 -0
  13. package/base/references/delegation-brief.md +63 -0
  14. package/base/references/design-pass.md +39 -0
  15. package/base/references/evidence.md +36 -0
  16. package/base/references/phase-boundaries.md +20 -0
  17. package/base/references/testing.md +89 -0
  18. package/base/rules.md +11 -2
  19. package/base/skills/build-a-feature/SKILL.md +49 -23
  20. package/base/skills/docs-update/SKILL.md +12 -1
  21. package/base/skills/docs-writing/SKILL.md +2 -2
  22. package/base/skills/docs-writing/references/agent-documents.md +53 -0
  23. package/base/skills/fix-a-bug/SKILL.md +84 -0
  24. package/base/skills/fix-a-bug/evals/evals.json +17 -0
  25. package/base/skills/knowledge-sync/SKILL.md +4 -1
  26. package/base/skills/knowledge-sync/knowledge-sync.workflow.js +10 -10
  27. package/base/skills/plan-a-change/SKILL.md +95 -0
  28. package/base/skills/plan-a-change/evals/evals.json +23 -0
  29. package/base/skills/plan-a-change/references/spec-card.md +39 -0
  30. package/base/skills/report-back/SKILL.md +112 -0
  31. package/base/skills/report-back/evals/evals.json +23 -0
  32. package/base/skills/research/SKILL.md +64 -0
  33. package/base/skills/research/evals/evals.json +17 -0
  34. package/base/skills/retro/SKILL.md +69 -0
  35. package/base/skills/retro/evals/evals.json +17 -0
  36. package/base/skills/review-a-change/SKILL.md +90 -0
  37. package/base/skills/review-a-change/evals/evals.json +17 -0
  38. package/base/skills/ship/SKILL.md +82 -0
  39. package/base/skills/ship/evals/evals.json +23 -0
  40. package/base/skills/visualize-work/SKILL.md +87 -0
  41. package/base/skills/visualize-work/evals/evals.json +17 -0
  42. package/base/skills/visualize-work/references/spec.md +65 -0
  43. package/package.json +3 -3
  44. package/src/agents/common/schema.ts +2 -2
  45. package/src/agents/detect.ts +5 -5
  46. package/src/agents/exclude.ts +3 -3
  47. package/src/agents/local.ts +1 -1
  48. package/src/agents/prompt.ts +2 -2
  49. package/src/agents/render.ts +2 -2
  50. package/src/agents/resolve.ts +6 -6
  51. package/src/agents/table.ts +1 -1
  52. package/src/commands/agents.command.ts +4 -4
  53. package/src/commands/clean.command.ts +72 -0
  54. package/src/commands/help.command.ts +11 -0
  55. package/src/commands/index.ts +6 -0
  56. package/src/commands/init.command.ts +4 -1
  57. package/src/commands/profile.command.ts +255 -0
  58. package/src/commands/sync.command.ts +6 -4
  59. package/src/commands/upgrade.command.ts +1 -1
  60. package/src/commands/visualize.command.ts +107 -0
  61. package/src/common/constants.ts +23 -0
  62. package/src/config/common/constants.ts +2 -0
  63. package/src/config/loader.ts +4 -4
  64. package/src/config/packages.ts +1 -1
  65. package/src/config/schema.ts +16 -5
  66. package/src/create/add-app.ts +15 -15
  67. package/src/create/add-lib.ts +7 -7
  68. package/src/create/bunfig.ts +1 -1
  69. package/src/create/dockerignore.ts +4 -4
  70. package/src/create/init-monorepo.ts +3 -1
  71. package/src/create/lib-preset.ts +1 -1
  72. package/src/create/names.ts +7 -6
  73. package/src/create/next.ts +4 -4
  74. package/src/create/preset-menu.ts +4 -4
  75. package/src/create/preset.ts +3 -3
  76. package/src/create/scratch.ts +27 -6
  77. package/src/create/workspace.ts +11 -11
  78. package/src/doctor/checks.ts +231 -45
  79. package/src/doctor/common/constants.ts +4 -0
  80. package/src/doctor/makefile.ts +3 -3
  81. package/src/doctor/runner.ts +16 -1
  82. package/src/doctor/skills.ts +8 -8
  83. package/src/doctor/tags.ts +5 -5
  84. package/src/hooks/common/constants.ts +29 -0
  85. package/src/hooks/common/types.ts +20 -0
  86. package/src/hooks/decision.ts +15 -0
  87. package/src/hooks/guard-git.ts +288 -0
  88. package/src/hooks/guard-manifest.ts +1 -1
  89. package/src/hooks/guard-outside.ts +399 -0
  90. package/src/hooks/guard-package.ts +4 -4
  91. package/src/hooks/guard-writes.ts +5 -5
  92. package/src/hooks/index.ts +6 -0
  93. package/src/hooks/owner-reply.ts +148 -0
  94. package/src/hooks/post-tool.ts +137 -0
  95. package/src/hooks/remote-hosts.ts +25 -23
  96. package/src/hooks/session-digest.ts +24 -4
  97. package/src/hooks/shell.ts +325 -0
  98. package/src/hooks/subagent-card.ts +32 -0
  99. package/src/init/scaffold.ts +6 -6
  100. package/src/local/clean.ts +88 -0
  101. package/src/local/constants.ts +50 -0
  102. package/src/local/format.ts +25 -0
  103. package/src/local/index.ts +4 -0
  104. package/src/local/scan.ts +368 -0
  105. package/src/manifest/render.ts +1 -1
  106. package/src/owner/card.ts +85 -0
  107. package/src/owner/constants.ts +105 -0
  108. package/src/owner/index.ts +8 -0
  109. package/src/owner/profile.ts +123 -0
  110. package/src/owner/schema.ts +147 -0
  111. package/src/owner/shape.ts +388 -0
  112. package/src/owner/survey.ts +289 -0
  113. package/src/owner/view.ts +76 -0
  114. package/src/owner/violations.ts +202 -0
  115. package/src/router.ts +18 -1
  116. package/src/rules/base.ts +1 -1
  117. package/src/rules/parser.ts +5 -5
  118. package/src/signals/claims.ts +71 -0
  119. package/src/signals/classify.ts +132 -0
  120. package/src/signals/constants.ts +88 -0
  121. package/src/signals/index.ts +5 -0
  122. package/src/signals/loop.ts +46 -0
  123. package/src/signals/state.ts +276 -0
  124. package/src/sync/agent-files.ts +4 -4
  125. package/src/sync/agent-removal.ts +6 -6
  126. package/src/sync/atlas-block.ts +1 -1
  127. package/src/sync/base-rules.ts +1 -1
  128. package/src/sync/exclude.ts +9 -9
  129. package/src/sync/local-choice.ts +35 -5
  130. package/src/sync/planner.ts +16 -16
  131. package/src/sync/prune.ts +3 -3
  132. package/src/sync/settings.ts +15 -15
  133. package/src/ui/prompt.ts +3 -3
  134. package/src/visualize/assets.ts +80 -0
  135. package/src/visualize/constants.ts +126 -0
  136. package/src/visualize/index.ts +6 -0
  137. package/src/visualize/layout.ts +107 -0
  138. package/src/visualize/page.ts +211 -0
  139. package/src/visualize/render.ts +161 -0
  140. package/src/visualize/schema.ts +178 -0
  141. package/src/visualize/validate.ts +127 -0
@@ -0,0 +1,127 @@
1
+ import type { TVisualizeSpec } from './schema.ts';
2
+
3
+ interface ICell {
4
+ row: number;
5
+ col: number;
6
+ }
7
+
8
+ /** The boxes an arrow would cross: along the source's row to the target's column, then along that column. */
9
+ const blockersOf = (opts: { from: ICell; to: ICell; cells: Map<string, string> }): string[] => {
10
+ const { from, to, cells } = opts;
11
+ const crossed: ICell[] = [];
12
+ const step = (start: number, end: number): number[] => {
13
+ if (start === end) {
14
+ return [];
15
+ }
16
+
17
+ const sign = end > start ? 1 : -1;
18
+ const between: number[] = [];
19
+
20
+ for (let at = start + sign; at !== end; at += sign) {
21
+ between.push(at);
22
+ }
23
+
24
+ return between;
25
+ };
26
+
27
+ for (const col of step(from.col, to.col)) {
28
+ crossed.push({ row: from.row, col });
29
+ }
30
+
31
+ if (from.row !== to.row && from.col !== to.col) {
32
+ crossed.push({ row: from.row, col: to.col });
33
+ }
34
+
35
+ for (const row of step(from.row, to.row)) {
36
+ crossed.push({ row, col: to.col });
37
+ }
38
+
39
+ return crossed.flatMap((cell) => cells.get(`${cell.row},${cell.col}`) ?? []);
40
+ };
41
+
42
+ /** What a schema cannot say: ids are unique, every edge and step points at something that exists, a cell holds one box. */
43
+ export const checkSpec = (opts: { spec: TVisualizeSpec }): string[] => {
44
+ const problems: string[] = [];
45
+ const { flow } = opts.spec;
46
+
47
+ if (flow === undefined) {
48
+ return problems;
49
+ }
50
+
51
+ const ids = new Set<string>();
52
+ const cells = new Map<string, string>();
53
+ const positions = new Map<string, { cell: ICell }>();
54
+
55
+ for (const node of flow.nodes) {
56
+ if (ids.has(node.id)) {
57
+ problems.push(`flow.nodes: id '${node.id}' is used twice`);
58
+ }
59
+
60
+ ids.add(node.id);
61
+
62
+ const cell = `${node.row},${node.col}`;
63
+ const owner = cells.get(cell);
64
+
65
+ if (owner !== undefined) {
66
+ problems.push(
67
+ `flow.nodes: '${node.id}' and '${owner}' are both in row ${node.row}, col ${node.col}`,
68
+ );
69
+ }
70
+
71
+ cells.set(cell, node.id);
72
+ positions.set(node.id, { cell: { row: node.row, col: node.col } });
73
+ }
74
+
75
+ const edges = new Set<string>();
76
+
77
+ for (const edge of flow.edges) {
78
+ for (const end of [edge.from, edge.to]) {
79
+ if (!ids.has(end)) {
80
+ problems.push(`flow.edges: '${edge.from}>${edge.to}' names '${end}', which is not a node`);
81
+ }
82
+ }
83
+
84
+ if (edge.from === edge.to) {
85
+ problems.push(`flow.edges: '${edge.from}>${edge.to}' loops to itself`);
86
+ }
87
+
88
+ const name = `${edge.from}>${edge.to}`;
89
+
90
+ if (edges.has(name)) {
91
+ problems.push(`flow.edges: '${name}' is drawn twice`);
92
+ }
93
+
94
+ if (edges.has(`${edge.to}>${edge.from}`)) {
95
+ problems.push(
96
+ `flow.edges: '${name}' and '${edge.to}>${edge.from}' run on the same line - draw one arrow, or put the boxes in another place`,
97
+ );
98
+ }
99
+
100
+ edges.add(name);
101
+
102
+ const from = positions.get(edge.from);
103
+ const to = positions.get(edge.to);
104
+
105
+ if (from !== undefined && to !== undefined && edge.from !== edge.to) {
106
+ for (const blocker of blockersOf({ from: from.cell, to: to.cell, cells })) {
107
+ problems.push(`flow.edges: '${name}' would be drawn through box '${blocker}' - move a box`);
108
+ }
109
+ }
110
+ }
111
+
112
+ for (const [index, step] of flow.steps.entries()) {
113
+ for (const id of step.nodes) {
114
+ if (!ids.has(id)) {
115
+ problems.push(`flow.steps[${index}]: node '${id}' does not exist`);
116
+ }
117
+ }
118
+
119
+ for (const name of step.edges) {
120
+ if (!edges.has(name)) {
121
+ problems.push(`flow.steps[${index}]: edge '${name}' does not exist`);
122
+ }
123
+ }
124
+ }
125
+
126
+ return problems;
127
+ };