/autograph:autographfrom autograph
Schema-as-code enforcement for Obsidian vaults. Discovers structure, builds a schema, then enforces it across 6 workflows: bootstrap, health, create/update, search & link, orchestrate, and daily-to-cards.
Ships in autograph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
One schema. One graph. Works on any vault.
No hardcoded domains, types, or paths. The agent discovers structure from data, builds a schema, then enforces it. All scripts share common.py. Metadata uses PyYAML 6.0.3 (safe scalar loader); uv installs the declared dependency. API calls use urllib.
| Workflow | When to use | Entry point |
|---|---|---|
| BOOTSTRAP | New vault / after import / first setup | discover.py → enforce.py → graph.py health |
| HEALTH | Daily maintenance / on request | graph + strict YAML checks → scoped repair manifest |
| CREATE / UPDATE | New knowledge card, or new info about an existing one | search.py dedup → ADD/UPDATE/SUPERSEDE → link → touch |
| SEARCH & LINK | Find info + strengthen connections | Hub → links → target; graph.py orphans → connect |
| ORCHESTRATE | Automated multi-agent workflows (no API keys) | orchestrate.py health|bootstrap |
| DAILY → CARDS | Turn a day's raw notes into linked cards | daily.py extract → dedup-first process → link |
When to use: New vault, bulk import, first setup. Run once, then switch to HEALTH.
Full guide: references/bootstrap-workflow.md
uv run scripts/discover.py <vault-dir> --verbose > /tmp/discovery.jsongenerate_schema.py) + agent swarm (swarm_prepare.py → Wave 1 haiku → swarm_reduce.py → Wave 2 sonnet). NEVER skip the swarm.engine.py init + enforce.py --applylink_cleanup.py --apply (before enrichment)enrich.py tags --apply (via OpenRouter API)dedup.py --apply (before link enrichment)enrich.py swarm-links --apply (always swarm-links, never links)moc.py generateenforce.py --check on the scoped manifest + graph.py health on the staged vault; resolve concrete validation/link findings. A health score is not an acceptance gate.swarm-links, not links (0.3% vs 81.6% match rate).--apply before applying.Read integrity.md before maintenance or creating cards.
The health orchestration command reports only; it does not automatically fix links, regenerate MOCs or change decay. Use uv run for all Python entry points so the declared YAML dependency is available.
When to use: Recording any card, or new information about something the vault may already track. Always look up first, always link immediately — a near-duplicate is the most common mistake; an orphan card is wasted knowledge.
uv run scripts/search.py "<entity / key phrase>" --vault <vault-dir> --json
# fallback: grep -ril "<name>" <vault-dir>
Pick the operation (full rules: references/update-in-place.md):
description, append a dated line under ## Log, re-touch.## History (- 2026-03→2026-06 · company: TDI Group), set updated:. Whole card obsolete → status: superseded + superseded_by: "[[new-card]]".Only when the operation is ADD, continue:
node_typesdomain_inference to find target folder:
# domain_inference maps path→domain. To find folder for domain "crm":
for path_prefix, domain in schema['domain_inference'].items():
if domain == 'crm':
target_folder = path_prefix # e.g. "work/crm/"
break
## Related section with [[hub]] file of the domain
_index.md or MEMORY.md of that domain
b. Find 2-3 sibling cards of same type+domain → add [[links]]uv run scripts/graph.py backlinks <vault> <hub> → find siblingsuv run scripts/engine.py touch <new-file>Templates: references/card-templates.md
When to use: Looking up information in the vault, or strengthening weak areas of the graph.
_index.md or MEMORY.md of that domainuv run scripts/graph.py backlinks <vault> <target> for reverse linksuv run scripts/graph.py orphans <vault-dir> # find orphans
# For each orphan: connect to nearest hub or sibling card
# Files with <2 links → enrich
OPENROUTER_API_KEY=sk-... uv run scripts/enrich.py swarm-links <vault-dir> --apply
uv run scripts/graph.py health <vault-dir> # verify improvement
When to use: Instead of running scripts manually. No API keys — the Claude Code agent does all judgment directly.
uv run scripts/orchestrate.py health <vault-dir> # automated health workflow
uv run scripts/orchestrate.py bootstrap <vault-dir> # full bootstrap (one command)
health runs graph and strict metadata checks only. It leaves cards and indexes unchanged; graph diagnostic reports may be written.
bootstrap runs: enforce > cleanup > tags > dedup > swarm-links > MOC > verify.
The agent (you) does the judgment directly — read prepared data, decide, write results.
# Phase 1: prep dedup clusters for YOUR review
uv run scripts/orchestrate.py dedup-prepare <vault-dir>
# -> writes .graph/dedup-review-input.json
# -> YOU read clusters, mark approved=true, then: dedup.py --apply-manifest
# Phase 2: prep domain catalogs for YOUR link suggestions
uv run scripts/orchestrate.py link-prepare <vault-dir>
# -> writes .graph/link-review-input.json
# -> YOU read catalogs, suggest links per domain, write batch results
# Phase 3: prep graph data for YOUR semantic analysis
uv run scripts/orchestrate.py graph-prepare <vault-dir>
# -> writes .graph/graph-analysis-input.json
# -> YOU analyze contradictions, missing links, stale hubs, write findings
For Phases 1-3: run the prep command, read the output JSON, do the analysis yourself (you ARE the LLM), write results back. Use Agent tool for parallel domain work in Phase 2.
When to use: Turning a daily/YYYY-MM-DD.md note file into durable cards. Judgment-first — the scripts extract candidates; you classify, dedup, and link.
Full guide: references/daily-processor.md
daily.py extract <daily-dir> <vault-dir> [date] (candidates → .graph/) + supersede.py <vault> (conflict scan). Read schema node_types, list noteworthy items + the day's topics.references/update-in-place.md); resolve every .graph/supersede-candidates.json entry.Idempotency: append <!-- autograph-processed: YYYY-MM-DDTHH:MM cards=N --> to the end of the daily file; on re-run, skip content above the last marker. Never edit existing lines.
The decay system models memory with three key mechanisms:
Each touch increments access_count in frontmatter. More retrievals = slower forgetting:
strength = 1 + ln(access_count)
effective_rate = base_rate / strength
relevance = max(floor, 1.0 - effective_rate * days_since_access)
Example: a card touched 5 times has strength = 1 + ln(5) ≈ 2.6, decaying ~2.6x slower than a card touched once.
Different content types decay at different rates. Configure in schema decay.domain_rates:
| Type | Rate | Half-life (~) | Rationale |
|---|---|---|---|
| contact | 0.005 | 100 days | People don't become irrelevant quickly |
| crm | 0.008 | 62 days | Deals have medium lifecycle |
| learning | 0.010 | 50 days | Knowledge fades moderately |
| project | 0.012 | 42 days | Projects have defined timelines |
| daily | 0.020 | 25 days | Daily notes lose relevance fast |
| (default) | 0.015 | 33 days | Fallback for unlisted types |
Touch promotes one tier at a time, not a direct jump to active:
archive → cold → warm → active
Each promotion sets last_accessed to a midpoint date, so without re-touch the card naturally drifts back.
access_count → default=1 → 1+ln(1)=1.0 → rate unchangedtype → default rate appliescalc_relevance(days, schema) → work unchanged (new params optional)uv run scripts/moc.py generate <vault-dir> # MOC generation
uv run scripts/engine.py decay <vault-dir> # decay cycle
uv run scripts/engine.py touch <vault-dir>/path/card.md # touch (graduated)
uv run scripts/engine.py creative 5 <vault-dir> # creative recall
uv run scripts/engine.py stats <vault-dir> # stats
uv run scripts/graph.py backlinks <vault-dir> path/to/card # backlinks
uv run scripts/graph.py orphans <vault-dir> # orphans
uv run scripts/graph.py fix <vault-dir> --apply # fix links
uv run scripts/search.py "<query>" --vault <vault-dir> --json # ranked memory search (dedup-first)
uv run scripts/supersede.py <vault-dir> # conflict scan (dry-run)
uv run scripts/supersede.py <vault-dir> --apply # stamp superseded (2-card, newer-by-date)
uv run scripts/daily.py extract <memory-dir> <vault-dir> # entity extraction
uv run scripts/engine.py init <vault-dir> --dry-run # bootstrap bare files
OPENROUTER_API_KEY=sk-... uv run scripts/enrich.py swarm-links <vault-dir> --apply # link enrichment
OPENROUTER_API_KEY=sk-... uv run scripts/enrich.py tags <vault-dir> --apply # tag enrichment
uv run scripts/link_cleanup.py <vault-dir> --apply # link cleanup
uv run scripts/cleanup.py <vault-dir> [schema.json] # preview bounded description repair
uv run scripts/cleanup.py <vault-dir> [schema.json] --apply # atomic repair before enforce/graph
| Script | Purpose |
|---|---|
| common.py | Shared: parse FM, walk, domain, decay (Ebbinghaus), wikilinks |
| discover.py | Workflow 1: scan vault, output enum candidates |
| generate_schema.py | Workflow 1: turn discovery JSON into draft schema |
| swarm_prepare.py | Workflow 1: bin-pack vault into agent batches |
| swarm_reduce.py | Workflow 1: consolidate + validate schema |
| enforce.py | Workflow 1: validate + autofix against schema |
| cleanup.py | Preflight: bounded-memory repair for bug-bloated descriptions |
| link_cleanup.py | Workflow 1/4: remove phantom wikilinks from ## Related |
| enrich.py | Workflow 1/4: tags + swarm-links (catalog-oriented link enrichment) |
| dedup.py | Workflow 1: safe merge + .trash/ |
| graph.py | Workflow 2/4: health score, link repair, backlinks, orphans |
| moc.py | Workflow 2: MOC generation per domain |
| orchestrate.py | Workflow 5: multi-agent orchestration (health, bootstrap, dedup-review, link-enrich, graph-analyze) |
| engine.py | Workflow 2/3: decay (Ebbinghaus), touch (graduated), creative, stats, init |
| search.py | Workflow 3/4: ranked memory search (BM25 FTS5 + link-graph rerank) — dedup-first lookup |
| supersede.py | Workflow 3: deterministic same-entity conflict scan → .graph/supersede-candidates.json |
| daily.py | Entity extraction from memory files |
| tests/test_autograph.py | Self-contained tests (temp fixtures) |
| File | In package? | Purpose |
|---|---|---|
| schema.example.json | Yes | Template — copy and customize (includes domain_rates) |
| schema.json | No | Your vault's schema (generated) |
| schema.local.json | No | Local override (gitignored) |
| references/ | Yes | Bootstrap workflow, schema docs, card templates, linking protocol |
| Mistake | Fix |
|---|---|
| Skipping agent swarm in Phase 2 | CRITICAL: always run Step 2B. Script alone cannot classify unstructured content. No exceptions. |
Using deprecated links subcommand | links was removed (0.3% match rate). Only swarm-links is available — 81.6% match rate. |
| Creating cards without linking | Always follow Workflow 3 — link to hub + 2 siblings immediately. Orphan cards are wasted knowledge. |
| Creating a near-duplicate instead of updating | Workflow 3 Step 0 — search.py/grep first. Same subject → UPDATE or SUPERSEDE the existing card, never a second one. |
| Two contradictory current values on one subject | SUPERSEDE: rewrite the current value (Compiled Truth), move the old one to append-only ## History. Never leave both standing. |
| Touching archive cards to active directly | Use graduated recall — touch promotes one tier at a time (archive→cold→warm→active). |
| Running whole-file tools on a giant card | Run cleanup.py first; enforce.py skips files over 10 MiB and reports them. |
| Sending full vault to one agent | Use swarm_prepare.py — bin-packs into ~50K token batches. |
| Running Wave 2 without Wave 1 | swarm_reduce.py prepare needs JSONL in .graph/swarm/classifications/. |
| Using schema.example.json directly | Run discover → generate your own schema.json |
| Description = title repeat | Write specific search snippet |
| Status not in enum | Check schema's node_types |
| Skip dry run | Always run without --apply first |
| Running link enrich before dedup | Creates links to files that get merged/trashed. Dedup first. |
| Missing OPENROUTER_API_KEY | enrich.py reads from OPENROUTER_API_KEY env var. |
| Only running swarm-links once | Run again with --force to enrich ALL files. |
| Command | Default model | Override |
|---|---|---|
| tags | google/gemini-3-flash-preview | --model flag |
| swarm-links | google/gemini-2.0-flash-001 | --model flag |
Both are production-tested. Do not change defaults without benchmarking.
Error: Schema not found → Create schema.json from discover output, or pass path: enforce.py vault/ my-schema.json
Score drops after enforce → New files without frontmatter. Run engine.py init vault/
Dedup picks wrong canonical → Content richness wins. Enrich the right file first, re-run.
Low match rate on swarm-links (<60%) → Check if LLM returns paths instead of stems. Try --force for second pass.
swarm-links shows 0 matched for some batches → Usually network errors. Results are cached — rerun and only failed batches retry.
evals/evals.json (opens in a new tab)references/bootstrap-workflow.md (opens in a new tab)references/card-templates.md (opens in a new tab)references/daily-processor.md (opens in a new tab)references/integrity.md (opens in a new tab)references/schema-reference.md (opens in a new tab)references/update-in-place.md (opens in a new tab)schema.example.json (opens in a new tab)scripts/cleanup.py (opens in a new tab)scripts/common.py (opens in a new tab)scripts/daily.py (opens in a new tab)scripts/dedup.py (opens in a new tab)scripts/discover.py (opens in a new tab)scripts/enforce.py (opens in a new tab)scripts/engine.py (opens in a new tab)scripts/enrich.py (opens in a new tab)scripts/generate_schema.py (opens in a new tab)scripts/graph.py (opens in a new tab)scripts/link_cleanup.py (opens in a new tab)scripts/moc.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub smixs/autograph --plugin autographOther plugins' skills for the same job