[docs] agent notes: skill direct-orchestration + hook regex word-boundary#82
Merged
trilamsr merged 2 commits intoMay 19, 2026
Merged
Conversation
…dary Captures two agent-internal patterns from this session that aren't universal enough for AGENTS.md but would help the next skill author or hook designer avoid the same trap. skill-design.md: why pr-review-loop dropped its plugin dependency (Claude Code permission classifier blew up on ~17KB ARGUMENTS; direct Agent-tool orchestration is the safer shape). automation.md: why the pre-PR checklist hook uses a regex word-boundary matcher rather than substring containment or starts-with — substring over-fires, starts-with under-fires, word-boundary lands the right balance. Both files at "Newest-first" ordering convention. Anchors point at PR #73 and PR #80 respectively. make doc-check clean. Signed-off-by: Tri Lam <trilamsr@gmail.com>
Self-review on PR #82 surfaced three gaps. This commit closes them: 1. Skill-design carve-out: the lesson now explicitly scopes itself to the multi-phase-with-large-prompt shape, not plugins in general. A future reader won't over-correct and avoid plugins for small, well-typed protocols where they remain the right tool. 2. Automation carve-out + generalization: bias toward false positives only when the hook is advisory. Blocking hooks (those that deny via permissionDecision) should flip to starts-with so unrelated commands aren't forcibly stopped. Also widens the lesson's scope: the trade-off generalizes to any shell-command-matching hook, not just PR/push commands. 3. Regex decomposed into named parts inline: the (^|[[:space:];&|]) prefix + alternation + ([[:space:]]|$) suffix structure is now visible at a glance rather than as a wall of characters. make doc-check clean locally. Signed-off-by: Tri Lam <trilamsr@gmail.com>
3 tasks
trilamsr
added a commit
that referenced
this pull request
May 19, 2026
## Summary Three observations from the recent session that didn't fit the structured surfaces (already used for the load-bearing AGENTS.md entries in PR #81 and the agent-internal notes in PR #82). Each captured via the `learn-from-mistakes` flow and lands in its existing topic note. **`.claude/notes/automation.md`** — *Memory captures rationale; hooks enforce.* The pre-PR checklist personal memory landed mid-session was followed by a lint failure shipped to CI within the hour. The same gap closed reliably by the `PreToolUse` hook installed shortly after. For any "always do X before Y" pattern, prefer the hook; the memory documents *why* the hook exists. **`docs/notes/ci.md`** — *Frame CI / perf projections as ranges, not single numbers.* PR #72's 155s wall-time projection vs 242s actual cost an investigation round (later landed in PR #77) because the projection's setup-go-cache amortization assumption was unverified. Either verify assumptions empirically before publishing the number, or frame as a range. **`.claude/notes/review-patterns.md`** — *Self-rate work, then write criteria for the next grade up.* Forces articulation of measurable improvements rather than free-form "anything else?". PR #76's B+ → A → A+ came from two iterations of this exact pattern; each iteration closed real structural gaps. A fourth lesson — "fix existing tools before proposing new ones" — was captured to personal memory (no PR, lives in `~/.claude/projects/.../memory/`), not the repo, because it's a judgment heuristic about my own decision-making rather than a repo-resident convention. ## Test plan - [x] `make doc-check` clean (banned-phrase lint, link resolution, all gates). - [x] `learn-from-mistakes` format check: banned vocabulary absent, no first-person AI phrasing, no AI attribution, all three entries carry `Anchor:` lines pointing at concrete PRs. - [ ] CI on this PR exercises `doc-check` + `pr-lint`. ## Rollback Each entry is a self-contained `### title` + body + `Anchor:` block at the top of its file. No dependents elsewhere; reverting is a single Edit per file. ```release-notes NONE — documentation only. Three meta-lessons from a recent session retrospective land in their existing topic notes (`automation.md`, `ci.md`, `review-patterns.md`). No runtime behavior change. ``` Signed-off-by: Tri Lam <trilamsr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two agent-internal lessons captured via the
learn-from-mistakescapture flow. Not universal enough forAGENTS.md; each lands in its existing topic note where the next skill author or hook designer would naturally look..claude/notes/skill-design.md— orchestrate multi-phase skills directly, not through a plugin's$ARGUMENTS. Routing a ~17 KB prompt body through/ralph-loop:ralph-loop's setup-script$ARGUMENTSblew Claude Code's permission classifier mid-session (parser timeout, resource limit, or over-length). PR #73 dropped the dependency and routed the 5 phases to directAgent-tool dispatches; this note documents why so the next author doesn't hit the same wall. Carves out: plugin delegation is fine for small, well-typed$ARGUMENTS; the lesson scopes to the multi-phase-with-large-prompt shape only..claude/notes/automation.md— match shell-command hooks by regex word-boundary, not substring containment. The pre-PR checklist hook (PR #80) iterated through three matcher shapes this session: substring over-fires onecho gh pr create, starts-with misses compoundcat > body && gh pr edit, regex word-boundary lands the balance. The note pins the trade-off rationale, decomposes the regex into named parts (leading boundary+alternation+trailing boundary), and carves out: advisory hooks bias toward false positives; blocking hooks should flip to starts-with so unrelated commands aren't forcibly stopped. The trade-off generalizes beyond PR commands.Test plan
make doc-checkclean (banned-phrase lint, link resolution, all gates).learn-from-mistakesformat check: banned vocabulary absent, no first-person AI phrasing, no AI attribution, both entries carryAnchor:lines.doc-check+pr-lint(no code changes).Rollback
Delete the two added entries (each is a self-contained
### title+ body +Anchor:block at the top of its file). No dependents elsewhere in the repo; reverting is a single Edit per file.