Sync Vision
Handle $ARGUMENTS.
VISION.md is living project taste. Treat it like the project doctrine layer:
learn from repeated human answers, agent misses, plans, docs, skills, research,
reviews, and handoffs, then ignore noise.
This skill is the incremental sync lane. It does not replace a vision router.
It keeps root VISION.md current by analyzing changed durable inputs since the
last synced commit. Root VISION.md is the mandatory essential read and single
project vision source.
Autogoal Dependency
Use autogoal before mutable work. This is a derived autogoal workflow.
- Prefer a repo-owned
docs/plans/templates/sync-vision.mdwhen it exists. - Otherwise use the
autogoaltasktemplate withagent-nativeanddocspacks when available. - Default flow: one-shot sync.
- Preview flow: one-shot planning, no vision-doc patch and no baseline advancement.
- Required evidence: command, artifact, source audit, classification ledger, and N/A rows.
autogoalowns lifecycle, first-checkpoint requirement extraction, completion semantics, output-budget discipline, andcheck-complete.mjs.sync-visionowns input-range accounting, candidate classification, root doctrine patch rules, status semantics, and baseline advancement.
Goal handle shape:
Sync vision; done when changed inputs are classified, VISION.md is patched or reaffirmed, baseline semantics are recorded, and checks pass; plan docs/plans/<path>.md.
State
Durable state lives in:
docs/sync/vision/status.json
docs/sync/vision/runs/<date>-<base>-to-<target>/
status.json fields:
lastSyncedCommit: every relevant committed input through this commit has been classified ascaptured,reaffirmed,rejected,run-specific,owner-routed, ordeferred-with-question.lastSyncedAt: when the baseline was advanced.lastRunDir: latest run artifact directory.lastTargetCommit: latest target commit analyzed.pendingRunDir: run with unresolved decisions, ornull.
Never advance lastSyncedCommit merely because artifacts were written. Advance
only after the committed range is fully accounted for. Working-tree overlays
are visible in artifacts but are not baselined until committed.
Working-tree overlays include relevant untracked files. New doctrine docs, plans, rule files, and root docs must be visible in artifacts before commit, but they are not baselined until committed.
Optional Config
Projects may customize the helper with:
docs/sync/vision/config.json
Supported fields:
includePathspecs: extra git pathspecs to collect.exactInputFiles: extra exact file paths.inputPathPrefixes: extra directory prefixes.excludePathPrefixes: extra excluded prefixes.trackedExts: extra text-like extensions.patterns: extra candidate regexes by category.
Keep config project-local. Do not put private URLs, account IDs, or temporary branch state in dotai.
Commands
status: readstatus.json, currentHEAD, committed diff count, and working-tree overlay count. No writes.preview: write run artifacts and recommendations. Do not patchVISION.md. Do not advance baseline.sync: default. Write artifacts, patch rootVISION.mdfor high-confidence reusable decisions, route non-vision owners, and advance baseline only if all committed inputs are classified.advance: updatestatus.jsonto currentHEADonly after the active plan proves the range is fully accounted for.
Use the helper for accounting from the project root:
node .agents/skills/sync-vision/scripts/collect-vision-diff.mjs --status
node .agents/skills/sync-vision/scripts/collect-vision-diff.mjs --dry-run
node .agents/skills/sync-vision/scripts/collect-vision-diff.mjs
node .agents/skills/sync-vision/scripts/collect-vision-diff.mjs --advance --plan docs/plans/<plan>.md
The helper writes:
changed-files.tsvcandidate-lines.tsvsummary.mdrun.json
Default Input Scope
Analyze changed durable inputs, not the whole repo every time:
VISION.mdAGENTS.md.agents/AGENTS.md.agents/rules/**skills/**when the repo uses top-level source skills, as dotai doesdocs/plans/**docs/sync/**exceptdocs/sync/vision/runs/**docs/research/**docs/solutions/**content/docs/**- other Markdown-like root docs when they appear in the changed-file list
Generated .agents/skills/** mirrors are not primary input when a source rule
or top-level skills/** source exists. Use generated mirrors only for sync
audits.
Classification
Every candidate line or theme becomes one of:
captured: patch rootVISION.mdwith a compact latest-state rule.reaffirmed: already covered by root; record the section.rejected: stale, one-off, contradicted, too narrow, or not project taste.run-specific: belongs in the active plan only.owner-routed: belongs in a skill/rule, research doc, benchmark target, package docs, product spec, behavior spec, or migration guide instead ofVISION.md.deferred-with-question: missing taste; queue one concise question and do not advance the baseline unless the range can be safely accounted for without it.
Promote to root VISION.md when the rule is reusable project doctrine: global
taste, source order, cross-boundary law, public API doctrine, proof standards,
review attention, owner-specific doctrine, or supervisor stop conditions.
Do not promote:
- temporary command output;
- one-off route state;
- old branch summaries;
- raw issue bodies;
- generated mirror noise;
- artifact paths;
- broad history that does not change a future decision.
Sync Workflow
- Load
autogoal, create or continue async-visionplan, and copy every user requirement into checkpoint zero. - Read root
VISION.md. - Read
docs/sync/vision/status.jsonif present. - Run the helper in
statusor collection mode. - Read
summary.md,candidate-lines.tsv, and the changed source files that actually contain high-signal candidates. - Cluster candidates by reusable decision, not by file.
- Classify each cluster.
- Patch root
VISION.mdonly forcapturedclusters. Write current-state doctrine, not changelog prose. - Route owner-specific misses to the owner:
- skill/rule miss -> local skill source or installed shared skill owner;
- behavior law -> product behavior/spec docs or owning plan skill;
- automation miss -> owning supervisor skill;
- research-system miss -> research owner;
- migration miss -> migration owner;
- benchmark truth -> benchmark target/script owner;
- docs/API mismatch -> docs or package owner.
- Record a decision ledger in the plan or run summary.
- If agent rules or shared skills changed, run the repo's generation or skill validation command.
- Run the active plan completion checker when available.
- Advance
lastSyncedCommitonly when the committed range is fully classified.
Baseline Advancement
Advance baseline when all are true:
- committed diff range was collected from prior
lastSyncedCommitto target; - every candidate cluster has a classification;
- root
VISION.mdwas patched or explicitly reaffirmed for reusable taste; - owner-routed items have concrete owners;
- deferred questions are listed with recommendations;
- generated mirrors are synced when source rules changed;
- the active plan passes its completion check when one exists.
Do not advance baseline when:
- the run is
statusorpreview; - a candidate changes product/API taste and no default can be inferred;
- a source rule changed but generated mirror sync failed;
- the helper reports a git/ref error;
- only uncommitted overlay input exists.
Final Handoff
Include:
- base commit, target commit, and whether baseline advanced;
- changed input count and candidate count;
- root vision doc changes;
- reaffirmed existing sections;
- rejected/noise clusters;
- owner-routed follow-ups;
- deferred questions;
- changed files;
- commands run;
- next
sync-visioncommand.
Keep it short. The run artifacts hold the detail.