simt-dev 0.0.0-stage → 0.1.1

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 (128) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/LICENSE +202 -0
  3. package/README.md +92 -2
  4. package/bin/simt-dev.mjs +28 -0
  5. package/docs/decisions/ADR-001-push-requires-approval.md +42 -0
  6. package/docs/decisions/ADR-002-refactor-blast-radius.md +45 -0
  7. package/docs/decisions/ADR-003-test-breadth.md +46 -0
  8. package/docs/decisions/ADR-004-hook-owns-format.md +45 -0
  9. package/docs/decisions/ADR-005-file-length.md +42 -0
  10. package/docs/decisions/ADR-006-coverage-bar.md +59 -0
  11. package/docs/decisions/ADR-007-section-skeleton.md +54 -0
  12. package/docs/decisions/ADR-008-verdict-vocabulary.md +59 -0
  13. package/docs/decisions/ADR-009-skill-layout.md +48 -0
  14. package/docs/decisions/ADR-010-runner-invocation.md +56 -0
  15. package/docs/decisions/ADR-011-windows-support.md +52 -0
  16. package/docs/decisions/ADR-012-drop-windows-support.md +59 -0
  17. package/docs/decisions/ADR-013-genericity-by-facts-and-local-profiles.md +114 -0
  18. package/docs/decisions/ADR-014-workspace-is-configuration.md +211 -0
  19. package/docs/decisions/ADR-015-a-source-is-content-not-a-location.md +117 -0
  20. package/docs/decisions/ADR-016-a-divergent-rule-is-retired-not-merged.md +180 -0
  21. package/docs/decisions/ADR-017-a-declared-gate-must-be-runnable.md +89 -0
  22. package/docs/decisions/ADR-018-an-unset-hooks-path-is-not-an-absent-hook.md +183 -0
  23. package/docs/decisions/ADR-019-a-declared-command-is-the-runner.md +110 -0
  24. package/docs/decisions/ADR-020-a-rule-is-written-per-surface-and-pointed-not-copied.md +100 -0
  25. package/docs/decisions/ADR-021-one-surface-per-repo.md +94 -0
  26. package/docs/decisions/ADR-022-a-key-simt-dev-reads-is-prefixed.md +98 -0
  27. package/docs/decisions/ADR-023-the-gate-ships-as-a-file-the-repo-owns.md +106 -0
  28. package/docs/decisions/ADR-024-simt-dev-overwrites-its-own-gate-file.md +111 -0
  29. package/docs/decisions/ADR-025-a-baseline-is-a-region-in-a-file-the-repo-owns.md +153 -0
  30. package/docs/decisions/ADR-026-a-config-without-a-region-is-a-file-the-repo-owns.md +117 -0
  31. package/docs/decisions/ADR-027-the-one-gitattributes-line-that-is-neither-dangerous-nor-empty.md +130 -0
  32. package/docs/decisions/ADR-028-a-base-file-is-a-floor-so-the-disagreement-it-cannot-repair-becomes-a-check.md +131 -0
  33. package/docs/decisions/ADR-029-the-pins-a-repository-declares-are-its-own.md +120 -0
  34. package/docs/decisions/ADR-030-what-a-plan-does-not-ship-is-a-decision-with-a-record.md +114 -0
  35. package/docs/decisions/ADR-031-the-suite-stages-the-environment-it-needs.md +129 -0
  36. package/docs/decisions/ADR-032-provenance-is-a-content-digest-not-a-commit.md +141 -0
  37. package/docs/decisions/ADR-033-three-plan-rows-closed-by-decision-not-by-authoring.md +82 -0
  38. package/docs/decisions/ADR-034-a-staged-tool-refuses-a-partially-staged-file.md +91 -0
  39. package/docs/decisions/ADR-035-one-write-decision-and-one-json-document.md +119 -0
  40. package/docs/decisions/ADR-036-a-writer-that-writes-says-so-and-the-instructions-naming-it-move-with-it.md +103 -0
  41. package/docs/decisions/ADR-037-unchanged-means-writing-would-not-change-a-byte.md +100 -0
  42. package/docs/decisions/ADR-038-the-gate-filter-belongs-to-every-manifest-writer.md +95 -0
  43. package/docs/decisions/ADR-039-a-ci-step-runs-a-form-that-can-fail.md +101 -0
  44. package/docs/decisions/ADR-040-the-last-writer-that-wrote-by-default-was-not-the-one-named.md +158 -0
  45. package/docs/decisions/ADR-041-the-suite-installs-the-package-in-order-to-test-it.md +92 -0
  46. package/docs/decisions/ADR-042-a-declared-glob-must-match-a-path-built-from-it.md +94 -0
  47. package/docs/decisions/ADR-043-a-keyword-is-a-phrase-and-two-letters-is-a-word.md +90 -0
  48. package/docs/decisions/ADR-044-compatibility-is-not-evidence.md +116 -0
  49. package/docs/decisions/ADR-045-a-dashboard-that-counts-a-defect.md +119 -0
  50. package/docs/decisions/ADR-046-one-rule-one-copy.md +140 -0
  51. package/docs/decisions/ADR-047-a-profile-selects-on-what-a-repository-runs-on.md +141 -0
  52. package/docs/decisions/ADR-048-a-baseline-carries-only-keys-a-reader-honours.md +150 -0
  53. package/docs/decisions/ADR-049-a-ruling-that-a-later-record-moved-says-so-where-it-is-printed.md +153 -0
  54. package/docs/decisions/ADR-050-a-byte-count-is-not-a-region-and-updated-is-not-a-change-of-rules.md +102 -0
  55. package/docs/decisions/ADR-051-a-pointer-is-the-readers-only-route-so-it-is-not-a-convenience.md +134 -0
  56. package/docs/decisions/ADR-052-a-dependency-is-counted-against-the-budget-and-there-is-one-budget.md +101 -0
  57. package/docs/decisions/ADR-053-the-node-floor-is-22-20-0.md +49 -0
  58. package/docs/decisions/ADR-054-the-digest-covers-every-byte-that-leaves-the-package.md +100 -0
  59. package/docs/decisions/ADR-055-a-status-line-travels-so-it-may-not-name-a-location.md +98 -0
  60. package/docs/decisions/ADR-056-three-names-one-of-which-is-cheap-to-move.md +160 -0
  61. package/docs/decisions/README.md +528 -0
  62. package/graph/skills.graph.json +1622 -0
  63. package/package.json +41 -4
  64. package/rules/core.md +76 -0
  65. package/rules/mdc/intake-questions.mdc +50 -0
  66. package/rules/mdc/preview-postflight.mdc +61 -0
  67. package/rules/mdc/slice-commit.mdc +52 -0
  68. package/rules/mdc/test-gate.mdc +54 -0
  69. package/rules/stacks/android.md +63 -0
  70. package/rules/stacks/cloudflare-workers.md +65 -0
  71. package/rules/stacks/connectiq.md +62 -0
  72. package/rules/stacks/container.md +31 -0
  73. package/rules/stacks/jvm.md +54 -0
  74. package/rules/stacks/node.md +45 -0
  75. package/rules/stacks/python.md +48 -0
  76. package/rules/stacks/react-native.md +58 -0
  77. package/rules/stacks/react-web.md +61 -0
  78. package/rules/stacks/typescript.md +21 -0
  79. package/rules/stacks/uv.md +32 -0
  80. package/src/argv.mjs +116 -0
  81. package/src/ci/dependabot.mjs +268 -0
  82. package/src/ci/workflow.mjs +360 -0
  83. package/src/commands/ci.mjs +285 -0
  84. package/src/commands/compare.mjs +195 -0
  85. package/src/commands/graph.mjs +73 -0
  86. package/src/commands/help.mjs +108 -0
  87. package/src/commands/hooks.mjs +471 -0
  88. package/src/commands/index.mjs +241 -0
  89. package/src/commands/init.mjs +566 -0
  90. package/src/commands/mcp.mjs +63 -0
  91. package/src/commands/rules.mjs +374 -0
  92. package/src/commands/skills.mjs +647 -0
  93. package/src/commands/skillsinstall.mjs +515 -0
  94. package/src/commands/sync.mjs +331 -0
  95. package/src/commands/upgrade.mjs +202 -0
  96. package/src/compare/discover.mjs +212 -0
  97. package/src/compare/hooksstate.mjs +159 -0
  98. package/src/compare/row.mjs +299 -0
  99. package/src/decisions/index.mjs +512 -0
  100. package/src/graph/load.mjs +541 -0
  101. package/src/hooks/capability.mjs +129 -0
  102. package/src/hooks/dispatcher.mjs +268 -0
  103. package/src/hooks/gates.mjs +144 -0
  104. package/src/hooks/resolve.mjs +194 -0
  105. package/src/hooks/shim.mjs +140 -0
  106. package/src/hooks/where.mjs +118 -0
  107. package/src/locate.mjs +75 -0
  108. package/src/mcp/server.mjs +167 -0
  109. package/src/mcp/tools.mjs +410 -0
  110. package/src/name.mjs +95 -0
  111. package/src/output/index.mjs +96 -0
  112. package/src/projection/baselines.mjs +209 -0
  113. package/src/projection/conflicts.mjs +205 -0
  114. package/src/projection/manifest.mjs +478 -0
  115. package/src/projection/markers.mjs +349 -0
  116. package/src/projection/mdc.mjs +327 -0
  117. package/src/projection/project.mjs +504 -0
  118. package/src/projection/rules.mjs +640 -0
  119. package/src/projection/surfaces.mjs +398 -0
  120. package/src/projection/targets.mjs +221 -0
  121. package/src/resolve/fingerprint.mjs +553 -0
  122. package/src/resolve/near.mjs +61 -0
  123. package/src/resolve/resolve.mjs +457 -0
  124. package/src/resolve/source.mjs +105 -0
  125. package/src/toolchain.mjs +202 -0
  126. package/src/tsconfig.mjs +314 -0
  127. package/src/upgrade/plan.mjs +203 -0
  128. package/src/workspace.mjs +289 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,130 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are recorded here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.1] — 2026-10-11
