@kontourai/flow-agents 1.1.0 → 1.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 (75) hide show
  1. package/.github/workflows/runtime-compat.yml +5 -2
  2. package/CHANGELOG.md +26 -0
  3. package/README.md +26 -5
  4. package/build/src/cli/{flow-kit.js → kit.js} +122 -108
  5. package/build/src/cli/validate-source-tree.js +4 -4
  6. package/build/src/cli.js +3 -3
  7. package/build/src/flow-kit/validate.js +58 -62
  8. package/build/src/tools/build-universal-bundles.js +64 -17
  9. package/build/src/tools/generate-context-map.js +49 -7
  10. package/build/src/tools/validate-source-tree.js +32 -1
  11. package/docs/adr/0007-flow-skill-kit-tool-boundary.md +169 -0
  12. package/docs/adr/0007-skill-audit.md +112 -0
  13. package/docs/adr/0008-kit-operation-boundary.md +88 -0
  14. package/docs/context-map.md +18 -22
  15. package/docs/flow-kit-repository-contract.md +5 -5
  16. package/docs/getting-started.md +177 -0
  17. package/docs/index.md +19 -8
  18. package/docs/kit-authoring-guide.md +26 -7
  19. package/docs/knowledge-kit.md +2 -2
  20. package/docs/spec/runtime-hook-surface.md +1 -1
  21. package/docs/vision.md +1 -1
  22. package/docs/workflow-usage-guide.md +1 -1
  23. package/evals/fixtures/builder-kit-workflow-state/happy-path.json +2 -2
  24. package/evals/fixtures/builder-kit-workflow-state/mid-work-resume.json +2 -2
  25. package/evals/fixtures/console-learning-projection/artifacts/console-learning-correction/learning.json +1 -1
  26. package/evals/fixtures/pull-work-provider/github-issues.json +5 -5
  27. package/evals/integration/test_activate_npx_context.sh +2 -2
  28. package/evals/integration/test_bundle_install.sh +17 -12
  29. package/evals/integration/test_console_learning_projection.sh +1 -1
  30. package/evals/integration/test_flow_kit_install_git.sh +7 -7
  31. package/evals/integration/test_flow_kit_repository.sh +4 -4
  32. package/evals/integration/test_kit_conformance_levels.sh +1 -1
  33. package/evals/integration/test_local_flow_kit_install.sh +7 -7
  34. package/evals/integration/test_publish_change_helper.sh +1 -1
  35. package/evals/integration/test_pull_work_provider.sh +1 -1
  36. package/evals/integration/test_runtime_adapter_activation.sh +3 -3
  37. package/evals/lib/node.sh +2 -2
  38. package/evals/static/test_workflow_skills.sh +15 -15
  39. package/integrations/strands/flow_agents_strands/steering.py +1 -1
  40. package/integrations/strands-ts/src/hooks.ts +1 -1
  41. package/kits/builder/kit.json +17 -0
  42. package/{skills → kits/builder/skills}/builder-shape/SKILL.md +4 -4
  43. package/{skills → kits/builder/skills}/idea-to-backlog/SKILL.md +1 -1
  44. package/kits/knowledge/kit.json +16 -9
  45. package/package.json +8 -5
  46. package/packaging/packs.json +1 -21
  47. package/scripts/README.md +1 -1
  48. package/scripts/kit.js +2 -0
  49. package/skills/README.md +23 -0
  50. package/src/cli/{flow-kit.ts → kit.ts} +124 -109
  51. package/src/cli/validate-source-tree.ts +4 -4
  52. package/src/cli.ts +3 -3
  53. package/src/flow-kit/validate.ts +63 -57
  54. package/src/tools/build-universal-bundles.ts +60 -13
  55. package/src/tools/generate-context-map.ts +36 -6
  56. package/src/tools/validate-source-tree.ts +27 -1
  57. package/scripts/flow-kit.js +0 -2
  58. package/skills/context-budget/SKILL.md +0 -40
  59. package/skills/explore/SKILL.md +0 -137
  60. package/skills/feedback-loop/SKILL.md +0 -87
  61. package/skills/frontend-design/SKILL.md +0 -80
  62. /package/{skills → kits/builder/skills}/deliver/SKILL.md +0 -0
  63. /package/{skills → kits/builder/skills}/design-probe/SKILL.md +0 -0
  64. /package/{skills → kits/builder/skills}/evidence-gate/SKILL.md +0 -0
  65. /package/{skills → kits/builder/skills}/execute-plan/SKILL.md +0 -0
  66. /package/{skills → kits/builder/skills}/fix-bug/SKILL.md +0 -0
  67. /package/{skills → kits/builder/skills}/learning-review/SKILL.md +0 -0
  68. /package/{skills → kits/builder/skills}/pickup-probe/SKILL.md +0 -0
  69. /package/{skills → kits/builder/skills}/plan-work/SKILL.md +0 -0
  70. /package/{skills → kits/builder/skills}/pull-work/SKILL.md +0 -0
  71. /package/{skills → kits/builder/skills}/release-readiness/SKILL.md +0 -0
  72. /package/{skills → kits/builder/skills}/review-work/SKILL.md +0 -0
  73. /package/{skills → kits/builder/skills}/tdd-workflow/SKILL.md +0 -0
  74. /package/{skills → kits/builder/skills}/verify-work/SKILL.md +0 -0
  75. /package/{skills → kits/knowledge/skills}/knowledge-capture/SKILL.md +0 -0
@@ -9,6 +9,61 @@ const packs = loadJson(path.join(root, "packaging/packs.json"));
9
9
  const textExtensions = new Set([".css", ".html", ".js", ".json", ".md", ".sh", ".toml", ".txt", ".yaml", ".yml", ".ts"]);
10
10
  const dropDiagnostics = [];
11
11
  const printDiagnostics = !["0", "false", "no"].includes(String(process.env.FLOW_AGENTS_EXPORT_DIAGNOSTICS ?? "1").toLowerCase());
