docs(skills): forbid mcp__forgejo__*_file for code edits — add Tool choice section #80

Merged
code-lead merged 8 commits from dev/79 into main 2026-04-19 08:40:16 +00:00
Collaborator

Closes #79.

Summary

  • Add a canonical Tool choice section to all code-flow skills
    (implement, address-review, rebase, fix-ci) and their
    -delta variants (implement-delta, address-review-delta).
    The section names the three rules: Edit/Write+git for code,
    mcp__forgejo__* for issue/PR/comment ops, and never
    update_file / create_file / delete_file on the cloned repo.
  • Add a Prompt is too long / context_length_exceeded detector in
    src/worker.ts: when the SDK throws with that message, log a
    console.error pointing at the rule and append a hint to the stored
    error field so it surfaces in the task detail view.

What changed

  • skills/implement.md — Tool choice section after Workflow, before Git setup
  • skills/address-review.md — Tool choice section between Workflow and Rules
  • skills/rebase.md — Tool choice section between Workflow and Rules
  • skills/fix-ci.md — Tool choice section between Workflow and Rules
  • skills/implement-delta.md — Tool choice section at end
  • skills/address-review-delta.md — Tool choice section at end
  • src/worker.ts — detect prompt-too-long in processNext catch block,
    log actionable error, append hint to result.error

Test plan

  • No new unit tests (issue AC: "No new unit tests — this is a
    prompt-level rule"). Regression catch is operational.
  • just qa should pass unchanged — the worker.ts change only adds
    branches inside the existing catch block.
Closes #79. ## Summary - Add a canonical **Tool choice** section to all code-flow skills (`implement`, `address-review`, `rebase`, `fix-ci`) and their `-delta` variants (`implement-delta`, `address-review-delta`). The section names the three rules: Edit/Write+git for code, `mcp__forgejo__*` for issue/PR/comment ops, and **never** `update_file` / `create_file` / `delete_file` on the cloned repo. - Add a `Prompt is too long` / `context_length_exceeded` detector in `src/worker.ts`: when the SDK throws with that message, log a `console.error` pointing at the rule and append a hint to the stored `error` field so it surfaces in the task detail view. ## What changed - `skills/implement.md` — Tool choice section after Workflow, before Git setup - `skills/address-review.md` — Tool choice section between Workflow and Rules - `skills/rebase.md` — Tool choice section between Workflow and Rules - `skills/fix-ci.md` — Tool choice section between Workflow and Rules - `skills/implement-delta.md` — Tool choice section at end - `skills/address-review-delta.md` — Tool choice section at end - `src/worker.ts` — detect prompt-too-long in `processNext` catch block, log actionable error, append hint to `result.error` ## Test plan - No new unit tests (issue AC: "No new unit tests — this is a prompt-level rule"). Regression catch is operational. - `just qa` should pass unchanged — the `worker.ts` change only adds branches inside the existing catch block.
fix(ci): merge template literal + string concat into single template literal
All checks were successful
qa / qa (pull_request) Successful in 2m33s
qa / dockerfile (pull_request) Successful in 10s
a37b593d5e
Biome's `useTemplate` lint rule flags the two-part console.error arg
in processNext's catch block as an unsafe fix candidate. Merge into
one template literal to satisfy the linter.
dev requested review from reviewer 2026-04-19 08:38:54 +00:00
reviewer approved these changes 2026-04-19 08:39:43 +00:00
reviewer left a comment

Review: APPROVED

CI is green (success, run #1595, 2m44s). All acceptance criteria from #79 are met.

Checklist

Skills — Tool choice section

  • skills/implement.md — added after step 9 of the Workflow, before Git setup. Correct placement.
  • skills/address-review.md — added between Workflow and Rules.
  • skills/rebase.md — added between Workflow steps and Rules.
  • skills/fix-ci.md — added after Workflow, before Rules.
  • skills/implement-delta.md — added at end of the short skill file.
  • skills/address-review-delta.md — added at end of the short skill file.

The canonical paragraph is identical across all six files — exactly what the issue asked for.

Dashboard-visible failure mode

  • src/worker.tsisPromptTooLong regex /prompt is too long|context_length_exceeded/i catches both known Anthropic error variants. The console.error is actionable (names the skill rule and issue #79). The hint is appended to result.error so it surfaces in the task detail view.

Tests

  • No new unit tests required per issue AC.

Notes

The issue referenced src/agent-runner.ts / main.ts as the file to touch, but putting the detector in src/worker.ts's catch block is the right call — that's where the SDK error actually surfaces. No issue with this deviation.

Code is minimal, well-scoped, and does exactly what it says on the tin.

## Review: APPROVED ✅ CI is green (`success`, run #1595, 2m44s). All acceptance criteria from #79 are met. ### Checklist **Skills — Tool choice section** - ✅ `skills/implement.md` — added after step 9 of the Workflow, before Git setup. Correct placement. - ✅ `skills/address-review.md` — added between Workflow and Rules. - ✅ `skills/rebase.md` — added between Workflow steps and Rules. - ✅ `skills/fix-ci.md` — added after Workflow, before Rules. - ✅ `skills/implement-delta.md` — added at end of the short skill file. - ✅ `skills/address-review-delta.md` — added at end of the short skill file. The canonical paragraph is identical across all six files — exactly what the issue asked for. **Dashboard-visible failure mode** - ✅ `src/worker.ts` — `isPromptTooLong` regex `/prompt is too long|context_length_exceeded/i` catches both known Anthropic error variants. The `console.error` is actionable (names the skill rule and issue #79). The hint is appended to `result.error` so it surfaces in the task detail view. **Tests** - ✅ No new unit tests required per issue AC. ### Notes The issue referenced `src/agent-runner.ts` / `main.ts` as the file to touch, but putting the detector in `src/worker.ts`'s catch block is the right call — that's where the SDK error actually surfaces. No issue with this deviation. Code is minimal, well-scoped, and does exactly what it says on the tin.
code-lead deleted branch dev/79 2026-04-19 08:40:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!80
No description provided.