Skip to content

Commit cbd664c

Browse files
committed
chore(ci): update agent configurations
- semi-standard hooks config `.agents/hooks.json` - semi-standard mcp config `.agents/mcp.json` - adjusted `.codex/config.toml` to enable hooks support. - added `.cursor/hooks.json` for cursor hooks support Signed-off-by: Cory Rylan <crylan@nvidia.com>
1 parent ce02646 commit cbd664c

11 files changed

Lines changed: 149 additions & 108 deletions

File tree

.agents/README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
# Agents
22

3-
https://agentskills.io/
3+
Repository leveraged agent harness features. The `.agents` directory is the source of truth. Agent-specific directories keep only local config and relative symlinks into this directory.
44

5-
Common skills and hooks shared across agent platforms. Symlinks are source controlled by default.
5+
## Features
66

7-
```shell
8-
# symlink skills
9-
ln -sfn ../.agents/skills .claude/skills
7+
Legend: ✅ supported | ⚠️ non-standard | ❌ blocked | ➖ not applicable
108

11-
# hooks
12-
# .claude/settings.json references .agents/hooks directly
13-
# .codex/config.toml enables hooks and .codex/hooks.json references .agents/hooks
14-
# Hooks resolve the project root from AGENTS_PROJECT_DIR, agent-specific env vars,
15-
# hook JSON cwd fields, the hook script location, or git.
9+
| Feature | Claude Code | Codex | Cursor | Open Code | Pi |
10+
| --- | --- | --- | --- | --- | --- |
11+
| **AGENTS.md** | ⚠️ [issue](https://github.com/anthropics/claude-code/issues/6235) - `CLAUDE.md` (symlink) |[docs](https://developers.openai.com/codex/guides/agents-md) |[docs](https://cursor.com/docs/rules) |[docs](https://opencode.ai/docs/rules/) |[docs](https://pi.dev/docs/latest/usage#context-files) |
12+
| **.agents/skills** | ⚠️ [issue](https://github.com/anthropics/claude-code/issues/31005) - `.claude/skills` (symlink) |[docs](https://developers.openai.com/codex/skills) |[docs](https://cursor.com/docs/skills) |[docs](https://opencode.ai/docs/skills) |[docs](https://pi.dev/docs/latest/skills) |
13+
| **.agents/mcp.json** | ⚠️ [docs](https://code.claude.com/docs/en/mcp) - `.mcp.json` (symlink) | ⚠️ [docs](https://developers.openai.com/codex/mcp) - `.codex/config.toml` | ⚠️ [docs](https://cursor.com/docs/mcp) - `.cursor/mcp.json` (symlink) |[extension](https://opencode.ai/docs/plugins/) |[extension](https://pi.dev/docs/latest/extensions) |
14+
| **.agents/hooks.json** | ⚠️ [docs](https://code.claude.com/docs/en/hooks) - `.claude/settings.json` | ⚠️ [docs](https://developers.openai.com/codex/hooks) - `.codex/hooks.json` (symlink) | ⚠️ [docs](https://cursor.com/docs/hooks) - `.cursor/hooks.json` |[extension](https://opencode.ai/docs/plugins/) |[extension](https://pi.dev/docs/latest/extensions) |
15+
| **Language Server Protocol** |[docs](https://code.claude.com/docs/en/tools-reference#lsp-tool-behavior) |[issue](https://github.com/openai/codex/issues/8745) |[docs](https://docs.cursor.com/context/) |[docs](https://opencode.ai/docs/lsp/) |[extension](https://pi.dev/docs/latest/extensions) |
16+
| **MCP Apps/UI** |[docs](https://claude.com/docs/connectors/building/mcp-apps/getting-started) (desktop) |[issue](https://github.com/openai/codex/issues/21019) |[docs](https://cursor.com/changelog/2-6) | ➖ cli | ➖ cli |
1617

17-
# symlink context
18-
ln -s AGENTS.md CLAUDE.md
19-
```
18+
## Hook Events
19+
20+
All platforms call the same hook scripts. Event names and tool filters differ by platform.
21+
22+
| Purpose | Shared script | Claude Code | Codex | Cursor |
23+
| --- | --- | --- | --- | --- |
24+
| Session setup | `.agents/hooks/session-start.sh` | `SessionStart` + `startup` | `SessionStart` + `^startup$` | `sessionStart` |
25+
| Shell guard | `.agents/hooks/pre-tool-use-bash.sh` | `PreToolUse` + `Bash` | `PreToolUse` + `^Bash$` | `preToolUse` + `Shell` |
26+
| Write guard | `.agents/hooks/pre-tool-use-edit-write.sh` | `PreToolUse` + `Edit\|Write` | `PreToolUse` + `Edit\|Write` | `preToolUse` + `Write\|Edit` |
27+
| Format and lint | `.agents/hooks/post-tool-use-edit-write.sh` | `PostToolUse` + `Edit\|Write` | `PostToolUse` + `Edit\|Write` | `postToolUse` + `Write\|Edit` |
28+
| End-of-turn checks | `.agents/hooks/stop.sh` | `Stop` | `Stop` | `stop` |
29+
30+
## Standardization Tracking
31+
32+
- https://github.com/modelcontextprotocol/modelcontextprotocol/issues/292

