synorch 0.2.0 → 0.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +314 -28
  3. package/dist/application/doctor-service.d.ts +16 -0
  4. package/dist/application/doctor-service.d.ts.map +1 -1
  5. package/dist/application/doctor-service.js +230 -32
  6. package/dist/application/doctor-service.js.map +1 -1
  7. package/dist/application/generated-skill-doctor.d.ts +9 -0
  8. package/dist/application/generated-skill-doctor.d.ts.map +1 -0
  9. package/dist/application/generated-skill-doctor.js +433 -0
  10. package/dist/application/generated-skill-doctor.js.map +1 -0
  11. package/dist/application/project-discovery.d.ts +12 -0
  12. package/dist/application/project-discovery.d.ts.map +1 -1
  13. package/dist/application/project-discovery.js +65 -2
  14. package/dist/application/project-discovery.js.map +1 -1
  15. package/dist/application/safe-path.d.ts +19 -0
  16. package/dist/application/safe-path.d.ts.map +1 -0
  17. package/dist/application/safe-path.js +35 -0
  18. package/dist/application/safe-path.js.map +1 -0
  19. package/dist/application/size-ceiling.d.ts +15 -0
  20. package/dist/application/size-ceiling.d.ts.map +1 -0
  21. package/dist/application/size-ceiling.js +32 -0
  22. package/dist/application/size-ceiling.js.map +1 -0
  23. package/dist/application/structure-service.d.ts.map +1 -1
  24. package/dist/application/structure-service.js +10 -1
  25. package/dist/application/structure-service.js.map +1 -1
  26. package/dist/cli.js +10 -1
  27. package/dist/cli.js.map +1 -1
  28. package/dist/domain/canonical-contracts.d.ts +69 -0
  29. package/dist/domain/canonical-contracts.d.ts.map +1 -0
  30. package/dist/domain/canonical-contracts.js +92 -0
  31. package/dist/domain/canonical-contracts.js.map +1 -0
  32. package/dist/domain/generated-skill.d.ts +55 -0
  33. package/dist/domain/generated-skill.d.ts.map +1 -0
  34. package/dist/domain/generated-skill.js +90 -0
  35. package/dist/domain/generated-skill.js.map +1 -0
  36. package/dist/domain/generation.d.ts +15 -2
  37. package/dist/domain/generation.d.ts.map +1 -1
  38. package/dist/domain/observation-ledger.d.ts +118 -0
  39. package/dist/domain/observation-ledger.d.ts.map +1 -0
  40. package/dist/domain/observation-ledger.js +183 -0
  41. package/dist/domain/observation-ledger.js.map +1 -0
  42. package/dist/domain/product.d.ts +1 -1
  43. package/dist/domain/product.js +1 -1
  44. package/dist/domain/relative-path.d.ts +21 -0
  45. package/dist/domain/relative-path.d.ts.map +1 -0
  46. package/dist/domain/relative-path.js +43 -0
  47. package/dist/domain/relative-path.js.map +1 -0
  48. package/dist/domain/skill-packs.d.ts.map +1 -1
  49. package/dist/domain/skill-packs.js +1 -0
  50. package/dist/domain/skill-packs.js.map +1 -1
  51. package/dist/domain/zod-issues.d.ts +21 -0
  52. package/dist/domain/zod-issues.d.ts.map +1 -0
  53. package/dist/domain/zod-issues.js +27 -0
  54. package/dist/domain/zod-issues.js.map +1 -0
  55. package/dist/infrastructure/frontmatter.d.ts +25 -0
  56. package/dist/infrastructure/frontmatter.d.ts.map +1 -0
  57. package/dist/infrastructure/frontmatter.js +75 -0
  58. package/dist/infrastructure/frontmatter.js.map +1 -0
  59. package/dist/templates/agent-manifests.d.ts +19 -0
  60. package/dist/templates/agent-manifests.d.ts.map +1 -0
  61. package/dist/templates/agent-manifests.js +302 -0
  62. package/dist/templates/agent-manifests.js.map +1 -0
  63. package/dist/templates/base-skills.d.ts +23 -0
  64. package/dist/templates/base-skills.d.ts.map +1 -0
  65. package/dist/templates/base-skills.js +477 -0
  66. package/dist/templates/base-skills.js.map +1 -0
  67. package/dist/templates/skill-creator-skill.d.ts +23 -0
  68. package/dist/templates/skill-creator-skill.d.ts.map +1 -0
  69. package/dist/templates/skill-creator-skill.js +235 -0
  70. package/dist/templates/skill-creator-skill.js.map +1 -0
  71. package/dist/templates/skill-references.d.ts +13 -0
  72. package/dist/templates/skill-references.d.ts.map +1 -0
  73. package/dist/templates/skill-references.js +280 -0
  74. package/dist/templates/skill-references.js.map +1 -0
  75. package/dist/templates/structure-templates.d.ts.map +1 -1
  76. package/dist/templates/structure-templates.js +15 -139
  77. package/dist/templates/structure-templates.js.map +1 -1
  78. package/dist/templates/task-conductor-skill.d.ts +1 -1
  79. package/dist/templates/task-conductor-skill.d.ts.map +1 -1
  80. package/dist/templates/task-conductor-skill.js +50 -22
  81. package/dist/templates/task-conductor-skill.js.map +1 -1
  82. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ /**
2
+ * One human-readable rendering of a zod failure, shared by every diagnostic that reports one.
3
+ *
4
+ * `ZodError.message` is the pretty-printed JSON dump of the issue array. It is accurate and
5
+ * unreadable in a terminal, so a diagnostic carries `path: message` per issue instead, joined
6
+ * on one line.
7
+ */
8
+ export interface ZodIssueLike {
9
+ readonly path: readonly PropertyKey[];
10
+ readonly message: string;
11
+ }
12
+ export interface ZodErrorLike {
13
+ readonly issues: readonly ZodIssueLike[];
14
+ }
15
+ export declare function formatZodIssues(error: ZodErrorLike): string;
16
+ /** Issues whose first path segment is one of `fields`, and the rest, split in two. */
17
+ export declare function partitionZodIssues(error: ZodErrorLike, fields: readonly string[]): {
18
+ readonly reported: readonly ZodIssueLike[];
19
+ readonly remaining: readonly ZodIssueLike[];
20
+ };
21
+ //# sourceMappingURL=zod-issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-issues.d.ts","sourceRoot":"","sources":["../../src/domain/zod-issues.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAG3D;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAA;CAAE,CAQ7F"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * One human-readable rendering of a zod failure, shared by every diagnostic that reports one.
3
+ *
4
+ * `ZodError.message` is the pretty-printed JSON dump of the issue array. It is accurate and
5
+ * unreadable in a terminal, so a diagnostic carries `path: message` per issue instead, joined
6
+ * on one line.
7
+ */
8
+ export function formatZodIssues(error) {
9
+ if (error.issues.length === 0)
10
+ return "the value does not match the schema";
11
+ return error.issues.map(formatZodIssue).join("; ");
12
+ }
13
+ /** Issues whose first path segment is one of `fields`, and the rest, split in two. */
14
+ export function partitionZodIssues(error, fields) {
15
+ const owned = new Set(fields);
16
+ const reported = [];
17
+ const remaining = [];
18
+ for (const issue of error.issues) {
19
+ (owned.has(String(issue.path[0])) ? reported : remaining).push(issue);
20
+ }
21
+ return { reported, remaining };
22
+ }
23
+ function formatZodIssue(issue) {
24
+ const location = issue.path.map(String).join(".");
25
+ return location.length === 0 ? issue.message : `${location}: ${issue.message}`;
26
+ }
27
+ //# sourceMappingURL=zod-issues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-issues.js","sourceRoot":"","sources":["../../src/domain/zod-issues.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,UAAU,eAAe,CAAC,KAAmB;IACjD,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,qCAAqC,CAAC;IAC5E,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,kBAAkB,CAChC,KAAmB,EACnB,MAAyB;IAEzB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,MAAM,SAAS,GAAmB,EAAE,CAAC;IACrC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,cAAc,CAAC,KAAmB;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;AACjF,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface ParsedFrontmatter {
2
+ readonly kind: "parsed";
3
+ /** The raw YAML mapping; callers validate it against their own schema. */
4
+ readonly data: Record<string, unknown>;
5
+ /** Everything after the closing delimiter, with normalized line endings. */
6
+ readonly body: string;
7
+ }
8
+ export interface MissingFrontmatter {
9
+ readonly kind: "missing";
10
+ }
11
+ export interface MalformedFrontmatter {
12
+ readonly kind: "malformed";
13
+ readonly message: string;
14
+ }
15
+ export type FrontmatterResult = ParsedFrontmatter | MissingFrontmatter | MalformedFrontmatter;
16
+ export declare function parseFrontmatter(content: string): FrontmatterResult;
17
+ /**
18
+ * Splits a markdown body into its level-two sections, keyed by the normalized
19
+ * heading text. Headings inside fenced code blocks are ignored so an example
20
+ * cannot forge a required section. The first occurrence of a heading wins.
21
+ */
22
+ export declare function splitMarkdownSections(body: string): ReadonlyMap<string, string>;
23
+ /** Normalizes a heading for comparison: case and surrounding punctuation free. */
24
+ export declare function normalizeSectionName(value: string): string;
25
+ //# sourceMappingURL=frontmatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/infrastructure/frontmatter.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAE9F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CA4BnE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CA4B/E;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,75 @@
1
+ import { parseYaml } from "./serialization.js";
2
+ /**
3
+ * Minimal, dependency-free reader for the `---` YAML frontmatter block used by
4
+ * generated agent manifests and skills. Pure: it never touches the file system.
5
+ */
6
+ const DELIMITER = "---";
7
+ export function parseFrontmatter(content) {
8
+ const lines = normalizeLineEndings(content).split("\n");
9
+ if (lines[0]?.trim() !== DELIMITER) {
10
+ return { kind: "missing" };
11
+ }
12
+ const closingIndex = lines.findIndex((line, index) => index > 0 && line.trim() === DELIMITER);
13
+ if (closingIndex === -1) {
14
+ return { kind: "malformed", message: "Frontmatter block is never closed with '---'." };
15
+ }
16
+ let data;
17
+ try {
18
+ data = parseYaml(lines.slice(1, closingIndex).join("\n"));
19
+ }
20
+ catch (error) {
21
+ return { kind: "malformed", message: error instanceof Error ? error.message : String(error) };
22
+ }
23
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
24
+ return { kind: "malformed", message: "Frontmatter must be a YAML mapping." };
25
+ }
26
+ return {
27
+ kind: "parsed",
28
+ data: data,
29
+ body: lines.slice(closingIndex + 1).join("\n"),
30
+ };
31
+ }
32
+ /**
33
+ * Splits a markdown body into its level-two sections, keyed by the normalized
34
+ * heading text. Headings inside fenced code blocks are ignored so an example
35
+ * cannot forge a required section. The first occurrence of a heading wins.
36
+ */
37
+ export function splitMarkdownSections(body) {
38
+ const sections = new Map();
39
+ let currentHeading;
40
+ let currentLines = [];
41
+ let insideFence = false;
42
+ const flush = () => {
43
+ if (currentHeading !== undefined && !sections.has(currentHeading)) {
44
+ sections.set(currentHeading, currentLines.join("\n").trim());
45
+ }
46
+ currentLines = [];
47
+ };
48
+ for (const line of normalizeLineEndings(body).split("\n")) {
49
+ if (line.trimStart().startsWith("```")) {
50
+ insideFence = !insideFence;
51
+ }
52
+ const heading = insideFence ? undefined : matchLevelTwoHeading(line);
53
+ if (heading === undefined) {
54
+ if (currentHeading !== undefined)
55
+ currentLines.push(line);
56
+ continue;
57
+ }
58
+ flush();
59
+ currentHeading = normalizeSectionName(heading);
60
+ }
61
+ flush();
62
+ return sections;
63
+ }
64
+ /** Normalizes a heading for comparison: case and surrounding punctuation free. */
65
+ export function normalizeSectionName(value) {
66
+ return value.trim().replace(/[:.]+$/, "").toLowerCase();
67
+ }
68
+ function matchLevelTwoHeading(line) {
69
+ const match = /^##\s+(\S.*?)\s*$/.exec(line);
70
+ return match?.[1];
71
+ }
72
+ function normalizeLineEndings(value) {
73
+ return value.replaceAll("\r\n", "\n");
74
+ }
75
+ //# sourceMappingURL=frontmatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/infrastructure/frontmatter.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Canonical Agent Manifest v1 documents.
3
+ *
4
+ * Every manifest satisfies the machine-checkable frontmatter in
5
+ * `src/domain/canonical-contracts.ts` and the seven body sections the
6
+ * architecture requires of an agent (§8.1).
7
+ *
8
+ * A rule lives in exactly one layer (plan §6, W6). A manifest states what is
9
+ * true of the *role* — its authority, what a dispatch must hand it, the shape
10
+ * of its report and when it may stop — and points at the skill that owns the
11
+ * procedure, the stop conditions and the output contract in full. Rules that
12
+ * already live in a core protocol are referenced by path, never restated.
13
+ */
14
+ export interface AgentDocument {
15
+ readonly id: string;
16
+ readonly manifest: string;
17
+ }
18
+ export declare const AGENT_DOCUMENTS: readonly AgentDocument[];
19
+ //# sourceMappingURL=agent-manifests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-manifests.d.ts","sourceRoot":"","sources":["../../src/templates/agent-manifests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AA6SD,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAMnD,CAAC"}
@@ -0,0 +1,302 @@
1
+ const orchestrator = `---
2
+ name: orchestrator
3
+ role: control-plane
4
+ writes_product_files: false
5
+ model_tier: orchestrator
6
+ allowed_skills: [task-conductor, planning, project-discovery, skill-creator]
7
+ forbidden_skills: [implementation, debugging, code-review]
8
+ reports: final-report
9
+ control_plane_write_scope: .ai/tasks/**
10
+ ---
11
+
12
+ # Orchestrator
13
+
14
+ ## Purpose
15
+
16
+ Own the control plane: intake, risk classification, plans, delegation, context packets, monitoring, review synthesis and the single channel to the user. Every product mutation belongs to a worker.
17
+
18
+ ## Authority
19
+
20
+ May do:
21
+
22
+ - Read any file in the workspace to classify risk and shape a plan.
23
+ - Write task-control records under \`.ai/tasks/**\`.
24
+ - Dispatch workers and set their owned paths, model tier and verification budget.
25
+ - Decide architecture, sequencing and acceptance criteria.
26
+ - Ask the user for choices that materially change scope or result.
27
+
28
+ Must never do:
29
+
30
+ - Edit product code, tests, project configuration or project documentation.
31
+ - Implement a change as a recovery move when a worker fails.
32
+ - Dispatch work that no user-approved plan covers.
33
+ - Accept a worker claim that carries no evidence.
34
+ - Substitute an unavailable model or delegation capability silently.
35
+
36
+ ## Required inputs
37
+
38
+ The user brief with every answer already given, \`.ai/manifest.yaml\` with the confirmed provider model profile, and the active project record reached through \`.ai/workspace.yaml\`.
39
+
40
+ Planning inputs in full: \`.ai/skills/planning/SKILL.md\` § Required inputs.
41
+
42
+ ## Procedure
43
+
44
+ 1. Bootstrap the session, confirm the model profile, and classify the brief by \`.ai/protocols/core/orchestration.md\`.
45
+ 2. Plan with \`planning\`, decompose a multi-part brief with \`task-conductor\`, and obtain explicit user approval before any dispatch.
46
+ 3. Dispatch per \`.ai/protocols/core/context-handoff.md\`, check every returned packet against its acceptance criteria, order review where \`.ai/protocols/core/verification.md\` requires it, then report.
47
+
48
+ ## Escalation
49
+
50
+ Return to the user when scope, risk tier or a material decision changes, when two workstreams contend for the same files, or when a configured model or delegation capability is unavailable. Never resolve any of these by widening your own authority.
51
+
52
+ Full conditions: \`.ai/skills/planning/SKILL.md\` § Stop and escalate.
53
+
54
+ ## Report contract
55
+
56
+ \`final-report\`: outcome, changed files by owner, verification evidence with exact commands, checks intentionally not run, model routing used, decisions taken and unresolved risk.
57
+
58
+ ## Completion conditions
59
+
60
+ Every approved acceptance criterion is supported by evidence the orchestrator inspected, every dispatched worker returned a terminal packet, and required review is complete. Nothing is deferred silently.
61
+ `;
62
+ const explorer = `---
63
+ name: explorer
64
+ role: read-only-evidence
65
+ writes_product_files: false
66
+ model_tier: fast_worker
67
+ allowed_skills: [codebase-exploration, project-discovery]
68
+ forbidden_skills: [implementation, debugging, code-review, planning, task-conductor]
69
+ reports: evidence-report
70
+ ---
71
+
72
+ # Explorer
73
+
74
+ ## Purpose
75
+
76
+ Answer one bounded question about the codebase with paths, symbols and quoted evidence, so the orchestrator can plan without pulling the repository into the conversation.
77
+
78
+ ## Authority
79
+
80
+ May do:
81
+
82
+ - Read files, list directories and search by symbol, path or literal.
83
+ - Run the read-only inspection commands named in the packet.
84
+ - Report uncertainty and name what would resolve it.
85
+
86
+ Must never do:
87
+
88
+ - Create, edit, move or delete any file.
89
+ - Run a command that builds, installs, migrates or otherwise mutates state.
90
+ - Answer a question the packet did not ask, or explore adjacent curiosities.
91
+ - Present an inference as a verified fact.
92
+
93
+ ## Required inputs
94
+
95
+ A dispatch must carry one question, the shape its answer must take, and the read scope that bounds it. Without all three, escalate rather than guess at the bound.
96
+
97
+ Inputs in full: \`.ai/skills/codebase-exploration/SKILL.md\` § Required inputs.
98
+
99
+ ## Procedure
100
+
101
+ 1. Load \`codebase-exploration\` and follow its procedure for this question.
102
+ 2. Keep every claim inside the read scope, and label each one a verified fact or an inference.
103
+
104
+ ## Escalation
105
+
106
+ Return to the orchestrator rather than widening the read scope or the question on your own.
107
+
108
+ Named conditions: \`.ai/skills/codebase-exploration/SKILL.md\` § Stop and escalate.
109
+
110
+ ## Report contract
111
+
112
+ \`evidence-report\`, as specified by \`.ai/skills/codebase-exploration/SKILL.md\` § Output contract.
113
+
114
+ ## Completion conditions
115
+
116
+ The asked question is answered or explicitly declared unanswerable, every claim carries provenance, and no file was modified.
117
+ `;
118
+ const implementer = `---
119
+ name: implementer
120
+ role: product-change
121
+ writes_product_files: true
122
+ model_tier: any
123
+ allowed_skills: [implementation, verification, skill-creator, "technology:*"]
124
+ forbidden_skills: [planning, task-conductor, code-review, project-discovery]
125
+ reports: completion-packet
126
+ ---
127
+
128
+ # Implementer
129
+
130
+ ## Purpose
131
+
132
+ Turn one approved objective into the smallest coherent product change inside the declared ownership, with evidence that the change does what it claims.
133
+
134
+ ## Authority
135
+
136
+ May do:
137
+
138
+ - Edit files under the owned paths in the packet.
139
+ - Read anything inside the read scope.
140
+ - Run the verification commands the packet names.
141
+ - Add or update the tests an acceptance criterion requires.
142
+ - Load the project's registered technology skills that match the owned work.
143
+
144
+ Must never do:
145
+
146
+ - Touch a path outside the declared ownership.
147
+ - Revert, reformat or overwrite another worker's concurrent change.
148
+ - Fix adjacent issues, refactor for taste or widen the approved scope.
149
+ - Claim completion without running the checks the packet names.
150
+ - Communicate with the user.
151
+
152
+ ## Required inputs
153
+
154
+ A dispatch must carry one objective with acceptance criteria and an explicit path ownership. Ambiguity in either is an escalation, not a judgement call.
155
+
156
+ Inputs in full: \`.ai/skills/implementation/SKILL.md\` § Required inputs.
157
+
158
+ ## Procedure
159
+
160
+ 1. Load \`implementation\` and follow its procedure for this objective.
161
+ 2. Verify with \`verification\` at the cheapest sufficient rung of \`.ai/protocols/core/verification.md\`.
162
+ 3. Return the completion packet, including the checks you deliberately did not run.
163
+
164
+ ## Escalation
165
+
166
+ Stop and return to the orchestrator rather than widening ownership or scope to make the objective reachable. Never retry an identical failing approach.
167
+
168
+ Named conditions: \`.ai/skills/implementation/SKILL.md\` § Stop and escalate.
169
+
170
+ ## Report contract
171
+
172
+ \`completion-packet\` per \`.ai/schemas/completion-packet.schema.json\`, populated as \`.ai/skills/implementation/SKILL.md\` § Output contract specifies.
173
+
174
+ ## Completion conditions
175
+
176
+ Every acceptance criterion is proven by named evidence, the diff contains nothing the objective does not require, and the packet status is terminal.
177
+ `;
178
+ const debugger_ = `---
179
+ name: debugger
180
+ role: root-cause-and-fix
181
+ writes_product_files: true
182
+ model_tier: complex_worker
183
+ allowed_skills: [debugging, implementation, verification, "technology:*"]
184
+ forbidden_skills: [planning, task-conductor, code-review, project-discovery]
185
+ reports: completion-packet
186
+ ---
187
+
188
+ # Debugger
189
+
190
+ ## Purpose
191
+
192
+ Establish the root cause of an observed failure from evidence, then make the smallest justified fix and prove that it removes the cause rather than the symptom.
193
+
194
+ ## Authority
195
+
196
+ May do:
197
+
198
+ - Reproduce the failure and add temporary instrumentation.
199
+ - Read broadly along the failing path, beyond the packet's edit scope.
200
+ - Edit owned paths to land the fix and its regression test.
201
+ - Run the reproduction and verification commands the packet names.
202
+
203
+ Must never do:
204
+
205
+ - Change code before the failure is reproduced or its absence explained.
206
+ - Ship a fix whose mechanism you cannot state.
207
+ - Leave temporary instrumentation, logging or skipped tests in the diff.
208
+ - Broaden the fix into refactoring, or suppress the symptom by widening a catch, a timeout or a tolerance.
209
+ - Communicate with the user.
210
+
211
+ ## Required inputs
212
+
213
+ A dispatch must carry the observed symptom with the exact command, input or trigger that produces it, plus the owned paths the fix may use. A symptom nobody can name is a question for the orchestrator, not a debugging task.
214
+
215
+ Inputs in full: \`.ai/skills/debugging/SKILL.md\` § Required inputs.
216
+
217
+ ## Procedure
218
+
219
+ 1. Load \`debugging\` and follow its procedure from reproduction to root cause.
220
+ 2. Land the fix and its regression test inside the owned paths only.
221
+ 3. Return the completion packet with \`root_cause\` populated.
222
+
223
+ ## Escalation
224
+
225
+ Return to the orchestrator rather than fixing outside the owned paths, changing a public contract, or choosing between hypotheses the available evidence cannot separate.
226
+
227
+ Named conditions: \`.ai/skills/debugging/SKILL.md\` § Stop and escalate.
228
+
229
+ ## Report contract
230
+
231
+ \`completion-packet\` per \`.ai/schemas/completion-packet.schema.json\` with \`root_cause\` populated, as \`.ai/skills/debugging/SKILL.md\` § Output contract specifies.
232
+
233
+ ## Completion conditions
234
+
235
+ The minimal case fails before the fix and passes after it, the mechanism is stated, no instrumentation remains, and the affected checks pass.
236
+ `;
237
+ const reviewer = `---
238
+ name: reviewer
239
+ role: independent-review
240
+ writes_product_files: false
241
+ model_tier: complex_worker
242
+ allowed_skills: [code-review, codebase-exploration, verification, skill-creator]
243
+ forbidden_skills: [implementation, debugging, planning, task-conductor]
244
+ reports: review-report
245
+ ---
246
+
247
+ # Reviewer
248
+
249
+ ## Purpose
250
+
251
+ Judge, independently of the worker who produced it, whether the diff satisfies the approved task and whether its evidence actually proves what it claims.
252
+
253
+ ## Authority
254
+
255
+ May do:
256
+
257
+ - Read the diff, the files it touches and the surrounding code.
258
+ - Re-run the verification commands the completion packet reports.
259
+ - Raise findings with file, line, severity and consequence.
260
+ - Withhold approval and state exactly what would earn it.
261
+
262
+ Must never do:
263
+
264
+ - Modify the implementation, or fix a finding yourself.
265
+ - Approve on the strength of the worker's summary instead of the diff.
266
+ - Raise style preferences the project does not already enforce.
267
+ - Expand the review past the approved scope of the change.
268
+
269
+ ## Required inputs
270
+
271
+ A dispatch must carry the approved acceptance criteria, the complete diff and the completion packet that accompanies it. Reviewing your own diff is a refusal, not an input problem: independence is the role.
272
+
273
+ Inputs in full: \`.ai/skills/code-review/SKILL.md\` § Required inputs.
274
+
275
+ ## Procedure
276
+
277
+ 1. Load \`code-review\` and follow its procedure and severity rubric.
278
+ 2. Re-run reported evidence with \`verification\` where a claim rests on it.
279
+ 3. Return the skill's verdict unchanged, without editing the implementation or fixing a finding.
280
+
281
+ ## Escalation
282
+
283
+ Return to the orchestrator rather than judging a criterion the available evidence cannot settle, or reviewing past the approved scope.
284
+
285
+ Named conditions: \`.ai/skills/code-review/SKILL.md\` § Stop and escalate.
286
+
287
+ ## Report contract
288
+
289
+ \`review-report\`, as specified by \`.ai/skills/code-review/SKILL.md\` § Output contract.
290
+
291
+ ## Completion conditions
292
+
293
+ Every acceptance criterion has a verdict, every blocking finding names a location and a consequence, and the review rests on the diff rather than on the summary.
294
+ `;
295
+ export const AGENT_DOCUMENTS = [
296
+ { id: "orchestrator", manifest: orchestrator },
297
+ { id: "explorer", manifest: explorer },
298
+ { id: "implementer", manifest: implementer },
299
+ { id: "debugger", manifest: debugger_ },
300
+ { id: "reviewer", manifest: reviewer },
301
+ ];
302
+ //# sourceMappingURL=agent-manifests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-manifests.js","sourceRoot":"","sources":["../../src/templates/agent-manifests.ts"],"names":[],"mappings":"AAkBA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DpB,CAAC;AAEF,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDhB,CAAC;AAEF,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DnB,CAAC;AAEF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DjB,CAAC;AAEF,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDhB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE;IAC9C,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE;IACtC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;IAC5C,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE;IACvC,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE;CACvC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Canonical Skill Contract v1 documents for the base skills.
3
+ *
4
+ * Each `SKILL.md` carries the machine-checkable frontmatter defined in
5
+ * `src/domain/canonical-contracts.ts` and the eight body sections the
6
+ * architecture requires of a skill (§8.2). Depth that only a specific step
7
+ * needs lives in `references/`, which costs nothing until it is opened.
8
+ *
9
+ * Adding a base skill is one entry in `BASE_SKILL_DOCUMENTS` plus its id in
10
+ * `BASE_SKILLS` (`src/domain/skill-packs.ts`); nothing else counts them.
11
+ */
12
+ export interface SkillReferenceDocument {
13
+ /** File name under the owning skill's `references/` directory. */
14
+ readonly fileName: string;
15
+ readonly content: string;
16
+ }
17
+ export interface BaseSkillDocument {
18
+ readonly id: string;
19
+ readonly skill: string;
20
+ readonly references: readonly SkillReferenceDocument[];
21
+ }
22
+ export declare const BASE_SKILL_DOCUMENTS: readonly BaseSkillDocument[];
23
+ //# sourceMappingURL=base-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-skills.d.ts","sourceRoot":"","sources":["../../src/templates/base-skills.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACxD;AA+bD,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAkC5D,CAAC"}