agentpacks 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -8
- package/dist/api.d.ts +2 -0
- package/dist/api.js +929 -409
- package/dist/cli/export-cmd.js +281 -149
- package/dist/cli/generate.js +740 -247
- package/dist/cli/import-cmd.js +57 -85
- package/dist/cli/info.d.ts +4 -0
- package/dist/cli/info.js +232 -0
- package/dist/cli/init.js +8 -36
- package/dist/cli/install.js +414 -129
- package/dist/cli/login.d.ts +9 -0
- package/dist/cli/login.js +202 -0
- package/dist/cli/models-explain.d.ts +16 -0
- package/dist/cli/models-explain.js +1205 -0
- package/dist/cli/pack/create.js +4 -32
- package/dist/cli/pack/enable.js +1 -29
- package/dist/cli/pack/list.js +266 -134
- package/dist/cli/pack/validate.js +274 -127
- package/dist/cli/publish.d.ts +8 -0
- package/dist/cli/publish.js +672 -0
- package/dist/cli/search.d.ts +12 -0
- package/dist/cli/search.js +210 -0
- package/dist/core/config.d.ts +2 -1
- package/dist/core/config.js +74 -117
- package/dist/core/dependency-resolver.js +4 -28
- package/dist/core/feature-merger.d.ts +7 -0
- package/dist/core/feature-merger.js +289 -29
- package/dist/core/index.js +283 -140
- package/dist/core/lockfile.js +0 -28
- package/dist/core/metarepo.js +74 -116
- package/dist/core/pack-loader.d.ts +2 -0
- package/dist/core/pack-loader.js +266 -133
- package/dist/core/profile-resolver.d.ts +75 -0
- package/dist/core/profile-resolver.js +111 -0
- package/dist/exporters/cursor-plugin.js +4 -32
- package/dist/exporters/index.js +4 -32
- package/dist/features/agents.d.ts +5 -0
- package/dist/features/agents.js +2 -30
- package/dist/features/commands.js +2 -30
- package/dist/features/hooks.js +2 -30
- package/dist/features/ignore.js +0 -28
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.js +176 -31
- package/dist/features/mcp.js +2 -30
- package/dist/features/models.d.ts +167 -0
- package/dist/features/models.js +293 -0
- package/dist/features/plugins.js +2 -30
- package/dist/features/rules.js +2 -30
- package/dist/features/skills.js +2 -30
- package/dist/importers/claude-code.js +10 -38
- package/dist/importers/cursor.js +15 -43
- package/dist/importers/opencode.js +16 -44
- package/dist/importers/rulesync.js +22 -50
- package/dist/index.js +1710 -538
- package/dist/node/api.js +929 -409
- package/dist/node/cli/export-cmd.js +281 -149
- package/dist/node/cli/generate.js +740 -247
- package/dist/node/cli/import-cmd.js +57 -85
- package/dist/node/cli/info.js +232 -0
- package/dist/node/cli/init.js +8 -36
- package/dist/node/cli/install.js +414 -129
- package/dist/node/cli/login.js +202 -0
- package/dist/node/cli/models-explain.js +1205 -0
- package/dist/node/cli/pack/create.js +4 -32
- package/dist/node/cli/pack/enable.js +1 -29
- package/dist/node/cli/pack/list.js +266 -134
- package/dist/node/cli/pack/validate.js +274 -127
- package/dist/node/cli/publish.js +672 -0
- package/dist/node/cli/search.js +210 -0
- package/dist/node/core/config.js +74 -117
- package/dist/node/core/dependency-resolver.js +4 -28
- package/dist/node/core/feature-merger.js +289 -29
- package/dist/node/core/index.js +283 -140
- package/dist/node/core/lockfile.js +0 -28
- package/dist/node/core/metarepo.js +74 -116
- package/dist/node/core/pack-loader.js +266 -133
- package/dist/node/core/profile-resolver.js +111 -0
- package/dist/node/exporters/cursor-plugin.js +4 -32
- package/dist/node/exporters/index.js +4 -32
- package/dist/node/features/agents.js +2 -30
- package/dist/node/features/commands.js +2 -30
- package/dist/node/features/hooks.js +2 -30
- package/dist/node/features/ignore.js +0 -28
- package/dist/node/features/index.js +176 -31
- package/dist/node/features/mcp.js +2 -30
- package/dist/node/features/models.js +293 -0
- package/dist/node/features/plugins.js +2 -30
- package/dist/node/features/rules.js +2 -30
- package/dist/node/features/skills.js +2 -30
- package/dist/node/importers/claude-code.js +10 -38
- package/dist/node/importers/cursor.js +15 -43
- package/dist/node/importers/opencode.js +16 -44
- package/dist/node/importers/rulesync.js +22 -50
- package/dist/node/index.js +1710 -538
- package/dist/node/sources/git-ref.js +7 -30
- package/dist/node/sources/git.js +7 -30
- package/dist/node/sources/index.js +337 -39
- package/dist/node/sources/local.js +0 -28
- package/dist/node/sources/npm-ref.js +0 -28
- package/dist/node/sources/npm.js +10 -37
- package/dist/node/sources/registry-ref.js +37 -0
- package/dist/node/sources/registry.js +355 -0
- package/dist/node/targets/additional-targets.js +196 -37
- package/dist/node/targets/agents-md.js +5 -33
- package/dist/node/targets/base-target.js +0 -28
- package/dist/node/targets/claude-code.js +211 -41
- package/dist/node/targets/codex-cli.js +7 -35
- package/dist/node/targets/copilot.js +202 -41
- package/dist/node/targets/cursor.js +188 -40
- package/dist/node/targets/gemini-cli.js +10 -38
- package/dist/node/targets/generic-md-target.js +196 -37
- package/dist/node/targets/index.js +414 -106
- package/dist/node/targets/opencode.js +171 -51
- package/dist/node/targets/registry.js +414 -106
- package/dist/node/utils/credentials.js +38 -0
- package/dist/node/utils/diff.js +22 -34
- package/dist/node/utils/filesystem.js +2 -30
- package/dist/node/utils/frontmatter.js +0 -28
- package/dist/node/utils/global.js +3 -31
- package/dist/node/utils/markdown.js +0 -28
- package/dist/node/utils/model-allowlist.js +110 -0
- package/dist/node/utils/model-guidance.js +78 -0
- package/dist/node/utils/registry-client.js +142 -0
- package/dist/node/utils/tarball.js +49 -0
- package/dist/sources/git-ref.js +7 -30
- package/dist/sources/git.d.ts +2 -2
- package/dist/sources/git.js +7 -30
- package/dist/sources/index.d.ts +2 -0
- package/dist/sources/index.js +337 -39
- package/dist/sources/local.js +0 -28
- package/dist/sources/npm-ref.js +0 -28
- package/dist/sources/npm.js +10 -37
- package/dist/sources/registry-ref.d.ts +30 -0
- package/dist/sources/registry-ref.js +37 -0
- package/dist/sources/registry.d.ts +18 -0
- package/dist/sources/registry.js +355 -0
- package/dist/targets/additional-targets.js +196 -37
- package/dist/targets/agents-md.js +5 -33
- package/dist/targets/base-target.d.ts +2 -0
- package/dist/targets/base-target.js +0 -28
- package/dist/targets/claude-code.js +211 -41
- package/dist/targets/codex-cli.js +7 -35
- package/dist/targets/copilot.js +202 -41
- package/dist/targets/cursor.js +188 -40
- package/dist/targets/gemini-cli.js +10 -38
- package/dist/targets/generic-md-target.js +196 -37
- package/dist/targets/index.js +414 -106
- package/dist/targets/opencode.js +171 -51
- package/dist/targets/registry.js +414 -106
- package/dist/utils/credentials.d.ts +19 -0
- package/dist/utils/credentials.js +38 -0
- package/dist/utils/diff.js +22 -34
- package/dist/utils/filesystem.js +2 -30
- package/dist/utils/frontmatter.js +0 -28
- package/dist/utils/global.js +3 -31
- package/dist/utils/markdown.js +0 -28
- package/dist/utils/model-allowlist.d.ts +39 -0
- package/dist/utils/model-allowlist.js +110 -0
- package/dist/utils/model-guidance.d.ts +6 -0
- package/dist/utils/model-guidance.js +78 -0
- package/dist/utils/registry-client.d.ts +141 -0
- package/dist/utils/registry-client.js +142 -0
- package/dist/utils/tarball.d.ts +13 -0
- package/dist/utils/tarball.js +49 -0
- package/package.json +171 -5
- package/templates/pack/models.json +38 -0
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/agentpacks)
|
|
4
4
|
[](https://www.npmjs.com/package/agentpacks)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://github.com/lssm-tech/contractspec/tree/main/packages/tools/agentpacks)
|
|
7
7
|
|
|
8
8
|
**Composable AI agent configuration manager.**
|
|
9
9
|
|
|
10
|
-
Write your rules, commands, skills, hooks, and MCP configs once — in a pack — and sync them automatically to OpenCode, Cursor, Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, and 13 more tools.
|
|
10
|
+
Write your rules, commands, skills, hooks, models, and MCP configs once — in a pack — and sync them automatically to OpenCode, Cursor, Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, and 13 more tools. Discover and share packs via the **agentpacks registry**.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -40,7 +40,9 @@ AI coding tools are proliferating fast. Every tool has its own config format:
|
|
|
40
40
|
| | agentpacks | rulesync |
|
|
41
41
|
| -------------------- | --------------------------------------- | ------------- |
|
|
42
42
|
| Architecture | Composable packs | Flat files |
|
|
43
|
-
| Pack distribution | npm, git, local
|
|
43
|
+
| Pack distribution | npm, git, local, **registry** | Local only |
|
|
44
|
+
| **Pack registry** | Search, publish, install via CLI | — |
|
|
45
|
+
| **Model configs** | Per-tool model/profile management | Not supported |
|
|
44
46
|
| OpenCode plugins | Per-pack `.ts` plugin files | Not supported |
|
|
45
47
|
| Cursor plugin export | Native plugin format | Not supported |
|
|
46
48
|
| Import from tools | Cursor, Claude Code, OpenCode, rulesync | — |
|
|
@@ -127,7 +129,7 @@ This reads your `.rulesync/` directory and `rulesync.jsonc`, and creates an equi
|
|
|
127
129
|
|
|
128
130
|
## Features
|
|
129
131
|
|
|
130
|
-
agentpacks supports
|
|
132
|
+
agentpacks supports 9 feature types inside a pack:
|
|
131
133
|
|
|
132
134
|
| Feature | Description | Example files |
|
|
133
135
|
| ------------ | ---------------------------------------------------- | ------------------------------------------- |
|
|
@@ -138,6 +140,7 @@ agentpacks supports 8 feature types inside a pack:
|
|
|
138
140
|
| **hooks** | Shell commands triggered by agent events | `hooks.json` |
|
|
139
141
|
| **plugins** | Raw TypeScript plugin files (OpenCode) | `plugins/my-plugin.ts` |
|
|
140
142
|
| **mcp** | MCP server definitions | `mcp.json` |
|
|
143
|
+
| **models** | Model preferences, profiles, and per-agent overrides | `models.json` |
|
|
141
144
|
| **ignore** | Patterns the agent should ignore | `ignore` |
|
|
142
145
|
|
|
143
146
|
---
|
|
@@ -164,6 +167,7 @@ agentpacks generate [options]
|
|
|
164
167
|
Options:
|
|
165
168
|
-t, --targets <targets> Comma-separated target IDs, or * for all (default: from config)
|
|
166
169
|
-f, --features <features> Comma-separated feature IDs, or * for all (default: from config)
|
|
170
|
+
--model-profile <profile> Activate a model profile (e.g. quality, budget, fast)
|
|
167
171
|
--dry-run Preview changes without writing files
|
|
168
172
|
--diff Show a diff of what would change
|
|
169
173
|
-v, --verbose Enable verbose output
|
|
@@ -178,13 +182,16 @@ agentpacks generate --targets cursor,claudecode
|
|
|
178
182
|
|
|
179
183
|
# Preview changes without writing
|
|
180
184
|
agentpacks generate --dry-run --diff
|
|
185
|
+
|
|
186
|
+
# Generate with the "budget" model profile active
|
|
187
|
+
agentpacks generate --model-profile budget
|
|
181
188
|
```
|
|
182
189
|
|
|
183
190
|
---
|
|
184
191
|
|
|
185
192
|
### `agentpacks install`
|
|
186
193
|
|
|
187
|
-
Install remote packs (npm packages or
|
|
194
|
+
Install remote packs (npm packages, git repos, or registry packs) into the local pack cache.
|
|
188
195
|
|
|
189
196
|
```bash
|
|
190
197
|
agentpacks install [options]
|
|
@@ -305,6 +312,130 @@ agentpacks pack enable my-pack # removes from "disabled" array
|
|
|
305
312
|
|
|
306
313
|
---
|
|
307
314
|
|
|
315
|
+
### `agentpacks search <query>`
|
|
316
|
+
|
|
317
|
+
Search the pack registry for packs matching a query.
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
agentpacks search typescript
|
|
321
|
+
|
|
322
|
+
# Filter by target
|
|
323
|
+
agentpacks search react --target cursor
|
|
324
|
+
|
|
325
|
+
# Sort by downloads
|
|
326
|
+
agentpacks search monorepo --sort downloads
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### `agentpacks info <pack>`
|
|
332
|
+
|
|
333
|
+
Show detailed information about a registry pack.
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
agentpacks info typescript-best-practices
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
### `agentpacks publish`
|
|
342
|
+
|
|
343
|
+
Publish the current pack to the registry. Requires authentication.
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
agentpacks login # store your registry token
|
|
347
|
+
agentpacks publish # validate, bundle, and upload
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
The publish command validates the pack, scans for secrets, creates a tarball, and uploads it. Publish will be blocked if the pack contains potential secrets (API keys, tokens, etc.) in `models.json` or other config files.
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
### `agentpacks login`
|
|
355
|
+
|
|
356
|
+
Authenticate with the pack registry.
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
agentpacks login
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Stores your token in `~/.config/agentpacks/credentials.json`.
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Model Configuration
|
|
367
|
+
|
|
368
|
+
agentpacks can manage AI model preferences across all your tools through the `models` feature. Define model assignments, named profiles, and provider options in a single `models.json` — agentpacks generates the right config for each tool.
|
|
369
|
+
|
|
370
|
+
### models.json
|
|
371
|
+
|
|
372
|
+
Place `models.json` at the root of a pack:
|
|
373
|
+
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"default": "anthropic/claude-sonnet-4-20250514",
|
|
377
|
+
"small": "anthropic/claude-haiku-3-5",
|
|
378
|
+
"agents": {
|
|
379
|
+
"code-reviewer": { "model": "anthropic/claude-opus-4-20250514" },
|
|
380
|
+
"quick-fixer": { "model": "anthropic/claude-haiku-3-5" }
|
|
381
|
+
},
|
|
382
|
+
"profiles": {
|
|
383
|
+
"quality": {
|
|
384
|
+
"default": "anthropic/claude-opus-4-20250514",
|
|
385
|
+
"small": "anthropic/claude-sonnet-4-20250514"
|
|
386
|
+
},
|
|
387
|
+
"budget": {
|
|
388
|
+
"default": "anthropic/claude-haiku-3-5",
|
|
389
|
+
"small": "anthropic/claude-haiku-3-5"
|
|
390
|
+
},
|
|
391
|
+
"fast": {
|
|
392
|
+
"default": "anthropic/claude-haiku-3-5"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"providers": {
|
|
396
|
+
"anthropic": {
|
|
397
|
+
"models": {
|
|
398
|
+
"claude-opus-4-20250514": {
|
|
399
|
+
"options": { "budgetTokens": 10000, "reasoningEffort": "high" }
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Activating a profile
|
|
408
|
+
|
|
409
|
+
Set `modelProfile` in your workspace config:
|
|
410
|
+
|
|
411
|
+
```jsonc
|
|
412
|
+
{
|
|
413
|
+
"modelProfile": "quality",
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Or override at generate time:
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
agentpacks generate --model-profile budget
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Per-tool output
|
|
424
|
+
|
|
425
|
+
| Tool | What agentpacks generates |
|
|
426
|
+
| --------------- | ----------------------------------------------------------------------------------------- |
|
|
427
|
+
| **OpenCode** | `model`, `small_model`, `provider.*.models.*.options`, `agent.*.model` in `opencode.json` |
|
|
428
|
+
| **Cursor** | `.cursor/rules/model-config.mdc` — an always-applied guidance rule |
|
|
429
|
+
| **Claude Code** | Model guidance in `CLAUDE.md`, `<!-- model: ... -->` hints in agent files |
|
|
430
|
+
| **Copilot** | Model guidance section in `.github/copilot-instructions.md` |
|
|
431
|
+
| **Others** | Model guidance in their root rule file |
|
|
432
|
+
|
|
433
|
+
### Security
|
|
434
|
+
|
|
435
|
+
`models.json` must **never** contain credentials. agentpacks scans for API keys, tokens, secrets, and private key markers during `pack validate` and `publish`. Publish is blocked if secrets are detected.
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
308
439
|
## Configuration
|
|
309
440
|
|
|
310
441
|
### Workspace config — `agentpacks.jsonc`
|
|
@@ -315,11 +446,12 @@ Created at your project root by `agentpacks init`.
|
|
|
315
446
|
{
|
|
316
447
|
"$schema": "https://unpkg.com/agentpacks/schema.json",
|
|
317
448
|
|
|
318
|
-
// Packs to load — local
|
|
449
|
+
// Packs to load — local, npm, git, or registry
|
|
319
450
|
"packs": [
|
|
320
451
|
"./packs/default",
|
|
321
452
|
"agentpacks-typescript-rules", // npm package
|
|
322
453
|
"github:myorg/agent-packs#main/python", // git ref
|
|
454
|
+
"registry:react-patterns", // registry pack
|
|
323
455
|
],
|
|
324
456
|
|
|
325
457
|
// Temporarily disable a pack without removing it
|
|
@@ -335,9 +467,12 @@ Created at your project root by `agentpacks init`.
|
|
|
335
467
|
"copilot",
|
|
336
468
|
],
|
|
337
469
|
|
|
338
|
-
// Which feature types to generate (* = all
|
|
470
|
+
// Which feature types to generate (* = all 9)
|
|
339
471
|
"features": ["*"],
|
|
340
472
|
|
|
473
|
+
// Active model profile (from models.json profiles)
|
|
474
|
+
"modelProfile": "quality",
|
|
475
|
+
|
|
341
476
|
// Repository mode: "repo" | "monorepo" | "metarepo"
|
|
342
477
|
"mode": "repo",
|
|
343
478
|
|
|
@@ -391,6 +526,7 @@ my-pack/
|
|
|
391
526
|
│ └── SKILL.md
|
|
392
527
|
├── hooks.json
|
|
393
528
|
├── mcp.json
|
|
529
|
+
├── models.json
|
|
394
530
|
└── ignore
|
|
395
531
|
```
|
|
396
532
|
|
|
@@ -476,7 +612,31 @@ For metarepo setups (a repo of repos), set `mode: "metarepo"` and agentpacks wil
|
|
|
476
612
|
|
|
477
613
|
## Pack Distribution
|
|
478
614
|
|
|
479
|
-
Packs can be shared
|
|
615
|
+
Packs can be shared via four sources:
|
|
616
|
+
|
|
617
|
+
### agentpacks registry
|
|
618
|
+
|
|
619
|
+
The official pack registry at [agentpacks.dev](https://agentpacks.dev) — search, publish, and install community packs.
|
|
620
|
+
|
|
621
|
+
```bash
|
|
622
|
+
# Search for packs
|
|
623
|
+
agentpacks search typescript
|
|
624
|
+
|
|
625
|
+
# View pack details
|
|
626
|
+
agentpacks info typescript-best-practices
|
|
627
|
+
|
|
628
|
+
# Install from registry
|
|
629
|
+
agentpacks install
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
```jsonc
|
|
633
|
+
{
|
|
634
|
+
"packs": [
|
|
635
|
+
"registry:typescript-best-practices",
|
|
636
|
+
"registry:react-patterns@1.2.0", // pinned version
|
|
637
|
+
],
|
|
638
|
+
}
|
|
639
|
+
```
|
|
480
640
|
|
|
481
641
|
### npm packages
|
|
482
642
|
|
package/dist/api.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ export { PackLoader, type LoadedPack } from './core/pack-loader.js';
|
|
|
18
18
|
export { FeatureMerger, type MergedFeatures } from './core/feature-merger.js';
|
|
19
19
|
export { type Lockfile, loadLockfile, saveLockfile, computeIntegrity, } from './core/lockfile.js';
|
|
20
20
|
export { type DependencyResolution, resolveDependencies, } from './core/dependency-resolver.js';
|
|
21
|
+
export { type ResolvedModels, resolveModels, resolveAgentModel, } from './core/profile-resolver.js';
|
|
21
22
|
export { isLocalPackRef, resolveLocalPack } from './sources/local.js';
|
|
22
23
|
export { isGitPackRef, parseGitSourceRef, type GitSourceRef, } from './sources/git-ref.js';
|
|
23
24
|
export { isNpmPackRef, parseNpmSourceRef, type NpmSourceRef, } from './sources/npm-ref.js';
|
|
25
|
+
export { isRegistryPackRef, parseRegistrySourceRef, registrySourceKey, type RegistrySourceRef, } from './sources/registry-ref.js';
|
|
24
26
|
export { installGitSource } from './sources/git.js';
|
|
25
27
|
export { installNpmSource } from './sources/npm.js';
|
|
26
28
|
export { type BaseTarget } from './targets/base-target.js';
|