12
+ /**
13
+ * Collect all skill source paths across skills/ and kit-owned skills.
14
+ * Returns an array of {name, src} pairs where name is the install name
15
+ * (same as the directory name) and src is the absolute SKILL.md path.
16
+ * Kit-owned skills are discovered by reading kit.json `skills` arrays;
17
+ * each entry's `path` is resolved relative to the kit directory.
18
+ */
19
+ function collectAllSkills() {
20
+ const results = [];
21
+ const seen = new Set();
22
+ // 1. Top-level skills/ directory (tools pending reclassification).
23
+ const skillsDir = path.join(root, "skills");
24
+ if (fs.existsSync(skillsDir)) {
25
+ for (const skill of fs.readdirSync(skillsDir).sort()) {
26
+ const skillPath = path.join(skillsDir, skill, "SKILL.md");
27
+ if (fs.existsSync(skillPath) && !seen.has(skill)) {
28
+ seen.add(skill);
29
+ results.push({ name: skill, src: skillPath });
30
+ }
31
+ }
32
+ }
33
+ // 2. Kit-owned skills declared in kits/<kit>/kit.json `skills` arrays.
34
+ const kitsDir = path.join(root, "kits");
35
+ if (fs.existsSync(kitsDir)) {
36
+ for (const kitName of fs.readdirSync(kitsDir).sort()) {
37
+ const kitJson = path.join(kitsDir, kitName, "kit.json");
38
+ if (!fs.existsSync(kitJson))
39
+ continue;
40
+ let kitManifest;
41
+ try {
42
+ kitManifest = loadJson(kitJson);
43
+ }
44
+ catch {
45
+ continue;
46
+ }
47
+ const skills = Array.isArray(kitManifest["skills"]) ? kitManifest["skills"] : [];
48
+ for (const entry of skills) {
49
+ if (typeof entry !== "object" || entry === null)
50
+ continue;
51
+ const skillEntry = entry;
52
+ const relPath = typeof skillEntry["path"] === "string" ? skillEntry["path"] : null;
53
+ if (!relPath)
54
+ continue;
55
+ // Derive install name from the directory containing SKILL.md (one level up).
56
+ const absPath = path.resolve(path.join(kitsDir, kitName), relPath);
57
+ const skillName = path.basename(path.dirname(absPath));
58
+ if (fs.existsSync(absPath) && !seen.has(skillName)) {
59
+ seen.add(skillName);
60
+ results.push({ name: skillName, src: absPath });
61
+ }
62
+ }
63
+ }
64
+ }
65
+ return results.sort((a, b) => a.name.localeCompare(b.name));
66
+ }
12
67
  function resetDir(dir) {
13
68
  fs.rmSync(dir, { recursive: true, force: true });
14
69
  fs.mkdirSync(dir, { recursive: true });
@@ -327,10 +382,8 @@ function buildClaudeCode(agents) {
327
382
  writeText(path.join(bundle, manifest.claude_code.task_dir, ".gitkeep"), "");
328
383
  for (const spec of agents)
329
384
  writeText(path.join(bundle, ".claude/agents", `${spec.name}.md`), exportClaudeAgent(spec));
330
- for (const skill of fs.readdirSync(path.join(root, "skills"))) {
331
- const skillPath = path.join(root, "skills", skill, "SKILL.md");
332
- if (fs.existsSync(skillPath))
333
- writeText(path.join(bundle, ".claude/skills", skill, "SKILL.md"), sanitizeText(readText(skillPath), "claude-code", "<bundle-root>"));
385
+ for (const { name, src } of collectAllSkills()) {
386
+ writeText(path.join(bundle, ".claude/skills", name, "SKILL.md"), sanitizeText(readText(src), "claude-code", "<bundle-root>"));
334
387
  }
335
388
  writeText(path.join(bundle, ".claude/settings.json"), exportClaudeSettings());
336
389
  writeText(path.join(bundle, "AGENTS.md"), exportRootAgentsMd("Claude Code", agents, manifest.claude_code.task_dir));
@@ -352,10 +405,8 @@ function buildCodex(agents) {
352
405
  writeText(path.join(bundle, ".codex/hooks.json"), exportCodexHooks());
353
406
  for (const spec of targetAgents)
354
407
  writeText(path.join(bundle, ".codex/agents", `${spec.name}.toml`), exportCodexAgent(spec));
355
- for (const skill of fs.readdirSync(path.join(root, "skills"))) {
356
- const skillPath = path.join(root, "skills", skill, "SKILL.md");
357
- if (fs.existsSync(skillPath))
358
- writeText(path.join(bundle, ".codex/skills", skill, "SKILL.md"), sanitizeText(readText(skillPath), "codex", "<bundle-root>"));
408
+ for (const { name, src } of collectAllSkills()) {
409
+ writeText(path.join(bundle, ".codex/skills", name, "SKILL.md"), sanitizeText(readText(src), "codex", "<bundle-root>"));
359
410
  }
360
411
  writeText(path.join(bundle, "AGENTS.md"), exportRootAgentsMd("Codex", targetAgents, manifest.codex.task_dir));
361
412
  writeText(path.join(bundle, "README.md"), exportTargetReadme("Codex", "bash install.sh /path/to/workspace"));
@@ -519,10 +570,8 @@ function buildOpencode(agents) {
519
570
  for (const spec of agents) {
520
571
  writeText(path.join(bundle, ".opencode/agents", `${spec.name}.md`), exportOpencodeAgent(spec));
521
572
  }
522
- for (const skill of fs.readdirSync(path.join(root, "skills"))) {
523
- const skillPath = path.join(root, "skills", skill, "SKILL.md");
524
- if (fs.existsSync(skillPath))
525
- writeText(path.join(bundle, ".opencode/skills", skill, "SKILL.md"), sanitizeText(readText(skillPath), "opencode", "<bundle-root>"));
573
+ for (const { name, src } of collectAllSkills()) {
574
+ writeText(path.join(bundle, ".opencode/skills", name, "SKILL.md"), sanitizeText(readText(src), "opencode", "<bundle-root>"));
526
575
  }
527
576
  writeText(path.join(bundle, ".opencode/plugins/flow-agents.js"), exportOpencodePlugin());
528
577
  writeText(path.join(bundle, "opencode.json"), exportOpencodeConfig());
@@ -632,10 +681,8 @@ function buildPi(agents) {
632
681
  writeText(path.join(bundle, manifest.pi.task_dir, ".gitkeep"), "");
633
682
  // pi has no named-subagent registry; agents are left canonical/unexported.
634
683
  // Skills are exported to .pi/skills/ (direct .md files supported in that dir).
635
- for (const skill of fs.readdirSync(path.join(root, "skills"))) {
636
- const skillPath = path.join(root, "skills", skill, "SKILL.md");
637
- if (fs.existsSync(skillPath))
638
- writeText(path.join(bundle, ".pi/skills", skill, "SKILL.md"), sanitizeText(readText(skillPath), "pi", "<bundle-root>"));
684
+ for (const { name, src } of collectAllSkills()) {
685
+ writeText(path.join(bundle, ".pi/skills", name, "SKILL.md"), sanitizeText(readText(src), "pi", "<bundle-root>"));
639
686
  }
640
687
  writeText(path.join(bundle, ".pi/extensions/flow-agents.ts"), exportPiExtension());
641
688
  writeText(path.join(bundle, "AGENTS.md"), exportRootAgentsMd("pi", agents, manifest.pi.task_dir));
@@ -648,7 +695,7 @@ function buildCatalog(agents) {
648
695
  return {
649
696
  source_root: ".",
650
697
  agents: agents.slice().sort((a, b) => a.name.localeCompare(b.name)).map((spec) => spec.name),
651
- skills: fs.readdirSync(path.join(root, "skills")).filter((name) => fs.existsSync(path.join(root, "skills", name, "SKILL.md"))).sort(),
698
+ skills: collectAllSkills().map(({ name }) => name),
652
699
  powers: fs.readdirSync(path.join(root, "powers")).filter((name) => fs.existsSync(path.join(root, "powers", name, "mcp.json"))).sort(),
653
700
  packs: packs.packs ?? [],
654
701
  kits: fs.existsSync(kitsCatalog) ? loadJson(kitsCatalog).kits ?? [] : [],
@@ -75,16 +75,58 @@ function repoShape(manifest) {
75
75
  rows.push([".flow-agents", "runtime", "Cross-session workflow artifacts and sidecars. Not committed by default."]);
76
76
  return rows;
77
77
  }
78
+ /** Collect all skill {name, absPath} pairs from skills/ and kit-owned skills. */
79
+ function allSkillPaths() {
80
+ const results = [];
81
+ const seen = new Set();
82
+ const skillsDir = path.join(root, "skills");
83
+ if (exists(skillsDir)) {
84
+ for (const name of fs.readdirSync(skillsDir).sort()) {
85
+ const absPath = path.join(skillsDir, name, "SKILL.md");
86
+ if (exists(absPath) && !seen.has(name)) {
87
+ seen.add(name);
88
+ results.push({ name, absPath });
89
+ }
90
+ }
91
+ }
92
+ const kitsDir = path.join(root, "kits");
93
+ if (exists(kitsDir)) {
94
+ for (const kitName of fs.readdirSync(kitsDir).sort()) {
95
+ const kitJson = path.join(kitsDir, kitName, "kit.json");
96
+ if (!exists(kitJson))
97
+ continue;
98
+ let kitManifest;
99
+ try {
100
+ kitManifest = loadJson(kitJson);
101
+ }
102
+ catch {
103
+ continue;
104
+ }
105
+ const skills = Array.isArray(kitManifest["skills"]) ? kitManifest["skills"] : [];
106
+ for (const entry of skills) {
107
+ if (typeof entry !== "object" || entry === null)
108
+ continue;
109
+ const skillEntry = entry;
110
+ const relPath = typeof skillEntry["path"] === "string" ? skillEntry["path"] : null;
111
+ if (!relPath)
112
+ continue;
113
+ const absPath = path.resolve(path.join(kitsDir, kitName), relPath);
114
+ const skillName = path.basename(path.dirname(absPath));
115
+ if (exists(absPath) && !seen.has(skillName)) {
116
+ seen.add(skillName);
117
+ results.push({ name: skillName, absPath });
118
+ }
119
+ }
120
+ }
121
+ }
122
+ return results.sort((a, b) => a.name.localeCompare(b.name));
123
+ }
78
124
  function listSkillRows() {
79
125
  const workflowRows = [];
80
126
  const supportRows = [];
81
- const skillsDir = path.join(root, "skills");
82
- for (const name of fs.readdirSync(skillsDir).sort()) {
83
- const skillPath = path.join(skillsDir, name, "SKILL.md");
84
- if (!exists(skillPath))
85
- continue;
86
- const meta = frontmatter(readText(skillPath));
87
- const row = [meta.name ?? name, rel(skillPath), oneLine(meta.description ?? "")];
127
+ for (const { name, absPath } of allSkillPaths()) {
128
+ const meta = frontmatter(readText(absPath));
129
+ const row = [meta.name ?? name, rel(absPath), oneLine(meta.description ?? "")];
88
130
  if (workflowSkills.has(row[0]))
89
131
  workflowRows.push(row);
90
132
  else
@@ -37,7 +37,7 @@ const publicScriptWrappers = new Map([
37
37
  ] }],
38
38
  ["scripts/filter-installed-packs.js", { target: "../build/src/tools/filter-installed-packs.js", significantLines: ['import("../build/src/tools/filter-installed-packs.js").then(({ main }) => process.exit(main(process.argv.slice(2))));'] }],
39
39
  ["scripts/generate-context-map.js", { target: "../build/src/tools/generate-context-map.js", significantLines: ['import("../build/src/tools/generate-context-map.js").then(({ main }) => process.exit(main(process.argv.slice(2))));'] }],
40
- ["scripts/flow-kit.js", { target: "../build/src/cli/flow-kit.js", significantLines: ['import("../build/src/cli/flow-kit.js").then(({ main }) => process.exit(main()));'] }],
40
+ ["scripts/kit.js", { target: "../build/src/cli/kit.js", significantLines: ['import("../build/src/cli/kit.js").then(({ main }) => main().then((code) => process.exit(code)));'] }],
41
41
  ["scripts/pull-work-provider.js", { target: "../build/src/cli/pull-work-provider.js", significantLines: ['import("../build/src/cli/pull-work-provider.js").then(({ main }) => process.exit(main()));'] }],
42
42
  ["scripts/effective-backlog-settings.js", { target: "../build/src/cli/effective-backlog-settings.js", significantLines: ['import("../build/src/cli/effective-backlog-settings.js").then(({ main }) => process.exit(main()));'] }],
43
43
  ["scripts/publish-change-helper.js", { target: "../build/src/cli/publish-change-helper.js", significantLines: ['import("../build/src/cli/publish-change-helper.js").then(({ main }) => process.exit(main()));'] }],
@@ -391,6 +391,32 @@ function validateAgentPaths(reporter, manifest) {
391
391
  }
392
392
  }
393
393
  function validateLegacyRefs(reporter) {
394
+ // Collect all kit-owned asset relative paths so legacy-ref scanning can skip matches
395
+ // that are subpaths of kit-owned assets. E.g. legacyRefRe matches "skills/plan-work/SKILL.md"
396
+ // within "kits/builder/skills/plan-work/SKILL.md"; the kit declares and validates these.
397
+ const kitOwnedSubPaths = new Set();
398
+ const kitsDir = path.join(root, "kits");
399
+ if (fs.existsSync(kitsDir)) {
400
+ for (const kitName of fs.readdirSync(kitsDir)) {
401
+ const kitJson = path.join(kitsDir, kitName, "kit.json");
402
+ if (!fs.existsSync(kitJson))
403
+ continue;
404
+ try {
405
+ const kitManifest = loadJson(kitJson);
406
+ for (const section of ["skills", "docs", "adapters", "evals", "assets"]) {
407
+ const entries = Array.isArray(kitManifest[section]) ? kitManifest[section] : [];
408
+ for (const entry of entries) {
409
+ if (typeof entry !== "object" || entry === null)
410
+ continue;
411
+ const relPath = entry["path"];
412
+ if (typeof relPath === "string" && relPath)
413
+ kitOwnedSubPaths.add(relPath);
414
+ }
415
+ }
416
+ }
417
+ catch { /* skip invalid kit.json */ }
418
+ }
419
+ }
394
420
  for (const file of walkFiles(path.join(root, "evals")).sort()) {
395
421
  if (!textRefExtensions.has(path.extname(file)))
396
422
  continue;
@@ -404,6 +430,11 @@ function validateLegacyRefs(reporter) {
404
430
  continue;
405
431
  if (ref.split(/[\\/]/).includes("node_modules"))
406
432
  continue;
433
+ // Skip refs that are declared kit-owned asset paths or their parent directories
434
+ // (e.g. "skills/plan-work/SKILL.md" or "skills/plan-work" matched inside
435
+ // "kits/builder/skills/plan-work/SKILL.md" in eval files).
436
+ if (kitOwnedSubPaths.has(ref) || [...kitOwnedSubPaths].some((p) => p.startsWith(ref + "/")))
437
+ continue;
407
438
  const candidates = [path.join(root, ref), ...(ref.startsWith("evals/") ? [] : [path.join(root, "evals", ref)])];
408
439
  if (!candidates.some(fs.existsSync))
409
440
  reporter.fail(`${rel(file)}: references missing source path: ${ref}`);
@@ -0,0 +1,169 @@
1
+ ---
2
+ title: "ADR 0007: Flow / Skill / Kit / Tool Boundary"
3
+ ---
4
+
5
+ # ADR 0007: Flow / Skill / Kit / Tool Boundary
6
+
7
+ **Date:** 2026-06-15
8
+ **Status:** Accepted
9
+
10
+ ---
11
+
12
+ ## Context
13
+
14
+ Flow Agents has accumulated ~26 skills. When kits were first introduced, the word "skill" was used loosely for anything the agent knew how to do — from kit-specific workflow procedures to general capabilities (search, browser, dependency scanning) to cross-cutting concerns (agentic engineering principles, context budgeting). That blurred three genuinely different things: the agent's *procedural methods for flow steps*, the *raw capabilities it wields*, and the *containers that package flows with their implementations*.
15
+
16
+ The boundary became sharper when the Flow Definition container moved to `kontourai/flow` (ADR 0001). Once Flow owns the process contract and Flow Agents owns the agent-facing implementation, a natural question emerges: where does each skill belong, and what is a skill in the first place?
17
+
18
+ A related accumulation was an informal "general capability skill tier" — skills like `agentic-engineering`, `search-first`, `github-cli`, and `eval-rebuild` that described how the agent uses runtime capabilities, not how it implements a specific flow step. That tier was never designed; it accreted as the skill list grew. It is not a peer design concept alongside Kit-skills; it is an artifact of undifferentiated naming.
19
+
20
+ This ADR records the conceptual model that was agreed in a design conversation with Brian Anderson on 2026-06-15 and makes it the authoritative reference for future skill placement, kit authoring, and orphan triage.
21
+
22
+ ---
23
+
24
+ ## Decision
25
+
26
+ ### The Four Definitions
27
+
28
+ #### 1. Flow Definition = the WHAT
29
+
30
+ A Flow Definition is a process contract: steps, gates, expected evidence, and definition-of-done. It is the container for *what* a workflow accomplishes, not *how* the agent does it.
31
+
32
+ - Flow Definitions are owned and validated by `kontourai/flow`.
33
+ - They are agentless-capable: a CI job or a human can satisfy a flow without an agent, as proven by the agentless gate-eval work (issues #52 and #60).
34
+ - Flow Agents *consumes* Flow Definitions; it does not own them (ADR 0001).
35
+
36
+ #### 2. Skill = the HOW = the *do* of a specific flow step
37
+
38
+ A skill is the agent's procedural method for accomplishing one step or gate of a flow. Brian's framing: *"skills are the do part of the flow definition."*
39
+
40
+ Consequences of this definition:
41
+
42
+ - There is exactly **one kind of skill** in the intended design.
43
+ - Every skill is bound to a flow step: it implements the agent's side of that step.
44
+ - Every skill belongs to the kit that owns that flow.
45
+ - A skill with no flow step behind it is not a skill in this model — it is either a tool, an orphan, or evidence of a missing flow.
46
+
47
+ The earlier informal "general capability skill tier" was an accreted artifact, not a designed concept. It is not a peer category to Kit-skills. Skills in that tier are reclassified as tools, orphans, or — where a missing flow is strongly implied — candidates for a future kit.
48
+
49
+ #### 3. Tool = a raw capability the agent wields
50
+
51
+ A tool is something the agent *uses* to do the work: run bash, read/write files, drive a browser, call `gh`, look up packages, search the web. Tools are:
52
+
53
+ - Provided by the runtime or harness, not tied to any flow.
54
+ - The agent's *hands*, not its *method*.
55
+ - Distinct from a skill even when the agent wraps a tool call in a named skill file — if the "skill" is just "here is how to invoke this capability," it is a tool description, not a flow-step method.
56
+
57
+ A skill that only describes how to use a tool (e.g., `github-cli`, `browser-test`, `eval-rebuild`) belongs in harness documentation or an agent system prompt, not in the `skills/` directory as a first-class skill.
58
+
59
+ #### 4. Kit = packages a flow with its skills
60
+
61
+ A kit:
62
+
63
+ - Owns one or more Flow Definitions.
64
+ - Provides the agent-side skills that implement those flows' steps.
65
+ - May include store adapters, evals, and docs.
66
+
67
+ A kit's skills are the agent-side implementation of that kit's flows, in a one-to-one relationship between skills and flow steps (or a small cluster of closely related steps).
68
+
69
+ ### Core Rule
70
+
71
+ > **A skill that has no flow step behind it is not a Kit-skill.** It is either:
72
+ > - (a) a **TOOL** mislabeled as a skill — it describes a raw capability and should live in harness docs or an agent system prompt, or
73
+ > - (b) an **ORPHAN** — it is procedural and agent-driven but the flow that would own its step has not been defined yet; it signals a missing or implicit flow, or
74
+ > - (c) **scope drift** — it does not belong in this repo's skill layer at all.
75
+
76
+ ### Cross-Kit Skill Sharing: DEFERRED
77
+
78
+ A question arose during this discussion: can a skill be shared across kits? For example, `knowledge-capture` is implemented as a Knowledge Kit skill (`knowledge.ingest:capture`) but is used as a support step inside Builder Kit flows (e.g., `learning-review` calls `knowledge-capture`).
79
+
80
+ The sharing model under active consideration is an npm-dependency model: Kit B declares a peer dependency on Kit A and invokes Kit A's skills as a consumer, without absorbing them into Kit B's skill list.
81
+
82
+ **This alternative is not adopted now.** The cross-kit sharing question is deferred. Until it is resolved:
83
+
84
+ - Each skill belongs to exactly one kit.
85
+ - When a skill is consumed across kits, the consumer kit calls the skill by reference; it does not duplicate or re-own it.
86
+ - The audit table in the companion document (`0007-skill-audit.md`) reflects the intended single-kit ownership for each skill.
87
+
88
+ ---
89
+
90
+ ## Consequences
91
+
92
+ ### Immediate Structural Clarity
93
+
94
+ - The `skills/` directory contains a mix of Kit-skills, tools, and orphans. The audit table in `docs/adr/0007-skill-audit.md` maps each skill to one of those three classifications.
95
+ - Skills that are tools (`agentic-engineering`, `browser-test`, `dependency-update`, `eval-rebuild`, `github-cli`, `search-first`) should eventually migrate to agent system prompts, harness context, or be removed from `skills/` entirely. No move is made in this ADR.
96
+ - Orphans (`context-budget`, `explore`, `feedback-loop`, `frontend-design`) each implied either a missing flow or a reclassification. All four were ruled on 2026-06-15 (see "Orphan Rulings — 2026-06-15" below); all are REMOVED, with preserved intents recorded.
97
+
98
+ ### Builder Kit Fix (Issue #62) Becomes Mechanical
99
+
100
+ With this model, the Builder Kit fix discussed in issue #62 is straightforward: every skill in `skills/` that maps to `builder.build` or `builder.shape` steps belongs in the Builder Kit. The audit table provides the exact step-to-skill mapping. The fix is to move those skills into `kits/builder/` — but that move is explicitly out of scope for this ADR. This ADR provides the analysis that makes the move mechanical.
101
+
102
+ ### Tools Are Flow-Agnostic
103
+
104
+ Runtime-provided tools (`gh`, Playwright, bash, file read/write, package registries) are not skills. They do not belong to flows. The agent wields them as hands while executing flow steps. Packaging them as skills creates false parallelism with Kit-skills and inflates the skill list.
105
+
106
+ ### Orphan Triage Protocol
107
+
108
+ For each orphan, one of these outcomes is required:
109
+
110
+ 1. **Define the missing flow.** If the orphan describes a coherent procedural method that deserves a kit, define the flow, create the kit, and move the skill.
111
+ 2. **Reclassify as a tool.** If the orphan is really a description of how to use a raw capability, remove it from `skills/` and fold its content into agent context or harness docs.
112
+ 3. **Accept scope drift.** If the orphan does not belong in this repo's skill layer, remove it.
113
+
114
+ No orphan should remain permanently in `skills/` without a documented triage outcome.
115
+
116
+ ### Orphan Rulings — 2026-06-15
117
+
118
+ Brian ruled on all four orphans on 2026-06-15. All four are **REMOVED** for now; preserved intents are recorded below so the rationale is not lost.
119
+
120
+ | Orphan Skill | Ruling | Preserved Intent |
121
+ | --- | --- | --- |
122
+ | `explore` | **REMOVED** — reclassified as a tool: parallel codebase-reading capability. | The original aim was multi-angle codebase capture (dependencies, security, runnability/testability, business logic, patterns). This preserved intent is the seed of a possible future `codebase-onboarding` flow if that capability is ever wanted as a first-class kit flow. |
123
+ | `feedback-loop` | **REMOVED** — subsumed. Its "did the change work locally" concern is now handled by `verify-work` plus the flow route-back capability. | No separate preserved intent; the concern is covered. |
124
+ | `context-budget` | **REMOVED** — agent self-maintenance; relates conceptually to `learning-review`. Not a flow-step skill. | Conceptually adjacent to `learning-review`; could inform a future self-maintenance flow, but is not a flow-step skill under the current model. |
125
+ | `frontend-design` | **REMOVED** for now. | "Plan-work but for UI" — the seed of a possible future UI/Frontend Kit with design + visual-verify steps. Revisit if a UI kit is ever built. |
126
+
127
+ These rulings do not change this ADR's status. The ADR remains **Proposed** pending Brian's separate confirmation of the whole document.
128
+
129
+ ### Knowledge Kit Boundary
130
+
131
+ `knowledge-capture` is the one skill in `skills/` that belongs to the Knowledge Kit rather than the Builder Kit. Its canonical flow is `knowledge.ingest:capture`. Its presence in the top-level `skills/` directory (rather than in `kits/knowledge/`) is itself a consequence of the pre-ADR undifferentiated structure. Future kit authoring should place kit skills inside their kit directory.
132
+
133
+ ### Audit Table as Evidence
134
+
135
+ The companion document `docs/adr/0007-skill-audit.md` is the authoritative mapping of every skill in `skills/` to this model. It provides the evidence base for Builder Kit issue #62 and any future kit migrations.
136
+
137
+ ---
138
+
139
+ ## Alternatives Considered
140
+
141
+ ### Keep the "General Capability Skill Tier" as a Peer Category
142
+
143
+ Rejected. The general capability tier was never designed — it accreted. Treating it as a first-class category alongside Kit-skills would institutionalize an accident. The model is simpler with exactly one kind of skill.
144
+
145
+ ### Allow Skills to Be Defined Without Flow Binding
146
+
147
+ Rejected. The whole value of the model is that a skill's purpose, ownership, and location are derivable from its flow step. A skill with no flow binding is undefined in the model — it either needs a flow or needs to be reclassified.
148
+
149
+ ### Cross-Kit Skill Sharing via npm Dependency (DEFERRED)
150
+
151
+ Not rejected but not adopted now. The npm-dependency model for cross-kit sharing is the most likely future path if skills need to be consumed across kits. It is deferred until a concrete cross-kit case requires it. See "Cross-Kit Skill Sharing: DEFERRED" above.
152
+
153
+ ### Move All Tool-like Skills to Agent System Prompts Immediately
154
+
155
+ Deferred. The tool-like skills in `skills/` have runtime users. Moving them without updating agent specs and evals would break existing behavior. This ADR records the intended direction; the migrations should be sequenced through backlog issues.
156
+
157
+ ---
158
+
159
+ ## References
160
+
161
+ - [ADR 0001: Flow Agents Consumes Flow For Workflow Enforcement](./0001-flow-agents-consumes-flow.md) — establishes that Flow owns Flow Definitions and Flow Agents consumes them.
162
+ - [ADR 0002: Flow Kits as Extension Unit](./0002-flow-kits-as-extension-unit.md) — establishes the kit as the packaging unit.
163
+ - [ADR 0003: Flow Agents Coordinates Kits and Adapters](./0003-flow-agents-coordinates-kits-and-adapters.md) — establishes how Flow Agents relates to kits.
164
+ - [docs/adr/0007-skill-audit.md](./0007-skill-audit.md) — companion skill audit table.
165
+ - `kits/builder/flows/build.flow.json` — Builder Kit build flow step IDs.
166
+ - `kits/builder/flows/shape.flow.json` — Builder Kit shape flow step IDs.
167
+ - `kits/knowledge/flows/ingest.flow.json` — Knowledge Kit ingest flow step IDs.
168
+ - GitHub issue #62 — Builder Kit skill placement fix (becomes mechanical given this model).
169
+ - GitHub issues #52 and #60 — agentless gate-eval work proving Flow Definitions are agentless-capable.
@@ -0,0 +1,112 @@
1
+ ---
2
+ title: "Skill Audit 2026-06-15: Flow / Skill / Kit / Tool Boundary"
3
+ ---
4
+
5
+ # Skill Audit: Flow / Skill / Kit / Tool Boundary
6
+
7
+ **Date:** 2026-06-15
8
+ **Companion to:** [ADR 0007](./0007-flow-skill-kit-tool-boundary.md)
9
+ **Scope:** All 26 skills in `skills/` — no skills declared inside kit directories were found separate from those already listed here.
10
+
11
+ ---
12
+
13
+ ## Classification Key
14
+
15
+ | Label | Meaning |
16
+ | --- | --- |
17
+ | **KIT-SKILL** | The agent's procedural method for one step of a kit-owned flow. Belongs in the kit that owns that flow. |
18
+ | **TOOL** | A raw capability the agent wields. Not tied to any flow step. Should be provided by the runtime or harness, not packaged as a "skill." |
19
+ | **ORPHAN** | Procedural but no flow step can be cited as the home. Either implies a missing/implicit flow, or signals scope drift. |
20
+
21
+ Flow step IDs used below are from:
22
+
23
+ - `kits/builder/flows/build.flow.json` — steps: `pull-work`, `design-probe`, `plan`, `execute`, `verify`, `merge-ready`, `pr-open`, `merge-ready-ci`, `learn`, `done`
24
+ - `kits/builder/flows/shape.flow.json` — steps: `shape`, `breakdown`, `file-issues`, `shape-done`
25
+ - `kits/knowledge/flows/ingest.flow.json` — steps: `capture`, `classify`, `route`
26
+ - `kits/knowledge/flows/compile.flow.json` — steps: `select-raws`, `compile`, `link`
27
+ - `kits/knowledge/flows/synthesize.flow.json` — steps: `detect-cluster`, `propose`, `evidence-gate`, `apply-or-reject`
28
+ - `kits/knowledge/flows/consolidate.flow.json` — steps: `related-event`, `propose`, `evidence-gate`, `apply-or-reject`
29
+ - `kits/knowledge/flows/retire.flow.json` — steps: `identify`, `propose-retirement`, `evidence-gate`, `apply-or-reject`
30
+ - `kits/knowledge/flows/store-contract.flow.json` — steps: `verify-contract`
31
+
32
+ ---
33
+
34
+ ## Full Audit Table
35
+
36
+ | Skill | What It Does | Classification | Kit + Flow Step (if KIT-SKILL) / Rationale (if TOOL or ORPHAN) |
37
+ | --- | --- | --- | --- |
38
+ | `agentic-engineering` | Principles for eval-first loops, task decomposition (15-minute units), model routing (Haiku/Sonnet/Opus), and session strategy. | TOOL | Documents how to use the agent's cognitive capabilities and model-selection judgment. It is guidance the agent *applies* while using tools, not a method for a specific flow step. It is not tied to any flow or kit. |
39
+ | `browser-test` | Delegates browser automation tasks — screenshots, accessibility checks, form filling, UI testing, DOM inspection — to `tool-playwright`. | TOOL | Wraps raw access to a browser automation capability (`tool-playwright`). No flow step backs it; it is a harness/runtime capability the agent directs. Equivalent to "how to run Playwright." |
40
+ | `builder-shape` | User-facing entry into the Builder Kit shape flow — invokes `idea-to-backlog` as a primitive and links `kits/builder/flows/shape.flow.json`; stops at the backlog gate unless issue sync is requested. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.shape`. **Step:** `shape` (and through it, `breakdown` and `file-issues` via `idea-to-backlog` delegation). `builder-shape` is the agent's procedural method for satisfying the `builder.shape` flow's entry step. |
41
+ | `context-budget` | Audits token overhead across installed Flow Agents bundles; scans components and produces a budget report with per-component breakdown and optimization suggestions. | ORPHAN | Procedural and agent-driven, but there is no flow in any kit that has a step for "audit the agent's own context budget." **Implies missing flow:** an implicit "context-health" or "self-maintenance" flow. Until that flow exists and is owned by a kit, this skill is unanchored. |
42
+ | `deliver` | Orchestrates the full plan → execute → review → verify loop, including preflight (pull-work, pickup-probe), looping on failures, and delivery confirmation. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Steps:** orchestrates across `pull-work`, `design-probe`, `plan`, `execute`, `verify`, `merge-ready` in sequence. `deliver` is the agent's top-level orchestration method for the builder build flow. It subsumes multiple build-flow steps and is the primary orchestrator skill for that flow. |
43
+ | `dependency-update` | Analyzes and upgrades project dependencies — delegates registry/advisory lookups to `tool-dependencies-updater`, then presents a plan and applies approved updates. | TOOL | Orchestrating a dependency scanner subagent (`tool-dependencies-updater`) is a raw capability use. There is no kit-owned flow with a "dependency-update" step. |
44
+ | `design-probe` | Generic one-question-at-a-time alignment interview — turns unclear goals, designs, or workflow states into shared understanding before planning or execution. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `design-probe`. The skill's own SKILL.md names the Builder Kit `design-probe` step explicitly. It also applies outside Builder Kit, but the canonical flow binding is `builder.build:design-probe`. |
45
+ | `eval-rebuild` | Defines project-specific rebuild/reinstall steps for the eval feedback loop so the `eval-builder` agent knows how to rebuild after editing a prompt or skill. | TOOL | This is harness/tooling guidance for how to run evals — a raw capability instruction with no flow step home. It is not a method for any kit-owned step; it is instructions about how the agent's own evaluation tooling works. |
46
+ | `evidence-gate` | Evaluates whether completed work has enough trustworthy evidence, scope integrity, and provider/runtime signal to publish, continue fixing, or request a human decision. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `verify` (the gate evaluation that determines whether the verify step's evidence satisfies the gate claim `builder.verify.tests`). Also maps to `merge-ready` evidence checks. The skill explicitly separates from release-readiness and handles the `verify`-step gate logic. |
47
+ | `execute-plan` | Parallel execution primitive — reads a plan artifact, fans out to `tool-worker` subagents in waves, and updates the session artifact between waves. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `execute`. The skill is the agent's procedural method for the `execute` step of the builder build flow. |
48
+ | `explore` | Fans out parallel subagents to map codebase structure, entry points, dependencies, architectural patterns, config, tests, and documentation accuracy in one pass. | ORPHAN | Procedural and multi-wave but there is no kit-owned flow step for "explore a codebase." It is used as a support skill during discovery/shaping and debugging but is not anchored to a specific flow step. **Implies missing flow:** a "codebase-onboarding" or "repository-exploration" flow with an `explore` step, or it belongs as a tool-like capability rather than a flow step skill. |
49
+ | `feedback-loop` | Verifies that completed implementation actually works by classifying the change (visual vs. integration) and delegating to the appropriate verification method (Playwright or direct command execution). | ORPHAN | There is no kit-owned flow step called "feedback-loop." It overlaps with the `verify` step of the builder build flow, but its scope is narrower (per-implementation-task confirmation) and it is used as a support skill during `execute-plan`, not as the canonical agent method for the `verify` step. **Implies missing flow:** or this is a tool-like capability (a "quick verify" affordance) that could be subsumed into `verify-work`. |
50
+ | `fix-bug` | Bug-fix orchestrator — adds a diagnosis phase (reproduce + root-cause via `tool-planner`), then chains plan → execute → review → verify identical to `deliver`. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Steps:** `design-probe` (root-cause/diagnosis maps to alignment before planning), `plan`, `execute`, `verify`. `fix-bug` is an alternative entry into the builder build flow for defect work; it adds a diagnosis front-end and otherwise implements the same flow steps as `deliver`. |
51
+ | `frontend-design` | Delegates frontend implementation to `tool-worker` with curated design guidelines (typography, color, motion, spatial composition, anti-patterns); requires Playwright visual verification after implementation. | ORPHAN | There is no kit-owned flow with a "frontend-design" step. This skill injects design taste into the `execute` step of the builder build flow but is not the canonical method for that step — it is used as a support layer inside `execute-plan`/`deliver`. **Implies missing flow:** a "frontend" or "UI-design" flow with dedicated design and verify steps, or this is more accurately a library of guidelines that the `execute` step (via `execute-plan`) consumes. |
52
+ | `github-cli` | Uses the `gh` CLI to interact with GitHub — PRs, issues, repos, releases, Actions, gists, search, and arbitrary API calls. | TOOL | `gh` is a raw capability — a command-line tool the agent wields. The skill is a how-to for operating that tool, not a method for a kit-owned flow step. Used as support across many flow steps without being bound to one. |
53
+ | `idea-to-backlog` | Turns raw product or technical ideas into shaped, prioritized, executable GitHub issue backlog through intake, separation, opportunity review, shaping, prioritization, and issue creation. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.shape`. **Steps:** `shape` (idea intake → shaped problem/outcome/constraints/non-goals/success/risk), `breakdown` (slices and thinnest meaningful slices), `file-issues` (creating GitHub issues with provider-neutral metadata). `idea-to-backlog` is the primary agent method that implements all three active steps of `builder.shape`. |
54
+ | `knowledge-capture` | Saves durable knowledge, pointers, decisions, lessons, corrections, and source references into the knowledge base using pointer or curated-knowledge modes. | KIT-SKILL | **Kit:** knowledge. **Flow:** `knowledge.ingest`. **Step:** `capture` (the first step of `knowledge.ingest`: capture raw text → produce a raw record). This skill is the agent's method for the `capture` step of the knowledge ingest flow. |
55
+ | `learning-review` | Captures post-merge/post-deploy/post-incident learnings and routes them back to backlog, workflow skills, tests, docs, or knowledge; includes correction telemetry and a verdict. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `learn`. The skill is the agent's method for the `learn` step of the builder build flow: turn delivery outcomes into durable learning and follow-up routing. |
56
+ | `pickup-probe` | Builder Kit specialization of the `design-probe` flow step — records scope, provider state, WIP/conflict scan, revision freshness, decisions, unresolved questions, accepted gaps, and planning readiness for selected backlog work. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `design-probe` (the `pickup-probe` skill is explicitly described in its SKILL.md as "the Builder Kit pickup specialization of the `design-probe` flow step"). It implements the `design-probe` step for the productized pickup path. |
57
+ | `plan-work` | Planning primitive — delegates codebase analysis and execution plan creation to `tool-planner`; produces a plan artifact, `acceptance.json`, and `handoff.json`. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `plan`. The skill is the agent's method for the `plan` step of the builder build flow. |
58
+ | `pull-work` | Selects ready GitHub issues from the backlog, enforces WIP limits, checks dependencies, determines worktree isolation, and hands selected work to planning. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `pull-work`. The skill is the agent's method for the `pull-work` step of the builder build flow. |
59
+ | `release-readiness` | Decides whether evidence-backed work is ready to merge, release, deploy, or hold — checks committed/pushed state, provider change record, CI/checks, rollback plan, observability, and docs; produces a structured release decision. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Steps:** `merge-ready` and `merge-ready-ci`. The skill implements the agent-facing logic for both merge readiness gates: it consumes evidence-gate output, checks operational and CI state, and produces a merge/release/deploy/hold decision. |
60
+ | `review-work` | Report-only critique primitive — delegates to `tool-code-reviewer`, `tool-security-reviewer`, and optionally `tool-dependencies-updater`; records findings through the `critique.json` artifact/sink. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `verify` (review is part of the verify gate's quality checks) or more precisely as an intermediate step between `execute` and the formal `verify` gate. The SKILL.md describes it as a gate that must be satisfied before verification. Mapped to: between `execute` and `verify` in `builder.build`. |
61
+ | `search-first` | Research-before-coding workflow — searches the codebase, package registries, GitHub, and web in parallel; evaluates candidates; and decides to adopt, extend, or build before writing code. | TOOL | This is a research/lookup methodology, not the agent's method for a specific flow step. It is used as a support behavior across multiple steps (shaping, planning, execution) without being anchored to one. It could be seen as a harness capability (web + registry search). |
62
+ | `tdd-workflow` | TDD orchestrator — wraps plan → execute → review → verify with test-first constraints, git checkpoints (RED/GREEN/REFACTOR), and a coverage gate (>= 80%). | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Steps:** `plan`, `execute`, `verify`. `tdd-workflow` is an alternative parameterization of the builder build flow that enforces test-first discipline across those three steps. |
63
+ | `verify-work` | Verification primitive — delegates to `tool-verifier` and `tool-playwright`; maps evidence to acceptance criteria; updates `evidence.json` and `acceptance.json`. | KIT-SKILL | **Kit:** builder. **Flow:** `builder.build`. **Step:** `verify`. The skill is the canonical agent method for the `verify` step. |
64
+
65
+ ---
66
+
67
+ ## Summary Counts
68
+
69
+ | Category | Count | Notes |
70
+ | --- | --- | --- |
71
+ | **KIT-SKILL (builder kit)** | 17 | `builder-shape`, `deliver`, `design-probe`, `evidence-gate`, `execute-plan`, `fix-bug`, `idea-to-backlog`, `learning-review`, `pickup-probe`, `plan-work`, `pull-work`, `release-readiness`, `review-work`, `tdd-workflow`, `verify-work`, `knowledge-capture` (builder-side consumer), `fix-bug` (builder alt-entry) |
72
+ | **KIT-SKILL (knowledge kit)** | 1 | `knowledge-capture` implements `knowledge.ingest:capture` |
73
+ | **TOOL** | 6 | `agentic-engineering`, `browser-test`, `dependency-update`, `eval-rebuild`, `github-cli`, `search-first` |
74
+ | **ORPHAN** | 4 | `context-budget`, `explore`, `feedback-loop`, `frontend-design` |
75
+
76
+ Note: `knowledge-capture` appears in both the builder-kit count above and the knowledge-kit count. The canonical home is the Knowledge Kit (`knowledge.ingest:capture`); its use inside builder flows is as a support dependency.
77
+
78
+ Corrected final count:
79
+
80
+ - **KIT-SKILL:** 17 total — 16 belonging to the builder kit (across `builder.build` and `builder.shape` flows), 1 belonging to the knowledge kit (`knowledge.ingest:capture`)
81
+ - **TOOL:** 6
82
+ - **ORPHAN:** 4
83
+
84
+ ---
85
+
86
+ ## Orphans With "Implies Missing Flow" Detail
87
+
88
+ | Orphan Skill | Implication | Disposition |
89
+ | --- | --- | --- |
90
+ | `context-budget` | Implies missing flow: a "context-health" or "agent-self-audit" flow. No kit currently owns context-budget management as a named flow. This could eventually become a `builder.context-audit` or standalone kit flow. Alternatively, if the repo decides context budgeting is always a harness concern, this should be reclassified as a TOOL and the skill dissolved or folded into harness documentation. | **REMOVED** (2026-06-15). Agent self-maintenance; not a flow-step skill. Conceptually adjacent to `learning-review`; preserved intent noted in ADR 0007. |
91
+ | `explore` | Implies missing flow: a "codebase-onboarding" or "repository-exploration" flow with discrete steps (structure, entry points, dependencies, patterns, docs accuracy). Alternatively, `explore` is a multi-step capability the agent uses across many flow phases — in which case it is more accurately a TOOL (raw codebase-reading capability orchestrated across subagents) than a flow-step skill. | **REMOVED** (2026-06-15). Reclassified as a tool (parallel codebase-reading capability). Preserved intent: seed of a possible future `codebase-onboarding` flow — see ADR 0007. |
92
+ | `feedback-loop` | Implies missing flow: or more precisely, it overlaps with the `verify` step of `builder.build` without being the canonical method for it. The skill is used as a lightweight per-task verification inside `execute-plan`. If the builder build flow added a sub-step or explicit "local-verify" step between `execute` and the formal `verify` gate, `feedback-loop` would map there. Otherwise, it should be subsumed into `verify-work` or reclassified as support tooling. | **REMOVED** (2026-06-15). Subsumed: concern now handled by `verify-work` plus flow route-back. |
93
+ | `frontend-design` | Implies missing flow: a "frontend" or "UI-kit" flow with steps for design direction, implementation, and visual verification. Alternatively, the design guidelines could be packaged as a context resource injected into `execute-plan`/`tool-worker` rather than as a separate "skill." If it stays a skill, it belongs in a hypothetical UI Kit that owns a `frontend.build` flow with design and verify steps. | **REMOVED** (2026-06-15). Preserved intent: "plan-work but for UI" — seed of a possible future UI/Frontend Kit with design + visual-verify steps. Revisit if a UI kit is built. |
94
+
95
+ ---
96
+
97
+ ## Implementation Record (Issue #62, 2026-06-15)
98
+
99
+ The dispositions in this audit table were implemented in PR #62:
100
+
101
+ - **16 KIT-SKILLS moved to Builder Kit:** `builder-shape`, `deliver`, `design-probe`, `evidence-gate`, `execute-plan`, `fix-bug`, `idea-to-backlog`, `learning-review`, `pickup-probe`, `plan-work`, `pull-work`, `release-readiness`, `review-work`, `tdd-workflow`, `verify-work` — moved from `skills/<name>/` to `kits/builder/skills/<name>/` and declared in `kits/builder/kit.json` `skills` array.
102
+ - **1 KIT-SKILL moved to Knowledge Kit:** `knowledge-capture` — moved to `kits/knowledge/skills/knowledge-capture/` and declared in `kits/knowledge/kit.json` `skills` array.
103
+ - **4 ORPHANS deleted:** `context-budget`, `explore`, `feedback-loop`, `frontend-design` — removed per Brian's 2026-06-15 ruling above.
104
+ - **6 TOOLs left in place:** `agentic-engineering`, `browser-test`, `dependency-update`, `eval-rebuild`, `github-cli`, `search-first` — remain in `skills/` pending separate reclassification. See `skills/README.md`.
105
+
106
+ **Structural changes:**
107
+ - `src/tools/build-universal-bundles.ts`: `collectAllSkills()` function added; bundle builders now collect skills from both `skills/` (tool-skills) and kit-declared `skills` arrays. Runtime bundles (`.claude/skills/`, `.codex/skills/`, etc.) include all kit-owned skills unchanged.
108
+ - `src/tools/generate-context-map.ts`: `allSkillPaths()` function added; context map generation now includes kit-owned skills.
109
+ - `src/tools/validate-source-tree.ts`: `validateLegacyRefs()` updated to skip legacy-ref matches that resolve as declared kit-owned asset subpaths.
110
+ - `packaging/packs.json`: Skill entries limited to the 6 remaining tool-skills in `skills/`. Kit-owned skills are no longer listed in packs (they're always included in the bundle as kit assets).
111
+ - `flow-agents kit inspect kits/builder` now reports `k1: true` (skills present).
112
+ - `flow-agents kit inspect kits/knowledge` now reports `k1: true` (skills present).
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: "ADR 0008: Kit Operation Boundary"
3
+ ---
4
+
5
+ # ADR 0008: Kit Operation Boundary
6
+
7
+ **Date:** 2026-06-15
8
+ **Status:** Accepted
9
+
10
+ ---
11
+
12
+ ## Context
13
+
14
+ A kit is the SEAM where Flow and Flow Agents meet: Flow owns the container (manifest + flows), Flow Agents owns the extension (skills, adapters, docs, activation), and a kit fuses both into one package. So "which layer owns an operation on a kit?" is ill-posed whenever the operation touches both halves.
15
+
16
+ Of the kit operations: `validate` touches only the container (cleanly Flow); `activate` touches only a specific agent runtime — codex-local/strands-local (cleanly Flow Agents); `install` and `inspect` STRADDLE the seam.
17
+
18
+ A concrete duplication was found motivating this: flow-agents reimplements Flow's container contract — `src/flow-kit/validate.ts` has its own `validateCoreContainer` (schema_version/id/name/flows), while Flow exposes the authoritative `validateKitContainer` from its `src/index.ts`, and flow-agents does not even depend on `@kontourai/flow`. The two contracts can silently drift.
19
+
20
+ This ADR records the design decision reached with Brian Anderson on 2026-06-15.
21
+
22
+ ---
23
+
24
+ ## Decision
25
+
26
+ ### The Dividing Test
27
+
28
+ Does the operation need to INTERPRET the agent extension (what a skill or adapter MEANS), or only the container (manifest + flows + the *names* of declared asset classes)? Container-only → Flow. Extension-interpreting → Flow Agents.
29
+
30
+ ### Flow Owns the Agent-Blind Kit Operations
31
+
32
+ `flow kit validate`, `flow kit install` (fetch + validate + place a kit package), `flow kit inspect` (container validity + flows + declared asset-class NAMES — the K0/structural view). Flow knows NOTHING about what a skill or adapter means.
33
+
34
+ ### Flow Agents Owns the Extension Operations
35
+
36
+ `flow-agents kit activate` (wire the extension into a runtime), plus the extension-interpreting augmentation of install (place skill/adapter assets) and inspect (interpret asset classes → K1/K2 + runtime targets). Flow Agents COMPOSES on Flow's primitives; it never reimplements them.
37
+
38
+ ### The Agent-Blind Guardrail
39
+
40
+ Flow's kit operations must NEVER interpret extension semantics — fetch, validate, place, report-structure, full stop. Holding this line keeps Flow's operations genuinely generic even though flow-agents is currently the only consumer; the line between the layers is precisely "does it interpret the extension?"
41
+
42
+ ### DRY via Delegation
43
+
44
+ flow-agents depends on `@kontourai/flow`, deletes `validateCoreContainer`, and delegates all container work to Flow's primitives. The container contract lives ONCE, in Flow.
45
+
46
+ ### Flow Agents Is the Reference Consumer
47
+
48
+ Flow Agents is the worked example for any future producer building on Flow — lean on Flow's agent-blind primitives, add your own extension layer in your own CLI.
49
+
50
+ ---
51
+
52
+ ## Consequences
53
+
54
+ ### CLI Surface
55
+
56
+ `flow kit <validate|install|inspect>` (container, agent-blind) and `flow-agents kit <install|inspect|activate>` (extension-composing). The standalone `flow-kit` binary and the flat `flow validate-kit` verb are deprecated with aliases.
57
+
58
+ ### Position C Adopted
59
+
60
+ This adopts position C (generic kit operations live in Flow) over position B (whole-kit lifecycle stays in flow-agents). C was chosen because doing it twice (B now, migrate later) is wasteful, and the agent-blind guardrail removes the premature-abstraction risk that motivated B.
61
+
62
+ ### Breaking CLI Change
63
+
64
+ Breaking CLI change on published 1.x in BOTH repos → deprecation aliases + a coordinated release.
65
+
66
+ ### Separate-Product-Ready
67
+
68
+ Because the primitives live in Flow with flow-agents as a consumer, Flow Kits could later be productized (container + primitives + marketplace) without re-architecture.
69
+
70
+ ---
71
+
72
+ ## Alternatives Considered
73
+
74
+ ### Position B (kit lifecycle entirely in flow-agents, defer generic Flow ops)
75
+
76
+ Rejected. Defensible short-term (flow-agents is the only layer that comprehends a whole kit today) but causes a double-migration; the agent-blind guardrail makes C's genericity real now, removing B's main justification.
77
+
78
+ ### Position A (container ops = Flow, runtime ops = flow-agents, by category)
79
+
80
+ Rejected earlier in the discussion — kits are not pure containers, so a category split mislocates install/inspect.
81
+
82
+ ---
83
+
84
+ ## References
85
+
86
+ - [ADR 0007: Flow / Skill / Kit / Tool Boundary](./0007-flow-skill-kit-tool-boundary.md) — the skill/tool boundary; same conversation.
87
+ - GitHub #62 (Builder Kit skill placement), #50 / #79 (marketplace / trust layer), #52 / #60 (agentless gate-eval proving Flow Definitions are agentless-capable).
88
+ - kontourai/flow container spec (flow PR #67) — establishes Flow owns the container contract + `validateKitContainer`.