Pyrite is a knowledge infrastructure platform — Knowledge-as-Code for humans and AI agents.
This project has a comprehensive knowledge base in kb/ indexed by Pyrite's own tools. Use the CLI to get context before and during work — it's faster and cheaper than reading files manually.
# Search for anything — architecture, decisions, components, backlog items
.venv/bin/pyrite search "<topic>" -k pyrite
# Semantic search (finds conceptually related content, not just keyword matches)
.venv/bin/pyrite search "<question>" -k pyrite --mode semantic
# Get a specific entry by ID
.venv/bin/pyrite get <entry-id> -k pyrite
# Browse project structure
.venv/bin/pyrite sw components # Core modules and services
.venv/bin/pyrite sw adrs # Architecture Decision Records
.venv/bin/pyrite sw backlog # All backlog items with status
.venv/bin/pyrite sw standards # Coding standards and conventions
# Find what links to something
.venv/bin/pyrite backlinks <entry-id> -k pyrite
# Browse by tag
.venv/bin/pyrite tags -k pyrite- Starting work on a feature: Search for the backlog item, related ADRs, and component docs
- Understanding architecture:
pyrite sw componentsandpyrite sw adrs - Finding related code:
pyrite search "<module or pattern>" -k pyrite --mode hybrid - Checking what's been decided:
pyrite search "<topic>" -k pyrite— ADRs and design docs will surface - Before modifying shared files: Search for the file path to see what docs reference it
When your work changes architecture, adds components, or completes backlog items:
# Sync index to pick up file changes
.venv/bin/pyrite index sync
# Create new entries using proper types
.venv/bin/pyrite create -k pyrite -t component --title "..." -b "..." --tags core
.venv/bin/pyrite create -k pyrite -t backlog_item --title "..." -b "..." --tags enhancement
# Create new ADRs
.venv/bin/pyrite sw new-adr --title "..." --status accepted
# Verify your changes are findable
.venv/bin/pyrite search "<your feature>" -k pyrite
.venv/bin/pyrite index healthUse correct type frontmatter so plugin tools can find entries:
type: component(withkind,path,owner,dependencies) —pyrite sw componentstype: adr(withadr_number,status,date) —pyrite sw adrstype: backlog_item(withkind,status,priority,effort) —pyrite sw backlogtype: standard—pyrite sw standards
- Core code:
pyrite/— CLI, server, storage, services, plugins, models - REST API:
pyrite/server/api.py(factory + deps) +pyrite/server/endpoints/(per-feature modules) - MCP server:
pyrite/server/mcp_server.py(3-tier tools) - Extensions:
extensions/— zettelkasten, social, encyclopedia, software-kb, journalism-investigation, cascade - Web frontend:
web/— SvelteKit + Svelte 5 - Knowledge base:
kb/— ADRs, backlog, components, designs, standards, runbooks
dev— daily development (default branch). All work happens here.main— stable releases only. Merge from dev requires passing CI.- Deploy demo.pyrite.wiki from
dev, capturecascade.org frommaintags. - See
.claude/skills/pyrite-dev/SKILL.mdfor release and deploy commands.
# Backend tests (~2700 tests)
.venv/bin/pytest tests/ -v
# Frontend
cd web && npm run build && npm run test:unit
# Linting
ruff check pyrite/Do NOT use isolation: "worktree" for parallel agents. Worktree merges are fragile and expensive — conflict markers, regex group mismatches, and stray artifacts cost more tokens than Edit retries.
Instead, launch agents without isolation. They work directly on the current branch (dev). Use file footprint planning to minimize collisions. When agents share a file, the Edit tool's exact-match replacement fails gracefully on conflict — the agent retries with the updated content. This is cheaper and self-correcting.
Read .claude/skills/pyrite-dev/parallel-agents.md before launching parallel agents. It has the full protocol: wave planning, file footprint validation, agent prompt templates, and merge steps.
Ruff, ruff-format, trailing-whitespace, end-of-file, check-yaml, check-large-files, check-merge-conflict, debug-statements, and pytest run automatically. If ruff-format modifies files, re-stage and commit again.