@bizibot/contracts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +131 -0
  3. package/conformance/patterns.json +12 -0
  4. package/dist/chunk-6OQSBZG4.js +709 -0
  5. package/dist/chunk-6OQSBZG4.js.map +1 -0
  6. package/dist/chunk-LONUJCLW.js +50 -0
  7. package/dist/chunk-LONUJCLW.js.map +1 -0
  8. package/dist/cli.js +258 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/index.js +41 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/package-T64HPNWA.js +7 -0
  13. package/dist/package-T64HPNWA.js.map +1 -0
  14. package/dist/src/artifacts/discover.d.ts +28 -0
  15. package/dist/src/check/release.d.ts +12 -0
  16. package/dist/src/check/repository.d.ts +19 -0
  17. package/dist/src/check/snapshot.d.ts +37 -0
  18. package/dist/src/check/version-transitions.d.ts +23 -0
  19. package/dist/src/ci.d.ts +20 -0
  20. package/dist/src/cli.d.ts +2 -0
  21. package/dist/src/contracts-file/matcher.d.ts +2 -0
  22. package/dist/src/contracts-file/parse.d.ts +26 -0
  23. package/dist/src/contracts-file/pin.d.ts +10 -0
  24. package/dist/src/contracts-file/ranges.d.ts +11 -0
  25. package/dist/src/contracts-file/resolve.d.ts +16 -0
  26. package/dist/src/index.d.ts +15 -0
  27. package/dist/src/local.d.ts +8 -0
  28. package/dist/src/managed.d.ts +17 -0
  29. package/dist/src/runtime/handoff.d.ts +11 -0
  30. package/dist/src/versioning/paths.d.ts +2 -0
  31. package/dist/src/versioning/validate.d.ts +13 -0
  32. package/dist/src/versioning/version.d.ts +3 -0
  33. package/docs/agents.md +65 -0
  34. package/docs/checks.md +102 -0
  35. package/docs/contracts-file.md +112 -0
  36. package/docs/cross-repo.md +39 -0
  37. package/docs/practices.md +40 -0
  38. package/docs/taxonomy.md +77 -0
  39. package/docs/versioning.md +73 -0
  40. package/docs/workflow.md +49 -0
  41. package/package.json +50 -0
  42. package/skills/contracts-adopt/SKILL.md +70 -0
  43. package/skills/contracts-change/SKILL.md +74 -0
  44. package/skills/contracts-triage/SKILL.md +46 -0
  45. package/skills/contracts-write/SKILL.md +80 -0
  46. package/skills/contracts-write/references/adr.md +34 -0
  47. package/skills/contracts-write/references/design.md +37 -0
  48. package/skills/contracts-write/references/prd.md +49 -0
  49. package/skills/contracts-write/references/procedure.md +34 -0
  50. package/skills/contracts-write/references/spec.md +41 -0
  51. package/skills/contracts-write/references/standard.md +31 -0
  52. package/templates/agents-section.md +16 -0
  53. package/templates/kinds/adr.md +21 -0
  54. package/templates/kinds/design.md +22 -0
  55. package/templates/kinds/prd.md +29 -0
  56. package/templates/kinds/procedure.md +16 -0
  57. package/templates/kinds/spec.md +17 -0
  58. package/templates/kinds/standard.md +16 -0
  59. package/templates/workflows/check.yml +28 -0
  60. package/templates/workflows/release.yml +29 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bizibot HQ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,131 @@
1
+ # @bizibot/contracts
2
+
3
+ **Dead simple SDD with contracts.**
4
+
5
+ Map code to the docs that govern it. Version them like dependencies. Catch
6
+ breaking changes before they ship.
7
+
8
+ > **Status: pre-release.** The package is not published yet. Its `0.x` CLI is
9
+ > implemented and still subject to compatibility changes before the first
10
+ > stable release.
11
+
12
+ ## The idea
13
+
14
+ Your PRDs, ADRs, specs, designs, standards and procedures are contracts that
15
+ your code depends on. `@bizibot/contracts` makes that dependency explicit:
16
+
17
+ ```
18
+ # CONTRACTS
19
+ /src/auth/ spec/auth@^2 adr/sessions@^1
20
+ /src/billing/ spec/billing@^3 docs/standards/api-design.md
21
+ /docs/specs/auth.md adr/sessions@^1
22
+ ```
23
+
24
+ - **One file.** `CONTRACTS` sits at the repo root and works like `CODEOWNERS`:
25
+ each line maps a path pattern to the docs that govern it.
26
+ - **Optional versioning.**
27
+ - `spec/auth@^2` is a versioned dependency: its range is checked.
28
+ - A plain path is a linked dependency: you get review reminders.
29
+ - **You set versions, the check verifies them.** When you change a versioned
30
+ doc, you (or `contracts version`) set its next patch, minor or major in the
31
+ PR. The check makes sure it moved exactly one step. No commit convention
32
+ required.
33
+ - **Breaking changes surface in the PR.** A PR that takes `spec/auth` to
34
+ `3.0.0` fails until the code pinned to `^2` is updated in the same PR.
35
+
36
+ ## Governance, not an agent workflow
37
+
38
+ Spec Kit, OpenSpec, Kiro and BMAD are **agent workflows**: their skills walk an
39
+ agent through writing a spec, then a plan, then tasks, then code. The framework
40
+ *is* the agent's process.
41
+
42
+ `@bizibot/contracts` is a **governance layer**. A deterministic CLI and CI do
43
+ the enforcing, and its skills teach agents to use them. It doesn't run your
44
+ process, but it does help you write each kind of doc well. Its job is to make
45
+ sure the code still matches the version of the spec it claims to follow.
46
+
47
+ ## Quick start
48
+
49
+ ```sh
50
+ npm i -g @bizibot/contracts
51
+ contracts init --agents claude
52
+ ```
53
+
54
+ `init` adds:
55
+ - a starter `CONTRACTS` file
56
+ - `docs/` kind folders
57
+ - two thin GitHub workflows (check and release)
58
+ - the managed delivery procedure
59
+ - agent instructions
60
+
61
+ It pins the package version in the first line of `CONTRACTS`. Any repo works,
62
+ in any language; you only need Node. Then:
63
+
64
+ 1. List your governing docs in `CONTRACTS`.
65
+ 2. Add `version: 0.1.0` to the frontmatter of any doc you want versioned.
66
+ From then on, bump it in each PR that changes the doc (`contracts version`
67
+ does it for you).
68
+ 3. Make the `contracts / check` workflow a required status check.
69
+
70
+ ## Installing and upgrading
71
+
72
+ Install once per machine, the way you would Corepack or Bazelisk:
73
+
74
+ ```sh
75
+ npm i -g @bizibot/contracts
76
+ ```
77
+
78
+ The global `contracts` command always runs the version pinned in the repo's
79
+ `CONTRACTS` (`# @bizibot/contracts 0.1.0`). If your global copy is a different
80
+ version, it runs the pinned one with `npx` for you. Without a global install,
81
+ `npx @bizibot/contracts <command>` does the same.
82
+
83
+ To upgrade a repo, run the new version's `init --update` and commit the result
84
+ in one PR:
85
+
86
+ ```sh
87
+ npx @bizibot/contracts@0.2.0 init --update
88
+ ```
89
+
90
+ It changes the pin and the managed files. There's no dev dependency and
91
+ nothing in `package.json`.
92
+
93
+ ## CLI
94
+
95
+ | Command | What it does |
96
+ |---|---|
97
+ | `contracts init` | Bootstrap a repo; `--update` refreshes managed files |
98
+ | `contracts new <kind> <slug>` | Create a doc in the right folder, with frontmatter and the kind's template |
99
+ | `contracts version <level> [path …]` | Write the next `patch`, `minor` or `major` version into the docs you changed |
100
+ | `contracts check` | The PR check: version changes, ranges, `CONTRACTS` validity, managed files |
101
+ | `contracts release` | After merge: tag new doc versions. Nothing else; your own release tooling still releases your product |
102
+ | `contracts list <path-or-id>` | What governs this file or doc? |
103
+ | `contracts list <path-or-id> --dependents` | What depends on it? |
104
+
105
+ Every command accepts `--json`, so other tools, such as an AI reviewer that
106
+ suggests bump levels, can build on the results. The package itself stays
107
+ deterministic, with no AI inside.
108
+
109
+ ## Docs
110
+
111
+ - [Taxonomy](docs/taxonomy.md): the six kinds of governing doc and how they relate
112
+ - [The CONTRACTS file](docs/contracts-file.md): format, matching, entries
113
+ - [Versioning](docs/versioning.md): what patch, minor and major mean for docs
114
+ - [Delivery workflow](docs/workflow.md): the PR rules the framework relies on
115
+ - [Suggested practices](docs/practices.md): optional ideas for Issues, PRDs, and scoping changes
116
+ - [Checks and CI](docs/checks.md): the PR check, releases, runner security
117
+ - [Across repos](docs/cross-repo.md): depending on another repo's docs *(after v1)*
118
+ - [Agents](docs/agents.md): always-on rules, skills, and who runs what
119
+
120
+ ## Principles
121
+
122
+ - **Dead simple.** One file, one grammar you already know, two workflows, no
123
+ configuration.
124
+ - **Never runs PR code.** The check reads PR content as data.
125
+ - **Acknowledgment, not compliance.** A satisfied range means the code claims
126
+ the current contract version. Review and tests still prove it complies.
127
+ - **No lock-in.** Everything is plain Markdown, YAML frontmatter and Git tags.
128
+
129
+ ## License
130
+
131
+ MIT
@@ -0,0 +1,12 @@
1
+ [
2
+ { "pattern": "*", "path": "README.md", "matches": true },
3
+ { "pattern": "/src/auth", "path": "src/auth/token.ts", "matches": true },
4
+ { "pattern": "**/x", "path": "a/b/x", "matches": true },
5
+ { "pattern": "x/**/y", "path": "x/y", "matches": true },
6
+ { "pattern": "x/**", "path": "x", "matches": true },
7
+ { "pattern": "x/**", "path": "x/a/b", "matches": true },
8
+ { "pattern": "a/**/**/x", "path": "a/b/x", "matches": true },
9
+ { "pattern": "src/\\*\\?\\#\\ file", "path": "src/*?# file", "matches": true },
10
+ { "pattern": "[x]{y}", "path": "[x]{y}", "matches": true },
11
+ { "pattern": "Readme.md", "path": "README.md", "matches": false }
12
+ ]