Validate and refine a ysonet document
Validate first, then improve the document itself. Do not merely return review
comments unless the user explicitly asks for review-only mode.
Non-negotiable result
Finish with a document that:
- separates verified facts, user decisions, proposals, predictions, and risks;
- contains no factual claim accepted only because the original document says it;
- has no contradiction, vague requirement, hidden assumption, unsupported count,
stale path, unbounded scope word, or unresolved decision;
- gives pros and cons for every suggestion, recommendation, and alternative;
- is complete enough for its stated purpose; and
- is concise, internally consistent, and written in the repository style.
"No uncertainty" means no IDENTIFIED uncertainty remains unresolved. Every
item must be verified, decided by the user, corrected, removed, or replaced
with an explicit bounded risk and a decision rule. Do not use "TBD", an
unstated assumption, or vague qualification to make the register look empty.
Scope and authority
- Edit the named file in place unless the user requests a new file.
- If more than one file could be the target, inspect the likely candidates and
ask which one before editing.
- Review linked or dependent documents when their claims affect the target.
- Change only the document and closely related document links or indexes. Do
not implement the plan or change product code unless the user separately
asks for implementation.
- Preserve unrelated user edits. When the target is inside this Git checkout,
inspect
git status --short and the target's current diff before editing.
For an untracked or external target, retain the original content in working
context and use a direct before/after review instead of pretending Git has a
baseline.
- Do not change
VERSION, commit, push, stage, or move an approved plan between
workflow folders without the approvals required by CLAUDE.md.
Workflow
1. Load the governing context
Read the whole target before judging any part of it.
Read CLAUDE.md, .claude/memory/memory.md, every public memory file it
indexes, and .claude/memory/private/index.md when it exists. Treat memory as
claims to check, not as proof. Read docs/ARCHITECTURE.md,
CONTRIBUTING.md, and every repository instruction file that governs the
target or its directory.
Apply these document-specific contracts:
- For a development plan, read
.claude/skills/ysonet-dev-create-plan/SKILL.md in full and follow every
subject-specific reference it routes to.
- For an approved implementation plan, also read
.claude/skills/ysonet-dev-implement-plan/SKILL.md to check whether the plan
is still implementable under the current contract.
- For a skill, agent, or prompt, read
.claude/skills/ysonet-dev-consistency-check/references/anthropic-skill-standards.md
and run the repository skill checker after editing.
- Before reviewing
ysonet/Generators/ or ysonet/Plugins/ for a third-party
defense, read SECURITY.md. Never validate a deserialization denylist as a
complete security fix. Stop catalog enumeration and redirect the document
to removal of unsafe deserialization or a fixed-schema, data-only design. A
strict allowlist may be described only as temporary containment.
Read every complete source, test, project, config, and documentation file on
which a claim depends. Do not rely on snippets when surrounding code can change
the meaning.
2. Define the document's contract
State in working notes:
- the target file and document type;
- its intended reader and decision or action it must enable;
- its requested outcome and explicit non-goals;
- the time, version, branch, platform, and configuration to which claims apply;
- whether the user requested edit mode or review-only mode; and
- the completion criteria.
Derive repository-checkable facts yourself. Ask the user about intent,
preference, scope, risk tolerance, or policy choices that evidence cannot
settle.
3. Apply the early ambiguity gate
Before a deep source audit, scan the target for undefined purpose, scope,
public behavior, compatibility, safety, or acceptance criteria. If a user
decision would change which design or evidence matters and repository facts
cannot settle it:
- verify only enough current state to frame accurate options;
- add the item to the uncertainty register;
- ask the user using the question format in step 6; and
- pause deep inspection of the affected alternatives until the answer arrives.
Continue checking independent claims while waiting only when that work remains
useful under every answer. This gate does not skip the repository's mandatory
session guidance. It prevents an expensive audit of a design whose purpose has
not been defined.
4. Build a zero-trust claim ledger
Inventory every factual, normative, causal, quantitative, and implicit claim
before editing. Include:
- file paths, symbols, namespaces, call paths, ownership, and dependencies;
- counts, lists, classifications, and statements using "all", "none", "only",
"never", "always", "complete", "supported", or "safe";
- current behavior, test coverage, compatibility, versions, dates, status, and
performance;
- negative claims that something does not exist or cannot happen;
- requirements attributed to the user or repository;
- assumptions disguised as facts;
- causal claims and claims that one change is sufficient;
- commands said to work and results said to pass;
- estimates, predictions, risks, and acceptance criteria; and
- recommendations or alternatives that omit trade-offs.
Classify each item:
| Type |
Required proof |
| Current repository fact |
Current source, project/config, or direct command output |
| Behavior claim |
Focused test or direct reproduction, plus source when relevant |
| Negative or exhaustive claim |
Complete scoped search or enumeration and its boundaries |
| Repository requirement |
Exact governing instruction or policy |
| External or time-sensitive fact |
Current primary source for the exact version and date |
| User requirement or preference |
Explicit user confirmation |
| Estimate or prediction |
Stated basis, range, assumptions, and failure trigger |
| Recommendation |
Decision criteria, pros, cons, and a clear recommendation |
Track each claim as verified, false, partly true, stale, unsupported, or
user-decision. The target document is never evidence for its own claim. A
second document repeating the same unsupported statement is corroboration
only, not proof.
5. Verify with the strongest available evidence
Use this order:
- current source, tests, project files, and configuration;
- focused execution or reproducible command output from the current checkout;
- repository policies and contracts;
- official specifications, vendor documentation, release notes, or original
research for the exact version in scope;
- secondary sources only as clearly identified supporting context.
Use rg or a registry/listing command for discovery and counts. Check both
declarations and consumers. Follow reflection, string-based names, generated
files, old-style project includes, CLI, interactive UI, help, completion,
tests, docs, and packaging when relevant.
For each claim:
- verify the precise scope, not a nearby example;
- use independent evidence rather than circular documentation;
- test the failure or negative path when the claim depends on absence;
- validate exact commands in the stated working directory;
- treat old logs and reported pass counts as historical unless tied to the
current commit and environment; and
- record a repository-relative file and symbol, command result, or direct
source that a later reader can re-check.
For external claims, prefer primary sources and record the relevant version or
access date in the document when the fact can change. If authoritative evidence
is unavailable, ask for the source or access needed. Otherwise remove or narrow
the claim. Never label it verified.
Run checks in proportion to the claim. A syntax check cannot prove runtime
behavior, a smoke test cannot prove an exhaustive matrix, and a passing test
cannot prove an assertion it never makes.
6. Run the uncertainty loop
Maintain an uncertainty register containing every ambiguity, contradiction,
missing decision, undefined term, vague adjective, unsupported assumption, and
evidence gap. Search specifically for terms such as "etc.", "as needed",
"appropriate", "proper", "simple", "fast", "safe", "later", "may", "should",
"ideally", "where relevant", and "if possible". Keep one only when its bounds
and decision rule are explicit.
Resolve repository-checkable questions by investigation. For every item that
requires the user:
- State the exact ambiguity and why it changes the result.
- Give concrete options.
- Give concise pros and cons for EACH option.
- Recommend one option and explain the deciding criterion.
- Say which document sections the answer will change.
- Ask related questions together with
AskUserQuestion when available.
For a plan under dev-kitchen/ideas/ or
dev-kitchen/to-be-implemented/, also record the questions in that SAME plan
using the plan-file question workflow in CLAUDE.md. Do not create a sidecar
question file. Keep active Open questions at the end of the plan's active
content. Preserve an Answered questions history after it when the current
plan template requires that record.
After every response:
- apply the answer everywhere it affects the document;
- record the decision where the plan workflow requires it;
- re-read the changed sections for contradictions and new implications;
- rebuild the uncertainty register; and
- ask the next batch if any uncertainty remains.
Do not infer closure from a partial answer. Do not stop after one round merely
because the original questions were answered.
7. Review design quality and completeness
Challenge the premise as well as the wording. Check whether the proposed
solution addresses the real problem, whether a simpler durable design exists,
and whether the document silently chooses a workaround.
Every suggestion, recommendation, and alternative in the target or in the
review must state:
- Pros: concrete benefits;
- Cons: cost, risk, limitations, and migration impact; and
- Recommendation: the chosen option and why it wins under the stated criteria.
A mandatory factual or policy correction is not a suggestion. Cite its
evidence instead of inventing artificial trade-offs.
For a plan, verify at least:
- goal, non-goals, reader, and acceptance criteria;
- verified current state and constraints;
- one coherent design, inclusion rule, and strongest alternative;
- file- and symbol-specific implementation sequence in dependency order;
- compatibility, migration, security, data, and public behavior;
- CLI, interactive UI, help, completion, docs, packaging, and generated files;
- focused positive, negative, boundary, regression, and matrix tests;
- exact verification commands, working directories, and expected evidence;
- risks, mitigations, checkpoints, escape hatch, and recoverable rollback;
- all applicable serializer, formatter, variant, gadget, or plugin coverage;
and
- settled questions, explicit decisions, and no hidden deferred work.
Do not accept a plan because it is detailed. Detail can still rest on a false
premise.
8. Choose the right edit depth
Use the least disruptive edit that produces a trustworthy document:
- Make surgical corrections when the structure and main conclusion are sound.
- Restructure when facts are mostly sound but evidence, sequence, or decisions
are hard to follow.
- Rewrite when the premise is false, errors are systemic, sections contradict
each other, the intended reader cannot act on it, or patching would preserve
misleading structure.
Preserve verified decisions, useful history, credits, and user wording where
they remain accurate. Remove repetition, stale commentary, and claims that no
longer serve the document's purpose. Keep repository-relative paths, plain
ASCII, simple words, and the existing document's public/private boundary.
Leave enough traceability for a later reader to re-check important claims.
Place a stable file and symbol, command, or primary-source reference near the
claim or in a compact evidence section. Avoid brittle line numbers when a
symbol or section name is clearer.
If validation materially changes an approved plan's scope, public behavior,
compatibility, dependency choice, security model, or selected design, ask the
user whether to revise its approval state before moving or implementing it.
9. Re-validate the revision from scratch
Treat the revised document as a new, untrusted input:
- Re-read the whole file without relying on the earlier ledger.
- Re-inventory all of its claims.
- Re-run affected searches, commands, link checks, and focused tests.
- Confirm every question answer is reflected everywhere it matters.
- Check headings, numbering, links, paths, commands, terminology, and status.
- Search for placeholders, vague terms, unsupported absolutes, and conflicting
statements.
- Inspect the final diff. Run
git diff --check when the target is inside the
Git checkout; otherwise perform an equivalent whitespace and formatting
review directly on the file.
- Run any document-type validator required by step 1.
Repeat verification and editing until the claim ledger contains no false,
partly true, stale, or unsupported claim and the uncertainty register is
empty.
Handoff
Lead with the outcome and the target path. Report:
- whether the document received a surgical edit, restructure, or rewrite;
- the important claims corrected or removed;
- the evidence and commands used;
- the user decisions applied;
- validation results; and
- remaining uncertainty.
A completed handoff must say remaining uncertainty is "None". If an item cannot
be verified or decided, do not call the document validated. Ask the next
question or state the exact evidence/access blocker and keep the work open.
Final checklist
1---2name: ysonet-dev-validate-and-refine3description: Validates and refines an existing ysonet development plan, design document, review note, or other Markdown file by treating every factual statement as untrusted, verifying claims against current source, tests, repository rules, and authoritative external evidence, resolving contradictions and vagueness through repeated user questions, and editing or rewriting the document until it is accurate, complete, consistent, actionable, and has no unresolved uncertainty. Use when the user asks to review, validate, verify, fact-check, critique, refine, correct, improve, or rewrite a plan or .md file, including a draft under dev-kitchen/ideas/ or an approved plan that may have drifted.4---56# Validate and refine a ysonet document78Validate first, then improve the document itself. Do not merely return review9comments unless the user explicitly asks for review-only mode.1011## Non-negotiable result1213Finish with a document that:1415- separates verified facts, user decisions, proposals, predictions, and risks;16- contains no factual claim accepted only because the original document says it;17- has no contradiction, vague requirement, hidden assumption, unsupported count,18 stale path, unbounded scope word, or unresolved decision;19- gives pros and cons for every suggestion, recommendation, and alternative;20- is complete enough for its stated purpose; and21- is concise, internally consistent, and written in the repository style.2223"No uncertainty" means no IDENTIFIED uncertainty remains unresolved. Every24item must be verified, decided by the user, corrected, removed, or replaced25with an explicit bounded risk and a decision rule. Do not use "TBD", an26unstated assumption, or vague qualification to make the register look empty.2728## Scope and authority2930- Edit the named file in place unless the user requests a new file.31- If more than one file could be the target, inspect the likely candidates and32 ask which one before editing.33- Review linked or dependent documents when their claims affect the target.34- Change only the document and closely related document links or indexes. Do35 not implement the plan or change product code unless the user separately36 asks for implementation.37- Preserve unrelated user edits. When the target is inside this Git checkout,38 inspect `git status --short` and the target's current diff before editing.39 For an untracked or external target, retain the original content in working40 context and use a direct before/after review instead of pretending Git has a41 baseline.42- Do not change `VERSION`, commit, push, stage, or move an approved plan between43 workflow folders without the approvals required by `CLAUDE.md`.4445## Workflow4647### 1. Load the governing context4849Read the whole target before judging any part of it.5051Read `CLAUDE.md`, `.claude/memory/memory.md`, every public memory file it52indexes, and `.claude/memory/private/index.md` when it exists. Treat memory as53claims to check, not as proof. Read `docs/ARCHITECTURE.md`,54`CONTRIBUTING.md`, and every repository instruction file that governs the55target or its directory.5657Apply these document-specific contracts:5859- For a development plan, read60 `.claude/skills/ysonet-dev-create-plan/SKILL.md` in full and follow every61 subject-specific reference it routes to.62- For an approved implementation plan, also read63 `.claude/skills/ysonet-dev-implement-plan/SKILL.md` to check whether the plan64 is still implementable under the current contract.65- For a skill, agent, or prompt, read66 `.claude/skills/ysonet-dev-consistency-check/references/anthropic-skill-standards.md`67 and run the repository skill checker after editing.68- Before reviewing `ysonet/Generators/` or `ysonet/Plugins/` for a third-party69 defense, read `SECURITY.md`. Never validate a deserialization denylist as a70 complete security fix. Stop catalog enumeration and redirect the document71 to removal of unsafe deserialization or a fixed-schema, data-only design. A72 strict allowlist may be described only as temporary containment.7374Read every complete source, test, project, config, and documentation file on75which a claim depends. Do not rely on snippets when surrounding code can change76the meaning.7778### 2. Define the document's contract7980State in working notes:8182- the target file and document type;83- its intended reader and decision or action it must enable;84- its requested outcome and explicit non-goals;85- the time, version, branch, platform, and configuration to which claims apply;86- whether the user requested edit mode or review-only mode; and87- the completion criteria.8889Derive repository-checkable facts yourself. Ask the user about intent,90preference, scope, risk tolerance, or policy choices that evidence cannot91settle.9293### 3. Apply the early ambiguity gate9495Before a deep source audit, scan the target for undefined purpose, scope,96public behavior, compatibility, safety, or acceptance criteria. If a user97decision would change which design or evidence matters and repository facts98cannot settle it:991001. verify only enough current state to frame accurate options;1012. add the item to the uncertainty register;1023. ask the user using the question format in step 6; and1034. pause deep inspection of the affected alternatives until the answer arrives.104105Continue checking independent claims while waiting only when that work remains106useful under every answer. This gate does not skip the repository's mandatory107session guidance. It prevents an expensive audit of a design whose purpose has108not been defined.109110### 4. Build a zero-trust claim ledger111112Inventory every factual, normative, causal, quantitative, and implicit claim113before editing. Include:114115- file paths, symbols, namespaces, call paths, ownership, and dependencies;116- counts, lists, classifications, and statements using "all", "none", "only",117 "never", "always", "complete", "supported", or "safe";118- current behavior, test coverage, compatibility, versions, dates, status, and119 performance;120- negative claims that something does not exist or cannot happen;121- requirements attributed to the user or repository;122- assumptions disguised as facts;123- causal claims and claims that one change is sufficient;124- commands said to work and results said to pass;125- estimates, predictions, risks, and acceptance criteria; and126- recommendations or alternatives that omit trade-offs.127128Classify each item:129130| Type | Required proof |131|---|---|132| Current repository fact | Current source, project/config, or direct command output |133| Behavior claim | Focused test or direct reproduction, plus source when relevant |134| Negative or exhaustive claim | Complete scoped search or enumeration and its boundaries |135| Repository requirement | Exact governing instruction or policy |136| External or time-sensitive fact | Current primary source for the exact version and date |137| User requirement or preference | Explicit user confirmation |138| Estimate or prediction | Stated basis, range, assumptions, and failure trigger |139| Recommendation | Decision criteria, pros, cons, and a clear recommendation |140141Track each claim as verified, false, partly true, stale, unsupported, or142user-decision. The target document is never evidence for its own claim. A143second document repeating the same unsupported statement is corroboration144only, not proof.145146### 5. Verify with the strongest available evidence147148Use this order:1491501. current source, tests, project files, and configuration;1512. focused execution or reproducible command output from the current checkout;1523. repository policies and contracts;1534. official specifications, vendor documentation, release notes, or original154 research for the exact version in scope;1555. secondary sources only as clearly identified supporting context.156157Use `rg` or a registry/listing command for discovery and counts. Check both158declarations and consumers. Follow reflection, string-based names, generated159files, old-style project includes, CLI, interactive UI, help, completion,160tests, docs, and packaging when relevant.161162For each claim:163164- verify the precise scope, not a nearby example;165- use independent evidence rather than circular documentation;166- test the failure or negative path when the claim depends on absence;167- validate exact commands in the stated working directory;168- treat old logs and reported pass counts as historical unless tied to the169 current commit and environment; and170- record a repository-relative file and symbol, command result, or direct171 source that a later reader can re-check.172173For external claims, prefer primary sources and record the relevant version or174access date in the document when the fact can change. If authoritative evidence175is unavailable, ask for the source or access needed. Otherwise remove or narrow176the claim. Never label it verified.177178Run checks in proportion to the claim. A syntax check cannot prove runtime179behavior, a smoke test cannot prove an exhaustive matrix, and a passing test180cannot prove an assertion it never makes.181182### 6. Run the uncertainty loop183184Maintain an uncertainty register containing every ambiguity, contradiction,185missing decision, undefined term, vague adjective, unsupported assumption, and186evidence gap. Search specifically for terms such as "etc.", "as needed",187"appropriate", "proper", "simple", "fast", "safe", "later", "may", "should",188"ideally", "where relevant", and "if possible". Keep one only when its bounds189and decision rule are explicit.190191Resolve repository-checkable questions by investigation. For every item that192requires the user:1931941. State the exact ambiguity and why it changes the result.1952. Give concrete options.1963. Give concise pros and cons for EACH option.1974. Recommend one option and explain the deciding criterion.1985. Say which document sections the answer will change.1996. Ask related questions together with `AskUserQuestion` when available.200201For a plan under `dev-kitchen/ideas/` or202`dev-kitchen/to-be-implemented/`, also record the questions in that SAME plan203using the plan-file question workflow in `CLAUDE.md`. Do not create a sidecar204question file. Keep active `Open questions` at the end of the plan's active205content. Preserve an `Answered questions` history after it when the current206plan template requires that record.207208After every response:2092101. apply the answer everywhere it affects the document;2112. record the decision where the plan workflow requires it;2123. re-read the changed sections for contradictions and new implications;2134. rebuild the uncertainty register; and2145. ask the next batch if any uncertainty remains.215216Do not infer closure from a partial answer. Do not stop after one round merely217because the original questions were answered.218219### 7. Review design quality and completeness220221Challenge the premise as well as the wording. Check whether the proposed222solution addresses the real problem, whether a simpler durable design exists,223and whether the document silently chooses a workaround.224225Every suggestion, recommendation, and alternative in the target or in the226review must state:227228- Pros: concrete benefits;229- Cons: cost, risk, limitations, and migration impact; and230- Recommendation: the chosen option and why it wins under the stated criteria.231232A mandatory factual or policy correction is not a suggestion. Cite its233evidence instead of inventing artificial trade-offs.234235For a plan, verify at least:236237- goal, non-goals, reader, and acceptance criteria;238- verified current state and constraints;239- one coherent design, inclusion rule, and strongest alternative;240- file- and symbol-specific implementation sequence in dependency order;241- compatibility, migration, security, data, and public behavior;242- CLI, interactive UI, help, completion, docs, packaging, and generated files;243- focused positive, negative, boundary, regression, and matrix tests;244- exact verification commands, working directories, and expected evidence;245- risks, mitigations, checkpoints, escape hatch, and recoverable rollback;246- all applicable serializer, formatter, variant, gadget, or plugin coverage;247 and248- settled questions, explicit decisions, and no hidden deferred work.249250Do not accept a plan because it is detailed. Detail can still rest on a false251premise.252253### 8. Choose the right edit depth254255Use the least disruptive edit that produces a trustworthy document:256257- Make surgical corrections when the structure and main conclusion are sound.258- Restructure when facts are mostly sound but evidence, sequence, or decisions259 are hard to follow.260- Rewrite when the premise is false, errors are systemic, sections contradict261 each other, the intended reader cannot act on it, or patching would preserve262 misleading structure.263264Preserve verified decisions, useful history, credits, and user wording where265they remain accurate. Remove repetition, stale commentary, and claims that no266longer serve the document's purpose. Keep repository-relative paths, plain267ASCII, simple words, and the existing document's public/private boundary.268Leave enough traceability for a later reader to re-check important claims.269Place a stable file and symbol, command, or primary-source reference near the270claim or in a compact evidence section. Avoid brittle line numbers when a271symbol or section name is clearer.272273If validation materially changes an approved plan's scope, public behavior,274compatibility, dependency choice, security model, or selected design, ask the275user whether to revise its approval state before moving or implementing it.276277### 9. Re-validate the revision from scratch278279Treat the revised document as a new, untrusted input:2802811. Re-read the whole file without relying on the earlier ledger.2822. Re-inventory all of its claims.2833. Re-run affected searches, commands, link checks, and focused tests.2844. Confirm every question answer is reflected everywhere it matters.2855. Check headings, numbering, links, paths, commands, terminology, and status.2866. Search for placeholders, vague terms, unsupported absolutes, and conflicting287 statements.2887. Inspect the final diff. Run `git diff --check` when the target is inside the289 Git checkout; otherwise perform an equivalent whitespace and formatting290 review directly on the file.2918. Run any document-type validator required by step 1.292293Repeat verification and editing until the claim ledger contains no false,294partly true, stale, or unsupported claim and the uncertainty register is295empty.296297## Handoff298299Lead with the outcome and the target path. Report:300301- whether the document received a surgical edit, restructure, or rewrite;302- the important claims corrected or removed;303- the evidence and commands used;304- the user decisions applied;305- validation results; and306- remaining uncertainty.307308A completed handoff must say remaining uncertainty is "None". If an item cannot309be verified or decided, do not call the document validated. Ask the next310question or state the exact evidence/access blocker and keep the work open.311312## Final checklist313314- [ ] The complete target and governing instructions were read.315- [ ] Existing user changes were preserved.316- [ ] Every factual, normative, causal, quantitative, and implicit claim was317 inventoried and independently checked.318- [ ] Negative and exhaustive claims used exhaustive scoped evidence.319- [ ] Time-sensitive claims used current primary sources.320- [ ] Every suggestion and alternative has pros, cons, and a recommendation.321- [ ] Every vague point entered the uncertainty loop.322- [ ] Each user answer was applied and re-audited for follow-on uncertainty.323- [ ] The plan or document is complete for its stated purpose.324- [ ] The revised document passed a fresh zero-trust review.325- [ ] Required validators and applicable diff/format checks passed.326- [ ] Remaining uncertainty is None.