Compare commits
5
Commits
a1c03360d1
...
7585e03fc0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7585e03fc0 | ||
|
|
2749feae78 | ||
|
|
26538c9634 | ||
|
|
9ed6015b2c | ||
|
|
c00271f691 |
No files matched your search
@@ -1,101 +1,37 @@
|
||||
---
|
||||
name: commit-logger
|
||||
description: Record verified Git commit events as lossless, immutable records in a machine-readable commit ledger (00-inbox/commit-log.csv).
|
||||
disable-model-invocation: false
|
||||
description: >-
|
||||
Record verified Git commit events as lossless, immutable records in a machine-readable
|
||||
commit ledger (00-inbox/commit-log.csv). Use when git-commit completes or to log commits.
|
||||
---
|
||||
|
||||
# Commit Logger
|
||||
|
||||
Vault extension: captures Git commit events into a configured knowledge-vault ledger (`00-inbox/commit-log.csv`).
|
||||
## Use when
|
||||
- Recording a verified Git commit event into the vault ledger (`00-inbox/commit-log.csv`).
|
||||
- Automatic handoff from `git-commit` after a commit is created.
|
||||
- Catch-up capture of unlogged commits (`/commit-logger [COMMIT_SHA]`).
|
||||
- Not for daily reflection or learning assessment: use `journal-builder`.
|
||||
- Not for triaging notes: use `draft-curation`.
|
||||
|
||||
Its sole responsibility is **immutable fact capture**. It does not interpret, summarize, or evaluate changes.
|
||||
## Steps
|
||||
1. **Pre-condition and recursion check.** Inspect the target repository root:
|
||||
`git rev-parse --show-toplevel`.
|
||||
If inside the vault repository itself or named `Brain`, terminate immediately unless
|
||||
`--force` or `--allow-brain` is explicitly provided.
|
||||
2. **Idempotency check.** Verify if the full 40-character commit SHA already exists in
|
||||
`00-inbox/commit-log.csv`. If present, exit silently.
|
||||
3. **Capture via deterministic script.** Run the capture script:
|
||||
`bash scripts/log-commit.sh [COMMIT_SHA]` (defaults to `HEAD` if omitted).
|
||||
Consult [references/ledger-schema.md](references/ledger-schema.md) for field definitions.
|
||||
4. **Verify row.** Inspect `00-inbox/commit-log.csv` to confirm the row exists and complies
|
||||
with RFC 4180 format.
|
||||
|
||||
---
|
||||
## Your call
|
||||
- Whether to force logging a vault commit when operating inside the vault (`--force`).
|
||||
|
||||
## 1. Governing Axioms & Invariants
|
||||
## Done when
|
||||
- The verified commit event row exists in `00-inbox/commit-log.csv`, or duplicate was safely skipped.
|
||||
|
||||
1. **Authoritative Event Identity**:
|
||||
> **The full 40-character commit SHA is the authoritative event identity. The CSV row is only its durable representation.**
|
||||
2. **Pure Fact Capture (Zero Interpretation)**:
|
||||
`commit-logger` records only immutable Git metadata. It does **NOT**:
|
||||
* Infer, ask for, or fabricate rationale.
|
||||
* Derive semantic lineage or retrospective notes.
|
||||
* Conduct learning quizzes or interact conversationally with the user.
|
||||
* Synthesize or write daily journals (reserved for a future `journal-builder` skill, not built yet).
|
||||
3. **Lossless Essential Metadata**:
|
||||
Captures the complete commit identity and essential Git attributes:
|
||||
`committed_at,repository,project,branch,commit_sha,parent_sha,subject`
|
||||
4. **Authoritative Project Resolution**:
|
||||
Resolves the repository directory against the vault's project topology (e.g. `06-projects/`). If no authoritative project mapping exists, preserves the repository name and leaves `project` empty (`""`). Never guesses project associations.
|
||||
5. **Anti-Recursion Invariant**:
|
||||
Commits inside the vault repository itself (e.g. `~/Brain`) are strictly non-loggable by default to prevent recursion. Any automated or hook invocation targeting the vault exits immediately as a no-op. When vault commits represent meaningful engineering progress, passing `--force` (or `--allow-brain`) explicitly captures the commit under project `brain`.
|
||||
6. **Idempotency Barrier**:
|
||||
The full 40-character commit SHA acts as a unique idempotency key. If the SHA already exists in `00-inbox/commit-log.csv`, the event is skipped silently.
|
||||
|
||||
---
|
||||
|
||||
## 2. Ledger Contract & Storage Schema
|
||||
|
||||
* **Target File**: `00-inbox/commit-log.csv` (RFC 4180 compliant)
|
||||
* **Header**:
|
||||
```csv
|
||||
committed_at,repository,project,branch,commit_sha,parent_sha,subject
|
||||
```
|
||||
|
||||
### Field Definitions
|
||||
|
||||
| Field | Source | Format / Rule | Example |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `committed_at` | Git committer timestamp | ISO-8601 with timezone (`%cI`) | `2026-10-02T16:42:13-05:00` |
|
||||
| `repository` | Top-level working directory | Directory basename | `bdinvite` |
|
||||
| `project` | Vault `06-projects/` mapping | Directory slug if known, else `""` | `bdinvite` |
|
||||
| `branch` | Current Git branch | Branch ref name (or `detached`) | `feat/gitops` |
|
||||
| `commit_sha` | Git commit identity | Full 40-character SHA | `a81f3c2e9b7d84f...` |
|
||||
| `parent_sha` | First parent commit SHA | Full 40-character SHA, or `""` if root | `91bc7de41f2a...` |
|
||||
| `subject` | Commit subject line | RFC 4180 escaped (double-quoted if needed) | `"validate manifest after pull"` |
|
||||
|
||||
---
|
||||
|
||||
## 3. Operational Procedure
|
||||
|
||||
When invoked following a verified commit (or during catch-up):
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start["Receive Commit Reference<br/>(SHA or HEAD)"] --> RepoCheck{"Inside Git Repo?"}
|
||||
RepoCheck -->|No| Abort["Exit with Error"]
|
||||
RepoCheck -->|Yes| Recursion{"Repo == Vault?"}
|
||||
Recursion -->|Yes| NoOp["Silent No-Op Exit"]
|
||||
Recursion -->|No| Extract["Extract Git Metadata & Resolve Project"]
|
||||
Extract --> Dedup{"SHA already in<br/>commit-log.csv?"}
|
||||
Dedup -->|Yes| Duplicate["Silent No-Op Exit"]
|
||||
Dedup -->|No| Append["Append CSV Row to 00-inbox/commit-log.csv"]
|
||||
Append --> Done["Event Recorded"]
|
||||
```
|
||||
|
||||
### Step 1: Pre-condition & Recursion Check
|
||||
Inspect the target repository:
|
||||
```bash
|
||||
git rev-parse --show-toplevel
|
||||
```
|
||||
If the repository root matches the configured vault or the directory name is `Brain`, terminate immediately.
|
||||
|
||||
### Step 2: Capture via Deterministic Script
|
||||
Execute the bundled deterministic capture script:
|
||||
```bash
|
||||
bash scripts/log-commit.sh [COMMIT_SHA] # path relative to this SKILL.md
|
||||
```
|
||||
*(If `COMMIT_SHA` is omitted, the script automatically defaults to `HEAD` of the current repository).*
|
||||
|
||||
Alternatively, execute the extraction steps directly adhering strictly to RFC 4180 escaping and the schema rules above.
|
||||
|
||||
### Step 3: Verification
|
||||
Inspect `00-inbox/commit-log.csv` to confirm the row exists and adheres to RFC 4180 standards.
|
||||
|
||||
---
|
||||
|
||||
## 4. Architectural Boundaries & System Role
|
||||
|
||||
* **Producer**: `git-commit` invokes `commit-logger` upon verifying the created commit SHA. External or manual commits may trigger `scripts/log-commit.sh` via a Git `post-commit` hook.
|
||||
* **Storage**: `00-inbox/commit-log.csv` is an append-only raw event ledger. It is exempt from `inbox-curation` triage.
|
||||
* **Consumer**: `journal-builder` (`/journal`) consumes the accumulated records in `commit-log.csv`, resolves project directories via the active agent profile, checks assessment provenance via journal frontmatters, conducts collaborative reconstruction, and drives the closed assessment loop to synthesize daily journals in `03-records/journal/`.
|
||||
## Hands off to
|
||||
- `journal-builder`: at day end to reconstruct history and assess learning objectives from the ledger.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Commit Ledger Schema & Axioms
|
||||
|
||||
Detailed specifications and invariants governing the commit event ledger (`00-inbox/commit-log.csv`).
|
||||
|
||||
## 1. Governing Axioms & Invariants
|
||||
|
||||
1. **Authoritative Event Identity**:
|
||||
The full 40-character commit SHA is the authoritative event identity. The CSV row is only its durable representation.
|
||||
2. **Pure Fact Capture (Zero Interpretation)**:
|
||||
`commit-logger` records only immutable Git metadata. It does not:
|
||||
* Infer, ask for, or fabricate rationale.
|
||||
* Derive semantic lineage or retrospective notes.
|
||||
* Conduct learning quizzes or interact conversationally with the user.
|
||||
* Synthesize or write daily journals (reserved for `journal-builder`).
|
||||
3. **Lossless Essential Metadata**:
|
||||
Captures the complete commit identity and essential Git attributes:
|
||||
`committed_at,repository,project,branch,commit_sha,parent_sha,subject`
|
||||
4. **Authoritative Project Resolution**:
|
||||
Resolves the repository directory against the vault's project topology (e.g. `06-projects/`). If no authoritative project mapping exists, preserves the repository name and leaves `project` empty (`""`). Never guesses project associations.
|
||||
5. **Anti-Recursion Invariant**:
|
||||
Commits inside the vault repository itself (e.g. `Brain`) are strictly non-loggable by default to prevent recursion. Any automated or hook invocation targeting the vault exits immediately as a no-op. When vault commits represent meaningful engineering progress, passing `--force` (or `--allow-brain`) explicitly captures the commit under project `brain`.
|
||||
6. **Idempotency Barrier**:
|
||||
The full 40-character commit SHA acts as a unique idempotency key. If the SHA already exists in `00-inbox/commit-log.csv`, the event is skipped silently.
|
||||
|
||||
## 2. Ledger Contract & Storage Schema
|
||||
|
||||
* **Target File**: `00-inbox/commit-log.csv` (RFC 4180 compliant)
|
||||
* **Header**:
|
||||
```csv
|
||||
committed_at,repository,project,branch,commit_sha,parent_sha,subject
|
||||
```
|
||||
|
||||
### Field Definitions
|
||||
|
||||
| Field | Source | Format / Rule | Example |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `committed_at` | Git committer timestamp | ISO-8601 with timezone (`%cI`) | `2026-10-02T16:42:13-05:00` |
|
||||
| `repository` | Top-level working directory | Directory basename | `bdinvite` |
|
||||
| `project` | Vault `06-projects/` mapping | Directory slug if known, else `""` | `bdinvite` |
|
||||
| `branch` | Current Git branch | Branch ref name (or `detached`) | `feat/gitops` |
|
||||
| `commit_sha` | Git commit identity | Full 40-character SHA | `a81f3c2e9b7d84f...` |
|
||||
| `parent_sha` | First parent commit SHA | Full 40-character SHA, or `""` if root | `91bc7de41f2a...` |
|
||||
| `subject` | Commit subject line | RFC 4180 escaped (double-quoted if needed) | `"validate manifest after pull"` |
|
||||
|
||||
## 3. System Role & Boundaries
|
||||
|
||||
* **Producer**: `git-commit` invokes `commit-logger` upon verifying the created commit SHA. External or manual commits may trigger `scripts/log-commit.sh` via a Git `post-commit` hook.
|
||||
* **Storage**: `00-inbox/commit-log.csv` is an append-only raw event ledger. It is exempt from `draft-curation` triage.
|
||||
* **Consumer**: `journal-builder` (`/journal`) consumes the accumulated records in `commit-log.csv`, resolves project directories via the active agent profile, checks assessment provenance via journal frontmatters, conducts collaborative reconstruction, and drives the closed assessment loop to synthesize daily journals in `03-records/journal/`.
|
||||
@@ -5,7 +5,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
VAULT_ROOT="${VAULT_ROOT:-${BRAIN_ROOT:-$HOME/Brain}}"
|
||||
LEDGER_FILE="${VAULT_ROOT}/00-inbox/commit-log.csv"
|
||||
LEDGER_FILE="${LEDGER_FILE:-${VAULT_ROOT}/00-inbox/commit-log.csv}"
|
||||
|
||||
TARGET_REF="HEAD"
|
||||
FORCE_ALLOW_BRAIN=false
|
||||
@@ -48,16 +48,28 @@ if [[ "${REPO_ROOT}" == "${VAULT_ROOT}" ]] || [[ "${REPO_NAME}" == "Brain" ]] ||
|
||||
PROJECT="brain"
|
||||
elif [[ -d "${VAULT_ROOT}/06-projects/${REPO_NAME}" ]]; then
|
||||
PROJECT="${REPO_NAME}"
|
||||
elif [[ -d "${VAULT_ROOT}/06-projects/${REPO_NAME,,}" ]]; then
|
||||
PROJECT="${REPO_NAME,,}"
|
||||
elif [[ -d "${VAULT_ROOT}/06-projects" ]]; then
|
||||
# Look for matching project directory containing repository reference in README.md
|
||||
# Resolve workstation path relative to $HOME (e.g. ~/Homelab/Core, ~/Config)
|
||||
if [[ "${REPO_ROOT}" == "${HOME}"* ]]; then
|
||||
REL_REPO_PATH="~${REPO_ROOT#$HOME}"
|
||||
else
|
||||
REL_REPO_PATH="${REPO_ROOT}"
|
||||
fi
|
||||
|
||||
if [[ "${REL_REPO_PATH}" != "~" && -n "${REL_REPO_PATH}" ]]; then
|
||||
ESCAPED_PATH="${REL_REPO_PATH//./\\.}"
|
||||
# Look for matching project directory referencing authoritative workstation path in README.md
|
||||
for proj_dir in "${VAULT_ROOT}/06-projects"/*; do
|
||||
if [[ -f "${proj_dir}/README.md" ]]; then
|
||||
if grep -qi "${REPO_NAME}" "${proj_dir}/README.md"; then
|
||||
if grep -Eq "(^|[^a-zA-Z0-9_/-])${ESCAPED_PATH}([^a-zA-Z0-9_/-]|$)" "${proj_dir}/README.md"; then
|
||||
PROJECT="$(basename "${proj_dir}")"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# 5. CSV Formatting (RFC 4180 Escaping)
|
||||
|
||||
@@ -2,114 +2,32 @@
|
||||
name: draft-curation
|
||||
description: >-
|
||||
Triage, classify, format, validate, and move raw notes and drafts from an inbox or staging
|
||||
directory into canonical knowledge lifecycle directories (plans, discussions, records,
|
||||
learning).
|
||||
directory into canonical knowledge lifecycle directories. Use when triaging 00-inbox/ drafts.
|
||||
---
|
||||
|
||||
# Draft Curation & Knowledge Ingestion
|
||||
# Draft Curation
|
||||
|
||||
This extension skill governs the systematic ingestion and curation of unprocessed drafts from an inbox/staging directory (e.g. `00-inbox/`) into canonical lifecycle directories.
|
||||
## Use when
|
||||
- `/draft-curation`: triaging, classifying, and ingesting raw notes from `00-inbox/` into canonical vault lifecycle directories.
|
||||
- Handoff from `document` after drafting notes into staging inbox.
|
||||
- Not for capturing git commits into ledger: use `commit-logger`.
|
||||
- Not for authoring fresh documents from conversation: use `document`.
|
||||
|
||||
> **Vault Contract**: This extension assumes a knowledge vault organized around epistemic lifecycle directories (`01-plans/`, `02-discussions/`, `03-records/`, `04-learning/`) with schema validation and semantic commit conventions.
|
||||
## Steps
|
||||
1. **Preflight verification.** Verify repository health before moving files (run vault validator if present, e.g. `python scripts/validate-brain.py`).
|
||||
2. **Inventory staging.** Scan `00-inbox/` for pending drafts, ignoring system ledgers (`commit-log.csv`), `.keep`, or `README.md`. Identify project context and note scope.
|
||||
3. **Classify and format.** Determine target directory, frontmatter type, and filename slug using [references/curation-matrix.md](references/curation-matrix.md). Ensure H1 heading, relative links, and clean markdown.
|
||||
4. **Checkpoint.** Present source path, proposed destination, proposed frontmatter, and epistemic rationale. Stop for confirmation before moving files.
|
||||
5. **Relocate and reconcile.** Write transformed file to destination (reconciling with existing daily journal if applicable, preserving existing edits and unioning `assessed_commits`). Delete original draft from `00-inbox/`.
|
||||
6. **Validate integrity.** Re-run repository validation suite to verify frontmatter, links, and syntax pass cleanly.
|
||||
|
||||
---
|
||||
## Your call
|
||||
- **Confirm destination and frontmatter**: approve target path, frontmatter type, and rationale.
|
||||
- **Decomposition**: whether to split a draft covering multiple distinct concerns.
|
||||
- **Reconciliation edits**: approving changes when merging into an existing daily journal.
|
||||
|
||||
## 1. Core Invariants
|
||||
## Done when
|
||||
- Staged draft is relocated, removed from `00-inbox/`, and repository validation passes cleanly.
|
||||
|
||||
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/<project>/` (`type: plan`)
|
||||
- Exploratory debates, trade-offs, architecture options $\to$ `02-discussions/<project>/` (`type: discussion`)
|
||||
- Daily logs & reflections $\to$ `03-records/journal/` (`type: journal`)
|
||||
- Incidents, regressions, root-cause analyses $\to$ `03-records/debug/` (`type: debug`)
|
||||
- Architectural decisions $\to$ `03-records/decisions/` (`type: decision`)
|
||||
- General knowledge, concepts, languages $\to$ `04-learning/knowledge/` (`type: knowledge`)
|
||||
- Practical SOPs, runbooks, operation walkthroughs $\to$ `04-learning/guides/<project>/` (`type: guide`)
|
||||
2. **The Validation Gate**: If the vault has an automated validator (e.g. `python scripts/validate-brain.py`), a curated document MUST pass before any commit is made.
|
||||
3. **Zero Dangling Drafts**: Once a draft is curated and relocated to its destination, the original file in the staging directory 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 Curation Boundary**: Each curated document or cohesive bundle is relocated and validated as an independent unit. Git history is mutated only through `git-commit`.
|
||||
6. **Unique Daily Journal & Reconciliation**: A daily journal (`03-records/journal/YYYY-MM-DD.md`) is a unique daily artifact. When a curated draft targets a date whose journal already exists, reconcile it with the existing record rather than creating a duplicate file (`-2.md`) or blindly overwriting. Reconciliation must preserve existing human edits, union the `assessed_commits` frontmatter list, and integrate genuinely new wins, artifacts, objectives, and reflections while avoiding duplicate entries.
|
||||
|
||||
---
|
||||
|
||||
## 2. Operational Procedure
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
S1["1. Preflight Gate<br/>python scripts/validate-brain.py"] --> S2["2. Inventory & Inspection<br/>Scan 00-inbox/ for pending drafts"]
|
||||
S2 --> S3["3. Epistemic Classification<br/>Determine target directory & metadata"]
|
||||
S3 --> S4{"4. Interactive Checkpoint<br/>Present target path & frontmatter"}
|
||||
S4 -->|Approved| S5["5. Transform & Relocate<br/>Write/reconcile file, delete from inbox"]
|
||||
S5 --> S6["6. Validate Integrity<br/>python scripts/validate-brain.py"]
|
||||
S6 --> S7["7. Hand Off to git-commit<br/>Ready for user review & commit"]
|
||||
```
|
||||
|
||||
### 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`, system ledgers (`commit-log.csv`), 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/<project>/` | `plan` | `<slug>.md` |
|
||||
| **Exploratory Trade-off / Why** | `02-discussions/<project>/` | `discussion` | `<slug>.md` |
|
||||
| **Daily Log / Journal** | `03-records/journal/` | `journal` | `YYYY-MM-DD.md` |
|
||||
| **Incident Root Cause / Bug** | `03-records/debug/` | `debug` | `YYYY-MM-DD-<slug>.md` |
|
||||
| **Architectural Decision (ADR)** | `03-records/decisions/` | `decision` | `<slug>.md` |
|
||||
| **Theoretical / Disciplinary Concept** | `04-learning/knowledge/concepts/` | `knowledge` | `<slug>.md` |
|
||||
| **Tool / Language Reference** | `04-learning/knowledge/technologies/` | `knowledge` | `<slug>.md` |
|
||||
| **Engineering Best Practice** | `04-learning/knowledge/methods/` | `knowledge` | `<slug>.md` |
|
||||
| **Operational SOP / How-to Runbook** | `04-learning/guides/<project>/` | `guide` | `<slug>.md` |
|
||||
|
||||
Prepare the compliant YAML frontmatter block matching the destination contract (see vault's `AGENTS.md` or 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 & Reconciliation
|
||||
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 or Reconcile Target File**:
|
||||
- *New document*: Write the transformed document directly to the destination path.
|
||||
- *Existing daily journal*: Perform journal-aware reconciliation. Preserve existing human-authored edits, append new project sections/wins, append new decisions/artifacts, union `assessed_commits` in YAML frontmatter, and record new learning edge outcomes without duplicating entries.
|
||||
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: Hand Off to `git-commit`
|
||||
With the staging draft removed and repository validation passing cleanly, hand off to `/git-commit` for inspection and explicit user approval. Propose the conventional or vault-specific semantic commit type:
|
||||
- `plan(<project>): <description>`
|
||||
- `discussion(<project>): <description>`
|
||||
- `journal: record daily log for YYYY-MM-DD`
|
||||
- `debug(<project>): <description>`
|
||||
- `decision(<project>): <description>`
|
||||
- `knowledge(<topic>): <description>`
|
||||
- `guide(<project>): <description>`
|
||||
|
||||
Do not commit working-tree mutations directly; mutation of Git history belongs strictly to `git-commit`.
|
||||
## Hands off to
|
||||
- `git-commit`: to inspect working-tree diff and commit curated documents with semantic commit types.
|
||||
@@ -0,0 +1,33 @@
|
||||
# Draft Curation Matrix & Invariants
|
||||
|
||||
Detailed specifications and epistemic classification table for ingesting inbox drafts into canonical lifecycle directories.
|
||||
|
||||
## 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: `01-plans/<project>/` (`type: plan`)
|
||||
- Exploratory debates, trade-offs, architecture options: `02-discussions/<project>/` (`type: discussion`)
|
||||
- Daily logs & reflections: `03-records/journal/` (`type: journal`)
|
||||
- Incidents, regressions, root-cause analyses: `03-records/debug/` (`type: debug`)
|
||||
- Architectural decisions: `03-records/decisions/` (`type: decision`)
|
||||
- General knowledge, concepts, languages: `04-learning/knowledge/` (`type: knowledge`)
|
||||
- Practical SOPs, runbooks, operation walkthroughs: `04-learning/guides/<project>/` (`type: guide`)
|
||||
2. **The Validation Gate**: If the vault has an automated validator (e.g. `python scripts/validate-brain.py`), a curated document must pass before any commit is made.
|
||||
3. **Zero Dangling Drafts**: Once a draft is curated and relocated to its destination, the original file in the staging directory 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 Curation Boundary**: Each curated document or cohesive bundle is relocated and validated as an independent unit. Git history is mutated only through `git-commit`.
|
||||
6. **Unique Daily Journal & Reconciliation**: A daily journal (`03-records/journal/YYYY-MM-DD.md`) is a unique daily artifact. When a curated draft targets a date whose journal already exists, reconcile it with the existing record rather than creating a duplicate file (`-2.md`) or blindly overwriting. Reconciliation must preserve existing human edits, union the `assessed_commits` frontmatter list, and integrate genuinely new wins, artifacts, objectives, and reflections while avoiding duplicate entries.
|
||||
|
||||
## 2. Epistemic Classification Matrix
|
||||
|
||||
| Content Nature | Target Directory | Frontmatter `type` | Naming Pattern |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **Phased Roadmap / Blueprint** | `01-plans/<project>/` | `plan` | `<slug>.md` |
|
||||
| **Exploratory Trade-off / Why** | `02-discussions/<project>/` | `discussion` | `<slug>.md` |
|
||||
| **Daily Log / Journal** | `03-records/journal/` | `journal` | `YYYY-MM-DD.md` |
|
||||
| **Incident Root Cause / Bug** | `03-records/debug/` | `debug` | `YYYY-MM-DD-<slug>.md` |
|
||||
| **Architectural Decision (ADR)** | `03-records/decisions/` | `decision` | `<slug>.md` |
|
||||
| **Theoretical / Disciplinary Concept** | `04-learning/knowledge/concepts/` | `knowledge` | `<slug>.md` |
|
||||
| **Tool / Language Reference** | `04-learning/knowledge/technologies/` | `knowledge` | `<slug>.md` |
|
||||
| **Engineering Best Practice** | `04-learning/knowledge/methods/` | `knowledge` | `<slug>.md` |
|
||||
| **Operational SOP / How-to Runbook** | `04-learning/guides/<project>/` | `guide` | `<slug>.md` |
|
||||
@@ -25,8 +25,9 @@ disable-model-invocation: true
|
||||
4. **Size it.** Decide the shape: reference (facts consulted on demand), transformation
|
||||
(input to output), procedure (steps with checks between them), or interview (rounds of
|
||||
questions). Add gates or checkpoints only for a failure you can name.
|
||||
5. **Write a short spec:** name (= slash command), description, steps, "Your call" items,
|
||||
done-when signal, hand-offs, files in `references/` or `scripts/` if any.
|
||||
5. **Write a short spec:** name (matching `^[a-z0-9-]+$` = slash command), description
|
||||
(3rd person, concrete triggers), manual invocation toggle if needed, steps, "Your call" items,
|
||||
done-when signal, hand-offs, and files in canonical subdirectories (`references/`, `scripts/`, etc.).
|
||||
6. **Write it** in this repo following [references/skeleton.md](references/skeleton.md),
|
||||
then run the checks in [references/checklist.md](references/checklist.md).
|
||||
7. **Dogfood.** Run it on a real task, read the agent's actual turns, and fix the smallest
|
||||
|
||||
@@ -6,15 +6,18 @@ Used by `build-skill` at step 6 (writing) and step 7 (dogfooding).
|
||||
|
||||
| Check | Question |
|
||||
| :--- | :--- |
|
||||
| Name syntax | Does `name` strictly match `^[a-z0-9-]+$` (no uppercase, no underscores)? |
|
||||
| Description | Does it state what the skill does in 3rd person and name concrete triggers? (The agent routes from this alone.) |
|
||||
| Invocation | Should this ever auto-trigger? If manual only, is `disable-model-invocation: true` set? |
|
||||
| Directory layout | Uses canonical layout (`SKILL.md`, and optional `references/`, `scripts/`, `resources/`, `examples/`)? |
|
||||
| Section structure | Follows fixed sections: `Use when`, `Steps`, `Your call`, `Done when`, `Hands off to`? |
|
||||
| Size | Is `SKILL.md` 80 lines or less, with bulky material/schemas in `references/`? |
|
||||
| One job | Is there one recurring problem this skill owns? |
|
||||
| Clear edges | Does "Hands off to" say where it stops? Does "Use when" say what it is not for? |
|
||||
| One owner per rule | Is any rule here already defined elsewhere (AGENTS.md, another skill)? Point to it instead. |
|
||||
| Deletion test | Would removing each sentence change what the agent does? If not, remove it. |
|
||||
| Observable finish | Does "Done when" name a concrete signal (test passes, file exists, user approved)? |
|
||||
| Human decisions | Does "Your call" list the decisions that must stay with the user? |
|
||||
| Size | Is `SKILL.md` 80 lines or less, with bulky material in `references/`? |
|
||||
| Invocation | Should this ever auto-trigger? If not, set `disable-model-invocation: true`. |
|
||||
| Description | Does it say what the skill does and name concrete triggers? (The agent decides from this alone.) |
|
||||
| Public repo | No absolute home paths, no secrets. |
|
||||
|
||||
Add extra controls (hard gates, state files, checkpoints) only for a failure you have actually
|
||||
|
||||
@@ -2,12 +2,25 @@
|
||||
|
||||
Every `skills/*/SKILL.md` uses this shape. `build-skill` owns this file; other skills follow it and do not restate it.
|
||||
|
||||
## Canonical Directory Structure
|
||||
|
||||
```text
|
||||
skills/<skill-name>/
|
||||
├── SKILL.md # Required: Root instructions with YAML frontmatter
|
||||
├── references/ # Optional: Deep documentation, schemas, and manuals
|
||||
├── scripts/ # Optional: Deterministic executable scripts
|
||||
├── resources/ # Optional: Templates, assets, or static data
|
||||
└── examples/ # Optional: Reference cases and sample inputs/outputs
|
||||
```
|
||||
|
||||
## SKILL.md Skeleton
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: <command-name> # what the user types: /<command-name>
|
||||
name: <command-name> # Regex ^[a-z0-9-]+$ (lowercase alphanumeric and hyphens; slash command: /<command-name>)
|
||||
description: >-
|
||||
<What it does, in one sentence. When to use it: concrete triggers.>
|
||||
# disable-model-invocation: true # only for skills that must never auto-trigger
|
||||
<What it does in 3rd person. When to use it: concrete triggers for semantic routing.>
|
||||
# disable-model-invocation: true # Optional boolean: true prevents automatic model invocation (manual slash command only)
|
||||
---
|
||||
|
||||
# <Title>
|
||||
@@ -31,11 +44,12 @@ description: >-
|
||||
|
||||
## Rules
|
||||
|
||||
- **80 lines max** for `SKILL.md`. Templates, long formats and branch rules go in `references/`.
|
||||
- **80 lines max** for `SKILL.md`. Templates, long formats, and branch rules go in `references/`.
|
||||
- **Extra sections** are allowed only for a format used across several steps (e.g. `diagnose`'s checkpoint).
|
||||
- **One owner per rule.** If another file already defines it (AGENTS.md, another skill), point to it.
|
||||
- **Deletion test.** If removing a sentence would not change what the agent does, remove it.
|
||||
- **Plain words.** No invented vocabulary. Prefer "decision" over "epistemic commitment".
|
||||
- **No diagrams that repeat a list.** A numbered list is already the flow.
|
||||
- **No em-dashes** in skill text.
|
||||
- **The `name` is the slash command.** Never create a separate wrapper skill to expose a command.
|
||||
- **The `name` is the slash command.** Must match `^[a-z0-9-]+$`. Never use underscores (`_`) or uppercase; never create a separate wrapper skill to expose a command.
|
||||
- **Public repo hygiene.** Never hardcode user home paths (`/home/...`) or secrets.
|
||||
@@ -47,9 +47,9 @@ Concise framing of the problem, background forces, and the central architectural
|
||||
* Criteria against which options are evaluated.
|
||||
|
||||
## Considered Options
|
||||
* **Option 1: <Name>** — Brief description.
|
||||
* **Option 2: <Name>** — Brief description.
|
||||
* **Option 3: <Name>** — Brief description.
|
||||
* **Option 1: <Name>**: Brief description.
|
||||
* **Option 2: <Name>**: Brief description.
|
||||
* **Option 3: <Name>**: Brief description.
|
||||
|
||||
## Decision Outcome
|
||||
Chosen option: **Option X: <Name>**, because <neutral trade-off rationale grounded in decision drivers>.
|
||||
|
||||
@@ -18,9 +18,9 @@ Create a Knowledge Article when an engineering effort, investigation, practice d
|
||||
3. **Pedagogical Durability**: The explanation will remain valuable to an engineer months or years later, independent of transient project tasks.
|
||||
|
||||
### Target Placement within Knowledge Base or Vault
|
||||
* **`concepts/`** — Disciplinary and theoretical ideas: data structures, algorithmic paradigms, concurrency models, distributed systems principles (`type: knowledge`).
|
||||
* **`methods/`** — Reusable engineering practices, workflows, and disciplines: testing strategies, investigative techniques, architectural paradigms, documentation methods (`type: knowledge`).
|
||||
* **`technologies/`** — Deep dives into tools, runtimes, and languages: environment managers, container engines, frameworks, standard library mechanics (`type: knowledge`).
|
||||
* **`concepts/`**: Disciplinary and theoretical ideas: data structures, algorithmic paradigms, concurrency models, distributed systems principles (`type: knowledge`).
|
||||
* **`methods/`**: Reusable engineering practices, workflows, and disciplines: testing strategies, investigative techniques, architectural paradigms, documentation methods (`type: knowledge`).
|
||||
* **`technologies/`**: Deep dives into tools, runtimes, and languages: environment managers, container engines, frameworks, standard library mechanics (`type: knowledge`).
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user