Skip to content

Commit ec2780e

Browse files
Refactor installer scope and destination handling
1 parent acf3673 commit ec2780e

17 files changed

Lines changed: 1108 additions & 497 deletions

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/__pycache__/
2+
**/*.pyc
3+
.cursor/
4+
.github/
5+
tests/

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project are documented here.
44

55
## Unreleased
66

7+
### Changed
8+
9+
- Refactored installation around explicit project/user scope, destination,
10+
target, and item selection so `add <name>` installs only the requested
11+
artifact and project installs never leak into user-level agent directories.
12+
- Made npm installs durable copies by default, aligned project-context files
13+
with the selected agent architecture, and made target auto-detection fail
14+
closed when no agent directory exists.
15+
- Consolidated validation and installer smoke tests into one cancellable CI
16+
workflow; the Windows smoke job now runs only for installer-related changes.
17+
718
### Added
819

920
- Codex delegation guidance and a dependency-free delegation packet adapter.

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ python scripts/build_cursor_rules.py --skills-dir skills --out-dir .cursor/rules
3434
python scripts/list_content.py --format markdown
3535
```
3636

37+
Installer changes must also preserve the scope contract: project installs may
38+
write only below the selected project, user installs may write only below the
39+
selected home, and `add <name>` may install only that artifact. Add regression
40+
coverage in `tests/test_install.py` and `tests/test_cli.py` for changes to these
41+
boundaries.
42+
3743
Commit frequent, scoped, coherent units of completed work. Use concise,
3844
professional imperative subjects that say what changed, such as `Add handoff
3945
template validation`; avoid vague or phase-based subjects. Push each completed

README.md

Lines changed: 153 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,191 @@
11
# indium-agentkit
22

3-
`indium-agentkit` is a distribution scaffold for sharing AI coding-agent skills, subagents, and project context across Claude Code, Codex, Antigravity CLI (formerly Gemini CLI), OpenCode, and Cursor.
3+
`indium-agentkit` distributes portable AI coding-agent skills, subagents, and
4+
project context across Claude Code, Codex, Gemini CLI, Antigravity, OpenCode,
5+
and Cursor.
46

5-
---
7+
## Quick start
68

7-
## ⚡ 1-Line Quick Installation (Install Whole Repo)
9+
Install the complete bundle into one agent inside the current project:
810

9-
To install **all 36 portable skills, 21 subagents, and Cursor rules** into any project repository in under 2 seconds:
11+
```bash
12+
npx @indium-ai-labs/agentkit install --target=codex
13+
```
14+
15+
Install one skill instead of the complete bundle:
1016

1117
```bash
12-
# Auto-detect active IDE and install all skills & subagents
13-
npx @indium-ai-labs/agentkit install
18+
npx @indium-ai-labs/agentkit add systematic-debugging --target=codex
1419
```
1520

16-
### 🎯 Target Specific AI Editors & IDEs:
21+
Project scope is the default. These commands write only below the current
22+
project; they do not modify user-level agent directories. Choose a different
23+
project explicitly with `--project-dir`:
24+
1725
```bash
18-
# Antigravity IDE (.antigravity/skills & .antigravity/agents)
19-
npx @indium-ai-labs/agentkit install --target=antigravity
26+
npx @indium-ai-labs/agentkit install \
27+
--project-dir=/path/to/project \
28+
--target=claude
29+
```
30+
31+
Use user scope only when you intentionally want content available across
32+
projects:
33+
34+
```bash
35+
npx @indium-ai-labs/agentkit install --scope=user --target=codex
36+
```
37+
38+
If `--target` is omitted, the CLI detects agent directories that already exist
39+
inside the chosen scope. It fails with guidance when no target is detected.
40+
Installing into every supported agent requires the explicit `--target=all`
41+
flag.
42+
43+
## Installation model
2044

21-
# OpenCode (.opencode/skills)
22-
npx @indium-ai-labs/agentkit install --target=opencode
45+
Four independent inputs control every installation:
2346

24-
# Cursor IDE (.cursor/rules/*.mdc)
25-
npx @indium-ai-labs/agentkit install --target=cursor
47+
| Input | Meaning | Default |
48+
| --- | --- | --- |
49+
| Command | `install` for the bundle or `add <name>` for one artifact | required |
50+
| Scope | `project` or `user` | `project` |
51+
| Destination | Current project or `--project-dir=<path>` | current directory |
52+
| Target | One agent, a comma-separated list, auto-detection, or explicit `all` | `auto` |
2653

27-
# Claude Code (.claude/skills & .claude/agents)
28-
npx @indium-ai-labs/agentkit install --target=claude
54+
The npm CLI creates durable copies by default because links into a temporary
55+
`npx` cache can break later. Use `--mode=link` only when you intentionally want
56+
the destination to follow a local agentkit checkout. Existing files that are
57+
not an exact copy or an agentkit link are reported and left untouched.
58+
59+
Project-context files follow the selected architecture:
60+
61+
| Target | Project content | Project context |
62+
| --- | --- | --- |
63+
| Claude Code | `.claude/skills`, `.claude/agents` | `CLAUDE.md` |
64+
| Codex | `.codex/skills` | `AGENTS.md` |
65+
| Gemini CLI | `.gemini/skills`, `.gemini/agents` | `AGENTS.md` |
66+
| Antigravity | `.antigravity/skills`, `.antigravity/agents` | `AGENTS.md` |
67+
| Cursor | generated `.cursor/rules/*.mdc` | `AGENTS.md` |
68+
| OpenCode | `.opencode/skills` | `AGENTS.md` |
69+
70+
User-scoped installs write only to the selected tool directory beneath the
71+
user home and never create project-context files.
72+
73+
### More examples
74+
75+
```bash
76+
# Multiple explicit targets in one project
77+
npx @indium-ai-labs/agentkit install --target=codex,cursor
78+
79+
# One Claude subagent in one project
80+
npx @indium-ai-labs/agentkit add reviewer --target=claude
81+
82+
# Explicitly install everywhere in the user scope
83+
npx @indium-ai-labs/agentkit install --scope=user --target=all
84+
85+
# Show every option and the active package version
86+
npx @indium-ai-labs/agentkit --help
2987
```
3088

31-
---
89+
A selected subagent fails clearly when its target has no native subagent
90+
installation path. Portable skills remain usable without subagents.
91+
92+
## Local checkout installers
93+
94+
The Bash and PowerShell wrappers use links by default for repository
95+
development. Passing a project directory uses project scope only:
96+
97+
```bash
98+
# macOS/Linux
99+
./scripts/install.sh /path/to/project codex
100+
101+
# Windows PowerShell
102+
.\scripts\install.ps1 -ProjectDir C:\path\to\project -TargetIde codex
103+
```
104+
105+
Their advanced options map to the canonical Python installer:
106+
107+
```bash
108+
python scripts/install.py \
109+
--scope project \
110+
--project-dir /path/to/project \
111+
--target cursor \
112+
--item systematic-debugging \
113+
--mode copy
114+
```
115+
116+
Creating links on Windows requires Developer Mode or an Administrator shell.
117+
The installer reports a clear remediation message if link creation fails.
118+
119+
Inspect exactly the boundary you installed:
120+
121+
```bash
122+
python scripts/check_install.py \
123+
--project /path/to/project \
124+
--target codex \
125+
--item systematic-debugging \
126+
--mode copy
127+
```
32128

33129
## Architecture
34130

35131
The repository uses two open, cross-agent formats:
36132

37-
- `SKILL.md` is a task-triggered capability. Each skill has YAML frontmatter (`name` and `description`), a Markdown body, and optionally helper files next to it. Claude Code, Codex, OpenCode, and Gemini CLI/Antigravity discover this format natively.
38-
- `AGENTS.md` is always-loaded project context: architecture, conventions, commands, and working notes. Codex, Cursor, Gemini CLI/Antigravity, Copilot, Aider, Windsurf, and Zed read it natively. The root file governs this repository; `templates/AGENTS.md` is the neutral file installers link into consumer projects, along with `CLAUDE.md` for Claude Code.
133+
- `SKILL.md` is a task-triggered capability with `name` and `description` YAML
134+
frontmatter plus a Markdown workflow. Claude Code, Codex, OpenCode, Gemini
135+
CLI, and Antigravity discover it natively.
136+
- `AGENTS.md` is always-loaded project context. Codex, Cursor, Gemini CLI,
137+
Antigravity, Copilot, Aider, Windsurf, and Zed read it natively. The root
138+
file governs this repository; consumer projects receive the neutral
139+
`templates/AGENTS.md`. Claude receives the same context as `CLAUDE.md`.
39140

40-
Cursor does not natively discover `SKILL.md`. The included Python builder turns each `skills/*/SKILL.md` into `.cursor/rules/<skill-directory>.mdc`, carrying over the skill description and Markdown body and setting `alwaysApply: false`. Skills therefore have one source of truth while remaining available to Cursor.
141+
Cursor does not natively discover `SKILL.md`. The dependency-free builder
142+
converts each selected skill to `.cursor/rules/<name>.mdc`, preserving the
143+
description and Markdown body with `alwaysApply: false`.
41144

42-
Subagents do not yet share a cross-tool schema. This repository uses Claude Code's format as the common denominator: YAML frontmatter containing `name`, `description`, `tools`, and `model`, followed by the subagent's Markdown prompt. Use [`templates/subagent.md`](templates/subagent.md) when authoring a new role; it is based on the repository's `agent-orchestrator` inspection structure and keeps safety, contracts, limits, and handoffs explicit.
145+
Subagents do not yet have a unified cross-tool schema. Agentkit uses Claude
146+
Code-compatible frontmatter (`name`, `description`, `tools`, and `model`) as
147+
the portable source shape. Use `templates/subagent.md` when authoring a role.
43148

44149
## Repository layout
45150

46151
```text
47152
indium-agentkit/
48-
├── README.md
49-
├── AGENTS.md
50-
├── templates/
51-
│ └── AGENTS.md
52-
├── skills/
53-
│ ├── author-agentkit-content/
54-
│ ├── plan-change/
55-
│ ├── safe-migration/
56-
│ ├── security-review/
57-
│ ├── ...
58-
│ └── verify-and-ship/
59-
├── agents/
60-
│ ├── explorer.md
61-
│ ├── migration-planner.md
62-
│ ├── security-reviewer.md
63-
│ ├── ...
64-
│ └── verifier.md
65-
├── scripts/
66-
│ ├── install.sh
67-
│ ├── install.ps1
68-
│ ├── build_cursor_rules.py
69-
│ ├── validate_content.py
70-
│ ├── check_install.py
71-
│ ├── scaffold_content.py
72-
│ └── list_content.py
73-
├── tests/
74-
├── .github/workflows/validate.yml
75-
├── docs/
76-
├── CATALOG.md
77-
├── CHANGELOG.md
78-
├── SECURITY.md
79-
├── CONTRIBUTING.md
80-
└── .gitignore
153+
|-- AGENTS.md
154+
|-- CATALOG.md
155+
|-- agents/
156+
|-- skills/
157+
|-- templates/
158+
| `-- AGENTS.md
159+
|-- scripts/
160+
| |-- cli.js
161+
| |-- install.py
162+
| |-- install.sh
163+
| |-- install.ps1
164+
| `-- build_cursor_rules.py
165+
|-- tests/
166+
`-- .github/workflows/validate.yml
81167
```
82168

