Managing Artifacts
Invariant Principles
- Never litter projects: Generated artifacts go to
~/.local/spellbook/, never project directories
- Respect shared repos: Multi-contributor projects use fallback paths to avoid polluting the repo
- Consistent encoding: Always use project-encoded paths for organization
Standard Directory Structure
~/.local/spellbook/
├── docs/<project-encoded>/ # All generated docs for a project
│ ├── encyclopedia.md # Project overview for agent onboarding (deprecated)
│ ├── plans/ # Design docs and implementation plans
│ │ ├── YYYY-MM-DD-feature-design.md
│ │ └── YYYY-MM-DD-feature-impl.md
│ ├── audits/ # Test audits, code reviews, etc.
│ │ └── auditing-green-mirage-YYYY-MM-DD-HHMMSS.md
│ ├── understanding/ # Feature understanding documents
│ │ └── understanding-feature-YYYYMMDD-HHMMSS.md
│ └── reports/ # Analysis reports, summaries
│ └── simplify-report-YYYY-MM-DD.md
├── distilled/<project-encoded>/ # Emergency session preservation
│ └── session-YYYYMMDD-HHMMSS.md
└── logs/ # Operation logs
└── review-pr-comments-YYYYMMDD.log
Project Encoded Path Generation
# Find outermost git repo (handles nested repos like submodules/vendor)
_outer_git_root() {
local root=$(git rev-parse --show-toplevel 2>/dev/null)
[ -z "$root" ] && { echo "NO_GIT_REPO"; return 1; }
local parent
while parent=$(git -C "$(dirname "$root")" rev-parse --show-toplevel 2>/dev/null) && [ "$parent" != "$root" ]; do
root="$parent"
done
echo "$root"
}
PROJECT_ROOT=$(_outer_git_root)
PROJECT_ENCODED=$(echo "$PROJECT_ROOT" | sed 's|^/||' | tr '/' '-')
# Result: "Users-alice-Development-myproject"
If NO_GIT_REPO: Ask user to init, or use fallback: ~/.local/spellbook/docs/_no-repo/$(basename "$PWD")/
NEVER Write To
| Path |
Why |
<project>/docs/ |
Project docs are for project documentation |
<project>/plans/ |
Reserved for project planning |
<project>/reports/ |
Reserved for project reports |
<project>/*.md |
Except CLAUDE.md when explicitly requested |
Project-Specific CLAUDE.md
Fallback Lookup
If project has no CLAUDE.md, check: ~/.local/spellbook/docs/<project-encoded>/CLAUDE.md
Open Source Project Handling
Detection (any of):
- Has
upstream git remote
- Multiple authors (
git shortlog -sn | wc -l > 1)
- Has CONTRIBUTING.md
- Is a fork
When user asks to "add X to CLAUDE.md" for such a project:
- Detect if open source/multi-contributor
- Write to fallback location instead
- Inform user: "This appears to be a shared repository. Added to ~/.local/spellbook/docs/..."
Quick Reference
| Artifact Type |
Location |
| Design docs |
~/.local/spellbook/docs/<project>/plans/YYYY-MM-DD-feature-design.md |
| Impl plans |
~/.local/spellbook/docs/<project>/plans/YYYY-MM-DD-feature-impl.md |
| Audits |
~/.local/spellbook/docs/<project>/audits/ |
| Reports |
~/.local/spellbook/docs/<project>/reports/ |
| Encyclopedia (deprecated) |
~/.local/spellbook/docs/<project>/encyclopedia.md |
| Session distill |
~/.local/spellbook/distilled/<project>/ |
| Logs |
~/.local/spellbook/logs/ |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: axiomantic-spellbook-managing-artifacts3description: Managing Artifacts4---56# Managing Artifacts78<ROLE>9Artifact Organization Specialist. Your reputation depends on keeping projects clean and artifacts findable. Littering project directories with generated files is a cardinal sin.10</ROLE>1112<CRITICAL>13ALL generated documents, reports, plans, and artifacts MUST be stored outside project directories.14This prevents littering projects with generated files and keeps artifacts organized centrally.15</CRITICAL>1617## Invariant Principles18191. **Never litter projects**: Generated artifacts go to `~/.local/spellbook/`, never project directories202. **Respect shared repos**: Multi-contributor projects use fallback paths to avoid polluting the repo213. **Consistent encoding**: Always use project-encoded paths for organization2223<analysis>24Before writing any artifact, determine:25- What type of artifact is this? (plan, audit, report, etc.)26- What is the project-encoded path?27- Is this a multi-contributor project requiring fallback location?28</analysis>2930<reflection>31After artifact operations, verify:32- File was written to correct spellbook directory, not project directory33- Path follows naming conventions (YYYY-MM-DD prefix, etc.)34- User was informed of file location35</reflection>3637## Standard Directory Structure3839```40~/.local/spellbook/41├── docs/<project-encoded>/ # All generated docs for a project42│ ├── encyclopedia.md # Project overview for agent onboarding (deprecated)43│ ├── plans/ # Design docs and implementation plans44│ │ ├── YYYY-MM-DD-feature-design.md45│ │ └── YYYY-MM-DD-feature-impl.md46│ ├── audits/ # Test audits, code reviews, etc.47│ │ └── auditing-green-mirage-YYYY-MM-DD-HHMMSS.md48│ ├── understanding/ # Feature understanding documents49│ │ └── understanding-feature-YYYYMMDD-HHMMSS.md50│ └── reports/ # Analysis reports, summaries51│ └── simplify-report-YYYY-MM-DD.md52├── distilled/<project-encoded>/ # Emergency session preservation53│ └── session-YYYYMMDD-HHMMSS.md54└── logs/ # Operation logs55 └── review-pr-comments-YYYYMMDD.log56```5758## Project Encoded Path Generation5960```bash61# Find outermost git repo (handles nested repos like submodules/vendor)62_outer_git_root() {63 local root=$(git rev-parse --show-toplevel 2>/dev/null)64 [ -z "$root" ] && { echo "NO_GIT_REPO"; return 1; }65 local parent66 while parent=$(git -C "$(dirname "$root")" rev-parse --show-toplevel 2>/dev/null) && [ "$parent" != "$root" ]; do67 root="$parent"68 done69 echo "$root"70}71PROJECT_ROOT=$(_outer_git_root)72PROJECT_ENCODED=$(echo "$PROJECT_ROOT" | sed 's|^/||' | tr '/' '-')73# Result: "Users-alice-Development-myproject"74```7576**If NO_GIT_REPO:** Ask user to init, or use fallback: `~/.local/spellbook/docs/_no-repo/$(basename "$PWD")/`7778## NEVER Write To7980| Path | Why |81|------|-----|82| `<project>/docs/` | Project docs are for project documentation |83| `<project>/plans/` | Reserved for project planning |84| `<project>/reports/` | Reserved for project reports |85| `<project>/*.md` | Except CLAUDE.md when explicitly requested |8687## Project-Specific CLAUDE.md8889### Fallback Lookup9091If project has no `CLAUDE.md`, check: `~/.local/spellbook/docs/<project-encoded>/CLAUDE.md`9293### Open Source Project Handling9495<RULE>96For multi-contributor projects, NEVER add instructions to `<project>/CLAUDE.md`.97Write to `~/.local/spellbook/docs/<project-encoded>/CLAUDE.md` instead.98</RULE>99100**Detection (any of):**101- Has `upstream` git remote102- Multiple authors (`git shortlog -sn | wc -l > 1`)103- Has CONTRIBUTING.md104- Is a fork105106When user asks to "add X to CLAUDE.md" for such a project:1071. Detect if open source/multi-contributor1082. Write to fallback location instead1093. Inform user: "This appears to be a shared repository. Added to ~/.local/spellbook/docs/..."110111## Quick Reference112113| Artifact Type | Location |114|--------------|----------|115| Design docs | `~/.local/spellbook/docs/<project>/plans/YYYY-MM-DD-feature-design.md` |116| Impl plans | `~/.local/spellbook/docs/<project>/plans/YYYY-MM-DD-feature-impl.md` |117| Audits | `~/.local/spellbook/docs/<project>/audits/` |118| Reports | `~/.local/spellbook/docs/<project>/reports/` |119| Encyclopedia (deprecated) | `~/.local/spellbook/docs/<project>/encyclopedia.md` |120| Session distill | `~/.local/spellbook/distilled/<project>/` |121| Logs | `~/.local/spellbook/logs/` |122123<FORBIDDEN>124- Writing generated artifacts to project directories125- Creating docs/, plans/, reports/ folders inside projects126- Adding instructions to CLAUDE.md in multi-contributor repos127- Using relative paths instead of project-encoded paths128- Skipping the open source detection check129</FORBIDDEN>130131<FINAL_EMPHASIS>132Every artifact you generate belongs in `~/.local/spellbook/`, not in the project. A clean project is a professional project. There is no excuse for littering — not haste, not convenience, not ambiguity.133</FINAL_EMPHASIS>134135---136> Converted and distributed by [TomeVault](https://tomevault.io/claim/axiomantic) — claim your Tome and manage your conversions.137<!-- tomevault:4.0:skill_md:2026-04-13 -->