Skip to content

ADR-319: Implement harvest-playbook skill and /harvest command dispatcher - #69

Merged
jodavis merged 2 commits into
feature/ADR-316-harvestfrom
dev/claude/ADR-319
Jul 15, 2026
Merged

ADR-319: Implement harvest-playbook skill and /harvest command dispatcher#69
jodavis merged 2 commits into
feature/ADR-316-harvestfrom
dev/claude/ADR-319

Conversation

@jodavis-claude

@jodavis-claude jodavis-claude commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Work item

ADR-319 — Implement the harvest-playbook skill (the core harvest procedure: gather inputs from paths, classify method content via markers/litmus-test/exemplar-diffing, interview the user, author a vendor-neutral playbook directory, replace consumed Method markers with provenance links, and present the TODO list plus replay-and-diff validation instructions) and its thin /harvest command dispatcher, so a user can turn a validated spec/exemplar-repo set into a reusable playbook.

Changes

  • plugins/dev-team/skills/harvest-playbook/SKILL.md (new) — the six-step harvest procedure: gather inputs from paths → build candidate method content via Method markers / litmus-test classification / template-output diffing / plan-vs-history divergence mining → interview the user → author the playbook directory → replace consumed Method markers with provenance links → present the TODO list and replay-and-diff validation procedure. Cites playbook-contract for the directory contract, TODO semantics, Method marker format/lifecycle, vendor-neutrality rules, and bare-name resolution rather than restating any of it.
  • plugins/dev-team/commands/harvest.md (new) — thin dispatcher on the fix.md/implement.md pattern: description + argument-hint frontmatter documenting /harvest <spec-path | none> [--exemplar <repo-path>]... [--template-output <path>] --out <playbook-directory> [--name <playbook-name>], and a body that parses arguments (with a missing---out guard) and forwards to harvest-playbook.

No fixtures, playbook-contract, or RUN.md were modified — both are owned by earlier tasks (ADR-317, ADR-318) and are cited, not restated.

Design decisions

  • Implemented the Testable component (harvest-playbook) directly rather than through the tdd-tester/tdd-implementer/tdd-refactorer trio: it is pure agent-skill prose with no AAA-testable logic, matching component-taxonomy's explicit callout of agent-skill prose as a Testable component verified by whatever mechanism actually fits.
  • Substituted a fixture-driven dry-run checklist for Gherkin E2E scenarios as the TDD-red artifact, since no Gherkin/BDD harness exists in this repo and missing-test-harness forbids inventing one. The checklist was authored before the SKILL.md prose (red), then the finished prose was graded against it (green).
  • --out is written to directly (not into a --name-named subdirectory), matching the fixture dry run's scripted answer key.
  • argument-hint mirrors the spec's illustrative multi-flag syntax on both harvest-playbook and commands/harvest.md.

Testing completed

Fixture-driven dry run per RUN.md's Step 2/3 procedure: materialized exemplar-repo-1/exemplar-repo-2 via materialize.py, ran a subagent blind to authoring context through harvest-playbook against the fixture spec, exemplars, template-output/, and interview-answer-key.md. All mechanical checks (file existence, vendor-neutrality grep, marker-replacement count, TODO manual-fallback presence) and judgment-shaped checks (executable-knowledge steps, correctly derived strip/replace step, surfaced plan-vs-history divergence) passed. Argument-contract behavior (refusal on zero durable-artifact sources, update-mode detection for an existing --out playbook) verified by prose inspection.

No pytest unit tests or Gherkin E2E scenarios were written — both components are agent-skill prose with no executable/AAA-testable logic, per component-taxonomy and missing-test-harness.

Dry-run checklist (authored before the skill prose — red artifact) and grading (green)

Authored per _spec_PlaybookHarvesting.md's "Verifying the Testable prose components" and RUN.md's Step 3 mechanical/judgment split, against a dry run driven with fixture-spec.md, materialized exemplar-repo-1/exemplar-repo-2, template-output/, and interview-answer-key.md.

