Logo di Okf Frontmatter

Okf Frontmatter

Community
longsizhuo
okf-frontmatter

Maintain a repo's Markdown docs (wiki chapters, ADRs, references) under Google's Open Knowledge Format (OKF), and find the right doc/schema fast. Two jobs. (1) Maintain docs the OKF way — each doc carries a small YAML frontmatter block as the single source of truth (type, title, tags, intent, schema_source, documents); schema detail links to the authoritative code instead of being copied into prose, so docs stop drifting and stop ballooning into thousand-line Markdown. (2) Look docs up fast — grep the literal term FIRST; only when grep is ambiguous (hits scattered across files / synonym mismatch / zero hits) run find_docs.py to rank the doc that owns the topic by frontmatter intent, or resolve a doc's schema_source straight to the code. Trigger phrases — "which doc covers X", "find the schema this doc points to", "where is endpoint/config-key X documented", "add OKF frontmatter to this doc", "lint the docs", "scaffold a new ADR/chapter". Run: scripts/run.sh find|schema|index|lint|new (or python3 scripts/find_docs.py --repo <path> ...).

Panoramica

Pubblicato dalongsizhuo
Repositoryokf-frontmatter
Nome della skillokf-frontmatter
Stelle
43
Fork
3
File inclusi
5
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 5

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da longsizhuo su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Okf Frontmatter in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/longsizhuo/okf-frontmatter/tree/main
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/longsizhuo/okf-frontmatter.git \
  .claude/skills/okf-frontmatter
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Okf Frontmatter in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Okf Frontmatter non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Okf Frontmatter non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

okf-frontmatter

Your repo's Markdown docs (wiki chapters, ADRs, references) each start, under OKF, with a YAML frontmatter block that is the single source of truth about that doc. Tooling reads the frontmatter; humans read the prose. The goal: stop maintaining huge prose docs that duplicate what the code already says — link to the code instead, and let find_docs.py do navigation.

Point the script at a repo with --repo <path>, or just run it from inside that repo (it auto-detects the nearest ancestor containing docs/wiki/, else uses the working dir). It is read-only except for docs you explicitly edit. The conventions below use openInvest as the worked example, but the mechanics (find / schema / lint) work on any repo whose markdown carries OKF frontmatter.


Job 1 — maintain docs the OKF way

The rule of thumb: frontmatter is structured truth; prose is explanation. Anything that is a schema (a Pydantic model, a dataclass, a config key, an endpoint contract) lives in code — the doc points to it via schema_source / documents, it does not re-type it. When the code changes, lint tells you which doc's pointer went stale. Don't grow a doc past a few screens of "why / how it fits together"; if you're copying field tables out of code, stop and add a schema_source pointer instead.

Frontmatter schema

Common to every doc:

fieldrequiredmeaning
type✅wiki-chapter | adr | index | reference | report | readme
titlerec.human title (usually the H1)
tagsopt.[api, rest, ...] — coarse categories
intentopt.one short phrase the lookup ranks on, e.g. API Contract, 决策参数, 部署
schema_sourceopt.list of relpath:Symbol pointers to the authoritative code, e.g. connectors/web_api/models.py:PortfolioResponse
documentsopt.{endpoints: [GET /api/x], config_keys: [a.b], symbols: [Foo]} — concrete things this doc covers

ADR-only (lifecycle):

fieldmeaning
statusproposed | accepted | superseded (normalizes the old **状态** line)
datedecision date
supersedes / superseded_byADR ids, e.g. [010]

Relationships between docs stay as ordinary markdown links in the body (that's the OKF knowledge graph). supersedes/superseded_by are typed mirrors lint cross-checks.

Adding / changing a doc

  • Scaffold: run.sh new <type> <name> prints a frontmatter skeleton to stdout — paste it at the top of the new file, fill it in.
  • Fill schema_source/documents from the code the doc describes (grep connectors/web_api/models.py, core/schemas.py, core/config/).
  • Run run.sh lint before committing — fix any error (broken link / dangling pointer / missing type).

See references/conventions.md for the full schema + the "no thousand-line prose" rule, and references/okf-spec.md for what OKF is.


Job 2 — find the right doc fast (grep first, script as fallback)

find_docs.py is not the first move. grep is. The script only pays off when grep can't tell you which doc is authoritative.

1. grep the literal term first (ripgrep) — zero script overhead.
2. grep is decisive? → read that doc, done.
   "decisive" = the term hits one file, or hits a heading / frontmatter (that doc owns it).
3. grep is ambiguous? → run.sh find <query>
   "ambiguous" = hits scattered across ≥3 files / only in prose / 0 hits (synonym mismatch).

Why: on a clean literal hit, grep is already optimal and the script just adds a call. The win comes from not calling the script on easy queries — so don't run both in parallel. The script's real value is matching intent, not strings: it ranks the doc whose frontmatter owns the symbol/endpoint/config-key first, even when the literal keyword is buried. Full decision tree + the benchmark behind it: references/lookup-strategy.md.

Commands

commanduse
run.sh find <query>symbol (PortfolioResponse), endpoint (GET /api/holdings), config key (verdict.risk_profile), intent/tag, or keyword → ranked owning docs (JSON, strongest match first)
run.sh schema <doc>resolve a doc's schema_source and print the real code definitions — read the authoritative schema without opening the prose
run.sh index [--cache]dump the whole frontmatter index as JSON (--cache writes docs/.okf-index.json)
run.sh lint [--ci]OKF compliance + drift; --ci exits non-zero only on errors (un-migrated docs are info, never a failure)
run.sh new <type> <name>print a frontmatter skeleton

References

filewhen to read
references/okf-spec.mdwhat the Open Knowledge Format is (the 1-page version)
references/conventions.mdthis repo's frontmatter schema + maintenance rules
references/lookup-strategy.mdthe grep-first / script-fallback decision tree + benchmark

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Okf Frontmatter?

Maintain a repo's Markdown docs (wiki chapters, ADRs, references) under Google's Open Knowledge Format (OKF), and find the right doc/schema fast. Two jobs. (1) Maintain docs the OKF way — each doc carries a small YAML frontmatter block as the single source of truth (type, title, tags, intent, schema_source, documents); schema detail links to the authoritative code instead of being copied into prose, so docs stop drifting and stop ballooning into thousand-line Markdown. (2) Look docs up fast — grep the literal term FIRST; only when grep is ambiguous (hits scattered across files / synonym mis...

Perché usare Okf Frontmatter su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Okf Frontmatter è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Okf Frontmatter in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/longsizhuo/okf-frontmatter/tree/main. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Okf Frontmatter?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Okf Frontmatter?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Okf Frontmatter: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Okf Frontmatter è gratuita?

Sì. È pubblicata su GitHub da longsizhuo con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