@brunosouzas/stackledger 0.0.0-stage → 0.5.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 (323) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +261 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +97 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/control.d.ts +2 -0
  7. package/dist/control.js +22 -0
  8. package/dist/control.js.map +1 -0
  9. package/dist/discover-command.d.ts +7 -0
  10. package/dist/discover-command.js +60 -0
  11. package/dist/discover-command.js.map +1 -0
  12. package/dist/discovery/annotations.d.ts +24 -0
  13. package/dist/discovery/annotations.js +37 -0
  14. package/dist/discovery/annotations.js.map +1 -0
  15. package/dist/discovery/host.d.ts +47 -0
  16. package/dist/discovery/host.js +56 -0
  17. package/dist/discovery/host.js.map +1 -0
  18. package/dist/discovery/index.d.ts +15 -0
  19. package/dist/discovery/index.js +30 -0
  20. package/dist/discovery/index.js.map +1 -0
  21. package/dist/discovery/machine.d.ts +14 -0
  22. package/dist/discovery/machine.js +17 -0
  23. package/dist/discovery/machine.js.map +1 -0
  24. package/dist/discovery/run.d.ts +39 -0
  25. package/dist/discovery/run.js +130 -0
  26. package/dist/discovery/run.js.map +1 -0
  27. package/dist/discovery/snapshot.d.ts +60 -0
  28. package/dist/discovery/snapshot.js +161 -0
  29. package/dist/discovery/snapshot.js.map +1 -0
  30. package/dist/discovery/sources/apps.d.ts +3 -0
  31. package/dist/discovery/sources/apps.js +136 -0
  32. package/dist/discovery/sources/apps.js.map +1 -0
  33. package/dist/discovery/sources/brew.d.ts +15 -0
  34. package/dist/discovery/sources/brew.js +69 -0
  35. package/dist/discovery/sources/brew.js.map +1 -0
  36. package/dist/discovery/sources/common.d.ts +39 -0
  37. package/dist/discovery/sources/common.js +70 -0
  38. package/dist/discovery/sources/common.js.map +1 -0
  39. package/dist/discovery/sources/index.d.ts +8 -0
  40. package/dist/discovery/sources/index.js +12 -0
  41. package/dist/discovery/sources/index.js.map +1 -0
  42. package/dist/discovery/sources/launchd.d.ts +3 -0
  43. package/dist/discovery/sources/launchd.js +65 -0
  44. package/dist/discovery/sources/launchd.js.map +1 -0
  45. package/dist/discovery/sources/mas.d.ts +9 -0
  46. package/dist/discovery/sources/mas.js +25 -0
  47. package/dist/discovery/sources/mas.js.map +1 -0
  48. package/dist/discovery/sources/mise.d.ts +5 -0
  49. package/dist/discovery/sources/mise.js +64 -0
  50. package/dist/discovery/sources/mise.js.map +1 -0
  51. package/dist/discovery/sources/npm.d.ts +12 -0
  52. package/dist/discovery/sources/npm.js +34 -0
  53. package/dist/discovery/sources/npm.js.map +1 -0
  54. package/dist/discovery/sources/pipx.d.ts +4 -0
  55. package/dist/discovery/sources/pipx.js +82 -0
  56. package/dist/discovery/sources/pipx.js.map +1 -0
  57. package/dist/discovery/types.d.ts +73 -0
  58. package/dist/discovery/types.js +10 -0
  59. package/dist/discovery/types.js.map +1 -0
  60. package/dist/discovery/write.d.ts +50 -0
  61. package/dist/discovery/write.js +196 -0
  62. package/dist/discovery/write.js.map +1 -0
  63. package/dist/drift-command.d.ts +62 -0
  64. package/dist/drift-command.js +375 -0
  65. package/dist/drift-command.js.map +1 -0
  66. package/dist/drift-formats.d.ts +3 -0
  67. package/dist/drift-formats.js +54 -0
  68. package/dist/drift-formats.js.map +1 -0
  69. package/dist/drift.d.ts +95 -0
  70. package/dist/drift.js +206 -0
  71. package/dist/drift.js.map +1 -0
  72. package/dist/errors.d.ts +15 -0
  73. package/dist/errors.js +26 -0
  74. package/dist/errors.js.map +1 -0
  75. package/dist/graph.d.ts +103 -0
  76. package/dist/graph.js +181 -0
  77. package/dist/graph.js.map +1 -0
  78. package/dist/ics.d.ts +18 -0
  79. package/dist/ics.js +103 -0
  80. package/dist/ics.js.map +1 -0
  81. package/dist/identity.d.ts +18 -0
  82. package/dist/identity.js +36 -0
  83. package/dist/identity.js.map +1 -0
  84. package/dist/index.d.ts +14 -0
  85. package/dist/index.js +9 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/map/badges.d.ts +20 -0
  88. package/dist/map/badges.js +95 -0
  89. package/dist/map/badges.js.map +1 -0
  90. package/dist/map/command.d.ts +8 -0
  91. package/dist/map/command.js +86 -0
  92. package/dist/map/command.js.map +1 -0
  93. package/dist/map/heap.d.ts +15 -0
  94. package/dist/map/heap.js +57 -0
  95. package/dist/map/heap.js.map +1 -0
  96. package/dist/map/ink.d.ts +11 -0
  97. package/dist/map/ink.js +10 -0
  98. package/dist/map/ink.js.map +1 -0
  99. package/dist/map/labels.d.ts +43 -0
  100. package/dist/map/labels.js +172 -0
  101. package/dist/map/labels.js.map +1 -0
  102. package/dist/map/layout.d.ts +64 -0
  103. package/dist/map/layout.js +228 -0
  104. package/dist/map/layout.js.map +1 -0
  105. package/dist/map/model.d.ts +46 -0
  106. package/dist/map/model.js +84 -0
  107. package/dist/map/model.js.map +1 -0
  108. package/dist/map/neighbourhood.d.ts +18 -0
  109. package/dist/map/neighbourhood.js +137 -0
  110. package/dist/map/neighbourhood.js.map +1 -0
  111. package/dist/map/parallel.d.ts +35 -0
  112. package/dist/map/parallel.js +261 -0
  113. package/dist/map/parallel.js.map +1 -0
  114. package/dist/map/pieces.d.ts +12 -0
  115. package/dist/map/pieces.js +15 -0
  116. package/dist/map/pieces.js.map +1 -0
  117. package/dist/map/relations.d.ts +39 -0
  118. package/dist/map/relations.js +122 -0
  119. package/dist/map/relations.js.map +1 -0
  120. package/dist/map/route.d.ts +25 -0
  121. package/dist/map/route.js +165 -0
  122. package/dist/map/route.js.map +1 -0
  123. package/dist/map/strip.d.ts +29 -0
  124. package/dist/map/strip.js +120 -0
  125. package/dist/map/strip.js.map +1 -0
  126. package/dist/map/suggest.d.ts +21 -0
  127. package/dist/map/suggest.js +97 -0
  128. package/dist/map/suggest.js.map +1 -0
  129. package/dist/map/svg.d.ts +29 -0
  130. package/dist/map/svg.js +203 -0
  131. package/dist/map/svg.js.map +1 -0
  132. package/dist/map/themes.d.ts +64 -0
  133. package/dist/map/themes.js +94 -0
  134. package/dist/map/themes.js.map +1 -0
  135. package/dist/map/xml.d.ts +6 -0
  136. package/dist/map/xml.js +57 -0
  137. package/dist/map/xml.js.map +1 -0
  138. package/dist/map/zones.d.ts +19 -0
  139. package/dist/map/zones.js +46 -0
  140. package/dist/map/zones.js.map +1 -0
  141. package/dist/mcp.d.ts +2 -0
  142. package/dist/mcp.js +145 -0
  143. package/dist/mcp.js.map +1 -0
  144. package/dist/money.d.ts +32 -0
  145. package/dist/money.js +91 -0
  146. package/dist/money.js.map +1 -0
  147. package/dist/report-command.d.ts +3 -0
  148. package/dist/report-command.js +85 -0
  149. package/dist/report-command.js.map +1 -0
  150. package/dist/report-formats.d.ts +11 -0
  151. package/dist/report-formats.js +157 -0
  152. package/dist/report-formats.js.map +1 -0
  153. package/dist/reports.d.ts +105 -0
  154. package/dist/reports.js +247 -0
  155. package/dist/reports.js.map +1 -0
  156. package/dist/scaffold.d.ts +30 -0
  157. package/dist/scaffold.js +140 -0
  158. package/dist/scaffold.js.map +1 -0
  159. package/dist/schema.d.ts +345 -0
  160. package/dist/schema.js +120 -0
  161. package/dist/schema.js.map +1 -0
  162. package/dist/secrets.d.ts +7 -0
  163. package/dist/secrets.js +68 -0
  164. package/dist/secrets.js.map +1 -0
  165. package/dist/site/build.d.ts +22 -0
  166. package/dist/site/build.js +198 -0
  167. package/dist/site/build.js.map +1 -0
  168. package/dist/site/command.d.ts +2 -0
  169. package/dist/site/command.js +221 -0
  170. package/dist/site/command.js.map +1 -0
  171. package/dist/site/data.d.ts +225 -0
  172. package/dist/site/data.js +243 -0
  173. package/dist/site/data.js.map +1 -0
  174. package/dist/site/fs-ops.d.ts +35 -0
  175. package/dist/site/fs-ops.js +26 -0
  176. package/dist/site/fs-ops.js.map +1 -0
  177. package/dist/site/owners.d.ts +5 -0
  178. package/dist/site/owners.js +50 -0
  179. package/dist/site/owners.js.map +1 -0
  180. package/dist/site/paths.d.ts +34 -0
  181. package/dist/site/paths.js +48 -0
  182. package/dist/site/paths.js.map +1 -0
  183. package/dist/site/policy.d.ts +17 -0
  184. package/dist/site/policy.js +26 -0
  185. package/dist/site/policy.js.map +1 -0
  186. package/dist/site/publish.d.ts +14 -0
  187. package/dist/site/publish.js +90 -0
  188. package/dist/site/publish.js.map +1 -0
  189. package/dist/site/relative.d.ts +14 -0
  190. package/dist/site/relative.js +265 -0
  191. package/dist/site/relative.js.map +1 -0
  192. package/dist/site/skills-build.d.ts +22 -0
  193. package/dist/site/skills-build.js +126 -0
  194. package/dist/site/skills-build.js.map +1 -0
  195. package/dist/site/skills-data.d.ts +89 -0
  196. package/dist/site/skills-data.js +94 -0
  197. package/dist/site/skills-data.js.map +1 -0
  198. package/dist/site/staging.d.ts +19 -0
  199. package/dist/site/staging.js +76 -0
  200. package/dist/site/staging.js.map +1 -0
  201. package/dist/site/ui-icons.d.ts +4 -0
  202. package/dist/site/ui-icons.js +19 -0
  203. package/dist/site/ui-icons.js.map +1 -0
  204. package/dist/skills/command.d.ts +8 -0
  205. package/dist/skills/command.js +64 -0
  206. package/dist/skills/command.js.map +1 -0
  207. package/dist/skills/frontmatter.d.ts +37 -0
  208. package/dist/skills/frontmatter.js +219 -0
  209. package/dist/skills/frontmatter.js.map +1 -0
  210. package/dist/skills/graph.d.ts +39 -0
  211. package/dist/skills/graph.js +100 -0
  212. package/dist/skills/graph.js.map +1 -0
  213. package/dist/skills/ignore.d.ts +34 -0
  214. package/dist/skills/ignore.js +138 -0
  215. package/dist/skills/ignore.js.map +1 -0
  216. package/dist/skills/lines.d.ts +53 -0
  217. package/dist/skills/lines.js +221 -0
  218. package/dist/skills/lines.js.map +1 -0
  219. package/dist/skills/map-command.d.ts +28 -0
  220. package/dist/skills/map-command.js +533 -0
  221. package/dist/skills/map-command.js.map +1 -0
  222. package/dist/skills/mermaid.d.ts +29 -0
  223. package/dist/skills/mermaid.js +261 -0
  224. package/dist/skills/mermaid.js.map +1 -0
  225. package/dist/skills/metro.d.ts +8 -0
  226. package/dist/skills/metro.js +93 -0
  227. package/dist/skills/metro.js.map +1 -0
  228. package/dist/skills/read.d.ts +17 -0
  229. package/dist/skills/read.js +54 -0
  230. package/dist/skills/read.js.map +1 -0
  231. package/dist/skills/rules.d.ts +28 -0
  232. package/dist/skills/rules.js +57 -0
  233. package/dist/skills/rules.js.map +1 -0
  234. package/dist/skills/source.d.ts +66 -0
  235. package/dist/skills/source.js +281 -0
  236. package/dist/skills/source.js.map +1 -0
  237. package/dist/skills/walk.d.ts +64 -0
  238. package/dist/skills/walk.js +281 -0
  239. package/dist/skills/walk.js.map +1 -0
  240. package/dist/source.d.ts +40 -0
  241. package/dist/source.js +199 -0
  242. package/dist/source.js.map +1 -0
  243. package/dist/stdout.d.ts +2 -0
  244. package/dist/stdout.js +24 -0
  245. package/dist/stdout.js.map +1 -0
  246. package/dist/validate.d.ts +45 -0
  247. package/dist/validate.js +321 -0
  248. package/dist/validate.js.map +1 -0
  249. package/dist/views.d.ts +25 -0
  250. package/dist/views.js +58 -0
  251. package/dist/views.js.map +1 -0
  252. package/examples/catalogue-repository/.github/workflows/stackledger.yml +122 -0
  253. package/examples/catalogue-repository/README.md +96 -0
  254. package/examples/catalogue-repository/catalog/catalog-info.yaml +12 -0
  255. package/examples/hosting/Caddyfile +69 -0
  256. package/examples/northwind/catalog-info.yaml +680 -0
  257. package/examples/northwind/stackledger.yaml +16 -0
  258. package/examples/northwind-machine/snapshot.json +309 -0
  259. package/examples/northwind-skills/agents/builder.md +10 -0
  260. package/examples/northwind-skills/agents/reviewer.md +10 -0
  261. package/examples/northwind-skills/designer/SKILL.md +8 -0
  262. package/examples/northwind-skills/editor/SKILL.md +8 -0
  263. package/examples/northwind-skills/engineering/SKILL.md +12 -0
  264. package/examples/northwind-skills/linter/SKILL.md +8 -0
  265. package/examples/northwind-skills/linter/rules.md +5 -0
  266. package/examples/northwind-skills/publishing/SKILL.md +12 -0
  267. package/examples/northwind-skills/publishing/rules.md +5 -0
  268. package/examples/northwind-skills/spec-writer/SKILL.md +8 -0
  269. package/examples/northwind-skills/stackledger-skills.yaml +51 -0
  270. package/examples/northwind-skills/tester/SKILL.md +10 -0
  271. package/examples/northwind-skills/writer/SKILL.md +8 -0
  272. package/examples/northwind-skills/writer/rules.md +6 -0
  273. package/npm-shrinkwrap.json +5016 -0
  274. package/package.json +52 -4
  275. package/site/LICENSE-astroplate +21 -0
  276. package/site/README.md +18 -0
  277. package/site/package.json +6 -0
  278. package/site/public/brand-mark-dark.svg +7 -0
  279. package/site/public/favicon.svg +6 -0
  280. package/site/public/home-banner.svg +93 -0
  281. package/site/public/link-icons/email-dark.svg +7 -0
  282. package/site/public/link-icons/email-light.svg +6 -0
  283. package/site/public/link-icons/github-dark.svg +8 -0
  284. package/site/public/link-icons/github-light.svg +7 -0
  285. package/site/public/link-icons/linkedin-dark.svg +8 -0
  286. package/site/public/link-icons/linkedin-light.svg +7 -0
  287. package/site/public/link-icons/website-dark.svg +8 -0
  288. package/site/public/link-icons/website-light.svg +7 -0
  289. package/site/src/components/Footer.astro +25 -0
  290. package/site/src/components/Header.astro +35 -0
  291. package/site/src/components/Impact.astro +55 -0
  292. package/site/src/components/LinkOrText.astro +12 -0
  293. package/site/src/components/SkillItem.astro +141 -0
  294. package/site/src/components/SubNav.astro +40 -0
  295. package/site/src/components/ThemeSwitch.astro +13 -0
  296. package/site/src/components/Themed.astro +15 -0
  297. package/site/src/layouts/Base.astro +52 -0
  298. package/site/src/lib/site.ts +25 -0
  299. package/site/src/pages/[reports].astro +222 -0
  300. package/site/src/pages/agents/[file].astro +14 -0
  301. package/site/src/pages/index.astro +72 -0
  302. package/site/src/pages/journeys/[name].astro +50 -0
  303. package/site/src/pages/journeys/index.astro +37 -0
  304. package/site/src/pages/licences/[name].astro +56 -0
  305. package/site/src/pages/map/index.astro +78 -0
  306. package/site/src/pages/playbooks/[file].astro +14 -0
  307. package/site/src/pages/rules/[...rules].astro +61 -0
  308. package/site/src/pages/skill-map/[...map].astro +101 -0
  309. package/site/src/pages/skills/[...list].astro +75 -0
  310. package/site/src/pages/skills/[file].astro +14 -0
  311. package/site/src/pages/software/[name].astro +155 -0
  312. package/site/src/pages/software/index.astro +71 -0
  313. package/site/src/scripts/diagram.ts +8 -0
  314. package/site/src/scripts/links.ts +31 -0
  315. package/site/src/scripts/map.ts +133 -0
  316. package/site/src/scripts/software.ts +32 -0
  317. package/site/src/scripts/theme.ts +52 -0
  318. package/site/src/styles/base.css +481 -0
  319. package/site/src/styles/fonts.css +60 -0
  320. package/site/src/styles/override.css +1 -0
  321. package/site/src/styles/pages.css +315 -0
  322. package/site/src/styles/tokens.css +87 -0
  323. package/skills/stackledger/SKILL.md +155 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Bruno Souza
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
package/README.md CHANGED
@@ -1,3 +1,262 @@
1
- # Temporary Holding Version
1
+ # stackledger
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Govern your software stack and licences, drawn as a metro map.
4
+
5
+ [![OpenSpec](https://github.com/brunosouzas/stackledger/actions/workflows/openspec.yml/badge.svg)](https://github.com/brunosouzas/stackledger/actions/workflows/openspec.yml)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
7
+
8
+ stackledger is a small, local-first tool for people and small companies who want to know what software they run, who owns it, which licences they pay for and when those renew. You describe your software in YAML files kept in Git, in the [Backstage](https://backstage.io/docs/features/software-catalog/descriptor-format) format. stackledger checks them and turns them into a static website you host behind your own sign-in. On a Mac it can also record what is installed and compare it with the catalogue, without changing either: you or your agent then update the catalogue through a reviewed pull request.
9
+
10
+ <picture>
11
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/map-dark.svg">
12
+ <img alt="A fictitious company's software as a metro map" src="docs/images/map-light.svg">
13
+ </picture>
14
+
15
+ *Generated by `stackledger map` from the fictitious [Northwind catalogue](examples/northwind/), dated 2027-06-01.*
16
+
17
+ ## Contents
18
+
19
+ - [Status](#status)
20
+ - [Features](#features)
21
+ - [How it works](#how-it-works)
22
+ - [Security](#security)
23
+ - [Using it with AI agents](#using-it-with-ai-agents)
24
+ - [Usage](#usage)
25
+ - [The website](#the-website)
26
+ - [Skills on the site](#skills-on-the-site)
27
+ - [Catalogue format](#catalogue-format)
28
+ - [Agent skills](#agent-skills)
29
+ - [How this project is built](#how-this-project-is-built)
30
+ - [Contributing](#contributing)
31
+ - [License](#license)
32
+
33
+ ## Status
34
+
35
+ Early development; the latest release on npm is `@brunosouzas/stackledger` 0.5.0. The catalogue format, the `validate`, `map`, `build` and `report` commands, the `mcp` server, Mac discovery (`stackledger discover` and `stackledger drift`), the agent skills check and map (`stackledger skills validate` and `stackledger skills map`) and the Skills section of the site (`stackledger build --skills`) work from npm or from source (see [Usage](#usage)). The order of the rest is in the [roadmap](docs/roadmap.md).
36
+
37
+ For a separate catalogue repository, copy the [pipeline template](examples/catalogue-repository/). Set up [protected hosting](docs/hosting.md) before the first deploy. The fictitious Northwind catalogue and its skill set run as a [demo](docs/demo.md) of the corporate mode, Software and Skills, at <https://stackledger-demo.pages.dev/>; it is protected by Cloudflare Access and only the owner can sign in, so for you it shows the sign-in page, which is the point. The [release guide](docs/release.md) covers npm publication, provenance and the SBOM.
38
+
39
+ ## Features
40
+
41
+ Planned for the first version:
42
+
43
+ - **A metro map of your software.** Each line is a journey, such as "ship a feature" or "send an invoice", and each station is a piece of software. Interchanges are the tools several journeys depend on. Stations stay where you put them, so the map does not reshuffle when the catalogue changes.
44
+ - **A software list with one page per item.** Owner, lifecycle, licence, the journeys it serves, a diagram of what it depends on and what depends on it, and what breaks if you remove it.
45
+ - **Licence reports.** Renewals, cost per month and year for each currency by owner, payer and zone, and items nobody owns, with a calendar file of renewal dates.
46
+ - **Drift on a Mac.** What is installed but not declared, and what is declared but missing.
47
+ - **Two views.** A `full` view for owners and finance, and a `staff` view without costs or renewal dates.
48
+ - **An MCP server**, so your AI agent can query and check the catalogue.
49
+ - **Your agent skills on the same site.** Skills, playbooks and agents with their declared relations, rules and a skills metro map whose zones are your playbooks.
50
+
51
+ ## How it works
52
+
53
+ ![How stackledger works: the catalogue in a private Git repository, GitHub Actions validates and builds it with stackledger from npm, and publishes the static site to Cloudflare Pages behind Cloudflare Access; discovery stays on your Mac](https://raw.githubusercontent.com/brunosouzas/stackledger/main/docs/images/how-it-works.svg)
54
+
55
+ The diagram as Mermaid, and the personal and corporate modes: [docs/how-it-works.md](https://github.com/brunosouzas/stackledger/blob/main/docs/how-it-works.md).
56
+
57
+ 1. **The catalogue lives in its own repository**, private when it holds real data. stackledger never holds your data. A company that already uses Backstage can point it at the same files. Why: [ADR 2](docs/adr/0002-catalogue-in-backstage-format-in-its-own-repository.md).
58
+ 2. **Lines are journeys, not categories.** A journey has an order; a category does not. Categories become zones. Why: [ADR 3](docs/adr/0003-lines-are-journeys.md).
59
+ 3. **The map engine is our own, and station positions are data.** Existing engines reshuffled the whole map after a small change. Why: [ADR 4](docs/adr/0004-own-map-engine-with-stored-positions.md).
60
+ 4. **The website is static.** No server, no database, nothing to patch. Why: [ADR 5](docs/adr/0005-static-site-no-server.md).
61
+ 5. **It is written in TypeScript**, so the same map engine runs at build time and in the browser. Why: [ADR 9](docs/adr/0009-typescript-end-to-end.md).
62
+ 6. **Agent skills are a second ledger in the same tool.** The skills, agents, playbooks and rules your AI agents use are read from their own folders, never copied into YAML. `stackledger skills validate` checks them, `stackledger skills map` draws them in the skills repository, and since 0.3.0 the site has a Skills section next to Software; linking each skill to the software it needs is planned. Why: [ADR 10](docs/adr/0010-agent-skills-are-a-second-ledger-read-from-their-folders.md).
63
+ 7. **It looks like brunosouzas.com.** The map, the diagrams, the favicon and the site's colours and fonts come from [`@brunosouzas/design-system`](https://www.npmjs.com/package/@brunosouzas/design-system), a dependency of the published package with no dependencies of its own; stackledger keeps the layout and writes every piece through its own SVG writer. See [the map](docs/map.md#routes-and-themes) and [the site](docs/site.md).
64
+
65
+ [How it works, end to end](docs/how-it-works.md) draws the publication path: a push to `main` of the private catalogue repository, GitHub Actions, Cloudflare Pages behind Cloudflare Access, and the personal (one site, one reader) and corporate (two sites) modes.
66
+
67
+ ## Security
68
+
69
+ A software catalogue maps its owner's attack surface: which VPN, which secret store, which versions. stackledger is designed around that:
70
+
71
+ - **No sign-in code in the tool.** The site sits behind an identity-aware proxy that uses your existing accounts (Google Workspace, Microsoft 365). [ADR 6](docs/adr/0006-authentication-at-an-identity-aware-proxy.md)
72
+ - **Two views, built as two sites.** The `staff` site does not contain costs, renewal dates, payers, seats, password-manager references or notes at all, so nothing leaks through the browser. You choose the hidden fields. [ADR 7](docs/adr/0007-two-views-built-as-separate-sites.md)
73
+ - **No secrets in the catalogue.** `validate` rejects fields named like secrets, private keys and card numbers, and never repeats the value in its message.
74
+ - **Nothing leaves your machine.** No telemetry, no analytics, no third-party scripts; discovery only reads and never uses `sudo`.
75
+ - **Read access to the catalogue repository equals the `full` view.** Give everyone else the website.
76
+
77
+ To report a vulnerability, see [SECURITY.md](SECURITY.md).
78
+
79
+ ## Using it with AI agents
80
+
81
+ stackledger does not call any AI model. Instead, a read-only [MCP](https://modelcontextprotocol.io/) server lets the agent you already use (Claude Code, Codex, Hermes or any MCP client) ask questions such as "what depends on this app?", "what breaks if I remove it?" or "what renews this month?", and validate the YAML it writes. With `--view staff` it serves only what the staff view shows, and offers no renewals or validation. Why: [ADR 8](docs/adr/0008-read-only-mcp-early-no-ai-in-the-core.md).
82
+
83
+ - [docs/mcp.md](docs/mcp.md): the tools, the views, and configuration for Claude Code, Codex and Hermes.
84
+ - [skills/stackledger/SKILL.md](skills/stackledger/SKILL.md): an agent skill for maintaining a catalogue (add an item, link a licence, add a line, place a station, run `validate`).
85
+
86
+ ## Usage
87
+
88
+ Use npm with Node.js 22.12 or later. The package is `@brunosouzas/stackledger` from 0.4.1, the same code as 0.4.0; versions up to 0.4.0 were published as `stackledger`, now deprecated, and the command is `stackledger` in both. Version 0.4.0 adds the home page (the map moves to `/map/`, the default title becomes `stackledger`, `spec.site.home`), whole station names on both maps and rule counts on the skills map, and skips hidden folders in a catalogue; 0.3.0 added the Skills section of `stackledger build` (`--skills`, `spec.skills.folders`, `stackledger-skills.yaml`); 0.2.0 added the agent skills commands (`skills validate`, `.stackledgerignore`, `skills map`); 0.1.0 has the catalogue commands only.
89
+
90
+ ```sh
91
+ npx @brunosouzas/stackledger@0.5.0 --help
92
+ npx @brunosouzas/stackledger@0.5.0 validate /path/to/catalogue
93
+ ```
94
+
95
+ To run it from source (for development, or a change not yet on npm):
96
+
97
+ ```sh
98
+ npm ci
99
+ npm run build
100
+ node dist/cli.js validate /path/to/catalogue
101
+ node dist/cli.js validate /path/to/catalogue --json
102
+ node dist/cli.js mcp /path/to/catalogue --view staff
103
+ node dist/cli.js map examples/northwind --date 2027-06-01 > map.svg
104
+ node dist/cli.js build examples/northwind --out ./public --date 2027-06-01
105
+ node dist/cli.js build examples/northwind --out ./public --date 2027-06-01 --skills examples/northwind-skills
106
+ node dist/cli.js report examples/northwind --date 2027-06-01 --format csv > licences.csv
107
+ node dist/cli.js discover
108
+ node dist/cli.js drift examples/northwind --snapshot examples/northwind-machine/snapshot.json
109
+ node dist/cli.js skills validate /path/to/skills
110
+ cd /path/to/skills && node /path/to/stackledger/dist/cli.js skills map . --out docs/skills-map
111
+ ```
112
+
113
+ | Command | Does | Status |
114
+ |---|---|---|
115
+ | `stackledger validate [folder]` | Checks a catalogue and reports each problem with file, line and field. Exit 0: no errors (warnings allowed); 1: catalogue errors; 2: usage or folder problem | Available (npm 0.5.0, source) |
116
+ | `stackledger mcp <folder> [--view full\|staff]` | Serves the catalogue read-only to AI agents over MCP on stdio; see [docs/mcp.md](docs/mcp.md). Exit 2: usage or folder problem | Available (npm 0.5.0, source) |
117
+ | `stackledger map <folder> [--view full\|staff] [--theme light\|dark] [--date YYYY-MM-DD]` | Draws a self-contained SVG on stdout; diagnostics and suggestions on stderr. Exit 0 even with catalogue errors; 2 for usage/folder problems. See [docs/map.md](docs/map.md) | Available (npm 0.5.0, source) |
118
+ | `stackledger build <folder> --out <dir> [--date YYYY-MM-DD] [--skills <folder>]...` | Builds the `full` and `staff` static sites into `<dir>/full/` and `<dir>/staff/` (only `full` in the personal mode), with `_headers`, `robots.txt` and `_redirects`, replacing an earlier build atomically; with a skill set, both sites get the Skills section ([Skills on the site](#skills-on-the-site)); report on stderr. Exit 0 even with catalogue or skill-set errors; 1: internal failure, a broken `Settings` that sets `spec.skills`, a skills folder with nothing in it or two items with one page name (the earlier build is left as it was); 2: usage or folder problem. See [docs/site.md](docs/site.md) | Available (npm 0.5.0, source) |
119
+ | `stackledger report <folder> [--date YYYY-MM-DD] [--days N] [--format text\|json\|csv\|ics]` | Prints the licence report of the `full` view on stdout: renewals in the next `--days` (default 90), recurring cost per currency by owner, payer and zone, one-off and planned costs, incomplete licences; or the renewal calendar. Exit 0 even with catalogue errors; 1: the report could not be computed or written; 2: usage or folder problem. See [docs/reports.md](docs/reports.md) | Available (npm 0.5.0, source) |
120
+ | `stackledger discover` | Reads what this Mac has installed (Homebrew, App Store, applications, launchd, mise, npm, pipx), with every program in the macOS sandbox, and writes `~/.stackledger/<machine>/snapshot.json`; one summary line per source on stdout. Exit 0 also with skipped sources; 1: not macOS, no sandbox or the file could not be written safely; 2: usage problem. See [docs/discovery.md](docs/discovery.md) | Available (npm 0.5.0, source) |
121
+ | `stackledger drift <folder> [--snapshot <file>] [--format text\|json] [--scaffold <dir>]` | Compares the snapshot with the catalogue through `stackledger/<source>` annotations: what is not declared (with the annotation to add), what is missing, what could not be checked, and `dependsOn` relations to confirm; `--scaffold` writes draft component files into a new folder outside the catalogue. Exit 0 even with catalogue errors; 1: internal or write failure; 2: usage, folder or snapshot problem. See [docs/discovery.md](docs/discovery.md) | Available (npm 0.5.0, source) |
122
+ | `stackledger skills validate [folder...] [--json]` | Checks agent skills, playbooks, agents and rules read from the given folders (default: the current folder) as one set, and reports each problem with file, line and field. Exit 0: no errors (warnings allowed); 1: errors; 2: usage or folder problem. See [docs/skills.md](docs/skills.md) | Available (npm 0.5.0, source) |
123
+ | `stackledger skills map [folder...] --out <folder> [--check]` | Writes Markdown pages with Mermaid diagrams of the set's declared relations into `<folder>`: an index and one page per skill, playbook and agent, byte for byte the same on every machine; `--check` writes nothing and lists what is out of date. Exit 0: written (also with errors in the set) or up to date; 1: out of date with `--check`, nothing found in a given folder, the folder changed during the run or a write failed; 2: usage or folder problem. See [docs/skills.md](docs/skills.md#map-in-the-repository) | Available (npm 0.5.0, source) |
124
+
125
+ `validate`, `mcp`, `map`, `report`, `drift` and `skills validate` only read files (`drift --scaffold` writes only inside the new folder it names); `build` and `skills map` write only inside their output folder; `discover` writes only its snapshot file. None of them makes network calls or sends telemetry, and none edits the catalogue. The text output and error messages of `validate`, `report`, `discover`, `drift` and `skills validate` carry no control characters from file names, options, catalogue or snapshot text, and their JSON output writes U+007F to U+009F as `\u` escapes; `build` and `mcp` keep their own rules, described in their documents.
126
+
127
+ ## The website
128
+
129
+ `stackledger build` makes two static sites from one catalogue: `full` for owners and finance, `staff` for everyone else, without costs, renewal dates, payers, seats, password-manager references or notes. Each has a **Software** division (the map at `/map/`, list, journeys and, in `full`, reports) and, when given a skill set, a **Skills** division. The site title (`stackledger` unless `spec.site.title` sets one) opens a **home page** at `/` with a card per division and, if you list them in `spec.site.home.links`, your own links. Serve them behind an identity-aware proxy, publishing only `full/`, `staff/`, `_headers`, `robots.txt` and `_redirects`; with `spec.sites: [full]` (the personal mode) only `full` is built; [docs/site.md](docs/site.md) explains the pages, the hosting and the security rules. Screenshots from the fictitious [Northwind catalogue](examples/northwind/), dated 2027-06-01:
130
+
131
+ | | |
132
+ |---|---|
133
+ | ![Home page with the banner, the Software and Skills cards and the configured links](docs/images/site-home.png) | ![Map page with the metro map, line buttons and map symbols](docs/images/site-map-light.png) |
134
+ | **Home**: the site title opens it; counts, links to each division and your own links from `spec.site.home` | **Map** (`/map/`): zoom, pan, zone filter; the line buttons highlight a journey |
135
+ | ![The same map page in the dark theme](docs/images/site-map-dark.png) | |
136
+ | **Dark theme**, remembered across pages | |
137
+ | ![Software list with search and filters](docs/images/site-software.png) | ![Component page for GitHub with its licence and neighbourhood diagram](docs/images/site-component.png) |
138
+ | **Software**: every component and licence, with search and filters | **Component**: licence, journeys, what it depends on and what depends on it, removal impact |
139
+ | ![Licence page in the full site with cost and renewal](docs/images/site-licence-full.png) | ![The same licence page in the staff site without cost or renewal](docs/images/site-licence-staff.png) |
140
+ | **Licence, `full` site** | **The same licence, `staff` site**: the hidden fields are not in the files at all |
141
+ | ![Journeys list with each line's badge and stop count](docs/images/site-journeys.png) | ![Journey page with its stops on a strip and the interchanges](docs/images/site-journey.png) |
142
+ | **Journeys** | **Journey**: stops in order, with the other lines at each interchange |
143
+ | ![Reports page with the recurring cost per currency and the renewals](docs/images/site-reports.png) | |
144
+ | **Reports**, `full` site only: renewals, cost per month and year per currency and group, and the calendar file | |
145
+
146
+ ## Skills on the site
147
+
148
+ Give `stackledger build` a skill set and both sites get a **Skills** division next to **Software**: a list of every skill, playbook and agent, a skills metro map, one page per item with a diagram of its declared relations, and an index of every rule. The pages are the same in the `full` and `staff` sites: nothing about a skill is hidden from staff.
149
+
150
+ There are two ways to say where the skills are, and **the option always wins**:
151
+
152
+ - `--skills <folder>`, repeatable: `--skills ../kit --skills ~/.claude/skills`. Paths are taken as you type them, from the current folder. When the command has at least one `--skills`, the setting below is ignored completely, not even checked.
153
+ - `spec.skills.folders` in the catalogue's `Settings` (in `stackledger.yaml`), used when there is no `--skills`. Each path is **relative to the catalogue folder**, not to where you run the command, so the same catalogue works on a laptop and in a pipeline. Absolute paths, `~` and drive letters are refused: they would tie the catalogue to one machine. `..` is fine.
154
+
155
+ ```yaml
156
+ apiVersion: stackledger/v1alpha1
157
+ kind: Settings
158
+ metadata:
159
+ name: settings
160
+ spec:
161
+ skills:
162
+ folders: [../ai-kit]
163
+ ```
164
+
165
+ On a laptop, with the catalogue and the skills repository side by side:
166
+
167
+ ```sh
168
+ npx @brunosouzas/stackledger build ./catalogue --out ./public # reads ./ai-kit, from spec.skills.folders
169
+ npx @brunosouzas/stackledger build ./catalogue --out ./public --skills ~/.claude/skills # this folder instead
170
+ ```
171
+
172
+ In a pipeline, check out the skills repository next to the catalogue (so `../ai-kit` exists), or pass `--skills` with the path the checkout used. Pin one stackledger version everywhere, 0.3.0 or later: 0.2.0 reads `spec.skills` as an error. If the `Settings` has an error and sets `spec.skills`, the build stops with exit 1 and changes nothing published, rather than publish a site without its Skills section; fix it, or pass `--skills`.
173
+
174
+ The skills map is drawn from `stackledger-skills.yaml` at the top of a skills folder: `Line` and `MapLayout` documents, as in the catalogue, with stops such as `skill:writer`, `playbook:release` and `agent:reviewer`. Playbooks can be zones; a skill in two playbooks sits in both zones, so place the shared skills between the playbooks and the zones overlap there cleanly. The format, the CI recipe and what each page shows: [docs/skills.md](docs/skills.md#skills-on-the-site).
175
+
176
+ ## Catalogue format
177
+
178
+ A catalogue is a folder of YAML files: Backstage `Component` documents for software, `Resource` documents with `spec.type: licence` for licences, plus `Line` journeys, one `MapLayout` with station positions and zones, and an optional `Settings` document that chooses the fields the staff view hides. The [format reference](docs/catalogue-format.md) describes every field, how references work, which problems are warnings, and how to share the folder with a Backstage instance. Keep real data in its own private repository; this example is fictitious. Save it as `catalogue.yaml` in an empty folder and run `validate` on that folder:
179
+
180
+ ```yaml
181
+ apiVersion: backstage.io/v1alpha1
182
+ kind: Component
183
+ metadata:
184
+ name: editor
185
+ spec:
186
+ type: tool
187
+ lifecycle: active
188
+ owner: user:alex
189
+ dependsOn: [resource:licence-editor]
190
+ ---
191
+ apiVersion: backstage.io/v1alpha1
192
+ kind: Component
193
+ metadata:
194
+ name: forge
195
+ spec:
196
+ type: service
197
+ lifecycle: active
198
+ owner: group:delivery
199
+ ---
200
+ apiVersion: backstage.io/v1alpha1
201
+ kind: Resource
202
+ metadata:
203
+ name: licence-editor
204
+ spec:
205
+ type: licence
206
+ owner: user:alex
207
+ licence:
208
+ vendor: Northwind Studio
209
+ status: active
210
+ cycle: yearly
211
+ cost: 120
212
+ currency: GBP
213
+ renewsOn: 2027-06-30
214
+ vaultItem: Northwind Editor subscription
215
+ ---
216
+ apiVersion: stackledger/v1alpha1
217
+ kind: Line
218
+ metadata:
219
+ name: ship
220
+ spec:
221
+ color: '#4466FF'
222
+ stops: [component:editor, component:forge]
223
+ ---
224
+ apiVersion: stackledger/v1alpha1
225
+ kind: MapLayout
226
+ metadata:
227
+ name: northwind
228
+ spec:
229
+ stations:
230
+ component:editor: [0, 0]
231
+ component:forge: [2, 0]
232
+ ```
233
+
234
+ ## Agent skills
235
+
236
+ `stackledger skills validate` checks agent skills (folders with a `SKILL.md`, in the [Agent Skills format](https://agentskills.io/specification)), playbooks, agents (`agents/*.md`, the Claude Code subagent format) and `rules.md` files as one set: duplicate names, a playbook naming a skill that does not exist, a rule ID defined twice, departures from the specification, and private keys or card numbers. Relations are declared inside the specification's `metadata` field, so `SKILL.md` stays valid for every tool:
237
+
238
+ ```yaml
239
+ metadata:
240
+ stackledger-kind: playbook
241
+ stackledger-skills: writer editor
242
+ stackledger-agents: reviewer
243
+ ```
244
+
245
+ `stackledger-kind` is `skill` (the default) or `playbook`; the other two keys hold names separated by spaces. Give the folders one agent loads together, and check each tool folder on its own. A `.stackledgerignore` file at the top of a given folder skips templates, examples and test fixtures with `.gitignore` patterns, and the output counts and lists what it skipped. `stackledger skills map` writes the set's declared relations as Markdown pages with Mermaid diagrams into the repository, for offline reading and pull-request diffs, and `--check` fails a pipeline when they are out of date. The format, every check, the map and a CI example: [docs/skills.md](docs/skills.md). With `--skills` or `spec.skills.folders`, `stackledger build` also publishes the set on the site ([Skills on the site](#skills-on-the-site)).
246
+
247
+ ## How this project is built
248
+
249
+ stackledger follows spec-driven development:
250
+
251
+ - **What it does:** each piece of work is an [OpenSpec](https://github.com/Fission-AI/OpenSpec) change in [`openspec/changes/`](openspec/changes/), with a proposal, specs with testable scenarios, a design and tasks. Delivered specs are in [`openspec/specs/`](openspec/specs/).
252
+ - **Why it is shaped this way:** project-wide decisions are [architecture decision records](docs/adr/README.md). [ADR 1](docs/adr/0001-record-architecture-decisions.md) explains how they relate to the OpenSpec changes.
253
+ - **What comes next:** the [roadmap](docs/roadmap.md).
254
+ - **Experiments:** [`docs/spikes/`](docs/spikes/).
255
+
256
+ ## Contributing
257
+
258
+ Issues and pull requests are welcome. For a change in behaviour, open an issue first so we can agree on the scenario before the code. Use only fictitious data in issues, examples and tests: never paste a real catalogue. Agents working in this repository start from [AGENTS.md](AGENTS.md).
259
+
260
+ ## License
261
+
262
+ [Apache-2.0](LICENSE) © 2026 Bruno Souza
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ /** Command line: validate, mcp, map, build, report, discover, drift, skills validate and skills map; run node dist/cli.js --help for their options.
3
+ * Usage/folder failures exit 2 on stderr with empty stdout; internal failures exit 1 without usage. Validate and skills validate report problems on stdout;
4
+ * map writes SVG, report the licence report and drift the comparison with a snapshot on stdout, diagnostics on stderr. skills map writes Markdown pages into its --out folder
5
+ * and only diagnostics on stderr. MCP stdout contains protocol messages only.
6
+ * Validate's text lines lose their control characters (a file name may hold ESC or U+009B) and its JSON has U+007F–U+009F as \u escapes (src/control.ts).
7
+ */
8
+ import { parseArgs } from 'node:util';
9
+ import { resolve } from 'node:path';
10
+ import { validateFolder } from './validate.js';
11
+ import { loadFolder } from './source.js';
12
+ import { viewNames } from './views.js';
13
+ import { reportFailure } from './errors.js';
14
+ import { escapeJsonControls, withoutControls } from './control.js';
15
+ const usage = 'Usage: stackledger validate [folder] [--json]\n stackledger mcp <folder> [--view full|staff]\n stackledger map <folder> [--view full|staff] [--theme light|dark] [--date YYYY-MM-DD]\n stackledger build <folder> --out <dir> [--date YYYY-MM-DD] [--skills <folder>]...\n stackledger report <folder> [--date YYYY-MM-DD] [--days N] [--format text|json|csv|ics]\n stackledger discover\n stackledger drift <folder> [--snapshot <file>] [--format text|json] [--scaffold <dir>]\n stackledger skills validate [folder...] [--json]\n stackledger skills map [folder...] --out <folder> [--check]\n stackledger --help\n';
16
+ function text(result) {
17
+ const lines = result.problems.map(p => withoutControls(`${p.path}:${p.line}:${p.column} ${p.severity} ${p.field ?? '-'} ${p.message}`));
18
+ const s = result.summary;
19
+ lines.push(`files: ${s.files}, documents: ${s.documents}, ignored: ${s.ignored}, errors: ${s.errors}, warnings: ${s.warnings}`);
20
+ return lines.join('\n') + '\n';
21
+ }
22
+ async function validate(args) {
23
+ const { values, positionals } = parseArgs({ args, strict: true, allowPositionals: true, options: { json: { type: 'boolean' } } });
24
+ const [, folder, ...extra] = positionals;
25
+ if (extra.length)
26
+ throw new Error('Only one folder is accepted');
27
+ const { problems, summary } = await validateFolder(folder ?? process.cwd());
28
+ const result = { problems, summary };
29
+ process.stdout.write(values.json ? escapeJsonControls(JSON.stringify(result)) + '\n' : text(result));
30
+ process.exitCode = summary.errors ? 1 : 0;
31
+ }
32
+ async function mcp(args) {
33
+ const { values, positionals } = parseArgs({ args, strict: true, allowPositionals: true, options: { view: { type: 'string' } } });
34
+ const [, folder, ...extra] = positionals;
35
+ if (!folder)
36
+ throw new Error('A catalogue folder is required');
37
+ if (extra.length)
38
+ throw new Error('Only one folder is accepted');
39
+ const view = values.view ?? 'full';
40
+ if (!viewNames.includes(view))
41
+ throw new Error(`Unknown view; allowed views: ${viewNames.join(', ')}`);
42
+ // Check the folder before the transport starts, so exit 2 happens before any protocol output.
43
+ const absolute = resolve(folder);
44
+ await loadFolder(absolute);
45
+ const { serve } = await import('./mcp.js');
46
+ await serve(absolute, view);
47
+ }
48
+ async function main(args) {
49
+ if (args.includes('--help')) {
50
+ process.stdout.write(usage);
51
+ return;
52
+ }
53
+ try {
54
+ // Find the command first; each command then parses its own options strictly.
55
+ const { positionals } = parseArgs({ args, strict: false, allowPositionals: true, options: { json: { type: 'boolean' }, view: { type: 'string' }, theme: { type: 'string' }, date: { type: 'string' }, out: { type: 'string' }, days: { type: 'string' }, format: { type: 'string' }, snapshot: { type: 'string' }, scaffold: { type: 'string' } } });
56
+ const command = positionals[0];
57
+ if (!command)
58
+ throw new Error('A command is required');
59
+ if (command === 'validate')
60
+ await validate(args);
61
+ else if (command === 'mcp')
62
+ await mcp(args);
63
+ else if (command === 'map') {
64
+ const { mapCommand } = await import('./map/command.js');
65
+ await mapCommand(args);
66
+ }
67
+ else if (command === 'build') {
68
+ const { buildCommand } = await import('./site/command.js');
69
+ await buildCommand(args);
70
+ }
71
+ else if (command === 'report') {
72
+ const { reportCommand } = await import('./report-command.js');
73
+ await reportCommand(args);
74
+ }
75
+ else if (command === 'discover') {
76
+ const { discoverCommand } = await import('./discover-command.js');
77
+ await discoverCommand(args);
78
+ }
79
+ else if (command === 'drift') {
80
+ const { driftCommand } = await import('./drift-command.js');
81
+ await driftCommand(args);
82
+ }
83
+ else if (command === 'skills') {
84
+ const { skillsCommand } = await import('./skills/command.js');
85
+ await skillsCommand(args);
86
+ }
87
+ else
88
+ throw new Error('Unknown command; expected validate, mcp, map, build, report, discover, drift or skills');
89
+ }
90
+ catch (error) {
91
+ const { stderr, exitCode } = reportFailure(error, usage);
92
+ process.stderr.write(stderr);
93
+ process.exitCode = exitCode;
94
+ }
95
+ }
96
+ await main(process.argv.slice(2));
97
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE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K,CAAC,CAAC;QACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,CAAC;AACH,CAAC;AACD,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function withoutControls(text: string): string;
2
+ export declare function escapeJsonControls(json: string): string;
@@ -0,0 +1,22 @@
1
+ /** Control characters in command output: one place for the two rules every command follows.
2
+ * Used by src/errors.ts (stderr), src/cli.ts (validate), src/drift-formats.ts, src/report-formats.ts
3
+ * and src/discovery/snapshot.ts.
4
+ *
5
+ * Why: file names, option names and catalogue or snapshot text come from outside, and a raw C0 or C1
6
+ * character (ESC, U+009B CSI) written to a terminal can move the cursor, clear the screen or set the
7
+ * window title. Ordinary text has none, so both rules leave it byte for byte unchanged.
8
+ *
9
+ * - withoutControls(text): C0 (U+0000–U+001F), DEL and C1 (U+007F–U+009F) removed. For one line of text
10
+ * output or one message; the caller adds its own line feeds afterwards.
11
+ * - escapeJsonControls(json): U+007F–U+009F written as `\u` escapes in JSON text from JSON.stringify,
12
+ * which already escapes U+0000–U+001F but leaves DEL and C1 raw. The values parse back unchanged.
13
+ */
14
+ const CONTROL = /[\u0000-\u001f\u007f-\u009f]/g;
15
+ const JSON_RAW_CONTROL = /[\u007f-\u009f]/g;
16
+ export function withoutControls(text) {
17
+ return text.replace(CONTROL, '');
18
+ }
19
+ export function escapeJsonControls(json) {
20
+ return json.replace(JSON_RAW_CONTROL, character => `\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`);
21
+ }
22
+ //# sourceMappingURL=control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.js","sourceRoot":"","sources":["../src/control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,GAAG,+BAA+B,CAAC;AAChD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AACpH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type Host } from './discovery/host.js';
2
+ import { type Snapshot } from './discovery/snapshot.js';
3
+ import { type WriteOps } from './discovery/write.js';
4
+ export declare const DISCOVER_USAGE = "Usage: stackledger discover\n";
5
+ /** The summary: the snapshot path, then one line per source in source order. */
6
+ export declare function summary(path: string, snapshot: Snapshot): string;
7
+ export declare function discoverCommand(args: string[], host?: Host, ops?: WriteOps): Promise<void>;