Skip to content

feat: document quality gate hook — advisory content validation#142

Closed
DavidROliverBA wants to merge 1 commit intotractorjuice:mainfrom
DavidROliverBA:feat/quality-gate
Closed

feat: document quality gate hook — advisory content validation#142
DavidROliverBA wants to merge 1 commit intotractorjuice:mainfrom
DavidROliverBA:feat/quality-gate

Conversation

@DavidROliverBA
Copy link
Contributor

Summary

PostToolUse hook that validates ARC document content quality after every write. Advisory only — never blocks, surfaces warnings as context so Claude can offer to fix issues.

  • Document control completeness — detects placeholder text ([Author], TBD, TODO, XXX)
  • Requirement ID format — flags malformed IDs (e.g., BR-1 instead of BR-001)
  • Empty section detection — headings with no content below them
  • Cross-reference integrity — references to ARC documents that don't exist in the project

Files Changed

File Change
arckit-claude/hooks/document-quality-gate.mjs New — PostToolUse hook
arckit-claude/hooks/hooks.json Register hook after update-manifest
docs/guides/document-quality-gate.md New — usage guide

Design Decisions

  • Advisory, not blocking — architects should never be prevented from saving work. Warnings surface as context for Claude to address.
  • Uses existing extractors — imports extractDocType from hook-utils.mjs and DOC_TYPES from doc-types.mjs
  • Scoped to ARC documents — only fires on ARC-*.md files under projects/

Test plan

  • JSON validation of hooks.json
  • ESM import validation
  • Write an ARC document with placeholder text — verify warnings surface
  • Write an ARC document with clean content — verify no warnings
  • Write a non-ARC file — verify silent pass-through

🤖 Generated with Claude Code

PostToolUse hook that validates ARC document content quality after writes:
- Document control completeness (detects placeholders)
- Requirement ID format validation
- Empty section detection
- Cross-reference integrity (referenced ARC docs exist)

Advisory only — never blocks writes, surfaces warnings as context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tractorjuice
Copy link
Owner

tractorjuice commented Mar 9, 2026

Superseded by #150, which includes your original quality gate hook, hooks.json registration, and guide plus:

Lint fixes:

  • Added text language specifier to 4 fenced code blocks in docs/guides/document-quality-gate.md (MD040)
  • Added blank lines before lists in 6 Gemini agent files (MD032): arckit-aws-research.md, arckit-azure-research.md, arckit-datascout.md, arckit-framework.md, arckit-gcp-research.md, arckit-research.md

Your original commit is preserved as-is in #150. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants