---
name: foundations-spells
description: >-
  Use when researching, completing, or migrating Foundations Spells corpus entries
  via MCP — franchises, spells, queue, runs, health, stage/publish — admin only.
---

# Foundations Spells (agent)

Allowlist host: `foundations.tensegrity.works`. **Admin Foundations account required.** All Spells tools cost **0 credits**. Do not write Notion after cutover.

## When to use

Sourced cinematic spell catalog: franchise-scoped stubs → written entries → visual/motion gates → PixelFX handoff. Not Elements UI encyclopedia. Not Personas councils.

## Start every run

1. `spells_rules_get` — hub rules SoT in D1
2. `spells_meta` — section ids, motion classes, checklist
3. `runs_start` → `queue_reset_stale`

## Research loop

| Phase | Tools |
| --- | --- |
| A stubs | `franchises_list` / `franchises_upsert`, `queue_list` / `queue_claim`, `spells_upsert` stage `stub` |
| B write | `spells_section_put`, `spells_sources_put` (`fetched_at` + `http_status`), `spells_completeness_check`, `spells_promote` |
| C enrich | `spells_pick` (`visual` \| `motion`), fill motion/visual fields, promote when checklist green |
| Finish | `queue_release` / status updates, `runs_finish` with `phase_summary` |

Prefer `spells_section_put` for gap-fill. Prefer Known absent over invention. Never invent gestures, colors, or second-precision timings.

## Completeness

Eight sections: `overview`, `mechanics`, `visual`, `motion`, `gestures`, `effects`, `variants`, `open_questions`.

Promote Complete / Visual Ready / Motion Staging Ready only when checklist passes (`spells_promote` rejects otherwise). Cone/beam/zone need `flow_pattern` unless Known absent.

## Ops / migrate

| Tool | Purpose |
| --- | --- |
| `spells_health` | Compendium Health aggregates (same as `/apps/admin/spells`) |
| `spells_stage` / `spells_publish` / `spells_versions` / `spells_restore` | Catalog versioning on R2 |
| `spells_rules_put` | Append new rules version (never silent overwrite) |
| `franchises_coverage_recompute` | After bulk load |

## Caps and stops

- Stop if tools are missing (non-admin) or `SPELLS_DB` unbound.
- Queue mutations require claim; stale >6h → Queued.
- Dual-write window: Spells D1 is write SoT; do not treat Notion as authority after freeze.
- Auth-gated docs: `GET /docs/spells`. Skill also at this path on the Worker.

## Notes

- Install: copy this folder to `.agents/skills/foundations-spells/` and paste AGENTS.snippet.md into project rules.
- Health UI: https://foundations.tensegrity.works/apps/admin/spells
- Migrate runbook: repo `docs/spells-migrate-runbook.md`

Live skill URL: https://foundations.tensegrity.works/skills/foundations-spells/SKILL.md
AGENTS snippet: https://foundations.tensegrity.works/skills/foundations-spells/AGENTS.snippet.md