[#314] feat: wire template-override resolution into skills#367
Conversation
- add shared skill-conventions/template-resolution.md: file-existence check on .pair/adoption/tech/templates/<name>-template.md (override wins whole), KB path fallback; way-of-working ## Templates = audit trail, not trigger - reference it from all 16 template-linking SKILL.md (dataset) at their template-use sites; regenerate .claude mirror via pair update - record-decision included (#310 merged, mutex cleared) - fix templates.mdx: 19 shipped templates (was 14), accurate file-existence mechanism (drop "AI reads adoption first" hand-wave), branch-template orphan resolved (consumed by publish-pr) - conformance test: every template-linking skill (dataset + mirror) carries the pointer; override-wins/idempotent semantics - Tasks: T1, T2, T3 Refs: #314 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review — PR #367 (Independent)Review InformationPR Number: #367 Review SummaryOverall Assessment
Key Changes SummaryAdds one shared Business Value ValidationThe core value — a project's PR/commit/story/ADR overrides are actually honored instead of silently ignored — is delivered for the directly-linked template sites. Two consumption paths still silently use the KB default (see Major findings), which is the precise anti-goal in the story's "So that" clause. Code Review Checklist — FindingsMajor Issues (should fix before merge)
Minor Issues (consider addressing)
Questions
AC Verification
Testing ReviewNew conformance suite (15 tests) asserts the convention content (file-existence check, override-wins, idempotent fallback, audit-trail, edge cases) and pointer presence across every Security ReviewNo security surface. Docs/instruction change plus one test file; no runtime code, inputs, secrets, or auth. Verdict: green, 0 findings. Adoption ComplianceDataset↔root mirror consistent: Risk Assessment
DecisionCHANGES-REQUESTED. Both Majors are small, in-scope, and fixable in this PR; no new story needed. Everything else (shared DRY instruction, 16-skill wiring, mirror consistency, mdx completeness, branch-template orphan resolution, conformance suite) is solid and matches the ACs. |
…; broaden conformance scan Review fixes on PR #367: - commit-template use-sites in merge-and-cascade.md (review Phase 6) and post-review-merge.md (implement Phase 4) now resolve override-first (dataset + .claude mirror) - context-map-maintenance.md: context-map-template & subdomain-context-template links resolve override-first so those 2 overrides are honored (matches templates.mdx claim, AC5) - conformance: new collectSkillMarkdownFiles walks all .md (not just SKILL.md); pointer invariant now scans disclosed aux files — root cause that let the aux-site gap pass green Refs: #314
Remediation — round 1 (commit
|
Code Review — PR #367 (Independent re-review)Review InformationPR Number: #367 Review SummaryOverall Assessment
Key Changes SummaryOne shared Business Value ValidationCore value delivered and now complete: a project's PR/commit/story/ADR/context-map overrides are honored instead of silently ignored, across every site that links a template. Verified: all 19 shipped templates have at least one pointer-carrying consumer, so the doc's blanket "override-first" claim is substantively true. Verification of Prior Findings
AC Verification
Code Review Checklist — FindingsMinor Issues (consider addressing)
Positive Feedback
Security ReviewNo security surface. Docs/instruction change plus one test file; no runtime code, inputs, secrets, or auth. Verdict: green, 0 findings. Adoption ComplianceDataset↔root mirror consistent; new README row present in both; every template-linking file (16 SKILL.md + 2 aux + 1 guideline) carries the pointer, dataset + mirror. Consistent with the shared-reference convention. DecisionAPPROVED WITH COMMENTS. Both prior Majors are genuinely resolved (not merely acknowledged): the merge-commit sites and the context-map guideline now resolve override-first, dataset + mirror; the conformance scanner was broadened to catch the root-cause blind spot. All five ACs are met. The four remaining items are Minor doc/test-precision nits — none re-open the doc/behavior mismatch this story exists to close. Human merge gate decides whether to fold the Minors into this PR or defer. |
…-spot (review minors) - templates.mdx: attribute context-map/subdomain-context templates to the context-map-maintenance guideline (record-decision writes context-map.md inline, never reads the template; map-* don't read it directly) - context-map-maintenance.md footer: add override-first resolution pointer to both template links (intra-file consistency with the use-sites) - skill-conventions README: drop hardcoded "16 skills" → "all template-linking skills" - template-resolution.test.ts: extend pointer scan to the guidelines corpus (dataset + generated root) so removing the pointer from context-map-maintenance.md fails the test (closes Major #2 blind-spot) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remediation — round 2 (commit
|
Orchestration change (distinct concern from #314), bundled here per maintainer request to merge together. The review<->fix loop is one logical cycle, so it no longer spams the PR per round: - first review IS posted on the PR (the independent review artifact); - fix<->re-review rounds accumulate in .pair/working/reviews/<id>.md (re-reviewer stays blind to it — prior findings arrive via prompt); - at convergence ONE synthesized remediation comment is posted, written contextually to the first review, then the log is deleted; - on escalation the log is flushed to the PR. +6 workflow tests (first-review-posts / re-review-silent / fix-logs / synthesis / clean-first-review-no-synthesis). Applies from the next run (this run used the prior script). Note: resume path posts a session-entry review by design. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review — Independent Re-ReviewPR: #367 · Story: #314 (wire template-override resolution into skills) · Reviewer: Independent reviewer (blind) · Date: 2026-07-23 · Type: Feature + bundled orchestration chore Overall Assessment
All four Minor findings from the prior review are genuinely resolved (not merely acknowledged), every AC of #314 is met by the diff, the bundled orchestration change is logically coherent and tested, and there is no regression. Full suite: 368/368 passing (after building Block A — Prior Minors verified resolved
Block B — Bundled orchestration change (
|
- flush-on-escalate branch now covered by a test (non-convergence -> flush with open findings, no synthesis) [Minor #1] - design-disagreement escalation passes the open findings to the flush agent, symmetric with the MAX_FIX_ROUNDS branch [Minor #2] - failed-fix return surfaces reviewLog so an orphaned working log is discoverable by the human / next resume [Minor #3] 13/13 workflow tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extend #367 one-review+one-remediation policy across the WHOLE PR cycle (runs, escalations, manual out-of-band rounds) in implement-batch.js: - continuation detection: sandbox-safe delegated existence-probe of the working log on resume runs (isContinuation) - silent round-0 on continuation (first = round0 && !isContinuation); seed remediated=isContinuation so immediate convergence still synthesizes - synthesis maps findings across ALL runs + minimizes prior flush/manual comments, then deletes the log - escalate keeps the log (continuation anchor) + documents the manual out-of-band convention in flush prompts + PR-COMMENT POLICY block - fresh-story path unchanged (no probe, first review posted) Test-first: added continuation/regression cases to implement-batch.test.mjs (40/40 green). Files: implement-batch.js + .test.mjs only. Refs: #373 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
What Changed
Adds ONE shared "Template Resolution" instruction (
.pair/knowledge/skill-conventions/template-resolution.md, dataset +.claudemirror) — a plain file-existence check on.pair/adoption/tech/templates/<name>-template.md, falling back to the KB path unchanged when no override exists — and wires a pointer to it into every SKILL.md that links a collaboration template. Also fixesapps/website/content/docs/customization/templates.mdxto list all shipped templates and describe the mechanism accurately (was previously claiming behavior that didn't exist), and resolves the orphanedbranch-template.md(now consumed by/pair-capability-publish-prfor branch-format parsing).Why This Change
templates.mdxalready documented an override mechanism ("the AI reads adoption files first") that no skill actually implemented — everySKILL.mdhardcoded a relative link straight to the KB default. A project that followed the docs and dropped a custom template into.pair/adoption/tech/templates/would have it silently ignored. This closes that doc/behavior gap with one shared, DRY instruction (not 35 copies of the same logic) and keeps the common case (no override) byte-identical to today's behavior.Story Context
User Story: #314 — "Wire template-override resolution into skills (docs already claim it works — it doesn't)"
Acceptance Criteria:
pr-template.mdvia/pair-process-implement) and a capability-composed one (adr-template.mdvia/pair-capability-record-decision). ✅skill-conventions/template-resolution.md, referenced by pointer.templates.mdxaccuracy — lists all shipped templates, mechanism described correctly, orphan resolved. ✅Changes Made
Implementation Details
packages/knowledge-hub/dataset/.pair/knowledge/skill-conventions/template-resolution.md(+ root mirror.pair/knowledge/skill-conventions/template-resolution.md): file-existence check on.pair/adoption/tech/templates/<name>-template.md, KB path fallback, override wins whole-file (no merge).skill-conventions/README.md.SKILL.md(dataset.skills/sources + regenerated.claude/mirror) at their template-use sites — see deviation note below on the count.record-decisionwired in the same commit — its earlier mutex with [#224] refactor: assess-* output-only; record-decision sole adoption writer #310 is cleared ([#224] refactor: assess-* output-only; record-decision sole adoption writer #310 merged to main), so ADR/ADL/DDR/analysis-log resolution is included here rather than deferred.apps/website/content/docs/customization/templates.mdxrewritten: 19 shipped templates listed (was 14), mechanism corrected to the plain file-existence check (dropped the inaccurate "AI reads adoption first" framing),## Templatesreframed as an audit-trail listing (not a trigger — the file-existence check on disk is authoritative),branch-template.mdorphan resolved (documented as consumed by/pair-capability-publish-prfor branch-format parsing)..claude/) regenerated vianode apps/pair-cli/dist/cli.js update --offline --source packages/knowledge-hub/dataset— verified byte-identical re-run (cleangit statusafter re-running), keeping dataset↔root mirror consistent per project convention.Files Changed
packages/knowledge-hub/dataset/.pair/knowledge/skill-conventions/template-resolution.md, mirrored root.pair/knowledge/skill-conventions/template-resolution.md,packages/knowledge-hub/src/conformance/template-resolution.test.ts.SKILL.mdfiles + their.claude/skills/**mirrors (32 files total),skill-conventions/README.md(×2, dataset+root),apps/website/content/docs/customization/templates.mdx.Testing
Test Coverage
packages/knowledge-hub/src/conformance/template-resolution.test.ts— 15 tests (test-first, confirmed RED before the instruction file/pointers existed, GREEN after): asserts every template-linkingSKILL.md(dataset + mirror) carries the resolution pointer, and the override-wins/idempotent-fallback semantics of the shared instruction text.Test Results
Testing Strategy
pr-template.md, consumed by/pair-process-implement→/pair-capability-publish-pr) and one capability-composed template (adr-template.md, consumed by/pair-capability-record-decision) per AC2's explicit ask..pair/adoption/tech/templates/pr-template.mdand confirm/pair-capability-publish-pr's resolution step picks it up; remove it and confirm it falls back to the KB default unchanged.Reviewer Guide
Two deliberate deviations from the story/orchestrator's stated counts — please confirm you're OK with these
16 skills wired, not 15. The story's count (14 template-linking skills +
record-decision= 15) predates/pair-capability-publish-pr, which merged later (pair-process-implement composes checkpoint + publish-pr via subagent (resume from checkpoint) #256/[#256] feat: implement composes checkpoint + publish-pr via handoff-only subagent #359).publish-prfactually links pr-/commit-/branch-/checkpoint-templates and is where the pr-template AC2 resolution actually happens in practice (/pair-process-implementcomposespublish-prfor its PR step). Excluding it would leave the single most important template consumer unwired and fail AC2 in spirit. The conformance test asserts the count-agnostic invariant "every template-linking SKILL.md carries the pointer" (currently ≥15) rather than hardcoding 15, so it's robust to this and future additions.19 shipped templates listed, not 17. At story refinement (2026-07-13) the KB shipped 17 template files; by now it ships 19 (
*-template.md, excluding README). The doc previously listed only 14 (already stale against the 17 at refinement time); this PR adds all 5 that were missing (checkpoint-, manual-test-case-, manual-test-report-, context-map-, subdomain-context-template.md) to reach the current 19.record-decision(T3) included, per the orchestrator's explicit directive that [#224] refactor: assess-* output-only; record-decision sole adoption writer #310 (which held an earlier mutex on this file) is merged — confirmed viagit logbefore touching it.Review Focus Areas
skill-conventions/<topic>.md+ a one-line pointer at each use site) matches the existing convention (e.g.way-of-working-pm-resolution.md) rather than introducing a new pattern.templates.mdx(single source of truth: the files on disk, not the## Templatesprose).SKILL.mdfiles (dataset + mirror) to confirm the pointer reads naturally at its use site and doesn't duplicate existing adoption-check prose.Dependencies & Related Work
Related PRs
/pair-capability-publish-prmerged, clearing the count baseline used here), [#224] refactor: assess-* output-only; record-decision sole adoption writer #310 (merged — cleared therecord-decision/SKILL.md mutex referenced in the orchestrator directive).Follow-up Work
Refs: #314