ag-second-brain
Use when querying, searching, updating, or adding notes in the Obsidian second brain without fabricating details.
- License 许可
- MIT
- 最近更新
- 2026-08-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ag-second-brain
- layer
- helper
- description
- Use when querying, searching, updating, or adding notes in the Obsidian second brain without fabricating details.
- trigger_keywords
- second, brain
02 资源文件 1
- 脚本scripts/search_brain.mjs4.6 KB
03 SKILL.md 正文
Second Brain QA & Explainer Skill
This skill allows the agent to search the local Obsidian second brain using a dedicated script, extract matching notes, and answer user queries with absolute accuracy by citing specific local notes as sources.
When to Apply
- The user asks for an explanation, summary, or definition of any technical concept, SOP, workflow, or vocabulary term.
- You need to verify if a specific topic or rule is documented in the second brain before answering.
- The user explicitly requests searching, updating, adding knowledge, or ducing drafts/inbox notes.
- The user wants to clean up the inbox or migrate raw notes into structured Atomic Notes.
How to Use
To query the second brain for a specific topic, execute the search script:
bun /home/ngxc/workspace/agent-skills-kit/.agents/skills/ag-second-brain/scripts/search_brain.mjs "<query>"
Knowledge Modification & Creation Guidelines
- Search Before Edit: Run the search script to check if the concept already exists. Avoid creating duplicate notes for the same concept.
- Updating Existing Notes:
- Maintain the strict 5-part structure (Frontmatter, TL;DR, Core Concept, Concrete Examples, Related Notes).
- Run
bun 99_Meta/Scripts/validate_notes.mjs <file_path>after editing.
- Creating Inbox Notes:
- Save temporary drafts or raw incoming notes directly to
00_Inbox/<filename>.md. These do not require strict frontmatter or section templates initially.
- Save temporary drafts or raw incoming notes directly to
- Migrating Inbox to Atomic Notes:
- Read the raw note from
00_Inbox/. - Apply the Litmus Test: If actionable (SOP, scripts, guidelines), place in
30_Resources/Methods/. If cognitive (theory, definitions), place in30_Resources/Concepts/or30_Resources/Tech/. - Structure the note into the 5-part Atomic Note format.
- Add backlinks to relevant MOCs (
000_Tech_MOC,000_Concepts_MOC, or000_Methods_MOC) and register the link inside those MOC files. - Run validation script on the new file:
bun 99_Meta/Scripts/validate_notes.mjs <new_file_path>. - Once successfully validated, delete the raw note from
00_Inbox/.
- Read the raw note from
- Creating Workflow Documentation:
- When creating or editing workflow docs in
second-brain/Docs/<Topic>/, follow the SSOT Workflow Documentation Standard atprocess/development-protocols/references/workflow-documentation-standard.md(viaag-docsskill design mode). - Use
docType: feature-workflowordocType: infrastructure-workflow. - Use PascalCase with Underscores file naming:
PascalCase_With_Underscores_Workflow.md(e.g.,Register_User_Workflow.md). - Use Codebase Memory MCP graph tools (
search_graph,trace_path,get_code_snippet) to extract grounded code symbols and avoid hallucinated routes or DTOs.
- When creating or editing workflow docs in
- Flashcard Creation & SRS Guidelines:
- Directory Structure: Store flashcard files under
50_Flashcards/<DeckName>/(e.g.,50_Flashcards/Backend/or50_Flashcards/Vocabulary/CV/). Yanki automatically derives the Anki deck name from the folder path. - File Format Constraints:
- Frontmatter: Omit standard atomic note tags to skip standard validation. Keep only the
noteIdin the YAML block (e.g.,--- \n noteId: 12345 \n ---) to preserve Anki's review history and avoid duplicate cards. - No Headings: Never write
# Titleheadings in the body of the markdown, as Yanki renders headings into the Anki card content. - Separator Spacing: The thematic break
---separating front and back content must be surrounded by an empty line both above and below it.
- Frontmatter: Omit standard atomic note tags to skip standard validation. Keep only the
- Supported Yanki Card Syntax:
- Basic:
Front content --- Back content - Reversed with Extra: Use a double
---to create a reversible card (twice the cards). A third---defines an "Extra" section visible on the back of both generated cards:Term / Concept A --- --- Definition / Concept B --- Extra context shown on both sides - Cloze Deletion: Hide terms with double tildes
~~, adding optional_italics_inside for hints:All will be ~~revealed _hint text_~~. - Advanced Cloze Numbering: Group clozes to reveal simultaneously by adding a number inside the cloze:
~~1 Grouped A~~ and ~~1 Grouped B~~. - Type-in-the-Answer: Emphasize the last line with
_italics_to force a spelling text-input check in Anki:Spell the term: _spelling_
- Basic:
- Directory Structure: Store flashcard files under
Response Guidelines
- Exact Extraction: Read the source note paths returned by the script and use their content (like
## TL;DRorCore Concept) to answer. - Mandatory Citations: Always reference the source note path or link (e.g.,
[[Note_Name]]or30_Resources/Concepts/Path/Note_Name.md) at the end of your explanation. - No Fabrication: If the script returns
NO_MATCHES_FOUNDor if the matching notes do not contain the answer, you MUST explicitly state: "Kiến thức này không có trong second-brain." Do not guess, hallucinate, or use external/pretrained LLM knowledge to answer the query.
References
04 同仓库更多 Skills
zustand
Rules and standards for state management using Zustand in React and Next.js. Use when implementing client-side stores, persistence with localStorage, or preventing SSR hydration mismatch.
zod
Zod v4 schema validation best practices. Use when defining schemas, utilizing safeParse, or customizing error messages.
upstash-ratelimit
Rules, standards, and references for rate limiting in serverless environments using Upstash Ratelimit. Use when implementing rate limiting, configuring Upstash Redis, or handling request blocking.
ui-design
UI/UX and frontend design best practices guidelines (formerly frontend-design). This skill should be used when writing, reviewing, or designing frontend code to ensure accessibility, performance, and usability. Triggers on tasks involving HTML structure, CSS styling, responsive layouts, form design, animations, or accessibility improvements.
typescript
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.
typescript-refactor
TypeScript and TSX refactoring and modernization guidelines from a principal specialist perspective, current to TypeScript 6.0 and React 19. This skill should be used when refactoring, reviewing, or modernizing TypeScript or React/TSX code for type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving type architecture, narrowing, generics, discriminated unions, error handling, React component and hook typing, or migration to modern TypeScript features (satisfies, using, const type parameters, inferred type predicates, isolatedDeclarations, erasable syntax, import attributes).