auto-brain

Generate YAML frontmatter and five Markdown sections for per-source brain files.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/Tschonsen/spec-driven-claude-development --skill auto-brain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-brain
Source: https://github.com/Tschonsen/spec-driven-claude-development/tree/main/plugin/sdcd/skills/auto-brain
Command: npx skills add https://github.com/Tschonsen/spec-driven-claude-development --skill auto-brain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write or refresh the <file>.brain summary for a source file Claude just created or edited. Use this whenever editing a source file in an SDCD project — brain files keep session context small by letting the next reader (Claude or human) grasp the file without opening the source.

Core Features & Use Cases

  • Creates an inline per-source brain file adjacent to the edited source, containing a YAML frontmatter and five Markdown sections.
  • Ensures quick grasp and reduces context-switching for future readers during SDCD workflows.
  • Use Case: When you edit src/app/main.ts, the brain file at src/app/main.ts.brain is updated with a concise summary of purpose, exports, collaborators, gotchas, and conventions.

Quick Start

Create or refresh the adjacent <source>.brain file when you edit a source file, writing YAML frontmatter with source, source_hash, model, generated_at and five Markdown sections in order.

Frequently Asked Questions about auto-brain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate context summaries for source files after editing?

To generate context summaries for source files, this tool writes or refreshes an adjacent `<file>.brain` summary containing YAML frontmatter and five Markdown sections whenever a source file is edited. It captures the file's purpose, exports, collaborators, gotchas, and conventions.

What is a brain file and how does it restore session context?

A brain file is a per-source Markdown summary with YAML frontmatter that restores session context by allowing readers to grasp a file's purpose without opening the source. It keeps session context small during SDCD workflows.

How do I keep context window size small when working with Claude on large codebases?

You can keep context window size small by generating per-file brain summaries instead of loading entire source files. This tool creates concise summaries of purpose, exports, and conventions, reducing context-switching for future readers.

Does this brain file generation tool require any external dependencies?

No external dependencies are required to generate brain files. The tool operates directly within the SDCD project environment, writing YAML frontmatter with source, source_hash, model, and generated_at fields alongside the edited source file.

When should I refresh per-file brain summaries in an SDCD project?

You should refresh per-file brain summaries whenever Claude edits or creates a source file in an SDCD project and the corresponding brain file is missing or outdated. This ensures future readers always have accurate context.

What format do the automatic brain summaries use for source file documentation?

Automatic brain summaries use a format consisting of YAML frontmatter with source, source_hash, model, and generated_at fields, followed by a fixed five-section Markdown body documenting the source file's key information.