lgtm-specs 0.0.4

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 (212) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/.gemini/README.md +8 -0
  3. package/.gemini/config.yaml +20 -0
  4. package/.gemini/styleguide.md +35 -0
  5. package/.github/workflows/README.md +5 -0
  6. package/.github/workflows/release.yml +52 -0
  7. package/.github/workflows/validate.yml +27 -0
  8. package/.prettierignore +4 -0
  9. package/.prettierrc +1 -0
  10. package/AGENTS.md +151 -0
  11. package/README.md +98 -0
  12. package/VERSION +1 -0
  13. package/agents/README.md +73 -0
  14. package/agents/modes/README.md +9 -0
  15. package/agents/modes/build.md +88 -0
  16. package/agents/modes/hack.md +76 -0
  17. package/agents/modes/review.md +79 -0
  18. package/agents/roles/builder.md +75 -0
  19. package/agents/roles/counsel.md +96 -0
  20. package/agents/roles/explorer.md +77 -0
  21. package/agents/roles/lead.md +76 -0
  22. package/agents/roles/librarian.md +63 -0
  23. package/agents/roles/planner.md +75 -0
  24. package/agents/roles/reviewer/BASE.md +9 -0
  25. package/agents/roles/reviewer/OUTPUT_FORMAT.md +4 -0
  26. package/agents/roles/reviewer/README.md +48 -0
  27. package/agents/roles/reviewer/lite.md +51 -0
  28. package/agents/roles/reviewer/logic.md +48 -0
  29. package/agents/roles/reviewer/performance.md +45 -0
  30. package/agents/roles/reviewer/plan.md +52 -0
  31. package/agents/roles/reviewer/quality.md +49 -0
  32. package/agents/roles/reviewer/security.md +47 -0
  33. package/agents/roles/reviewer/test.md +48 -0
  34. package/agents/templates/README.md +6 -0
  35. package/agents/templates/mode.md +33 -0
  36. package/agents/templates/role.md +73 -0
  37. package/contribute/README.md +24 -0
  38. package/contribute/add-agent.md +29 -0
  39. package/contribute/add-ci.md +31 -0
  40. package/contribute/add-constitution.md +17 -0
  41. package/contribute/add-law.md +20 -0
  42. package/contribute/add-policy.md +27 -0
  43. package/contribute/checklist.md +42 -0
  44. package/contribute/maintenance.md +19 -0
  45. package/contribute/update-models.md +47 -0
  46. package/docs/README.md +13 -0
  47. package/docs/adr/0001-knowledge-engineering-workflow.md +22 -0
  48. package/docs/adr/0002-rule-hierarchy.md +25 -0
  49. package/docs/adr/0003-atomic-knowledge-graph.md +21 -0
  50. package/docs/adr/0004-identification-schema.md +22 -0
  51. package/docs/adr/0005-agent-specialization.md +39 -0
  52. package/docs/adr/0006-git-workflow-integrity.md +34 -0
  53. package/docs/adr/0007-operating-modes-and-gates.md +54 -0
  54. package/docs/adr/0008-rules-vs-workflows-boundary.md +64 -0
  55. package/docs/adr/README.md +14 -0
  56. package/docs/agent_architecture.md +164 -0
  57. package/docs/context_lifecycle.md +228 -0
  58. package/docs/engineering_principles.md +128 -0
  59. package/docs/local_policies.md +59 -0
  60. package/docs/meta/collaborative_dynamics.md +142 -0
  61. package/docs/meta/domains/README.md +8 -0
  62. package/docs/meta/domains/bitcoin/01-units.md +21 -0
  63. package/docs/meta/domains/bitcoin/02-broadcast-cancellation.md +20 -0
  64. package/docs/meta/domains/bitcoin/03-fee-rates-rounding.md +21 -0
  65. package/docs/meta/domains/bitcoin/04-confirmations-reorgs.md +20 -0
  66. package/docs/meta/domains/bitcoin/05-address-gap-limit.md +16 -0
  67. package/docs/meta/domains/bitcoin/06-relay-policy.md +27 -0
  68. package/docs/meta/domains/bitcoin/README.md +12 -0
  69. package/docs/meta/domains/git/01-workflow.md +89 -0
  70. package/docs/meta/domains/git/02-commits.md +57 -0
  71. package/docs/meta/domains/git/03-collaboration.md +40 -0
  72. package/docs/meta/domains/git/04-integrity.md +26 -0
  73. package/docs/meta/domains/git/05-configuration.md +209 -0
  74. package/docs/meta/domains/git/06-advanced.md +130 -0
  75. package/docs/meta/domains/git/README.md +29 -0
  76. package/docs/meta/industry_best_practices.md +555 -0
  77. package/docs/meta/languages/README.md +8 -0
  78. package/docs/meta/languages/go/01-concurrency.md +37 -0
  79. package/docs/meta/languages/go/02-api-design.md +30 -0
  80. package/docs/meta/languages/go/03-resilience.md +27 -0
  81. package/docs/meta/languages/go/04-errors.md +27 -0
  82. package/docs/meta/languages/go/05-performance.md +18 -0
  83. package/docs/meta/languages/go/06-safety.md +18 -0
  84. package/docs/meta/languages/go/07-testing.md +44 -0
  85. package/docs/meta/languages/go/08-config-layout.md +23 -0
  86. package/docs/meta/languages/go/README.md +14 -0
  87. package/docs/meta/languages/typescript/01-strictness.md +19 -0
  88. package/docs/meta/languages/typescript/02-immutability.md +15 -0
  89. package/docs/meta/languages/typescript/03-async.md +18 -0
  90. package/docs/meta/languages/typescript/04-design.md +19 -0
  91. package/docs/meta/languages/typescript/05-control-flow.md +11 -0
  92. package/docs/meta/languages/typescript/README.md +11 -0
  93. package/docs/meta/workflow.md +68 -0
  94. package/docs/philosophy.md +36 -0
  95. package/integrate/README.md +459 -0
  96. package/integrate/versioning.md +41 -0
  97. package/models/README.md +68 -0
  98. package/models/registry.yaml +55 -0
  99. package/package.json +11 -0
  100. package/rules/README.md +57 -0
  101. package/rules/RULE-00000-EXAMPLE.md +29 -0
  102. package/rules/constitution/CONS-00001-srp.md +40 -0
  103. package/rules/constitution/CONS-00002-ocp.md +43 -0
  104. package/rules/constitution/CONS-00003-lsp.md +44 -0
  105. package/rules/constitution/CONS-00004-isp.md +46 -0
  106. package/rules/constitution/CONS-00005-dip.md +37 -0
  107. package/rules/constitution/CONS-00006-dry.md +45 -0
  108. package/rules/constitution/CONS-00007-demeter.md +35 -0
  109. package/rules/constitution/CONS-00008-composition.md +44 -0
  110. package/rules/constitution/CONS-00009-deep-modules.md +39 -0
  111. package/rules/constitution/CONS-00010-kiss.md +47 -0
  112. package/rules/constitution/CONS-00011-yagni.md +49 -0
  113. package/rules/constitution/CONS-00012-cognitive-limits.md +28 -0
  114. package/rules/constitution/CONS-00013-boy-scout.md +27 -0
  115. package/rules/constitution/CONS-00014-broken-windows.md +35 -0
  116. package/rules/constitution/CONS-00015-safety.md +46 -0
  117. package/rules/constitution/CONS-00016-cqs.md +39 -0
  118. package/rules/constitution/CONS-00017-postel.md +35 -0
  119. package/rules/constitution/CONS-00018-cap.md +35 -0
  120. package/rules/constitution/CONS-00019-fallacies.md +37 -0
  121. package/rules/constitution/CONS-00020-shift-left.md +28 -0
  122. package/rules/constitution/CONS-00021-congruence.md +28 -0
  123. package/rules/constitution/CONS-00022-orthogonality.md +40 -0
  124. package/rules/constitution/CONS-00023-determinism.md +38 -0
  125. package/rules/constitution/CONS-00024-security.md +42 -0
  126. package/rules/constitution/CONS-00025-efficiency.md +38 -0
  127. package/rules/constitution/CONS-00026-resilience.md +41 -0
  128. package/rules/constitution/CONS-00027-transparency.md +40 -0
  129. package/rules/constitution/CONS-00028-evolvability.md +36 -0
  130. package/rules/constitution/CONS-00029-operability.md +36 -0
  131. package/rules/constitution/CONS-00030-rework-cycle.md +27 -0
  132. package/rules/constitution/CONS-00031-checklist.md +28 -0
  133. package/rules/constitution/CONS-00032-documentation.md +39 -0
  134. package/rules/constitution/README.md +52 -0
  135. package/rules/laws/README.md +15 -0
  136. package/rules/laws/bitcoin/BTC-00001-amounts-as-satoshis.md +39 -0
  137. package/rules/laws/bitcoin/BTC-00002-broadcast-not-cancelable.md +36 -0
  138. package/rules/laws/bitcoin/BTC-00003-fee-rate-math-rounding.md +37 -0
  139. package/rules/laws/bitcoin/BTC-00004-confirmations-and-reorgs.md +40 -0
  140. package/rules/laws/bitcoin/BTC-00005-address-gap-limit.md +37 -0
  141. package/rules/laws/bitcoin/BTC-00006-relay-is-policy-dependent.md +36 -0
  142. package/rules/laws/bitcoin/BTC-00007-dust-policy.md +36 -0
  143. package/rules/laws/bitcoin/BTC-00008-min-relay-fee.md +36 -0
  144. package/rules/laws/bitcoin/BTC-00009-feefilter.md +36 -0
  145. package/rules/laws/bitcoin/README.md +29 -0
  146. package/rules/laws/default.md +30 -0
  147. package/rules/laws/git/GIT-00001-atomic-commit.md +29 -0
  148. package/rules/laws/git/GIT-00002-imperative-subject.md +27 -0
  149. package/rules/laws/git/GIT-00003-formatting-50-72.md +28 -0
  150. package/rules/laws/git/GIT-00004-trunk-based.md +28 -0
  151. package/rules/laws/git/GIT-00005-public-immutability.md +26 -0
  152. package/rules/laws/git/GIT-00006-signing.md +27 -0
  153. package/rules/laws/git/GIT-00007-reviewer-capital.md +26 -0
  154. package/rules/laws/git/GIT-00008-patch-series.md +28 -0
  155. package/rules/laws/git/GIT-00009-branch-naming.md +28 -0
  156. package/rules/laws/git/GIT-00010-pr-hygiene.md +51 -0
  157. package/rules/laws/git/GIT-00011-merge-method.md +35 -0
  158. package/rules/laws/git/GIT-00012-conflict-resolution.md +35 -0
  159. package/rules/laws/git/GIT-00013-ignore-standards.md +38 -0
  160. package/rules/laws/git/GIT-00014-lfs-large-binaries.md +37 -0
  161. package/rules/laws/git/GIT-00015-git-hooks.md +35 -0
  162. package/rules/laws/git/GIT-00016-branch-protection.md +34 -0
  163. package/rules/laws/git/GIT-00017-secrets-management.md +34 -0
  164. package/rules/laws/git/GIT-00018-ci-enforcement.md +33 -0
  165. package/rules/laws/git/GIT-00019-review-checklist.md +39 -0
  166. package/rules/laws/git/GIT-00020-issue-references.md +34 -0
  167. package/rules/laws/git/GIT-00021-partial-staging.md +38 -0
  168. package/rules/laws/git/GIT-00022-feature-flags.md +33 -0
  169. package/rules/laws/git/GIT-00023-breaking-changes.md +41 -0
  170. package/rules/laws/git/GIT-00024-dependency-management.md +44 -0
  171. package/rules/laws/git/GIT-00025-large-repository-optimization.md +54 -0
  172. package/rules/laws/git/README.md +31 -0
  173. package/rules/laws/go/GO-00001-actor-model.md +51 -0
  174. package/rules/laws/go/GO-00002-api-design.md +37 -0
  175. package/rules/laws/go/GO-00003-error-handling.md +43 -0
  176. package/rules/laws/go/GO-00004-context.md +45 -0
  177. package/rules/laws/go/GO-00005-performance.md +40 -0
  178. package/rules/laws/go/GO-00006-packages.md +29 -0
  179. package/rules/laws/go/GO-00007-circuit-breakers.md +43 -0
  180. package/rules/laws/go/GO-00008-safety.md +39 -0
  181. package/rules/laws/go/GO-00009-table-driven-test.md +48 -0
  182. package/rules/laws/go/GO-00010-escape-analysis.md +37 -0
  183. package/rules/laws/go/GO-00011-retry.md +45 -0
  184. package/rules/laws/go/GO-00012-rate-limiting.md +42 -0
  185. package/rules/laws/go/GO-00013-io-buffering.md +43 -0
  186. package/rules/laws/go/GO-00014-memory-layout.md +41 -0
  187. package/rules/laws/go/GO-00015-aaa-pattern.md +49 -0
  188. package/rules/laws/go/GO-00016-test-libraries.md +35 -0
  189. package/rules/laws/go/GO-00017-comments.md +37 -0
  190. package/rules/laws/go/GO-00018-test-isolation.md +38 -0
  191. package/rules/laws/go/GO-00019-test-comments.md +36 -0
  192. package/rules/laws/go/GO-00020-mocking.md +36 -0
  193. package/rules/laws/go/GO-00021-configuration.md +36 -0
  194. package/rules/laws/go/GO-00022-observability.md +34 -0
  195. package/rules/laws/go/GO-00023-dependency-management.md +28 -0
  196. package/rules/laws/go/GO-00024-project-layout.md +30 -0
  197. package/rules/laws/go/GO-00025-concurrency-patterns.md +39 -0
  198. package/rules/laws/go/README.md +45 -0
  199. package/rules/laws/typescript/README.md +14 -0
  200. package/rules/laws/typescript/TS-00001-no-any.md +39 -0
  201. package/rules/laws/typescript/TS-00002-immutability.md +36 -0
  202. package/rules/laws/typescript/TS-00003-async.md +35 -0
  203. package/rules/laws/typescript/TS-00004-strict-null.md +38 -0
  204. package/rules/laws/typescript/TS-00005-unions.md +35 -0
  205. package/rules/laws/typescript/TS-00006-interface.md +38 -0
  206. package/rules/laws/typescript/TS-00007-generics.md +38 -0
  207. package/rules/laws/typescript/TS-00008-modules.md +28 -0
  208. package/rules/policies/README.md +12 -0
  209. package/rules/policies/default.md +28 -0
  210. package/scripts/README.md +45 -0
  211. package/scripts/generate_release_notes.py +376 -0
  212. package/scripts/validate_specs.py +730 -0
