Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ _Avoid_: de-AI checklist, tell removal (the skill explicitly rejects "checklist"
**Document Modes**:
The `write` skill's second layer: its four Modes (Long-form Article, Release Note Template, Document Review, Paragraph Coherence), each doing a different kind of prose-document work — structural cuts, templating, a review checklist, flow diagnosis. Fire only on genuine prose documents — reports, docs, README, release notes, articles — never on single-line artifacts like a commit message or code comment.
_Avoid_: prose polishing, structural pass (the skill already uses "polish" for a different, sentence-level meaning, and "structural" only describes one of the four Modes)

**OKF bundle**:
The Open Knowledge Format (Google, v0.2) unit a single `okf_version` declaration governs. Per `project-brain`'s adoption (#195), the whole brain repo (e.g. `E:\Personal Projects\brain\`) is one bundle — its root `index.md` declares `okf_version: "0.2"`; per-initiative directories (`initiatives/<id>/`) are not separate bundles and get no `index.md` of their own.
_Avoid_: brain (ambiguous — could mean the repo, an initiative, or the concept generally); OKF instance

**OKF concept**:
A single Markdown file with a `type:` frontmatter field, per the Open Knowledge Format. Every non-reserved `.md` file under a brain (`core.md`, `STATUS.md`, `adr/*.md`, `research/*.md`, `reports/*.md`) is a concept; `index.md` and `log.md` are reserved filenames and are not concepts.
_Avoid_: document, page (too generic — "concept" is OKF's own term and is what a consumer routes on via `type:`)
64 changes: 63 additions & 1 deletion ai-agents/skills/project-brain/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,71 @@ and regenerate-able; the brain's truth source is the work. Design rationale: `<b
profile (domain knowledge the user has demonstrated; written by walkthrough close-out, read to
pitch tour depth). Area-level, not per-initiative, because the user's knowledge spans initiatives.
- An initiative: `core.md` (stable, auto-loaded), `STATUS.md` (volatile, auto-loaded), `adr/`,
`research/` (+ `index.md`), `reports/`, `spikes/`.
`research/` (+ `index.md`), `reports/`, `spikes/`, and — per initiative role — `tickets/` (per-PBI
ticket files) or a one-off `kanban.md`.
- Single-directory work uses the same schema in the repo's gitignored `.claude/brain/` instead.

## Schema: the Open Knowledge Format

Every brain file conforms to Google's Open Knowledge Format (OKF v0.2, June 2026) — a directory of
Markdown files with YAML frontmatter and standard markdown links, not a bespoke schema. Full
rationale: `docs/adr/adopt-okf-for-project-brain-markdown.md` in the dotfiles repo.

**Bundle root:** only the brain-root `index.md` declares `okf_version: "0.2"` in its frontmatter.
Per-initiative directories are not separate bundles and get no `index.md` of their own.

**`type:` enum** — one non-reserved concept type per directory role. `index.md` and `log.md` are
reserved role filenames and carry no `type:`.

| `type:` | File(s) |
|---|---|
| `core` | `core.md` |
| `status` | `STATUS.md` |
| `adr` | `adr/*.md` |
| `research` | `research/*.md` |
| `report` | `reports/*.md` |
| `ticket` | `tickets/*.md` (per-initiative ticket files) |
| `spike` | `spikes/*.md` |
| `learner` | `learner.md` |
| `kanban` | `kanban.md` (ad hoc, one-off) |

**Frontmatter shape per type:**

- `core.md`: `initiative`, `type: core`, `updated`, `generated: { by, at }` (written once at file
creation — see `templates/core.md`).
- `STATUS.md`: `initiative`, `type: status`, `updated`, `stale_after` (`updated:` + 7 days,
recomputed on every edit), `generated: { by, at }`.
- `adr/*.md`: the full former bullet-list header lives in frontmatter, not the body —
`status: draft | stable | deprecated` (remapped from `Proposed | Accepted | Superseded`), `date`,
`scope`, `supersedes`, `superseded_by`, `type: adr`, `generated: { by, at }`, `verified: []`.
- `research/*.md`: `type: research`, `generated: { by, at }`, `verified: []` — populated only when a
later session confirms a finding by spike/primary-source, not literature review alone.
- `reports/*.md`: `type: report`, `generated: { by, at }`. No `verified:` — reports are point-in-time
outputs, not standing claims to re-confirm.
- `ticket`/`spike`/`learner`/`kanban`: `type:` only — minimal conformance, no provenance/lifecycle
fields required.

`generated.by`/`generated.at` are written once, by hand, at file-creation time for new files (the
placeholder in each template). They are never backfilled with today's date on a pre-existing file —
see the conversion script below. A backfilled (pre-existing) file may therefore carry
`generated: { at }` only, with `by` omitted rather than guessed, when the original authoring
agent/session can't be reliably attributed — this is conformant, not a gap to flag. `verified:` is
never backfilled with real entries either: every
migrated file gets `verified: []` regardless of what its prose claims; it is populated only going
forward, by a session that actually re-performs the confirmation.

**Link syntax:** Obsidian-style `[[wikilink]]` is retired in favor of OKF's standard markdown links —
`[text](/path)` (absolute, bundle-root-relative) or `[text](./path)` (relative). Applies to
`core.md`'s Map section, area-level `index.md`, and ADR cross-references.

**Conversion script:** `scripts/convert-to-okf.ps1` in this directory does the mechanical part of
migrating a pre-existing file — wikilink rewrite, `type:`/`stale_after:` insertion, `verified: []`
insertion (adr/research only), and `generated.at` provenance derived from
`git log --diff-filter=A --follow --format=%aI` in the file's own repo (omitted, never guessed, when
git history has none). It does not rewrite an ADR's bullet-list header into frontmatter — that remap
is per-file judgement, done by hand. Run it against a file or a directory:
`./scripts/convert-to-okf.ps1 -Path <brain-repo-or-file>`.

## Loading (how context reaches a session)

In Claude Code, the SessionStart hook auto-injects the resolved `core.md` + `STATUS.md` (on
Expand Down
Loading