Skip to content

About

Claude Code skill that anchors implementation work in SICP: map the task to sections, fetch them live, distill invariants, then code.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

/sicp — a SICP-grounded coding skill for Claude Code

A Claude Code skill that anchors implementation work in Structure and Interpretation of Computer Programs (2nd edition). Before writing non-trivial code, the agent maps the task to relevant SICP sections, fetches them live, distills the engineering lessons (invariants, costs, abstraction barriers), and only then implements.

The book becomes part of the program that writes programs — a read–map–fetch–apply loop, not a quote dump.

Install from a prompt

Copy everything inside the block below and paste it into Claude Code. It clones this repo into your skills directory and smoke-tests the section fetcher — no manual steps.

Set up the /sicp skill for Claude Code. Do every step yourself in the shell; do not tell me what to run.

Repo: https://github.com/cdiak/slash-sicp
Install dir: ~/.claude/skills/sicp

Steps:
1. If ~/.claude/skills/sicp is already a clone of this repo, pull latest. If it exists but is something else, move it to ~/.claude/skills/sicp.bak first. Otherwise git clone into that path.
2. chmod +x ~/.claude/skills/sicp/scripts/fetch-section.sh
3. Smoke test: run ~/.claude/skills/sicp/scripts/fetch-section.sh 1.1.4 and confirm it prints section text (needs curl, python3, and network).
4. Report: install path, whether the fetch worked, and that /sicp will be available in new sessions.

If the smoke test fails, diagnose and fix before reporting done.

After it finishes, run /sicp <task> in a fresh session.

How it works

On each invocation the skill runs a mandatory loop:

  1. READ — parse the task into computational concepts (state, abstraction, evaluation, data representation, concurrency, streams, …).
  2. MAP — look up 1–3 section ids in references/task-index.md, an anchor-first index of all 129 SICP sections tagged with engineering tasks and consult-when triggers.
  3. FETCH — pull each section as plain text from the live sarabander HTML edition via scripts/fetch-section.sh.
  4. DISTILL — emit a short SICP constraints block: concepts, invariants to uphold, failure modes the section warns about.
  5. APPLY — implement, preferring the smallest correct decomposition.
  6. CLOSE — end with Applied: §x.y.z, tying the diff back to the lesson.

You can also pin sections yourself: /sicp 3.1.3 fix playback state bug.

Manual install

Copy (or clone) this repo into your Claude Code skills directory:

git clone https://github.com/cdiak/slash-sicp ~/.claude/skills/sicp

Then invoke it in any session with /sicp <task>, or let Claude trigger it automatically for state/abstraction work, interpreter and DSL design, or decomposition problems.

Contents

File Role
SKILL.md The skill definition and the READ→MAP→FETCH→DISTILL→APPLY→CLOSE loop
references/task-index.md Anchor-first index: engineering tasks and triggers for every section
references/toc.json Machine-readable TOC (ids, urls, parents)
scripts/fetch-section.sh Fetch one section as plain text
scripts/generate-references.py Regenerate the TOC and task index from the upstream edition

Regenerating references

If the upstream TOC changes:

python3 scripts/generate-references.py

Notes

  • The book text is not vendored here; sections are fetched at runtime from the sarabander edition (CC BY-SA 4.0).
  • Pairs well with a project-layout skill: SICP supplies the why, your layout conventions supply the shape.

About

Claude Code skill that anchors implementation work in SICP: map the task to sections, fetch them live, distill invariants, then code.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages