diff --git a/05-agents/README.md b/05-agents/README.md index cab6a47..e7e5947 100644 --- a/05-agents/README.md +++ b/05-agents/README.md @@ -47,6 +47,7 @@ For the system-level architecture diagram, skill interaction matrix, and canonic | Skill | Target Workspace | Primary Capability | Status | | :--- | :--- | :--- | :--- | +| [Inbox Curation](skills/inbox-curation/README.md) | Brain (`/home/kiskaadee/Brain`) | Triage, classify, format, validate, and move raw drafts from `00-inbox/` | `active` | | [Engineering Investigation](skills/engineering-investigation/README.md) | Global (`~/.gemini/config/skills/`) | Scientific investigation lifecycle, proportional checkpoints, and runtime verification | `active` | | [Documentation Router](skills/documentation-router/README.md) | Global (`~/.gemini/config/skills/`) | Second-order knowledge evaluation, epistemic classification, anti-overlap invariants, and authoring modules | `active` | | [Engineering Tutor](skills/engineering-tutor/README.md) | Global (`~/.gemini/config/skills/`) | Practice mode, Socratic graduated assistance, learner-as-primary-agent, and context-sensitive transfer verification | `active` | diff --git a/05-agents/skills/README.md b/05-agents/skills/README.md index 8f7e99c..877816b 100644 --- a/05-agents/skills/README.md +++ b/05-agents/skills/README.md @@ -129,6 +129,7 @@ The primary threat to this collection's health is **duplicate authority**, not m | Skill | Human API | Runtime Engine | References | | :--- | :--- | :--- | :--- | +| [Inbox Curation](inbox-curation/README.md) | [README](inbox-curation/README.md) | [SKILL.md](inbox-curation/SKILL.md) | — | | [Engineering Investigation](engineering-investigation/README.md) | [README](engineering-investigation/README.md) | [SKILL.md](engineering-investigation/SKILL.md) | — | | [Engineering Tutor](engineering-tutor/README.md) | [README](engineering-tutor/README.md) | [SKILL.md](engineering-tutor/SKILL.md) | — | | [Git Commit](git-commit/README.md) | [README](git-commit/README.md) | [SKILL.md](git-commit/SKILL.md) | — | diff --git a/05-agents/skills/inbox-curation/README.md b/05-agents/skills/inbox-curation/README.md new file mode 100644 index 0000000..05a0dea --- /dev/null +++ b/05-agents/skills/inbox-curation/README.md @@ -0,0 +1,84 @@ +--- +type: agent +status: active +name: inbox-curation +kind: skill +project: brain +tags: + - inbox + - curation + - knowledge-graph + - taxonomy + - workflows +--- + +# Inbox Curation Skill + +> **Inbox Curation standardizes the process of scanning, triaging, formatting, validating, and relocating raw captures from `00-inbox/` into the canonical lifecycle directories of the Brain knowledge graph.** + +--- + +## 1. Identity + +**Inbox Curation** is an operational capability for the Second Brain knowledge graph. It provides a structured, reproducible procedure for transforming unstructured, zero-friction captures into first-class graph citizens adhering to vault taxonomy, metadata contracts, link conventions, and atomic git commit standards. + +## 2. User Value + +The `00-inbox/` directory provides zero-friction capture without worrying about filenames, frontmatter schemas, or directory contracts during the flow of thinking. However, without deliberate curation, raw notes accumulate, fragment, or degrade into an unmaintained digital dumping ground. + +Inbox Curation ensures: +- **Zero Drift**: Staged drafts are brought into full compliance with `validate-brain.py` before entry into the graph. +- **Epistemic Integrity**: Content is classified strictly by its *epistemic role* (Intent $\to$ `01-plans/`, Exploration $\to$ `02-discussions/`, History $\to$ `03-records/`, Understanding $\to$ `04-learning/`, Navigation $\to$ `06-projects/`). +- **Human Authority**: Ambiguous classifications are elevated to the user with actionable recommendations before moving files. +- **Atomic History**: Every curated document transition is isolated and committed with the repository's semantic commit taxonomy (`plan:`, `discussion:`, `knowledge:`, `guide:`, `debug:`). + +## 3. Invocation + +### When to use it: +- During periodic vault maintenance passes when raw drafts exist in `00-inbox/`. +- When explicitly asked to "process the inbox", "curate notes", or "triage captures". +- After a research or capture session where rough notes were temporarily staged in `00-inbox/`. + +### When NOT to use it: +- **Active capture**: When the user is currently drafting ideas in `00-inbox/`. The inbox is intentionally exempt from rules while writing. +- **Session knowledge routing**: At the conclusion of a coding or debugging session when synthesizing thoughts directly from session context. Use [`documentation-router`](../documentation-router/README.md) instead. +- **Arbitrary file moving**: Reorganizing existing, already-committed files in `01-plans/` through `06-projects/`. + +## 4. Behavior + +When invoked, Inbox Curation progresses through a 5-phase operational pipeline: + +```mermaid +flowchart TD + Start["00-inbox/ has pending items"] --> Preflight["1. Preflight Validation
(Run python scripts/validate-brain.py)"] + Preflight --> Discovery["2. Discovery & Inspection
(Read draft, determine intent, extract references)"] + Discovery --> Classify["3. Epistemic Classification
(Map to 01-plans, 02-discussions, 03-records, 04-learning)"] + Classify --> Checkpoint{"Interactive Checkpoint
Confirm destination & metadata with user"} + Checkpoint -->|Confirmed| Transform["4. Transformation & Formatting
(Inject YAML frontmatter, fix relative links, style headings)"] + Transform --> Validate["5. Integrity Validation
(Run scripts/validate-brain.py again)"] + Validate --> Relocate["6. Relocate & Clean
(Write to destination, remove draft from 00-inbox/)"] + Relocate --> Commit["7. Atomic Semantic Commit
(Commit with semantic type: plan, discussion, etc.)"] +``` + +## 5. Outputs + +Inbox Curation produces concrete transformations in the knowledge graph: + +| Output | Description | Destination | +| :--- | :--- | :--- | +| **Curated Artifact** | Formatted Markdown file with valid YAML frontmatter and portable relative links. | Target lifecycle directory (`01-` to `06-`) | +| **Clean Inbox** | Removal of the staged draft from `00-inbox/`. | File deletion in `00-inbox/` | +| **Semantic Git Commit** | Single atomic commit isolating the curated addition. | Git history (`(): `) | + +## 6. Boundaries + +- **Never bypass validator**: A curated file must never be committed if `python scripts/validate-brain.py` fails. +- **Never delete without destination write**: The draft in `00-inbox/` is only removed after the curated version is successfully written and verified at its target destination. +- **Never guess ambiguous intent**: If a draft contains mixed concerns (e.g. an incident post-mortem combined with a future plan), the skill prompts the user to split the note or confirm the primary role. +- **Preserve authorial substance**: Formatting, frontmatter, and link adjustments elevate the document's structure without altering the core insights, observations, or conclusions of the original draft. + +--- + +## 7. Package Structure + +- [`SKILL.md`](SKILL.md) — Operational instructions, progressive procedure, and behavioral invariants executed by the AI agent runtime. diff --git a/05-agents/skills/inbox-curation/SKILL.md b/05-agents/skills/inbox-curation/SKILL.md new file mode 100644 index 0000000..93f7029 --- /dev/null +++ b/05-agents/skills/inbox-curation/SKILL.md @@ -0,0 +1,104 @@ +--- +name: inbox-curation +description: >- + Triage, classify, format, validate, and move raw notes and drafts from 00-inbox into + canonical Brain knowledge graph lifecycle directories (01-plans, 02-discussions, 03-records, + 04-learning). +--- + +# Inbox Curation & Graph Ingestion + +This skill governs the systematic ingestion and curation of unprocessed drafts from `00-inbox/` into the canonical lifecycle directories of the Brain knowledge graph. + +--- + +## 1. Core Invariants + +1. **Epistemic Classification over Chronology**: Content is sorted by its epistemic nature, never simply by when it was created: + - Roadmaps, milestones, phased execution $\to$ `01-plans//` (`type: plan`) + - Exploratory debates, trade-offs, architecture options $\to$ `02-discussions//` (`type: discussion`) + - Incidents, regressions, root-cause analyses $\to$ `03-records/debug/` (`type: debug`) + - General knowledge, concepts, languages $\to$ `04-learning/knowledge/` (`type: knowledge`) + - Practical SOPs, runbooks, operation walkthroughs $\to$ `04-learning/guides//` (`type: guide`) +2. **The Validation Gate**: A curated document MUST pass `python scripts/validate-brain.py` before any commit is made. +3. **Zero Dangling Drafts**: Once a draft is curated and committed to its destination, the original file in `00-inbox/` must be deleted. +4. **Interactive Checkpoint**: The agent must present the proposed destination, frontmatter, and rationale to the user before relocating files, unless explicitly instructed to process autonomously. +5. **Atomic Commit Boundary**: Each curated document or cohesive bundle must be committed separately with the Brain's semantic commit type (`plan`, `discussion`, `knowledge`, `guide`, `debug`). + +--- + +## 2. Operational Procedure + +```mermaid +flowchart TD + S1["1. Preflight Gate
python scripts/validate-brain.py"] --> S2["2. Inventory & Inspection
Scan 00-inbox/ for pending drafts"] + S2 --> S3["3. Epistemic Classification
Determine target directory & metadata"] + S3 --> S4{"4. Interactive Checkpoint
Present target path & frontmatter"} + S4 -->|Approved| S5["5. Transform & Relocate
Write formatted file, delete from inbox"] + S5 --> S6["6. Validate Integrity
python scripts/validate-brain.py"] + S6 --> S7["7. Atomic Semantic Commit
Commit with brain semantic type"] +``` + +### Step 1: Preflight Verification +Before touching any files, verify that the repository is currently in a healthy state: +```bash +python scripts/validate-brain.py +``` +If the validator fails prior to curation, resolve existing repository issues or alert the user before proceeding. + +### Step 2: Inventory & Inspection +Scan `00-inbox/` for files to curate, ignoring `.keep`, `README.md`, or active scratch notes specified by the user: +- Read the content of the staged draft. +- Identify the project context (e.g. `homelab`, `nekoweb`, `brain`, or global/general). +- Determine whether the draft contains a single concept or multiple mixed concerns that should be decomposed into separate files. + +### Step 3: Epistemic Classification & Metadata Preparation +Select the target directory according to the repository's Directory Contracts: + +| Content Nature | Target Directory | Frontmatter `type` | Naming Pattern | +| :--- | :--- | :--- | :--- | +| **Phased Roadmap / Blueprint** | `01-plans//` | `plan` | `.md` | +| **Exploratory Trade-off / Why** | `02-discussions//` | `discussion` | `.md` | +| **Incident Root Cause / Bug** | `03-records/debug/` | `debug` | `YYYY-MM-DD-.md` | +| **Theoretical / Disciplinary Concept** | `04-learning/knowledge/concepts/` | `knowledge` | `.md` | +| **Tool / Language Reference** | `04-learning/knowledge/technologies/` | `knowledge` | `.md` | +| **Engineering Best Practice** | `04-learning/knowledge/methods/` | `knowledge` | `.md` | +| **Operational SOP / How-to Runbook** | `04-learning/guides//` | `guide` | `.md` | + +Prepare the compliant YAML frontmatter block matching the destination contract (see [AGENTS.md](../../../AGENTS.md) for templates). + +### Step 4: Interactive Checkpoint +Present a 4-point curation checkpoint to the user: +1. **Source Draft**: Path in `00-inbox/`. +2. **Proposed Destination**: Target path in vault hierarchy. +3. **Proposed Frontmatter**: YAML block including `type`, `project`, `tags`, etc. +4. **Rationale**: Brief epistemic justification for why this target directory was selected. + +*If the user confirms or if operating in approved autonomous mode, proceed to Step 5.* + +### Step 5: Transformation, Relocation & Cleanup +1. **Format Content**: + - Prepend valid YAML frontmatter. + - Ensure title is an H1 heading matching document purpose. + - Convert any Obsidian `[[double-bracket]]` links to standard relative Markdown links (`[label](../path.md)`). + - Ensure external code links use forge Git URLs (never machine-specific `file:///` URIs). +2. **Write Target File**: Write the transformed document to the destination path. +3. **Remove Staging File**: Delete the original file from `00-inbox/`. + +### Step 6: Validation Pass +Run repository integrity tests: +```bash +python scripts/validate-brain.py +python scripts/test_validator.py +``` +Ensure all checks pass cleanly: frontmatter validation, link resolution, code fences, Mermaid syntax, Ruff linting, and Pyright typing. + +### Step 7: Atomic Semantic Commit +Package the curated file using the Brain's semantic commit taxonomy: +- `plan(): ` +- `discussion(): ` +- `debug(): ` +- `knowledge(): ` +- `guide(): ` + +Commit message must reflect the newly curated document, cleanly isolated from unrelated working-tree changes. diff --git a/AGENTS.md b/AGENTS.md index 534c404..81a2088 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,15 +8,15 @@ This repository is a personal knowledge graph organized strictly around the **ep The Brain organizes information into seven numbered lifecycle directories: -| Directory | Semantic Role | Contains | -| :--- | :--- | :--- | -| `00-inbox/` | **Capture** | Unprocessed, ephemeral captures — no classification or metadata required. | -| `01-plans/` | **Intent** | Actionable implementation roadmaps, specifications, and execution blueprints (`type: plan`). | -| `02-discussions/` | **Exploration** | Prospective inquiries, architectural options evaluations, and trade-offs (`type: discussion`). | -| `03-records/` | **History** | Historical memory: journals, incident RCAs, and ADRs (`type: journal \| debug \| decision`). | -| `04-learning/` | **Understanding** | Durable knowledge (`knowledge/`), operational SOPs (`guides/`), and deliberate practice (`practice/`). | -| `05-agents/` | **Machine Context** | Canonical store of AI agent profiles (`profiles/`) and operational skills (`skills/`). | -| `06-projects/` | **System Hubs** | Project topology hubs, forge repository mappings, and cross-cutting index entrypoints (`type: project`). | +| Directory | Semantic Role | Contains | +| :---------------- | :------------------ | :------------------------------------------------------------------------------------------------------- | +| `00-inbox/` | **Capture** | Unprocessed, ephemeral captures — no classification or metadata required. | +| `01-plans/` | **Intent** | Actionable implementation roadmaps, specifications, and execution blueprints (`type: plan`). | +| `02-discussions/` | **Exploration** | Prospective inquiries, architectural options evaluations, and trade-offs (`type: discussion`). | +| `03-records/` | **History** | Historical memory: journals, incident RCAs, and ADRs (`type: journal \| debug \| decision`). | +| `04-learning/` | **Understanding** | Durable knowledge (`knowledge/`), operational SOPs (`guides/`), and deliberate practice (`practice/`). | +| `05-agents/` | **Machine Context** | Canonical store of AI agent profiles (`profiles/`) and operational skills (`skills/`). | +| `06-projects/` | **System Hubs** | Project topology hubs, forge repository mappings, and cross-cutting index entrypoints (`type: project`). | --- @@ -213,17 +213,10 @@ Checks: directory-type contracts, max depth, filename requirements, frontmatter --- -## Inbox Curation Protocol +## Operational Skills -When curating the `00-inbox/` staging area: +Procedural workflows and multi-step capabilities are encapsulated as operational skills under `05-agents/skills/` rather than inline repository rules: -1. **Verify Baseline**: Ensure `python scripts/validate-brain.py` passes cleanly. -2. **Classify**: Map the captured draft into its target directory based on epistemic role: - - Implementation roadmap $\to$ `01-plans//` (`type: plan`) - - Architectural trade-off $\to$ `02-discussions//` (`type: discussion`) - - Incident post-mortem $\to$ `03-records/debug/` (`type: debug`) - - Knowledge note $\to$ `04-learning/knowledge/` (`type: knowledge`) - - Operational SOP $\to$ `04-learning/guides//` (`type: guide`) -3. **Format & Frontmatter**: Add valid YAML frontmatter matching the target directory contract. -4. **Remove Staging File**: Delete from `00-inbox/`. -5. **Atomic Commit**: Commit with semantic commit type matching the document role. +- **[Inbox Curation](05-agents/skills/inbox-curation/README.md)**: Scans `00-inbox/`, classifies raw notes into canonical lifecycle directories, injects valid YAML frontmatter, validates links, and executes atomic commits. +- **[Documentation Router](05-agents/skills/documentation-router/README.md)**: Evaluates completed engineering sessions to determine whether durable knowledge was produced and selects the canonical epistemic container (Discussion, ADR, Plan, Debug Record). +- **[Git Commit & History Hygiene](05-agents/skills/git-commit/README.md)**: Packages validated repository transitions into coherent, atomic Conventional Commits matching the Brain semantic taxonomy.