Skip to content

🐛 Check upstream issue before creating logbook in pr-logbook skill - #101

Merged
hcross merged 1 commit into
mainfrom
fix/issue-95-pr-logbook-upstream-check
May 14, 2026
Merged

🐛 Check upstream issue before creating logbook in pr-logbook skill#101
hcross merged 1 commit into
mainfrom
fix/issue-95-pr-logbook-upstream-check

Conversation

@hcross

@hcross hcross commented May 14, 2026

Copy link
Copy Markdown
Owner

Teaches the pr-logbook skill to reuse an existing upstream feature issue as the logbook surface instead of spawning a redundant ticket. Implements #95 — the friction it reports is fixed by this very PR, which applies the new rule to itself.

How to read this PR?

  1. Start with community-config/skills/pr-logbook/SKILL.md — that is the canonical tree. Read §4 Logbook entries (the only block that changed); the new pre-flight scan for Closes #N / Fixes #N / Resolves #N sits there.
  2. The .claude/skills/pr-logbook/SKILL.md and .gemini/skills/pr-logbook/SKILL.md files mirror the same diff for each harness. Spot-check that the three trees stayed in sync.
  3. Note the metadata.version bump (1.1.0 → 1.1.1) in all three files — that is the cheap signal downstream consumers diff against to detect the contract change.
  4. The rest of the branch's commit log (pr-reviewer, developer skill tweaks) belongs to earlier merged PRs and is not part of this changeset.

How to test this PR?

  1. git fetch origin && git checkout fix/issue-95-pr-logbook-upstream-check.
  2. git diff main...HEAD -- '*/pr-logbook/SKILL.md' — confirm the three mirrors carry the identical +13/-1 block and the version bump.
  3. Open one of the SKILL.md files at §4 and read the new clause as if you were an agent: it must be unambiguous that scanning the PR body for Closes #N / Fixes #N / Resolves #N happens before any gh issue create.
  4. Cross-check Friction cluster: pr-logbook-redundant-issue (1 report) #95 — the logbook narrative for this PR lives as a comment on the issue (no sibling logbook issue was opened) and the logbook label is present. That is the live regression test.

Detailed description (for agents)

  • Scope. Single behavioural edit to the pr-logbook skill, replicated across three trees (community-config/, .claude/, .gemini/). No code paths, no scripts, no agent definitions touched.
  • Diff shape. Each file gains a 13-line block immediately above the existing "A logbook is not a status update" paragraph in §4, and the metadata.version line moves from "1.1.0" to "1.1.1". git diff --stat reports +13/-1 per file.
  • Contract. Before opening a new logbook issue, the agent MUST scan the PR body for Closes #N, Fixes #N, or Resolves #N. If a match exists: (a) append the logbook entry as a comment on issue #N via add_issue_comment (or gh issue comment), (b) ensure #N carries the logbook label, adding it via gh issue edit <N> --add-label logbook if absent, (c) do NOT create a standalone logbook issue. Standalone issues remain valid only when no upstream ticket exists (hotfix, dependency bump, ticketless automation run).
  • Self-application. This PR is its own regression test. Issue Friction cluster: pr-logbook-redundant-issue (1 report) #95 already exists (the friction report that motivated the change); the logbook entry for this work is posted as a comment on Friction cluster: pr-logbook-redundant-issue (1 report) #95 and the logbook label was added to it. No new logbook issue was created.
  • Backward compatibility. Pure additive guard before the existing logbook-authoring guidance. Agents that ignore the new clause still produce valid output — they just produce the suboptimal output that the friction report flagged. The version bump is the discovery surface.
  • Out of scope. Tooling to auto-detect Closes #N and route the comment without an agent decision; cross-skill propagation to pr-reviewer or developer. Both deferred until a second friction report justifies them.

@hcross hcross left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE-equivalent (posted as COMMENT — GitHub blocks self-approval)

Independent cold-start review by the pr-reviewer agent. No authoring context.

Correctness

Each of the three SKILL.md mirrors (community-config/, .claude/, .gemini/) gains an identical 13-line block in §4 Logbook entries, positioned immediately above the "A logbook is not a status update" paragraph. The block instructs the agent to scan the PR body for Closes #N / Fixes #N / Resolves #N before creating a new logbook issue, and to append a comment + ensure the logbook label if a feature ticket exists.

The three trees stayed in sync. metadata.version correctly bumps 1.1.01.1.1 in all three files, matching AGENTS.md's convention of signalling contract changes via a version bump.

Convention compliance

  • Title — Gitmoji format respected: 🐛 Check upstream issue before creating logbook in pr-logbook skill. The 🐛 emoji matches the framing.
  • PR body — All four required sections present.
  • Branch namefix/issue-95-pr-logbook-upstream-check follows the fix/ prefix convention.
  • Language — English throughout.
  • Logbook — The PR claims #95 carries the logbook entry as a comment with the logbook label, applying the new rule to itself. Intended dogfood test.
  • Version bump rule — Honoured in all three mirrors.

Test coverage

No automated tests apply (skill content is prose). The live regression test is the self-application: the PR's logbook posted as a comment on #95 rather than a sibling issue. The diff is its own fixture.

Linter findings

  • lint-markdown.sh community-config/skills/pr-logbook/SKILL.md — exit 0, no output.
  • lint-skill.sh community-config/skills/pr-logbook/SKILL.md (BASE_REF=main) — exit 0, no output. Confirms required frontmatter fields and the version bump vs main.

Nits (non-blocking)

  • The new block names add_issue_comment (correct MCP tool) with gh issue comment as parenthetical fallback. Consider explicitly noting the MCP tool is preferred per the org's GitHub-MCP-priority rule. Minor.
  • Out-of-scope items (auto-detect tooling, cross-skill propagation to pr-reviewer / developer) are appropriately deferred.

Clean change, narrow blast radius, additive guard, self-validating. Ready to merge.

@hcross
hcross merged commit ed6fb6e into main May 14, 2026
5 checks passed
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