@v11g/agents-rock 1.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 (223) hide show
  1. package/README.md +65 -0
  2. package/bin/agents-rock.mjs +4 -0
  3. package/package.json +13 -0
  4. package/plugins/solution-architect/.claude-plugin/plugin.json +9 -0
  5. package/plugins/solution-architect/skills/analyze-requirements/README.md +75 -0
  6. package/plugins/solution-architect/skills/analyze-requirements/SKILL.md +31 -0
  7. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/OFL.txt +98 -0
  8. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  9. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  10. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  11. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
  12. package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
  13. package/plugins/solution-architect/skills/analyze-requirements/assets/mermaid-theme.json +52 -0
  14. package/plugins/solution-architect/skills/analyze-requirements/assets/section-help.json +101 -0
  15. package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +2389 -0
  16. package/plugins/solution-architect/skills/analyze-requirements/references/interview.md +53 -0
  17. package/plugins/solution-architect/skills/analyze-requirements/references/likec4.md +157 -0
  18. package/plugins/solution-architect/skills/analyze-requirements/references/project-types.md +60 -0
  19. package/plugins/solution-architect/skills/analyze-requirements/references/research.md +78 -0
  20. package/plugins/solution-architect/skills/analyze-requirements/references/viewer.md +772 -0
  21. package/plugins/solution-architect/skills/analyze-requirements/references/writing.md +206 -0
  22. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +74 -0
  23. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/chrome.mjs +66 -0
  24. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/companion-links.mjs +20 -0
  25. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-kinds.mjs +37 -0
  26. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-links.mjs +26 -0
  27. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-routes.mjs +27 -0
  28. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-sections.mjs +78 -0
  29. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/embed.mjs +8 -0
  30. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/er-entities.mjs +16 -0
  31. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/fonts.mjs +39 -0
  32. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/frontmatter.mjs +17 -0
  33. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/inputs.mjs +41 -0
  34. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-config.mjs +41 -0
  35. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-extract.mjs +29 -0
  36. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-steps.mjs +22 -0
  37. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-defs.mjs +20 -0
  38. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-flows.mjs +46 -0
  39. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-inline.mjs +31 -0
  40. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-links.mjs +7 -0
  41. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-list.mjs +64 -0
  42. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-render.mjs +127 -0
  43. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-shape.mjs +19 -0
  44. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-tables.mjs +30 -0
  45. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-views.mjs +48 -0
  46. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-wide.mjs +44 -0
  47. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/nav.mjs +72 -0
  48. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/offline.mjs +19 -0
  49. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/port.mjs +13 -0
  50. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +113 -0
  51. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/section-help.mjs +49 -0
  52. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/slug-registry.mjs +11 -0
  53. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-clusters.mjs +15 -0
  54. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-deployment.mjs +8 -0
  55. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-elections.mjs +20 -0
  56. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-links.mjs +23 -0
  57. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-model-tables.mjs +24 -0
  58. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-palette.mjs +34 -0
  59. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-provenance.mjs +20 -0
  60. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-tree.mjs +16 -0
  61. package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-config.mjs +19 -0
  62. package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-export.mjs +35 -0
  63. package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-gen.mjs +39 -0
  64. package/plugins/solution-architect/skills/analyze-requirements/scripts/render.mjs +130 -0
  65. package/plugins/solution-architect/skills/analyze-requirements/scripts/serve.mjs +71 -0
  66. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +553 -0
  67. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/companion-links.test.mjs +60 -0
  68. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-kinds.test.mjs +41 -0
  69. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-links.test.mjs +104 -0
  70. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-routes.test.mjs +54 -0
  71. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-sections.test.mjs +197 -0
  72. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/embed.test.mjs +28 -0
  73. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/er-entities.test.mjs +14 -0
  74. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/ARCHITECTURE.md +47 -0
  75. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/broken/model.c4 +27 -0
  76. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/pass/model.c4 +29 -0
  77. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/adr/0001-sample.md +18 -0
  78. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimate.html +2 -0
  79. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimation.md +8 -0
  80. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model-broken.json +1 -0
  81. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model.json +1 -0
  82. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/threat-model.md +8 -0
  83. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/sample-model.json +1 -0
  84. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/sample.c4 +28 -0
  85. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fonts.test.mjs +38 -0
  86. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/frontmatter.test.mjs +27 -0
  87. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/inputs.test.mjs +72 -0
  88. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-config-cli.test.mjs +26 -0
  89. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-config.test.mjs +74 -0
  90. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-export-cli.test.mjs +61 -0
  91. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-extract.test.mjs +37 -0
  92. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-gen-cli.test.mjs +73 -0
  93. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-steps.test.mjs +32 -0
  94. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-flows.test.mjs +82 -0
  95. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-links.test.mjs +16 -0
  96. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-provenance.test.mjs +42 -0
  97. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-render.test.mjs +226 -0
  98. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-tables.test.mjs +30 -0
  99. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-views.test.mjs +76 -0
  100. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-wide.test.mjs +76 -0
  101. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/nav.test.mjs +236 -0
  102. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/offline.test.mjs +37 -0
  103. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +86 -0
  104. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gates.test.mjs +20 -0
  105. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/render.test.mjs +171 -0
  106. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/research-workflow.test.mjs +38 -0
  107. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/section-help.test.mjs +101 -0
  108. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/serve.test.mjs +48 -0
  109. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-clusters.test.mjs +46 -0
  110. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-deployment.test.mjs +23 -0
  111. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-elections.test.mjs +30 -0
  112. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-links.test.mjs +38 -0
  113. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-model-tables.test.mjs +51 -0
  114. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-provenance.test.mjs +28 -0
  115. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-tree.test.mjs +43 -0
  116. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/viewer-template.test.mjs +1206 -0
  117. package/plugins/solution-architect/skills/analyze-requirements/scripts/validate.mjs +88 -0
  118. package/plugins/solution-architect/skills/analyze-requirements/workflows/research.js +57 -0
  119. package/plugins/solution-architect/skills/estimate/README.md +67 -0
  120. package/plugins/solution-architect/skills/estimate/SKILL.md +64 -0
  121. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +1128 -0
  122. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +95 -0
  123. package/plugins/solution-architect/skills/estimate/references/interview.md +80 -0
  124. package/plugins/solution-architect/skills/estimate/references/slicing.md +55 -0
  125. package/plugins/solution-architect/skills/estimate/references/techniques.md +111 -0
  126. package/plugins/solution-architect/skills/estimate/references/writing.md +211 -0
  127. package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +23 -0
  128. package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +128 -0
  129. package/plugins/solution-architect/skills/estimate/scripts/lib/components.mjs +19 -0
  130. package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +85 -0
  131. package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +10 -0
  132. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +30 -0
  133. package/plugins/solution-architect/skills/estimate/scripts/lib/roadmap.mjs +32 -0
  134. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +122 -0
  135. package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +128 -0
  136. package/plugins/solution-architect/skills/estimate/scripts/render.mjs +65 -0
  137. package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +623 -0
  138. package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +88 -0
  139. package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +34 -0
  140. package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +112 -0
  141. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/booking-inputs.json +58 -0
  142. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-fail.md +30 -0
  143. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-pass.md +60 -0
  144. package/plugins/solution-architect/skills/estimate/scripts/test/quality-gates.test.mjs +20 -0
  145. package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +71 -0
  146. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +121 -0
  147. package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +129 -0
  148. package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +72 -0
  149. package/plugins/solution-architect/skills/estimate/scripts/validate.mjs +20 -0
  150. package/plugins/solution-architect/skills/new-lead/README.md +48 -0
  151. package/plugins/solution-architect/skills/new-lead/SKILL.md +113 -0
  152. package/plugins/solution-architect/skills/new-lead/assets/dashboard/detail.html +842 -0
  153. package/plugins/solution-architect/skills/new-lead/assets/dashboard/index.html +655 -0
  154. package/plugins/solution-architect/skills/new-lead/assets/dashboard/start.sh +3 -0
  155. package/plugins/solution-architect/skills/new-lead/assets/dashboard/stats.mjs +98 -0
  156. package/plugins/solution-architect/skills/new-lead/assets/dashboard/vendor/reactflow-bundle.js +473 -0
  157. package/plugins/solution-architect/skills/new-lead/assets/vendor-build/entry.jsx +33 -0
  158. package/plugins/solution-architect/skills/new-lead/assets/vendor-build/package-lock.json +1055 -0
  159. package/plugins/solution-architect/skills/new-lead/assets/vendor-build/package.json +19 -0
  160. package/plugins/solution-architect/skills/new-lead/scripts/init-root.mjs +73 -0
  161. package/plugins/solution-architect/skills/new-lead/scripts/lead-upsert.mjs +31 -0
  162. package/plugins/solution-architect/skills/new-lead/scripts/lib/enrich.mjs +20 -0
  163. package/plugins/solution-architect/skills/new-lead/scripts/lib/map-nodes.mjs +124 -0
  164. package/plugins/solution-architect/skills/new-lead/scripts/lib/map.mjs +117 -0
  165. package/plugins/solution-architect/skills/new-lead/scripts/lib/port.mjs +15 -0
  166. package/plugins/solution-architect/skills/new-lead/scripts/lib/registry.mjs +116 -0
  167. package/plugins/solution-architect/skills/new-lead/scripts/serve.mjs +163 -0
  168. package/plugins/solution-architect/skills/new-lead/scripts/test/e2e-workspace.test.mjs +59 -0
  169. package/plugins/solution-architect/skills/new-lead/scripts/test/enrich.test.mjs +16 -0
  170. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/ARCHITECTURE.md +16 -0
  171. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/brief.md +4 -0
  172. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/index.html +11 -0
  173. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/proposal-non-tech.html +2 -0
  174. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/threat-model.html +2 -0
  175. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation-inputs.json +6 -0
  176. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation.json +10 -0
  177. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/notes.md +3 -0
  178. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/proposal-non-tech.md +3 -0
  179. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/rfp.md +3 -0
  180. package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads.json +25 -0
  181. package/plugins/solution-architect/skills/new-lead/scripts/test/init-root.test.mjs +81 -0
  182. package/plugins/solution-architect/skills/new-lead/scripts/test/lead-upsert.test.mjs +67 -0
  183. package/plugins/solution-architect/skills/new-lead/scripts/test/map.test.mjs +72 -0
  184. package/plugins/solution-architect/skills/new-lead/scripts/test/port.test.mjs +31 -0
  185. package/plugins/solution-architect/skills/new-lead/scripts/test/registry-io.test.mjs +57 -0
  186. package/plugins/solution-architect/skills/new-lead/scripts/test/registry.test.mjs +49 -0
  187. package/plugins/solution-architect/skills/new-lead/scripts/test/serve.test.mjs +205 -0
  188. package/plugins/solution-architect/skills/new-lead/scripts/test/stats.test.mjs +92 -0
  189. package/plugins/solution-architect/skills/new-lead/scripts/test/validate-cli.test.mjs +24 -0
  190. package/plugins/solution-architect/skills/new-lead/scripts/test/vendor-bundle.test.mjs +9 -0
  191. package/plugins/solution-architect/skills/new-lead/scripts/validate.mjs +9 -0
  192. package/plugins/solution-architect/skills/proposal/README.md +36 -0
  193. package/plugins/solution-architect/skills/proposal/SKILL.md +58 -0
  194. package/plugins/solution-architect/skills/proposal/assets/proposal-template.html +82 -0
  195. package/plugins/solution-architect/skills/proposal/references/interview.md +63 -0
  196. package/plugins/solution-architect/skills/proposal/references/review.md +28 -0
  197. package/plugins/solution-architect/skills/proposal/references/writing.md +102 -0
  198. package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +22 -0
  199. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +75 -0
  200. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +54 -0
  201. package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +17 -0
  202. package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +43 -0
  203. package/plugins/solution-architect/skills/proposal/scripts/lib/jargon.mjs +9 -0
  204. package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +32 -0
  205. package/plugins/solution-architect/skills/proposal/scripts/render.mjs +60 -0
  206. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +144 -0
  207. package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +93 -0
  208. package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +51 -0
  209. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +30 -0
  210. package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +81 -0
  211. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +22 -0
  212. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +55 -0
  213. package/plugins/solution-architect/skills/proposal/scripts/test/quality-gates.test.mjs +20 -0
  214. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +70 -0
  215. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +40 -0
  216. package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +20 -0
  217. package/src/cli/agents.mjs +12 -0
  218. package/src/cli/args.mjs +46 -0
  219. package/src/cli/install.mjs +68 -0
  220. package/src/cli/main.mjs +124 -0
  221. package/src/cli/picker.mjs +78 -0
  222. package/src/cli/registry.mjs +26 -0
  223. package/src/cli/uninstall.mjs +38 -0
