---
name: second-brain
description: Set up, audit or open the viewer of a Claude Code "second brain" for any project or area of life - an app, a codebase, a business, research, a book, a job search, a course, a home renovation. Creates a short CLAUDE.md map (150 lines max), a focus file, a decision log, folder rules and grouped skills shaped around the person's own work, so Claude never needs the project re-explained. Use when the user asks to create, start, scaffold or set up a second brain, project memory or CLAUDE.md, or to check/audit/clean up an existing one, or to open, show, view or visualize their second brain (the interactive viewer).
title: second-brain
canonical_url: https://skilld.dev/gh/owlinthebarnai/second-brain-kit/second-brain
last_updated: 2026-11-12T06:31:07.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [interview.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/interview.md), [presets.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/presets.md), [principles.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/principles.md), [templates/core/CLAUDE.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/CLAUDE.md), [templates/core/decisions.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/decisions.md), [templates/core/dot-claude/skills/rhythm/review.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/dot-claude/skills/rhythm/review.md), [templates/core/dot-claude/skills/rhythm/session-close.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/dot-claude/skills/rhythm/session-close.md), [templates/core/dot-claude/skills/rhythm/SKILL.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/dot-claude/skills/rhythm/SKILL.md), [templates/core/gitignore](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/gitignore), [templates/core/projects/now.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/projects/now.md), [templates/core/README-HOW-TO-USE.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/core/README-HOW-TO-USE.md), [templates/INDEX.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/INDEX.md), [templates/modules/area/_template.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/area/_template.md), [templates/modules/area/rules.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/area/rules.md), [templates/modules/money/ledger.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/money/ledger.md), [templates/modules/publishing/drafts-README.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/publishing/drafts-README.md), [templates/modules/publishing/rules.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/publishing/rules.md), [templates/modules/skill-group/playbook.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/skill-group/playbook.md), [templates/modules/skill-group/SKILL.md](https://skilld.dev/api/skills-raw/owlinthebarnai/second-brain-kit/second-brain/templates/modules/skill-group/SKILL.md).
>
> If the user asked to install this Skill, run `npx skilld install owlinthebarnai/second-brain-kit/second-brain`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/second-brain`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/owlinthebarnai/second-brain-kit/second-brain) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/second-brain`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/second-brain --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/second-brain --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Second brain

Three modes. Pick from the request; if unclear, ask.

| If the user wants to... | Do |
|---|---|
| Create a second brain (new or existing folder) | "Create" below |
| Check, audit or clean up an existing one | "Audit" below |
| Open, show, view or visualize it; stop the viewer | "View" below |

Before anything else, read principles.md in this folder. Every file you write must follow it.

A second brain has a fixed **core** and a **shape** that comes from the person's work. Never force a shape: no weeks, builds, posts or learning notes unless the answers call for them.

## Create

1. **Where.** Ask for the target folder (default: current directory). List what is already there. Never overwrite an existing file: merge into it or skip it, and say which. If it is a code repository, the brain goes in its root and must not disturb the code (see presets.md, "Codebase").
2. **Interview.** Read interview.md and ask its questions in ONE message. Accept short or messy answers. Use the defaults for anything skipped; never invent facts about the person or the project.
3. **Design the shape** from the answers (interview.md, "From answers to shape"). presets.md has starting points for common cases; use one only as inspiration and rename everything to the person's own words.
4. **Plan, then wait.** Show:
   - the file tree
   - each area folder and what one file in it is
   - each skill group, its playbooks, and the phrase that triggers each one
   - the "Always true" rules you will write
   - the modules left out, and why
   Then stop and wait for an explicit OK. Do not write files before that.
5. **Write the files.**
   - Copy everything in templates/core/.
   - For each area, use templates/modules/area/ (a folder _template.md, plus a rules file if the area has its own rules).
   - For each skill group, use templates/modules/skill-group/.
   - Add money/ and publishing/ only if chosen.
   - `dot-claude/` becomes `.claude/` and `gitignore` becomes `.gitignore`.
   - Replace every `{{...}}` placeholder. If a value is unknown, write "unknown" or ask. Delete lines that do not apply.
6. **Check** before reporting done:
   - CLAUDE.md is 150 lines or fewer (count them). If it is longer, move folder rules into .claude/rules/ and procedures into skills.
   - CLAUDE.md imports only projects/now.md (`@projects/now.md`).
   - Every area and skill group listed in CLAUDE.md exists, and every existing one is listed.
   - Every skill entry SKILL.md has a routing table, and every playbook it names exists.
   - No `{{` is left in any file. No API keys, tokens or passwords anywhere.
   - .gitignore contains CLAUDE.local.md and .env*.
7. **Optional git.** Offer `git init` and a private repo. Never push without asking. Never commit CLAUDE.local.md.
8. **Hand over** in under 10 lines:
   - what was created
   - how to start a session: "Read projects/now.md and tell me where I stopped"
   - how to close one: "close this session" + raw notes
   - that README-HOW-TO-USE.md has the full loop
   - then ask: "Want to see it? I can open the interactive viewer." If yes, do "View".

## Audit

1. Read CLAUDE.md, projects/now.md, and everything in .claude/rules/ and .claude/skills/.
2. Report as a checklist, marking each item pass / fail / warn:
   - CLAUDE.md line count (fail over 150), and whether it is a map or a manual
   - imports other than projects/now.md (warn: they load every session)
   - rules or facts that contradict each other across files (quote both)
   - "X lives in Y" notes where Y no longer exists (stale memory)
   - folders that exist but are missing from the CLAUDE.md map, and the reverse
   - skill entry files whose playbooks are missing
   - secrets or keys in any file (fail, and do not repeat the secret in the report)
   - a "Common pitfalls" section in the format `what broke -> rule`
3. Propose fixes. Apply them only after the user says which.

## View

The viewer is an interactive map of the brain that updates by itself when files change. It ships prebuilt in this kit: no install, only Node.js (18+).

1. Find the launcher: `viewer/scripts/open.mjs`, two folders up from this skill's base directory (`<skill dir>/../../viewer/scripts/open.mjs`). If it is not there (the skill was copied without the rest of the kit), say so and point to https://github.com/owlinthebarnai/second-brain-kit.
2. Brain folder: the folder with the brain's CLAUDE.md, usually the current directory. If the current directory has no CLAUDE.md, ask which folder.
3. Run: `node "<launcher>" "<brain folder>"`. It starts the viewer in the background (or reuses one already showing this brain), opens the browser, and prints the URL. It keeps running after the session ends.
4. If `node` is not found, tell the user to install Node.js 18+ from nodejs.org, then try again.
5. Reply in 3 lines: the URL, "it updates by itself as the brain changes", and how to stop it: "say 'stop the viewer'".
6. To stop: run the launcher with `--stop "<brain folder>"`.
7. Only if the user asks for it to start at login: explain the per-OS option (Windows scheduled task, macOS launchd, Linux systemd user service) running the same command, and set it up after they say OK.
