Skip to content

AI: Tell agents to preserve generated code unless relevant changes#34970

Merged
valentinpalkovic merged 1 commit into
nextfrom
sidnioulz/preserve-generated-code
May 29, 2026
Merged

AI: Tell agents to preserve generated code unless relevant changes#34970
valentinpalkovic merged 1 commit into
nextfrom
sidnioulz/preserve-generated-code

Conversation

@Sidnioulz
Copy link
Copy Markdown
Contributor

@Sidnioulz Sidnioulz commented May 29, 2026

What I did

Told agents to stop mutating files like code/core/src/manager/globals/exports.ts unintentionally. Those should be handled by us if they become flaky, to avoid noise on dozens of PRs.

Checklist for Contributors

Testing

ø

Manual testing

Run agent workflows from this branch and check if SupportedFramework keeps getting added/removed from code/core/src/manager/globals/exports.ts.

Documentation

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts IRRELEVANT

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Documentation
    • Added a "Code Authoring Principles" note advising automated agents to avoid accidental overrides of generated files and to flag such files in pull requests when changes aren't part of the work.

Note: This release contains no user-facing changes.

Review Change Stack

Copilot AI review requested due to automatic review settings May 29, 2026 08:59
@Sidnioulz Sidnioulz added the build Internal-facing build tooling & test updates label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Fails
🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

Generated by 🚫 dangerJS against 5a10925

@Sidnioulz Sidnioulz force-pushed the sidnioulz/preserve-generated-code branch from d73228a to 0992cbf Compare May 29, 2026 09:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 543733d9-eb42-4220-8f08-4b166da8cca9

📥 Commits

Reviewing files that changed from the base of the PR and between d73228a and 5a10925.

📒 Files selected for processing (1)
  • AGENTS.md
✅ Files skipped from review due to trivial changes (1)
  • AGENTS.md

📝 Walkthrough

Walkthrough

Updates AGENTS.md by adding a new "Code Authoring Principles" bullet that warns agents not to commit accidental overrides to generated code files and to flag flaky generated files in the PR description.

Changes

Agent Documentation Updates

Layer / File(s) Summary
Code authoring principle
AGENTS.md
Adds a new bullet instructing agents not to commit accidental overrides to generated code files (e.g., code/core/src/manager/globals/exports.ts) unless the changes match the PR, and to flag flaky generated files in the PR description.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs


Comment @coderabbitai help to get the list of available commands and usage tips.

@Sidnioulz Sidnioulz force-pushed the sidnioulz/preserve-generated-code branch from 0992cbf to 5a10925 Compare May 29, 2026 09:02
@Sidnioulz Sidnioulz changed the title Tell agents to preserve generated code unless relevant changes AI: Tell agents to preserve generated code unless relevant changes May 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an explicit instruction to AGENTS.md telling agents not to commit accidental overrides of generated files (e.g., code/core/src/manager/globals/exports.ts), and slightly widens the Environment Variables table to accommodate the existing FIX_ON_COMMIT row.

Changes:

  • Add a new Review Self-Check bullet warning against committing accidental changes to generated files.
  • Reformat the Environment Variables table column widths for alignment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@valentinpalkovic valentinpalkovic merged commit 7880945 into next May 29, 2026
10 of 13 checks passed
@valentinpalkovic valentinpalkovic deleted the sidnioulz/preserve-generated-code branch May 29, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants