@pratikpsl/agent-skills 0.9.0 → 1.0.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 +59 -99
- package/dist/bin/agent-skills.d.ts.map +1 -1
- package/dist/bin/agent-skills.js +0 -3
- package/dist/bin/agent-skills.js.map +1 -1
- package/dist/cli/index.js +41 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/core/ide-map.d.ts +3 -9
- package/dist/core/ide-map.d.ts.map +1 -1
- package/dist/core/ide-map.js +16 -33
- package/dist/core/ide-map.js.map +1 -1
- package/dist/core/install-template.d.ts +21 -0
- package/dist/core/install-template.d.ts.map +1 -0
- package/dist/core/install-template.js +119 -0
- package/dist/core/install-template.js.map +1 -0
- package/dist/core/resolve-template.d.ts +4 -0
- package/dist/core/resolve-template.d.ts.map +1 -0
- package/dist/core/resolve-template.js +22 -0
- package/dist/core/resolve-template.js.map +1 -0
- package/package.json +2 -2
- package/templates/default/instructions.md +26 -28
- package/templates/dotnet/AgentSkills/agents/architect.agent.md +8 -54
- package/templates/dotnet/AgentSkills/agents/developer.agent.md +8 -83
- package/templates/dotnet/AgentSkills/skills/csharp-xunit/SKILL.md +32 -58
- package/templates/dotnet/AgentSkills/skills/dotnet-best-practices/SKILL.md +62 -153
- package/templates/dotnet/AgentSkills/skills/performance/SKILL.md +18 -0
- package/templates/react/AgentSkills/agents/developer.agent.md +23 -0
- package/templates/react/AgentSkills/skills/performance/SKILL.md +18 -0
- package/templates/react/AgentSkills/skills/react-typescript/SKILL.md +22 -0
- package/templates/react/AgentSkills/skills/testing/SKILL.md +17 -0
- package/templates/shared/AgentSkills/OPERATING.md +15 -0
- package/templates/shared/AgentSkills/agents/architect.agent.md +12 -0
- package/templates/shared/AgentSkills/agents/reviewer.agent.md +26 -0
- package/templates/shared/AgentSkills/skills/security/SKILL.md +18 -0
- package/templates/shared/AgentSkills/skills/standards/SKILL.md +27 -0
- package/templates/shared/entry-points/instructions.md +24 -0
- package/dist/cli/commands/add.d.ts +0 -3
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -73
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/dotnet-setup.d.ts +0 -5
- package/dist/cli/commands/dotnet-setup.d.ts.map +0 -1
- package/dist/cli/commands/dotnet-setup.js +0 -83
- package/dist/cli/commands/dotnet-setup.js.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -3
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -36
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/list.d.ts +0 -3
- package/dist/cli/commands/list.d.ts.map +0 -1
- package/dist/cli/commands/list.js +0 -37
- package/dist/cli/commands/list.js.map +0 -1
- package/dist/cli/commands/setup.d.ts +0 -9
- package/dist/cli/commands/setup.d.ts.map +0 -1
- package/dist/cli/commands/setup.js +0 -77
- package/dist/cli/commands/setup.js.map +0 -1
- package/dist/core/copy-skills.d.ts +0 -30
- package/dist/core/copy-skills.d.ts.map +0 -1
- package/dist/core/copy-skills.js +0 -84
- package/dist/core/copy-skills.js.map +0 -1
- package/dist/core/load-pack.d.ts +0 -15
- package/dist/core/load-pack.d.ts.map +0 -1
- package/dist/core/load-pack.js +0 -35
- package/dist/core/load-pack.js.map +0 -1
- package/dist/core/manifest.d.ts +0 -21
- package/dist/core/manifest.d.ts.map +0 -1
- package/dist/core/manifest.js +0 -170
- package/dist/core/manifest.js.map +0 -1
- package/dist/core/resolve-pack.d.ts +0 -7
- package/dist/core/resolve-pack.d.ts.map +0 -1
- package/dist/core/resolve-pack.js +0 -59
- package/dist/core/resolve-pack.js.map +0 -1
- package/templates/dotnet/AgentSkills/OPERATING.md +0 -85
- package/templates/dotnet/AgentSkills/README.md +0 -64
- package/templates/dotnet/AgentSkills/agents/README.md +0 -16
- package/templates/dotnet/AgentSkills/entry-points/entry-point.md +0 -49
- package/templates/dotnet/AgentSkills/memory/index.md +0 -22
- package/templates/dotnet/AgentSkills/memory/lessons/api.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/auth.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/csharp.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/db.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/design.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/infra.md +0 -8
- package/templates/dotnet/AgentSkills/memory/lessons/mcp.md +0 -3
- package/templates/dotnet/AgentSkills/memory/lessons/testing.md +0 -3
- package/templates/dotnet/AgentSkills/memory/schema.md +0 -26
- package/templates/dotnet/AgentSkills/skills/INDEX.md +0 -21
- package/templates/dotnet/AgentSkills/skills/README.md +0 -14
- package/templates/dotnet/AgentSkills/skills/code-standards/SKILL.md +0 -122
- package/templates/dotnet/AgentSkills/skills/core/SKILL.md +0 -83
- package/templates/dotnet/AgentSkills/skills/design/SKILL.md +0 -108
- package/templates/dotnet/AgentSkills/skills/harness/SKILL.md +0 -62
- package/templates/dotnet/AgentSkills/skills/mcp_dotnet/SKILL.md +0 -54
- package/templates/shared/manifest.json +0 -57
package/dist/core/copy-skills.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// src/core/copy-skills.ts
|
|
2
|
-
// Copies skill files from a pack into the target project's AgentSkills/ folder.
|
|
3
|
-
//
|
|
4
|
-
// Rules enforced here:
|
|
5
|
-
// - Never overwrite an existing file without --force; warn and skip instead.
|
|
6
|
-
// - Directories are created recursively as needed.
|
|
7
|
-
// - Returns a summary object for the caller to print: { written, skipped }.
|
|
8
|
-
//
|
|
9
|
-
// This module contains no pack-specific logic. The manifest tells it what
|
|
10
|
-
// to copy; it does not inspect SKILL.md contents.
|
|
11
|
-
import { cpSync, existsSync, linkSync, mkdirSync, rmSync, statSync } from "fs";
|
|
12
|
-
import path from "path";
|
|
13
|
-
/**
|
|
14
|
-
* Places a single skill file or directory, using hardlinks when requested
|
|
15
|
-
* and a previous instance of the source file was already written.
|
|
16
|
-
*/
|
|
17
|
-
function placeSkillFile(src, dest, destRelPath, targetDir, hardlink, primaryDestMap) {
|
|
18
|
-
const primaryPath = primaryDestMap.get(src);
|
|
19
|
-
if (hardlink && primaryPath && existsSync(primaryPath)) {
|
|
20
|
-
try {
|
|
21
|
-
linkSync(primaryPath, dest);
|
|
22
|
-
const relPrimary = path.relative(targetDir, primaryPath);
|
|
23
|
-
console.log(` ✓ ${destRelPath} (hardlink → ${relPrimary})`);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
// Fall back to copy if hard link fails (e.g. cross-device link)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
cpSync(src, dest, { recursive: true });
|
|
31
|
-
try {
|
|
32
|
-
if (statSync(src).isFile()) {
|
|
33
|
-
primaryDestMap.set(src, dest);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Stat error ignored
|
|
38
|
-
}
|
|
39
|
-
console.log(` ✓ ${destRelPath}`);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Copies or hardlinks a list of skill sources into the target project.
|
|
43
|
-
*/
|
|
44
|
-
export function copySkills(options) {
|
|
45
|
-
const { skills, packDir, targetDir, force, hardlink = false } = options;
|
|
46
|
-
const written = [];
|
|
47
|
-
const skipped = [];
|
|
48
|
-
const primaryDestMap = new Map();
|
|
49
|
-
for (const skill of skills) {
|
|
50
|
-
const src = path.join(packDir, skill.path);
|
|
51
|
-
const destRelPath = skill.dest ?? skill.path;
|
|
52
|
-
const dest = path.join(targetDir, destRelPath);
|
|
53
|
-
if (!existsSync(src)) {
|
|
54
|
-
console.warn(` ⚠ Source path for skill "${skill.name}" not found: ${src}`);
|
|
55
|
-
skipped.push(destRelPath);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (existsSync(dest) && !force) {
|
|
59
|
-
console.warn(` ⚠ Skipping "${skill.name}" — destination already exists. Use --force to overwrite.`);
|
|
60
|
-
skipped.push(destRelPath);
|
|
61
|
-
if (!primaryDestMap.has(src))
|
|
62
|
-
primaryDestMap.set(src, dest);
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
mkdirSync(path.dirname(dest), { recursive: true });
|
|
66
|
-
if (force && existsSync(dest)) {
|
|
67
|
-
rmSync(dest, { recursive: true, force: true });
|
|
68
|
-
}
|
|
69
|
-
placeSkillFile(src, dest, destRelPath, targetDir, hardlink, primaryDestMap);
|
|
70
|
-
written.push(destRelPath);
|
|
71
|
-
}
|
|
72
|
-
return { written, skipped };
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Ensures the AgentSkills root directory exists in the target project.
|
|
76
|
-
*
|
|
77
|
-
* @returns Absolute path to AgentSkills/.
|
|
78
|
-
*/
|
|
79
|
-
export function ensureAgentSkillsDir(targetDir) {
|
|
80
|
-
const dir = path.join(targetDir, "AgentSkills");
|
|
81
|
-
mkdirSync(dir, { recursive: true });
|
|
82
|
-
return dir;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=copy-skills.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-skills.js","sourceRoot":"","sources":["../../src/core/copy-skills.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,gFAAgF;AAChF,EAAE;AACF,uBAAuB;AACvB,+EAA+E;AAC/E,qDAAqD;AACrD,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,kDAAkD;AAElD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC/E,OAAO,IAAI,MAAM,MAAM,CAAC;AAuBxB;;;GAGG;AACH,SAAS,cAAc,CACrB,GAAW,EACX,IAAY,EACZ,WAAmB,EACnB,SAAiB,EACjB,QAAiB,EACjB,cAAmC;IAEnC,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAA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IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAChD,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/core/load-pack.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Manifest } from "./manifest.js";
|
|
2
|
-
export interface LoadedPack {
|
|
3
|
-
/** Absolute path to the pack root. */
|
|
4
|
-
packDir: string;
|
|
5
|
-
/** Validated manifest for the pack. */
|
|
6
|
-
manifest: Manifest;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Resolves a pack by name and reads its manifest.
|
|
10
|
-
* Throws with a user-friendly message on any failure.
|
|
11
|
-
*
|
|
12
|
-
* @throws When the pack cannot be resolved or its manifest is invalid.
|
|
13
|
-
*/
|
|
14
|
-
export declare function loadPack(packName: string): LoadedPack;
|
|
15
|
-
//# sourceMappingURL=load-pack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-pack.d.ts","sourceRoot":"","sources":["../../src/core/load-pack.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAoBrD"}
|
package/dist/core/load-pack.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// src/core/load-pack.ts
|
|
2
|
-
// Shared helper that resolves a pack and reads its manifest in one step.
|
|
3
|
-
//
|
|
4
|
-
// Eliminates the duplicated try/catch pattern that previously appeared
|
|
5
|
-
// in both add.ts and dotnet-setup.ts. Commands that need a pack and its
|
|
6
|
-
// manifest should call this instead of calling resolvePack + readManifest
|
|
7
|
-
// separately.
|
|
8
|
-
import { resolvePack } from "./resolve-pack.js";
|
|
9
|
-
import { readManifest } from "./manifest.js";
|
|
10
|
-
/**
|
|
11
|
-
* Resolves a pack by name and reads its manifest.
|
|
12
|
-
* Throws with a user-friendly message on any failure.
|
|
13
|
-
*
|
|
14
|
-
* @throws When the pack cannot be resolved or its manifest is invalid.
|
|
15
|
-
*/
|
|
16
|
-
export function loadPack(packName) {
|
|
17
|
-
let packDir;
|
|
18
|
-
try {
|
|
19
|
-
packDir = resolvePack(packName);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
23
|
-
throw new Error(`Could not resolve pack "${packName}": ${message}`);
|
|
24
|
-
}
|
|
25
|
-
let manifest;
|
|
26
|
-
try {
|
|
27
|
-
manifest = readManifest(packDir);
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
31
|
-
throw new Error(`Could not read manifest for pack "${packName}": ${message}`);
|
|
32
|
-
}
|
|
33
|
-
return { packDir, manifest };
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=load-pack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-pack.js","sourceRoot":"","sources":["../../src/core/load-pack.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,yEAAyE;AACzE,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,cAAc;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAU7C;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,QAAkB,CAAC;IACvB,IAAI,CAAC;QACH,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,qCAAqC,QAAQ,MAAM,OAAO,EAAE,CAC7D,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
|
package/dist/core/manifest.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface SkillEntry {
|
|
2
|
-
/** Short identifier used as a CLI argument. */
|
|
3
|
-
name: string;
|
|
4
|
-
/** Human-readable purpose of the skill. */
|
|
5
|
-
description: string;
|
|
6
|
-
/** Source path of the skill, relative to the pack root. */
|
|
7
|
-
path: string;
|
|
8
|
-
/** Destination path in the target project, relative to the project root. */
|
|
9
|
-
dest?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface Manifest {
|
|
12
|
-
/** Package name. */
|
|
13
|
-
name: string;
|
|
14
|
-
/** Semver string. */
|
|
15
|
-
version: string;
|
|
16
|
-
/** All skills provided by this pack. */
|
|
17
|
-
skills: SkillEntry[];
|
|
18
|
-
}
|
|
19
|
-
export declare function discoverSkills(packDir: string): SkillEntry[];
|
|
20
|
-
export declare function readManifest(packDir: string): Manifest;
|
|
21
|
-
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/core/manifest.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AA6FD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAkB5D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAyCtD"}
|
package/dist/core/manifest.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
// src/core/manifest.ts
|
|
2
|
-
// Reads and validates a pack's manifest.json, or auto-discovers skills from disk
|
|
3
|
-
// when manifest.json is not present.
|
|
4
|
-
import { readFileSync, existsSync, readdirSync } from "fs";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import { IDE_ENTRY_POINT_MAP } from "./ide-map.js";
|
|
7
|
-
const DEFAULT_DESCRIPTIONS = {
|
|
8
|
-
OPERATING: "Shared operating contract: bootstrap sequence, working rules, completion gate for all agents.",
|
|
9
|
-
agents: "Agent persona definitions: architect (design/CQRS) and developer (.NET C# implementation).",
|
|
10
|
-
memory: "Persistent agent memory: domain lesson files and memory schema for learning loops.",
|
|
11
|
-
instructions: "Canonical single-file coding agent instructions (Goal, Principles, Definition of Done).",
|
|
12
|
-
};
|
|
13
|
-
const IDE_DESTINATIONS = {
|
|
14
|
-
"entry-point:claude": "CLAUDE.md",
|
|
15
|
-
"entry-point:codex": "AGENTS.md",
|
|
16
|
-
"entry-point:copilot": ".github/copilot-instructions.md",
|
|
17
|
-
"entry-point:cursor": ".cursor/rules/instructions.md",
|
|
18
|
-
"entry-point:antigravity": ".agents/GEMINI.md",
|
|
19
|
-
"entry-point:windsurf": ".windsurfrules",
|
|
20
|
-
"entry-point:cline": ".clinerules",
|
|
21
|
-
};
|
|
22
|
-
function parseSkillDescription(skillDir, skillName) {
|
|
23
|
-
const skillFile = path.join(skillDir, "SKILL.md");
|
|
24
|
-
if (existsSync(skillFile)) {
|
|
25
|
-
try {
|
|
26
|
-
const raw = readFileSync(skillFile, "utf8");
|
|
27
|
-
const match = raw.match(/^description:\s*(?:>|\|)?\s*\n?([^\n\r]+)/m);
|
|
28
|
-
if (match && match[1]) {
|
|
29
|
-
return match[1].trim();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// ignore
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return DEFAULT_DESCRIPTIONS[skillName] ?? `Skill definition for ${skillName}.`;
|
|
37
|
-
}
|
|
38
|
-
function discoverIdeEntryPoints(entryPointSrc) {
|
|
39
|
-
const skills = [];
|
|
40
|
-
for (const [ide, skillName] of Object.entries(IDE_ENTRY_POINT_MAP)) {
|
|
41
|
-
skills.push({
|
|
42
|
-
name: skillName,
|
|
43
|
-
description: `Lightweight ${ide} entry point.`,
|
|
44
|
-
path: entryPointSrc,
|
|
45
|
-
dest: IDE_DESTINATIONS[skillName],
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return skills;
|
|
49
|
-
}
|
|
50
|
-
function discoverAgentSkills(packDir) {
|
|
51
|
-
const skills = [];
|
|
52
|
-
const agentSkillsDir = path.join(packDir, "AgentSkills");
|
|
53
|
-
if (existsSync(path.join(agentSkillsDir, "OPERATING.md"))) {
|
|
54
|
-
skills.push({
|
|
55
|
-
name: "OPERATING",
|
|
56
|
-
description: DEFAULT_DESCRIPTIONS.OPERATING,
|
|
57
|
-
path: "AgentSkills/OPERATING.md",
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const skillsSubdir = path.join(agentSkillsDir, "skills");
|
|
61
|
-
if (existsSync(skillsSubdir)) {
|
|
62
|
-
const entries = readdirSync(skillsSubdir, { withFileTypes: true });
|
|
63
|
-
for (const entry of entries) {
|
|
64
|
-
if (entry.isDirectory()) {
|
|
65
|
-
const fullSkillDir = path.join(skillsSubdir, entry.name);
|
|
66
|
-
skills.push({
|
|
67
|
-
name: entry.name,
|
|
68
|
-
description: parseSkillDescription(fullSkillDir, entry.name),
|
|
69
|
-
path: `AgentSkills/skills/${entry.name}`,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
for (const item of ["agents", "memory"]) {
|
|
75
|
-
if (existsSync(path.join(agentSkillsDir, item))) {
|
|
76
|
-
skills.push({
|
|
77
|
-
name: item,
|
|
78
|
-
description: DEFAULT_DESCRIPTIONS[item] ?? `${item} definitions.`,
|
|
79
|
-
path: `AgentSkills/${item}`,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const epFile = path.join(agentSkillsDir, "entry-points", "entry-point.md");
|
|
84
|
-
if (existsSync(epFile)) {
|
|
85
|
-
skills.push(...discoverIdeEntryPoints("AgentSkills/entry-points/entry-point.md"));
|
|
86
|
-
}
|
|
87
|
-
return skills;
|
|
88
|
-
}
|
|
89
|
-
export function discoverSkills(packDir) {
|
|
90
|
-
if (existsSync(path.join(packDir, "AgentSkills"))) {
|
|
91
|
-
return discoverAgentSkills(packDir);
|
|
92
|
-
}
|
|
93
|
-
if (existsSync(path.join(packDir, "instructions.md"))) {
|
|
94
|
-
return [
|
|
95
|
-
{
|
|
96
|
-
name: "instructions",
|
|
97
|
-
description: DEFAULT_DESCRIPTIONS.instructions,
|
|
98
|
-
path: "instructions.md",
|
|
99
|
-
dest: "AGENTS.md",
|
|
100
|
-
},
|
|
101
|
-
...discoverIdeEntryPoints("instructions.md"),
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
|
-
throw new Error(`No recognized skills or instructions found in "${packDir}".`);
|
|
105
|
-
}
|
|
106
|
-
export function readManifest(packDir) {
|
|
107
|
-
const localManifestPath = path.join(packDir, "manifest.json");
|
|
108
|
-
const sharedManifestPath = path.join(packDir, "..", "shared", "manifest.json");
|
|
109
|
-
const targetPath = existsSync(localManifestPath)
|
|
110
|
-
? localManifestPath
|
|
111
|
-
: existsSync(sharedManifestPath) && existsSync(path.join(packDir, "instructions.md"))
|
|
112
|
-
? sharedManifestPath
|
|
113
|
-
: undefined;
|
|
114
|
-
if (!targetPath) {
|
|
115
|
-
return {
|
|
116
|
-
name: "@pratikpsl/agent-skills",
|
|
117
|
-
version: "0.9.0",
|
|
118
|
-
skills: discoverSkills(packDir),
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
let raw;
|
|
122
|
-
try {
|
|
123
|
-
raw = readFileSync(targetPath, "utf8");
|
|
124
|
-
if (raw.charCodeAt(0) === 0xfeff) {
|
|
125
|
-
raw = raw.slice(1);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch (err) {
|
|
129
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
130
|
-
throw new Error(`Could not read manifest.json: ${message}`);
|
|
131
|
-
}
|
|
132
|
-
let manifest;
|
|
133
|
-
try {
|
|
134
|
-
manifest = JSON.parse(raw);
|
|
135
|
-
}
|
|
136
|
-
catch (err) {
|
|
137
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
138
|
-
throw new Error(`manifest.json at "${targetPath}" is not valid JSON: ${message}`);
|
|
139
|
-
}
|
|
140
|
-
validateManifest(manifest, targetPath);
|
|
141
|
-
return manifest;
|
|
142
|
-
}
|
|
143
|
-
function validateManifest(manifest, filePath) {
|
|
144
|
-
if (typeof manifest !== "object" || manifest === null) {
|
|
145
|
-
throw new Error(`manifest.json at "${filePath}" must be a JSON object.`);
|
|
146
|
-
}
|
|
147
|
-
const obj = manifest;
|
|
148
|
-
const required = ["name", "version", "skills"];
|
|
149
|
-
for (const key of required) {
|
|
150
|
-
if (!(key in obj)) {
|
|
151
|
-
throw new Error(`manifest.json is missing required field "${key}".`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (!Array.isArray(obj.skills)) {
|
|
155
|
-
throw new Error(`manifest.json "skills" must be an array.`);
|
|
156
|
-
}
|
|
157
|
-
for (const [i, skill] of obj.skills.entries()) {
|
|
158
|
-
const entry = skill;
|
|
159
|
-
for (const field of ["name", "description", "path"]) {
|
|
160
|
-
if (typeof entry[field] !== "string" || !entry[field].trim()) {
|
|
161
|
-
throw new Error(`manifest.json skills[${i}] is missing or has an empty "${field}" field.`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if ("dest" in entry &&
|
|
165
|
-
(typeof entry.dest !== "string" || !entry.dest.trim())) {
|
|
166
|
-
throw new Error(`manifest.json skills[${i}] has an invalid "dest" field — must be a non-empty string when present.`);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/core/manifest.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,iFAAiF;AACjF,qCAAqC;AAErC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAsBnD,MAAM,oBAAoB,GAA2B;IACnD,SAAS,EAAE,+FAA+F;IAC1G,MAAM,EAAE,4FAA4F;IACpG,MAAM,EAAE,oFAAoF;IAC5F,YAAY,EAAE,yFAAyF;CACxG,CAAC;AAEF,MAAM,gBAAgB,GAA2B;IAC/C,oBAAoB,EAA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AAQ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EACtD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,wBAAwB,CAAC,0EAA0E,CACpG,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-pack.d.ts","sourceRoot":"","sources":["../../src/core/resolve-pack.ts"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+BpD"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// src/core/resolve-pack.ts
|
|
2
|
-
// Locates a templates folder bundled inside the package itself.
|
|
3
|
-
// Since everything is in one package, no runtime npm fetching is needed.
|
|
4
|
-
//
|
|
5
|
-
// Templates live at the repo/package root under `templates/<packName>/`.
|
|
6
|
-
import { existsSync } from "fs";
|
|
7
|
-
import path from "path";
|
|
8
|
-
import { fileURLToPath } from "url";
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = path.dirname(__filename);
|
|
11
|
-
/** Canonical directory names for built-in packs. */
|
|
12
|
-
const PACK_ALIASES = {
|
|
13
|
-
dotnet: "dotnet",
|
|
14
|
-
"skills-dotnet": "dotnet",
|
|
15
|
-
"@pratikpsl/agent-skills-dotnet": "dotnet",
|
|
16
|
-
default: "default",
|
|
17
|
-
instructions: "default",
|
|
18
|
-
"skills-instructions": "default",
|
|
19
|
-
"@pratikpsl/agent-skills": "default",
|
|
20
|
-
"@pratikpsl/agent-skills-default": "default",
|
|
21
|
-
"@pratikpsl/agent-skills-instructions": "default",
|
|
22
|
-
"single-file": "default",
|
|
23
|
-
universal: "default",
|
|
24
|
-
"skills-universal": "default",
|
|
25
|
-
"@pratikpsl/agent-skills-universal": "default",
|
|
26
|
-
core: "default",
|
|
27
|
-
"skills-core": "default",
|
|
28
|
-
"@pratikpsl/agent-skills-core": "default",
|
|
29
|
-
standard: "default",
|
|
30
|
-
"skills-standard": "default",
|
|
31
|
-
"@pratikpsl/agent-skills-standard": "default",
|
|
32
|
-
base: "default",
|
|
33
|
-
"skills-base": "default",
|
|
34
|
-
"@pratikpsl/agent-skills-base": "default",
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Resolves a pack name or alias to its installed directory.
|
|
38
|
-
*
|
|
39
|
-
* @throws When the pack cannot be located.
|
|
40
|
-
*/
|
|
41
|
-
export function resolvePack(packName) {
|
|
42
|
-
const normalized = PACK_ALIASES[packName] ??
|
|
43
|
-
packName
|
|
44
|
-
.replace(/^@pratikpsl\/agent-skills-/, "")
|
|
45
|
-
.replace(/^skills-/, "");
|
|
46
|
-
// templates/ lives three levels up from dist/core/ (at the package root)
|
|
47
|
-
// In development (src/core/), it's two levels up — but we always run from
|
|
48
|
-
// the compiled dist/, so three levels is correct.
|
|
49
|
-
const templateDir = path.resolve(__dirname, "..", "..", "templates", normalized);
|
|
50
|
-
if (existsSync(templateDir) &&
|
|
51
|
-
(existsSync(path.join(templateDir, "manifest.json")) ||
|
|
52
|
-
existsSync(path.join(templateDir, "AgentSkills")) ||
|
|
53
|
-
existsSync(path.join(templateDir, "instructions.md")))) {
|
|
54
|
-
return templateDir;
|
|
55
|
-
}
|
|
56
|
-
throw new Error(`Pack "${packName}" (mapped to "${normalized}") is not bundled with this version of the CLI. ` +
|
|
57
|
-
`Currently available packs: default, dotnet`);
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=resolve-pack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-pack.js","sourceRoot":"","sources":["../../src/core/resolve-pack.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,gEAAgE;AAChE,yEAAyE;AACzE,EAAE;AACF,yEAAyE;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAA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,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAClD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YACjD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC,EACxD,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,SAAS,QAAQ,iBAAiB,UAAU,kDAAkD;QAC5F,4CAA4C,CAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Coding Agent Operating Contract
|
|
2
|
-
|
|
3
|
-
This file is the canonical prerequisite and completion workflow for every coding
|
|
4
|
-
agent and AI-enabled IDE working in this repository.
|
|
5
|
-
|
|
6
|
-
Tool-specific files such as `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`,
|
|
7
|
-
`.agent/rules/instructions.md`, `.copilot/`, and `.codex/` are lightweight entry
|
|
8
|
-
points only. They must route agents here and must not duplicate skill, agent,
|
|
9
|
-
memory, checklist, or project-rule content.
|
|
10
|
-
|
|
11
|
-
## Applies To
|
|
12
|
-
|
|
13
|
-
This contract applies to Codex, GitHub Copilot, Claude, Cursor, Antigravity,
|
|
14
|
-
local agent harnesses, CI hooks, and any future coding agent integration.
|
|
15
|
-
|
|
16
|
-
## Task Start Prerequisites
|
|
17
|
-
|
|
18
|
-
Before changing files or producing a final answer, every agent must complete this
|
|
19
|
-
bootstrap sequence:
|
|
20
|
-
|
|
21
|
-
1. Read `AgentSkills/memory/index.md`, then load only the domain lesson file(s)
|
|
22
|
-
that match the task.
|
|
23
|
-
2. Read `AgentSkills/skills/INDEX.md`.
|
|
24
|
-
3. Always load `AgentSkills/skills/core/SKILL.md`.
|
|
25
|
-
4. Load any task-specific skill listed in the skill index.
|
|
26
|
-
5. Load `AgentSkills/skills/harness/SKILL.md` when changing instructions,
|
|
27
|
-
validation scripts, CI workflows, hooks, or operational guardrails.
|
|
28
|
-
6. Load agent definitions from `AgentSkills/agents/` only when the task needs a
|
|
29
|
-
role-specific agent:
|
|
30
|
-
- `AgentSkills/agents/architect.agent.md` for design, CQRS structure, SQL
|
|
31
|
-
schema, or MCP contract planning.
|
|
32
|
-
- `AgentSkills/agents/developer.agent.md` for .NET C# implementation work.
|
|
33
|
-
7. Inspect the local repository context before editing, including relevant files
|
|
34
|
-
and current worktree state.
|
|
35
|
-
8. Define the verification path for the task before making changes.
|
|
36
|
-
|
|
37
|
-
If the request is ambiguous and a safe, local assumption is not possible, ask a
|
|
38
|
-
short clarifying question before editing.
|
|
39
|
-
|
|
40
|
-
## Working Rules
|
|
41
|
-
|
|
42
|
-
- Keep `AgentSkills/` as the single source of truth for skills, agents, memory,
|
|
43
|
-
prerequisites, project rules, and completion gates.
|
|
44
|
-
- Use repo-relative paths in shared documentation and configuration.
|
|
45
|
-
- Keep changes scoped to the user request and the files required to satisfy it.
|
|
46
|
-
- Preserve user changes already present in the worktree.
|
|
47
|
-
- Prefer the repository's existing patterns over new abstractions.
|
|
48
|
-
- Update public documentation only when behavior, setup, commands, or usage
|
|
49
|
-
changes.
|
|
50
|
-
- Record a memory lesson only when a mistake was made or a durable
|
|
51
|
-
project-specific rule was discovered.
|
|
52
|
-
|
|
53
|
-
## Completion Gate
|
|
54
|
-
|
|
55
|
-
Before marking work complete, every coding agent must:
|
|
56
|
-
|
|
57
|
-
1. Run the pre-submit checklist in `AgentSkills/skills/core/SKILL.md`.
|
|
58
|
-
2. Run the shared harness sensor when code, project files, instructions, CI,
|
|
59
|
-
hooks, or validation behavior changed:
|
|
60
|
-
|
|
61
|
-
```powershell
|
|
62
|
-
pwsh ./tools/Harness/validate.ps1
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
3. For quick local loops during development, the harness may be run in Debug
|
|
66
|
-
mode with formatting skipped, but the final pass should use the full command
|
|
67
|
-
unless the task is documentation-only or the environment cannot run it:
|
|
68
|
-
|
|
69
|
-
```powershell
|
|
70
|
-
pwsh ./tools/Harness/validate.ps1 -Configuration Debug -SkipFormat
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
4. If the full harness cannot be run, report the exact command that was skipped
|
|
74
|
-
or failed and the reason.
|
|
75
|
-
5. Do not claim completion when required checks fail. List failures clearly and
|
|
76
|
-
leave the work in a reviewable state.
|
|
77
|
-
|
|
78
|
-
## Final Response
|
|
79
|
-
|
|
80
|
-
The final response should state:
|
|
81
|
-
|
|
82
|
-
- What changed.
|
|
83
|
-
- Which validation commands were run.
|
|
84
|
-
- Any failures, skipped checks, or follow-up risks.
|
|
85
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# AgentSkills: Unified Skill & Memory Workspace
|
|
2
|
-
|
|
3
|
-
This directory is the single, shared source of truth for all AI agents (Claude, Codex, Copilot, Antigravity, etc.) interacting with this repository.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Folder Structure
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
AgentSkills/
|
|
11
|
-
├── skills/ ← Custom developer skills (best practices, guidelines)
|
|
12
|
-
│ ├── INDEX.md ← Index of all skills and when to load them
|
|
13
|
-
│ ├── core/ ← Core principles (think before coding, checklist)
|
|
14
|
-
│ ├── code-standards/ ← Coding standards (no magic values, naming, DRY)
|
|
15
|
-
│ ├── design/ ← SOLID, KISS, YAGNI, and design pattern rules
|
|
16
|
-
│ ├── dotnet-best-practices/ ← General .NET and EF Core best practices
|
|
17
|
-
│ ├── csharp-xunit/ ← Unit testing guidelines using xUnit
|
|
18
|
-
│ ├── mcp_dotnet/ ← Model Context Protocol tool rules
|
|
19
|
-
│ ├── dotnet-api/ ← RESTful API URL structure, pipeline, and OpenAPI rules
|
|
20
|
-
│ └── harness/ ← Guide and sensor setup for agent operations
|
|
21
|
-
│
|
|
22
|
-
├── agents/ ← Custom agent definition personas
|
|
23
|
-
│ ├── README.md ← Agent index and canonical path instructions
|
|
24
|
-
│ ├── architect.agent.md ← Structure and design planning agent
|
|
25
|
-
│ └── developer.agent.md ← C# / .NET implementation agent
|
|
26
|
-
│
|
|
27
|
-
└── memory/ ← Persistent agent memories
|
|
28
|
-
├── index.md ← Router: always load this first; maps task type to domain file
|
|
29
|
-
├── schema.md ← Lesson logging format (load only when writing a lesson)
|
|
30
|
-
└── lessons/
|
|
31
|
-
├── api.md ← CQRS, MediatR, commands, queries, controllers
|
|
32
|
-
├── db.md ← EF Core, migrations, schema, repositories
|
|
33
|
-
├── infra.md ← Build, paths, CI, tooling, portability
|
|
34
|
-
├── auth.md ← Authentication, authorisation, JWT
|
|
35
|
-
├── testing.md ← xUnit, mocking, coverage
|
|
36
|
-
├── csharp.md ← C# language features, naming, async/await
|
|
37
|
-
├── design.md ← SOLID, CQRS, patterns, architecture decisions
|
|
38
|
-
└── mcp.md ← MCP server tools, transports, contracts
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## How It Works
|
|
44
|
-
|
|
45
|
-
1. **Task Initialization**:
|
|
46
|
-
- The agent starts with [AgentSkills/OPERATING.md](OPERATING.md), the shared operating contract for all coding agents and AI-enabled IDEs.
|
|
47
|
-
- The agent reads [AgentSkills/memory/index.md](memory/index.md) to identify relevant domains, then loads only the matching domain file(s) from `memory/lessons/`.
|
|
48
|
-
- The agent reads [AgentSkills/skills/INDEX.md](skills/INDEX.md) to load `core` and any task-specific skills.
|
|
49
|
-
|
|
50
|
-
2. **Core Checklist**:
|
|
51
|
-
- Before finishing any task, the agent runs the prerequisite and pre-submit checklists in [AgentSkills/skills/core/SKILL.md](skills/core/SKILL.md).
|
|
52
|
-
|
|
53
|
-
3. **Memory Update**:
|
|
54
|
-
- If the agent makes a mistake or discovers a project-specific rule, it reads [memory/schema.md](memory/schema.md) for the one-line format, appends to the correct domain file, and increments the count in `index.md`.
|
|
55
|
-
|
|
56
|
-
4. **Tool Entry Points**:
|
|
57
|
-
- Codex reads `AGENTS.md`.
|
|
58
|
-
- Claude reads `CLAUDE.md`.
|
|
59
|
-
- GitHub Copilot reads `.github/copilot-instructions.md`.
|
|
60
|
-
- Other coding IDEs and agents read their configured lightweight entry point.
|
|
61
|
-
- Tool-specific files point back to `AgentSkills/OPERATING.md`; skill, agent, memory, checklist, and project-rule content is not duplicated.
|
|
62
|
-
|
|
63
|
-
5. **Integration Hooks**:
|
|
64
|
-
- A post-tool-use hook is configured in `.github/hooks/build_test_lint.json` to run the shared harness sensor at `tools/Harness/validate.ps1`.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Agents
|
|
2
|
-
|
|
3
|
-
This folder is the canonical source of truth for agent definitions used by all AI tools and IDEs in this repository.
|
|
4
|
-
|
|
5
|
-
Do not duplicate agent content under `.github/`, `.copilot/`, `.codex/`, or other tool-specific folders.
|
|
6
|
-
Those tools should load agent definitions from this folder.
|
|
7
|
-
Complete `AgentSkills/OPERATING.md` before loading a task-specific agent definition.
|
|
8
|
-
|
|
9
|
-
## Agent Locations (canonical paths)
|
|
10
|
-
|
|
11
|
-
| Agent | Canonical Path |
|
|
12
|
-
|---|---|
|
|
13
|
-
| architect | `AgentSkills/agents/architect.agent.md` |
|
|
14
|
-
| developer | `AgentSkills/agents/developer.agent.md` |
|
|
15
|
-
|
|
16
|
-
All agents and tools (Copilot, Codex, Claude, Cursor, Antigravity) load agents from `AgentSkills/agents/`.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Agent Entry Point
|
|
2
|
-
|
|
3
|
-
`AgentSkills/` is the single source of truth for skills, agents, memory,
|
|
4
|
-
prerequisites, checklists, and project rules used by all coding agents and
|
|
5
|
-
AI-enabled IDEs in this repository.
|
|
6
|
-
|
|
7
|
-
## Start Here
|
|
8
|
-
|
|
9
|
-
1. Read `AgentSkills/OPERATING.md`.
|
|
10
|
-
2. Follow skill routing in `AgentSkills/skills/INDEX.md`.
|
|
11
|
-
3. Load role definitions from `AgentSkills/agents/` only when the task requires them.
|
|
12
|
-
|
|
13
|
-
Do not duplicate canonical instructions in this file. Edit shared guidance in
|
|
14
|
-
`AgentSkills/`.
|
|
15
|
-
|
|
16
|
-
## Mandatory Bootstrap (All Agents — Enforced)
|
|
17
|
-
|
|
18
|
-
Before changing any file or producing a final answer for any **code-changing**
|
|
19
|
-
task in this repository, you MUST complete the following bootstrap sequence
|
|
20
|
-
in order. Do NOT skip this sequence even for tasks that appear simple or quick.
|
|
21
|
-
|
|
22
|
-
1. Read `AgentSkills/OPERATING.md`.
|
|
23
|
-
2. Read `AgentSkills/memory/index.md`; load only the domain lesson file(s)
|
|
24
|
-
relevant to the current task (do not load all files at once).
|
|
25
|
-
3. Read `AgentSkills/skills/INDEX.md` (when it exists).
|
|
26
|
-
4. Always load `AgentSkills/skills/core/SKILL.md`.
|
|
27
|
-
5. Load any task-specific skill from `AgentSkills/skills/` that matches the task.
|
|
28
|
-
6. For .NET / C# implementation tasks, load `AgentSkills/agents/developer.agent.md`.
|
|
29
|
-
7. For design, CQRS structure, SQL schema, or architecture tasks, load
|
|
30
|
-
`AgentSkills/agents/architect.agent.md`.
|
|
31
|
-
8. Inspect the worktree context before editing so existing user changes are
|
|
32
|
-
preserved.
|
|
33
|
-
9. Define the verification path for the task before making changes.
|
|
34
|
-
|
|
35
|
-
## Completion Gate (All Agents — Enforced)
|
|
36
|
-
|
|
37
|
-
Before marking any code-changing task complete:
|
|
38
|
-
|
|
39
|
-
1. Run the pre-submit checklist in `AgentSkills/skills/core/SKILL.md`.
|
|
40
|
-
2. Run the harness validator (unless the task is documentation-only or the
|
|
41
|
-
environment cannot run it — in that case, state the reason explicitly):
|
|
42
|
-
|
|
43
|
-
```powershell
|
|
44
|
-
pwsh ./tools/Harness/validate.ps1
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
3. Do not claim completion when required checks fail. List failures clearly and
|
|
48
|
-
leave the work in a reviewable state.
|
|
49
|
-
|