chore(work): decompose 2026-05-14-library-evaluation-policy epic

Decomposer produced 9 stories under docs/work/2026-05-14-library-
evaluation-policy/, ordered to land the schema foundation first and
the cross-referencing content (skill, guide, backfill) last:

01 - trace schema module + docs/library-decisions/ foundation
02 - pre-commit check script
03 - Claude PreToolUse / PostToolUse hooks
04 - evaluate-library skill
05 - human guide (docs/guides/adding-a-library.md)
06 - sandcastle reviewer prompt update
07 - generator pre-shipped traces for optional cores
08 - backfill traces for existing runtime deps
09 - CLAUDE.md Key Conventions bullet

Anchored by ADR-022 + the approved PRD at
docs/work/prds/2026-05-14-library-evaluation-policy.prd.md.
This commit is contained in:
2026-05-14 06:52:02 +02:00
parent 7f1a8d0212
commit 16a03e026b
11 changed files with 584 additions and 3 deletions

View File

@@ -0,0 +1,46 @@
---
id: 04-evaluate-library-skill
epic: 2026-05-14-library-evaluation-policy
title: evaluate-library skill (SKILL.md + supporting files)
type: technical-story
status: todo
feature: tooling
depends-on: [01-trace-schema-foundation]
blocks: [05-human-guide]
---
## Goal
Create the `.claude/skills/evaluate-library/` directory with `SKILL.md` (the authoritative agent runbook), `POLICY.md` (ADR-022 mirror for quick reference), `TRACE-TEMPLATE.md` (showing the YAML frontmatter + heading shape the skill must emit), and an `EXAMPLES/` directory with two worked cases (one approved, one rejected). The skill must be invocable as `/evaluate-library <name> --tier <feature|core|app> --target <package-path>`.
## Why
Without a deterministic skill runbook, every agent evaluating a library does so ad hoc — different filters, different order, inconsistent trace format. The skill is the single source of truth for the 8-filter + 3-prompt sequence, the collect-cheap-skip-expensive ordering, and the trace write step. It also provides the canonical invocation the Claude hook emits.
## Done when
- `.claude/skills/evaluate-library/SKILL.md` exists and covers: invocation signature (`/evaluate-library <name> --tier <tier> --target <pkg-path>`), the 8 filters in collect-cheap-skip-expensive order (license, types, shadow-check, boundary-fit run to completion; maintenance, CVE scan, EU residency, named-consumer short-circuit after first reject), the 3 prompts, trace-write step (unconditional at evaluation end, including rejections), and the fail/skip sentinel for skipped expensive filters.
- `.claude/skills/evaluate-library/POLICY.md` summarises ADR-022 in ≤2 pages — the filters, the tier trigger, the trace schema fields, the four enforcement layers.
- `.claude/skills/evaluate-library/TRACE-TEMPLATE.md` shows the complete YAML frontmatter (all fields, real sentinel values for skipped filters) + all 11 required headings in order.
- `.claude/skills/evaluate-library/EXAMPLES/` contains at least two worked trace files: one `decision: approved` trace and one `decision: rejected` trace (use `trpc-to-openapi` as the rejected example per the PRD, with `named-consumer: fail` and prose citing the grill-session conversation as provenance).
- The skill is listed in `.claude/settings.json` (or wherever skills are registered) so `/evaluate-library` resolves to the SKILL.md via the Skill tool.
- `pnpm lint && pnpm fallow:audit` pass.
## In scope
- `.claude/skills/evaluate-library/SKILL.md`
- `.claude/skills/evaluate-library/POLICY.md`
- `.claude/skills/evaluate-library/TRACE-TEMPLATE.md`
- `.claude/skills/evaluate-library/EXAMPLES/approved-example.md`
- `.claude/skills/evaluate-library/EXAMPLES/rejected-trpc-to-openapi.md`
- Skill registration in `.claude/settings.json` (match existing skill registration pattern).
## Out of scope
- Automated tests for the skill (it is a prose runbook; correctness is verified by the success criterion in the PRD — running it against `trpc-to-openapi` produces the documented trace).
- The schema module (Story 01) — already landed.
- The human guide with worked examples for non-agent readers (Story 05).
## Tasks
- [ ] Investigate the existing skill registration pattern (read `.claude/settings.json` and one existing skill's SKILL.md to confirm format and registration key); then write all five skill files (`SKILL.md`, `POLICY.md`, `TRACE-TEMPLATE.md`, `EXAMPLES/approved-example.md`, `EXAMPLES/rejected-trpc-to-openapi.md`) and register the skill; all gates pass on this single commit.