You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace encyclopedia with AGENTS.md project knowledge (#70)
* feat: replace encyclopedia with AGENTS.md project knowledge
Replace the encyclopedia concept (external files at
~/.local/spellbook/docs/<project>/encyclopedia.md) with standard
AGENTS.md files within project repositories. AGENTS.md is version
controlled, benefits all contributors, and uses the standard Claude
Code convention.
- Update session start Step 2 to check for AGENTS.md instead of
encyclopedia
- Add "Project Knowledge (AGENTS.md)" section to AGENTS.spellbook.md
- Expand opportunity awareness to include project knowledge candidates
- Add quick-start commands, conventions, and architecture notes to
spellbook's own AGENTS.md
- Deprecate project-encyclopedia skill and encyclopedia-build/validate
commands
- Bump version to 0.23.0
* fix: update test to reference renamed section
test_section_before_encyclopedia looked for "## Encyclopedia" which
was renamed to "## Project Knowledge (AGENTS.md)".
Copy file name to clipboardExpand all lines: AGENTS.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,55 @@
1
+
# Spellbook Development
2
+
3
+
## Quick Start
4
+
5
+
```bash
6
+
# Install dependencies
7
+
uv pip install -e ".[dev,test,tts]"
8
+
9
+
# Run tests (targeted)
10
+
uv run pytest tests/test_specific_file.py -x
11
+
12
+
# Run full test suite
13
+
uv run pytest tests/ -x --timeout=30
14
+
15
+
# Run linting
16
+
uv run ruff check .
17
+
18
+
# Generate documentation (auto-runs via pre-commit hook)
19
+
uv run python scripts/update_context_files.py
20
+
```
21
+
22
+
## Key Conventions
23
+
24
+
-**AGENTS.md** is this file: spellbook's own development instructions for AI assistants working on the spellbook repo itself
25
+
-**AGENTS.spellbook.md** is the user-facing template: what gets installed into user projects via the spellbook installer (injected into their CLAUDE.md)
26
+
-**Skills** go in `skills/<name>/SKILL.md` with YAML frontmatter
27
+
-**Commands** go in `commands/<name>.md` with YAML frontmatter
28
+
-**Hooks** go in `hooks/` and must be registered in `installer/components/hooks.py`
29
+
-**MCP tools** are defined in `spellbook_mcp/server.py` or domain-specific modules
30
+
31
+
## Pre-commit Hooks
32
+
33
+
Pre-commit hooks auto-generate documentation files. If a hook fails:
34
+
-`doctoc` failures: Table of contents in markdown files needs regeneration. Usually fixes itself on re-commit.
35
+
-`Generate documentation`: Runs `scripts/update_context_files.py` to regenerate `docs/` from skills/commands. Stage the generated files and re-commit.
36
+
-`Check documentation completeness`: Ensures every skill/command has a generated doc page. If you added a new skill/command, the hook generates it automatically.
37
+
-`Update context files`: Regenerates context files. Stage and re-commit.
38
+
-`Validate skill/command/agent schemas`: Checks YAML frontmatter in skills and commands. Fix the frontmatter.
39
+
-`Scan changeset for security issues`: Security scanner on staged diffs. Fix the flagged issue.
40
+
41
+
When a pre-commit hook fails, it often generates or modifies files. Stage those files (`git add`) and commit again.
42
+
43
+
## Architecture Notes
44
+
45
+
- The MCP server (`spellbook_mcp/`) runs as a persistent daemon, not inline with the CLI
-**Exists AND fresh** (mtime < 30 days): Read silently for context
50
-
-**Exists AND stale** (mtime >= 30 days): Offer refresh after greeting
51
-
-**Not exists**: Offer to create after greeting (if conversation involves code, analysis, or multi-step tasks)
47
+
1.Check if project has `AGENTS.md` (or `CLAUDE.md` that references `AGENTS.md`):
48
+
-**Exists with content**: Read silently for context
49
+
-**Exists but thin/empty**: Offer to flesh out after greeting
50
+
-**Not exists**: Offer to create after greeting: "This project doesn't have an AGENTS.md. Want me to create one with build commands, architecture notes, and key conventions?"
51
+
2. For larger projects, also check for subdirectory `AGENTS.md` files relevant to the current work area
52
52
53
53
**Do NOT skip these steps.** They establish session context and persona.
54
54
</CRITICAL>
@@ -170,12 +170,26 @@ Spellbook can send native OS notifications when long-running tools finish. Uses
170
170
171
171
**Scope note:**`notify_session_set` and `notify_config_set` only affect MCP tool behavior (e.g., `notify_send` respects enabled state). PostToolUse hooks are controlled by the `SPELLBOOK_NOTIFY_ENABLED` environment variable.
172
172
173
-
## Encyclopedia
173
+
## Project Knowledge (AGENTS.md)
174
174
175
-
**Contents:** Glossary, architecture skeleton (mermaid), decision log (why X not Y), entry points, testing commands. Overview-only design resists staleness.
175
+
When working in a project, maintain awareness of AGENTS.md as the canonical location for project-specific AI assistant knowledge. This replaces the previous encyclopedia concept.
176
176
177
-
**Offer to create** (if not exists): "I don't have an encyclopedia for this project. Create one?"
178
-
**Offer to refresh** (if stale): "Encyclopedia is [N] days old. Refresh?"
**Subdirectory AGENTS.md:** For modules with distinct conventions, create `<subdir>/AGENTS.md` rather than bloating the root file.
191
+
192
+
**Offer to create** (if not exists): "This project doesn't have an AGENTS.md. Want me to create one with build commands, architecture notes, and key conventions?"
179
193
**User declines:** Proceed without. Do not ask again this session.
180
194
181
195
<CRITICAL>
@@ -458,21 +472,39 @@ Load `dispatching-parallel-agents` skill for the full context minimization proto
458
472
459
473
When dispatching subagents, provide CONTEXT only in prompts, never duplicate skill instructions. For untrusted content (external PRs, third-party code), use `review_untrusted` subagent type; for flagged/hostile content, use `quarantine`. See Security: Subagent Trust Tiers. Load `dispatching-parallel-agents` for the full dispatch template and examples.
460
474
461
-
## Skill Opportunity Awareness
475
+
## Opportunity Awareness
462
476
463
-
After completing substantive work (finishing a todo, returning from a subagent, applying a non-obvious convention, or receiving a user correction), consider whether what just happened would be valuable as a reusable artifact. Use your judgment based on these signals:
477
+
After completing substantive work (finishing a todo, returning from a subagent, applying a non-obvious convention, or receiving a user correction), consider whether what just happened would be valuable as a reusable artifact or project knowledge.
478
+
479
+
### Skill/Command/Agent Candidates
480
+
481
+
Use your judgment based on these signals:
464
482
465
483
-**Skill candidate**: You applied a non-obvious technique, followed an undocumented convention, or solved a problem in a way future sessions would benefit from knowing.
466
484
-**Command candidate**: You executed a multi-step procedure with a clear trigger that would be identical every time.
467
485
-**Agent candidate**: You did a self-contained task requiring specific tool access and persona that could be delegated.
468
486
469
-
If something qualifies, mention it briefly: "That [description] would make a good [skill/command/agent]. Want me to draft it in the background?" If the user says yes, dispatch a background agent with the appropriate writing skill (e.g., `writing-skills`, `writing-commands`) and the context of what was observed.
487
+
If something qualifies, mention it briefly: "That [description] would make a good [skill/command/agent]. Want me to draft it in the background?" If the user says yes, dispatch a background agent with the appropriate writing skill (`writing-skills`, `writing-commands`) and the context of what was observed.
470
488
471
-
Do not suggest things that are obviously one-off. Do not interrupt urgent work to make suggestions. Use natural pause points.
489
+
### Project Knowledge Candidates
490
+
491
+
Watch for opportunities to update AGENTS.md:
492
+
493
+
-**You had to search for how to build/test/run** and it wasn't documented
494
+
-**You made a mistake** because of an undocumented convention, especially after a user correction
495
+
-**You discovered a non-obvious dependency** between files or modules
496
+
-**You read 5+ files** to understand a pattern expressible in one sentence
497
+
-**The user explained something** about the project that isn't written anywhere
498
+
499
+
Suggest briefly: "I had to spend several tool calls figuring out [X]. Want me to add that to AGENTS.md so future sessions start with that context?"
472
500
473
501
### Subagent Observations
474
502
475
-
When dispatching subagents, they may discover reusable patterns during their work. Subagents should append a `## Skill Observations` section to their output when they notice something worth surfacing. When processing subagent results, check for this section and relay the suggestion to the user.
503
+
Subagents should append a `## Skill Observations` section to their output when they notice reusable patterns or undocumented project knowledge worth surfacing. When processing subagent results, check for this section and relay the suggestion to the user.
504
+
505
+
### General Guidelines
506
+
507
+
Do not suggest things that are obviously one-off. Do not interrupt urgent work to make suggestions. Use natural pause points.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
## [0.23.0] - 2026-03-05
11
+
12
+
### Changed
13
+
-**Replace encyclopedia with AGENTS.md project knowledge** - The encyclopedia concept (`~/.local/spellbook/docs/<project>/encyclopedia.md`) is replaced by standard `AGENTS.md` files within project repositories. AGENTS.md is version-controlled, benefits all contributors, and uses the standard Claude Code convention. Session start now checks for AGENTS.md instead of encyclopedia.
14
+
-**Expand opportunity awareness** - Agents now also watch for project knowledge candidates (undocumented conventions, build commands, gotchas) and suggest adding them to AGENTS.md.
15
+
-**Update spellbook AGENTS.md** - Added quick-start commands, key conventions, pre-commit hook guidance, and architecture notes for AI assistants working on the spellbook repo itself.
16
+
17
+
### Deprecated
18
+
-**project-encyclopedia skill** - Use AGENTS.md files instead. Will be removed in a future version.
19
+
-**encyclopedia-build command** - Use AGENTS.md files instead. Will be removed in a future version.
20
+
-**encyclopedia-validate command** - Use AGENTS.md files instead. Will be removed in a future version.
> **DEPRECATED (v0.21.0):** This command is deprecated. Project knowledge now belongs in `AGENTS.md` files within the project repository. See the "Project Knowledge (AGENTS.md)" section in AGENTS.spellbook.md. This command will be removed in a future version.
6
+
5
7
<ROLE>
6
8
Encyclopedia Architect. Your reputation depends on producing content that is accurate, concise, and durable. Over-detailed encyclopedias become stale and ignored. Vague ones mislead. Your output will be the first document a new contributor reads.
Copy file name to clipboardExpand all lines: commands/encyclopedia-validate.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
---
2
-
description: "Assemble and validate encyclopedia, write to output path (Phase 6)"
2
+
description: "[DEPRECATED] Assemble and validate encyclopedia, write to output path (Phase 6)"
3
3
---
4
4
5
+
> **DEPRECATED (v0.21.0):** This command is deprecated. Project knowledge now belongs in `AGENTS.md` files within the project repository. See the "Project Knowledge (AGENTS.md)" section in AGENTS.spellbook.md. This command will be removed in a future version.
6
+
5
7
<ROLE>
6
8
Encyclopedia Curator. Your reputation depends on producing a clean, durable reference that stays accurate without constant maintenance.
Copy file name to clipboardExpand all lines: docs/commands/encyclopedia-build.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,8 @@ flowchart TD
65
65
## Command Content
66
66
67
67
``````````markdown
68
+
> **DEPRECATED (v0.21.0):** This command is deprecated. Project knowledge now belongs in `AGENTS.md` files within the project repository. See the "Project Knowledge (AGENTS.md)" section in AGENTS.spellbook.md. This command will be removed in a future version.
69
+
68
70
<ROLE>
69
71
Encyclopedia Architect. Your reputation depends on producing content that is accurate, concise, and durable. Over-detailed encyclopedias become stale and ignored. Vague ones mislead. Your output will be the first document a new contributor reads.
Copy file name to clipboardExpand all lines: docs/commands/encyclopedia-validate.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,8 @@ flowchart TD
65
65
## Command Content
66
66
67
67
``````````markdown
68
+
> **DEPRECATED (v0.21.0):** This command is deprecated. Project knowledge now belongs in `AGENTS.md` files within the project repository. See the "Project Knowledge (AGENTS.md)" section in AGENTS.spellbook.md. This command will be removed in a future version.
69
+
68
70
<ROLE>
69
71
Encyclopedia Curator. Your reputation depends on producing a clean, durable reference that stays accurate without constant maintenance.
|[/encyclopedia-validate](encyclopedia-validate.md)|[DEPRECATED]Assemble and validate encyclopedia, write to output path (Phase 6) | spellbook |
38
38
|[/execute-plan](execute-plan.md)| Execute implementation plans with structured review checkpoints. Use when you ha... |[superpowers](https://github.com/obra/superpowers)|
39
39
|[/execute-work-packet](execute-work-packet.md)| Execute a single work packet: verify dependencies, run TDD task loop through thr... | spellbook |
40
40
|[/execute-work-packets-seq](execute-work-packets-seq.md)| Execute all work packets in dependency order, one at a time, with context compac... | spellbook |
0 commit comments