83-
## Validation
169+
## Adding content
84170

85-
Validate content and run the dependency-free test suite before publishing:
171+
Create skills at `skills/<name>/SKILL.md` and subagents at
172+
`agents/<name>.md`. Follow `CONTRIBUTING.md`, regenerate `CATALOG.md`, and keep
173+
skills executable by a single agent even when delegation can accelerate them.
174+
175+
## Validation
86176

87177
```bash
178+
python scripts/generate_catalog.py
179+
python scripts/diff_catalog.py
88180
python scripts/validate_content.py
89181
python scripts/validate_handoff.py --templates-dir templates/handoffs
90182
python -m unittest discover -s tests -v
183+
python scripts/build_cursor_rules.py --skills-dir skills --out-dir .cursor/rules
91184
```
92185

93-
GitHub Actions runs the same checks on pushes and pull requests.
94-
95-
## Tools and compatibility
96-
97-
Use `python scripts/check_install.py --project /path/to/project` to inspect an installation, `scripts/scaffold_content.py` to create valid starter content, and `scripts/list_content.py --format json` to consume the catalog programmatically. For Codex delegation, use `scripts/codex_delegate.py` to produce a structured packet from an `agents/<name>.md` role.
98-
See [compatibility details](docs/compatibility.md), [security guidance](SECURITY.md), and [release guidance](docs/releasing.md).
99-
100-
## Status
186+
CI uses one workflow run per event. Superseded runs are cancelled, Bash smoke
187+
coverage shares the Linux validation job, and the higher-cost Windows smoke job
188+
runs only when installer-related files change.
101189

