bengous/agents-skills/second-brain

Claude Code and agent skill by bengous/agents-skills

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

USER-INVOKED ONLY. Invoke only when the user runs $second-brain or explicitly names this skill. Stand up and maintain an agent-maintained markdown wiki that loads progressively and stays bounded: a thin always-loaded index plus a recent-window journal, with the source catalog, sealed period archives, and synthesis pages pulled only on demand. Triggers: the user invokes $second-brain; wants to set up a second brain, knowledge base, agent memory, or LLM wiki; or a memory/log/notes file has grown large and is reloaded in full every session and they want it windowed and bounded. Not for a handful of notes, and not for a million-document corpus (that is a search/RAG problem). Never invoke implicitly.

Install

npx vskill@latest install bengous/agents-skills/second-brain

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as bengous/agents-skills/second-brain.

Second Brain

Stand up and maintain a markdown wiki an agent keeps for itself — one that loads progressively and stays bounded no matter how large it grows.

The model in one paragraph

A finite attention budget means you cannot load the whole knowledge base every session, so split it with a single loading boundary. Eager (loaded every session): a thin index.md that maps the wiki, plus the recent window of journal.md. On demand (pulled only when a link is followed): the source catalog.md, everything under raw/ and pages/, and the sealed archives under log/. The eager set is small and fixed; it does not grow as the wiki grows, because the index links to content instead of inlining it. That boundary is the whole idea — everything below serves it.

When to use this

  • The user invokes $second-brain, or asks to set up a second brain / knowledge

base / agent memory / LLM wiki.

  • A memory, log, or notes file has grown large and is reloaded in full every

session — the symptom this fixes is "one giant file is eating my context".

When not to:

  • A handful of notes (two or three files). Plain files are lighter; say so and stop.
  • A corpus of millions of documents nobody curated. That is a search / RAG

problem; this pattern is for a hand-curated base (see references/limits.md).

Structure

index.md eager: thin map, links to pages, names the content dirs
journal.md eager: recent-window activity log + Archives pointers
catalog.md on demand: one line per raw/ source
SCHEMA.md the maintenance contract (generic mechanics + your domain rules)
raw/ on demand: immutable dated captures and long traces
pages/ on demand: maintained synthesis pages
log/ on demand: sealed period archives (log/YYYY-MM.md)
scripts/ check-wiki.sh, archive-journal.sh

Workflow A — Setup (new wiki)

  1. Load references/setup-guide.md.
  2. Scaffold: scripts/init-wiki.sh <target-dir>. It refuses a non-empty target

without --force, so it never writes over existing content.

  1. Personalize SCHEMA.md — keep the generic mechanics, add domain rules under

the line at the bottom.

  1. Wire scripts/check-wiki.sh into a hook (portable pre-commit by default; a

Claude Code Stop hook in addition when relevant). See the setup guide.

  1. Run scripts/check-wiki.sh — it should print wiki check OK.

Workflow B — Maintenance (existing wiki, or one that has bloated)

  1. Diagnose the bloat: which file is loaded eagerly and large? Usually a fat

index that inlines a catalogue, or a journal that never gets windowed.

  1. Thin the index: move any inlined catalogue or content out of index.md into

catalog.md or a page, leaving one-line links behind.

  1. Window the journal: scripts/archive-journal.sh seals the oldest whole months

into log/YYYY-MM.md and leaves a pointer. Re-run is a no-op once bounded.

  1. Load references/maintenance-protocol.md for the ingest / query / lint cycle

and the anti-orphan invariant.

  1. Run scripts/check-wiki.sh and fix any orphan it reports.

Scripts: run them, do not reimplement them

The scripts are deterministic and bundled so every invocation does not re-derive them. Execute them; read their output, not their source.

  • init-wiki.sh <dir> [--force] — scaffold from templates.
  • check-wiki.sh — anti-orphan + index-integrity lint, plus frontmatter checks

(updated: format as an error, index freshness as a warning) that no-op on files without frontmatter. Run from the wiki root (or via its hook). A non-zero exit means an orphan, a missing required file, or a malformed date.

  • archive-journal.sh [threshold_bytes] — seal old months out of the journal.

Gates

  • Never scaffold over existing content. init-wiki.sh refuses a non-empty

directory without --force; do not reach for --force to overwrite a real wiki without the user confirming.

  • Never rewrite a sealed archive. log/YYYY-MM.md files are immutable;

archive-journal.sh refuses to touch one that exists. Growth goes into new files, never edits of old ones.

  • The index links, never inlines. If you are about to paste content into

index.md, put it in a page and link instead.

References — load on demand, not all at once

  • references/loading-model.md — the tiers and the loading boundary in depth;

why imports don't bound context and on-demand reads do. Load when deciding what goes eager vs on-demand.

  • references/maintenance-protocol.md — ingest / query / lint, rollover, the

anti-orphan invariant, freshness. Load when maintaining an existing wiki.

  • references/setup-guide.md — scaffolding steps and how to wire the check

(portable vs Claude Code). Load during setup.

  • references/limits.md — where the model stops scaling (when to shard the index,

add a search CLI, or — only at very large scale — reach for RAG) and when not to use this pattern at all. Load when hitting scale limits.

  • references/scaling-up.md — the graduated architecture as a case study: full

typed page contract, registry-driven lint CLI, federated wikis, three-tier memory, multi-agent projection. Load when a wiki outgrows the baseline.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bengous/agents-skills/second-brain/badge)](https://verified-skill.com/skills/bengous/agents-skills/second-brain)

Something wrong with this skill or its page? Tell us.