@evo-dev/evodev 0.0.1-alpha → 0.0.1-alpha.2

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 (38) hide show
  1. package/dist/.agents/skills/grilling/SKILL.md +10 -0
  2. package/dist/.claude-plugin/marketplace.json +2 -2
  3. package/dist/assets/agents/review/code-reviewer/examples.md +1 -1
  4. package/dist/assets/agents/review/code-reviewer/prompt.md +1 -1
  5. package/dist/assets/agents/review/code-reviewer/verification.md +1 -1
  6. package/dist/assets/skills/coding/knowledge-distillation/SKILL.md +249 -0
  7. package/dist/assets/skills/coding/knowledge-distillation/manifest.json +10 -0
  8. package/dist/assets/skills/coding/knowledge-distillation/references/knowledge-distillation-methods.md +126 -0
  9. package/dist/assets/workflows/rd-bug-fix/WORKFLOW.json +1 -1
  10. package/dist/assets/workflows/rd-code-review/WORKFLOW.json +1 -1
  11. package/dist/assets/workflows/rd-docs-update/WORKFLOW.json +1 -1
  12. package/dist/assets/workflows/rd-feature-implementation/WORKFLOW.json +1 -1
  13. package/dist/assets/workflows/rd-refactor/WORKFLOW.json +1 -1
  14. package/dist/assets/workflows/rd-release-readiness/WORKFLOW.json +1 -1
  15. package/dist/assets/workflows/rd-security-boundary-review/WORKFLOW.json +2 -2
  16. package/dist/assets/workflows/rd-test-generation/WORKFLOW.json +1 -1
  17. package/dist/index.js +18925 -6426
  18. package/dist/plugins/evodev/.claude-plugin/plugin.json +2 -2
  19. package/dist/plugins/evodev/.codex-plugin/plugin.json +8 -6
  20. package/dist/plugins/evodev/.mcp.json +6 -0
  21. package/dist/plugins/evodev/hooks/codex-hooks.json +10 -10
  22. package/dist/plugins/evodev/hooks/codex.ts +596 -34
  23. package/dist/plugins/evodev/hooks/hooks.json +18 -18
  24. package/dist/plugins/evodev/hooks/hooks.ts +417 -25
  25. package/dist/plugins/evodev/hooks/index.ts +15 -0
  26. package/dist/plugins/evodev/hooks/paths.ts +44 -1
  27. package/dist/plugins/evodev/hooks/plugin.ts +160 -9
  28. package/dist/plugins/evodev/hooks/runtime.ts +227 -43
  29. package/dist/plugins/evodev/hooks/transform-agent.ts +30 -0
  30. package/dist/plugins/evodev/hooks/workspace-core.ts +154 -0
  31. package/dist/plugins/evodev/package.json +3 -3
  32. package/dist/plugins/evodev/skills/engineering-discipline/SKILL.md +63 -0
  33. package/dist/plugins/evodev/skills/engineering-discipline/anti-patterns.md +21 -0
  34. package/dist/plugins/evodev/skills/engineering-discipline/examples.md +19 -0
  35. package/dist/plugins/evodev/skills/engineering-discipline/verification.md +11 -0
  36. package/dist/plugins/evodev/skills/knowledge-distillation/SKILL.md +249 -0
  37. package/dist/plugins/evodev/skills/knowledge-distillation/references/knowledge-distillation-methods.md +126 -0
  38. package/package.json +3 -6
@@ -10,6 +10,16 @@ export interface ClaudeAgentTransformResult {
10
10
  content: string;
11
11
  }
12
12
 
13
+ export interface CodexAgentTransformInput {
14
+ asset: ScannedAsset<AgentManifest>;
15
+ source: string;
16
+ }
17
+
18
+ export interface CodexAgentTransformResult {
19
+ name: string;
20
+ content: string;
21
+ }
22
+
13
23
  export function transformClaudeAgent(input: ClaudeAgentTransformInput): ClaudeAgentTransformResult {
14
24
  const { manifest } = input.asset;
15
25
  const frontmatter = [
@@ -25,6 +35,26 @@ export function transformClaudeAgent(input: ClaudeAgentTransformInput): ClaudeAg
25
35
  };
26
36
  }
27
37
 
38
+ export function transformCodexAgent(input: CodexAgentTransformInput): CodexAgentTransformResult {
39
+ const { manifest } = input.asset;
40
+ const lines = [
41
+ `# Generated by EvoDev from ${input.asset.registryKey}`,
42
+ `name = ${tomlString(manifest.id)}`,
43
+ `description = ${tomlString(manifest.description)}`,
44
+ `developer_instructions = ${tomlString(input.source)}`,
45
+ "",
46
+ ];
47
+
48
+ return {
49
+ name: manifest.id,
50
+ content: lines.join("\n"),
51
+ };
52
+ }
53
+
28
54
  function escapeFrontmatterValue(value: string): string {
29
55
  return value.replaceAll("\n", " ");
30
56
  }
57
+
58
+ function tomlString(value: string): string {
59
+ return JSON.stringify(value);
60
+ }
@@ -0,0 +1,154 @@
1
+ import type { Dirent } from "node:fs";
2
+ import { cp, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
+
5
+ export interface WorkspaceCoreHydrationResult {
6
+ warnings: string[];
7
+ errors: string[];
8
+ }
9
+
10
+ export async function hydrateWorkspaceCoreDependency(input: {
11
+ sourceCoreRoot: string;
12
+ cachePluginRoot: string;
13
+ runtimeLabel: string;
14
+ }): Promise<WorkspaceCoreHydrationResult> {
15
+ const warnings: string[] = [];
16
+ const errors: string[] = [];
17
+
18
+ const installedPluginRoot = await findInstalledPluginRoot(input.cachePluginRoot);
19
+ if (installedPluginRoot === null) {
20
+ warnings.push(
21
+ `Skipped @evo-dev/core hydration because the ${input.runtimeLabel} plugin cache was not found: ${input.cachePluginRoot}`,
22
+ );
23
+ return { warnings, errors };
24
+ }
25
+
26
+ if (!(await isDirectory(input.sourceCoreRoot))) {
27
+ errors.push(
28
+ `Cannot hydrate @evo-dev/core for ${input.runtimeLabel} plugin runtime: marketplace core package not found at ${input.sourceCoreRoot}`,
29
+ );
30
+ return { warnings, errors };
31
+ }
32
+
33
+ try {
34
+ await writeRuntimeCorePackage({
35
+ sourceCoreRoot: input.sourceCoreRoot,
36
+ targetCoreRoot: `${installedPluginRoot}/node_modules/@evo-dev/core`,
37
+ });
38
+ } catch (error) {
39
+ errors.push(
40
+ `Cannot hydrate @evo-dev/core for ${input.runtimeLabel} plugin runtime: ${describeError(error)}`,
41
+ );
42
+ }
43
+
44
+ return { warnings, errors };
45
+ }
46
+
47
+ export function isSafePluginCacheSegment(segment: string): boolean {
48
+ return /^[A-Za-z0-9._-]+$/.test(segment) && segment !== "." && segment !== "..";
49
+ }
50
+
51
+ async function findInstalledPluginRoot(cachePluginRoot: string): Promise<string | null> {
52
+ let entries: Dirent[];
53
+ try {
54
+ entries = await readdir(cachePluginRoot, { withFileTypes: true });
55
+ } catch (error) {
56
+ if (isNotFoundError(error)) {
57
+ return null;
58
+ }
59
+ throw error;
60
+ }
61
+
62
+ const versionDirs = await Promise.all(
63
+ entries
64
+ .filter((entry) => entry.isDirectory())
65
+ .map(async (entry) => {
66
+ const path = `${cachePluginRoot}/${entry.name}`;
67
+ const pathStat = await stat(path);
68
+ return { path, mtimeMs: pathStat.mtimeMs };
69
+ }),
70
+ );
71
+ if (versionDirs.length === 0) {
72
+ return null;
73
+ }
74
+
75
+ versionDirs.sort(
76
+ (left, right) => right.mtimeMs - left.mtimeMs || right.path.localeCompare(left.path),
77
+ );
78
+ return versionDirs[0].path;
79
+ }
80
+
81
+ async function writeRuntimeCorePackage(input: {
82
+ sourceCoreRoot: string;
83
+ targetCoreRoot: string;
84
+ }): Promise<void> {
85
+ const sourcePackagePath = `${input.sourceCoreRoot}/package.json`;
86
+ if (!(await isFile(sourcePackagePath))) {
87
+ throw new Error(`source package.json not found at ${sourcePackagePath}`);
88
+ }
89
+ if (!(await isDirectory(`${input.sourceCoreRoot}/src`))) {
90
+ throw new Error(`source src directory not found at ${input.sourceCoreRoot}/src`);
91
+ }
92
+
93
+ await rm(input.targetCoreRoot, { recursive: true, force: true });
94
+ await mkdir(dirname(input.targetCoreRoot), { recursive: true });
95
+ await mkdir(input.targetCoreRoot, { recursive: true });
96
+ await cp(`${input.sourceCoreRoot}/src`, `${input.targetCoreRoot}/src`, {
97
+ recursive: true,
98
+ });
99
+ if (await isDirectory(`${input.sourceCoreRoot}/assets`)) {
100
+ await cp(`${input.sourceCoreRoot}/assets`, `${input.targetCoreRoot}/assets`, {
101
+ recursive: true,
102
+ });
103
+ }
104
+
105
+ const sourcePackageJson = JSON.parse(await readFile(sourcePackagePath, "utf8")) as Record<
106
+ string,
107
+ unknown
108
+ >;
109
+ const runtimePackageJson = {
110
+ ...sourcePackageJson,
111
+ files: ["src", "assets", "package.json"],
112
+ };
113
+ await writeFile(
114
+ `${input.targetCoreRoot}/package.json`,
115
+ `${JSON.stringify(runtimePackageJson, null, 2)}\n`,
116
+ "utf8",
117
+ );
118
+ }
119
+
120
+ async function isDirectory(path: string): Promise<boolean> {
121
+ try {
122
+ return (await stat(path)).isDirectory();
123
+ } catch (error) {
124
+ if (isNotFoundError(error)) {
125
+ return false;
126
+ }
127
+ throw error;
128
+ }
129
+ }
130
+
131
+ async function isFile(path: string): Promise<boolean> {
132
+ try {
133
+ return (await stat(path)).isFile();
134
+ } catch (error) {
135
+ if (isNotFoundError(error)) {
136
+ return false;
137
+ }
138
+ throw error;
139
+ }
140
+ }
141
+
142
+ function isNotFoundError(error: unknown): boolean {
143
+ return (
144
+ error instanceof Error && "code" in error && (error as NodeJS.ErrnoException).code === "ENOENT"
145
+ );
146
+ }
147
+
148
+ function describeError(error: unknown): string {
149
+ if (error instanceof Error) {
150
+ return error.message;
151
+ }
152
+
153
+ return String(error);
154
+ }
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@evo-dev/plugin",
3
- "version": "0.0.1-alpha",
3
+ "version": "0.0.1-alpha.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./hooks/index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "@evo-dev/core": "0.0.1-alpha"
9
+ "@evo-dev/core": "workspace:*"
10
10
  },
11
11
  "engines": {
12
12
  "bun": ">=1.1.0"
13
13
  },
14
- "files": ["hooks", ".claude-plugin", ".codex-plugin", "hooks", "package.json"],
14
+ "files": ["hooks", ".claude-plugin", ".codex-plugin", ".mcp.json", "skills", "package.json"],
15
15
  "license": "MIT"
16
16
  }
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: engineering-discipline
3
+ description: Use when implementing, reviewing, or refactoring code to clarify assumptions, avoid overengineering, keep diffs focused, protect scope boundaries, and verify results.
4
+ license: MIT
5
+ ---
6
+
7
+ # Engineering Discipline
8
+
9
+ ## Purpose
10
+
11
+ Engineering Discipline is a practical guardrail for AI-assisted development. It keeps each coding session anchored to the requested outcome, makes assumptions visible, and requires verification before reporting success.
12
+
13
+ ## Use this skill when
14
+
15
+ - Implementing a feature, bug fix, refactor, or test change.
16
+ - Reviewing code for correctness, safety, or maintainability.
17
+ - Working under explicit MVP, privacy, release, or project-boundary constraints.
18
+ - A task could expand into speculative architecture or unrelated cleanup.
19
+
20
+ ## Do not use this skill for
21
+
22
+ - Pure brainstorming where no code or plan will be produced.
23
+ - Tasks where the user explicitly asks for unconstrained exploration.
24
+ - Replacing product, security, or legal review when those are required.
25
+
26
+ ## Core principles
27
+
28
+ ### 1. Assumption management
29
+
30
+ State meaningful assumptions before acting. If an assumption changes the user-visible behavior, data boundary, or implementation scope, pause and ask instead of silently guessing.
31
+
32
+ ### 2. Simplicity control
33
+
34
+ Prefer the smallest design that satisfies the current acceptance criteria. Avoid framework additions, broad abstractions, and future-facing features unless they are required now.
35
+
36
+ ### 3. Diff discipline
37
+
38
+ Every modified file should have a clear reason tied to the task. Avoid drive-by formatting, unrelated refactors, and opportunistic rewrites.
39
+
40
+ ### 4. Verification loop
41
+
42
+ Attach each important change to a verification method: test, typecheck, lint, dry-run, manual command, or explicit reason it cannot be run. Do not claim a gate passed unless it was actually executed.
43
+
44
+ ### 5. Scope boundary
45
+
46
+ Respect project and privacy boundaries. Do not modify user project assets, user-level Code Agent configuration, secrets, logs, or learning data unless the task explicitly requires it and the relevant safeguards exist.
47
+
48
+ ## Operating steps
49
+
50
+ 1. Restate the goal and identify the current task, todo item, or acceptance criteria.
51
+ 2. Check the nearest source of truth: existing code, tests, implementation notes, or task instructions.
52
+ 3. List assumptions and ask when a choice is materially ambiguous.
53
+ 4. Make the smallest focused change that satisfies the goal.
54
+ 5. Verify with the most relevant local gate.
55
+ 6. Report what changed, what was tested, what failed or was skipped, and any remaining risk.
56
+
57
+ ## Output checklist
58
+
59
+ - Goal remains unchanged from the request.
60
+ - Modified files are directly related to the goal.
61
+ - New behavior has a validation path.
62
+ - User or project boundaries were not crossed.
63
+ - Final report distinguishes PASS, FAIL, and not-run checks.
@@ -0,0 +1,21 @@
1
+ # Engineering Discipline Anti-Patterns
2
+
3
+ ## Scope creep
4
+
5
+ Adding sync, plugin, workflow, or learning behavior while a task only asks for canonical assets.
6
+
7
+ ## Silent assumptions
8
+
9
+ Choosing a destructive write path, external dependency, or user-data behavior without explaining the assumption or asking for confirmation.
10
+
11
+ ## Diff pollution
12
+
13
+ Formatting unrelated files, renaming public APIs, or refactoring neighboring modules because they were nearby.
14
+
15
+ ## Verification theater
16
+
17
+ Reporting success without running the relevant gate, or hiding a failed check behind vague wording.
18
+
19
+ ## Boundary violations
20
+
21
+ Writing to project-level `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.codex/`, or user private data unless the user explicitly requested it and the current task permits it.
@@ -0,0 +1,19 @@
1
+ # Engineering Discipline Examples
2
+
3
+ ## Focused implementation
4
+
5
+ **Situation:** The task asks for a scanner-valid built-in asset.
6
+
7
+ **Disciplined response:** Add only the asset directory, manifest, entry file, and concise support files. Validate with the asset scanner or project check. Do not implement plugin sync or CLI behavior in the same task.
8
+
9
+ ## Assumption handling
10
+
11
+ **Situation:** Two output formats are possible and both affect users.
12
+
13
+ **Disciplined response:** Explain the options and ask for direction, or choose the option already specified by the current source of truth.
14
+
15
+ ## Verification report
16
+
17
+ **Good report:** `bun run check` was run and passed. Asset manifests scan with registry keys `coding/engineering-discipline` and `review/code-reviewer`.
18
+
19
+ **Bad report:** “Looks good” without saying what was run or whether any gate failed.
@@ -0,0 +1,11 @@
1
+ # Engineering Discipline Verification
2
+
3
+ Use this quick gate before reporting completion:
4
+
5
+ 1. **Scope:** Does every change map to the current request, todo item, or acceptance criteria?
6
+ 2. **Safety:** Did the work avoid project assets, secrets, private logs, and user configuration unless explicitly allowed?
7
+ 3. **Simplicity:** Is there any new abstraction, dependency, or feature not needed for the current goal?
8
+ 4. **Evidence:** Was the most relevant test, typecheck, lint, scanner, or dry-run executed?
9
+ 5. **Report:** Are failures and skipped checks stated plainly?
10
+
11
+ If any answer is no, fix the issue or report the remaining risk instead of claiming the gate passed.
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: knowledge-distillation
3
+ description: Use when turning reviewed execution evidence into atomic, privacy-filtered, role-tagged engineering knowledge candidates, evos cases, repo asset proposals, or role-agent/team suggestions.
4
+ license: MIT
5
+ ---
6
+
7
+ # Knowledge Distillation / 提炼
8
+
9
+ ## Purpose
10
+
11
+ Knowledge Distillation is an evidence curation pipeline. It turns reviewed execution evidence into an OKF-aware transient knowledge plan. The organizer, not this skill, writes final OKF Markdown files after dedupe, conflict handling, tagging, link updates, index generation, and logging.
12
+
13
+ It is not a trace summarizer, automatic memory writer, OKF file writer, or team launcher.
14
+
15
+ ## Use This Skill When
16
+
17
+ - A completed task produced a repeatable repository-specific lesson.
18
+ - A review, failure, postmortem, or user correction should become a rule, warning, checklist item, decision, pattern, or evos case.
19
+ - Execution evidence suggests a repo-local skill, rule, role agent, subagent, or EvoHub team.
20
+ - Reviewed execution evidence shows a task split, tool call, skill output, or subagent handoff was incomplete, inaccurate, inefficient, or unsafe.
21
+ - Role-specific knowledge should later be available to a role agent, subject to explicit consent and runtime scope.
22
+
23
+ ## Do Not Use This Skill For
24
+
25
+ - Writing `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.codex/`, `.evodev/`, source files, or project assets without explicit project opt-in.
26
+ - Storing raw prompts, transcripts, source dumps, raw command output, secrets, tokens, internal links, or private URLs.
27
+ - Treating unreviewed observations, model reflection, or trace logs as accepted memory.
28
+ - Writing final OKF concept documents directly; output a transient plan for the organizer.
29
+ - Starting subagents or teams automatically.
30
+
31
+ ## Inputs
32
+
33
+ Work from one bounded evidence window. Prefer reviewed, minimized inputs:
34
+
35
+ - Task goal, final outcome, and repository scope.
36
+ - Verification evidence, failures, fixes, and review findings.
37
+ - Accepted corrections or explicit user feedback.
38
+ - Relevant external authority, when the lesson depends on a standard, official documentation, or upstream behavior.
39
+ - Relevant OKF v0.1 constraints: concept documents need YAML frontmatter with non-empty `type`; `index.md` and `log.md` are reserved at every directory level; bundle-relative absolute Markdown links are preferred for durable relationships.
40
+ - Existing OKF index snippets or concept summaries, when available, so duplicate and conflict risk can be scored before proposing new candidates.
41
+ - Candidate roles that should care, such as `architect`, `implementer`, `reviewer`, `tester`, `security`, `release`, `docs`, or user-defined role slugs.
42
+
43
+ Do not ingest raw traces wholesale. If trace evidence is needed, use a redacted summary and evidence references.
44
+
45
+ ## Evidence Policy
46
+
47
+ Classify every input before extraction:
48
+
49
+ | Evidence class | Use | Constraint |
50
+ |---|---|---|
51
+ | `verified-run` | Test/build/lint/check outcomes and accepted fixes | Store references and summaries, not raw output |
52
+ | `reviewed-finding` | Code review, security review, or user correction | Keep finding, impact, and accepted action separate |
53
+ | `decision-record` | Architecture or workflow decision | Preserve context, decision, alternatives, consequences |
54
+ | `postmortem-case` | Failure, incident, or after-action review | Preserve expected vs actual, cause, action item |
55
+ | `official-reference` | Standards, docs, upstream behavior | Include URL/version/date; do not overquote |
56
+ | `model-reflection` | Agent-generated synthesis | Candidate only; never accepted without review |
57
+ | `tool-call-summary` | Tool selection, risk class, status, and recovery | No raw command or raw stdout/stderr by default |
58
+ | `skill-invocation` | Skill id/version, input class, output schema, and reviewed result | Record omissions or inaccuracies as findings; do not store raw prompts/source |
59
+ | `subagent-lifecycle` | Role, reason, scope, status, output refs, and merge result | No raw transcript |
60
+ | `evo-eval-result` | Eval case pass/fail and assertion summary | Store fixture refs and assertion results, not private raw data |
61
+
62
+ ## Distillation Pipeline
63
+
64
+ 1. **Scope**: identify repo, task, role audience, workflow audience, path scope, evidence ids, and user-local OKF target scope.
65
+ 2. **Minimize**: remove raw prompts, raw logs, source dumps, secrets, personal data, internal links, and one-off noise.
66
+ 3. **Analyze execution structure**: when event evidence is present, identify task slices, owner roles, dependencies, key tool calls, skill invocations, subagent lifecycle events, verification gates, and merge outcomes.
67
+ 4. **Extract atomic candidates**: one claim per candidate. Allowed `kind` values are `rule`, `decision`, `pattern`, `anti-pattern`, `warning`, `checklist`, `concept`, `workflow-improvement`, `task-split-improvement`, `tool-use-improvement`, `skill-improvement`, `repo-asset-suggestion`, `role-agent-suggestion`, `team-suggestion`, `eval-set`, and `open-question`.
68
+ 5. **Separate fact from inference**: mark whether the candidate is directly evidenced or inferred from evidence.
69
+ 6. **Classify**: add `okfType`, `targetPath`, `stableKey`, `roleTags`, `repoTags`, `workflowTags`, `pathScopes`, `domainTags`, `stability`, `sensitivity`, and `targetStore`.
70
+ 7. **Score**: estimate evidence strength, reuse value, actionability, stability, novelty, privacy risk, and duplication risk.
71
+ 8. **Pair improvements with evals**: every proposed skill, role-agent, team, workflow, routing, tool-use, or subagent behavior change should include an `evoEvalSets` entry, unless the plan explains why eval coverage is not applicable.
72
+ 9. **Privacy gate**: defer candidates that require raw private content to remain meaningful.
73
+ 10. **Route**: emit `no_write`, `create`, `update`, `skip`, or `needs-human` for each candidate.
74
+ 11. **Plan OKF organization**: provide canonical concept targets and repo/role/workflow overlay updates. Do not emit final OKF files.
75
+ 12. **Recovery notes**: explain conflicts, stale information, required repo fact checks, and why human intervention is needed when applicable.
76
+
77
+ ## Output Schema
78
+
79
+ Return executable JSON with `schemaVersion: 1` and `kind: "knowledge-distillation-output"`. The runtime parser converts this output into an OKF plan and validates the full contract before any OKF directory or concept write occurs. Invalid outputs become validation failed-plan artifacts; those artifacts are redacted, non-resumable, and inspectable with `evo plan show`.
80
+
81
+ ```json
82
+ {
83
+ "schemaVersion": 1,
84
+ "kind": "knowledge-distillation-output",
85
+ "projectKey": "evodev",
86
+ "runId": "run-123",
87
+ "createdAt": "2026-06-24T00:00:00.000Z",
88
+ "evidenceWindowId": "evidence-run-123",
89
+ "summary": "What reusable improvement was found.",
90
+ "evidenceRefs": [
91
+ {
92
+ "id": "source-1",
93
+ "kind": "verification",
94
+ "source": "state/evidence/metadata.json",
95
+ "rawContentStored": false,
96
+ "externalContentCopied": false
97
+ }
98
+ ],
99
+ "evoEvalSets": [
100
+ {
101
+ "id": "eval-role-routing-1",
102
+ "target": { "kind": "role-agent-suggestion", "id": "candidate-1" },
103
+ "purpose": "Guard a behavior-changing active write.",
104
+ "roleTags": ["reviewer"],
105
+ "cases": [
106
+ {
107
+ "id": "case-1",
108
+ "inputRefs": ["source-1"],
109
+ "assertions": ["Candidate remains metadata-only and review-state gated."],
110
+ "expectedReviewState": "auto-accepted"
111
+ }
112
+ ],
113
+ "privacy": {
114
+ "usesRawPrompt": false,
115
+ "usesSourceDump": false,
116
+ "usesRawCommandOutput": false
117
+ },
118
+ "decision": "create"
119
+ }
120
+ ],
121
+ "knowledgeCandidates": [
122
+ {
123
+ "id": "candidate-1",
124
+ "decision": "auto-accept",
125
+ "kind": "rule",
126
+ "okfType": "EvoDev Rule",
127
+ "targetStore": "okf",
128
+ "targetPath": "concepts/rules/workspace-check.md",
129
+ "stableKey": "rule:verification:workspace-check",
130
+ "confidence": "high",
131
+ "title": "Workspace check before completion",
132
+ "description": "Run the workspace check before reporting TypeScript CLI completion.",
133
+ "claim": "For TypeScript CLI changes, run the workspace check before reporting completion.",
134
+ "basis": "direct",
135
+ "metadataOnlyEvidence": true,
136
+ "howToApply": "Add bun run check to the verification plan.",
137
+ "antiCriteria": ["Do not mark completion from lint alone."],
138
+ "roleTags": ["implementer", "reviewer"],
139
+ "repoTags": ["evodev"],
140
+ "workflowTags": ["feature-implementation"],
141
+ "pathScopes": ["packages/cli/", "packages/core/"],
142
+ "relatedConceptLinks": ["/concepts/verification/workspace-quality-gate.md"],
143
+ "overlayUpdates": [
144
+ {
145
+ "targetPath": "roles/reviewer/verification.md",
146
+ "operation": "append-link",
147
+ "link": "/concepts/rules/workspace-check.md"
148
+ }
149
+ ],
150
+ "scores": {
151
+ "evidenceStrength": 5,
152
+ "reuseValue": 4,
153
+ "actionability": 4,
154
+ "stability": 4,
155
+ "privacyRisk": 1,
156
+ "duplicationRisk": 1
157
+ },
158
+ "decisionReason": "Auto-accepted from verified metadata-only evidence.",
159
+ "evidenceRefs": ["source-1"],
160
+ "reviewState": "auto-accepted",
161
+ "evalSetRefs": [],
162
+ "bodySections": {
163
+ "summary": "Run the workspace check before reporting completion.",
164
+ "appliesWhen": ["TypeScript CLI or core changes were made."],
165
+ "guidance": ["Run bun run check and report the result."],
166
+ "antiCriteria": ["Do not store raw command output."],
167
+ "verification": ["Workspace check passed with metadata-only evidence."],
168
+ "citations": []
169
+ },
170
+ "privacyCheck": {
171
+ "rawPromptsStored": false,
172
+ "rawLogsStored": false,
173
+ "sourceDumpsStored": false,
174
+ "rawCommandOutputStored": false,
175
+ "secretsStored": false,
176
+ "internalLinksStored": false
177
+ }
178
+ }
179
+ ],
180
+ "droppedSignals": [
181
+ {
182
+ "evidenceRef": "event-17",
183
+ "reason": "Routine tool-call metadata with no reusable lesson."
184
+ }
185
+ ],
186
+ "conflicts": [],
187
+ "privacyCheck": {
188
+ "rawPromptsStored": false,
189
+ "rawLogsStored": false,
190
+ "sourceDumpsStored": false,
191
+ "rawCommandOutputStored": false,
192
+ "secretsStored": false,
193
+ "internalLinksStored": false
194
+ }
195
+ }
196
+ ```
197
+
198
+ Required candidate fields are `id`, `decision`, `kind`, `okfType`, `targetStore`, `targetPath`, `stableKey`, `confidence`, `title`, `description`, `claim`, `basis`, `metadataOnlyEvidence`, `howToApply`, `antiCriteria`, `roleTags`, `repoTags`, `workflowTags`, `pathScopes`, `relatedConceptLinks`, `overlayUpdates`, `scores`, `decisionReason`, `evidenceRefs`, `reviewState`, `bodySections`, and `privacyCheck`.
199
+
200
+ Valid decisions are `auto-accept`, `create`, `update`, `needs-human`, `skip`, and canonical `no_write`. `no-write` may be normalized by the runtime but new output should emit `no_write`. Active writes (`auto-accept`, `create`, `update`) must target `okf`, use reviewState `auto-accepted` or `accepted`, use metadata-only evidence, include evidence refs, have a safe relative `.md` target path outside reserved `index.md` and `log.md`, and include verification or `verificationNotApplicableReason`.
201
+
202
+ Behavior-changing active writes, including skill, role-agent, team, workflow, routing, tool-use, task-split, and subagent changes, must include `evalSetRefs` that point to provided `evoEvalSets`. Eval sets must be metadata-only and use privacy flags `usesRawPrompt: false`, `usesSourceDump: false`, and `usesRawCommandOutput: false`.
203
+
204
+ Scoring uses 1-5 integers for `evidenceStrength`, `reuseValue`, `actionability`, `stability`, `privacyRisk`, and `duplicationRisk`. A candidate should not target `okf` unless evidence strength, reuse value, and actionability justify future retrieval and privacy risk is low. `no_write` is a normal result and should be common.
205
+
206
+ ## Write Targets
207
+
208
+ Default output is a transient plan only.
209
+
210
+ - `okf`: stable facts, decisions, constraints, concepts, evos cases, and reusable rules that the organizer may write into user-local OKF.
211
+ - `evo-eval-set`: regression cases tied to proposed or accepted behavior changes.
212
+ - `repo-asset-proposal`: suggested repo rules, skills, role agents, subagents, or teams. Requires explicit project opt-in before any repository write.
213
+ - `none`: useful observation that should stay in the report and not become durable knowledge.
214
+
215
+ Project-local writes remain out of scope for this skill.
216
+
217
+ ## Role Tags
218
+
219
+ Every durable candidate must include at least one role tag. Prefer stable role slugs:
220
+
221
+ - `architect`
222
+ - `implementer`
223
+ - `reviewer`
224
+ - `tester`
225
+ - `security`
226
+ - `release`
227
+ - `docs`
228
+
229
+ Use user-defined role slugs only when a reviewed role-agent definition exists. Treat role tags as retrieval/routing filters, not decorative labels.
230
+
231
+ ## Human Intervention Triggers
232
+
233
+ Mark a candidate as `needs-human` when it:
234
+
235
+ - Affects security, privacy, release, architecture, or cross-repo behavior.
236
+ - Suggests a project-local file write.
237
+ - Suggests changing a skill, role agent, team, workflow, routing rule, tool-use policy, or subagent behavior without an associated `evoEvalSets` entry or explicit not-applicable reason.
238
+ - Has low evidence strength, high privacy risk, or ambiguous repo scope.
239
+ - Would change role-agent behavior, EvoHub team composition, or runtime retrieval behavior.
240
+ - Conflicts with existing OKF guidance in a way the organizer cannot resolve from current repo facts.
241
+ - Is derived primarily from model reflection rather than verified evidence.
242
+
243
+ ## Runtime Attention Boundary
244
+
245
+ Only active OKF concepts under `~/.evodev/knowledge/okf` may influence retrieval. Runtime loading remains gated by role selection, repo scope, workflow scope, path scope, privacy policy, and consent. Transient plans, failed plans, repo proposals, and `no_write` observations must not influence routing or runtime behavior.
246
+
247
+ ## References
248
+
249
+ For method comparisons and design rationale, read `references/knowledge-distillation-methods.md` in this skill directory. For OKF structure, reserved filenames, concept frontmatter, links, indexes, logs, and conformance rules, follow the Open Knowledge Format v0.1 spec: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md.