How huytieu/cog-second-brain works
Purpose and Runtime Model
COG is a local-first, markdown-based “second brain” framework. AI coding/agent clients interpret skill playbooks, read and mutate a vault, and optionally call external integrations; Git and optional iCloud provide persistence/sync. There is no application server or database. Primary entry guidance is AGENTS.md, with client-specific roots in CLAUDE.md, GEMINI.md, and .cursorrules.
Agent-Surface Distribution
The authoritative full implementation is the Claude surface: skills and specialist-agent playbooks under .claude/skills/ and .claude/agents/. Equivalent plugin-standard skills are shipped under skills/; Antigravity has pointer stubs in .agents/; Kiro and Gemini expose a core subset via native command formats.
• .claude/skills/onboarding/SKILL.md
• skills/onboarding/SKILL.md
• .gemini/commands/onboarding.toml
Vault as the Data Boundary
User state is plaintext Markdown organized as a PARA-like vault. Skills classify incoming material, write daily/project/knowledge artifacts, and later synthesize those artifacts. Framework instructions and user content are intentionally separated so updates can replace framework files without overwriting personal data.
• 00-inbox/
• 01-daily/briefs/
• 02-personal/braindumps/
• 03-professional/braindumps/
• 04-projects/
• 05-knowledge/
Skill-Orchestrated Workflows
Skills are declarative operational entry points rather than executable application modules. They cover capture and synthesis (braindump, briefs, consolidation), team/product workflows, research, content production, and framework maintenance. The agent client supplies reasoning and tool execution; each playbook controls artifact locations, evidence expectations, and mutation rules.
• .claude/skills/braindump/SKILL.md
• .claude/skills/team-brief/SKILL.md
• .claude/skills/knowledge-consolidation/SKILL.md
• .claude/skills/update-cog/SKILL.md
Worker and Verification Pipeline
Complex work is delegated from a lead agent to focused workers. Workers perform I/O-heavy collection, research, file operations, approved external mutations, or publishing, writing detailed results to /tmp and returning a path. Independent verifiers inspect artifacts by path rather than worker narratives; fixes are bounded and harvested learning is proposal-only. This establishes a V-model: criteria/planning → build → component verification → integration/acceptance.
• .claude/agents/worker-data-collector.md
• .claude/agents/worker-executor.md
• .claude/agents/task-verifier.md
• .claude/agents/integration-verifier.md
• .claude/agents/harvest-curator.md
Knowledge Evolution and CRM
Capture and intelligence artifacts feed weekly analysis and periodic consolidation into durable knowledge. The people CRM is a specialized knowledge subsystem: profiles progressively enrich based on evidence and citations, rather than treating observations as unqualified facts.
• .claude/skills/weekly-checkin/SKILL.md
• .claude/skills/memory-hygiene/SKILL.md
• 05-knowledge/consolidated/
• 05-knowledge/people/README.md
• 06-templates/people-profile-template.md
External Boundaries, Updates, and Integrity
Optional integrations include GitHub, Linear, Slack, PostHog, Jira, Confluence, Notion, museum open-data APIs, Git, and iCloud; skills should degrade when integrations are absent. cog-update.sh updates framework content while preserving vault data. Packaging manifests expose the plugin, while validation prevents drift across distribution surfaces.
• cog-update.sh
• scripts/validate-agent-surface.sh
• plugin.json
• .claude-plugin/plugin.json
• docs/AGENT-SUPPORT.md
Main entry points: onboarding/SKILL.md Claude skill playbooks · braindump/SKILL.md Capture & synthesis skills · onboarding/SKILL.md Plugin-standard skills · team-brief/SKILL.md Team & maintenance skills
Components 20
Agent surfaces
Instructions and playbooks consumed by AI clients.
- Primary agent guidance
AGENTS.md - Client-specific roots
CLAUDE.md - Claude skill playbooks · Authoritative operational implementation.
.claude/skills/onboarding/SKILL.md - Plugin-standard skills
skills/onboarding/SKILL.md - Gemini commands · Exposes a core skill subset.
.gemini/commands/onboarding.toml - Capture & synthesis skills · Classify, create, and synthesize vault artifacts.
.claude/skills/braindump/SKILL.md - Team & maintenance skills
.claude/skills/team-brief/SKILL.md
Orchestration
Delegation and independent verification for complex work.
- Lead agent · Supplies reasoning, tool use, and workflow coordination.
- Focused workers · Collect, execute approved mutations, and publish; return result paths.
.claude/agents/worker-executor.md - Worker result files · Detailed worker outputs written for path-based review.
- Independent verifiers · Inspect artifacts rather than worker narratives.
.claude/agents/task-verifier.md - Harvest curator · Produces proposal-only learning from completed work.
.claude/agents/harvest-curator.md
User vault
Plaintext Markdown state, separated from framework files.
- Inbox & daily artifacts
- Project artifacts
- Durable knowledge · Receives periodic consolidation.
- People CRM · Profiles enrich only with cited evidence.
05-knowledge/people/README.md
Distribution & integrity
Framework update, packaging, and surface-drift controls.
- Framework updater · Replaces framework content while preserving user vault data.
cog-update.sh - Surface validation · Prevents drift across distributed agent surfaces.
scripts/validate-agent-surface.sh - Plugin manifest
plugin.json
Other components
- Optional integrations · GitHub, Linear, Slack, Git, iCloud, and other optional sources degrade gracefully.
Connections 24
- Primary agent guidance → Client-specific roots: routes clients to
- Client-specific roots → Claude skill playbooks: loads
- Claude skill playbooks → Plugin-standard skills: is distributed as
- Claude skill playbooks → Gemini commands: core subset exposed through
- Claude skill playbooks → Capture & synthesis skills: includes
- Claude skill playbooks → Team & maintenance skills: includes
- Capture & synthesis skills → Lead agent: directs
- Team & maintenance skills → Lead agent: directs
- Lead agent → Focused workers: delegates complex work
- Focused workers → Worker result files: writes detailed results
- Worker result files → Independent verifiers: reviewed by path
- Independent verifiers → Lead agent: returns bounded fixes
- Independent verifiers → Harvest curator: completed work informs
- Capture & synthesis skills → Inbox & daily artifacts: captures and writes
- Capture & synthesis skills → Project artifacts: creates project artifacts
- Inbox & daily artifacts → Durable knowledge: weekly analysis and consolidation
- Project artifacts → Durable knowledge: synthesized into
- Durable knowledge → People CRM: supplies evidence
- Team & maintenance skills → Optional integrations: optionally calls
- Framework updater → Claude skill playbooks: updates framework content
- Framework updater → Plugin-standard skills: updates framework content
- Surface validation → Claude skill playbooks: checks surface parity
- Surface validation → Plugin-standard skills: checks surface parity
- Plugin manifest → Plugin-standard skills: packages