@@ -0,0 +1,88 @@
1
+ import { readFileSync, readdirSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { buildInputs } from './lib/inputs.mjs';
4
+ import { validateProvenance } from './lib/validate-provenance.mjs';
5
+ import { validateElections } from './lib/validate-elections.mjs';
6
+ import { validateModelTables } from './lib/validate-model-tables.mjs';
7
+ import { validateDeployment } from './lib/validate-deployment.mjs';
8
+ import { validateLinks } from './lib/validate-links.mjs';
9
+ import { validateTree } from './lib/validate-tree.mjs';
10
+ import { validateClusters } from './lib/validate-clusters.mjs';
11
+
12
+ function consumeDocs(argv, i, docs) {
13
+ while (argv[i + 1] && !argv[i + 1].startsWith('--')) docs.push(argv[++i]);
14
+ return i;
15
+ }
16
+
17
+ function parseArgs(argv) {
18
+ const args = { root: process.cwd(), docs: [] };
19
+ for (let i = 0; i < argv.length; i += 1) {
20
+ const flag = argv[i];
21
+ if (flag === '--docs') {
22
+ i = consumeDocs(argv, i, args.docs);
23
+ } else if (flag.startsWith('--')) {
24
+ args[flag.slice(2)] = argv[++i];
25
+ }
26
+ }
27
+ return args;
28
+ }
29
+
30
+ function boundaryRows(tables) {
31
+ const t = tables.find((x) => x.section.includes('Project Structure'));
32
+ return (t?.rows ?? []).map((r) => r[0]);
33
+ }
34
+
35
+ function componentRows(tables) {
36
+ const t = tables.find((x) => x.section.includes('Core Components'));
37
+ const col = (t?.headers ?? []).findIndex((h) => /key paths/i.test(h));
38
+ return (t?.rows ?? []).map((r) => ({
39
+ name: r[0].replace(/\[([^\]]*)\]\([^)]*\)/, '$1'),
40
+ keyPaths: col === -1 ? [] : r[col].split(',').map((p) => p.trim()),
41
+ }));
42
+ }
43
+
44
+ function listDirs(dir, hidden = false) {
45
+ return readdirSync(dir, { withFileTypes: true })
46
+ .filter((e) => e.isDirectory() && (hidden || !e.name.startsWith('.')) && e.name !== 'node_modules')
47
+ .map((e) => e.name);
48
+ }
49
+
50
+ function walkDirs(root, hidden = false) {
51
+ const top = listDirs(root, hidden);
52
+ return top.flatMap((d) => [d, ...listDirs(join(root, d), hidden).map((c) => `${d}/${c}`)]);
53
+ }
54
+
55
+ function brownfieldFindings({ inputs, args, root }) {
56
+ const clusters = args.clusters ? JSON.parse(readFileSync(args.clusters, 'utf8')) : [];
57
+ return [
58
+ ...validateTree({
59
+ boundaryRows: boundaryRows(inputs.tables),
60
+ fsDirs: walkDirs(root),
61
+ allDirs: walkDirs(root, true),
62
+ }),
63
+ ...validateClusters({ clusters, componentRows: componentRows(inputs.tables), storeNames: inputs.erNames }),
64
+ ];
65
+ }
66
+
67
+ const args = parseArgs(process.argv.slice(2));
68
+ const root = args.root;
69
+
70
+ const inputs = await buildInputs({
71
+ root,
72
+ archPath: args.arch,
73
+ modelPath: args.model,
74
+ docPaths: args.docs,
75
+ });
76
+
77
+ const findings = [
78
+ ...validateProvenance({ tables: inputs.tables }),
79
+ ...validateElections({ frontmatter: inputs.frontmatter }),
80
+ ...validateModelTables({ model: inputs.model, tables: inputs.tables, erNames: inputs.erNames }),
81
+ ...validateDeployment({ model: inputs.model }),
82
+ ...validateLinks({ links: inputs.links, files: inputs.files, anchors: inputs.anchors }),
83
+ ...(args.mode === 'brownfield' ? brownfieldFindings({ inputs, args, root }) : []),
84
+ ];
85
+
86
+ for (const f of findings) console.log(`FAIL [${f.check}] ${f.message}`);
87
+ if (!findings.length) console.log('ok all checks passed');
88
+ process.exit(findings.length ? 1 : 0);
@@ -0,0 +1,57 @@
1
+ export const meta = {
2
+ name: 'arch-docs-research',
3
+ description: 'Domain, stack, and per-aspect design research with provenance',
4
+ phases: [
5
+ { title: 'Domain', detail: 'concepts + comparable systems' },
6
+ { title: 'Stack', detail: 'verify stated claims, integration facts' },
7
+ { title: 'Design', detail: 'greenfield per-aspect proposals' },
8
+ ],
9
+ }
10
+
11
+ const FACTS = { type: 'object', required: ['facts'], properties: { facts: { type: 'array', items: {
12
+ type: 'object', required: ['fact', 'provenance', 'source'],
13
+ properties: { fact: { type: 'string' }, provenance: { type: 'string' }, source: { type: 'string' } },
14
+ } } } }
15
+
16
+ const dropped = []
17
+ const keep = (label) => (r) => {
18
+ if (r) return r.facts
19
+ dropped.push({ item: label, reason: 'agent returned nothing' })
20
+ log(`DROPPED ${label}: agent returned nothing`)
21
+ return []
22
+ }
23
+
24
+ phase('Domain')
25
+ const domainBriefs = [
26
+ `Research the ${args.domain} domain: core concepts, canonical vocabulary, regulatory constraints. Cite sources. Every fact gets provenance "researched" and a source URL.`,
27
+ `Find 2-3 comparable ${args.domain} systems and their published architectures. Cite sources.`,
28
+ ]
29
+ const domain = (await parallel(domainBriefs.map((p, i) => () =>
30
+ agent(p, { label: `domain-${i}`, phase: 'Domain', schema: FACTS }).then(keep(`domain-${i}`))
31
+ ))).flat()
32
+
33
+ phase('Stack')
34
+ const stackJobs = [
35
+ ...args.statedFacts.map((f) => `Verify this stated claim: "${f.claim}". If verifiable, return it as provenance "researched" with source; if not, return it as provenance "stated" with source "unverified".`),
36
+ ...args.gaps.map((g) => `Research integration facts for ${g}: auth method, rate limits, pricing tier, failure modes. Provenance "researched" with sources.`),
37
+ ]
38
+ const stack = (await parallel(stackJobs.map((p, i) => () =>
39
+ agent(p, { label: `stack-${i}`, phase: 'Stack', schema: FACTS }).then(keep(`stack-${i}`))
40
+ ))).flat()
41
+
42
+ let aspects = []
43
+ if (args.mode === 'greenfield') {
44
+ phase('Design')
45
+ const aspectNames = ['components', 'data', 'deployment', 'security']
46
+ aspects = (await parallel(aspectNames.map((a) => () =>
47
+ agent(
48
+ `Propose the ${a} design for a ${args.projectType} ${args.domain} system, constrained by these researched facts: ${JSON.stringify(domain.slice(0, 20))}. Every proposal gets provenance "proposed", source "this workflow".`,
49
+ { label: `design-${a}`, phase: 'Design', schema: FACTS },
50
+ ).then(keep(`design-${a}`))
51
+ ))).flat()
52
+ } else {
53
+ log('brownfield mode: per-aspect design skipped, scan owns observed facts')
54
+ }
55
+
56
+ log(`research done: ${domain.length} domain, ${stack.length} stack, ${aspects.length} proposed, ${dropped.length} dropped`)
57
+ return { domain, stack, aspects, dropped }
@@ -0,0 +1,67 @@
1
+ # estimate
2
+
3
+ Produce an honest, validated project estimate, then serve it on localhost as an
4
+ interactive what-if page.
5
+
6
+ ## What it produces
7
+
8
+ **`estimation.md`** — scope split into `stated` vs `proposed` items, a task-level
9
+ backlog with confidence and assumptions per row, an AI-aware scenario comparison
10
+ (team composition × Claude Code plan), and the technique used, all backed by
11
+ `estimation.json` (the numbers every table cell comes from — nothing in the
12
+ doc is hand-totaled).
13
+
14
+ **An interactive page** (`estimate.html`) — the same data rendered as a
15
+ self-contained, offline-capable HTML file with live what-if controls (swap
16
+ team/plan, see months and cost recompute), served on `localhost:4173` (or the
17
+ next free port).
18
+
19
+ ## Two run modes
20
+
21
+ - **Standalone** — no existing docs. estimate runs its own interview, sizes
22
+ from evidence you provide, and writes `estimation-inputs.json` +
23
+ `estimation.md` from scratch.
24
+ - **Companion** — an `ARCHITECTURE.md` already exists (from the `analyze-requirements`
25
+ skill). estimate seeds the WBS from its §6 Core Components and the risk
26
+ register from its §15 Risks, seeds a `components` roster from §6 so every
27
+ feature is tagged with the component it implements (untouched components
28
+ are caught by validation), then places `estimation.md` beside it so the
29
+ analyze-requirements viewer picks it up as a companion page. `estimate.html` renders
30
+ into the shared `dist/` output folder (falling back to beside
31
+ `estimation.md`), so viewer and estimate ship as one folder; the viewer
32
+ links it from the estimation tab, and `render.mjs --viewer <path>` adds
33
+ the internal-only back-link.
34
+
35
+ ## Run it
36
+
37
+ ```
38
+ node scripts/compute.mjs --inputs estimation-inputs.json --out estimation.json
39
+ node scripts/validate.mjs --md estimation.md --json estimation.json
40
+ node scripts/render.mjs --json estimation.json --md estimation.md --out .
41
+ ```
42
+
43
+ `validate.mjs` must exit 0 before `render.mjs` will produce a page — an
44
+ unvalidated estimate cannot ship. Add `--client-only` to `render.mjs` for a
45
+ client-safe file with rates and the labor/plan cost breakdown stripped from
46
+ both the embedded data and the task register (totals and months stay) —
47
+ unless `exposeRatesToClient: true` is set in `estimation-inputs.json`, which
48
+ keeps them.
49
+
50
+ ## Dependency
51
+
52
+ Node ≥ 20. The scripts are dependency-free — no `npm install` needed to run
53
+ them.
54
+
55
+ The root `package.json`'s `engines: >=18.3` is a different, lower number for a
56
+ different job: it's the floor for the *installer* (`npx agents-rock`), which
57
+ only copies skill files and creates symlinks. This skill's own runtime needs
58
+ Node ≥ 20, declared in `SKILL.md`, the same as `analyze-requirements`.
59
+
60
+ ## Why the honesty rules
61
+
62
+ An estimate that hides its guesses is worse than no estimate — it looks precise
63
+ right up until a date slips. estimate labels every scope item `stated` or
64
+ `proposed`, renders anything nobody sized as `not estimated` rather than `0`,
65
+ and never applies one blanket AI-speedup multiplier across a whole project —
66
+ only per task category, because boilerplate and novel logic don't speed up the
67
+ same amount.
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: estimate
3
+ description: Interview-driven project estimation with AI-aware delivery scenarios. Use when the user asks for an estimate, effort sizing, a quote, a timeline, staffing, or "how long would this take" — with or without existing architecture docs.
4
+ ---
5
+
6
+ # estimate
7
+
8
+ Produce an honest, validated estimate: confirmed scope split from assumptions,
9
+ a technique that fits the evidence, AI-assisted staffing scenarios, and an
10
+ interactive what-if page served on localhost.
11
+
12
+ ## Hard rules
13
+
14
+ 1. Every estimate row carries confidence + assumptions. A row nobody estimated
15
+ renders `not estimated` — never `0`.
16
+ 2. Every scope item is labeled `stated` or `proposed` — no unlabeled scope.
17
+ 3. Agent judges, script computes: every number in a deliverable comes from
18
+ `scripts/compute.mjs`. Never total, average, or price by hand.
19
+ 4. Never apply one blanket AI multiplier to a whole project — per-task
20
+ category only (`references/ai-multipliers.md`).
21
+ 5. `node scripts/validate.mjs` must exit 0 before the page renders.
22
+
23
+ ## Flow
24
+
25
+ 1. **Detect evidence**: requirements/RFP? ARCHITECTURE.md? codebase? none?
26
+ State findings; the user can override. (`references/interview.md` §1)
27
+ 2. **Depth**: ask QUICK / STANDARD / DEEP first.
28
+ 3. **Interview**: follow `references/interview.md` — pre-fill from evidence,
29
+ ask only holes, run the clear-vs-assumed gate before sizing. Before
30
+ proposing milestones, read `references/slicing.md` — slices are judged
31
+ there, not computed.
32
+ 4. **Technique**: recommend from `references/techniques.md`, state why,
33
+ cite the method's sources (its §Sources — attribution + link, never
34
+ quoted text), confirm.
35
+ 5. **Size**: write judgments to `estimation-inputs.json`
36
+ (`references/writing.md` — the booking fixture is the canonical shape).
37
+ 6. **Compute**: `node scripts/compute.mjs --inputs estimation-inputs.json --out estimation.json`
38
+ 7. **Write**: estimation.md per `references/writing.md`.
39
+ 8. **Validate**: `node scripts/validate.mjs --md estimation.md --json estimation.json`
40
+ — fix findings, re-run until clean.
41
+ 9. **Render + serve**:
42
+ `node scripts/render.mjs --json estimation.json --md estimation.md --out <dir>`
43
+ (add `--client-only` for a client-safe file) — render re-runs the validation
44
+ checks itself and refuses on findings, so an unvalidated page cannot ship.
45
+ Then serve with the analyze-requirements skill's `serve.mjs`; report the URL.
46
+
47
+ ## Companion mode
48
+
49
+ When ARCHITECTURE.md exists: §6 components seed the WBS, §15 risks seed the
50
+ risk register, seed the `components` roster from §6 rows (use the LikeC4
51
+ model's container and component ids where one exists — dotted ids like
52
+ `atlas.goldStore`) and tag every feature with the component it implements,
53
+ flip the `electedDocs` estimation entry to `elected: true`,
54
+ place estimation.md beside ARCHITECTURE.md so the analyze-requirements viewer picks it
55
+ up as a companion page; link the interactive page from it. Render
56
+ estimate.html **into `<dir>/dist/`** — the same folder the viewer renders
57
+ into. When a rendered viewer exists, add `--viewer index.html` for the
58
+ back-link (internal view only; the client render strips it) — index.html and
59
+ estimate.html then ship as one self-contained folder, and the viewer's
60
+ estimation tab links the copy inside it.
61
+
62
+ ## Dependency
63
+
64
+ Node ≥ 20. No npm install needed — the scripts are dependency-free.