|
| 1 | +--- |
| 2 | +name: data-flywheel |
| 3 | +version: 2026-04-25 |
| 4 | +triggers: ["data flywheel", "trace to train", "training traces", "context cards", "eval cases", "approved runs", "vertical intelligence"] |
| 5 | +tools: [bash, git] |
| 6 | +preconditions: [".agent exists"] |
| 7 | +constraints: ["local-only by default", "human-approved runs only", "redaction required before trainable", "do not train models"] |
| 8 | +--- |
| 9 | + |
| 10 | +# Data Flywheel - approved runs into reusable intelligence |
| 11 | + |
| 12 | +Use this skill when a user wants to turn repeated human-approved agent work |
| 13 | +across Claude Code, Hermes, OpenClaw, Codex, Cursor, or custom `.agent/` loops |
| 14 | +into local artifacts for retrieval, evals, prompt shrinking, and optional |
| 15 | +future open-weight model/adapters. |
| 16 | + |
| 17 | +The flywheel is: |
| 18 | + |
| 19 | +```text |
| 20 | +approved run |
| 21 | +-> redacted trace |
| 22 | +-> context card |
| 23 | +-> eval case |
| 24 | +-> training-ready JSONL |
| 25 | +-> optional downstream SLM/adapter experiment later |
| 26 | +``` |
| 27 | + |
| 28 | +This skill creates the harness. It does not train a model. |
| 29 | + |
| 30 | +## Hard Rules |
| 31 | + |
| 32 | +- Use only human-approved runs. Rejected or unknown-review runs can become |
| 33 | + failure-mode notes, not trainable examples. |
| 34 | +- Redaction must pass before anything is marked trainable. |
| 35 | +- Do not store raw prompts, raw code, client names, addresses, phone numbers, |
| 36 | + emails, secrets, credentials, or unredacted CRM records. |
| 37 | +- Keep `.agent/flywheel/` private and gitignored unless the user explicitly |
| 38 | + commits sanitized examples. |
| 39 | +- Stay model-agnostic. Mention model families only as downstream examples. |
| 40 | + |
| 41 | +## Inputs |
| 42 | + |
| 43 | +Default local input: |
| 44 | + |
| 45 | +```text |
| 46 | +.agent/flywheel/approved-runs.jsonl |
| 47 | +``` |
| 48 | + |
| 49 | +Each line should be a sanitized run record with: |
| 50 | + |
| 51 | +- `domain` |
| 52 | +- `workflow` |
| 53 | +- `harness` |
| 54 | +- `instruction` |
| 55 | +- `input_redacted` |
| 56 | +- `output_approved` |
| 57 | +- `human_review.status` as `accepted` or `edited` |
| 58 | +- `redaction_status: passed` |
| 59 | +- `pii_level` |
| 60 | +- optional `stable_rules`, `tool_contracts`, `eval_tags`, `failure_modes` |
| 61 | + |
| 62 | +## Export |
| 63 | + |
| 64 | +Run: |
| 65 | + |
| 66 | +```bash |
| 67 | +python3 .agent/tools/data_flywheel_export.py |
| 68 | +``` |
| 69 | + |
| 70 | +Outputs go to: |
| 71 | + |
| 72 | +```text |
| 73 | +.agent/flywheel/exports/<YYYY-MM-DD>/ |
| 74 | +``` |
| 75 | + |
| 76 | +Key outputs: |
| 77 | + |
| 78 | +- `trace-records.jsonl` |
| 79 | +- `training-examples.jsonl` |
| 80 | +- `eval-cases.jsonl` |
| 81 | +- `context-cards/<domain>/<workflow>.md` |
| 82 | +- `context-cards/<domain>/<workflow>.json` |
| 83 | +- `flywheel-metrics.json` |
| 84 | + |
| 85 | +## Readiness Checks |
| 86 | + |
| 87 | +Use these as heuristics, not hard rules: |
| 88 | + |
| 89 | +- 10-25 approved runs: useful first context card |
| 90 | +- 25-100 approved runs: first eval set and repeated failure modes |
| 91 | +- 100-300 approved runs: context compression and routing measurement |
| 92 | +- 500-1,500 high-quality examples: narrow adapter experiment candidate |
| 93 | +- 2,000-10,000+ examples: broader workflow-family corpus |
| 94 | + |
| 95 | +## What To Report |
| 96 | + |
| 97 | +When finishing, report: |
| 98 | + |
| 99 | +- traces exported |
| 100 | +- trainable examples exported |
| 101 | +- eval cases exported |
| 102 | +- context cards created |
| 103 | +- redaction pass rate |
| 104 | +- acceptance rate by workflow |
| 105 | +- workflows that should stay frontier-model/manual-review |
| 106 | +- workflows that may become SLM/adapter candidates later |
| 107 | + |
| 108 | +## Self-rewrite hook |
| 109 | + |
| 110 | +If users repeatedly ask for the same domain-specific fields, add them to a |
| 111 | +local context card or schema example instead of hard-coding them into this |
| 112 | +general skill. |
0 commit comments