Skip to content

Add AGENTS.md agent guidance#52

Merged
glenn-jocher merged 3 commits into
mainfrom
agents-md
Jul 6, 2026
Merged

Add AGENTS.md agent guidance#52
glenn-jocher merged 3 commits into
mainfrom
agents-md

Conversation

@glenn-jocher

@glenn-jocher glenn-jocher commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds AGENTS.md (with CLAUDE.md as a relative symlink) documenting how AI coding agents should work in this repo: Core Principles, PR workflow, verified commands, architecture, and conventions. Every command, path, workflow trigger, and test name was checked against the actual repo files.

Details

  • AGENTS.md — Core Principles (Delete > Replace > Add), the standard Ultralytics PR workflow, plus repo-specific Commands / Architecture / Conventions kept short for this single-script utility. Facts verified against ci.yml (ubuntu-latest, Python 3.11, uv pip install, compileall, pytest -q, daily cron), format.yml, requirements.txt, flickr_scraper.py, utils/, and tests/.
  • CLAUDE.md — relative symlink to AGENTS.md (committed as mode 120000).
  • README audit — reviewed README.md; there is only one README (no translations). All install/run commands, flags (--search/--n/--download/--page/--key/--secret), the ./images/<search>/ output path, and the Compatibility Notes match the current code. No factual drift found, so no README changes were needed.

Notable verified gotcha captured in AGENTS.md: utils/clean_images.py imports OpenCV, which is not in requirements.txt.

Deleted: nothing — this PR only adds agent-guidance docs and a symlink; there is no prior agent-guidance file or duplicated content to remove or consolidate.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Adds AI-agent contribution guidance for ultralytics/flickr_scraper, plus a CLAUDE.md symlink for Claude Code compatibility 🤖

📊 Key Changes

  • Added a new AGENTS.md file documenting repository-specific rules, workflow, commands, architecture, and conventions 📘
  • Introduced strict agent editing principles focused on deleting or consolidating code before adding new logic 🧹
  • Defined PR workflow expectations, including automated formatting, adversarial review, rebasing, and cleanup steps 🔁
  • Documented common development commands for installing dependencies, running tests, compiling files, and executing the scraper 🛠️
  • Summarized repository architecture, including flickr_scraper.py, shared utilities, standalone scripts, and test behavior 🧪
  • Added CLAUDE.md as a symlink to AGENTS.md for Claude Code and compatible AI tooling 🔗

🎯 Purpose & Impact

  • Helps AI coding agents make safer, more maintainable changes by following clear repository rules ✅
  • Reduces code bloat by emphasizing deletion, reuse, and consolidation over adding guards or duplicate helpers 📉
  • Improves PR quality through documented review gates and validation expectations 🚦
  • Makes onboarding easier for contributors and automated agents by centralizing commands, architecture, and conventions 🚀
  • Supports Claude Code workflows without duplicating documentation, keeping guidance consistent across tools 🤝

@UltralyticsAssistant UltralyticsAssistant added devops GitHub Devops or MLops documentation Improvements or additions to documentation labels Jul 6, 2026
@UltralyticsAssistant

Copy link
Copy Markdown
Member

👋 Hello @glenn-jocher, thank you for submitting a ultralytics/flickr_scraper 🚀 PR! This automated message is here to help ensure a seamless integration of your work, and an Ultralytics engineer will assist with review.

  • Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • Synchronize with Source: Confirm your PR is synchronized with the ultralytics/flickr_scraper main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • Update Documentation: Update the relevant documentation for any new or modified features.
  • Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔍 PR Review

Made with ❤️ by Ultralytics Actions

The guidance file is generally useful and matches the repo structure/CI details, but two documentation/process issues need attention: the PR body does not satisfy the newly introduced Deleted: gate, and the license-header convention is currently overbroad for Markdown files in this repo.

💬 Posted 2 inline comments

Comment thread AGENTS.md
3. **Search the repo before creating anything.** Before building a helper, search the whole repo — it likely exists (`utils/general.py` holds the shared helpers). If two scripts grow the same logic, consolidate into `utils/` and delete the duplicates. Avoid premature abstraction — three similar lines beat a helper nobody else calls.
4. **Deletion beats caution.** Zero regression means understanding the code you remove, not leaving it in place as insurance. Keeping broken or duplicated code "to be safe" is itself the regression: it is how repos rot. All changes must still ship debugged, validated, and production ready.

**Output gate:** every PR body must contain a `Deleted:` line naming the code removed (functions, branches, files, config). Features must name what they reused or consolidated. `Deleted: nothing` demands the rule-2 justification.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 MEDIUM: This PR introduces a hard output gate requiring every PR body to include a Deleted: line, but the current PR body in the description does not include one. Please update the PR body to satisfy the new gate, or this change blocks its own merge criteria.

Comment thread AGENTS.md Outdated

## Conventions

- Every file starts with `# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license` — Ultralytics Actions adds headers automatically; don't add or revert them manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

📝 LOW: This convention is too broad for the repository as-is: README.md does not start with the Ultralytics license header, and this new AGENTS.md also starts with # AGENTS.md. As written, future agents may try to add headers to Markdown files that intentionally do not have them. Please scope this to the file types where the convention actually applies.

Suggested change:

Suggested change
- Every file starts with `# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license` — Ultralytics Actions adds headers automatically; don't add or revert them manually.
- Python and workflow files start with `# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license` — Ultralytics Actions adds headers automatically; don't add or revert them manually.

@glenn-jocher glenn-jocher merged commit 882eb30 into main Jul 6, 2026
5 checks passed
@glenn-jocher glenn-jocher deleted the agents-md branch July 6, 2026 10:13
@UltralyticsAssistant

Copy link
Copy Markdown
Member

🚀 Merged — thank you @glenn-jocher!

“Give me six hours to chop down a tree and I will spend the first four sharpening the axe.” — Abraham Lincoln

This PR sharpens the tools for everyone working in ultralytics/flickr_scraper by adding clear AI-agent guidance, streamlined workflow expectations, repository architecture notes, and Claude Code compatibility through CLAUDE.md. These updates will help contributors and automated agents make safer, cleaner, and more maintainable changes with less duplication and more confidence.

Appreciate the thoughtful improvement to contributor experience and long-term project quality!

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

Labels

devops GitHub Devops or MLops documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants