Skip to content

[CLAUDE.md] State agent guidance by intent, not by enumerated edge cases - #202334

Open
ezyang wants to merge 2 commits into
gh/ezyang/3634/basefrom
gh/ezyang/3634/head
Open

ezyang wants to merge 2 commits into
gh/ezyang/3634/basefrom
gh/ezyang/3634/head

Conversation

@ezyang

@ezyang ezyang commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Rules in CLAUDE.md, skills and REVIEW.md files are applied literally by
agents. When a rule tries to settle its edge cases with lists of paths,
exemptions or hard limits, each entry is a factual claim that can be
wrong or go stale, and every gap or counterexample then reads as a
defect. On #202251 this led to a string of review rounds, each adding a
more specific exemption that the next round found a counterexample to,
until the rule was cut down to a short one.

Add an "Agent Guidance" section to CLAUDE.md asking agents that add or
rewrite instructions for agents to keep them short and state the intent,
spelling out only the edge cases that are known pitfalls. It sits in its
own section rather than in Coding Style Guidelines, which covers code
changes.

Update the skill-writer skill to match: its skeleton template asked for
an "edge cases" step and its validation checklist for "edge cases
handled". Drop the template step (the template's best practices already
list common pitfalls) and make both of its validation checklists ask for
stated intent, with edge cases only for known pitfalls.

This only changes guidance for authors. The pr-review skill's own rules
are unchanged: changing what the automated reviewer flags needs a
maintainer's explicit approval and belongs in a separate PR.

Test Plan: documentation-only change. Checked the other agent guidance
that mentions edge cases for conflicts with the new rule:

git grep -n -i "edge case" -- CLAUDE.md '*REVIEW.md' .agents

This PR was authored with the help of an AI assistant (Claude).

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 28, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - Ready for human review:

This PR adds an "Agent Guidance" section to CLAUDE.md asking agents who write
instructions for other agents to keep them short, state the intent, and spell
out only the edge cases that are known pitfalls. It also updates the
skill-writer skill to match, and the review found no issues. Recommendation:
Approve.

Reviewed commit: e4f3898

Review run

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/202334

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit e4f3898 with merge base 33ce05e (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - PR requires human review:

  • Never trivial: adds a project-level rule
    • CLAUDE.md gains an # Agent Guidance section setting a new rule for how agent instructions in the repo are written
    • Documentation that adds a rule or states project policy is on the never-trivial list, whatever its size
  • Steering of later agents
    • .agents/skills/skill-writer/SKILL.md drops the template's edge-case step and rewrites both validation checklists
    • Changing what the skill-writer skill produces affects every future skill, so a human should sign off on it
  • Open review state
    • Dr. CI's status comment in the PR metadata reports that a maintainer requested changes on this PR

reason: not_trivial
Reviewed commit: e4f3898

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorchgreenlight pytorchgreenlight Bot added the GL/human GreenLight marked as needing human review label Oct 28, 2026
@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Oct 28, 2026
github-actions[bot]

This comment was marked as outdated.

…ll-writer checklist update

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Oct 29, 2026
Rules in CLAUDE.md, skills and REVIEW.md files are applied literally by
agents. When a rule tries to settle its edge cases with lists of paths,
exemptions or hard limits, each entry is a factual claim that can be
wrong or go stale, and every gap or counterexample then reads as a
defect. On #202251 this led to a string of review rounds, each adding a
more specific exemption that the next round found a counterexample to,
until the rule was cut down to a short one.

Add an "Agent Guidance" section to CLAUDE.md asking agents that add or
rewrite instructions for agents to keep them short and state the intent,
spelling out only the edge cases that are known pitfalls. It sits in its
own section rather than in Coding Style Guidelines, which covers code
changes.

Update the skill-writer skill to match: its skeleton template asked for
an "edge cases" step and its validation checklist for "edge cases
handled". Drop the template step (the template's best practices already
list common pitfalls) and make both of its validation checklists ask for
stated intent, with edge cases only for known pitfalls.

This only changes guidance for authors. The pr-review skill's own rules
are unchanged: changing what the automated reviewer flags needs a
maintainer's explicit approval and belongs in a separate PR.

Test Plan: documentation-only change. Checked the other agent guidance
that mentions edge cases for conflicts with the new rule:

```
git grep -n -i "edge case" -- CLAUDE.md '*REVIEW.md' .agents
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: ffacba2
Pull-Request: #202334

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review of e4f3898: nothing blocking; ready for human review.

This PR adds an "Agent Guidance" section to CLAUDE.md asking agents who write instructions for other agents to keep them short, state the intent, and spell out only the edge cases that are known pitfalls. It also updates the skill-writer skill to match, and the review found no issues. Recommendation: Approve.

This review is AI-generated and advisory. Each new automated review replaces the previous one.

@github-actions
github-actions Bot dismissed their stale review October 29, 2026 18:57

Withdrawn: the automated review of e4f3898 found nothing blocking.

@pytorch-bot pytorch-bot Bot added ready for review Automated review passed, ready for a final review by a maintainer. and removed in progress PR is being worked on by the author, until the automated review accepts it labels Oct 29, 2026

@albanD albanD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds very fair

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GL/human GreenLight marked as needing human review ready for review Automated review passed, ready for a final review by a maintainer. release notes: devx topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants