Use when modifying sparks plugin, debugging hooks, adding knowledge categories, or understanding how knowledge capture works
Trigger: sparks, /learn, /find, knowledge, registry Confidence: high Created: 2025-01-18 Updated: 2025-01-18 Version: 2
Sparks is a knowledge capture and retrieval system for Claude Code projects. It solves the problem of context loss between sessions - when you debug something hard, discover a gotcha, or establish a pattern, that knowledge usually dies with the conversation.
Sparks captures durable knowledge as project-scoped skills that Claude automatically discovers and loads when relevant. Think of it as building institutional memory for your codebase.
| Problem | How Sparks Helps |
|---|---|
| Debugging the same issue twice | Gotchas captured, auto-loaded next time |
| "Why did we do it this way?" |
| Decisions + rationale preserved |
| New feature, no context | Feature dossiers explain architecture |
| Onboarding (human or AI) | Patterns and procedures documented |
| Knowledge siloed in conversations | Extracted into searchable, loadable skills |
After spending time debugging a tricky issue:
/learn the JWT refresh token was failing because...
Creates a gotcha that loads automatically when someone hits similar symptoms.
After implementing or understanding a feature:
/learn how the auth system works
Creates a feature dossier with flows, key files, and common tasks.
After making a significant choice:
/learn we chose Redis over Postgres for sessions because...
Preserves the rationale so future you (or teammates) don't reverse it blindly.
Before diving into unfamiliar code:
/find auth
Searches registry, loads relevant skills into context before you start.
/learn)/learn with optional topic/find or sparks-find skill)/find {query} or Claude loads sparks-find skillSkill({skill-name}){{project}}/.claude/skills/
├── sparks-find/
│ ├── SKILL.md # Find skill (generated, embedded registry)
│ └── references/
│ └── registry.toon # Registry source of truth
├── {category}-{slug}/ # Each learning = one skill
│ └── SKILL.md
└── ...
plugins/sparks/
├── skills/
│ ├── learn/
│ │ ├── SKILL.md # Capture workflow
│ │ └── references/
│ │ └── find-template.md # Template for project find skill
│ └── apply/
│ └── SKILL.md # Compliance (fallback for non-hook agents)
└── hooks/scripts/
├── load-knowledge.py # SessionStart - injects registry
└── register_spark.py # Creates registry + find skill
# registry.toon
{skill-name}|{category}|{triggers}|{description}
Example:
feature-auth-flows|feature|auth, login, JWT|Use when implementing or debugging authentication
gotchas-hook-timeout|gotchas|hook, timeout, silent|Use when hooks fail without error output
| Category | When to Use |
|---|---|
| feature | End-to-end feature knowledge (flows, architecture, key files) |
| gotchas | Hard-won debugging insights, non-obvious pitfalls |
| patterns | Repeatable solutions used across codebase |
| decisions | Architectural choices + rationale |
| procedures | Multi-step processes (deploy, release, migrate) |
| integration | Third-party APIs, vendor quirks |
| performance | Optimization learnings, benchmarks |
| testing | Test strategies, coverage decisions |
| ux | Design patterns, interaction conventions |
| strategy | Roadmap decisions, prioritization rationale |
user-invocable: false - skills don't clutter /skill list but agent loads via Skill toolregister_spark.py keeps find skill in sync| File | Purpose |
|---|---|
plugins/sparks/skills/learn/SKILL.md | Capture workflow - categorize, propose, write, register |
plugins/sparks/skills/learn/references/find-template.md | Template for generating project find skill |
plugins/sparks/skills/apply/SKILL.md | Compliance instructions for non-hook agents |
plugins/sparks/hooks/scripts/load-knowledge.py | SessionStart hook - reads registry, injects context |
plugins/sparks/hooks/scripts/register_spark.py | Creates/updates registry + regenerates find skill |
plugins/sparks/skills/learn/SKILL.md.claude/skills/sparks-find/references/registry.tooncd /project && python3 plugins/sparks/hooks/scripts/load-knowledge.pysystemMessage and additionalContext/learn in project with a topic.claude/skills/{category}-{slug}/SKILL.md.claude/skills/sparks-find/references/registry.toon