8
+
9
+ ### A foreign hook on an event this repo does not gate is chained
10
+
11
+ `0.1.0` chained the wrong set of hooks and is worth replacing rather than
12
+ recommending. It chained on the event *vocabulary* — anything that was not
13
+ `pre-commit` or `pre-push` — when the question worth asking is whether **this
14
+ repository** declares a gate for that event.
15
+
16
+ The difference is `simt-app`, whose `pre-push` is `git-lfs`. `pre-push` is an
17
+ event this tool gates in general, so `0.1.0` displaced that hook; and because
18
+ `simt-app` declares no `pre-push` gate there was no shim for the event either, so
19
+ git would have found no `pre-push` hook at all. LFS objects would have stopped
20
+ being uploaded, with nothing to notice it — the exact silent failure chaining
21
+ exists to prevent, reached by fixing the wrong half of it.
22
+
23
+ `0.1.1` asks the manifest. An event the repo declares a gate for is left to
24
+ `gates.commands`, where the hook runs as a gate and its verdict appears in the
25
+ report; every other foreign hook is chained. That also picks up
26
+ `simt-landing`'s Lighthouse pre-push, which declares no gates at all.
27
+ *(ADR-018, as amended)*
28
+
29
+ Upgrade with `npm i -D simt-dev@0.1.1`, then `simt hooks install --yes`. Any
30
+ repository already routed with `0.1.0` should re-run it: the shims it writes
31
+ will differ where a gated event was previously displaced.
32
+
33
+ ## [0.1.0] — 2026-10-11
34
+
35
+ The first release with real contents in it. `1.0.0` was an empty reservation of the name
36
+ and `0.0.0-stage` was its rehearsal; neither shipped a byte anyone could run, so this entry
37
+ is the whole history. The decisions behind it are readable in the package under
38
+ `docs/decisions/`, and from any checkout with `simt rules why <id>`.
39
+
40
+ ### The command is `simt`
41
+
42
+ The package is `simt-dev` and the command is `simt`. They are not the same thing and were
43
+ never required to be: the command appears only in text the tool itself writes, and that
44
+ text migrates on the next write. The package name, the `.simt-hooks/` directory and the
45
+ `simt-dev-check.yml` gate already exist in every repository that adopted this tool, and
46
+ they did not move. The manifest and the region markers did — see below.
47
+
48
+ ### The manifest is `simt.json`
49
+
50
+ The manifest was called `simt-dev.json`; it is now `simt.json`. The move is a
51
+ read-both/write-new, so nothing in an adopting repository has to be done:
52
+
53
+ - Every read takes `simt.json` if it exists, else `simt-dev.json`, so a repository that
54
+ has not written since the upgrade is still seen as adopted.
55
+ - Every write goes to `simt.json`, and a lone `simt-dev.json` is moved, not shadowed.
56
+ - The old name keeps working until the first `init` or manifest write in each repository,
57
+ and that write closes it. *(ADR-056)*
58
+
59
+ ### The region markers are `simt:`
60
+
61
+ The generated region was stamped `<!-- simt-dev:begin -->` / `<!-- simt-dev:end -->` — and
62
+ so was the provenance header inside it; every one of those lines is now `simt:`. The move
63
+ is the same read-both/write-new as the manifest:
64
+
65
+ - Every read accepts either spelling, so a repository that has not written since the
66
+ upgrade is still seen as adopted.
67
+ - Every write emits `simt:` only, so the first `sync` in each repository migrates its
68
+ regions in place, and that write closes the window.
69
+ - A file holding two regions — one of each spelling — is a state only a hand edit can
70
+ make, and it is reported malformed rather than merged. *(ADR-056)*
71
+
72
+ ### A hook you already had keeps running
73
+
74
+ `hooks install` points `core.hooksPath` at `.simt-hooks/`, and git reads **every** hook from
75
+ that one directory — not just the two events this tool gates. So adopting a repository that
76
+ had its own `post-commit`, `post-checkout` or `post-merge` would have quietly stopped them:
77
+ nothing fails, nothing is logged, and the hook is still on disk looking intact.
78
+
79
+ Those hooks are now **chained**. Install writes a shim for them that runs the repository's
80
+ own hook and forwards git's arguments, so nothing is lost and the reason is in the file. If
81
+ the hook is gone, the shim refuses and names the path instead of passing quietly. A hook on
82
+ an event this tool *does* gate (`pre-commit`, `pre-push`) is deliberately not chained —
83
+ declare it under `gates.commands` so the dispatcher runs it and its verdict appears in the
84
+ gate report. *(ADR-018, as amended)*
85
+
86
+ ### What a first release has to say out loud
87
+
88
+ These are the behaviours a reader is most likely to trip over. Each one is deliberate,
89
+ and each has a numbered decision record behind it — but a behaviour nobody can discover
90
+ without reading the source is not a documented one.
91
+
92
+ - **`sync` and `init` write nothing without `--yes`.** Both print a plan and exit. `sync`
93
+ exits **1** when the plan is non-empty, so bare `sync` doubles as a check. Neither ever
94
+ commits or pushes. *(ADR-035, ADR-036)*
95
+ - **`upgrade` moves a pin and nothing else.** It never adopts a repository, never repairs
96
+ one, and never rewrites a manifest. Every consumer moves to the same version as one set.
97
+ - **A pre-commit hook with no reachable binary fails closed.** The refusal is the correct
98
+ behaviour, not a bug; the remedy it prints is the command that obtains one.
99
+ *(ADR-010, ADR-018)*
100
+ - **A gate whose tool is not installed is dropped, with a remedy naming the package.**
101
+ It is never declared and silently unrunnable. *(ADR-017)*
102
+ - **Two rules are never loaded twice.** Each rule projects to exactly one place, chosen by
103
+ what the harness actually reads. *(ADR-021, ADR-046)*
104
+ - **macOS and Linux only.** Windows `npm i` fails with npm's `EBADPLATFORM`, which npm
105
+ will not let a package explain; use WSL2. See the platform section of the README.
106
+ *(ADR-012)*
107
+
108
+ ### Packaging
109
+
110
+ - Licence set to Apache-2.0; the `LICENSE` file is the canonical, unmodified text.
111
+ - `files` no longer lists `skills`, `agents`, `tooling` or `hooks`, none of which exist,
112
+ and no longer ships `docs/plans`. The tarball is the tool and the decisions behind it,
113
+ and nothing else.
114
+ - The package `description` no longer names an internal ecosystem. It is the first line
115
+ anybody outside the project reads.
116
+ - Unscoped, so the install command is `npm i -D simt-dev` rather than a name under an
117
+ organisation. The `@simt` and `@quazarmedia` scopes were both free; an unscoped name is
118
+ the one a reader can guess.
119
+
120
+ ### Notes for anyone upgrading a hook
121
+
122
+ A shim installed by an earlier version looks for `SIMT_DEV_BIN`, then for
123
+ `node_modules/simt-dev/bin/simt-dev.mjs`, then for a program named `simt` on `PATH`. The
124
+ last of those is new, so a machine that installed the package before this release and
125
+ never ran `simt hooks install` again will find nothing until the dependency is refreshed
126
+ and `simt hooks install --yes` is re-run. That is a real upgrade step and it is called out
127
+ here rather than discovered.
128
+
129
+ [0.1.1]: https://github.com/QuazarMedia/simt-dev/releases/tag/v0.1.1
130
+ [0.1.0]: https://github.com/QuazarMedia/simt-dev/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,93 @@
1
- # Temporary Holding Version
1
+ # simt-dev
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
+ Shared agent rules, skills and git hooks for a repository.
4
+
5
+ One command adopts a repository: it reads what the repo actually runs, projects the
6
+ matching rules into the files your agent already reads, and installs a pre-commit hook
7
+ that refuses a commit which breaks a gate that repo can genuinely run.
8
+
9
+ - **Nothing is declared that cannot run.** Every gate is probed against the working tree
10
+ before it is written. A gate whose tool is absent is dropped, with a remedy naming the
11
+ package to install — never silently present, never silently absent.
12
+ - **Nothing an agent reads is written twice.** Each rule goes to exactly one place, chosen
13
+ by what the harness actually reads.
14
+ - **The rules are a projection, not a copy.** They carry markers, so `check` can tell
15
+ drift from a deliberate edit, and `sync` can regenerate.
16
+ - **The tool explains itself.** `rules why` answers "why did I get told this?" from a
17
+ numbered record of the decisions behind the rules, with the rejected alternatives
18
+ attached.
19
+
20
+ ## Install
21
+
22
+ Requires **Node >= 22.20.0**.
23
+
24
+ ```sh
25
+ # pinned, per repository - what CI and a teammate both get
26
+ npm i -D simt-dev@0.1.1
27
+
28
+ # or globally, if you would rather not add a dependency
29
+ npm i -g simt-dev@0.1.1
30
+
31
+ # or with no install at all, for a one-off
32
+ npx -y simt-dev@0.1.1 check
33
+ ```
34
+
35
+ Pin the version. The tool writes a content digest into the files it generates, and an
36
+ unpinned upgrade changes them under you.
37
+
38
+ ## Use
39
+
40
+ ```sh
41
+ simt init # adopt or scaffold this repository (dry-run; --yes to write)
42
+ simt doctor # what this repo is, and whether its config is healthy
43
+ simt check # the gate: projection drift, manifest validity, policy
44
+ simt sync --yes # regenerate the projection
45
+ simt upgrade --yes # move every consumer of this tool to this version
46
+ simt rules why ADR-042 # why a rule says what it says, and what was rejected
47
+ simt compare # what changed across every repository that adopted it
48
+ ```
49
+
50
+ `init` and `sync` print a plan and write nothing without `--yes`. Neither commits or pushes.
51
+
52
+ ## What it writes
53
+
54
+ | Path | What |
55
+ | --- | --- |
56
+ | `AGENTS.md` | the projection, between `<!-- simt:begin -->` and `<!-- simt:end -->` (renamed from `simt-dev:`; the old markers are still read, and a region migrates on its next write) |
57
+ | `simt.json` | your manifest: which gates to declare, which substitutions to fill (renamed from `simt-dev.json`; the old name is still read, and moves on the next write) |
58
+ | `.cursor/rules/*.mdc`, `.claude/rules/*.md`, `.agents/rules/*.md`, `.github/instructions/*.instructions.md` | one file per rule, written only for the harnesses that read their own directory |
59
+ | `.editorconfig`, `.gitattributes` | baseline regions |
60
+ | `.simt-hooks/` and `core.hooksPath` | the shared dispatcher, fail-closed |
61
+
62
+ Anything outside the markers is yours. simt-dev never edits it and never reverts it.
63
+
64
+ ## Platform
65
+
66
+ **macOS and Linux.** The hooks are POSIX `sh`; there is no Windows build and no plan for
67
+ one. `npm i` on Windows fails with npm's `EBADPLATFORM`, which npm will not let a package
68
+ explain — so the answer is here: **use WSL2**, and the gate works normally inside it.
69
+
70
+ A Windows checkout without WSL2 can still read every rule this tool generates, because the
71
+ projection is plain text in `AGENTS.md` and the per-harness rule files. Only the hooks and
72
+ the CI gate need the POSIX host.
73
+
74
+ ## How the rules are chosen
75
+
76
+ Detection reads what the repository runs — its dependency manifests, its build files, its
77
+ CI workflows — and resolves that against a registry of capabilities. Resolution is a
78
+ scored ranking over path, keyword, name, capability and stack: no model, no network, no
79
+ guessing, so a pull request can meaningfully diff the answer.
80
+
81
+ **Not every ecosystem has a profile yet.** A Go, Rust, .NET, Ruby, Swift, Dart or Elixir
82
+ repository is detected and gets facts, but it is adopted with the core rules and no gates
83
+ until its gate templates are written. A repository with no gates is a repository with an
84
+ agent and no pre-commit hook — better than one with a hook that runs nothing, but not full
85
+ support, and this README will not pretend otherwise.
86
+
87
+ Every behaviour that is a choice rather than a detail has a numbered record, and the
88
+ records are readable with `simt rules why <id>`. If the tool ever does something you
89
+ did not expect, that command is the shortest path from the symptom to the reason.
90
+
91
+ ## Licence
92
+
93
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ // simt-dev - developer and agent tooling for the SIMT ecosystem.
3
+ //
4
+ // POSIX only (ADR-012). package.json declares os: [darwin, linux], so npm refuses
5
+ // the install elsewhere rather than letting a hook fail obscurely.
6
+
7
+ import { dispatch } from '../src/commands/index.mjs';
8
+ import { EXIT, fail } from '../src/output/index.mjs';
9
+ import { parse } from '../src/argv.mjs';
10
+
11
+ try {
12
+ const argv = process.argv.slice(2);
13
+ const parsed = parse(argv);
14
+ if (!parsed.ok) {
15
+ process.exit(parsed.code);
16
+ }
17
+ const { flags, positional } = parsed.value;
18
+
19
+ // No arguments at all is a usage error, not a silent help dump: an agent that
20
+ // ran the wrong thing should be told so rather than handed 40 lines of prose.
21
+ if (positional.length === 0 && !flags.help && !flags.version) {
22
+ process.exit(fail('no command given', EXIT.USAGE));
23
+ }
24
+
25
+ process.exit((await dispatch(argv)) ?? EXIT.OK);
26
+ } catch (error) {
27
+ process.exit(fail(error?.message ?? String(error), EXIT.FAIL));
28
+ }
@@ -0,0 +1,42 @@
1
+ # ADR-001 — Push requires explicit approval
2
+
3
+ Status: **accepted** · 2026-10-05 · affects all repos
4
+
5
+ ## Context
6
+
7
+ The repos state a commit/push policy. They disagree on whether an agent may push.
8
+
9
+ - A repo outside this estate: "always create a focused Git commit… skip the commit only
10
+ when the user explicitly asks not to commit." Silent on push.
11
+ - `simt-garmin/AGENTS.md` DoD #8: "**Committed and pushed** with a conventional message."
12
+ - `simt-social` and `simt-social-api`: "create a non-interactive Conventional Commit. Report
13
+ the commit SHA; **do not push**."
14
+ - `simt-api`, `simt-social-media`: silent.
15
+
16
+ The Social pair justify it: a push to the production branch triggers Cloudflare Workers Builds,
17
+ so "an approved push is therefore a production deployment action, not only source publication."
18
+ `simt-garmin` has no such coupling, and its rule asks for an autonomous push.
19
+
20
+ ## Ruling
21
+
22
+ Commit locally, report the SHA, **push only on explicit user approval**.
23
+
24
+ When a repo's push triggers a deployment, a migration, or any remote mutation, say so before
25
+ asking for approval — do not treat approval for the push as approval for the deploy.
26
+
27
+ `simt-garmin` DoD #8 changes to "committed with a conventional message; pushed on approval."
28
+ This is the single outlier, and the 4:1 majority is also the safe direction.
29
+
30
+ ## Consequences
31
+
32
+ - An agent that finishes a task ends at a reported SHA. Pushes become a separate, explicit step.
33
+ - `simt-dev init` and `upgrade` propose changes and never push, including for simt-dev itself.
34
+ - Repos whose CI deploys on push must state that consequence in their own AGENTS.md, which is
35
+ where the Social pair's rule already lives.
36
+
37
+ ## Rejected
38
+
39
+ - **Autonomous push (garmin's current rule).** Removes the only checkpoint between "the agent
40
+ thinks it is done" and "production changed".
41
+ - **Push on completion, as a commit-always contributor loop implies.** Same objection; its
42
+ PR step does not require an agent to open the PR unattended.
@@ -0,0 +1,45 @@
1
+ # ADR-002 — Blast radius bounds refactoring; a third copy is a defect
2
+
3
+ Status: **accepted** · 2026-10-05 · affects all repos
4
+
5
+ ## Context
6
+
7
+ Two repos state opposite philosophies, and both are reasonable in isolation.
8
+
9
+ - `simt-social` / `simt-social-api`: "When a second real use or a near-duplicate already
10
+ exists, refactor the existing code to extract the shared part… A third copy of the same
11
+ logic is a defect, and so is an abstraction invented for a single caller."
12
+ - A repo outside this estate: "Match existing style, naming, and test layout. **Do not
13
+ refactor neighboring code unless the requested change requires it.** Do not add speculative
14
+ flexibility, configuration, or abstractions."
15
+
16
+ Neither can be an org rule as written. The Social rule mandates proactive refactoring;
17
+ the other forbids it.
18
+
19
+ ## Ruling
20
+
21
+ Both survive, split by scope:
22
+
23
+ - **Outside the current change's blast radius** — do not refactor. Unrelated code is not
24
+ collateral.
25
+ - **Inside the blast radius** — a second real use extracts, and the extraction is *finished*:
26
+ no orphaned imports, exports, styles, messages, files, feature flags or compatibility
27
+ aliases remain anywhere in the affected dependency graph.
28
+ - **A third copy of the same logic is a defect.** So is an abstraction invented for a single
29
+ caller.
30
+
31
+ ## Consequences
32
+
33
+ - "Do not refactor neighbours" survives verbatim as a reviewer's objection to drive-by changes.
34
+ - "A third copy is a defect" survives verbatim as a reviewer's objection to copy-paste.
35
+ - Refactor completion becomes a checkable state, not an intention: the reviewer greps for
36
+ orphans rather than trusting the claim.
37
+ - The "no speculative flexibility" half is restated as the single-caller half of this
38
+ ruling rather than as a blanket ban.
39
+
40
+ ## Rejected
41
+
42
+ - **Social's rule verbatim.** Sanctions unrelated refactors, which is how a 10-line fix turns
43
+ into a 400-line diff nobody can review.
44
+ - **The opposite rule verbatim.** Sanctions the third copy, which is how a codebase grows four
45
+ subtly different implementations of the same validation.
@@ -0,0 +1,46 @@
1
+ # ADR-003 — Focused tests are the default; a full suite needs a named trigger
2
+
3
+ Status: **accepted** · 2026-10-05 · affects all repos
4
+
5
+ ## Context
6
+
7
+ - `simt-social` / `simt-social-api`: "Focused tests are the default gate, and full suites are
8
+ the exception… **absent a named trigger, running a full suite is a defect, not diligence.**"
9
+ - A repo outside this estate: `fail_under = 100` plus a full-suite script as the pre-push
10
+ default, and a contributor loop that says "run the full gate locally (lint + tests +
11
+ coverage)."
12
+ - `simt-garmin`: reframes the axis entirely as a layer-conditional 5a–5m matrix.
13
+ - `simt-social-media`: no policy — it just lists `npm run test:unit && npm run test:e2e`.
14
+
15
+ The Social pair make a full suite a sin. media presents it as unremarkable. The hard-gate
16
+ repo makes it mandatory. These cannot all be org rules as stated.
17
+
18
+ ## Ruling
19
+
20
+ Focused tests are the default gate. Running a full suite is legitimate **only** against a
21
+ named trigger:
22
+
23
+ 1. Phase exit.
24
+ 2. Release gate.
25
+ 3. Behaviour that crosses a system boundary.
26
+ 4. A repo-declared numeric gate (see ADR-006 for where that number lives).
27
+ 5. Explicit user or caller instruction.
28
+ 6. Pre-push on a protected branch, in a repo that declares this trigger in `simt-dev.json`.
29
+
30
+ Re-running a full suite as a progress meter is a defect. Repos outside this estate already
31
+ say exactly this ("do not run the full gate repeatedly as a progress meter"); the principle is
32
+ adopted as canonical.
33
+
34
+ ## Consequences
35
+
36
+ - Each repo's `simt-dev.json` declares which of the six triggers are active for it. A repo
37
+ with a declared numeric gate activates 4 and 6; the Social repos activate 1, 2 and 3.
38
+ - A reviewer can ask "which trigger?" and get a number, not an opinion.
39
+ - media gains an explicit policy instead of an implicit one that contradicts its siblings.
40
+
41
+ ## Rejected
42
+
43
+ - **"A full suite is a defect."** Wrong for a release gate and wrong for a repo whose coverage
44
+ floor is a hard number; it makes the rule get ignored rather than followed.
45
+ - **Full suite by default.** Re-pays the whole cost on every iteration; the Social pair are
46
+ right that an inflated brief is a defect in the brief, not thoroughness.
@@ -0,0 +1,45 @@
1
+ # ADR-004 — The hook owns format and lint for staged files
2
+
3
+ Status: **accepted** · 2026-10-05 · affects all repos
4
+
5
+ ## Context
6
+
7
+ - `simt-social-api`: "lint and format are enforced by the pre-commit hook — **do not run them
8
+ manually.**"
9
+ - `simt-social`: "the local pre-push hook republishes opportunistically when a token happens to
10
+ be present." Never says the hook is the gate; instructs agents to run static checks directly.
11
+ - A repo outside this estate: tells agents to run its linter and `git diff --check` by hand,
12
+ and its contributor guide repeats it.
13
+ - `simt-api`, and 11 repos with no hooks at all: silent.
14
+
15
+ The audit also found the estate's hook reality: 4 incompatible conventions, and
16
+ `simt-app/hooks/pre-push` is **0 bytes** while the real git-lfs pre-push sits unused in
17
+ `scripts/hooks/`.
18
+
19
+ ## Ruling
20
+
21
+ The pre-commit hook owns format and lint **for staged files**. Do not re-run what the hook
22
+ just ran on the same files.
23
+
24
+ Manual runs are correct when:
25
+
26
+ 1. The hook is not installed in this checkout, or
27
+ 2. A check failed and you are diagnosing it, or
28
+ 3. The check is not hook-covered (typecheck, migration verification, contract generation).
29
+
30
+ A repo with no hook installed still runs its checks manually. Silence is not permission to
31
+ skip.
32
+
33
+ ## Consequences
34
+
35
+ - The shared hook dispatcher from plan 0001 lands in every repo that has one, which also
36
+ delivers the dead `simt-app/hooks/pre-push` fix.
37
+ - `simt-dev doctor` reports hook installation state, so "the hook will cover it" is a
38
+ verifiable claim rather than an assumption.
39
+ - The 11 hook-less repos get a pre-commit on adoption, which ends the silent case entirely.
40
+
41
+ ## Rejected
42
+
43
+ - **"Never run lint manually."** False whenever the hook is absent, which is most of the
44
+ estate today.
45
+ - **"Always run lint manually."** Re-runs what a hook already verified, on every iteration.