.agents/hooks.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"matcher": "^startup$",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/session-start.sh\"",
10+
"timeout": 600,
11+
"statusMessage": "Setting up development environment..."
12+
}
13+
]
14+
}
15+
],
16+
"PreToolUse": [
17+
{
18+
"matcher": "^Bash$",
19+
"hooks": [
20+
{
21+
"type": "command",
22+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/pre-tool-use-bash.sh\"",
23+
"timeout": 30,
24+
"statusMessage": "Checking for destructive operations..."
25+
}
26+
]
27+
},
28+
{
29+
"matcher": "Edit|Write",
30+
"hooks": [
31+
{
32+
"type": "command",
33+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/pre-tool-use-edit-write.sh\"",
34+
"timeout": 30,
35+
"statusMessage": "Checking critical file protections..."
36+
}
37+
]
38+
}
39+
],
40+
"PostToolUse": [
41+
{
42+
"matcher": "Edit|Write",
43+
"hooks": [
44+
{
45+
"type": "command",
46+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/post-tool-use-edit-write.sh\"",
47+
"timeout": 120,
48+
"statusMessage": "Running formatter and linters..."
49+
}
50+
]
51+
}
52+
],
53+
"Stop": [
54+
{
55+
"hooks": [
56+
{
57+
"type": "command",
58+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/stop.sh\"",
59+
"timeout": 600,
60+
"statusMessage": "Running build and test..."
61+
}
62+
]
63+
}
64+
]
65+
}
66+
}

.agents/mcp.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"mcpServers": {
3+
"elements": {
4+
"description": "NVIDIA Elements UI Design System (nve-*), custom element schemas, APIs and examples",
5+
"command": "node",
6+
"args": ["./projects/cli/dist/index.js", "mcp"]
7+
}
8+
}
9+
}

.codex/config.toml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
notify = [ # codex does not yet support notification hooks
2-
"bash",
3-
"-lc",
4-
'root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"; "$root/.agents/hooks/notification.sh" "$@"',
5-
"codex-notify",
6-
]
7-
81
[features]
9-
codex_hooks = true # partial/experimental support
2+
hooks = true # partial/experimental support
3+
4+
[mcp_servers.elements]
5+
command = "node"
6+
args = ["./projects/cli/dist/index.js", "mcp"]

.codex/hooks.json

Lines changed: 0 additions & 66 deletions
This file was deleted.

.codex/hooks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.agents/hooks.json

.cursor/hooks.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": 1,
3+
"hooks": {
4+
"sessionStart": [
5+
{
6+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/session-start.sh\" >&2",
7+
"timeout": 600
8+
}
9+
],
10+
"preToolUse": [
11+
{
12+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/pre-tool-use-bash.sh\" >&2",
13+
"matcher": "Shell",
14+
"timeout": 30
15+
},
16+
{
17+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/pre-tool-use-edit-write.sh\" >&2",
18+
"matcher": "Write|Edit",
19+
"timeout": 30
20+
}
21+
],
22+
"postToolUse": [
23+
{
24+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/post-tool-use-edit-write.sh\" >&2",
25+
"matcher": "Write|Edit",
26+
"timeout": 120
27+
}
28+
],
29+
"stop": [
30+
{
31+
"command": "root=\"$(git rev-parse --show-toplevel)\" && AGENTS_PROJECT_DIR=\"$root\" \"$root/.agents/hooks/stop.sh\" >&2",
32+
"timeout": 600
33+
}
34+
]
35+
}
36+
}

.cursor/mcp.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

.cursor/mcp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.agents/mcp.json

.mcp.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)