@@ -0,0 +1,28 @@
1
+ # Logical Commit Series Structure (GIT-00008)
2
+
3
+ **Source**: [01. The Workflow](../../../docs/meta/domains/git/01-workflow.md#2-the-atomic-commit-philosophy)
4
+ **Tags**: #structural #git #git-commit #workflow #series
5
+ **Related**: [Composition](../../constitution/CONS-00008-composition.md)
6
+
7
+ ## Definition
8
+
9
+ Complex changes must be broken into a Logical Commit Series of independent commits.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Ordering**: Abstraction first, Implementation second.
14
+ 2. **Independence**: Commit N must compile without Commit N+1.
15
+
16
+ ## Anti-Patterns
17
+
18
+ - Commit 1: "Add half of the feature (broken)".
19
+ - Commit 2: "Finish feature (fixes build)".
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+ Big PR.
25
+
26
+ **Good:**
27
+ Commit 1: `feat: add IService interface`
28
+ Commit 2: `feat: implement Service`
@@ -0,0 +1,28 @@
1
+ # Branch Naming (GIT-00009)
2
+
3
+ **Source**: [01. The Workflow](../../../docs/meta/domains/git/01-workflow.md#1-the-single-source-of-truth)
4
+ **Tags**: #structural #git #git-branch #naming
5
+ **Related**: [The Checklist](../../constitution/CONS-00031-checklist.md)
6
+
7
+ ## Definition
8
+
9
+ Branch names are a structured communication channel. They must be readable, searchable, and automation-friendly.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Prefix**: Use `<type>/...` to express intent (`feat/`, `fix/`, `refactor/`, `docs/`, `test/`, `chore/`).
14
+ 2. **Format**: Use kebab-case for the description (`feat/user-login`, not `feat/UserLogin`).
15
+ 3. **Clarity**: The description must explain the work without requiring additional context.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - `tmp/try-stuff` (unclear intent)
20
+ - `feature/1234` (ticket-only names)
21
+
22
+ ## Examples
23
+
24
+ **Good:**
25
+ `fix/api-timeout`
26
+
27
+ **Bad:**
28
+ `branch1`
@@ -0,0 +1,51 @@
1
+ # Pull Request Hygiene (GIT-00010)
2
+
3
+ **Source**: [01. The Workflow](../../../docs/meta/domains/git/01-workflow.md#2-the-atomic-commit-philosophy)
4
+ **Tags**: #operational #git #git-review #pr #workflow
5
+ **Related**: [Cognitive Limits](../../constitution/CONS-00012-cognitive-limits.md)
6
+
7
+ ## Definition
8
+
9
+ A pull request is the unit of integration into `main`. It must be reviewable and safe to merge.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Description**: The PR description should state intent, testing performed, and any rollout/flagging notes.
14
+ 2. **Scope**: The PR should be small enough to enable a high-quality review.
15
+ 3. **Transparency**: If conflict resolution materially changes behavior, it must be called out in the PR description.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - "misc fixes" with no testing notes.
20
+ - PRs that bundle unrelated changes.
21
+
22
+ ## Examples
23
+
24
+ **Bad:**
25
+
26
+ ```markdown
27
+ Title: misc fixes
28
+
29
+ Description:
30
+
31
+ - changed stuff
32
+ ```
33
+
34
+ **Good:**
35
+
36
+ ```markdown
37
+ Title: Add widget creation behind flag
38
+
39
+ Intent:
40
+
41
+ - Add widget creation flow behind `WIDGETS_V2`.
42
+
43
+ Testing:
44
+
45
+ - Unit: `go test ./...`
46
+ - Manual: created widget via UI and verified persisted state.
47
+
48
+ Rollout:
49
+
50
+ - Flag default OFF; canary enable in staging.
51
+ ```
@@ -0,0 +1,35 @@
1
+ # Merge Method (No Squash) (GIT-00011)
2
+
3
+ **Source**: [04. History Integrity & Security](../../../docs/meta/domains/git/04-integrity.md#2-merge-strategy)
4
+ **Tags**: #operational #git #git-branch #merge #integrity
5
+ **Related**: [Safety](../../constitution/CONS-00015-safety.md)
6
+
7
+ ## Definition
8
+
9
+ `main` preserves the Logical Commit Series for auditability and debugging.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Merge Commit**: PRs must be merged into `main` with a merge commit.
14
+ 2. **No Squash**: Squash-merge into `main` is forbidden.
15
+ 3. **No Rebase-Merge**: Rebase-merging into `main` is forbidden.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Flattening a multi-commit PR into one commit on `main`.
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Merge method: Squash and merge
27
+ Result: PR commit series collapsed into 1 commit on main
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```text
33
+ Merge method: Create a merge commit
34
+ Result: main retains the PR's logical commit series for audit/debug
35
+ ```
@@ -0,0 +1,35 @@
1
+ # Conflict Resolution (GIT-00012)
2
+
3
+ **Source**: [03. Collaboration & Etiquette](../../../docs/meta/domains/git/03-collaboration.md#4-conflict-resolution)
4
+ **Tags**: #behavioral #git #git-collaboration #conflicts
5
+ **Related**: [Transparency](../../constitution/CONS-00027-transparency.md)
6
+
7
+ ## Definition
8
+
9
+ Merge conflicts are resolved by the author, with changes kept reviewable and explicitly communicated.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Owner**: The author resolves merge conflicts.
14
+ 2. **Reviewability**: Conflict resolutions must be made in small, reviewable commits.
15
+ 3. **Escalation**: If resolution is unclear or high-risk, escalate to the Team Lead and/or open an RFC issue.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Resolving conflicts by blindly accepting "incoming" changes.
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Resolved conflicts by accepting "incoming" without understanding.
27
+ Pushed a single large conflict-resolution commit with no explanation.
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```text
33
+ Commit message: resolve conflicts: preserve API signature; keep new tests
34
+ PR description: calls out any behavior changes introduced by resolution
35
+ ```
@@ -0,0 +1,38 @@
1
+ # Ignore Standards (GIT-00013)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#3-ignore-standards)
4
+ **Tags**: #operational #git #git-hygiene #ignore
5
+ **Related**: [Security](../../constitution/CONS-00024-security.md)
6
+
7
+ ## Definition
8
+
9
+ Repositories must not version generated artifacts or secrets.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Generated Artifacts**: Generated build outputs must be ignored.
14
+ 2. **Secrets**: Secret-bearing files (e.g., `.env`) must be ignored.
15
+ 3. **Noise**: Platform cruft (e.g., `.DS_Store`) should be ignored.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Committing `.env` files.
20
+ - Committing `dist/` build outputs.
21
+
22
+ ## Examples
23
+
24
+ **Bad:**
25
+
26
+ ```text
27
+ Committed: .env, dist/, node_modules/
28
+ Result: secrets exposure + noisy diffs + slow clones
29
+ ```
30
+
31
+ **Good:**
32
+
33
+ ```gitignore
34
+ node_modules/
35
+ dist/
36
+ .env
37
+ .DS_Store
38
+ ```
@@ -0,0 +1,37 @@
1
+ # Large Binaries via LFS (GIT-00014)
2
+
3
+ **Source**: [06. Advanced Operations](../../../docs/meta/domains/git/06-advanced.md#2-recovery--maintenance)
4
+ **Tags**: #operational #git #git-tooling #lfs #performance
5
+ **Related**: [Evolvability](../../constitution/CONS-00028-evolvability.md)
6
+
7
+ ## Definition
8
+
9
+ Large binary artifacts must not enter Git history; they must be tracked via Git LFS.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Policy**: Repositories must not store large or non-diffable binaries directly in Git history.
14
+ 2. **Mechanism**: Use Git LFS and commit the corresponding `.gitattributes` changes.
15
+ 3. **Platform Constraint**: On hosting platforms (e.g., GitHub), treat warning thresholds as hard guidelines and hard limits as hard blocks.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Committing archives/media directly to the repo.
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Committed: release.zip, demo.mp4
27
+ Result: bloated Git history; slow clone/fetch; poor diffs
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```bash
33
+ git lfs track "*.zip" "*.mp4"
34
+ git add .gitattributes
35
+ git add release.zip
36
+ git commit -m "chore: track large artifacts with LFS"
37
+ ```
@@ -0,0 +1,35 @@
1
+ # Git Hooks as a Fast Gate (GIT-00015)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#1-git-hooks)
4
+ **Tags**: #operational #git #git-tooling #hooks #automation
5
+ **Related**: [Safety](../../constitution/CONS-00015-safety.md)
6
+
7
+ ## Definition
8
+
9
+ Git hooks provide fast local feedback to prevent avoidable review and CI failures.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Deterministic**: Hooks must be fast and deterministic.
14
+ 2. **Coverage**: Hooks should include commit message validation and quick lint/test gates.
15
+ 3. **No Bypass**: Hook bypassing must be exceptional and explicitly justified.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Hooks that take minutes to run.
20
+ - Hooks that depend on network access.
21
+
22
+ ## Examples
23
+
24
+ **Bad:**
25
+
26
+ ```text
27
+ pre-commit: runs a full integration suite (10+ minutes) and downloads deps
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```text
33
+ commit-msg: validates commit subject format
34
+ pre-commit: runs fast lint/format + a small unit-test subset (<30s)
35
+ ```
@@ -0,0 +1,34 @@
1
+ # Branch Protection Policy (GIT-00016)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#2-branch-protection-hosting-platform)
4
+ **Tags**: #operational #git #git-governance #branch-protection #security
5
+ **Related**: [Security](../../constitution/CONS-00024-security.md)
6
+
7
+ ## Definition
8
+
9
+ Protected branches ensure that integration happens through review and verified checks.
10
+
11
+ ## Requirements
12
+
13
+ 1. **PR Only**: Direct pushes to `main` are forbidden.
14
+ 2. **Checks**: Required status checks must pass before merge.
15
+ 3. **Signatures**: Protected branches must require signed commits.
16
+ 4. **Merge Method**: Merge commits must be allowed; squash and rebase-merge must be disabled.
17
+
18
+ ## Anti-Patterns
19
+
20
+ - Admins bypassing protections for convenience.
21
+
22
+ ## Examples
23
+
24
+ **Bad:**
25
+
26
+ ```text
27
+ main allows direct pushes; merges allowed with failing checks; unsigned commits allowed
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```text
33
+ main requires PRs + passing status checks + signed commits; admins do not bypass without incident-level justification
34
+ ```
@@ -0,0 +1,34 @@
1
+ # Secrets Management (GIT-00017)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#4-secrets-and-credential-hygiene)
4
+ **Tags**: #operational #git #git-security #secrets
5
+ **Related**: [Security](../../constitution/CONS-00024-security.md)
6
+
7
+ ## Definition
8
+
9
+ Secrets must not be committed to Git.
10
+
11
+ ## Requirements
12
+
13
+ 1. **No Secrets**: Secret material must not enter Git history.
14
+ 2. **Assume Compromise**: Any committed secret must be treated as compromised and rotated.
15
+ 3. **Detection**: Repos should use secret scanning (platform scanning and/or pre-commit tooling).
16
+
17
+ ## Anti-Patterns
18
+
19
+ - "It was only in a private repo".
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Committed: .env with API_KEY=...
27
+ Response: "we'll delete it later" (treat as compromised)
28
+ ```
29
+
30
+ **Good:**
31
+
32
+ ```text
33
+ Enable secret scanning + pre-commit checks; if a secret leaks: rotate immediately and document the incident
34
+ ```
@@ -0,0 +1,33 @@
1
+ # CI Enforcement (GIT-00018)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#5-ci-enforcement)
4
+ **Tags**: #operational #git #git-ci #automation #policy
5
+ **Related**: [The Checklist](../../constitution/CONS-00031-checklist.md)
6
+
7
+ ## Definition
8
+
9
+ CI is the authoritative gate for merge policy.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Superset**: CI checks must be a superset of local hooks for merge-critical rules.
14
+ 2. **Policy Checks**: CI must enforce policies that hosting cannot enforce (e.g., verifying all PR commits are signed).
15
+ 3. **Evidence**: CI results are the evidence used to approve merges.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Hook-only rules that CI does not enforce.
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Local hooks enforce formatting, but CI does not; main accepts merges with failing checks
27
+ ```
28
+
29
+ **Good:**
30
+
31
+ ```text
32
+ CI runs lint/format/tests and blocks merge on failure; branch protection requires these checks
33
+ ```
@@ -0,0 +1,39 @@
1
+ # Code Review Checklist (GIT-00019)
2
+
3
+ **Source**: [03. Collaboration & Etiquette](../../../docs/meta/domains/git/03-collaboration.md#5-review-checklist)
4
+ **Tags**: #behavioral #git #git-review #quality
5
+ **Related**: [The Checklist](../../constitution/CONS-00031-checklist.md)
6
+
7
+ ## Definition
8
+
9
+ Code review enforces correctness, security, performance, and maintainability.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Correctness**: Review for intent and edge cases.
14
+ 2. **Security**: Review for secrets, unsafe defaults, and new attack surface.
15
+ 3. **Performance**: Review for regressions on hot paths.
16
+ 4. **Maintainability**: Review for clarity and complexity.
17
+ 5. **Verification**: Review that tests/CI evidence matches risk.
18
+
19
+ ## Anti-Patterns
20
+
21
+ - Rubber-stamp approvals.
22
+
23
+ ## Examples
24
+
25
+ **Bad:**
26
+
27
+ ```text
28
+ "LGTM" with no notes, no evidence, and no review of tests/risk
29
+ ```
30
+
31
+ **Good:**
32
+
33
+ ```text
34
+ Checklist notes:
35
+ - Correctness: edge cases X/Y
36
+ - Security: input validated at boundary
37
+ - Tests: added cases for failure paths
38
+ - Performance: no new O(n^2) in hot loop
39
+ ```
@@ -0,0 +1,34 @@
1
+ # Issue Reference Standards (GIT-00020)
2
+
3
+ **Source**: [02. The Commit](../../../docs/meta/domains/git/02-commits.md#4-issue-references)
4
+ **Tags**: #behavioral #git #git-traceability #issues
5
+ **Related**: [Transparency](../../constitution/CONS-00027-transparency.md)
6
+
7
+ ## Definition
8
+
9
+ Issue references connect changes to motivation and enable traceability.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Closing Keywords**: Use `Closes`/`Fixes`/`Resolves` when the change completes the issue.
14
+ 2. **Context Links**: Use `Refs`/`Related-to` when the change is partial or exploratory.
15
+
16
+ ## Anti-Patterns
17
+
18
+ - No issue reference for non-trivial changes.
19
+
20
+ ## Examples
21
+
22
+ **Bad:**
23
+
24
+ ```text
25
+ Commit message: fix bug
26
+ PR description: (no links)
27
+ ```
28
+
29
+ **Good:**
30
+
31
+ ```text
32
+ PR: Refs #123 (partial); follow-up tracked in #124
33
+ Commit: Refs #123: handle empty input safely
34
+ ```
@@ -0,0 +1,38 @@
1
+ # Partial Staging for Atomic Commits (GIT-00021)
2
+
3
+ **Source**: [06. Advanced Operations](../../../docs/meta/domains/git/06-advanced.md#1-partial-staging-git-add-p)
4
+ **Tags**: #behavioral #git #git-commit #atomicity
5
+ **Related**: [Cognitive Limits](../../constitution/CONS-00012-cognitive-limits.md)
6
+
7
+ ## Definition
8
+
9
+ Partial staging is a mechanism to keep commits atomic when a file contains multiple logical changes.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Atomicity**: If a file contains multiple logical changes, the commit must include only the relevant hunks.
14
+ 2. **No Mixed Commits**: Refactors, formatting, and behavior changes must not be mixed in one commit.
15
+
16
+ ## Anti-Patterns
17
+
18
+ - One commit that mixes formatting and logic changes.
19
+
20
+ ## Examples
21
+
22
+ **Bad:**
23
+
24
+ ```text
25
+ Commit includes: rename variables + reformat file + change behavior + add tests
26
+ ```
27
+
28
+ **Good:**
29
+
30
+ ```bash
31
+ # Stage only the relevant hunks for the behavior change
32
+ git add -p
33
+ git commit -m "fix: handle empty input"
34
+
35
+ # Stage formatting separately (if needed)
36
+ git add -p
37
+ git commit -m "chore: format"
38
+ ```
@@ -0,0 +1,33 @@
1
+ # Feature Flags for Trunk Discipline (GIT-00022)
2
+
3
+ **Source**: [01. The Workflow](../../../docs/meta/domains/git/01-workflow.md#4-feature-flags)
4
+ **Tags**: #structural #git #git-release #flags #workflow
5
+ **Related**: [Evolvability](../../constitution/CONS-00028-evolvability.md)
6
+
7
+ ## Definition
8
+
9
+ Feature flags preserve "always deployable" trunk invariants by separating merge from release.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Merge Behind Flags**: Incomplete features must be merged behind a flag.
14
+ 2. **Safe Defaults**: Flags must default to safe/off.
15
+ 3. **Rollback**: Flags must support rapid rollback.
16
+
17
+ ## Anti-Patterns
18
+
19
+ - Long-lived branches used to avoid feature flagging.
20
+
21
+ ## Examples
22
+
23
+ **Bad:**
24
+
25
+ ```text
26
+ Kept feature on a long-lived branch to avoid merging incomplete work; main diverged and integration became risky
27
+ ```
28
+
29
+ **Good:**
30
+
31
+ ```text
32
+ Merged incremental changes behind `FEATURE_X` (default OFF); enabled in staging first; can roll back by disabling flag
33
+ ```
@@ -0,0 +1,41 @@
1
+ # Breaking Change Management (GIT-00023)
2
+
3
+ **Source**: [01. The Workflow](../../../docs/meta/domains/git/01-workflow.md#3-the-release-lifecycle)
4
+ **Tags**: #structural #git #git-release #versioning #compatibility #breaking-change
5
+ **Related**: [Feature Flags for Trunk Discipline](GIT-00022-feature-flags.md), [Evolvability](../../constitution/CONS-00028-evolvability.md)
6
+
7
+ ## Definition
8
+
9
+ Breaking changes must be managed through versioned releases with clear communication and migration paths.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Semantic Versioning**: Breaking changes must increment the major version (following SemVer).
14
+ 2. **Changelog Documentation**: All breaking changes must be documented in a changelog with migration instructions.
15
+ 3. **Feature Flag Transition**: When possible, breaking changes should be introduced behind feature flags with deprecation periods.
16
+ 4. **Parallel Support**: For API-breaking changes, consider maintaining backward compatibility until consumers can migrate.
17
+
18
+ ## Anti-Patterns
19
+
20
+ - **Silent Breaking Change**: Introducing a breaking change without version bump or documentation.
21
+ - **Forced Migration**: Requiring immediate upgrade without migration path.
22
+ - **Version Skipping**: Making breaking changes without incrementing major version.
23
+
24
+ ## Examples
25
+
26
+ **Bad:**
27
+
28
+ ```
29
+ git commit -m "Update API to remove deprecated endpoint"
30
+ # No version bump, no migration instructions
31
+ ```
32
+
33
+ **Good:**
34
+
35
+ ```
36
+ git commit -m "feat(api): remove deprecated /v1/endpoint"
37
+ # Accompanied by:
38
+ # - CHANGELOG.md entry with migration guide
39
+ # - Version tag v2.0.0
40
+ # - Feature flag to toggle old/new behavior during transition
41
+ ```
@@ -0,0 +1,44 @@
1
+ # Dependency Management in Version Control (GIT-00024)
2
+
3
+ **Source**: [05. Configuration & Governance](../../../docs/meta/domains/git/05-configuration.md#4-secrets-and-credential-hygiene)
4
+ **Tags**: #operational #git #git-dependencies #security #maintenance #lockfiles
5
+ **Related**: [Secrets Management](GIT-00017-secrets-management.md), [CI Enforcement](GIT-00018-ci-enforcement.md)
6
+
7
+ ## Definition
8
+
9
+ Dependency updates must be managed atomically with proper version control practices to ensure reproducibility and security.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Lockfile Commitment**: Version lockfiles (package-lock.json, yarn.lock, Gemfile.lock, Cargo.lock, etc.) must be committed to the repository.
14
+ 2. **Atomic Updates**: Dependency updates should be isolated in dedicated commits, separate from feature changes.
15
+ 3. **Security Patches**: Critical security updates must be prioritized and applied as soon as possible.
16
+ 4. **Update Documentation**: Major dependency updates should include rationale and testing notes in commit messages.
17
+ 5. **Transitive Dependency Review**: Regularly review and update transitive dependencies for security vulnerabilities.
18
+
19
+ ## Anti-Patterns
20
+
21
+ - **Floating Dependencies**: Using version ranges without lockfiles, leading to non-reproducible builds.
22
+ - **Mixed Changes**: Combining dependency updates with feature development in the same commit.
23
+ - **Ignored Security Alerts**: Dismissing security vulnerability reports for dependencies.
24
+ - **Manual Editing**: Manually editing lockfiles instead of using package manager commands.
25
+
26
+ ## Examples
27
+
28
+ **Bad:**
29
+
30
+ ```
31
+ git commit -m "Add new feature and update dependencies"
32
+ # Mixed concerns, no clear audit trail
33
+ ```
34
+
35
+ **Good:**
36
+
37
+ ```
38
+ git commit -m "chore(deps): update React to v18.2.0
39
+
40
+ - Improves concurrent rendering performance
41
+ - Includes security fixes for CVE-2023-XXXXX
42
+ - Tested with existing component suite"
43
+ # Followed by separate feature commit
44
+ ```
@@ -0,0 +1,54 @@
1
+ # Large Repository Optimization (GIT-00025)
2
+
3
+ **Source**: [06. Advanced Operations](../../../docs/meta/domains/git/06-advanced.md#4-large-repos--dependencies)
4
+ **Tags**: #operational #git #git-performance #large-repo #monorepo #optimization
5
+ **Related**: [Large Binaries via LFS](GIT-00014-lfs-large-binaries.md), [Partial Staging for Atomic Commits](GIT-00021-partial-staging.md)
6
+
7
+ ## Definition
8
+
9
+ Large repositories must use optimization techniques to maintain developer productivity and CI efficiency.
10
+
11
+ ## Requirements
12
+
13
+ 1. **Sparse Checkout**: Repositories exceeding 1GB should consider sparse checkout configurations for focused development.
14
+ 2. **Shallow Clones**: CI systems should use shallow clones (`--depth=1`) where appropriate to reduce clone times.
15
+ 3. **LFS for Binaries**: Large binary files (>50MB) must be tracked via Git LFS.
16
+ 4. **History Optimization**: Consider periodic history cleanup (git gc, repack) for repositories with extensive history.
17
+ 5. **Monorepo Structure**: If using monorepo structure, enforce clear directory boundaries and ownership.
18
+
19
+ ## Anti-Patterns
20
+
21
+ - **Full History Cloning**: Always cloning full history in CI when shallow would suffice.
22
+ - **Binary Bloat**: Committing large binaries directly to Git history.
23
+ - **Unbounded Growth**: Allowing repository size to grow without optimization considerations.
24
+ - **Cross-Cutting Dependencies**: Creating circular dependencies between monorepo packages.
25
+
26
+ ## Examples
27
+
28
+ **Bad:**
29
+
30
+ ```
31
+ # CI configuration cloning full 10GB repository history every build
32
+ git clone https://github.com/company/monorepo
33
+ ```
34
+
35
+ **Good:**
36
+
37
+ ```
38
+ # CI configuration with optimization
39
+ git clone --depth=1 --filter=blob:none https://github.com/company/monorepo
40
+ cd monorepo
41
+ git sparse-checkout set packages/frontend
42
+ ```
43
+
44
+ **Monorepo Structure Example:**
45
+
46
+ ```
47
+ monorepo/
48
+ ├── packages/
49
+ │ ├── frontend/ # Owned by Frontend Team
50
+ │ ├── backend/ # Owned by Backend Team
51
+ │ └── shared/ # Shared ownership
52
+ ├── tools/ # Build tooling
53
+ └── docs/ # Documentation
54
+ ```