Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .agents/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
# `.agents/` — agent-agnostic source of truth
# `.agents/` — agent compatibility and shared config

This directory is the canonical location for assets shared by AI coding agents
working in this repository (Claude Code, Codex, Cursor, …).
This directory exposes the ModelOpt plugin skills to repository-local agents
and holds shared configuration.

## Layout

```text
.agents/
├── skills/ # SKILL.md files (canonical)
│ └── <skill-name>/SKILL.md
├── skills → ../plugins/modelopt/skills
├── plugins/
│ └── marketplace.json # Codex marketplace
├── scripts/ # shared helper scripts (sync-upstream-skills.sh, …)
└── clusters.yaml.example # remote-cluster config template

plugins/modelopt/
├── .claude-plugin/
├── .codex-plugin/
└── skills/ # canonical SKILL.md files
├── common/ # shared skill support files
└── <skill-name>/SKILL.md
```

## Why this exists

Different agents look for skills/config in vendor-specific directories. Rather
than maintaining N copies that drift out of sync, **`.agents/` is the single
source of truth** — each agent's guidance or install mechanism points here
directly.
The installable plugin owns its skills, as required by the plugin format.
Repository-local agent discovery uses relative symlinks to the same files.

## How each agent finds these

Each agent points at `.agents/` through whatever mechanism it supports — never
a copy:

- **Claude Code** only auto-discovers skills under `.claude/skills/`, so
`.claude/` holds relative in-repo symlinks back into `.agents/`:
`.claude/skills → ../.agents/skills`, `.claude/scripts → ../.agents/scripts`,
and `.claude/clusters.yaml.example → ../.agents/clusters.yaml.example`. These
follow the same committed-symlink pattern already used elsewhere in this repo
(e.g. `CLAUDE.md`, `tools/launcher/modules/Model-Optimizer`).
- **Future agents** (Codex, Cursor, …) add their own symlink or config pointing
at `.agents/`.
`.claude/skills/` holds relative symlinks into `.agents/skills/`.
- **Repository agents** use `.agents/skills`, a relative symlink into the
plugin.
- **Claude Code and Codex plugins** load `plugins/modelopt/skills` directly.

## Editing rules

- **Always edit files under `.agents/`**.
- **Always edit skills under `plugins/modelopt/skills/`**.
- Vendored-verbatim skills (`launching-evals`, `accessing-mlflow`) are managed
by `.agents/scripts/sync-upstream-skills.sh` — do not modify by hand.
- New skills go in `.agents/skills/<skill-name>/SKILL.md` following the
conventions of existing skills (e.g. `.agents/skills/monitor/SKILL.md`).
- New skills go in `plugins/modelopt/skills/<skill-name>/SKILL.md`.
- Shared support files go in `plugins/modelopt/skills/common/`.

## Project-level cluster config

Expand Down
5 changes: 5 additions & 0 deletions .agents/TOOLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ of the always-loaded agent instructions.
Update `AGENTS.md` for repository-wide agent instructions. `CLAUDE.md` is
symlinked to `AGENTS.md`, so changes there apply to both Codex and Claude Code.

## Installable Skills

