diff --git a/.gitignore b/.gitignore index b61942b..a813930 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ secrets/ # ── Documented examples (commit these) ── !.env.example !config/supervisor/CLAUDE.md +!brain/CLAUDE.md # IDE .idea/ diff --git a/brain/CLAUDE.md b/brain/CLAUDE.md new file mode 100644 index 0000000..f63a8ef --- /dev/null +++ b/brain/CLAUDE.md @@ -0,0 +1,154 @@ +# Brain Wiki Schema + +This document defines the three page types in the brain wiki. +The LLM must follow this schema exactly when generating wiki pages. + +## Wikilink Format + +All cross-references use `[[slug|Display Text]]`. + +Rules: +- slug = lowercase filename without .md, spaces → hyphens, strip all non-alphanumeric except hyphens +- The `|` separator is REQUIRED — never use `[[Title]]` without a slug +- Examples: `[[domain-driven-design|Domain Driven Design]]`, `[[ryan-singer|Ryan Singer]]` +- Slugs must resolve to an existing file in the inventory, or a file you are creating in this response + +Slug generation examples: +- "Domain Driven Design" → `domain-driven-design` +- "It's Complicated" → `its-complicated` +- "gRPC" → `grpc` +- "GPT-4o" → `gpt-4o` + +## Domains + +Use one of: `ai-llm`, `software-engineering`, `product-strategy`, `finance-markets`, +`personal`, `consulting`, `climate`, `infrastructure`, `security` + +--- + +## Source Pages — wiki/sources/.md + +One page per ingested source. Books are NEVER split across multiple source pages — update the existing one. + +Required frontmatter: +```yaml +title: +type: article | pdf | book | video | note | project +domain: +date_ingested: YYYY-MM-DD +last_updated: YYYY-MM-DD +aliases: + - +``` + +Body sections (in this order): + +### Summary +2–3 sentences. Core argument or finding. + +### Key Claims +Bulleted list. Paraphrase — no verbatim quotes or code. + +### Concepts Introduced or Reinforced +Wikilinks to wiki/concepts/ ONLY. One per line. + +### Entities Mentioned +Wikilinks to wiki/entities/ ONLY. One per line. + +### Open Questions Raised +Gaps or follow-up questions from this source. + +For books only, also add: + +### Chapters +One bullet per chapter with 1–2 sentence summary. + +### Argument Arc +Overall narrative as it becomes clear across chapters. + +### Updates +Dated entries appended on re-ingestion. NEVER rewrite — only append. + +--- + +## Concept Pages — wiki/concepts/.md + +One page per idea, framework, methodology, or pattern. + +Required frontmatter: +```yaml +title: +domain: +last_updated: YYYY-MM-DD +aliases: + - +``` + +Body sections (in this order): + +### Definition +One-paragraph plain-language explanation. + +### Why It Matters +Practical significance. Why should anyone care? + +### Related Concepts +Wikilinks to wiki/concepts/ ONLY. + +### Related Entities +Wikilinks to wiki/entities/ ONLY. + +### Sources +Wikilinks to wiki/sources/ ONLY. + +### Evolving Notes +Updated as new sources arrive. Append, do not rewrite. + +--- + +## Entity Pages — wiki/entities/.md + +One page per person, tool, organisation, technology, or product. + +Required frontmatter: +```yaml +title: +type: person | company | tool | model | framework | technology +domain: +last_updated: YYYY-MM-DD +aliases: + - +``` + +Body sections (in this order): + +### Description +One-line description. + +### Relevance +Why this entity matters to this knowledge base. + +### Key Positions, Products, or Claims +With dates where known. + +### Related Concepts +Wikilinks to wiki/concepts/ ONLY. + +### Related Entities +Wikilinks to wiki/entities/ ONLY. + +### Sources +Wikilinks to wiki/sources/ ONLY. + +--- + +## Non-Negotiable Rules + +1. Output ONLY a valid JSON array — no markdown fences, no prose before or after +2. Each element: `{"path": "wiki//.md", "content": "...full markdown..."}` +3. Slugs are kebab-case: lowercase, spaces→hyphens, strip special characters +4. Every wikilink must be `[[slug|Display Text]]` — the pipe separator is required +5. Dates always YYYY-MM-DD +6. Never reproduce verbatim code — describe the pattern or technique +7. Section links must match their section type (Related Concepts → concepts/ only, etc.) +8. One source page per book — if inventory shows it exists, include it as an UPDATE