Mechanical checks — all passed:

  1. test -f <playbook-out>/SKILL.md && test -f <playbook-out>/spec-template.md → pass (both files present).
  2. grep -riE "dev-team|spawn|invoke skill|use skill|subagent" <playbook-out>/SKILL.md <playbook-out>/spec-template.md → pass (no matches, exit 1).
  3. grep -c "harvested into" <scratch-fixture-spec.md> → pass (count 2, matching the fixture spec's two Method markers).
  4. grep -B2 "TODO" <playbook-out>/SKILL.md → pass (each of the two TODOs — the {{SERVICE_NAME}} substitution script and the service.yaml schema validator — is preceded by a concrete manual fallback: grep/sed commands for the first, a manual field-by-field checklist for the second).

Judgment-shaped checks — all passed:
5. Steps are executable knowledge, not delegation — every step in the produced SKILL.md names concrete commands (grep, sed, git diff) or manual checklists; no skill/agent references.
6. The strip/replace step is correctly derived from the template-output/ diff — the produced playbook's Steps 2–3 name the exact tokens seen in template-output/service.yaml/README.md ({{SERVICE_NAME}}, {{LOG_FORMAT}}) and what they resolve to, matching exemplar-repo-1/02-strip-replace.
7. The plan-vs-history divergence mined from the exemplars surfaces — the logging-format split (exemplar-repo-1/orders-service moves to json; exemplar-repo-2/billing-service keeps text "for legacy compatibility") appears both as the playbook's canonical-plus-exception step 3 and in the dry run's interview transcript (its question 4, answered from the fixture answer key's row 4).

Argument-contract checks — verified by prose inspection (not re-exercised via a second live dry run, since the fixture set is built for a full harvest, not an empty-input or already-existing-playbook scenario): SKILL.md step 1 states the refusal for zero durable-artifact sources and the update-mode detection for an existing playbook at --out, matching the brief's argument-contract exit criterion.

commands/harvest.md — visual inspection (Wrapper tier, no dedicated test expected): description + argument-hint frontmatter document the full flag syntax; the body parses arguments and forwards to harvest-playbook with no duplicated logic.

…cher

Adds plugins/dev-team/skills/harvest-playbook/SKILL.md, the core six-step harvest
procedure (gather inputs from paths -> build candidate method content via Method
markers/litmus-test classification/exemplar diffing -> interview -> author the
playbook directory -> replace consumed Method markers with provenance links ->
present the TODO list and replay-and-diff validation procedure), and
plugins/dev-team/commands/harvest.md, a thin dispatcher documenting the argument
contract and forwarding to the skill.

Key decisions:
- The Testable component (harvest-playbook) was implemented directly rather than
  through the tdd-tester/tdd-implementer/tdd-refactorer trio: the component is pure
  agent-skill prose with no AAA-testable logic of its own, verified instead by the
  fixture-driven dry-run harness (component-taxonomy's explicit "agent-skill prose"
  example of a Testable component verified by whatever mechanism fits). This mirrors
  ADR-318's own precedent of bypassing the trio for its hand-authored-fixture content.
- Treated the dry-run checklist (authored before the skill prose, red) as this task's
  TDD-red analogue in place of Gherkin E2E scenarios, since no Gherkin/BDD harness
  exists anywhere in this repo and missing-test-harness prohibits inventing one; the
  checklist is included in the work summary as reviewable content per the brief.
- Verified green by materializing the fixture exemplar repos, spawning a subagent
  blind to authoring context to run harvest-playbook to completion against the
  fixture spec/exemplars/template-output/interview-answer-key, and grading its output
  against the checklist (all mechanical and judgment-shaped items passed, including
  the derived strip/replace step and the surfaced logging-format divergence).
@github-actions

Copy link
Copy Markdown

build-and-test: Python test results

Status: ✅ Passed

Test log

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against the ADR-319 task brief and _spec_PlaybookHarvesting.md's Task 3 exit criteria. The six-step harvest-playbook procedure and the commands/harvest.md dispatcher both look solid: they match the investigate-bug/fix.md style precedents, correctly cite playbook-contract instead of restating it (directory contract, TODO semantics, marker format/lifecycle, vendor-neutrality rules), and I independently cross-checked the described dry-run results (marker count, strip/replace tokens, logging-format divergence) against the actual fixture files (fixture-spec.md, template-output/service.yaml, interview-answer-key.md) — they're consistent. One requirements-level gap below (checklist not landed as reviewable PR content), otherwise no blocking issues found. Style/content of the prose itself is clean.

Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md
@jodavis-claude

Copy link
Copy Markdown
Collaborator Author

Sign-off review: confirmed the dry-run checklist is now present in the PR description (added in the prior fix pass) and CI (build-and-test, gate) is green. No new code changes since the last review pass — approving.

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign-off review — ADR-319 (harvest-playbook / /harvest)

Prior review thread status:

  • Requirements-gap thread (dry-run checklist missing from PR description): resolved satisfactorily. The full checklist (mechanical checks with grep counts, judgment-shaped checks with cited evidence, argument-contract prose-inspection note) is now present in the PR description under "Dry-run checklist (authored before the skill prose — red artifact) and grading (green)". No code changes were needed for this fix, consistent with the fix summary. Replied on the thread confirming this; could not mark the GitHub thread itself as resolved due to a tooling permission restriction in this session — flagging for the human owner to resolve manually if desired.

Scan of modified files since last review: no code files changed since the last review pass — the fix was a PR-description-only edit (single commit 770d16d, unchanged). Re-inspected harvest-playbook/SKILL.md and commands/harvest.md against playbook-contract/SKILL.md and CONTRIBUTING.md/_doc_Projects.md: six-step procedure present and correctly ordered, argument-contract rules (durable-artifact requirement, update-mode detection) stated in step 1, Method marker provenance-link format matches playbook-contract's example exactly, vendor-neutrality rules cited (not restated), TODO semantics cited with manual-fallback requirement preserved, commands/harvest.md follows the fix.md/spec.md thin-dispatcher pattern with a missing---out guard. No new Priority 1-4 issues found.

CI: build-and-test and gate both green.

Approving sign-off.

Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md
@jodavis-claude
jodavis-claude marked this pull request as ready for review July 15, 2026 16:32
@jodavis-claude
jodavis-claude requested a review from jodavis July 15, 2026 16:32
Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md
Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md
Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md Outdated
Comment thread plugins/dev-team/skills/harvest-playbook/SKILL.md Outdated
- Support partial-spec harvests: scope can be given conversationally in
  step 1, or asked explicitly at the start of step 3, instead of assuming
  the whole artifact is always in scope.
- Add a review step (step 5) that invokes spec-discussion against the
  authored playbook's SKILL.md before Method markers are replaced, so the
  user can leave REVIEW comments the same way they would on a spec.
- Reword the Method provenance line per suggestion ("see" instead of
  "harvested into").
- Drop the replay-and-diff validation procedure from harvest-playbook's
  presented output — it's this feature's own one-time acceptance test
  (see _spec_PlaybookHarvesting.md), not a standard step for every
  harvested playbook. Updated the spec's decision record and Task 3 exit
  criteria to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBnDBvr47h4fVqNte6feE2
@jodavis
jodavis merged commit 799571d into feature/ADR-316-harvest Jul 15, 2026
3 checks passed
@jodavis
jodavis deleted the dev/claude/ADR-319 branch July 15, 2026 19:24
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.

3 participants