@pratikpsl/agent-skills 0.4.0 → 0.6.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 +93 -47
- package/dist/bin/agent-skills.d.ts +3 -0
- package/dist/bin/agent-skills.d.ts.map +1 -0
- package/dist/bin/agent-skills.js +6 -0
- package/dist/bin/agent-skills.js.map +1 -0
- package/dist/cli/commands/add.d.ts +3 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +71 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/dotnet-setup.d.ts +14 -0
- package/dist/cli/commands/dotnet-setup.d.ts.map +1 -0
- package/dist/cli/commands/dotnet-setup.js +110 -0
- package/dist/cli/commands/dotnet-setup.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +36 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/list.d.ts +3 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +37 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +29 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/copy-skills.d.ts +28 -0
- package/dist/core/copy-skills.d.ts.map +1 -0
- package/dist/core/copy-skills.js +60 -0
- package/dist/core/copy-skills.js.map +1 -0
- package/dist/core/load-pack.d.ts +15 -0
- package/dist/core/load-pack.d.ts.map +1 -0
- package/dist/core/load-pack.js +35 -0
- package/dist/core/load-pack.js.map +1 -0
- package/dist/core/manifest.d.ts +29 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +75 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/resolve-pack.d.ts +7 -0
- package/dist/core/resolve-pack.d.ts.map +1 -0
- package/dist/core/resolve-pack.js +38 -0
- package/dist/core/resolve-pack.js.map +1 -0
- package/package.json +26 -7
- package/templates/dotnet/AgentSkills/entry-points/antigravity-instructions.md +50 -0
- package/{src/templates → templates}/dotnet/manifest.json +8 -2
- package/bin/agent-skills.js +0 -7
- package/src/__tests__/copySkills.test.js +0 -161
- package/src/__tests__/list.test.js +0 -49
- package/src/__tests__/manifest.test.js +0 -72
- package/src/commands/add.js +0 -89
- package/src/commands/dotnet-setup.js +0 -67
- package/src/commands/init.js +0 -42
- package/src/commands/list.js +0 -41
- package/src/index.js +0 -33
- package/src/lib/copySkills.js +0 -84
- package/src/lib/manifest.js +0 -117
- package/src/lib/resolvePack.js +0 -44
- /package/{src/templates → templates}/dotnet/AgentSkills/OPERATING.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/README.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/agents/README.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/agents/architect.agent.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/agents/developer.agent.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/entry-points/AGENTS.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/entry-points/CLAUDE.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/entry-points/copilot-instructions.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/entry-points/cursor-instructions.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/index.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/api.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/auth.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/csharp.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/db.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/design.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/infra.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/mcp.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/lessons/testing.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/memory/schema.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/INDEX.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/README.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/code-standards/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/core/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/csharp-xunit/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/design/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/dotnet-api/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/dotnet-best-practices/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/harness/SKILL.md +0 -0
- /package/{src/templates → templates}/dotnet/AgentSkills/skills/mcp_dotnet/SKILL.md +0 -0
package/README.md
CHANGED
|
@@ -1,92 +1,138 @@
|
|
|
1
|
-
# agent-skills
|
|
1
|
+
# @pratikpsl/agent-skills
|
|
2
2
|
|
|
3
|
-
> Scaffold and manage AI agent skills across any project — like `shadcn/ui
|
|
3
|
+
> Scaffold and manage AI agent skills across any project — like `shadcn/ui`, but for Cursor, Claude, Codex, Copilot, and Antigravity.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@pratikpsl/agent-skills` is a single npm package: a TypeScript CLI plus bundled skill **packs** under `templates/`. No runtime network fetch — packs ship inside the package, so setup works offline after install.
|
|
6
|
+
|
|
7
|
+
Currently published on npm as **0.5.0**; this branch prepares **0.6.0**.
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Quickstart
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
From any project root (Node 18+):
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
#
|
|
15
|
-
npx @pratikpsl/agent-skills dotnet-setup
|
|
16
|
+
# Install the full .NET/C# skill set + every IDE entry-point
|
|
17
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup
|
|
18
|
+
|
|
19
|
+
# Or install shared skills + one IDE entry-point only
|
|
20
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup cursor # → .cursor/rules/instructions.md
|
|
21
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup claude # → CLAUDE.md
|
|
22
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup codex # → AGENTS.md
|
|
23
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup copilot # → .github/copilot-instructions.md
|
|
24
|
+
npx @pratikpsl/agent-skills@0.6.0 dotnet-setup antigravity # → .agents/GEMINI.md
|
|
16
25
|
```
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
Until 0.6.0 is published, use `@0.5.0` or the git branch for local testing.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
19
32
|
|
|
20
33
|
| Command | Description |
|
|
21
|
-
|
|
34
|
+
| --- | --- |
|
|
22
35
|
| `npx @pratikpsl/agent-skills init` | Scaffold an empty `AgentSkills/` folder and `index.json` |
|
|
23
|
-
| `npx @pratikpsl/agent-skills list
|
|
24
|
-
| `npx @pratikpsl/agent-skills
|
|
25
|
-
| `npx @pratikpsl/agent-skills add dotnet
|
|
36
|
+
| `npx @pratikpsl/agent-skills list` | List skills in known packs (default: `dotnet`) |
|
|
37
|
+
| `npx @pratikpsl/agent-skills list dotnet` | List skills in the `dotnet` pack |
|
|
38
|
+
| `npx @pratikpsl/agent-skills add dotnet <skill>` | Copy one skill into the project |
|
|
39
|
+
| `npx @pratikpsl/agent-skills add dotnet --all` | Copy all skills (same pack content as `dotnet-setup`) |
|
|
40
|
+
| `npx @pratikpsl/agent-skills dotnet-setup [ide]` | Convenience installer for the .NET pack |
|
|
26
41
|
| `npx @pratikpsl/agent-skills --help` | Show CLI help |
|
|
27
42
|
| `npx @pratikpsl/agent-skills --version` | Show CLI version |
|
|
28
43
|
|
|
29
44
|
### Options
|
|
30
|
-
|
|
31
|
-
- `--
|
|
45
|
+
|
|
46
|
+
- `--force` — overwrite existing skill and entry-point files
|
|
47
|
+
- `--path <dir>` — target project root (default: `process.cwd()`)
|
|
32
48
|
|
|
33
49
|
---
|
|
34
50
|
|
|
35
|
-
##
|
|
51
|
+
## Packs
|
|
52
|
+
|
|
53
|
+
| Pack | Path | Notes |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `dotnet` | `templates/dotnet/` | .NET/C# skills, agents, memory, IDE entry-points |
|
|
56
|
+
|
|
57
|
+
Aliases accepted by the CLI: `dotnet`, `skills-dotnet`, `@pratikpsl/agent-skills-dotnet`.
|
|
58
|
+
|
|
59
|
+
The repo also contains a `Skills/` tree of additional drafts and a `plugins/` folder. Those are **not** part of the published npm tarball (see `.npmignore` and the `files` whitelist in `package.json`).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Repository layout
|
|
36
64
|
|
|
37
65
|
```
|
|
38
|
-
|
|
39
|
-
├── bin/
|
|
40
|
-
│ └── agent-skills.js (CLI binary entrypoint)
|
|
66
|
+
coding-skills-ai/
|
|
41
67
|
├── src/
|
|
42
|
-
│ ├──
|
|
43
|
-
│ ├──
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
|
|
47
|
-
│
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
68
|
+
│ ├── bin/agent-skills.ts # CLI binary entry
|
|
69
|
+
│ ├── cli/ # commander wiring + commands
|
|
70
|
+
│ │ └── commands/ # init, list, add, dotnet-setup
|
|
71
|
+
│ └── core/ # resolve-pack, manifest, copy-skills
|
|
72
|
+
├── templates/
|
|
73
|
+
│ └── dotnet/ # shipped pack (manifest.json + AgentSkills/)
|
|
74
|
+
├── tests/ # Vitest suite
|
|
75
|
+
├── Skills/ # extra drafts (not published)
|
|
76
|
+
├── plugins/ # local experiments (not published)
|
|
77
|
+
├── .github/workflows/ # CI + npm publish on version tags
|
|
78
|
+
├── package.json
|
|
79
|
+
├── tsconfig.json # emits to dist/
|
|
80
|
+
├── vitest.config.ts
|
|
81
|
+
├── LICENSE # Apache-2.0
|
|
52
82
|
└── README.md
|
|
53
83
|
```
|
|
54
84
|
|
|
85
|
+
Build output: `tsc` compiles `src/` → `dist/`. The published binary is `dist/bin/agent-skills.js`. Pack templates stay at package-root `templates/` (included via `files`).
|
|
86
|
+
|
|
55
87
|
---
|
|
56
88
|
|
|
57
|
-
## Local
|
|
89
|
+
## Local development
|
|
58
90
|
|
|
59
91
|
```bash
|
|
60
|
-
|
|
61
|
-
npm
|
|
62
|
-
|
|
63
|
-
# Run unit tests
|
|
92
|
+
npm ci
|
|
93
|
+
npm run build
|
|
64
94
|
npm test
|
|
65
95
|
|
|
66
|
-
#
|
|
96
|
+
# Optional: try the CLI globally from this checkout
|
|
67
97
|
npm link
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
agent-skills dotnet-setup
|
|
98
|
+
agent-skills --help
|
|
99
|
+
agent-skills list dotnet
|
|
71
100
|
```
|
|
72
101
|
|
|
73
|
-
|
|
102
|
+
Useful scripts:
|
|
74
103
|
|
|
75
|
-
|
|
104
|
+
| Script | What it does |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `npm run build` | `tsc` → `dist/` |
|
|
107
|
+
| `npm test` | Vitest (`tests/**/*.test.ts`) |
|
|
108
|
+
| `npm run test:watch` | Vitest watch mode |
|
|
109
|
+
| `npm run dry-run` | Build + `npm publish --dry-run` |
|
|
76
110
|
|
|
77
|
-
|
|
111
|
+
---
|
|
78
112
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
## Publish checklist (maintainers)
|
|
114
|
+
|
|
115
|
+
1. Ensure `main` is green (CI: Node 18/20/22 — build + test).
|
|
116
|
+
2. Confirm version in `package.json` (and pack `templates/dotnet/manifest.json` if skill content changed).
|
|
117
|
+
3. Verify the tarball includes templates:
|
|
84
118
|
```bash
|
|
85
|
-
npm
|
|
119
|
+
npm run build
|
|
120
|
+
npm pack --dry-run
|
|
121
|
+
# Expect: dist/** and templates/dotnet/** (not Skills/ or src/)
|
|
86
122
|
```
|
|
123
|
+
4. Publish:
|
|
124
|
+
- **Trusted Publisher (preferred):** push an annotated tag matching `package.json`, e.g. `v0.6.0`. Workflow `.github/workflows/publish.yml` runs tests and `npm publish --provenance`.
|
|
125
|
+
- **Manual:**
|
|
126
|
+
```bash
|
|
127
|
+
npm login
|
|
128
|
+
npm run build && npm test
|
|
129
|
+
npm publish --access public --otp=YOUR_6_DIGIT_OTP
|
|
130
|
+
```
|
|
131
|
+
5. Confirm on npm: https://www.npmjs.com/package/@pratikpsl/agent-skills
|
|
132
|
+
6. Smoke-test: `npx @pratikpsl/agent-skills@0.6.0 --version` and `dotnet-setup` in a throwaway folder.
|
|
87
133
|
|
|
88
134
|
---
|
|
89
135
|
|
|
90
136
|
## License
|
|
91
137
|
|
|
92
|
-
|
|
138
|
+
Apache License 2.0 — see [`LICENSE`](./LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-skills.d.ts","sourceRoot":"","sources":["../../src/bin/agent-skills.ts"],"names":[],"mappings":";AAKA,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-skills.js","sourceRoot":"","sources":["../../src/bin/agent-skills.ts"],"names":[],"mappings":";AACA,0BAA0B;AAC1B,8CAA8C;AAC9C,kEAAkE;AAElE,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8DjD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/cli/commands/add.ts
|
|
2
|
+
// `agent-skills add <pack> <skillName|--all>`
|
|
3
|
+
//
|
|
4
|
+
// Copies a single named skill (or all skills with --all) from a pack into the
|
|
5
|
+
// current project's AgentSkills/ folder.
|
|
6
|
+
//
|
|
7
|
+
// This is the generic command. `dotnet-setup` is a convenience wrapper over this.
|
|
8
|
+
import path from "path";
|
|
9
|
+
import { loadPack } from "../../core/load-pack.js";
|
|
10
|
+
import { copySkills, ensureAgentSkillsDir } from "../../core/copy-skills.js";
|
|
11
|
+
export function addCommand(program) {
|
|
12
|
+
program
|
|
13
|
+
.command("add <pack> [skillName]")
|
|
14
|
+
.description("Copy a skill (or all skills with --all) from a pack into this project")
|
|
15
|
+
.option("--all", "Copy all skills from the pack", false)
|
|
16
|
+
.option("--force", "Overwrite existing files", false)
|
|
17
|
+
.option("--path <dir>", "Target project root (default: cwd)", process.cwd())
|
|
18
|
+
.action((pack, skillName, options) => {
|
|
19
|
+
if (!skillName && !options.all) {
|
|
20
|
+
console.error("✗ Specify a skill name or pass --all to copy every skill.");
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const targetDir = path.resolve(options.path);
|
|
24
|
+
const { packDir, manifest } = loadPackOrExit(pack);
|
|
25
|
+
let skillsToCopy;
|
|
26
|
+
if (options.all) {
|
|
27
|
+
skillsToCopy = manifest.skills;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const found = manifest.skills.find((s) => s.name === skillName);
|
|
31
|
+
if (!found) {
|
|
32
|
+
const available = manifest.skills.map((s) => s.name).join(", ");
|
|
33
|
+
console.error(`✗ Skill "${skillName}" not found in pack "${pack}".`);
|
|
34
|
+
console.error(` Available: ${available}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
skillsToCopy = [found];
|
|
38
|
+
}
|
|
39
|
+
ensureAgentSkillsDir(targetDir);
|
|
40
|
+
console.log(`\nCopying from ${manifest.name}@${manifest.version} → ${targetDir}\n`);
|
|
41
|
+
const { written, skipped } = copySkills({
|
|
42
|
+
skills: skillsToCopy,
|
|
43
|
+
packDir,
|
|
44
|
+
targetDir,
|
|
45
|
+
force: options.force,
|
|
46
|
+
});
|
|
47
|
+
printSummary(written, skipped);
|
|
48
|
+
if (written.length === 0 && skipped.length > 0) {
|
|
49
|
+
// Everything was skipped — treat as a soft warning, not a hard error.
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function loadPackOrExit(pack) {
|
|
55
|
+
try {
|
|
56
|
+
return loadPack(pack);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
60
|
+
console.error(`✗ ${message}`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function printSummary(written, skipped) {
|
|
65
|
+
console.log("\n" + "─".repeat(50));
|
|
66
|
+
console.log(`✔ Done — ${written.length} written, ${skipped.length} skipped.`);
|
|
67
|
+
if (skipped.length > 0) {
|
|
68
|
+
console.log(" (Run with --force to overwrite skipped files.)");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,8CAA8C;AAC9C,EAAE;AACF,8EAA8E;AAC9E,yCAAyC;AACzC,EAAE;AACF,kFAAkF;AAElF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UA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GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,MAAM,aAAa,OAAO,CAAC,MAAM,WAAW,CAAC,CAAC;IAC9E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { SkillEntry } from "../../core/manifest.js";
|
|
3
|
+
/**
|
|
4
|
+
* Filters a skill list for a specific IDE:
|
|
5
|
+
* - Keeps all non-entry-point skills (shared AgentSkills content).
|
|
6
|
+
* - Keeps only the entry-point skill matching the given IDE.
|
|
7
|
+
*
|
|
8
|
+
* Exported for unit testing; contains no I/O.
|
|
9
|
+
*
|
|
10
|
+
* @throws When `ide` is not a recognised key in IDE_ENTRY_POINT_MAP.
|
|
11
|
+
*/
|
|
12
|
+
export declare function filterSkillsForIde(skills: SkillEntry[], ide: string): SkillEntry[];
|
|
13
|
+
export declare function dotnetSetupCommand(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=dotnet-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dotnet-setup.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsBzD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAAE,EACpB,GAAG,EAAE,MAAM,GACV,UAAU,EAAE,CAYd;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkEzD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/cli/commands/dotnet-setup.ts
|
|
2
|
+
// `agent-skills dotnet-setup [ide]`
|
|
3
|
+
//
|
|
4
|
+
// Convenience command equivalent to:
|
|
5
|
+
// agent-skills add @pratikpsl/agent-skills-dotnet --all
|
|
6
|
+
//
|
|
7
|
+
// When an optional [ide] positional argument is supplied (cursor | claude |
|
|
8
|
+
// codex | copilot | antigravity), only that IDE's entry-point file is written
|
|
9
|
+
// together with all shared AgentSkills files. All other entry-point files are
|
|
10
|
+
// skipped.
|
|
11
|
+
//
|
|
12
|
+
// Without [ide], all skills including every entry-point are copied (original
|
|
13
|
+
// behaviour — no breaking change).
|
|
14
|
+
import path from "path";
|
|
15
|
+
import { loadPack } from "../../core/load-pack.js";
|
|
16
|
+
import { copySkills, ensureAgentSkillsDir } from "../../core/copy-skills.js";
|
|
17
|
+
const DOTNET_PACK = "@pratikpsl/agent-skills-dotnet";
|
|
18
|
+
/**
|
|
19
|
+
* Maps the user-facing IDE name to the manifest skill name for that IDE's
|
|
20
|
+
* entry-point. Skills whose name starts with `entry-point:` but are NOT in
|
|
21
|
+
* this map are filtered out when an IDE is specified.
|
|
22
|
+
*/
|
|
23
|
+
const IDE_ENTRY_POINT_MAP = {
|
|
24
|
+
cursor: "entry-point:cursor",
|
|
25
|
+
claude: "entry-point:claude",
|
|
26
|
+
codex: "entry-point:codex",
|
|
27
|
+
copilot: "entry-point:copilot",
|
|
28
|
+
antigravity: "entry-point:antigravity",
|
|
29
|
+
};
|
|
30
|
+
const ENTRY_POINT_PREFIX = "entry-point:";
|
|
31
|
+
/** Human-readable list of valid IDE names for error messages. */
|
|
32
|
+
const VALID_IDE_NAMES = Object.keys(IDE_ENTRY_POINT_MAP).join(", ");
|
|
33
|
+
/**
|
|
34
|
+
* Filters a skill list for a specific IDE:
|
|
35
|
+
* - Keeps all non-entry-point skills (shared AgentSkills content).
|
|
36
|
+
* - Keeps only the entry-point skill matching the given IDE.
|
|
37
|
+
*
|
|
38
|
+
* Exported for unit testing; contains no I/O.
|
|
39
|
+
*
|
|
40
|
+
* @throws When `ide` is not a recognised key in IDE_ENTRY_POINT_MAP.
|
|
41
|
+
*/
|
|
42
|
+
export function filterSkillsForIde(skills, ide) {
|
|
43
|
+
const targetSkillName = IDE_ENTRY_POINT_MAP[ide];
|
|
44
|
+
if (!targetSkillName) {
|
|
45
|
+
throw new Error(`Unknown IDE "${ide}". Valid options are: ${VALID_IDE_NAMES}`);
|
|
46
|
+
}
|
|
47
|
+
return skills.filter((s) => !s.name.startsWith(ENTRY_POINT_PREFIX) || s.name === targetSkillName);
|
|
48
|
+
}
|
|
49
|
+
export function dotnetSetupCommand(program) {
|
|
50
|
+
program
|
|
51
|
+
.command("dotnet-setup")
|
|
52
|
+
.description(`Install the full .NET/C# agent skill set (shortcut for: add ${DOTNET_PACK} --all).\n` +
|
|
53
|
+
` Optionally pass an IDE name to install only that IDE's entry-point:\n` +
|
|
54
|
+
` ${VALID_IDE_NAMES}`)
|
|
55
|
+
.argument("[ide]", `IDE entry-point to install (${VALID_IDE_NAMES}). Omit to install all.`)
|
|
56
|
+
.option("--force", "Overwrite existing files", false)
|
|
57
|
+
.option("--path <dir>", "Target project root (default: cwd)", process.cwd())
|
|
58
|
+
.action((ide, options) => {
|
|
59
|
+
const targetDir = path.resolve(options.path);
|
|
60
|
+
if (ide !== undefined) {
|
|
61
|
+
console.log(`\n🔧 Setting up .NET agent skills [${ide}] in: ${targetDir}\n`);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(`\n🔧 Setting up .NET agent skills in: ${targetDir}\n`);
|
|
65
|
+
}
|
|
66
|
+
const { packDir, manifest } = loadPackOrExit(DOTNET_PACK);
|
|
67
|
+
let skills;
|
|
68
|
+
if (ide !== undefined) {
|
|
69
|
+
try {
|
|
70
|
+
skills = filterSkillsForIde(manifest.skills, ide);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
74
|
+
console.error(`✗ ${message}`);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
skills = manifest.skills;
|
|
80
|
+
}
|
|
81
|
+
ensureAgentSkillsDir(targetDir);
|
|
82
|
+
console.log(`Copying from ${manifest.name}@${manifest.version}\n`);
|
|
83
|
+
const { written, skipped } = copySkills({
|
|
84
|
+
skills,
|
|
85
|
+
packDir,
|
|
86
|
+
targetDir,
|
|
87
|
+
force: options.force,
|
|
88
|
+
});
|
|
89
|
+
console.log("\n" + "─".repeat(50));
|
|
90
|
+
console.log(`✔ .NET skills installed — ${written.length} written, ${skipped.length} skipped.`);
|
|
91
|
+
if (skipped.length > 0) {
|
|
92
|
+
console.log(" (Run with --force to overwrite skipped files.)");
|
|
93
|
+
}
|
|
94
|
+
if (written.length === 0 && skipped.length === 0) {
|
|
95
|
+
console.error("\n✗ No skills were copied. Check that the pack contains skill entries.");
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function loadPackOrExit(pack) {
|
|
101
|
+
try {
|
|
102
|
+
return loadPack(pack);
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
106
|
+
console.error(`✗ ${message}`);
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=dotnet-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet-setup.js","sourceRoot":"","sources":["../../../src/cli/commands/dotnet-setup.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,oCAAoC;AACpC,EAAE;AACF,qCAAqC;AACrC,0DAA0D;AAC1D,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,WAAW;AACX,EAAE;AACF,6EAA6E;AAC7E,mCAAmC;AAE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AO,GAAG,IAAI,CAsClD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/cli/commands/init.ts
|
|
2
|
+
// `agent-skills init`
|
|
3
|
+
//
|
|
4
|
+
// Scaffolds an empty AgentSkills/ folder + index.json in the current project
|
|
5
|
+
// if one doesn't exist yet. Safe to run multiple times (idempotent).
|
|
6
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
7
|
+
import path from "path";
|
|
8
|
+
export function initCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("init")
|
|
11
|
+
.description("Scaffold an empty AgentSkills/ folder in the current project")
|
|
12
|
+
.option("--path <dir>", "Target project root (default: cwd)", process.cwd())
|
|
13
|
+
.option("--force", "Overwrite existing files", false)
|
|
14
|
+
.action((options) => {
|
|
15
|
+
const targetDir = path.resolve(options.path);
|
|
16
|
+
const agentSkillsDir = path.join(targetDir, "AgentSkills");
|
|
17
|
+
if (existsSync(agentSkillsDir) && !options.force) {
|
|
18
|
+
console.log(`AgentSkills/ already exists at ${agentSkillsDir}`);
|
|
19
|
+
console.log("Use --force to reinitialize.");
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
mkdirSync(agentSkillsDir, { recursive: true });
|
|
23
|
+
console.log(`✓ Created ${agentSkillsDir}`);
|
|
24
|
+
const indexPath = path.join(agentSkillsDir, "index.json");
|
|
25
|
+
if (!existsSync(indexPath) || options.force) {
|
|
26
|
+
const indexContent = {
|
|
27
|
+
skills: [],
|
|
28
|
+
_comment: "Add skills via `agent-skills add <pack> <skillName>` or `agent-skills dotnet-setup`",
|
|
29
|
+
};
|
|
30
|
+
writeFileSync(indexPath, JSON.stringify(indexContent, null, 2) + "\n", "utf8");
|
|
31
|
+
console.log(`✓ Created ${indexPath}`);
|
|
32
|
+
}
|
|
33
|
+
console.log("\n✔ AgentSkills initialized. Run `agent-skills dotnet-setup` to add .NET skills.");
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingUR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AAC,SAAS,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5C,MAAM,YAAY,GAAG;gBACnB,MAAM,EAAE,EAAE;gBACV,QAAQ,EACN,qFAAqF;aACxF,CAAC;YACF,aAAa,CACX,SAAS,EACT,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAC5C,MAAM,CACP,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,CAAC,GAAG,CACT,kFAAkF,CACnF,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+BlD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/cli/commands/list.ts
|
|
2
|
+
// `agent-skills list [pack]`
|
|
3
|
+
//
|
|
4
|
+
// Lists available skills in an installed or available pack.
|
|
5
|
+
// When no pack is specified, lists all packs the CLI knows about.
|
|
6
|
+
import { resolvePack } from "../../core/resolve-pack.js";
|
|
7
|
+
import { readManifest } from "../../core/manifest.js";
|
|
8
|
+
export function listCommand(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("list [pack]")
|
|
11
|
+
.description("List available skills in a pack (default: all known packs)")
|
|
12
|
+
.action((pack) => {
|
|
13
|
+
const packsToList = pack
|
|
14
|
+
? [pack]
|
|
15
|
+
: ["dotnet"]; // Extend this array as new packs are added.
|
|
16
|
+
let exitCode = 0;
|
|
17
|
+
for (const packName of packsToList) {
|
|
18
|
+
try {
|
|
19
|
+
const packDir = resolvePack(packName);
|
|
20
|
+
const manifest = readManifest(packDir);
|
|
21
|
+
console.log(`\n📦 ${manifest.name}@${manifest.version}`);
|
|
22
|
+
console.log("─".repeat(50));
|
|
23
|
+
for (const skill of manifest.skills) {
|
|
24
|
+
console.log(` • ${skill.name.padEnd(28)} ${skill.description}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
29
|
+
console.error(`\n✗ Could not list pack "${packName}": ${message}`);
|
|
30
|
+
exitCode = 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (exitCode !== 0)
|
|
34
|
+
process.exit(exitCode);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,6BAA6B;AAC7B,EAAE;AACF,4DAA4D;AAC5D,kEAAkE;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CAAC,CAAC,IAAa,EAAE,EAAE;QACxB,MAAM,WAAW,GAAG,IAAI;YACtB,CAAC,CAAC,CAAC,IAAI,CAAC;YACR,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,4CAA4C;QAE5D,IAAI,QAAQ,GAAG,CAAC,CAAC;QAEjB,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;gBACtC,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;gBAEvC,OAAO,CAAC,GAAG,CAAC,QAAQ,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;gBACzD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBAE5B,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACpC,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;gBACnE,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,OAAO,CAAC,KAAK,CAAC,4BAA4B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;gBACnE,QAAQ,GAAG,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,KAAK,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/cli/index.ts
|
|
2
|
+
// Wires up the root `commander` program and registers all sub-commands.
|
|
3
|
+
// This file is the only place that imports commander; sub-commands receive
|
|
4
|
+
// the program instance so they stay independently testable.
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import { createRequire } from "module";
|
|
7
|
+
import { initCommand } from "./commands/init.js";
|
|
8
|
+
import { listCommand } from "./commands/list.js";
|
|
9
|
+
import { addCommand } from "./commands/add.js";
|
|
10
|
+
import { dotnetSetupCommand } from "./commands/dotnet-setup.js";
|
|
11
|
+
// Read version from our own package.json without a JSON import assertion
|
|
12
|
+
// (works in Node 18 without the --experimental-json-modules flag).
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const { version } = require("../../package.json");
|
|
15
|
+
const program = new Command();
|
|
16
|
+
program
|
|
17
|
+
.name("agent-skills")
|
|
18
|
+
.description("Scaffold and manage AI agent skills across projects")
|
|
19
|
+
.version(version);
|
|
20
|
+
initCommand(program);
|
|
21
|
+
listCommand(program);
|
|
22
|
+
addCommand(program);
|
|
23
|
+
dotnetSetupCommand(program);
|
|
24
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
25
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
26
|
+
console.error(`\n✗ ${message}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,wEAAwE;AACxE,2EAA2E;AAC3E,4DAA4D;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,yEAAyE;AACzE,mEAAmE;AACnE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;AAEzE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,cAAc,CAAC;KACpB,WAAW,CAAC,qDAAqD,CAAC;KAClE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,UAAU,CAAC,OAAO,CAAC,CAAC;AACpB,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE5B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACtD,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,KAAK,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SkillEntry } from "./manifest.js";
|
|
2
|
+
export interface CopyResult {
|
|
3
|
+
/** Files that were successfully written. */
|
|
4
|
+
written: string[];
|
|
5
|
+
/** Files that were skipped because they already exist. */
|
|
6
|
+
skipped: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface CopySkillsOptions {
|
|
9
|
+
/** Skills to copy, filtered from the manifest (all or a single skill). */
|
|
10
|
+
skills: SkillEntry[];
|
|
11
|
+
/** Absolute path to the pack root. */
|
|
12
|
+
packDir: string;
|
|
13
|
+
/** Absolute path to the target project root. */
|
|
14
|
+
targetDir: string;
|
|
15
|
+
/** When true, overwrite existing files. */
|
|
16
|
+
force: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Copies a list of skill source directories into the target project.
|
|
20
|
+
*/
|
|
21
|
+
export declare function copySkills(options: CopySkillsOptions): CopyResult;
|
|
22
|
+
/**
|
|
23
|
+
* Ensures the AgentSkills root directory exists in the target project.
|
|
24
|
+
*
|
|
25
|
+
* @returns Absolute path to AgentSkills/.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ensureAgentSkillsDir(targetDir: string): string;
|
|
28
|
+
//# sourceMappingURL=copy-skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-skills.d.ts","sourceRoot":"","sources":["../../src/core/copy-skills.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CA0CjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI9D"}
|