102-
The current bundle contains thirty-six portable skills, twenty-one read-only specialists, and two scoped implementation subagents. See `CATALOG.md` for the generated inventory.
190+
See `CATALOG.md` for the generated inventory, `docs/compatibility.md` for the
191+
support matrix, and `SECURITY.md` for distribution guidance.

docs/compatibility.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22

33
| Capability | Claude Code | Codex | Gemini CLI / Antigravity | Cursor |
44
| --- | --- | --- | --- | --- |
5-
| `AGENTS.md` project context | Via linked `CLAUDE.md` | Native | Native | Native |
5+
| Project context | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` | `AGENTS.md` |
66
| `SKILL.md` skills | Native | Native | Native | Generated `.mdc` rules |
7-
| Claude-style subagents | Native | Adapt manually | Adapt manually | Adapt manually |
8-
| Per-item installation | `~/.claude/` | `~/.codex/` | `~/.gemini/`, `~/.antigravity/` | Project `.cursor/rules/` |
7+
| Claude-style subagents | Native | Delegation adapter | Distributed role files | Adapt manually |
8+
| Project installation | `.claude/` | `.codex/` | `.gemini/`, `.antigravity/` | `.cursor/rules/` |
9+
| User installation | `~/.claude/` | `~/.codex/` | `~/.gemini/`, `~/.antigravity/` | `~/.cursor/rules/` |
910

1011
Skills must remain usable by one agent because only Claude Code consumes the
1112
subagent files directly. A skill may recommend delegation as an optional
1213
acceleration path, but its core workflow must not depend on it.
1314

15+
Installation scope and target are independent. Project scope never writes to
16+
the user home, and user scope never creates project files. `add <name>` installs
17+
only that artifact; `install` installs the bundle. The npm CLI uses copies by
18+
default, while local checkout wrappers use links by default.
19+
1420
Run `python scripts/build_cursor_rules.py --skills-dir skills --out-dir
15-
<project>/.cursor/rules` after adding or changing a skill for Cursor.
21+
<project>/.cursor/rules --skill <name>` to convert one skill for Cursor, or omit
22+
`--skill` to convert the complete skill collection.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indium-ai-labs/agentkit",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "Portable AI coding-agent skills, subagents, and project-context templates.",
55
"main": "scripts/cli.js",
66
"bin": {
@@ -19,8 +19,8 @@
1919
"README.md"
2020
],
2121
"scripts": {
22-
"test": "python3 -m unittest discover -s tests -v",
23-
"lint": "python3 scripts/validate_content.py"
22+
"test": "python -m unittest discover -s tests -v",
23+
"lint": "python scripts/validate_content.py"
2424
},
2525
"keywords": [
2626
"ai",

scripts/.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__/
2+
*.pyc

scripts/build_cursor_rules.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ def convert_skill(skill_file: Path, out_dir: Path) -> Path:
7373

7474
def parse_args() -> argparse.Namespace:
7575
parser = argparse.ArgumentParser(
76-
description="Convert skills/*/SKILL.md files to Cursor .mdc rules."
76+
description="Convert skills/*/SKILL.md files to Cursor .mdc rules.",
77+
allow_abbrev=False,
7778
)
7879
parser.add_argument(
7980
"--skills-dir", type=Path, required=True, help="Directory containing skills"
8081
)
8182
parser.add_argument(
8283
"--out-dir", type=Path, required=True, help="Directory for generated .mdc files"
8384
)
85+
parser.add_argument(
86+
"--skill", help="Convert only the skill whose directory has this name"
87+
)
8488
return parser.parse_args()
8589

8690

@@ -94,6 +98,15 @@ def main() -> int:
9498
return 2
9599

96100
skill_files = sorted(skills_dir.glob("*/SKILL.md"))
101+
if args.skill:
102+
skill_files = [
103+
skill_file
104+
for skill_file in skill_files
105+
if skill_file.parent.name == args.skill
106+
]
107+
if not skill_files:
108+
print(f"error: skill not found: {args.skill}", file=sys.stderr)
109+
return 2
97110
if not skill_files:
98111
print("no skills found")
99112
return 0

0 commit comments

Comments
 (0)