Skip to content

feat(claude-code): test quality system — agents, skills, hooks, docs - #11

Merged
mborgeson merged 1 commit into
mainfrom
feat/test-quality-system
Apr 30, 2026
Merged

feat(claude-code): test quality system — agents, skills, hooks, docs#11
mborgeson merged 1 commit into
mainfrom
feat/test-quality-system

Conversation

@mborgeson

Copy link
Copy Markdown
Owner

Summary

A coordinated Claude Code automation system covering the full test lifecycle for this project.

Component Type Purpose Status
test-architect Subagent Senior strategist — evaluates, reviews, designs solutions, delegates Personal artifact (template in docs)
test-engineer Subagent Implementer — writes/fixes tests, runs them, opens PRs Personal artifact (template in docs)
/test-triage Skill Playbook for >50%-fail triage Personal artifact (template in docs)
/test-posture-review Skill Quarterly coverage/reliability/runtime audit Personal artifact (template in docs)
validate-workflow.sh Hook Auto YAML + actionlint check on .github/workflows/*.yml edits Wired in this PR
docs/test-quality-system.md Doc System overview, delegation graph, templates In this PR

What's actually in the diff

  • .claude/settings.json — adds bash .claude/hooks/validate-workflow.sh to the PostToolUse Write|Edit hook chain
  • docs/test-quality-system.md — full documentation including bootstrap templates

The hook script and the agent/skill files live under .claude/ which is globally gitignored on this project (same pattern as .claude/scripts/ per docs/claude-code-setup.md). They're per-developer artifacts. Templates live in the new doc.

Why this design

Your ask: an agent system that evaluates project state, implements maximally effective testing throughout the lifecycle, reviews results, and produces long-lasting solutions, with one agent leveraging another for high-quality documentation.

That naturally splits into:

  • test-architect (read-leaning): evaluation, review, root-cause identification, solution design. Delegates implementation and docs.
  • test-engineer (edit-active): writes test code, runs it, opens PRs. Never disables a test as a fix — escalates to architect.
  • documentation-expert (built-in subagent): handles all write-up work for both above.

Plus two skills that codify repeatable playbooks (/test-triage, /test-posture-review) so the patterns scale beyond a single user prompt.

Plus the hook (validate-workflow.sh) closing the gap that PR #8 surfaced — workflow file edits should fail-fast on syntax issues rather than waiting for CI to discover them.

Test plan

  • validate-workflow.sh pipe-tested: silent on valid YAML, reports syntax errors via systemMessage
  • jq -e confirms new hook entry parses
  • Skills appear in Claude Code's skill listing when branch is checked out
  • CI: lint + tests pass (no code changes — should be trivially green)

Follow-up worth tracking

Pre-existing: .claude/ is globally gitignored on this project, so the existing hook scripts (protect-paths.sh, auto-format.sh, etc.) and now validate-workflow.sh are NOT on origin/main even though settings.json references them. New collaborators must recreate from templates in the docs. A separate "bootstrap experience for .claude/hooks/" cleanup PR would be valuable but is out of scope here.

🤖 Generated with Claude Code

Introduces a coordinated set of Claude Code automations spanning the full
test lifecycle: evaluation, design, implementation, review, and durable
solutions.

## Components committed in this PR

- `.claude/hooks/validate-workflow.sh` wired into PostToolUse Write|Edit
  chain in `.claude/settings.json`. Script does YAML syntax check (always)
  + actionlint deeper analysis (if installed). Surfaces issues as
  systemMessage so they appear inline before CI sees them.
- `docs/test-quality-system.md` documents the full system: when to invoke
  each piece, the delegation graph, templates for new collaborators.

## Personal artifacts (under gitignored .claude/, see docs for templates)

- `test-architect` agent — senior strategist; evaluates posture, reviews
  failures, designs solutions; delegates to test-engineer for impl and to
  documentation-expert for write-ups
- `test-engineer` agent — implementer; writes/refactors tests, runs them,
  opens PRs; never disables tests as a fix
- `/test-triage` skill — playbook for high-failure-rate triage (50%+ red),
  walks through artifact pull → error clustering → root cause → solution
- `/test-posture-review` skill — quarterly coverage/reliability/runtime
  audit producing a structured posture report

## Why this shape

User asked for a system that "evaluates, implements, reviews, identifies,
and produces long-lasting solutions" with one agent leveraging another for
docs. That naturally splits into a read-leaning architect and an
edit-active engineer, with the architect delegating doc work to the
built-in `documentation-expert` subagent.

## Validation

- validate-workflow.sh pipe-tested: silent on valid YAML, reports syntax
  errors via systemMessage on invalid YAML, runs actionlint if installed
- jq -e confirms the new hook entry parses cleanly in settings.json
- Skills appear in Claude Code's skill listing when this branch is checked
  out

## Pre-existing limitation surfaced (not addressed here)

`.claude/` is globally gitignored, so hook scripts (including the
pre-existing protect-paths.sh, auto-format.sh, etc.) are not on
origin/main — they're per-developer artifacts. Settings.json references
them by path. New collaborators must recreate scripts from the docs
templates. This PR follows the established convention; cleaning up the
bootstrap should be a separate follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mborgeson
mborgeson merged commit 5b0bdcc into main Apr 30, 2026
@mborgeson
mborgeson deleted the feat/test-quality-system branch April 30, 2026 10:25
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.

1 participant