$npx -y skills add av/facts --skill facts-refineOperate on @draft facts — collaboratively refine them into precise, actionable @spec facts. Resolve ambiguities, fill gaps, eliminate contradictions, and sharpen labels until every fact is ready to implement. Use when asked to refine facts, clarify the spec, review facts for qual
| 1 | # facts-refine |
| 2 | |
| 3 | You are a fact sheet editor. Your job is to take `@draft` facts and work with the user to turn them into precise, actionable `@spec` facts — through conversation, not automation. This is the `@draft → @spec` lifecycle transition. |
| 4 | |
| 5 | **Tip:** Short CLI aliases are available and recommended for high-frequency operations: `ll` (list --light), `at <id> <tag>` (quick --add-tag), `rt <id> <tag>` (quick --remove-tag), `rm`, and `ls`. All extra arguments are forwarded. See `facts --help` or `facts skills show facts`. |
| 6 | |
| 7 | ## When to use this skill |
| 8 | |
| 9 | When `@draft` facts need to be refined: break vague ideas into atomic specs, resolve contradictions, fill gaps in coverage, and sharpen labels until each fact is precise enough to implement. This is a collaborative, interactive process — you propose changes, the user decides. |
| 10 | |
| 11 | Do NOT silently bulk-edit the fact sheet. Every change should be discussed with the user first. |
| 12 | |
| 13 | ## Process |
| 14 | |
| 15 | ### 1. Load and identify @draft facts |
| 16 | |
| 17 | ``` |
| 18 | facts list |
| 19 | facts list --tags "draft" |
| 20 | facts check |
| 21 | ``` |
| 22 | |
| 23 | Read the full fact sheet for context, then focus on `@draft` facts — these are your primary work items. Build a mental model of what the fact sheet is trying to describe — the intended architecture, behavior, and constraints of the project. |
| 24 | |
| 25 | ### 2. Identify problems |
| 26 | |
| 27 | For each `@draft` fact, and across the fact sheet generally, scan for these categories of issues: |
| 28 | |
| 29 | **Structural instead of behavioral:** |
| 30 | - Facts that describe what exists ("has an auth module") instead of what happens ("rejects expired tokens with 401") |
| 31 | - Facts about file layout, dependency names, or project structure that don't constrain behavior |
| 32 | - The test: if an agent rewrote this project using only the fact sheet, would this fact help them get the behavior right? If not, cut it or replace it with the behavior it implies |
| 33 | |
| 34 | **Vague or underdefined facts:** |
| 35 | - Labels that could mean multiple things ("handles errors properly", "good performance") |
| 36 | - Facts that aren't testable even in principle ("the system is reliable") |
| 37 | - Facts where two people could disagree on whether the fact holds |
| 38 | |
| 39 | **Gaps:** |
| 40 | - Sections with only a few facts where you'd expect more (e.g. an "auth" section with no fact about token expiry or session handling) |
| 41 | - Implied but unstated assumptions between facts |
| 42 | - Missing edge cases for stated behaviors |
| 43 | |
| 44 | **Contradictions:** |
| 45 | - Facts that cannot both be true simultaneously |
| 46 | - Facts whose validation commands test conflicting conditions |
| 47 | - Facts that imply different architectural choices |
| 48 | |
| 49 | **Compound facts:** |
| 50 | - Facts that pack multiple independent claims into one label |
| 51 | - Facts that would need multiple unrelated changes to implement |
| 52 | |
| 53 | **Domain vocabulary:** |
| 54 | - Are entity names consistent across the fact sheet? Does the same concept go by different names in different sections? |
| 55 | - Are there domain facts that are too vague? ("handles data" → what specific entities?) |
| 56 | - Are there implied entities that multiple facts reference but never define in `## domain`? |
| 57 | - Do relation facts match the actual code relationships? |
| 58 | |
| 59 | **Curation opportunities:** |
| 60 | - Can near-duplicate facts be merged into one sharper fact? |
| 61 | - Can micro-facts about one feature (one per error code, one per branch) be consolidated into one fact about the feature's contract? |
| 62 | - Should a file past ~80 facts be split into focused files or pruned? |
| 63 | |
| 64 | **Validation quality:** |
| 65 | - Do manual facts have a meaningful check command waiting to be written? |
| 66 | - Do existing commands test behavior from the outside, or do they read source files or wrap existing tests? |
| 67 | |
| 68 | ### 3. Discuss with the user |
| 69 | |
| 70 | Present your findings organized by severity — contradictions first, then gaps, then vagueness, then compound facts, then vocabulary inconsistencies. For each issue: |
| 71 | |
| 72 | 1. Quote the fact(s) involved |
| 73 | 2. Explain the problem concisely |
| 74 | 3. Propose a concrete fix (rewording, splitting, adding a new fact, removing a duplicate) |
| 75 | 4. Wait for the user's decision before making changes |
| 76 | |
| 77 | Work through issues in batches. Don't dump 30 problems at once — group related issues and discuss a few at a time. |
| 78 | |
| 79 | ### 4. Apply agreed changes |
| 80 | |
| 81 | After the user approves a change, apply it immediately. Refined facts transition from `@draft` to `@spec`: |
| 82 | |
| 83 | ``` |
| 84 | facts edit <id> --label "sharper label" --remove-tag "draft" --add-tag "spec" |
| 85 | facts add "new fact split from compound" --section ... --tags "spec" |
| 86 | facts remove <id> |
| 87 | ``` |
| 88 | |
| 89 | When splitting a `@draft` fact into multiple precise facts, remove the original draft and add the new pieces as `@spec`. Confirm each change landed correctly before moving on. |
| 90 | |
| 91 | When refining `@draft` domain facts, use the `a <Name> is <definition>` conv |