Triage

From BEKO2210/Firstbrain · View interactive version

Triage is an AI agent skill from the GitHub repository BEKO2210/Firstbrain. Classify inbox notes by type, auto-tag high-confidence items, and propose folder moves for review

How to use this skill

Skill file

/triage -- Inbox Triage

Intelligent inbox classification that reads each note's full content, assigns a type with confidence level, auto-applies metadata for high-confidence items, and proposes structural moves for user review. Follows the three-tier action model mapped directly to vault governance zones (AUTO / PROPOSE / NEVER).

The inbox should not be a dumping ground. /triage transforms unorganized inbox notes into properly classified, tagged, and filed knowledge -- respecting governance by auto-applying only safe metadata changes and proposing structural changes for review.

Usage

/triage              # Triage all inbox notes
/triage --dry-run    # Show classifications only, no changes applied

Classification Approach

Claude reads each inbox note's full content and uses its own reasoning to determine the note type. There is no NLP library or keyword matching -- classification relies on Claude's understanding of the content in context.

Classification signals (strongest to weakest):

  1. Headings structure -- e.g., ## Installation, ## Usage suggests tool; ## Pros, ## Cons suggests decision
  2. Content patterns -- e.g., code blocks suggest code-snippet; meeting attendees and action items suggest meeting; personal reflection suggests zettel
  3. Existing partial frontmatter -- if type: is already set, trust it; if tags: exist, use them as classification hints
  4. File naming patterns -- e.g., Book -- prefix strongly signals resource, Tool -- signals tool, Decision -- signals decision, Person -- signals person
  5. Links and tags already present -- shared tags with existing notes of a known type provide classification context

Claude combines these signals to assign both a type and a confidence score. Strong, unambiguous signals (e.g., file named Tool -- Docker.md with installation instructions) yield high confidence. Weak or conflicting signals yield low confidence.

Confidence Levels and Governance Mapping

| Confidence | Score | Governance Zone | Action |

|------------|-------|-----------------|--------|

| High | >= 0.8 | AUTO | Fill missing frontmatter (type, created, tags). Log to changelog. |

| Medium | 0.5 - 0.8 | PROPOSE | Present classification and target folder. Wait for user approval before applying changes. |

| Low | < 0.5 | REVIEW | Show the note with Claude's best guess. No action taken. User decides. |

Score calculation guidance:

Execution Flow

Claude follows these steps when /triage is invoked:

  1. Ensure fresh indexes: Call ensureFreshIndexes('.') from create-utils to rebuild indexes if stale (> 5 min).
  1. Load vault index: Read .claude/indexes/vault-index.json using loadJson.
  1. Get inbox notes: Call getInboxNotes('.', vaultIndex) from triage-utils.cjs to collect all notes in 00 - Inbox/ that need triage (excluding Daily Notes, templates, and the Inbox.md file itself).
  1. Empty inbox check: If no inbox notes are found, report: "Inbox is clear -- nothing to triage." and stop.
  1. Classify each note. For each inbox note, Claude reads the full content and determines:
  1. Present triage results grouped by confidence level:
  1. Apply AUTO actions: For high-confidence items, call applyFrontmatterFix() from triage-utils.cjs to fill missing frontmatter fields (type, created, tags). These are safe metadata changes within the AUTO governance zone.
  1. Collect user decisions on PROPOSED items. Present medium-confidence classifications for user review. After user approval, execute approved moves via moveNote() from triage-utils.cjs.
  1. Re-scan: Call scan('.') from scanner.cjs after all modifications to update vault indexes.
  1. Log actions to .claude/changelog.md -- record which notes were auto-tagged and which were moved.

Dry-run mode

When --dry-run is specified, skip steps 7-10. Show all classifications and proposed actions without applying any changes. This lets the user preview triage results before committing.

Governance

This skill maps directly to the vault's three governance zones:

AUTO (do it, log it)

Actions that /triage performs automatically for high-confidence items:

These are identical to the governance rule "fill missing frontmatter fields" -- safe metadata changes that never alter meaning.

PROPOSE (ask first)

Actions that /triage presents for user approval:

Medium-confidence items always go through PROPOSE regardless of action type.

NEVER (hard boundaries)

Actions that /triage will never perform:

Output Format

Example of a typical triage report:

## Inbox Triage -- 5 notes

**Auto-applied** (high confidence)
- [[Docker Notes]] -- type: tool, tags: [docker, containers] -> filled frontmatter
- [[Meeting with Sarah]] -- type: meeting, created: 2026-03-05 -> filled frontmatter

**Proposed** (medium confidence)
- Move [[Docker Notes]] from Inbox to 03 - Resources/? (tool)
- Move [[Meeting with Sarah]] from Inbox to 01 - Projects/? (meeting)

**Needs Review** (low confidence)
- [[Random Thoughts]] -- could be zettel or daily? Please classify.

Approve proposed moves? (yes/no/select)

Notes:

Edge Cases

Utility Module

File: triage-utils.cjs

Provides inbox scanning, frontmatter fixing, and file operation functions used during the execution flow:

const { getInboxNotes, applyFrontmatterFix, moveNote, getTargetFolder } = require('./.agents/skills/triage/triage-utils.cjs');

Function Signatures

getInboxNotes(vaultRoot, vaultIndex)

Collects all notes in 00 - Inbox/ that need triage. Excludes Daily Notes subfolder, the Inbox.md file itself, and templates. Reads full file content for each qualifying note. Returns array of objects with path, name, content, frontmatter, tags, headings, links, hasType, and hasTags.

applyFrontmatterFix(vaultRoot, notePath, updates)

Modifies frontmatter fields on a note file (AUTO zone action). If no frontmatter exists, inserts a new block at the top. If frontmatter exists, updates/adds specified fields without disturbing other fields or the note body. Returns { applied: true, fields: [...] }.

moveNote(vaultRoot, sourcePath, targetFolder)

Moves a note file from one folder to another (PROPOSE zone -- only call after user approval). Checks for filename collision at target. Returns { moved: true, from, to } on success or { moved: false, reason } on collision.

getTargetFolder(type)

Returns the canonical target folder for a given note type. Delegates to create-utils.cjs getTemplateInfo for consistent mapping. Returns folder string or null for unknown types.

Dependencies

Limitations

Connections

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.