You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: enforcement and intent assessor improvements (ADR A.5, A.8) (#484)
* feat: enforcement and intent assessor improvements (ADR A.5, A.8)
Reprioritize DeterministicEnforcementAssessor scoring so agent hooks
(60 pts) outrank bypassable git hooks (40 pts), and add design doc
enforcement detection to DesignIntentAssessor (advisory 10 pts,
deterministic 15 pts). Also adds recommended starter hooks to
.claude/settings.json and updates test-assess skill cleanup to
avoid triggering the new destructive-command blocker.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: add .agents/ and .codex/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address CodeRabbit feedback on enforcement assessors
- Require non-empty hook entries before awarding 60 pts (not just key presence)
- Require both design-doc reference AND enforcement verb for deterministic bonus
- Fix remediation example to use correct nested hook schema
- Isolate agent vs pre-commit scoring test with separate repo paths
- Add negative test for hooks mentioning design docs without enforcement verbs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/attributes.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -794,18 +794,19 @@ Automated code quality checks before commits (pre-commit hooks) and in CI/CD pip
794
794
795
795
#### Why It Matters
796
796
797
-
Pre-commit hooks give immediate local feedback. They can be bypassed with `--no-verify`, which is why CI matters too — but for agent-generated commits that go through a normal PR flow, hooks are the first line of defense. Catching a lint error before a commit beats catching it in CI review.
797
+
Agent hooks (`.claude/settings.json`) are deterministic for agent workflows: they always execute and cannot be bypassed. Git hooks (pre-commit, Husky) provide local feedback but can be bypassed with `--no-verify`. Both matter, but agent hooks score higher because they are the primary enforcement mechanism for AI-assisted development.
-**`.husky` directory with hook scripts** (40 pts): Husky git hooks configured (bypassable with `--no-verify`)
806
+
-**`.claude/settings.json` without hooks** (10 pts): Agent settings present but no hooks defined
805
807
-**`.husky` directory without hook scripts** (10 pts): Husky directory exists but no hooks defined
806
-
-**`.claude/settings.json` with hooks** (30 pts): Claude Code hook configuration present
807
808
808
-
**Pass threshold**: 60 points or higher. Either `.pre-commit-config.yaml` or `.husky` with hook scripts is sufficient to pass.
809
+
**Pass threshold**: 40 points or higher. Any single enforcement mechanism (agent hooks, pre-commit, or Husky with scripts) is sufficient to pass.
809
810
810
811
#### Remediation
811
812
@@ -1032,7 +1033,7 @@ setup:
1032
1033
**File Size Limits** (`file_size_limits`, 3%) — Files under threshold to keep context manageable
1033
1034
**Separation of Concerns** (`separation_of_concerns`, 3%) — Clean module boundaries and single-responsibility
1034
1035
**Pattern References** (`pattern_references`, 3%) — Documented patterns for common changes. Skills scoring is tiered: 1-2 SKILL.md files earn partial credit (30 pts), 3+ earn full credit (60 pts). Context files >150 lines without skills trigger a warning
1035
-
**Design Intent Documentation** (`design_intent`, 3%) — Preconditions, invariants, and rationale in design docs (moved from T3)
1036
+
**Design Intent Documentation** (`design_intent`, 3%) — Preconditions, invariants, and rationale in design docs (moved from T3). Enforcement bonus: advisory rules in AGENTS.md requiring design doc updates (+10 pts), or deterministic enforcement via hooks/skills (+15 pts). The higher of the two is awarded, not both
1036
1037
1037
1038
*Full details for each attribute available in the [research document](https://github.com/ambient-code/agentready/blob/main/RESEARCH_REPORT.md).*
"For each critical module, document preconditions, invariants, and rationale",
324
424
"Use an AI agent to reverse-engineer initial design docs from code, then enrich with intent",
325
425
"Reference design docs from CLAUDE.md/AGENTS.md",
426
+
"Add a rule to AGENTS.md requiring design doc updates with architectural changes",
427
+
"For stronger enforcement, add a hook or skill that checks for design doc updates",
326
428
],
327
429
tools=[],
328
430
commands=["mkdir -p docs/design"],
329
431
examples=[
330
432
"# docs/design/event-system.md\n## Invariants\n- Event log is append-only; never mutate or delete entries\n- Events are processed exactly-once via idempotency keys\n\n## Preconditions\n- Auth middleware must validate token before event handlers run\n\n## Rationale\n- Polling instead of webhooks: upstream API has 5s delivery SLA, too slow for our use case",
433
+
"# AGENTS.md - Advisory enforcement\n## Design Documentation\nWhen modifying component boundaries, data flows, or API contracts,\nreview and update the corresponding design doc in docs/design/.",
0 commit comments