Files
Model-Optimizer/AGENTS.md
T
bdb793a42d [SKILL.md Chore] Make .agents/ the canonical agent-skills location (#1362)
### What does this PR do?

Type of change: documentation / repo housekeeping

Centralize agent-shared assets under **`.agents/`** as the single,
agent-agnostic source of truth, so the same `SKILL.md` (plus shared
scripts and cluster config) works across every coding agent without
maintaining N copies that drift out of sync. Claude Code discovers
skills only under `.claude/skills/`, so `.claude/` holds **relative
in-repo symlinks** into `.agents/` for back-compat.

```bash
repo-root/
├── .agents/                      ← canonical source of truth
│   ├── README.md
│   ├── clusters.yaml.example
│   ├── scripts/
│   │   └── sync-upstream-skills.sh
│   └── skills/
│       ├── accessing-mlflow/      compare-results/     debug/
│       ├── deployment/            eagle3-new-model/    eagle3-review-logs/
│       ├── eagle3-triage/         eagle3-validate/     evaluation/
│       ├── launching-evals/       monitor/             ptq/
│       ├── quant-recipe-search/   release-cherry-pick/ common/
│
├── .claude/                      ← back-compat (relative symlinks)
│   ├── clusters.yaml.example  →  ../.agents/clusters.yaml.example
│   ├── scripts                →  ../.agents/scripts
│   └── skills                 →  ../.agents/skills
│
└── (future agents — add a symlink/config, no copies)
    ├── .codex/skills           →  ../.agents/skills
    └── .cursor/skills          →  ../.agents/skills
```

### Why symlinks (and not "just point each agent's config at
`.agents/`")

Claude Code **only** auto-discovers project skills under
`.claude/skills/` — there is no setting/env var to redirect discovery to
an arbitrary path, and the plugin route would require committing a
`.claude/settings.json` + marketplace manifest, add a first-open
workspace-trust gate (breaks headless/CI runs), and namespace every
skill (`/ptq` → `/<plugin>:ptq`). A single relative in-repo symlink is
the smallest change that keeps `.agents/` canonical while satisfying
Claude Code's discovery requirement. This repo already commits relative
symlinks (`CLAUDE.md`, `tools/launcher/modules/Model-Optimizer`). See
the discussion thread for the full comparison.

### Changes

- Move `.claude/{skills,scripts,clusters.yaml.example}` → `.agents/`
(git renames preserve history).
- Add `.agents/README.md` documenting the convention and per-agent
wiring.
- Re-add `.claude/skills`, `.claude/scripts`,
`.claude/clusters.yaml.example` as relative symlinks into `.agents/`.
- Update internal path references and lint/sync config from `.claude/`
to `.agents/` (upstream provenance paths and `.claude/clusters.yaml`
back-compat lookups left intact).
- **Merged latest `main`** and folded in skills added there since branch
time — `compare-results`, `eagle3-new-model`, `eagle3-triage`,
`eagle3-review-logs`, `eagle3-validate`, `quant-recipe-search`, and new
`evaluation` recipes/tasks/references — into `.agents/skills/`.
- `main` converted `CLAUDE.md` into a symlink to a new agent-agnostic
`AGENTS.md`; this PR keeps that and moves the "skills live in
`.agents/`" guidance into `AGENTS.md`.

### Testing

- `.claude/skills` symlink resolves to all 15 skills; `ls
.claude/skills` and `ls .agents/skills` match.
- `pre-commit run check-symlinks --all-files` and `markdownlint-cli2
--all-files` pass.
- `bash -n` clean on `sync-upstream-skills.sh` and `remote_exec.sh`.
- `.claude/skills`, `.claude/scripts`, `.claude/clusters.yaml.example`,
and `CLAUDE.md` are all recorded as git symlinks (mode `120000`).

### Before your PR is "*Ready for review*"

Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)
and your commits are signed (`git commit -s -S`).

Make sure you read and follow the [Security Best
Practices](https://github.com/NVIDIA/Model-Optimizer/blob/main/SECURITY.md#security-coding-practices-for-contributors).

- Is this change backward compatible?: ✅ `.claude/skills/`,
`.claude/scripts/`, and `.claude/clusters.yaml.example` continue to
resolve to the same content via symlinks; Claude Code auto-discovery is
unaffected; `remote_exec.sh` still accepts `.claude/clusters.yaml`.
- Did you write any new necessary tests?: N/A — directory move with
symlinks; verified as listed above.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A — repo housekeeping only, no API/feature/bugfix change.

### Additional Information

- A few vendored skill files still carry internal details (Slurm account
names, lustre paths, internal `:5005` GitLab registry advice in
`launching-evals/`) worth scrubbing in a follow-up.

---------

Signed-off-by: Seonghee Lee <seongheel@nvidia.com>
Signed-off-by: Zhiyu Cheng <zhiyuc@nvidia.com>
Co-authored-by: Shengliang Xu <106840466+shengliangxu@users.noreply.github.com>
Co-authored-by: Zhiyu Cheng <zhiyuc@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 16:12:19 -07:00

2.1 KiB

Agent Instructions for ModelOpt

These instructions apply to AI-assisted work in this repository.

Repository orientation

  • Start with README.md for project overview and install.
  • Use modelopt/ for source, tests/ for focused test coverage, and examples/ or docs/ for usage patterns.
  • Agent skills and shared config live under .agents/ — the canonical, agent-agnostic source of truth (.agents/skills/<name>/SKILL.md, .agents/scripts/, .agents/clusters.yaml.example). Claude Code's .claude/skills, .claude/scripts, and .claude/clusters.yaml.example are relative symlinks into .agents/. Always edit files under .agents/, not the symlink path. See .agents/README.md for the convention.

Coding guidelines

  • Coding guide: Code development and review require reading and following the coding standards in CONTRIBUTING.md; do not skip this step.
  • Use relative paths from the repo root in commands and file references.

Iterative development

  • Running tests: Follow the writing and running tests instructions. For fast initial iteration, choose focused tests for the changed area from tests/.
  • Running pre-commit: Follow the pre-commit hook instructions. Hooks may modify files; review and re-stage those changes before committing.
  • Signed commit: Use git commit -s -S -m "<message>" for commits so they follow the signing your work requirements.
  • Never git push without explicit approval in the current turn. Commit locally is fine; publishing to a remote is not.
  • After git commit, stop and wait for the user to say "push", "publish", "ship", or equivalent before running git push, gh pr create, or any push-option flags like -o merge_request.create.

Contributing and PR readiness

  • Before opening or marking a PR ready for review, read the submitting your code guidance.
  • Read .github/PULL_REQUEST_TEMPLATE.md and satisfy the checklist.