/secondbrain:secondbrain-entityfrom secondbrain
Creates custom entity types with schema validation and VitePress integration for secondbrain projects. Guides users through defining fields, ID formats, and status workflows.
Ships in secondbrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create custom entity types with schema validation and VitePress integration.
Verify secondbrain is initialized:
.claude/data/config.yamlsecondbrain-init firstCollect from user:
PREFIX-XXXX)YYYY-MM-DD-slug)Create .claude/data/<entity>/schema.yaml:
type: object
required: [records]
properties:
last_number:
type: integer
description: Last assigned sequential number
records:
type: array
items:
type: object
required: [id, title, created, file]
properties:
id:
type: string
description: Unique identifier
title:
type: string
description: Display title
created:
type: string
format: date
file:
type: string
description: Path to markdown file
status:
type: string
enum: [active, archived]
# ... custom fields
Create .claude/data/<entity>/records.yaml:
last_number: 0
records: []
Create templates/entities/<entity>/TEMPLATE.md:
---
id: {{id}}
title: {{title}}
created: {{date}}
status: active
# ... custom fields
---
# {{title}}
## Overview
[Description]
## Details
[Content]
Create docs/.vitepress/data/<entity>.data.ts:
import { defineLoader } from 'vitepress'
import fs from 'fs'
import yaml from 'js-yaml'
interface Record {
id: string
title: string
created: string
file: string
status: string
// ... custom fields
}
export interface Data {
records: Record[]
lastNumber: number
}
declare const data: Data
export { data }
export default defineLoader({
watch: ['.claude/data/<entity>/*.yaml'],
async load(): Promise<Data> {
const recordsPath = '.claude/data/<entity>/records.yaml'
if (!fs.existsSync(recordsPath)) {
return { records: [], lastNumber: 0 }
}
const content = fs.readFileSync(recordsPath, 'utf-8')
const parsed = yaml.load(content) as any
return {
records: parsed.records || [],
lastNumber: parsed.last_number || 0
}
}
})
Create docs/<entity>/index.md:
---
title: <Entity> Index
---
# <Entity>
<script setup>
import { data } from '../.vitepress/data/<entity>.data'
import EntityTable from '../.vitepress/theme/components/EntityTable.vue'
const columns = [
{ key: 'id', label: 'ID', sortable: true },
{ key: 'title', label: 'Title', sortable: true },
{ key: 'created', label: 'Created', sortable: true },
{ key: 'status', label: 'Status', sortable: true }
]
</script>
<EntityTable :data="data.records" :columns="columns" />
Add entity to .claude/data/config.yaml:
entities:
<entity>:
enabled: true
singular: <singular>
id_format: sequential # or date-based, uuid
prefix: PREFIX # for sequential IDs
freshness:
stale_after_days: 30
fields:
- name: field_name
type: string
required: true
Add to docs/.vitepress/config.ts sidebar:
{
text: '<Entity>',
collapsed: true,
items: [
{ text: 'Overview', link: '/<entity>/' }
]
}
## Entity Created
**Name:** <entity>
**Singular:** <singular>
**ID Format:** sequential (PREFIX-XXXX)
**Status Tracking:** Yes
### Fields
| Field | Type | Required |
|-------|------|----------|
| title | string | Yes |
| description | string | No |
| priority | enum (low, medium, high) | No |
### Files Created
- `.claude/data/<entity>/schema.yaml`
- `.claude/data/<entity>/records.yaml`
- `docs/.vitepress/data/<entity>.data.ts`
- `docs/<entity>/index.md`
### Next Steps
1. Create records using the new entity type
2. Add entity-specific skills if needed
3. Customize the index page layout
| Type | YAML Schema | Example |
|---|---|---|
| string | type: string | "Hello world" |
| integer | type: integer | 42 |
| number | type: number | 3.14 |
| boolean | type: boolean | true/false |
| date | type: string, format: date | 2026-01-15 |
| datetime | type: string, format: date-time | 2026-01-15T10:30:00Z |
| array | type: array, items: {...} | [tag1, tag2] |
| enum | type: string, enum: [...] | "active" |
Best for: Tasks, tickets, numbered records
PREFIX-0001, PREFIX-0002, PREFIX-0003
Best for: Notes, journal entries, time-sensitive content
2026-01-15-meeting-notes
2026-01-15-architecture-review
Best for: Globally unique, import/export scenarios
550e8400-e29b-41d4-a716-446655440000
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
11 skills in this plugin
/secondbrain-adrThis skill should be used when the user asks to "create ADR", "document decision",
"architecture decision", "add decision record", or mentions needing to record a
technical decision with status tracking and category organization.
/secondbrain-discussionThis skill should be used when the user asks to "document discussion", "save meeting notes",
"record conversation", "capture meeting", or mentions needing to document team discussions
with participants, decisions, and action items.
/secondbrain-freshnessThis skill should be used when the user asks for "freshness check", "freshness report",
"what needs attention", "stale items", "review backlog", or mentions wanting to see
what secondbrain content needs review or updating.
npx claudepluginhub sergio-bershadsky/ai --plugin secondbrainOther plugins' skills for the same job