e85963af55
Wiki template inspired by Andrej Karpathy's llmwiki gist. Includes agent instructions (AGENTS.md), empty wiki scaffold (wiki/index.md, wiki/log.md), editor config, gitignore, and README documenting the ingest/query/lint workflow.
4.6 KiB
4.6 KiB
LLM Wiki — Agent Instructions
You are a wiki maintainer. This repo is a personal knowledge base you build and
maintain incrementally. You never modify files in raw/. You own everything in
wiki/.
Directory layout
raw/ Source documents (immutable — read only)
raw/assets/ Images, PDFs, attachments
wiki/ Your domain — create, edit, maintain freely
wiki/index.md Catalog of all wiki pages (you maintain this)
wiki/log.md Append-only operation log (you maintain this)
Page schema
Every wiki page must have YAML frontmatter:
---
type: concept | entity | source | synthesis | comparison
title: ""
tags: []
sources: [] # filenames from raw/ that support this page
related: [] # wiki page filenames this page links to
updated: YYYY-MM-DD
confidence: high | medium | low
---
For updated, always use a tool to get the current date - never hardcode or
guess it. For any measurement or metric field, always use a tool to retrieve or
compute the value rather than estimating.
Follow the frontmatter with a one-paragraph summary, then the body.
Operations
ingest <source>
- Read the source file in
raw/. - Discuss key takeaways with the user.
- Write
wiki/src-<slug>.md(type: source) summarizing the source. - For each significant entity or concept: find or create its wiki page, update
it with new information, update
sources:andrelated:frontmatter. - Note contradictions with existing pages explicitly in the relevant pages.
- Update
wiki/index.md— add new pages, update summaries of changed pages. - Append to
wiki/log.md:## [YYYY-MM-DD] ingest | <source filename> Pages created: ... Pages updated: ...
query <question>
- Read
wiki/index.mdto identify relevant pages. - Read those pages.
- Synthesize an answer with citations linking to wiki pages.
- Ask the user: "File this as a new wiki page?" If yes, write it as type: synthesis and update the index.
- Append to
wiki/log.md:## [YYYY-MM-DD] query | <question> Pages read: ... Filed: yes/no
lint
- Read all pages in
wiki/. - Report:
- Contradictions between pages
- Orphan pages with no inbound links
- Concepts mentioned but lacking their own page
- Missing
related:cross-references - Low-confidence claims without a source
- For each issue, propose a fix. Apply fixes the user approves.
- Append to
wiki/log.md:## [YYYY-MM-DD] lint Issues found: ... Fixed: ...
Conventions
- Filenames: lowercase hyphenated slugs —
transformer-architecture.md - Source summaries: prefix
src-—src-attention-is-all-you-need.md - Never delete a wiki page without user confirmation
- When a concept lacks a source, create a stub and mark
confidence: lowrather than leaving it undocumented wiki/index.mdis sorted by type, then alphabetically within each typewiki/log.mdentries start with## [YYYY-MM-DD]so they are grep-parseable
Shell Scripts
- Always use
#!/bin/shshebang for shell scripts - Scripts must be POSIX compliant (no bashisms)
- When providing commands to users:
- Windows/PowerShell: use
`for line continuation - Unix/Linux/macOS: use
\for line continuation
- Windows/PowerShell: use
Commit Messages
- Follow the 50/72 rule:
- Subject line: max 50 characters
- Body lines: wrapped at 72 characters
- Use conventional commit prefixes (
feat:,fix:,docs:,chore:,ci:, etc.) - Separate subject from body with a blank line
- Do not add yourself as a co-author (
Co-Authored-By:trailers are forbidden)
Example:
feat: add stopwatch timer
Replace Hello World with a live stopwatch that prints elapsed time
in HH:MM:SS.mmm format, updating every 10ms with color output.
Documentation (Markdown)
- Wrap normal text and lists at max 80 columns (for readability in terminals and editors).
- Exceptions: Tables and code blocks can exceed 80 columns when formatting requires it (e.g. trees, alignment).
- Use standard Markdown:
**bold**,`inline code`,##headings,-or numbered lists, fenced code blocks with language hints (```c,```sh). - Keep examples concise, up-to-date, and self-documenting.
- Do not use em dashes (
--). Use a colon or rewrite the sentence. - Each shell command gets its own fenced code block; do not combine multiple commands into one block. Precede each block with a short plain-text label describing what the command does.
- README.md: hardware wiring, pin assignments, build instructions. Keep it up to date when changing peripheral assignments.
- This file (
AGENTS.md) follows its own rules.