The `modelopt` plugin packages the repository skills for use from any
workspace. Installation commands are in the [README](../README.md#ai-agents).

## Local Overrides

For private local instructions, use the tool-specific override file:
Expand Down
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "modelopt",
"interface": {
"displayName": "NVIDIA Model Optimizer"
},
"plugins": [
{
"name": "modelopt",
"source": {
"source": "local",
"path": "./plugins/modelopt"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
5 changes: 3 additions & 2 deletions .agents/scripts/sync-upstream-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
#
# Requires: gh, base64, awk. Run from the repo root.
#
# The script overwrites .agents/skills/<skill>/ with upstream contents and
# The script overwrites plugins/modelopt/skills/<skill>/ through the
# .agents/skills compatibility symlink and
# re-applies our provenance lines into each SKILL.md frontmatter. If you have
# local changes to a vendored skill, they will be lost — that is expected,
# since vendored-verbatim skills should not be modified locally.
#
# Note: .claude/skills/ (and other agent-specific skill dirs) are symlinks to
# .agents/skills/ — see .agents/README.md.
# plugins/modelopt/skills/ — see .agents/README.md.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .agents/skills
21 changes: 21 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://json.schemastore.org/claude-code-marketplace.json",
"name": "modelopt",
"version": "0.1.0",
"description": "Model Optimizer agent plugins.",
"owner": {
"name": "NVIDIA Corporation"
},
"plugins": [
{
"name": "modelopt",
"source": "./plugins/modelopt",
"description": "Skills for Model Optimizer development, quantization, deployment, and evaluation.",
"version": "0.1.0",
"author": {
"name": "NVIDIA Corporation"
},
"category": "development"
}
]
}
4 changes: 2 additions & 2 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ config:
# Vendored upstream skills — kept byte-identical to upstream via
# .agents/scripts/sync-upstream-skills.sh; do not reformat.
ignores:
- ".agents/skills/launching-evals/**"
- ".agents/skills/accessing-mlflow/**"
- "plugins/modelopt/skills/launching-evals/**"
- "plugins/modelopt/skills/accessing-mlflow/**"
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ repos:
exclude: ^modelopt_recipes/configs/

- id: sync-claude-skills
name: sync .claude/skills/ symlinks from .agents/skills/
name: sync .claude/skills/ symlinks from plugin skills
entry: bash tools/precommit/sync_claude_skills.sh
language: system
files: ^\.agents/skills/
files: ^plugins/modelopt/skills/
pass_filenames: false

- id: check-launcher-yaml
Expand Down
10 changes: 4 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ These instructions apply to AI-assisted work in this repository.
- 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.
- **Agent skills live under `plugins/modelopt/skills/`**, the installable
plugin's canonical skill tree. `.agents/skills` and `.claude/skills` expose
those skills through relative symlinks. Shared agent config and scripts
remain under `.agents/`. See `.agents/README.md` for the convention.

## Coding guidelines

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,25 @@ Please read our [Contributing](./CONTRIBUTING.md) guidelines for details on how

## AI Agents

For AI-assisted development setup, see the [agent tooling notes](./.agents/TOOLING.md).
ModelOpt's agent skills can be installed from this repository and used in any
workspace.

### Claude Code

```bash
claude plugin marketplace add https://github.com/NVIDIA/Model-Optimizer.git
claude plugin install modelopt@modelopt
```

### Codex

```bash
codex plugin marketplace add https://github.com/NVIDIA/Model-Optimizer.git
```

Then open `/plugins`, select the `modelopt` marketplace, and install `modelopt`.
Contributors can also use the skills directly from a checkout. See the
[agent tooling notes](./.agents/TOOLING.md).

### Top Contributors

Expand Down
20 changes: 20 additions & 0 deletions plugins/modelopt/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "modelopt",
"displayName": "ModelOpt",
"version": "0.1.0",
"description": "Skills for Model Optimizer development, quantization, deployment, and evaluation.",
"author": {
"name": "NVIDIA Corporation"
},
"homepage": "https://github.com/NVIDIA/Model-Optimizer",
"repository": "https://github.com/NVIDIA/Model-Optimizer",
"license": "Apache-2.0",
"keywords": [
"modelopt",
"quantization",
"evaluation",
"deployment",
"llm"
]
}
37 changes: 37 additions & 0 deletions plugins/modelopt/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "modelopt",
"version": "0.1.0",
"description": "Skills for Model Optimizer development, quantization, deployment, and evaluation.",
"author": {
"name": "NVIDIA Corporation",
"url": "https://github.com/NVIDIA/Model-Optimizer"
},
"homepage": "https://github.com/NVIDIA/Model-Optimizer",
"repository": "https://github.com/NVIDIA/Model-Optimizer",
"license": "Apache-2.0",
"keywords": [
"modelopt",
"quantization",
"evaluation",
"deployment",
"llm"
],
"skills": "./skills/",
"interface": {
"displayName": "ModelOpt",
"shortDescription": "Optimize, deploy, and evaluate models.",
"longDescription": "Provides Model Optimizer workflows for post-training quantization, deployment, evaluation, result comparison, and release validation.",
"developerName": "NVIDIA",
"category": "Developer Tools",
"capabilities": [
"Interactive",
"Write"
],
"defaultPrompt": [
"Quantize this model with ModelOpt.",
"Deploy and evaluate this checkpoint.",
"Compare the baseline and quantized results."
],
"brandColor": "#76B900"
}
}
10 changes: 10 additions & 0 deletions plugins/modelopt/skills/common/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: common
description: Shared ModelOpt support files. Use only when another ModelOpt skill directs you here.
---

# Shared ModelOpt Support

This skill is a placeholder required for Codex plugin validation.

Read only the file named by the calling ModelOpt skill.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ extend-ignore = [
"examples/*" = ["D"]
"noxfile.py" = ["D", "E501"]
"tests/*" = ["B017", "D", "E402", "PT012"]
".agents/skills/*/tests/test_*.py" = ["D", "E402"] # Skill test scripts: docstring (D) + sys.path import-order (E402) exemptions
"plugins/modelopt/skills/*/tests/test_*.py" = ["D", "E402"] # Skill test scripts: docstring (D) + sys.path import-order (E402) exemptions
"*/_[a-zA-Z]*" = ["D"] # Private packages (_abc/*.py) or modules (_xyz.py)
"*.ipynb" = ["D", "E501"] # Ignore missing docstrings or line length for Jupyter notebooks
"modelopt/torch/kernels/*" = ["N803", "N806", "E731"] # triton style
Expand Down
Loading