Skip to content

refactor(#146): co-locate policy+query+checklist across sub-skills (closes #140)#151

Merged
devallibus merged 8 commits intomasterfrom
issue/146-colocate-subskills
Apr 18, 2026
Merged

refactor(#146): co-locate policy+query+checklist across sub-skills (closes #140)#151
devallibus merged 8 commits intomasterfrom
issue/146-colocate-subskills

Conversation

@devallibus
Copy link
Copy Markdown
Owner

@devallibus devallibus commented Apr 18, 2026

[rtk] /!\ No hook installed — run rtk init -g for automatic token savings

Summary

  • Co-locates policy + runnable queries + acceptance checklist into each commands/shiplog/<phase>.md sub-skill file so LLMs can execute any phase from a single file without cross-file navigation
  • Folds in [shiplog/plan] Hunt command misses comment-based signed reviews #140 T1–T3: extends hunt.md to fetch PR comments and detect signed Reviewed-by: + Disposition: lines, so PRs with comment-based reviews are correctly classified instead of appearing in the needs-review bucket
  • Trims closure-and-review.md to its cross-model gate policy anchor; runbook content moves to new commands/shiplog/review.md

Closes #146
Closes #140

Tasks Completed

T1: hunt.md (folds in #140 T1–T3)

  • commands/shiplog/hunt.md reshaped to canonical 3-section shape
  • Policy: signed review = PR/issue comment with Reviewed-by: + Disposition:, not reviewDecision/reviews fields
  • Query: per-PR gh pr view <N> --json comments fetch; signed-review detection scans comment bodies
  • Classification: PR with valid signed approve comment placed in approved bucket, not needs-review
  • Cross-link: preamble + Policy both point to closure-and-review.md §3

T2: plan.md

  • commands/shiplog/plan.md reshaped
  • Policy: when to create a planning issue, envelope requirements, triage field derivation pointer
  • Query/Template: label bootstrap, gh issue create command, full planning issue body template with Authored-by: sig

T3: start.md

  • commands/shiplog/start.md reshaped
  • Policy: branch naming convention, branch base requirement, label swap, envelope update, session-start comment
  • Query/Template: worktree + fallback commands, label swap, session-start template

T4: commit.md

  • commands/shiplog/commit.md reshaped
  • Policy: <type>(#<id>): <msg> format, Authored-by: in commit body, when to post commit-note
  • Query/Template: git commit -F pattern, commit message + commit-note templates

T5: pr.md

T6: review.md (new file) + closure-and-review.md trim

  • New: commands/shiplog/review.md — policy, sign-off template, self-review template, PR snapshot update
  • Trimmed: closure-and-review.md §3 sign-off runbook → review.md; §4 execution ladder → pointer + GitHub API constraint anchor

T7: lookup.md + resume.md

  • commands/shiplog/lookup.md: ID-first retrieval, multi-surface search, compact report format
  • commands/shiplog/resume.md: branch detection, session-resume comment template, blocker surfacing

T8: SKILL.md Integration Map

  • Sub-skill map table added (8 phases → files)
  • Cross-cutting reference anchors table added
  • External skill delegation table updated to point to sub-skill files as primary
  • Requirements section: "Internalized Workflows" replaced with "Co-located Sub-skills" + "Internalized Reference Workflows" tables

Verification

  • hunt.md has exactly 3 top-level sections (Policy / Query+Template / Acceptance Checklist)
  • hunt.md fetches gh pr view <N> --json comments per PR before classifying review status
  • All 7 existing sub-skill files reshaped to 3-section canonical shape
  • review.md created; an LLM can do a full PR review from it plus one jump to closure-and-review.md §3
  • closure-and-review.md retains cross-model gate policy, merge conditions, closure evidence rules
  • SKILL.md Integration Map points to sub-skill files as primary; no auto-activation rules changed

Journey Timeline

Initial Plan

Issue #146 called for co-locating policy+query+checklist across all 8 sub-skill files, with #140 (hunt.md comment-probe fix) folded into T1.

What We Discovered

Windows file-locking (implementation issue): Several files in commands/shiplog/ were locked by another process (likely another Claude Code session or editor). start.md, commit.md, pr.md, lookup.md, and resume.md all returned EUNKNOWN on Write and Permission denied on cp. Resolved by using git mv <file> <file>.bak to rename the locked file, then creating a fresh file at the original path, then removing the .bak in the same commit. No data was lost.

Key Decisions

Decision Rationale
Fold #140 T1–T3 into #146 T1 Both touch hunt.md; sequential edits in separate PRs create merge sequencing risk
Keep cross-model gate policy in closure-and-review.md §3, not in review.md Gate is cross-cutting (hunt.md, pr.md, review.md all reference it); single anchor prevents drift
Trim §4 to GitHub API constraint + pointer Execution steps now live in review.md; keeping them in both files recreates the desync problem this PR fixes
#141 graceful degrade (no Reviews-index line) #141 not yet merged; reviews placeholder in pr.md references review.md without speculating on #141's shape

Changes Made

Reviews

Current state: approved
Last reviewed by: claude/opus-4.7 (claude-code)
Last reviewed at: 2026-04-18T14:30:00Z
Reviewed commit: 307e2fc
Source artifact: #151 (comment)
Needs re-review since: —


Authored-by: claude/sonnet-4.6 (claude-code)
Last-code-by: claude/sonnet-4.6 (claude-code)
Captain's log — PR timeline by shiplog

… detection (closes #140)

Reshapes commands/shiplog/hunt.md to the canonical 3-section shape (Policy /
Query-Template / Acceptance Checklist) and folds in #140 T1-T3:

- Policy: signed review = comment with Reviewed-by: + Disposition: lines;
  reviewDecision/reviews fields are advisory only
- Query: extended probe fetches gh pr view <N> --json comments per PR;
  signed-review detection scans comment bodies for both lines
- Classification: PR with valid signed approve comment goes to approved bucket,
  not needs-review bucket
- Cross-link: policy pointer to closure-and-review.md §3 in preamble and Policy
- Checklist: 6 items covering comment fetch, correct bucket placement, cross-model
  gate check using resolved last-code-author

Closes #140

Authored-by: claude/sonnet-4.6 (claude-code)
Canonical 3-section shape (Policy / Query-Template / Acceptance Checklist).

- Policy: when to create a planning issue, envelope requirements, triage field
  derivation rule (pointer to artifact-envelopes.md §1), label-at-creation rule
- Query/Template: label bootstrap snippet, gh issue create command, full planning
  issue body template with pre-filled Authored-by sig block
- Checklist: 6 items covering envelope validity, max_tier derivation, task fields,
  label, sig, and unverified-claim annotation

Authored-by: claude/sonnet-4.6 (claude-code)
Canonical 3-section shape (Policy / Query-Template / Acceptance Checklist).

- Policy: branch naming convention (issue/<id>-<slug>), branch base must be
  default branch tip, label swap rule (shiplog/ready -> shiplog/in-progress),
  envelope readiness update, session-start comment requirement
- Query/Template: fetch issue command, worktree + fallback branch commands,
  label swap commands, session-start comment template with Authored-by sig
- Checklist: 6 items covering branch name, base, label swap, envelope update,
  session-start posted with unchecked task list

Note: file was renamed via git mv to work around a Windows file-lock (another
process had start.md open); the rename was resolved in the same commit.

Authored-by: claude/sonnet-4.6 (claude-code)
Canonical 3-section shape (Policy / Query-Template / Acceptance Checklist).

- Policy: commit message format (<type>(#<id>): <msg> and <type>(#<id>/<Tn>): <msg>),
  Authored-by: sig required in commit body, when to post commit-note comment,
  staging hygiene (specific files, no --no-verify)
- Query/Template: temp-file + git commit -F pattern, commit message template with
  pre-filled Authored-by sig, commit-note comment template, git log --grep retrieval
- Checklist: 6 items covering format, sig, staging, no-verify, commit-note, hash shown

Authored-by: claude/sonnet-4.6 (claude-code)
Canonical 3-section shape (Policy / Query-Template / Acceptance Checklist).

- Policy: PR body mandatory sections (envelope, summary, Closes, timeline,
  verification, reviews placeholder, sig blocks); both Authored-by: and
  Last-code-by: required; review gate pointer to review.md (no duplication
  of gate policy); partial delivery uses Addresses #<N> not Closes #<N>
- Query/Template: git push + gh pr create command, full PR body template with
  pre-filled sig block, label transition command
- Checklist: 6 items covering envelope, Closes line, timeline, sig blocks,
  review placeholder, label transition

#141 gracefully degraded: no Reviews-index line added; reviews placeholder
section references review.md for review sub-skill instead.

Authored-by: claude/sonnet-4.6 (claude-code)
…-and-review.md

New file: commands/shiplog/review.md with canonical 3-section shape:
- Policy: 4-field sign-off requirement, cross-model gate pointer (to
  closure-and-review.md §3), approve-with-follow-ups precondition, default
  publication rule, snapshot follow-through
- Query/Template: check PR code author command, gh pr diff + view, review
  sign-off comment template (with envelope), self-review template, PR body
  snapshot update commands
- Checklist: 6 items covering cross-model check, diff read, follow-up issue
  pre-creation, publication, snapshot update, Follow-ups field validity

Trim: closure-and-review.md §3 sign-off format section and §4 Review
Execution Ladder shrunk to policy anchor + cross-cutting GitHub API constraint.
All runbook content (templates, dispatch steps, self-review format, publication
rules) relocated to review.md. Cross-model gate rule, what-constitutes-different-
model definition, merge conditions (§5), and closure evidence rules all retained.

Authored-by: claude/sonnet-4.6 (claude-code)
Both files reshaped to canonical 3-section shape (Policy / Query-Template /
Acceptance Checklist).

lookup.md:
- Policy: ID-first retrieval (issue number as primary key), multi-surface
  search requirement (issues + PRs + git log), envelope-first reading, deep
  dive on request only
- Query/Template: by issue number (ID-first), by keyword, by shiplog tag,
  envelope-only read via jq, lookup report format
- Checklist: 5 items covering both gh surfaces, git log, compact-first output,
  envelope fields noted, ork:memory queried if available

resume.md:
- Policy: branch detection from issue/<id>-<slug>, session-resume comment
  requirement (distinct from session-start), triage field sync, open blocker
  surfacing
- Query/Template: branch parse, gh issue view, linked PR check, session-resume
  comment template with Authored-by sig, git log --grep for prior commits
- Checklist: 6 items covering issue detection, task status current, blockers
  surfaced, resume comment posted, triage sync, next task by tier

Authored-by: claude/sonnet-4.6 (claude-code)
…-skills

Integration Map restructured into three tables:
1. Sub-skill map — each phase pointing to its commands/shiplog/<phase>.md file
2. Cross-cutting reference anchors — what stays in references/ and why
3. External skill delegation — updated to point to sub-skill files as primary

Requirements section updated:
- "Internalized Workflows" table replaced with "Co-located Sub-skills" table
  listing all 8 phase files
- New "Internalized Reference Workflows" table for references/ deep-dive files

No changes to auto-activation rules, core principle, kind map, signing spec,
triage maintenance table, or edge cases. Pointer updates only per T8 scope.

Authored-by: claude/sonnet-4.6 (claude-code)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 307e2fc6ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread commands/shiplog/plan.md
Comment on lines 37 to 40
gh label create "shiplog/plan" --color "0B7285" --description "Brainstorm captured as a planning issue" --force
gh label create "shiplog/ready" --color "2DA44E" --description "Ready to implement" --force
gh label create "shiplog/in-progress" --color "FBCA04" --description "Implementation in progress" --force
gh label create "shiplog/needs-review" --color "D93F0B" --description "Awaiting review" --force
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore shiplog/discovery to Phase 1 label bootstrap

The Phase 1 bootstrap list no longer creates shiplog/discovery, but the discovery flow still creates issues with --label "shiplog/discovery" (see skills/shiplog/discovery.md). In a repo initialized from this updated bootstrap, discovery handling will fail when it tries to apply a label that was never created, which blocks a core Phase 3 path; add shiplog/discovery back (or reuse the canonical full bootstrap from references/labels.md).

Useful? React with 👍 / 👎.

Comment on lines +72 to +73
gh pr comment <N> --body-file <temp-file>
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Permit temp-file writes in review workflow

This command requires temp files for required steps (gh pr comment --body-file <temp-file> and gh pr edit --body-file <updated-body-file>), but its frontmatter only allows Bash(gh:*), Bash(git:*), Read and omits Write. In environments that enforce allowed-tools, the reviewer cannot create those files, so publication and snapshot update—the two mandatory completion steps in this file—become non-executable.

Useful? React with 👍 / 👎.

Comment on lines +37 to +40
Write to a temp file and use `git commit -F`:

**Commit types:** `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `style`, `perf`.
```
<type>(#<issue-id>/<Tn>): <description>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Permit temp-file writes in commit workflow

The commit flow now explicitly depends on temp files (git commit -F <temp-file> and later gh issue comment ... --body-file), but this command still omits Write from allowed-tools. Under enforced tool permissions, that blocks the documented happy path for composing multiline commit messages and commit-note artifacts, so the command cannot reliably execute its own template.

Useful? React with 👍 / 👎.

@devallibus
Copy link
Copy Markdown
Owner Author

[shiplog/review-handoff] #146: Review of PR #151

Reviewer: claude/opus-4.7 (claude-code) — cross-model review of a sonnet-4.6 author
Reviewed commit: 307e2fc (tip of issue/146-colocate-subskills)
Scope: full diff — 10 files, +637 / -513

What was reviewed

Findings

Disposition: approve — no blockers.

  1. Canonical 3-section shape verified on all 8 sub-skill files. hunt.md, plan.md, start.md, commit.md, pr.md, review.md, lookup.md, resume.md each have exactly ## Policy, ## Query / Template, ## Acceptance Checklist as top-level sections. Extra ## in plan.md/pr.md/review.md are embedded template content (issue body, PR body, comment body) inside code fences — correct by intent, since templates are copy-pasteable artifacts and must retain their own heading structure.

  2. hunt.md comment-probe fix ([shiplog/plan] Hunt command misses comment-based signed reviews #140 fold-in) is correct. Policy declares reviewDecision/reviews advisory-only; the query fetches gh pr view <N> --json comments; classification keys on a comment containing both Reviewed-by: AND Disposition: approve|approve-with-follow-ups. Checklist explicitly calls out that the cross-model gate check uses the resolved last-code-author identity, not reviewDecision. Closes [shiplog/plan] Hunt command misses comment-based signed reviews #140 cleanly.

  3. closure-and-review.md trim is surgical. §1–2 closure evidence retained. §3 still owns the cross-model gate rule, "what constitutes different model", provenance fallback chain. §4 shrunk to policy anchor + GitHub API constraint (execution moved to review.md). §5 merge conditions retained. No runbook duplication across the two files — which was the whole point of T6.

  4. review.md is self-sufficient for an LLM. Four-field sign-off requirement, cross-model gate pointer, approve-with-follow-ups precondition (create tracking issue first), self-review-does-not-satisfy-gate warning, snapshot field list matching the pr.md template. An LLM can review a PR from this file alone plus one jump to §3 for the gate rule.

  5. SKILL.md Integration Map is pointer-only. No changes to auto-activation rules, core principle, kind map, signing spec, triage table, or edge cases. The three new tables (sub-skill map, cross-cutting anchors, external delegation) are navigational additions. No scope creep into [shiplog/plan] Restructure SKILL.md: golden path + verb grid + section reorder #147 (no golden-path walkthrough, no verb grid, no section reorder — all correctly deferred).

  6. [shiplog/plan] Remove invented tags from #145 kind map (session-end, approach-change) #150 invented-tag issue not compounded. Repo-wide diff scan confirms zero new uses of session-end or approach-change introduced by this PR. Pre-existing occurrences in SKILL.md, timeline.md, and artifact-envelopes.md are untouched and remain tracked in [shiplog/plan] Remove invented tags from #145 kind map (session-end, approach-change) #150.

  7. [shiplog/plan] PR envelope: add Reviews index line for signed reviews #141 graceful degrade is correct. pr.md template's ## Reviews placeholder references commands/shiplog/review.md without speculating on [shiplog/plan] PR envelope: add Reviews index line for signed reviews #141's Reviews-index shape. When [shiplog/plan] PR envelope: add Reviews index line for signed reviews #141 lands, the placeholder text can be extended without refactoring the template.

  8. All 8 commits signed Authored-by: claude/sonnet-4.6 (claude-code). Windows file-lock implementation issue from T3 documented in the PR body as expected (captured per mandatory-issue-capture rule). No data lost.

Notes for follow-on workstreams

One-line-edit check


Reviewed-by: claude/opus-4.7 (claude-code)
Disposition: approve
Scope: full diff — 10 files, +637 / -513
Follow-ups: none

@devallibus devallibus merged commit cf238d5 into master Apr 18, 2026
@devallibus devallibus deleted the issue/146-colocate-subskills branch April 18, 2026 12:09
devallibus added a commit that referenced this pull request Apr 22, 2026
Backfills cumulative drift since the implicit 0.1.0 baseline (PR #84,
2026-03-15). Five MINOR-worthy phases shipped without bumps; classifying
them per semver lands at 0.5.0. Stays on 0.x — surface is still mobile
(Quiet Mode just removed, vocabulary just rewritten).

This unblocks downstream consumers: Claude Code's plugin cache and
npx skills add both key on this version string. Existing 0.1.0 caches
will refresh on next install and finally pick up the post-#151 hunt
fix from #140 (and everything else that has merged since 2026-03-15).

T1 of #156. T2 (CONTRIBUTING policy), T3 (CI bump-check), T4 (release
workflow) follow as separate PRs.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shiplog/history Final history-bearing Shiplog PR shiplog/issue-driven PR is linked to a Shiplog issue shiplog/needs-review Awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[shiplog/plan] Co-locate policy + query + checklist across all shiplog sub-skills [shiplog/plan] Hunt command misses comment-based signed reviews

1 participant