@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.
- package/.claude-plugin/plugin.json +29 -0
- package/LICENSE +21 -0
- package/README.md +850 -0
- package/bin/adr +1552 -0
- package/bin/adr-audit +454 -0
- package/bin/adr-context +584 -0
- package/bin/adr-discover +546 -0
- package/bin/adr-doctor +166 -0
- package/bin/adr-generate-scripts +421 -0
- package/bin/adr-grill-signal +131 -0
- package/bin/adr-guardian +1263 -0
- package/bin/adr-index +199 -0
- package/bin/adr-judge +2832 -0
- package/bin/adr-judge-precommit +87 -0
- package/bin/adr-lint +2087 -0
- package/bin/adr-mcp +1093 -0
- package/bin/adr-migrate +644 -0
- package/bin/adr-quality +275 -0
- package/bin/adr-readiness +211 -0
- package/bin/adr-readiness-ci +111 -0
- package/bin/adr-related +401 -0
- package/bin/adr-renumber +254 -0
- package/bin/adr-retire +467 -0
- package/bin/adr-settings +399 -0
- package/bin/adr-status +797 -0
- package/bin/adr-suggest +803 -0
- package/bin/adr-watch +674 -0
- package/bin/adr_catalog.py +536 -0
- package/bin/adr_config.py +280 -0
- package/bin/adr_doctor_checks.py +407 -0
- package/bin/adr_doctor_core.py +342 -0
- package/bin/adr_doctor_models.py +186 -0
- package/bin/adr_doctor_probes.py +216 -0
- package/bin/adr_format.py +786 -0
- package/bin/adr_grill_signal.py +123 -0
- package/bin/adr_guardian_queue.py +218 -0
- package/bin/adr_history_scan.py +278 -0
- package/bin/adr_index_core.py +443 -0
- package/bin/adr_llm.py +333 -0
- package/bin/adr_llm_judge_migration.py +314 -0
- package/bin/adr_quality_core.py +674 -0
- package/bin/adr_query.py +678 -0
- package/bin/adr_readiness.py +442 -0
- package/bin/adr_readiness_ci.py +123 -0
- package/bin/adr_regex.py +165 -0
- package/bin/adr_regex_worker.py +30 -0
- package/bin/adr_retrieval_health.py +385 -0
- package/bin/adr_schema.py +448 -0
- package/bin/adr_state.py +172 -0
- package/bin/bump-version +71 -0
- package/clients/workflows.json +229 -0
- package/hooks/__init__.py +1 -0
- package/hooks/adapters/__init__.py +13 -0
- package/hooks/adapters/claude.py +27 -0
- package/hooks/adapters/codex.py +26 -0
- package/hooks/adapters/copilot.py +11 -0
- package/hooks/adr-hook.py +128 -0
- package/hooks/adr_hook_core.py +843 -0
- package/hooks/adr_pr_guard.py +367 -0
- package/instructions/ADR-guide.md +48 -0
- package/instructions/adr.coding.md +82 -0
- package/instructions/adr.review.md +182 -0
- package/opencode/plugin.ts +451 -0
- package/package.json +41 -0
- package/schemas/adr-context-probes.schema.json +56 -0
- package/schemas/adr-enforcement.schema.json +57 -0
- package/schemas/adr-frontmatter.schema.json +144 -0
- package/schemas/adr-index.schema.json +276 -0
- package/schemas/adr-kit-config.schema.json +371 -0
- package/schemas/adr-readiness.schema.json +41 -0
- package/schemas/client-capabilities.schema.json +503 -0
- package/schemas/client-certification.schema.json +101 -0
- package/schemas/doctor-output.schema.json +92 -0
- package/schemas/marketplace.json.schema.json +70 -0
- package/schemas/plugin.json.schema.json +67 -0
- package/scripts/adr_settings.py +239 -0
- package/scripts/benchmark-adr-grilling.py +323 -0
- package/scripts/benchmark-client-generation.py +178 -0
- package/scripts/build-client-adapters.py +139 -0
- package/scripts/bump-version.py +304 -0
- package/scripts/check-branch-sync.py +243 -0
- package/scripts/check-release-version.py +81 -0
- package/scripts/client_certification.py +153 -0
- package/scripts/client_evidence.py +280 -0
- package/scripts/client_generation.py +288 -0
- package/scripts/client_generation_artifacts.py +351 -0
- package/scripts/client_generation_model.py +173 -0
- package/scripts/client_generation_state.py +260 -0
- package/scripts/client_support_matrix.py +360 -0
- package/scripts/install-agent-envs.py +300 -0
- package/scripts/probe-client-events.py +183 -0
- package/scripts/project_setup.py +379 -0
- package/scripts/refresh-otgw-corpus.py +219 -0
- package/scripts/settings.py +81 -0
- package/scripts/setup-project.py +205 -0
- package/scripts/sync-agent-plugins.py +17 -0
- package/scripts/version_sites.py +377 -0
- package/skills/adr/SKILL.md +780 -0
- package/skills/audit/SKILL.md +103 -0
- package/skills/context/SKILL.md +77 -0
- package/skills/grill/SKILL.md +84 -0
- package/skills/grill/agents/openai.yaml +4 -0
- package/skills/guardian/SKILL.md +316 -0
- package/skills/init/SKILL.md +499 -0
- package/skills/install-hooks/SKILL.md +154 -0
- package/skills/judge/SKILL.md +168 -0
- package/skills/lint/SKILL.md +321 -0
- package/skills/migrate/SKILL.md +313 -0
- package/skills/related/SKILL.md +62 -0
- package/skills/retire/SKILL.md +41 -0
- package/skills/review/SKILL.md +167 -0
- package/skills/settings/SKILL.md +73 -0
- package/skills/setup/SKILL.md +128 -0
- package/skills/supersede/SKILL.md +136 -0
- package/skills/upgrade/SKILL.md +273 -0
- package/templates/adr-kit-guide.md +354 -0
- package/templates/adr-template.canonical.md +115 -0
- package/templates/adr-template.madr.md +131 -0
- package/templates/adr-template.md +131 -0
- package/templates/adr-template.nygard.md +111 -0
- package/templates/cc-settings/guardian-hook-entry.json +9 -0
- package/templates/githooks/pre-commit +337 -0
- package/templates/github-workflows/adr-audit.yml +58 -0
- package/templates/github-workflows/adr-guardian-audit.yml +133 -0
- package/templates/github-workflows/adr-index-check.yml +30 -0
- package/templates/github-workflows/adr-judge.yml +31 -0
- package/templates/github-workflows/adr-readiness.yml +18 -0
- package/templates/validate_adr_template.py +38 -0
- 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())
|