yet-another-agentic-workflow 0.2.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 (61) hide show
  1. package/README.md +125 -0
  2. package/dist/adapters.d.ts +43 -0
  3. package/dist/adapters.js +191 -0
  4. package/dist/adapters.js.map +1 -0
  5. package/dist/architect.d.ts +38 -0
  6. package/dist/architect.js +275 -0
  7. package/dist/architect.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +580 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/feature.d.ts +30 -0
  12. package/dist/feature.js +344 -0
  13. package/dist/feature.js.map +1 -0
  14. package/dist/index.d.ts +22 -0
  15. package/dist/index.js +12 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/init.d.ts +26 -0
  18. package/dist/init.js +255 -0
  19. package/dist/init.js.map +1 -0
  20. package/dist/installer.d.ts +64 -0
  21. package/dist/installer.js +365 -0
  22. package/dist/installer.js.map +1 -0
  23. package/dist/observability.d.ts +37 -0
  24. package/dist/observability.js +200 -0
  25. package/dist/observability.js.map +1 -0
  26. package/dist/parser.d.ts +6 -0
  27. package/dist/parser.js +166 -0
  28. package/dist/parser.js.map +1 -0
  29. package/dist/persistence.d.ts +83 -0
  30. package/dist/persistence.js +279 -0
  31. package/dist/persistence.js.map +1 -0
  32. package/dist/providers.d.ts +14 -0
  33. package/dist/providers.js +27 -0
  34. package/dist/providers.js.map +1 -0
  35. package/dist/review.d.ts +29 -0
  36. package/dist/review.js +66 -0
  37. package/dist/review.js.map +1 -0
  38. package/dist/schema.d.ts +2 -0
  39. package/dist/schema.js +44 -0
  40. package/dist/schema.js.map +1 -0
  41. package/dist/skills.d.ts +24 -0
  42. package/dist/skills.js +210 -0
  43. package/dist/skills.js.map +1 -0
  44. package/dist/types.d.ts +86 -0
  45. package/dist/types.js +2 -0
  46. package/dist/types.js.map +1 -0
  47. package/package.json +48 -0
  48. package/schemas/agent.schema.json +37 -0
  49. package/schemas/context.schema.json +13 -0
  50. package/schemas/eval.schema.json +26 -0
  51. package/schemas/hook.schema.json +29 -0
  52. package/schemas/skill.schema.json +23 -0
  53. package/schemas/state.schema.json +14 -0
  54. package/schemas/workflow.schema.json +34 -0
  55. package/schemas/yaaw.schema.json +58 -0
  56. package/skills/clarify/SKILL.md +14 -0
  57. package/skills/code-review/SKILL.md +29 -0
  58. package/skills/slice-work/SKILL.md +15 -0
  59. package/skills/spec/SKILL.md +21 -0
  60. package/skills/tdd/SKILL.md +25 -0
  61. package/templates/instructions/managed-block.md +17 -0
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # Yet Another Agentic Workflow
2
+
3
+ **Yet Another Agentic Workflow installs a small, composable engineering harness into the coding agents you already use.**
4
+
5
+ ## What is YAAW?
6
+
7
+ YAAW configures Claude Code and OpenAI Codex with focused engineering skills. It does not replace your coding agent or require a separate workflow runtime. After setup, keep working in the agent you already use.
8
+
9
+ YAAW follows two principles:
10
+
11
+ > **Agents get judgment. Software gets enforcement.**
12
+
13
+ > **YAAW installs the engineering environment. The coding agent does the work.**
14
+
15
+ ## Quick start
16
+
17
+ From the repository you want to configure, run:
18
+
19
+ ```bash
20
+ npx yet-another-agentic-workflow@latest init
21
+ ```
22
+
23
+ Choose Claude Code, Codex, or both. The initializer discovers repository tooling, summarizes its plan, preserves existing instructions, installs provider-native skills, and records ownership metadata.
24
+
25
+ For scripts and CI, bypass prompts explicitly:
26
+
27
+ ```bash
28
+ npx yet-another-agentic-workflow@latest init --provider claude --provider codex --yes
29
+ ```
30
+
31
+ ## What gets installed
32
+
33
+ Claude Code uses:
34
+
35
+ ```text
36
+ CLAUDE.md
37
+ .claude/skills/<skill>/SKILL.md
38
+ ```
39
+
40
+ OpenAI Codex uses:
41
+
42
+ ```text
43
+ AGENTS.md
44
+ .agents/skills/<skill>/SKILL.md
45
+ ```
46
+
47
+ YAAW records installed version, selected providers, and generated-file hashes in:
48
+
49
+ ```text
50
+ .yaaw/install.json
51
+ ```
52
+
53
+ Skills come from the npm package. A project does not need a duplicate canonical `.yaaw/skills/` tree.
54
+
55
+ ## Supported coding agents
56
+
57
+ | Provider | Instruction file | Skills directory |
58
+ | --- | --- | --- |
59
+ | Claude Code | `CLAUDE.md` | `.claude/skills/` |
60
+ | OpenAI Codex | `AGENTS.md` | `.agents/skills/` |
61
+
62
+ Provider definitions live behind a registry so another native integration can be added without rewriting the installer.
63
+
64
+ ## Engineering skills
65
+
66
+ v0.2 ships the validated core set:
67
+
68
+ - `clarify` — resolve only consequential ambiguity;
69
+ - `spec` — turn evidence and decisions into acceptance criteria;
70
+ - `slice-work` — divide work into verifiable vertical slices;
71
+ - `tdd` — use public-seam red-green feedback loops;
72
+ - `code-review` — review specification fidelity and engineering standards independently.
73
+
74
+ ## Updating YAAW
75
+
76
+ Run the same command again:
77
+
78
+ ```bash
79
+ npx yet-another-agentic-workflow@latest init
80
+ ```
81
+
82
+ `init` handles installation, updates, provider reconfiguration, and repair. To add or remove providers non-interactively, pass the complete desired provider set with repeated `--provider` flags.
83
+
84
+ ## Existing-project safety
85
+
86
+ YAAW owns only its delimited section in `CLAUDE.md` or `AGENTS.md`:
87
+
88
+ ```markdown
89
+ <!-- yaaw:start -->
90
+ ...
91
+ <!-- yaaw:end -->
92
+ ```
93
+
94
+ Unrelated instruction content remains unchanged. Before updating or removing a generated skill, YAAW compares its current hash with `.yaaw/install.json`. Modified files are preserved and reported as conflicts; missing files are repaired on the next `init`. Writes are atomic and the manifest is written last.
95
+
96
+ Inspect an installation at any time:
97
+
98
+ ```bash
99
+ yaaw doctor
100
+ ```
101
+
102
+ ## Commands
103
+
104
+ | Command | Purpose |
105
+ | --- | --- |
106
+ | `yaaw init` | Install, update, reconfigure, or repair integrations |
107
+ | `yaaw doctor` | Validate manifest, instruction blocks, skills, and hashes |
108
+ | `yaaw version` | Show CLI and project-installed versions |
109
+ | `yaaw --help` | Show the public command surface |
110
+ | `yaaw --version` | Show the CLI version |
111
+
112
+ ## Philosophy
113
+
114
+ YAAW keeps global instructions small and puts procedures in composable skills. The installer plans before writing, constrains generated paths to the target repository, preserves user-owned configuration, and stays out of the way after setup.
115
+
116
+ ## Contributing
117
+
118
+ ```bash
119
+ npm ci
120
+ npm run typecheck
121
+ npm test
122
+ npm run test:package
123
+ ```
124
+
125
+ Package verification confirms that a clean packed artifact contains the CLI and skill assets and can initialize a temporary repository.
@@ -0,0 +1,43 @@
1
+ export type AdapterName = "claude" | "codex";
2
+ export interface AdapterSyncOptions {
3
+ check?: boolean;
4
+ force?: boolean;
5
+ }
6
+ export interface AdapterSkillRecord {
7
+ name: string;
8
+ source: string;
9
+ target: string;
10
+ sourceHash: string;
11
+ outputHash: string;
12
+ }
13
+ export interface AdapterManifest {
14
+ version: 1;
15
+ adapter: AdapterName;
16
+ sourceRoot: ".yaaw/skills";
17
+ targetRoot: string;
18
+ skills: AdapterSkillRecord[];
19
+ }
20
+ export interface AdapterDifference {
21
+ name: string;
22
+ kind: "missing" | "outdated" | "stale" | "conflict";
23
+ target: string;
24
+ }
25
+ export interface AdapterSyncResult {
26
+ adapter: AdapterName;
27
+ root: string;
28
+ sourceRoot: string;
29
+ targetRoot: string;
30
+ manifestPath: string;
31
+ check: boolean;
32
+ ok: boolean;
33
+ changed: boolean;
34
+ written: string[];
35
+ unchanged: string[];
36
+ removed: string[];
37
+ differences: AdapterDifference[];
38
+ }
39
+ export declare class AdapterError extends Error {
40
+ constructor(message: string);
41
+ }
42
+ /** Materialize every canonical YAAW skill into one harness representation. */
43
+ export declare function syncAdapterSkills(adapter: AdapterName, projectDirectory?: string, options?: AdapterSyncOptions): Promise<AdapterSyncResult>;
@@ -0,0 +1,191 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, readFile, rename, rmdir, unlink, writeFile } from "node:fs/promises";
3
+ import { dirname, join, relative, resolve, sep } from "node:path";
4
+ import { stringify } from "yaml";
5
+ import { discoverSkills, invokeSkill } from "./skills.js";
6
+ export class AdapterError extends Error {
7
+ constructor(message) {
8
+ super(message);
9
+ this.name = "AdapterError";
10
+ }
11
+ }
12
+ const TARGETS = {
13
+ claude: ".claude/skills",
14
+ codex: ".agents/skills"
15
+ };
16
+ function hash(source) {
17
+ return createHash("sha256").update(source).digest("hex");
18
+ }
19
+ function slash(path) {
20
+ return path.replaceAll("\\", "/");
21
+ }
22
+ function isRecord(value) {
23
+ return typeof value === "object" && value !== null && !Array.isArray(value);
24
+ }
25
+ async function readOptional(path) {
26
+ try {
27
+ return await readFile(path, "utf8");
28
+ }
29
+ catch (error) {
30
+ if (error.code === "ENOENT")
31
+ return undefined;
32
+ throw error;
33
+ }
34
+ }
35
+ async function atomicWrite(path, source) {
36
+ await mkdir(dirname(path), { recursive: true });
37
+ const temporary = `${path}.${process.pid}.tmp`;
38
+ await writeFile(temporary, source, "utf8");
39
+ await rename(temporary, path);
40
+ }
41
+ function outputDocument(name, description, instructions) {
42
+ const frontmatter = stringify({ name, description }).trimEnd();
43
+ return `---\n${frontmatter}\n---\n${instructions.trim()}\n`;
44
+ }
45
+ function targetPath(root, targetRoot, name) {
46
+ return join(root, targetRoot, name, "SKILL.md");
47
+ }
48
+ function assertManagedTarget(root, targetRoot, target) {
49
+ const boundary = resolve(root, targetRoot);
50
+ const absolute = resolve(root, target);
51
+ if (absolute !== boundary && !absolute.startsWith(`${boundary}${sep}`)) {
52
+ throw new AdapterError(`adapter manifest target escapes '${targetRoot}': ${target}`);
53
+ }
54
+ return absolute;
55
+ }
56
+ async function readManifest(path, adapter) {
57
+ const source = await readOptional(path);
58
+ if (source === undefined)
59
+ return undefined;
60
+ let value;
61
+ try {
62
+ value = JSON.parse(source);
63
+ }
64
+ catch {
65
+ throw new AdapterError(`${path} contains invalid JSON`);
66
+ }
67
+ if (!isRecord(value) || value.version !== 1 || value.adapter !== adapter || !Array.isArray(value.skills)) {
68
+ throw new AdapterError(`${path} is not a ${adapter} adapter manifest`);
69
+ }
70
+ for (const item of value.skills) {
71
+ if (!isRecord(item) || typeof item.name !== "string" || typeof item.source !== "string" || typeof item.target !== "string" || typeof item.sourceHash !== "string" || typeof item.outputHash !== "string") {
72
+ throw new AdapterError(`${path} contains an invalid skill record`);
73
+ }
74
+ }
75
+ return value;
76
+ }
77
+ /** Materialize every canonical YAAW skill into one harness representation. */
78
+ export async function syncAdapterSkills(adapter, projectDirectory = ".", options = {}) {
79
+ if (options.check && options.force)
80
+ throw new AdapterError("--check and --force cannot be combined");
81
+ const root = resolve(projectDirectory);
82
+ const sourceRoot = join(root, ".yaaw", "skills");
83
+ const relativeTargetRoot = TARGETS[adapter];
84
+ const adapterTargetRoot = join(root, relativeTargetRoot);
85
+ const manifestPath = join(root, ".yaaw", "adapters", `${adapter}.json`);
86
+ const previous = await readManifest(manifestPath, adapter);
87
+ const previousByName = new Map(previous?.skills.map((record) => [record.name, record]) ?? []);
88
+ const summaries = await discoverSkills(root);
89
+ const records = [];
90
+ const written = [];
91
+ const unchanged = [];
92
+ const removed = [];
93
+ const differences = [];
94
+ for (const summary of summaries) {
95
+ const invocation = await invokeSkill(summary.name, root);
96
+ const loaded = invocation.skills.find(({ name }) => name === summary.name);
97
+ const source = await readFile(summary.path, "utf8");
98
+ const output = outputDocument(summary.name, summary.description ?? summary.purpose, loaded.instructions);
99
+ const absoluteTarget = targetPath(root, relativeTargetRoot, summary.name);
100
+ const target = slash(relative(root, absoluteTarget));
101
+ const current = await readOptional(absoluteTarget);
102
+ const old = previousByName.get(summary.name);
103
+ const currentHash = current === undefined ? undefined : hash(current);
104
+ const outputHash = hash(output);
105
+ const conflict = current !== undefined && currentHash !== outputHash && (!old || currentHash !== old.outputHash);
106
+ if (current === undefined)
107
+ differences.push({ name: summary.name, kind: "missing", target });
108
+ else if (conflict)
109
+ differences.push({ name: summary.name, kind: "conflict", target });
110
+ else if (currentHash !== outputHash)
111
+ differences.push({ name: summary.name, kind: "outdated", target });
112
+ if (!options.check) {
113
+ if (conflict && !options.force) {
114
+ throw new AdapterError(`${target} diverged from its generated ${adapter} copy; rerun with --force to replace it from .yaaw/skills`);
115
+ }
116
+ if (currentHash !== outputHash) {
117
+ await atomicWrite(absoluteTarget, output);
118
+ written.push(target);
119
+ }
120
+ else {
121
+ unchanged.push(target);
122
+ }
123
+ }
124
+ else if (currentHash === outputHash) {
125
+ unchanged.push(target);
126
+ }
127
+ records.push({
128
+ name: summary.name,
129
+ source: slash(relative(root, summary.path)),
130
+ target,
131
+ sourceHash: hash(source),
132
+ outputHash
133
+ });
134
+ }
135
+ const canonicalNames = new Set(records.map(({ name }) => name));
136
+ for (const stale of previous?.skills ?? []) {
137
+ if (canonicalNames.has(stale.name))
138
+ continue;
139
+ const absoluteTarget = assertManagedTarget(root, relativeTargetRoot, stale.target);
140
+ const current = await readOptional(absoluteTarget);
141
+ if (current === undefined)
142
+ continue;
143
+ const conflict = hash(current) !== stale.outputHash;
144
+ differences.push({ name: stale.name, kind: conflict ? "conflict" : "stale", target: stale.target });
145
+ if (options.check)
146
+ continue;
147
+ if (conflict && !options.force) {
148
+ throw new AdapterError(`${stale.target} is stale and locally modified; rerun with --force to remove the generated skill`);
149
+ }
150
+ await unlink(absoluteTarget);
151
+ try {
152
+ await rmdir(dirname(absoluteTarget));
153
+ }
154
+ catch (error) {
155
+ if (error.code !== "ENOTEMPTY")
156
+ throw error;
157
+ }
158
+ removed.push(stale.target);
159
+ }
160
+ const manifest = {
161
+ version: 1,
162
+ adapter,
163
+ sourceRoot: ".yaaw/skills",
164
+ targetRoot: slash(relativeTargetRoot),
165
+ skills: records
166
+ };
167
+ const manifestSource = `${JSON.stringify(manifest, null, 2)}\n`;
168
+ const oldManifestSource = await readOptional(manifestPath);
169
+ const manifestChanged = oldManifestSource !== manifestSource;
170
+ if (!options.check && manifestChanged)
171
+ await atomicWrite(manifestPath, manifestSource);
172
+ if (options.check && manifestChanged && differences.length === 0) {
173
+ differences.push({ name: "<manifest>", kind: "outdated", target: slash(relative(root, manifestPath)) });
174
+ }
175
+ const changed = written.length > 0 || removed.length > 0 || (!options.check && manifestChanged);
176
+ return {
177
+ adapter,
178
+ root,
179
+ sourceRoot,
180
+ targetRoot: adapterTargetRoot,
181
+ manifestPath,
182
+ check: options.check ?? false,
183
+ ok: options.check ? differences.length === 0 : true,
184
+ changed,
185
+ written,
186
+ unchanged,
187
+ removed,
188
+ differences
189
+ };
190
+ }
191
+ //# sourceMappingURL=adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA8C1D,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,OAAO,GAAgC;IAC3C,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,SAAS,IAAI,CAAC,MAAc;IAC1B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,KAAK,CAAC,IAAY;IACzB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK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face ArchitectAnswers {
3
+ requiresJudgment: boolean;
4
+ deterministic: boolean;
5
+ isolated: boolean;
6
+ requiresProof: boolean;
7
+ requiresSequencing: boolean;
8
+ needsKnowledge: boolean;
9
+ needsPersistence: boolean;
10
+ }
11
+ export interface ArchitectDiagnosis {
12
+ problem: string;
13
+ kind: PrimitiveKind;
14
+ suggestedName: string;
15
+ answers: ArchitectAnswers;
16
+ reasons: string[];
17
+ scores: Record<PrimitiveKind, number>;
18
+ }
19
+ export interface ArchitectOptions {
20
+ name?: string;
21
+ dryRun?: boolean;
22
+ force?: boolean;
23
+ }
24
+ export interface ArchitectResult {
25
+ diagnosis: ArchitectDiagnosis;
26
+ name: string;
27
+ root: string;
28
+ configPath: string;
29
+ artifactPaths: string[];
30
+ changed: boolean;
31
+ }
32
+ export declare class ArchitectError extends Error {
33
+ constructor(message: string);
34
+ }
35
+ /** Diagnose a requirement before choosing a YAAW primitive. */
36
+ export declare function diagnoseArchitecture(problem: string): ArchitectDiagnosis;
37
+ /** Diagnose a problem, add the selected primitive to yaaw.yaml, and create its focused artifact. */
38
+ export declare function architectWorkflow(problem: string, projectDirectory?: string, options?: ArchitectOptions): Promise<ArchitectResult>;