fix(agents): point a trimming workflow to its audit #224

Merged
claudiomaradonna merged 1 commit from fix/trim-opening-step into main 2026-11-12 20:26:43 +01:00
Collaborator

Why

Agent Foundry gives coding agents their rules in AGENTS.md and their
procedures as skills, and routes each request to one workflow skill. A
change that shortens those rules, a trim, should first get a
documentation audit, which the implement-feature workflow's first step
saves. When the request goes to another workflow, such as fix-bug for
a defect in a skill, the agent read nothing on its way that sent it to
that step, so the trim could go through its work unaudited. The one
pointer left, since 612d6b6 moved the rule out of AGENTS.md, was the
last clause of implement-feature's description.

Pointers in the opening steps of fix-bug, document-feature, and
refactor-code were set aside, as three places to keep alike. A step in
run-change was set aside, since it runs after the opening step the
audit must precede.

Closes #220

What changed

Before, an agent routed to fix-bug with a change that trims a skill
went straight to the diagnosis. Now the routing rule of AGENTS.md
tells it to keep its route and first run implement-feature step 1. A
change that trims nothing meets no new duty, and the rule's body stays
in implement-feature.

Before, the upgrade migration that moved the old rule applied while
AGENTS.md held "the Workflows bullets on a trim or upgrade", which the
new sentence could be taken for at every later upgrade. Now it names
the old bullet as a bullet of its own that the routing sentence
replaces, and sends a repository's own additions to the kinds a trim
covers to that sentence too.

The changes are in the first bullet of AGENTS.md § Workflows and in
the migration Workflow start points in skills of UPGRADING.md, whose
paragraph Prettier rewrapped; git diff --word-diff shows the wording
alone.

How to verify

  1. Have Git and a clone of this repository, with git fetch origin.

  2. The problem. On main, neither the rules nor the defect workflow
    name a trim:

    git grep -c 'first runs' origin/main -- AGENTS.md
    git grep -c 'trim' origin/main -- .agents/skills/fix-bug/SKILL.md
    

    Both print nothing.

  3. The solution. On the branch,

    git grep -n 'first runs' origin/fix/trim-opening-step -- AGENTS.md
    

    prints line 327 of AGENTS.md, "skill, a template, or a subagent
    brief keeps its route and first runs", the sentence to read with the
    lines around it.

The checks of docs/MAINTENANCE.md pass on the tip. No test reads the
routing rule, so the change adds none.

Not tried: an agent in a trial repository asked to fix a defect in a
skill by trimming it, on main and on the branch, and the behavioral
evals that docs/MAINTENANCE.md has the maintainer run before merging
a change to AGENTS.md; both need billed sessions outside the sandbox.

Considerations

The sentence repeats the kinds a trim covers, which implement-feature
also holds, so that an agent can tell at routing time whether the rule
concerns its change. AGENTS.md still leaves the word trim undefined,
as the old bullet did; a reviewer's finding on it was set aside as a
decision of its own.

## Why Agent Foundry gives coding agents their rules in `AGENTS.md` and their procedures as skills, and routes each request to one workflow skill. A change that shortens those rules, a trim, should first get a documentation audit, which the `implement-feature` workflow's first step saves. When the request goes to another workflow, such as `fix-bug` for a defect in a skill, the agent read nothing on its way that sent it to that step, so the trim could go through its work unaudited. The one pointer left, since 612d6b6 moved the rule out of `AGENTS.md`, was the last clause of `implement-feature`'s description. Pointers in the opening steps of `fix-bug`, `document-feature`, and `refactor-code` were set aside, as three places to keep alike. A step in `run-change` was set aside, since it runs after the opening step the audit must precede. Closes #220 ## What changed Before, an agent routed to `fix-bug` with a change that trims a skill went straight to the diagnosis. Now the routing rule of `AGENTS.md` tells it to keep its route and first run `implement-feature` step 1. A change that trims nothing meets no new duty, and the rule's body stays in `implement-feature`. Before, the upgrade migration that moved the old rule applied while `AGENTS.md` held "the Workflows bullets on a trim or upgrade", which the new sentence could be taken for at every later upgrade. Now it names the old bullet as a bullet of its own that the routing sentence replaces, and sends a repository's own additions to the kinds a trim covers to that sentence too. The changes are in the first bullet of `AGENTS.md` § Workflows and in the migration Workflow start points in skills of `UPGRADING.md`, whose paragraph Prettier rewrapped; `git diff --word-diff` shows the wording alone. ## How to verify 1. Have Git and a clone of this repository, with `git fetch origin`. 2. The problem. On `main`, neither the rules nor the defect workflow name a trim: ```bash git grep -c 'first runs' origin/main -- AGENTS.md git grep -c 'trim' origin/main -- .agents/skills/fix-bug/SKILL.md ``` Both print nothing. 3. The solution. On the branch, ```bash git grep -n 'first runs' origin/fix/trim-opening-step -- AGENTS.md ``` prints line 327 of `AGENTS.md`, "skill, a template, or a subagent brief keeps its route and first runs", the sentence to read with the lines around it. The checks of `docs/MAINTENANCE.md` pass on the tip. No test reads the routing rule, so the change adds none. Not tried: an agent in a trial repository asked to fix a defect in a skill by trimming it, on `main` and on the branch, and the behavioral evals that `docs/MAINTENANCE.md` has the maintainer run before merging a change to `AGENTS.md`; both need billed sessions outside the sandbox. ## Considerations The sentence repeats the kinds a trim covers, which `implement-feature` also holds, so that an agent can tell at routing time whether the rule concerns its change. `AGENTS.md` still leaves the word trim undefined, as the old bullet did; a reviewer's finding on it was set aside as a decision of its own.
fix(agents): point a trimming workflow to its audit
All checks were successful
Maintenance / checks (pull_request) Successful in 4m32s
Maintenance / checks (push) Successful in 3m59s
725055a1f3
Since 612d6b6 the rule that a workflow whose change is also a trim
first runs implement-feature step 1 was reachable only from the end of
that skill's description, so an agent routed to fix-bug could skip the
audit. The pointer is a sentence of the routing bullet rather than a
bullet of its own, and the migration that moved the old bullet now
tells the two apart; Prettier rewraps the rest of its paragraph.

Refs: #220
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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
claudiomaradonna/agent-foundry!224
No description provided.