From ccfe8e8a4f96cc1606eb8a237e7d61dcc37fcc3b Mon Sep 17 00:00:00 2001 From: Invoker Date: Sun, 16 Aug 2026 09:22:20 +0000 Subject: [PATCH] reflect: check for an already-drafted-but-unlanded prior lesson before writing a new one Found via /reflect in the Invoker repo: a reflect commit documenting a "same root cause fixed N times on unmerged disposable branches" pattern sat unmerged on its own PR branch, and the exact pattern it documented recurred and was independently rediscovered by a sibling workflow about an hour later -- the lesson about unlanded fixes was itself an unlanded fix. Adds a check to step 6: before drafting a new skill edit, search the target repo's history for a prior reflect commit on the same file/section and verify it actually landed (is an ancestor of the branch being landed on) before assuming the lesson is in effect. Co-Authored-By: Claude Sonnet 5 --- skills/reflect/SKILL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/skills/reflect/SKILL.md b/skills/reflect/SKILL.md index 736815f..c887b2a 100644 --- a/skills/reflect/SKILL.md +++ b/skills/reflect/SKILL.md @@ -115,6 +115,7 @@ Present the full Accepted / Backlog / Route-to-automate-me / Rejected list to th - Substantive edit (a new section, a new principle, more than ~10 lines): write it out in full, matching the target skill's existing structure and tone, and show the diff before it's considered done. - Backlog item: describe the concrete script/check/test to write, but don't write it as part of `reflect` itself — that's separate implementation work once the user confirms it's wanted. - Route-to-`automate-me` item: don't draft it here. Either invoke `automate-me` directly if the user wants it done now, or leave it as a named follow-up in the summary below. +- Before drafting a new edit, check whether the same lesson was already captured and drafted by an earlier `reflect` pass but never landed — a skill-edit commit is subject to the same disposable-branch/unmerged-PR risk as any other fix, and a lesson that only exists on an unmerged branch is not actually in effect. Search the target repo's history for a prior reflect commit touching the same file/section (e.g. `git log --all --grep="reflect" -i -- `) and check whether it's an ancestor of the branch you're landing on (e.g. `git merge-base --is-ancestor HEAD`). If a matching unlanded draft exists, prefer adapting/extending it — and note its commit/branch in the summary so a reviewer can consider closing the duplicate — over writing a third divergent copy of the same lesson. ### 7. Summarize