# Spellbook

> Demo skill for "The Dark Arts of Skill Engineering." A tiny, readable scaffold that shows five dark arts in miniature: routing (this file), a script that talks back (scripts/context.mjs), a hook that fights back (scripts/hook.mjs), making sub-agents argue (reference/argue.md), and forcing divergence (reference/diverge.md). Use when the user types /spellbook <command>, or asks to argue, diverge, or set up the demo.

- Skill: `pbakaus/spellbook` (Agent Skill, multi-file: 10 files)
- Install (CLI): `npx skillmds@latest add pbakaus/spellbook`
- Raw SKILL.md: https://api.skillmd.com/api/skills/pbakaus/spellbook/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: Apache-2.0
- Author: pbakaus (https://skillmd.com/u/pbakaus)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/pbakaus/spellbook

---


# Spellbook (starter)

The workshop build: a **pocket Impeccable** you assemble as the talk climbs. It
critiques and re-imagines `sample/landing.html` (a deliberately-median page)
using five dark arts in miniature. It runs as-is; every art has a `YOUR TURN`
marker where you extend it. Read it top to bottom, then make it yours.

## Setup (always do this first)

DARK ART · *the script talks back.* Do not guess the project state. Run:

```bash
node scripts/context.mjs
```

**Follow whatever it prints.** The script reads the environment (git branch,
whether a NOTES.md exists) and returns a fresh, in-thread directive. That
directive outranks anything written statically below, because it is shaped to
the exact situation. If it prints `NO_NOTES`, create `NOTES.md` first. If it
prints `READY`, continue.

## Commands (the router)

DARK ART · *route like a frontier model.* This file is a thin router. Do not
inline the technique here; load the one expert reference the command needs, and
nothing else, so context stays cheap.

| Command                     | Load this, then follow it |
|-----------------------------|---------------------------|
| `/spellbook argue [page]`   | `reference/argue.md`      |
| `/spellbook diverge [page]` | `reference/diverge.md`    |

`[page]` defaults to `sample/landing.html`. If no command is given, ask which one
the user wants. Never run both references at once.

## The hook (already working, even when this skill is not invoked)

DARK ART · *hooks that fight back.* `scripts/hook.mjs` runs after every file
edit (wire it up via `.claude/settings.json`, see `README.md`). It scans the
touched file for a banned pattern and injects a system-reminder. You do not
invoke it; it watches. Try editing a file to include `TODO: fix later` and
watch it push back.

