@pratikpsl/agent-skills 1.1.0 → 1.3.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 +58 -22
- package/dist/cli/index.js +4 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/core/ide-map.js +3 -3
- package/dist/core/ide-map.js.map +1 -1
- package/dist/core/install-template.d.ts +2 -2
- package/dist/core/install-template.d.ts.map +1 -1
- package/dist/core/install-template.js +124 -43
- package/dist/core/install-template.js.map +1 -1
- package/dist/core/resolve-template.d.ts.map +1 -1
- package/dist/core/resolve-template.js +1 -1
- package/dist/core/resolve-template.js.map +1 -1
- package/package.json +3 -1
- package/templates/default/instructions.md +9 -2
- package/templates/dotnet/AgentSkills/skills/index.md +14 -0
- package/templates/python/AgentSkills/agents/architect.md +13 -0
- package/templates/python/AgentSkills/agents/developer.md +23 -0
- package/templates/python/AgentSkills/skills/index.md +14 -0
- package/templates/python/AgentSkills/skills/performance/SKILL.md +26 -0
- package/templates/python/AgentSkills/skills/python-best-practices/SKILL.md +59 -0
- package/templates/python/AgentSkills/skills/python-typing/SKILL.md +42 -0
- package/templates/python/AgentSkills/skills/testing/SKILL.md +42 -0
- package/templates/react/AgentSkills/skills/index.md +13 -0
- package/templates/rust/AgentSkills/agents/architect.md +14 -0
- package/templates/rust/AgentSkills/agents/developer.md +24 -0
- package/templates/rust/AgentSkills/skills/index.md +14 -0
- package/templates/rust/AgentSkills/skills/performance/SKILL.md +43 -0
- package/templates/rust/AgentSkills/skills/rust-best-practices/SKILL.md +48 -0
- package/templates/rust/AgentSkills/skills/rust-ownership/SKILL.md +40 -0
- package/templates/rust/AgentSkills/skills/testing/SKILL.md +60 -0
- package/templates/shared/AgentSkills/OPERATING.md +2 -2
- package/templates/shared/AgentSkills/agents/{reviewer.agent.md → reviewer.md} +2 -0
- package/templates/shared/AgentSkills/skills/index.md +10 -0
- package/templates/shared/AgentSkills/skills/principles/SKILL.md +1 -1
- package/templates/shared/AgentSkills/skills/review/SKILL.md +33 -0
- package/templates/shared/AgentSkills/skills/standards/SKILL.md +12 -3
- package/templates/shared/entry-points/instructions.md +4 -3
- /package/templates/dotnet/AgentSkills/agents/{architect.agent.md → architect.md} +0 -0
- /package/templates/dotnet/AgentSkills/agents/{developer.agent.md → developer.md} +0 -0
- /package/templates/react/AgentSkills/agents/{developer.agent.md → developer.md} +0 -0
- /package/templates/shared/AgentSkills/agents/{architect.agent.md → architect.md} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @pratikpsl/agent-skills
|
|
2
2
|
|
|
3
|
-
> Scaffold and manage AI agent skills across any project — for Cursor, Claude, Codex, Copilot, Antigravity,
|
|
3
|
+
> Scaffold and manage AI agent skills across any project — for Cursor, Claude, Codex, Copilot, Antigravity, and Cline.
|
|
4
4
|
|
|
5
5
|
`@pratikpsl/agent-skills` is a single npm package: a TypeScript CLI plus bundled templates under `templates/`. No runtime network fetch — templates ship inside the package, so setup works offline after install.
|
|
6
6
|
|
|
@@ -10,22 +10,31 @@
|
|
|
10
10
|
|
|
11
11
|
From any project root (Node 18+ or Bun):
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Shared Agent Skills (Universal Skills & Personas)
|
|
14
14
|
|
|
15
|
-
Running with **
|
|
15
|
+
Running with an **agent name** or `shared` automatically installs shared skills (`AgentSkills/skills/review`, `AgentSkills/skills/principles`, `AgentSkills/skills/standards`, `AgentSkills/skills/security`), agent personas (`AgentSkills/agents/architect.md`, `AgentSkills/agents/reviewer.md`), and the agent's entry point:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
#
|
|
19
|
-
npx @pratikpsl/agent-skills
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
npx @pratikpsl/agent-skills
|
|
23
|
-
npx @pratikpsl/agent-skills
|
|
24
|
-
npx @pratikpsl/agent-skills
|
|
25
|
-
npx @pratikpsl/agent-skills
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
npx @pratikpsl/agent-skills
|
|
18
|
+
# Install shared skills + specific IDE / Agent entry point
|
|
19
|
+
npx @pratikpsl/agent-skills antigravity # → .agents/rules/GEMINI.md + AgentSkills/
|
|
20
|
+
npx @pratikpsl/agent-skills cursor # → .cursor/rules/instructions.md + AgentSkills/
|
|
21
|
+
npx @pratikpsl/agent-skills claude # → AGENTS.md + AgentSkills/
|
|
22
|
+
npx @pratikpsl/agent-skills code # → AGENTS.md + AgentSkills/
|
|
23
|
+
npx @pratikpsl/agent-skills codex # → AGENTS.md + AgentSkills/
|
|
24
|
+
npx @pratikpsl/agent-skills copilot # → .github/copilot-instructions.md + AgentSkills/
|
|
25
|
+
npx @pratikpsl/agent-skills cline # → .clinerules + AgentSkills/
|
|
26
|
+
|
|
27
|
+
# Install shared skills across all IDE entry points
|
|
28
|
+
npx @pratikpsl/agent-skills shared
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Compact Single-File Instructions
|
|
32
|
+
|
|
33
|
+
To scaffold compact single-file agent instructions without the `AgentSkills/` folder:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @pratikpsl/agent-skills default
|
|
37
|
+
npx @pratikpsl/agent-skills default --agent antigravity
|
|
29
38
|
```
|
|
30
39
|
|
|
31
40
|
### .NET / C# Template
|
|
@@ -35,7 +44,7 @@ npx @pratikpsl/agent-skills cline # → .clinerules
|
|
|
35
44
|
npx @pratikpsl/agent-skills dotnet
|
|
36
45
|
|
|
37
46
|
# Install .NET agent skills + specific agent entry point only
|
|
38
|
-
npx @pratikpsl/agent-skills dotnet --agent
|
|
47
|
+
npx @pratikpsl/agent-skills dotnet --agent code
|
|
39
48
|
npx @pratikpsl/agent-skills dotnet --agent cursor
|
|
40
49
|
```
|
|
41
50
|
|
|
@@ -50,6 +59,28 @@ npx @pratikpsl/agent-skills react --agent cursor
|
|
|
50
59
|
npx @pratikpsl/agent-skills react --agent claude
|
|
51
60
|
```
|
|
52
61
|
|
|
62
|
+
### Python Template
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Install Python agent skills + all IDE entry points
|
|
66
|
+
npx @pratikpsl/agent-skills python
|
|
67
|
+
|
|
68
|
+
# Install Python agent skills + specific agent entry point only
|
|
69
|
+
npx @pratikpsl/agent-skills python --agent cursor
|
|
70
|
+
npx @pratikpsl/agent-skills python --agent claude
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Rust Template
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Install Rust agent skills + all IDE entry points
|
|
77
|
+
npx @pratikpsl/agent-skills rust
|
|
78
|
+
|
|
79
|
+
# Install Rust agent skills + specific agent entry point only
|
|
80
|
+
npx @pratikpsl/agent-skills rust --agent cursor
|
|
81
|
+
npx @pratikpsl/agent-skills rust --agent claude
|
|
82
|
+
```
|
|
83
|
+
|
|
53
84
|
*(You can also use `bunx @pratikpsl/agent-skills` in Bun environments).*
|
|
54
85
|
|
|
55
86
|
---
|
|
@@ -60,13 +91,14 @@ npx @pratikpsl/agent-skills react --agent claude
|
|
|
60
91
|
Usage: agent-skills [options] [template]
|
|
61
92
|
|
|
62
93
|
Arguments:
|
|
63
|
-
template Template: default, dotnet, react; agent names install
|
|
94
|
+
template Template: default, dotnet, python, react, rust, shared; agent names install shared guidance
|
|
64
95
|
|
|
65
96
|
Options:
|
|
66
97
|
-V, --version output the version number
|
|
67
|
-
--agent <name> Install one agent entry point: antigravity, claude, cline, codex, copilot, cursor
|
|
98
|
+
--agent <name> Install one agent entry point: antigravity, claude, cline, code, codex, copilot, cursor
|
|
68
99
|
--force Overwrite installed files (default: false)
|
|
69
|
-
--
|
|
100
|
+
--hardlink Hardlink matching entry points (default: true)
|
|
101
|
+
--no-hardlink Do not hardlink matching entry points
|
|
70
102
|
--path <dir> Target project root (default: current working directory)
|
|
71
103
|
-h, --help display help for command
|
|
72
104
|
```
|
|
@@ -77,10 +109,12 @@ Options:
|
|
|
77
109
|
|
|
78
110
|
| Template | Path | Description |
|
|
79
111
|
| --- | --- | --- |
|
|
80
|
-
| `
|
|
81
|
-
| `dotnet` | `templates/dotnet/` | .NET/C# skills, architecture & developer agents, memory |
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
112
|
+
| `shared` | `templates/shared/` | Base operating contract, core skills (principles, standards, security, review), review & architecture agents (`architect.md`, `reviewer.md`) |
|
|
113
|
+
| `dotnet` | `templates/dotnet/` | .NET/C# skills, architecture & developer agents (`architect.md`, `developer.md`), memory |
|
|
114
|
+
| `python` | `templates/python/` | Python skills (PEP 8, uv, typing, testing, performance), architecture & developer agents (`architect.md`, `developer.md`) |
|
|
115
|
+
| `react` | `templates/react/` | React & TypeScript skills, frontend testing, developer agent (`developer.md`) |
|
|
116
|
+
| `rust` | `templates/rust/` | Rust skills (ownership, best-practices, testing, performance), architecture & developer agents (`architect.md`, `developer.md`) |
|
|
117
|
+
| `default` | `templates/default/` | Compact single-file agent instructions without AgentSkills folder |
|
|
84
118
|
|
|
85
119
|
---
|
|
86
120
|
|
|
@@ -98,7 +132,9 @@ coding-skills-ai/
|
|
|
98
132
|
├── templates/
|
|
99
133
|
│ ├── default/ # Single-file instructions
|
|
100
134
|
│ ├── dotnet/ # .NET template
|
|
135
|
+
│ ├── python/ # Python template
|
|
101
136
|
│ ├── react/ # React template
|
|
137
|
+
│ ├── rust/ # Rust template
|
|
102
138
|
│ └── shared/ # Shared operating contract & memory
|
|
103
139
|
├── tests/ # Vitest test suite
|
|
104
140
|
├── bun.lock # Reproducible lockfile
|
package/dist/cli/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function runInstall(template, options) {
|
|
|
11
11
|
if (implicitAgent && options.agent) {
|
|
12
12
|
throw new Error("Choose an agent with either the argument or --agent, not both.");
|
|
13
13
|
}
|
|
14
|
-
const selectedTemplate = implicitAgent ? "
|
|
14
|
+
const selectedTemplate = implicitAgent ? "shared" : template ?? "shared";
|
|
15
15
|
const agent = implicitAgent ?? parseAgentName(options.agent);
|
|
16
16
|
const targetDir = options.path;
|
|
17
17
|
const hardlink = options.hardlink ?? true;
|
|
@@ -37,10 +37,11 @@ program
|
|
|
37
37
|
.name("agent-skills")
|
|
38
38
|
.description("Install shared coding-agent guidance and a framework template")
|
|
39
39
|
.version(version)
|
|
40
|
-
.argument("[template]", `Template: ${TEMPLATE_NAMES.join(", ")}; agent names install
|
|
40
|
+
.argument("[template]", `Template: ${TEMPLATE_NAMES.join(", ")}; agent names install shared guidance`)
|
|
41
41
|
.option("--agent <name>", `Install one agent entry point: ${AGENT_NAMES.join(", ")}`)
|
|
42
42
|
.option("--force", "Overwrite installed files", false)
|
|
43
|
-
.option("--
|
|
43
|
+
.option("--hardlink", "Hardlink matching entry points", true)
|
|
44
|
+
.option("--no-hardlink", "Do not hardlink matching entry points")
|
|
44
45
|
.option("--path <dir>", "Target project root", process.cwd())
|
|
45
46
|
.action((template, options) => runInstall(template, options));
|
|
46
47
|
program.parseAsync(process.argv).catch((error) => {
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAErG,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;AASzE,SAAS,UAAU,CAAC,QAA4B,EAAE,OAAmB;IACnE,MAAM,OAAO,GAAG,QAAQ,I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gCAAgC,EAAE,IAAI,CAAC;KAC5D,MAAM,CAAC,eAAe,EAAE,uCAAuC,CAAC;KAChE,MAAM,CAAC,cAAc,EAAE,qBAAqB,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;KAC5D,MAAM,CAAC,CAAC,QAA4B,EAAE,OAAmB,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
package/dist/core/ide-map.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const IDE_ENTRY_POINTS = {
|
|
2
|
-
antigravity: ".agents/GEMINI.md",
|
|
3
|
-
claude: "
|
|
2
|
+
antigravity: ".agents/rules/GEMINI.md",
|
|
3
|
+
claude: "AGENTS.md",
|
|
4
4
|
cline: ".clinerules",
|
|
5
|
+
code: "AGENTS.md",
|
|
5
6
|
codex: "AGENTS.md",
|
|
6
7
|
copilot: ".github/copilot-instructions.md",
|
|
7
8
|
cursor: ".cursor/rules/instructions.md",
|
|
8
|
-
windsurf: ".windsurfrules",
|
|
9
9
|
};
|
|
10
10
|
export const AGENT_NAMES = Object.keys(IDE_ENTRY_POINTS);
|
|
11
11
|
export function parseAgentName(value) {
|
package/dist/core/ide-map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ide-map.js","sourceRoot":"","sources":["../../src/core/ide-map.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ide-map.js","sourceRoot":"","sources":["../../src/core/ide-map.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,WAAW,EAAE,yBAAyB;IACtC,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,+BAA+B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAEzD,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,IAAI,KAAK,IAAI,gBAAgB;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,cAAc,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -5,7 +5,7 @@ export interface InstallResult {
|
|
|
5
5
|
export interface InstallOptions {
|
|
6
6
|
agent?: string;
|
|
7
7
|
force: boolean;
|
|
8
|
-
hardlink
|
|
8
|
+
hardlink?: boolean;
|
|
9
9
|
targetDir: string;
|
|
10
10
|
sharedDir: string;
|
|
11
11
|
templateDir: string;
|
|
@@ -13,7 +13,7 @@ export interface InstallOptions {
|
|
|
13
13
|
export interface InstallDefaultOptions {
|
|
14
14
|
agent?: string;
|
|
15
15
|
force: boolean;
|
|
16
|
-
hardlink
|
|
16
|
+
hardlink?: boolean;
|
|
17
17
|
targetDir: string;
|
|
18
18
|
}
|
|
19
19
|
export declare function installTemplate(options: InstallOptions): InstallResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-template.d.ts","sourceRoot":"","sources":["../../src/core/install-template.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"install-template.d.ts","sourceRoot":"","sources":["../../src/core/install-template.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AA6OD,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CA0BtE;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,GAC7B,aAAa,CAUf"}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
|
-
import { copyFileSync, existsSync,
|
|
1
|
+
import fs, { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { IDE_ENTRY_POINTS } from "./ide-map.js";
|
|
4
|
+
const UTF8_ENCODING = "utf8";
|
|
5
|
+
const AGENTS_FILENAME = "AGENTS.md";
|
|
6
|
+
const DEFAULT_RELATIVE_PREFIX = "./";
|
|
7
|
+
const PARENT_DIR_PREFIX = "../";
|
|
8
|
+
const AGENT_SKILLS_DIR = "AgentSkills/";
|
|
9
|
+
const ANTIGRAVITY_TARGET = ".agents/rules/GEMINI.md";
|
|
10
|
+
const CURSOR_TARGET = ".cursor/rules/instructions.md";
|
|
11
|
+
const ANTIGRAVITY_FRONTMATTER = `---
|
|
12
|
+
trigger: always_on
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
name: core-entry-point
|
|
18
|
+
description: >
|
|
19
|
+
Load on every task. Universal guidelines, standards, and verification rules.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
`;
|
|
24
|
+
const CURSOR_FRONTMATTER = `---
|
|
25
|
+
description: Universal agent instructions and standards
|
|
26
|
+
globs: *
|
|
27
|
+
alwaysApply: true
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
`;
|
|
4
31
|
function relativePath(targetDir, filePath) {
|
|
5
32
|
return path.relative(targetDir, filePath).replaceAll("\\", "/");
|
|
6
33
|
}
|
|
@@ -33,7 +60,7 @@ function copyFile(source, destination, force, existingBeforeInstall) {
|
|
|
33
60
|
copyFileSync(source, destination);
|
|
34
61
|
return true;
|
|
35
62
|
}
|
|
36
|
-
function mergeDirectory(sourceDir, targetDir,
|
|
63
|
+
function mergeDirectory(sourceDir, targetDir, context) {
|
|
37
64
|
if (!existsSync(sourceDir))
|
|
38
65
|
return;
|
|
39
66
|
mkdirSync(targetDir, { recursive: true });
|
|
@@ -41,72 +68,126 @@ function mergeDirectory(sourceDir, targetDir, projectDir, force, existingBeforeI
|
|
|
41
68
|
const source = path.join(sourceDir, entry.name);
|
|
42
69
|
const target = path.join(targetDir, entry.name);
|
|
43
70
|
if (entry.isDirectory()) {
|
|
44
|
-
mergeDirectory(source, target,
|
|
71
|
+
mergeDirectory(source, target, context);
|
|
72
|
+
continue;
|
|
45
73
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
if (!result.skipped.includes(rel)) {
|
|
55
|
-
result.skipped.push(rel);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
74
|
+
const rel = relativePath(context.projectDir, target);
|
|
75
|
+
const copied = copyFile(source, target, context.force, context.existingBeforeInstall);
|
|
76
|
+
const list = copied ? context.result.written : context.result.skipped;
|
|
77
|
+
if (!list.includes(rel)) {
|
|
78
|
+
list.push(rel);
|
|
58
79
|
}
|
|
59
80
|
}
|
|
60
81
|
}
|
|
61
82
|
function selectedEntryPoints(agent) {
|
|
62
|
-
|
|
83
|
+
if (agent)
|
|
84
|
+
return [IDE_ENTRY_POINTS[agent]];
|
|
85
|
+
const all = Array.from(new Set(Object.values(IDE_ENTRY_POINTS)));
|
|
86
|
+
return all.sort((a, b) => (a === AGENTS_FILENAME ? -1 : b === AGENTS_FILENAME ? 1 : a.localeCompare(b)));
|
|
87
|
+
}
|
|
88
|
+
function getRelativePrefix(destination) {
|
|
89
|
+
const dir = path.dirname(destination).replaceAll("\\", "/");
|
|
90
|
+
if (dir === "." || dir === "")
|
|
91
|
+
return DEFAULT_RELATIVE_PREFIX;
|
|
92
|
+
const depth = dir.split("/").filter(Boolean).length;
|
|
93
|
+
return PARENT_DIR_PREFIX.repeat(depth);
|
|
94
|
+
}
|
|
95
|
+
function addAgentsLinkNote(content, prefix) {
|
|
96
|
+
if (content.includes(AGENTS_FILENAME))
|
|
97
|
+
return content;
|
|
98
|
+
const agentsLink = prefix === DEFAULT_RELATIVE_PREFIX ? `./${AGENTS_FILENAME}` : `${prefix}${AGENTS_FILENAME}`;
|
|
99
|
+
const note = `\n> Follow universal guidelines and standards in [${AGENTS_FILENAME}](${agentsLink}).\n`;
|
|
100
|
+
const headerMatch = content.match(/^# [^\n]+/m);
|
|
101
|
+
if (!headerMatch || headerMatch.index === undefined) {
|
|
102
|
+
return `${note}\n${content}`;
|
|
103
|
+
}
|
|
104
|
+
const insertPos = headerMatch.index + headerMatch[0].length;
|
|
105
|
+
return content.slice(0, insertPos) + note + content.slice(insertPos);
|
|
106
|
+
}
|
|
107
|
+
function formatEntryPoint(destination, content, hasAgentsMd) {
|
|
108
|
+
const prefix = getRelativePrefix(destination);
|
|
109
|
+
let adjusted = content;
|
|
110
|
+
if (prefix !== DEFAULT_RELATIVE_PREFIX) {
|
|
111
|
+
adjusted = adjusted.replaceAll(AGENT_SKILLS_DIR, `${prefix}${AGENT_SKILLS_DIR}`);
|
|
112
|
+
}
|
|
113
|
+
if (prefix !== DEFAULT_RELATIVE_PREFIX && hasAgentsMd) {
|
|
114
|
+
adjusted = addAgentsLinkNote(adjusted, prefix);
|
|
115
|
+
}
|
|
116
|
+
if (destination === ANTIGRAVITY_TARGET) {
|
|
117
|
+
adjusted = `${ANTIGRAVITY_FRONTMATTER}${adjusted}`;
|
|
118
|
+
}
|
|
119
|
+
else if (destination === CURSOR_TARGET) {
|
|
120
|
+
adjusted = `${CURSOR_FRONTMATTER}${adjusted}`;
|
|
121
|
+
}
|
|
122
|
+
return adjusted;
|
|
123
|
+
}
|
|
124
|
+
function tryHardlink(primaryPath, target) {
|
|
125
|
+
try {
|
|
126
|
+
fs.linkSync(primaryPath, target);
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
63
132
|
}
|
|
64
|
-
function
|
|
65
|
-
if (existingBeforeInstall.has(target) && !
|
|
133
|
+
function writeOrLinkEntryPoint(target, content, primaryPath, context) {
|
|
134
|
+
if (context.existingBeforeInstall.has(target) && !context.force) {
|
|
66
135
|
return false;
|
|
67
136
|
}
|
|
68
137
|
if (existsSync(target)) {
|
|
69
138
|
rmSync(target, { force: true, recursive: true });
|
|
70
139
|
}
|
|
71
140
|
mkdirSync(path.dirname(target), { recursive: true });
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
// Non-hardlink-compatible filesystems use copy fallback
|
|
79
|
-
}
|
|
141
|
+
const linked = context.hardlink && primaryPath && tryHardlink(primaryPath, target);
|
|
142
|
+
if (!linked) {
|
|
143
|
+
writeFileSync(target, content, UTF8_ENCODING);
|
|
80
144
|
}
|
|
81
|
-
copyFileSync(source, target);
|
|
82
145
|
return true;
|
|
83
146
|
}
|
|
84
147
|
function installEntryPoints(source, options, existingBeforeInstall, result) {
|
|
85
|
-
|
|
86
|
-
|
|
148
|
+
const baseContent = readFileSync(source, UTF8_ENCODING);
|
|
149
|
+
const destinations = selectedEntryPoints(options.agent);
|
|
150
|
+
const agentsPath = path.join(options.targetDir, AGENTS_FILENAME);
|
|
151
|
+
const willHaveAgentsMd = destinations.includes(AGENTS_FILENAME) ||
|
|
152
|
+
existingBeforeInstall.has(agentsPath) ||
|
|
153
|
+
existsSync(agentsPath);
|
|
154
|
+
const writeContext = {
|
|
155
|
+
existingBeforeInstall,
|
|
156
|
+
force: options.force,
|
|
157
|
+
hardlink: options.hardlink ?? true,
|
|
158
|
+
};
|
|
159
|
+
const contentToPrimaryPath = new Map();
|
|
160
|
+
for (const destination of destinations) {
|
|
87
161
|
const target = path.join(options.targetDir, destination);
|
|
88
162
|
const rel = relativePath(options.targetDir, target);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
163
|
+
const content = formatEntryPoint(destination, baseContent, willHaveAgentsMd);
|
|
164
|
+
const primaryPath = contentToPrimaryPath.get(content);
|
|
165
|
+
const written = writeOrLinkEntryPoint(target, content, primaryPath, writeContext);
|
|
166
|
+
const list = written ? result.written : result.skipped;
|
|
167
|
+
if (!list.includes(rel)) {
|
|
168
|
+
list.push(rel);
|
|
94
169
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
result.skipped.push(rel);
|
|
98
|
-
}
|
|
170
|
+
if (written && !contentToPrimaryPath.has(content)) {
|
|
171
|
+
contentToPrimaryPath.set(content, target);
|
|
99
172
|
}
|
|
100
173
|
}
|
|
101
174
|
}
|
|
102
175
|
export function installTemplate(options) {
|
|
103
176
|
const result = { written: [], skipped: [] };
|
|
104
177
|
const existing = collectExistingFiles(options.targetDir);
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
178
|
+
const mergeCtx = {
|
|
179
|
+
existingBeforeInstall: existing,
|
|
180
|
+
force: options.force,
|
|
181
|
+
projectDir: options.targetDir,
|
|
182
|
+
result,
|
|
183
|
+
};
|
|
184
|
+
const sharedSkills = path.join(options.sharedDir, AGENT_SKILLS_DIR);
|
|
185
|
+
const templateSkills = path.join(options.templateDir, AGENT_SKILLS_DIR);
|
|
186
|
+
const targetSkills = path.join(options.targetDir, AGENT_SKILLS_DIR);
|
|
187
|
+
mergeDirectory(sharedSkills, targetSkills, mergeCtx);
|
|
188
|
+
if (path.resolve(templateSkills) !== path.resolve(sharedSkills)) {
|
|
189
|
+
mergeDirectory(templateSkills, targetSkills, mergeCtx);
|
|
190
|
+
}
|
|
110
191
|
installEntryPoints(path.join(options.sharedDir, "entry-points", "instructions.md"), options, existing, result);
|
|
111
192
|
return result;
|
|
112
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-template.js","sourceRoot":"","sources":["../../src/core/install-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"install-template.js","sourceRoot":"","sources":["../../src/core/install-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC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O,EACP,QAAQ,EACR,MAAM,CACP,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,SAAiB,EACjB,OAA8B;IAE9B,MAAM,MAAM,GAAkB,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC3D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzD,kBAAkB,CAChB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EACvC,OAAO,EACP,QAAQ,EACR,MAAM,CACP,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-template.d.ts","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"resolve-template.d.ts","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,UAA6D,CAAC;AAMzF,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWpD"}
|
|
@@ -2,7 +2,7 @@ import { existsSync } from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
export const TEMPLATE_NAMES = ["default", "dotnet", "react"];
|
|
5
|
+
export const TEMPLATE_NAMES = ["default", "dotnet", "python", "react", "rust", "shared"];
|
|
6
6
|
function templatesRoot() {
|
|
7
7
|
return path.resolve(__dirname, "..", "..", "templates");
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-template.js","sourceRoot":"","sources":["../../src/core/resolve-template.ts"],"names":[],"mappings":"AAA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W,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,qCAAqC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pratikpsl/agent-skills",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "CLI to scaffold and manage AI agent skills across projects — like shadcn/ui, but for Cursor, Claude, Codex, Copilot, Antigravity, and more",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agent-skills": "dist/bin/agent-skills.js"
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"copilot",
|
|
27
27
|
"codex",
|
|
28
28
|
"dotnet",
|
|
29
|
+
"python",
|
|
30
|
+
"rust",
|
|
29
31
|
"agents",
|
|
30
32
|
"antigravity",
|
|
31
33
|
"typescript"
|
|
@@ -18,7 +18,8 @@ minimizing the diff, following the project's own architecture and conventions.
|
|
|
18
18
|
- Keep functions under 50 lines, nesting depth at most 2 levels (prefer early returns), and signatures under 4 parameters.
|
|
19
19
|
- Use meaningful names and named constants/enums (no magic numbers or strings).
|
|
20
20
|
- Design self-describing APIs, structured schemas, and human-/machine-readable contracts.
|
|
21
|
-
- Comment only where non-obvious rationale is required, not what the code already says.
|
|
21
|
+
- Comment only where non-obvious rationale is required, not what the code already says. Comments should explain "why" not "what". CODE SHOULD BE SELF-DESCRIBING.
|
|
22
|
+
|
|
22
23
|
|
|
23
24
|
### Reliability & Security
|
|
24
25
|
- Never hardcode, commit, or log secrets, credentials, tokens, or sensitive user data.
|
|
@@ -26,8 +27,14 @@ minimizing the diff, following the project's own architecture and conventions.
|
|
|
26
27
|
- Use idiomatic non-blocking `async`/`await`; ensure code is free of race conditions and deadlocks.
|
|
27
28
|
- Avoid deprecated APIs and patterns; introduce new dependencies only when strictly necessary (permissive license, actively maintained).
|
|
28
29
|
|
|
30
|
+
### Review & Verification
|
|
31
|
+
- Review code against five core dimensions: correctness (boundaries, errors, race conditions), readability (depth <= 2, functions <= 50 lines), architecture (SOLID, KISS), security, and performance.
|
|
32
|
+
- Review tests first; address root causes over symptoms (fix shared logic once).
|
|
33
|
+
- Categorize findings clearly (Critical, Important, Suggestion) and provide concrete, actionable fixes.
|
|
34
|
+
- Maximum 2 levels of nesting; prefer early returns to flatten control flow.
|
|
35
|
+
|
|
29
36
|
## Definition of Done
|
|
30
|
-
- Builds cleanly
|
|
37
|
+
- Builds cleanly without any errors.
|
|
31
38
|
- No debug code, dead code, unused imports, or temporary files left behind.
|
|
32
39
|
- Changes are minimal, focused, covered by tests, and easy to review.
|
|
33
40
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Skills Index
|
|
2
|
+
|
|
3
|
+
Consult this index to load only the skills relevant to the current task.
|
|
4
|
+
|
|
5
|
+
| Skill | Path | Description / When to Load |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
|
|
8
|
+
| standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
|
|
9
|
+
| security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
|
|
10
|
+
| review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
|
|
11
|
+
| dotnet-best-practices | AgentSkills/skills/dotnet-best-practices/SKILL.md | C# idioms, CQRS, EF Core, DI lifetimes, async/await, logging |
|
|
12
|
+
| dotnet-api | AgentSkills/skills/dotnet-api/SKILL.md | RESTful API design, HTTP methods, pagination, OpenAPI/Swagger |
|
|
13
|
+
| csharp-xunit | AgentSkills/skills/csharp-xunit/SKILL.md | xUnit testing, AAA pattern, Facts vs Theories, mocking, assertions |
|
|
14
|
+
| performance | AgentSkills/skills/performance/SKILL.md | Span/ReadOnlySpan, ValueTask, EF Core query tuning, memory pooling |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Python architectural design, Clean Architecture, module boundaries, and pyproject.toml packaging.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python Architect
|
|
7
|
+
|
|
8
|
+
## Architectural Principles
|
|
9
|
+
- **Layered Separation**: Enforce clean boundaries across `domain` (entities, value objects), `application` (use cases, services), `infrastructure` (DB, HTTP, queue adapters), and `api` (FastAPI/Flask routes or CLI entry points).
|
|
10
|
+
- **Dependency Direction**: Outer layers depend on inner layers; never let `domain` import from `infrastructure`.
|
|
11
|
+
- **Contract-First Design**: Define `pydantic` schemas and typed interfaces before implementation. Treat data shapes as the primary design artifact.
|
|
12
|
+
- **Packaging**: Structure projects with `pyproject.toml` (`[project]`, `[build-system]`, `[tool.mypy]`, `[tool.ruff]`). Use namespace packages only when cross-team sharing genuinely requires it.
|
|
13
|
+
- **Genuine Reusability**: Extract shared utilities only when the same logic is needed across at least two distinct domains. Avoid premature abstraction (YAGNI).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: developer
|
|
3
|
+
description: Python feature implementation, async I/O, strict static typing, and uv project management.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python Developer
|
|
7
|
+
|
|
8
|
+
## Implementation Principles
|
|
9
|
+
- **PEP Naming**: `snake_case` for functions, variables, and modules; `PascalCase` for classes; `UPPER_SNAKE_CASE` for constants; `_prefixed` for private members.
|
|
10
|
+
- **Static Typing**: Annotate every function signature and class attribute. Enable `from __future__ import annotations` at the top of every module.
|
|
11
|
+
- **Pydantic Models**: Use `pydantic.BaseModel` for all data contracts, API request/response bodies, and configuration objects. Never use untyped dicts as data boundaries.
|
|
12
|
+
- **Complexity Limits**: Keep functions under 50 lines; maximum 2 levels of nesting; prefer early returns to flatten control flow.
|
|
13
|
+
- **No Magic Literals**: Replace all magic numbers and strings with named constants or `enum.Enum` members.
|
|
14
|
+
|
|
15
|
+
## Project & Dependency Management
|
|
16
|
+
- Use `uv` for all project operations: `uv init`, `uv add`, `uv run`, `uv sync`.
|
|
17
|
+
- Declare all dependencies in `pyproject.toml`; never mutate the global environment with bare `pip install`.
|
|
18
|
+
- Pin direct dependencies; let `uv.lock` track the full resolved set.
|
|
19
|
+
|
|
20
|
+
## Async & I/O
|
|
21
|
+
- Use `async`/`await` for all I/O, network, and database operations.
|
|
22
|
+
- Propagate cancellation via `asyncio.CancelledError`; never swallow it silently.
|
|
23
|
+
- Use `asyncio.gather` or task groups (`asyncio.TaskGroup`) for concurrent work; avoid blocking calls on the event loop.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Skills Index
|
|
2
|
+
|
|
3
|
+
Consult this index to load only the skills relevant to the current task.
|
|
4
|
+
|
|
5
|
+
| Skill | Path | Description / When to Load |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| principles | AgentSkills/skills/principles/SKILL.md | Foundational simplicity ladder, KISS, YAGNI, surgical changes |
|
|
8
|
+
| standards | AgentSkills/skills/standards/SKILL.md | Code quality, 50-line limits, shallow nesting, clean signatures |
|
|
9
|
+
| security | AgentSkills/skills/security/SKILL.md | Input validation, secrets handling, safe queries, least privilege |
|
|
10
|
+
| review | AgentSkills/skills/review/SKILL.md | Code review framework, five review dimensions, verification rules |
|
|
11
|
+
| python-best-practices | AgentSkills/skills/python-best-practices/SKILL.md | PEP 8 conventions, uv project setup, ruff, async patterns, logging |
|
|
12
|
+
| python-typing | AgentSkills/skills/python-typing/SKILL.md | Strict static typing, mypy/pyright, pydantic models, Protocol, TypeVar |
|
|
13
|
+
| testing | AgentSkills/skills/testing/SKILL.md | pytest, pytest-asyncio, hypothesis property testing, fixtures, mocks |
|
|
14
|
+
| performance | AgentSkills/skills/performance/SKILL.md | cProfile/memray, generators, asyncio concurrency, connection pooling |
|