Skip to content

skills: clarify repo > bundled precedence, learn from feedback - #306

Merged
max-sixty merged 1 commit into
mainfrom
soul
Apr 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
soul

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

Two improvements inspired by OpenClaw's skill architecture:

1. Make repo > bundled precedence explicit

The overlay pattern already exists — consuming repos add a running-tend skill at .claude/skills/running-tend/SKILL.md that overlays tend's bundled skills — but the precedence rule was stated piecemeal across running-in-ci and action.yaml. This PR lifts it to a single, authoritative statement in two places:

  • CLAUDE.md gains a "Skill precedence: repo > bundled" section for developers working on tend.
  • running-in-ci/SKILL.md moves the precedence rule to the top of the file (from a midway mention under Conduct) and phrases it as a universal rule applying to all skills.

2. Learn from feedback

New "Learning from Feedback" section in running-in-ci/SKILL.md: when a maintainer corrects the bot's behavior during a run, the bot proposes a standalone PR against the consuming repo's running-tend skill — not against tend itself. This isolates learning per-repo and keeps tend's bundled skills stable.

Guardrails:

  • Only for generalizable feedback (patterns, conventions — not task details)
  • Only from maintainers (non-maintainer suggestions get a reply, not a PR)
  • Standalone PR, follows the repo's own title conventions
  • Dedup by target file path (not title, since conventions vary)
  • Open-and-exit — the PR is the review request; no pinging, no blocking

Test plan

  • Generator tests pass (uv run pytest — 163 passed)
  • Pre-commit lints pass
  • Will dogfood: next time a maintainer corrects bot behavior on this repo, the bot should propose a PR against .claude/skills/running-tend/SKILL.md

- CLAUDE.md gains a "Skill precedence" section documenting how consuming
  repos overlay tend's bundled skills with a `running-tend` skill.
- running-in-ci moves the precedence rule to the top and links back to it
  from the Conduct section, replacing the duplicated statement.
- running-in-ci adds a "Learning from Feedback" section: when a maintainer
  corrects the bot, it proposes a standalone PR against the consuming
  repo's `running-tend` skill so the lesson applies to future runs in
  that repo. Dedup by target file path, not title (conventions vary per
  repo). Maintainer-gated, open-and-exit.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 2713140 into main Apr 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the soul branch April 18, 2026 18:38
max-sixty added a commit that referenced this pull request Apr 22, 2026
## Summary

Upstreams the fix from worktrunk PR
[max-sixty/worktrunk#2386](max-sixty/worktrunk#2386)
into the bundled notifications skill.

Step 4a of the dedup check currently finds *completed* bot activity
(comments, reviews, timeline cross-references). It does not see a
dedicated workflow that is still running. `tend-mention` sessions that
involve real implementation routinely run past the 10-minute freshness
gate — when the notifications bot proceeds, it re-implements in-progress
work.

Evidence (from worktrunk, finding in #2386):

- Run
[24742688091](https://github.com/max-sixty/worktrunk/actions/runs/24742688091)
— ~79 min, ~$25, 279 turns. Re-implemented [PR
#2361](max-sixty/worktrunk#2361) while
tend-mention was still pushing; last-step dedup caught the collision and
cleaned up, but the session cost had already been incurred.
- Run
[24519963858](https://github.com/max-sixty/worktrunk/actions/runs/24519963858)
— ~16 min, ~$9, 168 turns. Same pattern on PR #2263 / issue #2261.

## Change

Adds an **In-flight check** sub-step to step 4a of
`plugins/tend-ci-runner/skills/notifications/SKILL.md`, sitting between
the freshness gate and the dedup check. It queries
`actions/runs?status=in_progress`, filters to `tend-*` runs, excludes
`$GITHUB_RUN_ID`, and matches on `display_title` (the workflow_run
payload does not expose the triggering issue number for `issue_comment`
/ `pull_request_review` events without an extra API call per run). On
hit, skip without marking read — same disposition as the freshness gate.

The two bash-tool caveats from the overlay are preserved inline: `gh api
--jq` does not accept `--arg`/`--argjson`, and the Bash tool's bang
rewriting can still bite outside heredocs, so the jq uses `(X) | not`
rather than the not-equal operator.

## Why this lives in tend, not as a per-repo overlay

The precedence rule codified in CLAUDE.md ("Skill precedence: repo >
bundled") and in `running-in-ci/SKILL.md`
([#306](#306)) says overlays are
for repo-specific policy/convention/taste. This fix is generic: any tend
consumer whose `tend-mention` runs can exceed 10 minutes will hit the
same race. That makes it a bundled-skill defect, not an overlay.

## Follow-up on worktrunk

Once this lands,
[worktrunk#2386](max-sixty/worktrunk#2386) is
redundant — the bundled skill now covers what its overlay added. A human
should close #2386 and revert the overlay section it added to
`.claude/skills/running-tend/SKILL.md`. I have not touched worktrunk.

## Test plan

- [x] `pre-commit run --all-files` passes
- [x] jq query verified against worktrunk's
`actions/runs?status=in_progress` (returns 0 when no concurrent tend run
matches the subject title, which is the current state)
- [ ] Next time a same-repo mention triggers a long `tend-mention` run,
verify a concurrent notifications run sees `IN_PROGRESS > 0` and exits
cleanly

> _This was written by Claude Code on behalf of @max-sixty_

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

2 participants