@rvdbreemen/adr-kit-opencode 0.52.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 (129) hide show
  1. package/.claude-plugin/plugin.json +29 -0
  2. package/LICENSE +21 -0
  3. package/README.md +850 -0
  4. package/bin/adr +1552 -0
  5. package/bin/adr-audit +454 -0
  6. package/bin/adr-context +584 -0
  7. package/bin/adr-discover +546 -0
  8. package/bin/adr-doctor +166 -0
  9. package/bin/adr-generate-scripts +421 -0
  10. package/bin/adr-grill-signal +131 -0
  11. package/bin/adr-guardian +1263 -0
  12. package/bin/adr-index +199 -0
  13. package/bin/adr-judge +2832 -0
  14. package/bin/adr-judge-precommit +87 -0
  15. package/bin/adr-lint +2087 -0
  16. package/bin/adr-mcp +1093 -0
  17. package/bin/adr-migrate +644 -0
  18. package/bin/adr-quality +275 -0
  19. package/bin/adr-readiness +211 -0
  20. package/bin/adr-readiness-ci +111 -0
  21. package/bin/adr-related +401 -0
  22. package/bin/adr-renumber +254 -0
  23. package/bin/adr-retire +467 -0
  24. package/bin/adr-settings +399 -0
  25. package/bin/adr-status +797 -0
  26. package/bin/adr-suggest +803 -0
  27. package/bin/adr-watch +674 -0
  28. package/bin/adr_catalog.py +536 -0
  29. package/bin/adr_config.py +280 -0
  30. package/bin/adr_doctor_checks.py +407 -0
  31. package/bin/adr_doctor_core.py +342 -0
  32. package/bin/adr_doctor_models.py +186 -0
  33. package/bin/adr_doctor_probes.py +216 -0
  34. package/bin/adr_format.py +786 -0
  35. package/bin/adr_grill_signal.py +123 -0
  36. package/bin/adr_guardian_queue.py +218 -0
  37. package/bin/adr_history_scan.py +278 -0
  38. package/bin/adr_index_core.py +443 -0
  39. package/bin/adr_llm.py +333 -0
  40. package/bin/adr_llm_judge_migration.py +314 -0
  41. package/bin/adr_quality_core.py +674 -0
  42. package/bin/adr_query.py +678 -0
  43. package/bin/adr_readiness.py +442 -0
  44. package/bin/adr_readiness_ci.py +123 -0
  45. package/bin/adr_regex.py +165 -0
  46. package/bin/adr_regex_worker.py +30 -0
  47. package/bin/adr_retrieval_health.py +385 -0
  48. package/bin/adr_schema.py +448 -0
  49. package/bin/adr_state.py +172 -0
  50. package/bin/bump-version +71 -0
  51. package/clients/workflows.json +229 -0
  52. package/hooks/__init__.py +1 -0
  53. package/hooks/adapters/__init__.py +13 -0
  54. package/hooks/adapters/claude.py +27 -0
  55. package/hooks/adapters/codex.py +26 -0
  56. package/hooks/adapters/copilot.py +11 -0
  57. package/hooks/adr-hook.py +128 -0
  58. package/hooks/adr_hook_core.py +843 -0
  59. package/hooks/adr_pr_guard.py +367 -0
  60. package/instructions/ADR-guide.md +48 -0
  61. package/instructions/adr.coding.md +82 -0
  62. package/instructions/adr.review.md +182 -0
  63. package/opencode/plugin.ts +451 -0
  64. package/package.json +41 -0
  65. package/schemas/adr-context-probes.schema.json +56 -0
  66. package/schemas/adr-enforcement.schema.json +57 -0
  67. package/schemas/adr-frontmatter.schema.json +144 -0
  68. package/schemas/adr-index.schema.json +276 -0
  69. package/schemas/adr-kit-config.schema.json +371 -0
  70. package/schemas/adr-readiness.schema.json +41 -0
  71. package/schemas/client-capabilities.schema.json +503 -0
  72. package/schemas/client-certification.schema.json +101 -0
  73. package/schemas/doctor-output.schema.json +92 -0
  74. package/schemas/marketplace.json.schema.json +70 -0
  75. package/schemas/plugin.json.schema.json +67 -0
  76. package/scripts/adr_settings.py +239 -0
  77. package/scripts/benchmark-adr-grilling.py +323 -0
  78. package/scripts/benchmark-client-generation.py +178 -0
  79. package/scripts/build-client-adapters.py +139 -0
  80. package/scripts/bump-version.py +304 -0
  81. package/scripts/check-branch-sync.py +243 -0
  82. package/scripts/check-release-version.py +81 -0
  83. package/scripts/client_certification.py +153 -0
  84. package/scripts/client_evidence.py +280 -0
  85. package/scripts/client_generation.py +288 -0
  86. package/scripts/client_generation_artifacts.py +351 -0
  87. package/scripts/client_generation_model.py +173 -0
  88. package/scripts/client_generation_state.py +260 -0
  89. package/scripts/client_support_matrix.py +360 -0
  90. package/scripts/install-agent-envs.py +300 -0
  91. package/scripts/probe-client-events.py +183 -0
  92. package/scripts/project_setup.py +379 -0
  93. package/scripts/refresh-otgw-corpus.py +219 -0
  94. package/scripts/settings.py +81 -0
  95. package/scripts/setup-project.py +205 -0
  96. package/scripts/sync-agent-plugins.py +17 -0
  97. package/scripts/version_sites.py +377 -0
  98. package/skills/adr/SKILL.md +780 -0
  99. package/skills/audit/SKILL.md +103 -0
  100. package/skills/context/SKILL.md +77 -0
  101. package/skills/grill/SKILL.md +84 -0
  102. package/skills/grill/agents/openai.yaml +4 -0
  103. package/skills/guardian/SKILL.md +316 -0
  104. package/skills/init/SKILL.md +499 -0
  105. package/skills/install-hooks/SKILL.md +154 -0
  106. package/skills/judge/SKILL.md +168 -0
  107. package/skills/lint/SKILL.md +321 -0
  108. package/skills/migrate/SKILL.md +313 -0
  109. package/skills/related/SKILL.md +62 -0
  110. package/skills/retire/SKILL.md +41 -0
  111. package/skills/review/SKILL.md +167 -0
  112. package/skills/settings/SKILL.md +73 -0
  113. package/skills/setup/SKILL.md +128 -0
  114. package/skills/supersede/SKILL.md +136 -0
  115. package/skills/upgrade/SKILL.md +273 -0
  116. package/templates/adr-kit-guide.md +354 -0
  117. package/templates/adr-template.canonical.md +115 -0
  118. package/templates/adr-template.madr.md +131 -0
  119. package/templates/adr-template.md +131 -0
  120. package/templates/adr-template.nygard.md +111 -0
  121. package/templates/cc-settings/guardian-hook-entry.json +9 -0
  122. package/templates/githooks/pre-commit +337 -0
  123. package/templates/github-workflows/adr-audit.yml +58 -0
  124. package/templates/github-workflows/adr-guardian-audit.yml +133 -0
  125. package/templates/github-workflows/adr-index-check.yml +30 -0
  126. package/templates/github-workflows/adr-judge.yml +31 -0
  127. package/templates/github-workflows/adr-readiness.yml +18 -0
  128. package/templates/validate_adr_template.py +38 -0
  129. package/templates/validate_adr_template.sh +74 -0
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env python3
2
+ """adr-judge-precommit — thin wrapper for the pre-commit framework.
3
+
4
+ The pre-commit framework (https://pre-commit.com) invokes hooks with a list
5
+ of staged filenames. bin/adr-judge, however, needs the *diff* piped on
6
+ stdin — it does not accept filenames. This wrapper bridges the gap:
7
+
8
+ 1. Reads the staged diff via ``git diff --cached --unified=0``.
9
+ 2. Pipes it to the sibling ``bin/adr-judge --diff - --adr-dir docs/adr/``
10
+ (path resolved relative to this script, so the invocation is
11
+ repository-root-independent).
12
+ 3. Propagates the exit code from adr-judge verbatim.
13
+
14
+ Exit codes (mirroring bin/adr-judge):
15
+ 0 no violations
16
+ 1 at least one Enforcement violation
17
+ 2 config or input error
18
+
19
+ Usage (via pre-commit framework — do not invoke directly):
20
+ See .pre-commit-hooks.yaml in the adr-kit repository.
21
+
22
+ Usage (direct smoke-test, cwd = a git repository):
23
+ python bin/adr-judge-precommit
24
+ """
25
+
26
+ from __future__ import annotations
27
+
28
+ import subprocess
29
+ import sys
30
+ from pathlib import Path
31
+
32
+ # Resolve bin/adr-judge relative to *this* script so the wrapper works
33
+ # regardless of where the pre-commit framework places it on PATH.
34
+ _SELF = Path(__file__).resolve()
35
+ _ADR_JUDGE = _SELF.parent / "adr-judge"
36
+
37
+ if not _ADR_JUDGE.exists():
38
+ print(
39
+ f"[adr-judge-precommit] ERROR: sibling binary not found: {_ADR_JUDGE}",
40
+ file=sys.stderr,
41
+ )
42
+ sys.exit(2)
43
+
44
+
45
+ def main() -> int:
46
+ # Answer --help without judging anything. The wrapper takes no arguments,
47
+ # so it used to run a full judge for `--help` and merely look fast while no
48
+ # LLM backend was configured; with one recorded (TASK-169) the same call
49
+ # spawns a host CLI per ADR and takes tens of seconds. A help flag must
50
+ # never do the work it is asking about.
51
+ if any(argument in {"-h", "--help"} for argument in sys.argv[1:]):
52
+ print(__doc__.strip())
53
+ return 0
54
+
55
+ # Step 1: capture the staged diff.
56
+ diff_proc = subprocess.run(
57
+ ["git", "diff", "--cached", "--unified=0"],
58
+ stdin=subprocess.DEVNULL,
59
+ capture_output=True,
60
+ )
61
+ if diff_proc.returncode != 0:
62
+ print(
63
+ "[adr-judge-precommit] ERROR: 'git diff --cached' failed.",
64
+ file=sys.stderr,
65
+ )
66
+ print(diff_proc.stderr.decode(errors="replace"), file=sys.stderr)
67
+ return 2
68
+
69
+ staged_diff = diff_proc.stdout # bytes
70
+
71
+ # Step 2: pipe the diff into adr-judge.
72
+ judge_proc = subprocess.run(
73
+ [
74
+ sys.executable,
75
+ str(_ADR_JUDGE),
76
+ "--diff", "-",
77
+ "--adr-dir", "docs/adr/",
78
+ "--repo-root", str(Path.cwd()),
79
+ "--snapshot", "staged",
80
+ ],
81
+ input=staged_diff,
82
+ )
83
+ return judge_proc.returncode
84
+
85
+
86
+ if __name__ == "__main__":
87
+ sys.exit(main())