Compare commits

...
2 Commits
Author SHA1 Message Date
kiskaadee 82c09e97cd refactor(document,practice,reconcile-docs): deprecate external vault and scope artifacts to repository
- profile: remove ~/Brain and ~/Brain/00-inbox/ from AGENTS.md and
  retire journal-builder from learning-contract.md; default durable notes
  to repository docs/ and personal learning/agent artifacts to gitignored
  .internal/.
- document: route all 5 epistemic types (Discussion, ADR, Plan, Debug
  Record, Knowledge) to the active repository's docs/ tree (or .internal/
  when personal), and remove journal-authoring.md and draft-curation
  handoff.
- practice: store practice records and scan overdue revisits in
  gitignored .internal/practice/ at the repository root.
- reconcile-docs: read repository-local docs/ (discussions, debug, adr,
  designs), git history, and Gitea state without external vault or inbox
  references.
- install.sh & README.md: retire journal-builder and draft-curation into
  OBSOLETE_SKILLS so install.sh backs up and unlinks them cleanly.
- tests: add test_repo_scoped_documentation_and_vault_deprecation.
2026-11-15 16:08:43 -05:00
kiskaadee b606e9c037 feat(reconcile-docs,gitea-plan,implement-slice): wire read-only Gitea ingestion and drift hooks
- reconcile-docs: ingest merged PRs, published code-review comments,
  milestones, and Project Board column placement (Completed vs.
  Backlog/Ready) read-only via gt; include active design specs
  (docs/designs/*.md) and Mid-Slice Spec Drift resolution; hand off to
  gitea-plan when reconciled docs require tracker updates.
- gitea-plan: hand off to reconcile-docs at milestone boundaries or when
  canonical docs lag behind Completed board cards.
- implement-slice: check for upstream design spec drift in Step 1
  preflight and prompt to run reconcile-docs at Step 7 when Scope Drift
  evolves a contract in docs/designs/*.md or ARCHITECTURE.md.
- tests: add test_reconcile_docs_gitea_ingestion_and_hooks.
2026-11-15 15:52:56 -05:00
23 changed files with 164 additions and 291 deletions

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
.obsidian
.internal/
__pycache__/
*.py[cod]
+24 -36
View File
@@ -43,16 +43,13 @@ flowchart TD
PRAC["practice<br/>learn it: Socratic & recall"]
DIAG["diagnose<br/>find out: evidence-first RCA"]
GIT["git-manager<br/>branches, commits & recovery"]
JB["journal-builder<br/>synthesize it: facts & scaffold"]
end
DOC["document<br/>classify & author: 6 epistemic types"]
REC["reconcile-docs<br/>reconcile: history, code, roadmap"]
Storage["Vault / Repo Docs"]
DOC["document<br/>classify & author: 5 epistemic types"]
REC["reconcile-docs<br/>reconcile: history, code, Gitea, roadmap"]
Storage["Repo docs/ & .internal/"]
SB --> Core
Core --> DOC
Core --> JB
JB --> DOC
DOC --> Storage
Storage --> REC
REC --> Storage
@@ -68,54 +65,45 @@ Every skill features an explicit **"Your call"** checkpoint where the agent paus
| Skill | Trigger / Command | Purpose | Length |
| :--- | :--- | :--- | :--- |
| **[`practice`](skills/practice/SKILL.md)** | `/practice [topic]`, `/practice review` | Socratic tutoring and delayed retrieval. Learner writes all code; uses graduated assistance, rubric calibration, and recall-before-reveal. | 50 lines |
| **[`practice`](skills/practice/SKILL.md)** | `/practice [topic]`, `/practice review` | Socratic tutoring and delayed retrieval. Learner writes all code; uses graduated assistance, rubric calibration, and recall-before-reveal in gitignored `.internal/practice/`. | 51 lines |
| **[`diagnose`](skills/diagnose/SKILL.md)** | `/diagnose [symptom]` | Evidence-first troubleshooting. Progresses from raw logs to proven root cause and minimal, reversible fixes. | 49 lines |
| **[`git-manager`](skills/git-manager/SKILL.md)** | `/git-manager` | Repository hygiene, branch and worktree lifecycle, incremental Conventional Commits (autonomous on working branches in delivery mode; user-authored in learning mode), integration, conflict stops, and evidence-first reflog recovery. | 65 lines |
| **[`gitea-plan`](skills/gitea-plan/SKILL.md)** | `/gitea-plan` | Translates technical goals and plans into Gitea milestones and issues with tiered sizing and falsifiable acceptance criteria. | 54 lines |
| **[`implement-slice`](skills/implement-slice/SKILL.md)** | `/implement-slice` | Orchestrates end-to-end delivery of an issue or vertical slice across worker and QA subagents, pre-committed rubrics, and final-HEAD gates without editing code directly. | 44 lines |
| **[`gitea-pr`](skills/gitea-pr/SKILL.md)** | `/gitea-pr` | Manages Gitea pull request lifecycle: branch readiness, review/verification synthesis, issue closing, and merge readiness. | 60 lines |
| **[`gt-usage`](skills/gt-usage/SKILL.md)** | `/gt-usage` | Work with Gitea repositories, issues, milestones, projects, and pull requests via the official gt CLI. Verified JSON recipes and anti-hallucination rules. | 44 lines |
| **[`document`](skills/document/SKILL.md)** | `/document` | Second-order knowledge classifier (Discussion, ADR, Plan, Debug Record, Knowledge, Journal). User confirms type and provides core insight. | 55 lines |
| **[`journal-builder`](skills/journal-builder/SKILL.md)** | `/journal-builder` or `/journal` | Two-phase daily engineering review: generates factual skeleton with question blanks, then reviews and calibrates user reasoning. | 58 lines |
| **[`reconcile-docs`](skills/reconcile-docs/SKILL.md)** | `/reconcile-docs [path]` | Reconciles historical evidence, present code reality, and future plans into canonical repo docs (README, ARCHITECTURE, ADR, ROADMAP). | 40 lines |
| **[`gitea-plan`](skills/gitea-plan/SKILL.md)** | `/gitea-plan` | Translates technical goals and plans into Gitea milestones, 5-column Kanban boards, and issues with tiered sizing and falsifiable acceptance criteria. | 75 lines |
| **[`implement-slice`](skills/implement-slice/SKILL.md)** | `/implement-slice` | Orchestrates end-to-end delivery of an issue or vertical slice across worker and QA subagents, pre-committed rubrics, Kanban card transitions, and final-HEAD gates without editing code directly. | 45 lines |
| **[`gitea-pr`](skills/gitea-pr/SKILL.md)** | `/gitea-pr` | Manages Gitea pull request lifecycle: branch readiness, review/verification synthesis, PR review comment publishing, issue closing, and merge readiness. | 73 lines |
| **[`gt-usage`](skills/gt-usage/SKILL.md)** | `/gt-usage` | Work with Gitea repositories, issues, milestones, projects, and pull requests via the official gt CLI. Verified JSON recipes and anti-hallucination rules. | 45 lines |
| **[`document`](skills/document/SKILL.md)** | `/document` | Second-order knowledge classifier (Discussion, ADR, Plan, Debug Record, Knowledge) scoped to the active repository's `docs/` (or `.internal/`). User confirms type and provides core insight. | 55 lines |
| **[`reconcile-docs`](skills/reconcile-docs/SKILL.md)** | `/reconcile-docs [path]` | Reconciles historical evidence, present code reality, Gitea delivery state, and future plans into canonical repo docs (`README`, `ARCHITECTURE`, `docs/adr/`, `ROADMAP`, `docs/designs/*.md`). | 44 lines |
| **[`build-skill`](skills/build-skill/SKILL.md)** | `/build-skill [topic]` | Interactive design, sizing, authoring, and empirical dogfooding of agent skills. Enforces design review gate before file creation. | 50 lines |
| **[`derive-skill`](skills/derive-skill/SKILL.md)** | `/derive-skill <url-or-path>` | Evaluates an external skill (source, license, scripts), sorts material into preserve/adapt/reject, and decides new skill, merge, or reject. Hands an approved derivation brief to `build-skill`. | 58 lines |
| **[`inspect-flake-update`](skills/inspect-flake-update/SKILL.md)** | `/inspect-flake-update` | Inspects updated flake.lock inputs, reviews upstream revisions, runs nix flake check, and drafts commit messages. | 46 lines |
| **[`nix-devshell`](skills/nix-devshell/SKILL.md)** | `/nix-devshell` | Authors, extends, validates, and troubleshoots project Nix development shells from repository evidence. | 76 lines |
| **[`verify-slice`](skills/verify-slice/SKILL.md)** | `/verify-slice` | Runs risk-proportional verification and PR review across behavioral, state, security, ergonomic, and regression perspectives using falsifiable assertions. | 37 lines |
| **[`code-review`](skills/code-review/SKILL.md)** | `/code-review` | Inspects diffs across four isolated axes: Spec & Scope (including strategic project alignment), Standards & Smells, Seam & Test Integrity, and Defensive Invariants. | 42 lines |
| **[`code-review`](skills/code-review/SKILL.md)** | `/code-review` | Inspects diffs across four isolated axes: Spec & Scope (including strategic project alignment), Standards & Smells, Seam & Test Integrity, and Defensive Invariants, plus drafting PR comment blocks. | 45 lines |
| **[`tdd`](skills/tdd/SKILL.md)** | `/tdd` | Guides red-green test-driven development through public interface seams, boundary-only mocking, and non-tautological assertions. | 40 lines |
### Vault Extensions (`extensions/`)
| Skill | Status | Purpose |
| :--- | :--- | :--- |
| **[`draft-curation`](extensions/draft-curation/SKILL.md)** | Active | Triages, classifies, and commits incoming notes from an inbox/staging directory into structured lifecycle directories. |
---
## Skill Interaction Matrix
| From \ To | Practice | Diagnose | Git Manager | Journal Builder | Document | Reconcile Docs |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **Practice** | - | yields for production incidents | learner writes message & runs commit | feeds learning edges | optional handoff on key insights | - |
| **Diagnose** | yields if user wants to find cause | - | branches, commits fix & recovers | feeds incident root causes | hands off if RCA reveals non-obvious lesson | - |
| **Git Manager** | learner-controlled in practice/learning | manages branches & packages fixes | - | provides commit history for review | delegates if commit warrants deeper doc | provides commit history |
| **Journal Builder** | hands off unresolved gaps | hands off active defects | assesses commit history | - | hands off candidate journal draft | - |
| **Document** | consumes practice milestones | consumes RCA findings | commits docs if stored in repo | consumes completed journal drafts | - | provides ADRs and plans |
| **Reconcile Docs** | - | - | verifies commit reality & commits docs | - | audits ADRs and plans | - |
| From \ To | Practice | Diagnose | Git Manager | Document | Reconcile Docs |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **Practice** | - | yields for production incidents | learner writes message & runs commit | optional handoff on key insights | - |
| **Diagnose** | yields if user wants to find cause | - | branches, commits fix & recovers | hands off if RCA reveals non-obvious lesson | - |
| **Git Manager** | learner-controlled in practice/learning | manages branches & packages fixes | - | delegates if commit warrants deeper doc | provides commit history |
| **Document** | consumes practice milestones | consumes RCA findings | commits docs in repo `docs/` | - | provides ADRs and plans |
| **Reconcile Docs** | - | - | verifies commit reality & commits docs | audits ADRs, discussions, and plans | - |
---
## Canonical Flows
1. **Investigation to History**: `diagnose` (verify root cause) -> `git-manager` (checkpoint commit) -> `document` (optional Debug Record / ADR).
2. **Deliberate Practice to Knowledge**: `practice` (solve transfer challenge) -> `document` (author durable knowledge article).
3. **Retrospective Scaffolding to Journal**: `journal-builder` (reconstruct facts & question blanks from repository history) -> user fills reasoning -> curation & calibration -> `draft-curation`.
4. **Documentation Reconciliation**: `reconcile-docs` (audit history, code reality, roadmap) -> propose updates to README / ARCHITECTURE / ADRs -> user approves.
5. **Skill Design Loop**: `build-skill` (approve spec) -> dogfood run -> minimal mechanism refinement.
6. **Branch Lifecycle & Integration**: `git-manager` (branch-before-edits or isolated worktree) -> implementation & incremental checkpoint commits -> `code-review` / `verify-slice` -> `git-manager` (rebase or integration).
7. **Issue Planning to PR Delivery**: `gitea-plan` (tiered sizing & falsifiable acceptance criteria) -> `implement-slice` (orchestrates `git-manager` workspace isolation, worker `tdd` checkpoints, pre-committed `verify-slice` QA rubrics, and final-HEAD `code-review`) -> `gitea-pr` (PR synthesis, feedback triage, issue closing).
1. **Investigation to History**: `diagnose` (verify root cause) -> `git-manager` (checkpoint commit) -> `document` (optional Debug Record / ADR in `docs/`).
2. **Deliberate Practice to Knowledge**: `practice` (solve transfer challenge, log in `.internal/practice/`) -> `document` (optional durable knowledge article in `docs/knowledge/`).
3. **Documentation Reconciliation**: `reconcile-docs` (audit repo history, code reality, Gitea state, roadmap) -> propose updates to `README` / `ARCHITECTURE` / `docs/adr/` / `ROADMAP` / `docs/designs/*.md` -> user approves.
4. **Skill Design Loop**: `build-skill` (approve spec) -> dogfood run -> minimal mechanism refinement.
5. **Branch Lifecycle & Integration**: `git-manager` (branch-before-edits or isolated worktree) -> implementation & incremental checkpoint commits -> `code-review` / `verify-slice` -> `git-manager` (rebase or integration).
6. **Issue Planning to PR Delivery**: `gitea-plan` (tiered sizing, 5-column Kanban reconciliation, & falsifiable acceptance criteria) -> `implement-slice` (orchestrates `git-manager` workspace isolation, worker `tdd` checkpoints, pre-committed `verify-slice` QA rubrics, Kanban card transitions, and final-HEAD `code-review`) -> `gitea-pr` (PR synthesis, review comment publishing, feedback triage, merge & `Review -> Completed`).
---
-32
View File
@@ -1,32 +0,0 @@
---
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. Use when triaging 00-inbox/ drafts.
---
# Draft Curation
## 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 authoring fresh documents from conversation: use `document`.
## 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 `.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.
## Done when
- Staged draft is relocated, removed from `00-inbox/`, and repository validation passes cleanly.
## Hands off to
- `git-manager`: to stage and commit curated documents with semantic commit types.
@@ -1,33 +0,0 @@
# 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, then committed following `git-manager` conventions.
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` |
+3 -3
View File
@@ -33,11 +33,11 @@ while [[ $# -gt 0 ]]; do
done
# Active skills to install
ACTIVE_PORTABLE_SKILLS=(build-skill code-review derive-skill diagnose document git-manager gitea-plan gitea-pr gt-usage implement-slice inspect-flake-update journal-builder nix-devshell practice reconcile-docs tdd verify-slice)
ACTIVE_EXTENSION_SKILLS=(draft-curation)
ACTIVE_PORTABLE_SKILLS=(build-skill code-review derive-skill diagnose document git-manager gitea-plan gitea-pr gt-usage implement-slice inspect-flake-update nix-devshell practice reconcile-docs tdd verify-slice)
ACTIVE_EXTENSION_SKILLS=()
# Legacy / deprecated skills to clean up or back up if found in target
OBSOLETE_SKILLS=(engineering-tutor engineering-investigation skill-builder documentation-router inbox-curation commit-logger git-commit git-workspace)
OBSOLETE_SKILLS=(engineering-tutor engineering-investigation skill-builder documentation-router inbox-curation commit-logger git-commit git-workspace journal-builder draft-curation)
OBSOLETE_AGENTS=(anne-droid.md)
check_prerequisites() {
+1 -2
View File
@@ -60,7 +60,7 @@ whether I really understood something), don't make it for me:
## Skills and docs
- My skills live in `~/Projects/active/skills`. Edit them there, never in an installed copy.
- Durable notes default to `~/Brain/00-inbox/`. Use `document` to decide if one is warranted.
- Durable engineering notes default to `docs/` in the active repository (or current directory when outside a repo); personal learning/practice records and intermediate agent artifacts live in gitignored `.internal/` at the repository root. Use `document` to decide if a durable note is warranted.
- For `todo.txt` task files, use non-interactive `tuxedo` CLI subcommands (`tuxedo ls --json`, `tuxedo lsp`, `tuxedo do <N>`, `tuxedo add ...`); never invoke bare `tuxedo`, `tuxedo n`, or the interactive shell alias `todo` in agent subshells (they launch the full-screen TUI or fail to resolve).
## Workspaces and resolution
@@ -69,7 +69,6 @@ whether I really understood something), don't make it for me:
- `~/Projects/active/` (active tools and applications)
- `~/Projects/tests/` (benchmarks, experiments, and spikes)
- `~/Homelab/` Shared space for Homelab's Core and Sites repositories
- `~/Brain/` (knowledge vault)
- `~/Config/` (system and NixOS configuration)
- When resolving a project from task context, search these workspace roots before asking the user.
- To create new projects or repositories, always use `new-repo` (source: `~/Projects/active/new-repo`). It supports organization targeting (`-o`), GitHub push mirroring, licenses, and templates.
+1 -1
View File
@@ -1,6 +1,6 @@
# Learning contract
Rules for any skill with a learning mode (`practice`, `git-manager`, `journal-builder`, `document`).
Rules for any skill with a learning mode (`practice`, `git-manager`, `document`).
The session mode itself is defined in the profile (`AGENTS.md`, "Session mode"). This file
defines what each mode means.
+2 -2
View File
@@ -19,9 +19,9 @@ disable-model-invocation: true
2. **Pick the right tool.** Before writing a skill, check whether it is really:
- a rule that always applies: one line in `AGENTS.md`;
- a fixed command with no judgment: a script;
- a human procedure: a guide in your docs or vault;
- a human procedure: a guide in `docs/`;
- a procedure that needs agent judgment: a skill. Continue.
3. **Check overlap.** List the skills in this repo (`skills/`, `extensions/`). Ask where the new
3. **Check overlap.** List the skills in this repo (`skills/`). Ask where the new
skill stops and which existing skill it hands off to.
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
+19 -19
View File
@@ -2,9 +2,9 @@
name: document
description: >-
Capture decisions, trade-offs, debugging insights, or plans from a session into the
personal knowledge vault (00-inbox/). Use when the user asks to document an insight
or session outcome. For auditing or updating canonical repository documentation
(README, ARCHITECTURE, repository ADRs), use reconcile-docs.
active repository's docs/ directory (or current directory). Use when the user asks
to document an insight or session outcome. For auditing or updating canonical
repository documentation (README, ARCHITECTURE, repository ADRs), use reconcile-docs.
---
# Document
@@ -20,36 +20,36 @@ description: >-
surprising failure, a reusable insight.
2. **Classify by the kind of knowledge, not by the activity that produced it:**
| Knowledge | Type | Spec |
| ----------------------------------------------------- | ------------ | :----------------------------------------------- |
| Why: exploration, alternatives, trade-offs | Discussion | [discussion](references/discussion-authoring.md) |
| What we decided (architecture) | ADR | [adr](references/adr-authoring.md) |
| How to build it: phases, constraints, done-definition | Plan | [plan](references/plan-authoring.md) |
| What broke and why (root cause) | Debug Record | [debug](references/debug-record-authoring.md) |
| A general mental model or technique | Knowledge | [knowledge](references/knowledge-authoring.md) |
| Daily synthesis: facts, reasoning, calibration | Journal | [journal](references/journal-authoring.md) |
| Knowledge | Type | Default Repo Path | Spec |
| ----------------------------------------------------- | ------------ | ------------------- | :----------------------------------------------- |
| Why: exploration, alternatives, trade-offs | Discussion | `docs/discussions/` | [discussion](references/discussion-authoring.md) |
| What we decided (architecture) | ADR | `docs/adr/` | [adr](references/adr-authoring.md) |
| How to build it: phases, constraints, done-definition | Plan | `docs/designs/` | [plan](references/plan-authoring.md) |
| What broke and why (root cause) | Debug Record | `docs/debug/` | [debug](references/debug-record-authoring.md) |
| A general mental model or technique | Knowledge | `docs/knowledge/` | [knowledge](references/knowledge-authoring.md) |
A rich session may justify more than one (e.g. Debug Record + Discussion). Split them; don't write one hybrid document.
3. **Draft** each document following its spec. Read the spec before writing.
4. **Avoid overlap.** Each fact has one owning document: the Discussion owns the reasoning,
4. **Avoid overlap.** Each fact has one owning document: the Discussion owns the reasoning,
the ADR the decision, the Plan the steps, the Debug Record the evidence, Knowledge the
general lesson. Others link to it instead of repeating it.
5. **Keep references portable**: Use relative paths or context-defined placeholders. Never write absolute file-system paths into documentation.
6. **Save** to the location I choose (see below). Discussions and Debug Records are
historical and never rewritten later. ADRs and Plans get `status: superseded` when replaced.
6. **Save** inside the repository or directory where `/document` was called, at the path I confirm.
Discussions and Debug Records are historical and never rewritten later. ADRs and Plans get
`status: superseded` when replaced.
## Your call
- **Type(s)**: confirm the classification from step 2.
- **The key sentence**: before drafting, ask me to state the core in my own words: the
decision, the root cause, or the insight. Build the draft around my sentence.
- **Insights:** when the core insight is unclear, ask about the intent behind important choices, rejected alternatives, and relevant trade-offs. Use these questions to validate the user's understanding, not to expand the scope of the session.
- **Where it goes**: offer 2-3 options, recommended first, e.g.
default notes inbox (from profile) / the project's `docs/` / typed record folder.
- **Where it goes**: offer 2-3 options scoped to the active repository (or current directory if outside a repo), recommended first, e.g.
typed folder (`docs/adr/`, `docs/designs/`, `docs/discussions/`, `docs/debug/`, `docs/knowledge/`) / project `docs/` root / gitignored `.internal/` (when personal-only).
## Done when
- The file exists at the chosen location, or we agreed no document is needed.
- The file exists at the chosen repository-local location, or we agreed no document is needed.
## Hands off to
- `draft-curation`: to review and curate drafts staged into an inbox into lifecycle destinations.
- `git-manager`: to stage and commit the document if it lives directly in a repo.
- `git-manager`: to stage and commit the document if stored in `docs/`.
- `reconcile-docs`: when a new ADR or Plan updates canonical repository architecture or roadmap direction.
@@ -1,63 +0,0 @@
# Journal Authoring Specification
A Daily Journal is an evidence-grounded record of a day's engineering accomplishments, architectural decisions, and human-authored reasoning on key concepts.
---
## 1. Epistemic Role
* **Purpose**: Capture the terminal state of a day's work across projects, record human-authored mental models, and preserve active learning edges for future study.
* **Grounding**: Derived from primary evidence (commit ledger, git history) and user reflection, never from auto-summarized activity narration or promotional praise.
* **Scaffolding vs Review**: In learning mode, the journal begins as an agent-generated scaffold with facts and question blanks. The engineer completes the blanks, and curation adds diagnostic feedback and calibration.
* **Assessment Provenance**: The `assessed_commits` list in YAML frontmatter contains the full 40-character Git commit SHAs incorporated into the journal. This provides a deterministic boundary distinguishing processed history from unassessed ledger events.
---
## 2. Frontmatter Contract
```yaml
---
type: journal
project: brain # or primary project scope
date: YYYY-MM-DD
tags:
- project-name
- technology-or-topic
assessed_commits:
- 42927b9858c1b091bb6e78d3abcf6f9500bd7547
- fee7429a1064193c066b8c20bd6927977599a67f
status: draft | completed
revisit_after: YYYY-MM-DD # optional
---
```
---
## 3. Structural Sections
### 1. Document Title
`# Daily Journal: YYYY-MM-DD`
### 2. Facts (Agent) (`## Facts (Agent)`)
Grouped by project (`### <Project Name>`).
Plain, concise technical facts without promotional adjectives:
- **Commits**: `<short-sha>` description of change.
- **Artifacts**: links to ADRs, plans, debug records.
- **Evidence**: key files touched, test results.
### 3. Learning & Reasoning (User) (`## Learning & Reasoning (User)`)
Numbered prompts derived from substantive architectural changes, invariants, trade-offs, or bug diagnoses:
- `### 1. <Question prompt>`
- User's explanation in their own words.
### 4. Feedback & Calibration (Agent) (`## Feedback & Calibration (Agent)`)
Filled during review/curation after user answers:
- **Assistance**: `independent` | `hints` | `substantial` | `shown-solution`
- **Rubric Checklist**:
- Invariant / Mechanism: [✓ | ✗ | ~] <note>
- Edge cases / Failure modes: [✓ | ✗ | ~] <note>
- Trade-offs / Constraints: [✓ | ✗ | ~] <note>
- **Diagnostic Feedback**: points labeled `correct`, `missing`, `wrong`, or `unsupported`.
### 5. Open / Gaps (`## Open / Gaps`)
Unresolved uncertainties, deferred questions, or edge cases identified during review.
@@ -17,7 +17,7 @@ Create a Knowledge Article when an engineering effort, investigation, practice d
2. **Non-Trivial Mental Model**: The subject involves non-obvious trade-offs, subtle failure modes, or conceptual hurdles that standard API docs or cursory tutorials gloss over.
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
### Target Placement within the Repository (`docs/knowledge/` or `.internal/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`).
@@ -26,14 +26,14 @@ Create a Knowledge Article when an engineering effort, investigation, practice d
## 2. When NOT to Create a Knowledge Article
To prevent vault bloat and respect epistemic boundaries, do **NOT** create a Knowledge Article for:
To prevent documentation bloat and respect epistemic boundaries, do **NOT** create a Knowledge Article for:
* **Session Transcripts & Raw Notes**: Temporary meeting logs, scratch notes, or raw command histories (keep in `00-inbox/` or discard).
* **Project Implementation Blueprints**: Roadmaps, milestone breakdowns, or task tickets for building a specific feature (use **Plan** $\to$ `01-plans/`).
* **Point-in-Time Architectural Commitments**: Decisions selecting a specific stack, framework, or model for a specific repository (use **ADR** $\to$ `03-records/decisions/`).
* **Historical Failure Postmortems**: Empirical diagnosis and logs of a specific broken system or production outage (use **Debug Record** $\to$ `03-records/debug/`).
* **Project Discussions & Trade-offs**: Debates exploring competing directions for a specific system (use **Discussion** $\to$ `02-discussions/`).
* **Runbooks & Operational SOPs**: Step-by-step procedures for administering a specific deployed service (use **Guide** $\to$ `04-learning/guides/`).
* **Session Transcripts & Raw Notes**: Temporary meeting logs, scratch notes, or raw command histories (keep in gitignored `.internal/` or discard).
* **Project Implementation Blueprints**: Roadmaps, milestone breakdowns, or task tickets for building a specific feature (use **Plan** $\to$ `docs/designs/`).
* **Point-in-Time Architectural Commitments**: Decisions selecting a specific stack, framework, or model for a specific repository (use **ADR** $\to$ `docs/adr/`).
* **Historical Failure Postmortems**: Empirical diagnosis and logs of a specific broken system or production outage (use **Debug Record** $\to$ `docs/debug/`).
* **Project Discussions & Trade-offs**: Debates exploring competing directions for a specific system (use **Discussion** $\to$ `docs/discussions/`).
* **Runbooks & Operational SOPs**: Step-by-step procedures for administering a specific deployed service (use **Guide** $\to$ `docs/guides/`).
* **Shallow API Summaries**: Regurgitating command flags or library cheatsheets that are better found by typing `--help` or reading upstream documentation.
---
@@ -52,8 +52,8 @@ Knowledge Articles coexist cleanly with other epistemic documents by enforcing s
### Rule of Epistemic Purpose
The same engineering lesson may inform multiple artifacts, but each must serve its native purpose:
* An investigation post-mortem records the raw failure in a **Debug Record** (`03-records/debug/`).
* If the root cause exposed a generalizable diagnostic technique or systems principle, that principle is abstracted into a **Knowledge Article** (`04-learning/knowledge/methods/`), omitting the incident's transient logs.
* An investigation post-mortem records the raw failure in a **Debug Record** (`docs/debug/`).
* If the root cause exposed a generalizable diagnostic technique or systems principle, that principle is abstracted into a **Knowledge Article** (`docs/knowledge/methods/` or `.internal/knowledge/methods/`), omitting the incident's transient logs.
---
+6 -3
View File
@@ -19,9 +19,11 @@ description: >-
## Steps
1. **Reconcile artifacts bidirectionally.** Check specs, roadmaps, assets, and Gitea
state for contradictions. Flag zombie in-progress, premature done, or horizon
divergence conflicts before planning new work. See
[references/decomposition-tiers.md](references/decomposition-tiers.md).
state for contradictions. Flag zombie in-progress, premature completed, or horizon
divergence conflicts before planning new work. When closing a milestone or before
decomposing the next rolling milestone, if `ARCHITECTURE.md`, `ROADMAP.md`, or
`docs/designs/*.md` lag behind `Completed` board cards, hand off to `reconcile-docs`
first. See [references/decomposition-tiers.md](references/decomposition-tiers.md).
2. **Assess scope and select tier.** Assign `Small`, `Medium`, or `Large`.
Emit explicit `### Project Board Policy: <Omitted|Recommended|Required> (Rationale)`.
3. **Decompose into deliverable outcome slices.** Map work into verifiable issues
@@ -70,3 +72,4 @@ description: >-
- `implement-slice`: to orchestrate end-to-end delivery of an approved issue or slice.
- `git-manager`: to create dedicated branches or worktrees for decomposed issues.
- `gitea-pr`: to link, review, and close issues via pull requests.
- `reconcile-docs`: when canonical docs or design specs lag behind completed slices or milestone boundaries.
+3 -2
View File
@@ -17,13 +17,13 @@ description: >-
- Not inside an already-delegated implementation worker task: follow the assigned worker contract (`tdd`, `git-manager`) without re-invoking `implement-slice`.
## Steps
1. **Preflight branch check, readiness audit, and `Backlog -> Ready`.** Check session mode per `profile/AGENTS.md`. Classify working tree per [handoff-contracts](references/handoff-contracts.md) (`CLEAN_BASE`, `ADOPTABLE_DIFF`, `CONFLICTING_STATE`, `WRONG_BASE`). Stop on conflicts. Read target Gitea issue/milestone/board state via `gt issue`, `gt milestone`, direction docs (`ARCHITECTURE.md`, `ROADMAP.md`, `AGENTS.md`), and `git status --short`. Reconcile issue acceptance criteria against current `HEAD` (updating the Gitea issue after owner approval if earlier slices shifted contracts) and, when `--dry-run` is not active, move the issue card `Backlog -> Ready` on the project board. Hand off to `gitea-plan` if tracking issues must be created first.
1. **Preflight branch check, readiness audit, and `Backlog -> Ready`.** Check session mode per `profile/AGENTS.md`. Classify working tree per [handoff-contracts](references/handoff-contracts.md) (`CLEAN_BASE`, `ADOPTABLE_DIFF`, `CONFLICTING_STATE`, `WRONG_BASE`). Stop on conflicts. Read target Gitea issue/milestone/board state via `gt issue`, `gt milestone`, direction docs (`ARCHITECTURE.md`, `ROADMAP.md`, `docs/designs/*.md`, `AGENTS.md`), and `git status --short`. Reconcile issue acceptance criteria against current `HEAD` (handing off to `reconcile-docs` if canonical design docs drifted during upstream slices, or updating the Gitea issue after owner approval) and, when `--dry-run` is not active, move the issue card `Backlog -> Ready` on the project board. Hand off to `gitea-plan` if tracking issues must be created first.
2. **Select orchestration topology (`complexity x risk`).** Combine planning size with assurance risk per [orchestration-tiers](references/orchestration-tiers.md). Keep pure-orchestrator invariants: retain plan, status, commit SHAs, QA dispositions, blockers; never edit implementation files, repair Git via code edits, self-certify QA, or ingest full test logs unless resolving a failure.
3. **Lock Planned Workflow and pre-committed rubrics.** Formulate the Planned Workflow using the Canonical Node Schema (5-tuples: `node_id`, `claim`, `method`, `executor`, `pass_condition`). Project a dynamic Mermaid diagram deriving directly from node IDs with visible rework edges. If `--dry-run` is active, halt after displaying the plan (enforce 0 file changes, 0 commits, 0 remote calls). Hard gate: pause for human approval.
4. **Move card `Ready -> Work in Progress`, assign workspaces, and delegate.** Once the human approves Step 3, move the issue card `Ready -> Work in Progress` on the project board per [handoff-contracts](references/handoff-contracts.md). Govern branch/worktree lifecycle through `git-manager` per [orchestration-tiers](references/orchestration-tiers.md). Dispatch worker subagent(s) with the Implementation Assignment in [handoff-contracts](references/handoff-contracts.md). Never run concurrent workers in the same working tree. Update the runtime Execution Record table as nodes change state.
5. **Audit worker reports and run rubric QA.** Verify worker reports via read-only Git checks. Spawn read-only QA subagents running `verify-slice` against pre-committed rubrics. Update Execution Record with concrete evidence (SHA, exit codes).
6. **Triage outcomes and route rework.** Classify failures using [handoff-contracts](references/handoff-contracts.md): route code defects to existing worker via `send_message`; record justified rubric amendments if criteria change. Loop Steps 4-6 until all nodes pass.
7. **Enforce final-HEAD evidence, move card `Work in Progress -> Review`, and integrate.** Confirm `code-review` (`Ready`) and `verify-slice` match the exact final `HEAD` and base, then move the issue card `Work in Progress -> Review` on the project board. Present the Execution Deviation Report (skipped/added checks, rework iterations, scope drift). Integrate per [orchestration-tiers](references/orchestration-tiers.md) Policy Matrix: fast-forward merge (and move card `Review -> Completed`) if repo `AGENTS.md` permits and user approves, else hand off to `gitea-pr`.
7. **Enforce final-HEAD evidence, move card `Work in Progress -> Review`, and integrate.** Confirm `code-review` (`Ready`) and `verify-slice` match the exact final `HEAD` and base, then move the issue card `Work in Progress -> Review` on the project board. Present the Execution Deviation Report (skipped/added checks, rework iterations, scope drift; if scope drift evolved a contract in `docs/designs/*.md` or `ARCHITECTURE.md`, prompt to run `reconcile-docs` before the next slice). Integrate per [orchestration-tiers](references/orchestration-tiers.md) Policy Matrix: fast-forward merge (and move card `Review -> Completed`) if repo `AGENTS.md` permits and user approves, else hand off to `gitea-pr`.
## Your call
- **Session mode**: decide whether to switch from `learning` to `delivery` before autonomous delegation.
@@ -42,3 +42,4 @@ description: >-
- `code-review`: for final-slice 4-axis static and strategic alignment inspection.
- `diagnose`: when an unexpected failure requires evidence-first root-cause investigation.
- `gitea-pr`: when policy or remote CI mandates a pull request and final-`HEAD` packets are ready.
- `reconcile-docs`: when upstream slices or approved scope drift leave canonical docs or design specs out of sync with `HEAD`.
@@ -89,7 +89,7 @@ Updated dynamically in orchestrator turns:
- **Skipped Checks**: <None | List of skipped checks with explicit rationale>
- **Added Checks**: <None | New checks introduced in response to findings>
- **Rework Iterations**: <0 | Details of remediation loops and commit references>
- **Scope Drift**: <None | Differences between planned and actual seams>
- **Scope Drift**: <None | Differences between planned and actual seams; if an approved contract evolution leaves `docs/designs/*.md` or `ARCHITECTURE.md` stale, flag a `reconcile-docs` handoff before the next slice>
```
### Dynamic Mermaid Projection Rules
-58
View File
@@ -1,58 +0,0 @@
---
name: journal-builder
description: >-
Turn a day's engineering history into a factual journal and learning scaffold.
Produces facts and question blanks for the user to answer, then evaluates them.
---
# Journal Builder
## Use when
- `/journal-builder [YYYY-MM-DD]` or `/journal [YYYY-MM-DD]` (defaults to today).
- End of a workday or sprint to record facts and practice recalling key reasoning.
- Not for standalone changelogs: use git log directly.
- Not for deliberate coding practice drills: use `practice`.
## Steps
1. **Target the day and check history.** Establish date from argument or today.
Check if a draft scaffold exists for that date with filled answers; if so, skip to step 5.
Read events from repository `git log` or session history.
- **Provenance check**: Read `assessed_commits` across existing journals. Only events
whose full 40-character SHA is absent proceed as unassessed work.
- **Backlog check**: If unassessed events exist from prior dates, surface them and ask
whether to process the older backlog chronologically first.
- **Resolve locations**: Resolve project identities to local paths using agent profile.
2. **Reconstruct facts.** Inspect repositories (diffs, tests, docs). Group by project:
commit SHAs, files touched, passing/failing tests, and links to ADRs or plans.
3. **Formulate learning questions.** Follow the learning contract. Select 0-3 questions
from substantive work (architectural decisions, invariants, trade-offs, hard bugs).
Skip routine work. Prepare hidden expected answers grounded in the diffs. Zero questions
is a valid outcome if work was routine.
4. **Author scaffold draft.**
- **Learning mode** (session mode, see profile): write draft with `status: draft`. Include
`assessed_commits`, `## Facts (Agent)` grouping commits and artifacts, `## Learning & Reasoning (User)`
with question headers and blanks (`[Your answer / explanation]`), and an empty `## Open / Gaps`.
Stage draft in configured notes inbox (e.g. `00-inbox/`) and prompt me to fill the blanks.
- **Delivery mode**: draft concise facts and brief summary without blanks, avoiding promotional
praise ("masterfully", "expert").
5. **Review completed scaffold.** When evaluating a filled draft:
- Check answers against code evidence and invariants.
- Fill `## Feedback & Calibration (Agent)`: label points (`correct`, `missing`, `wrong`,
`unsupported`) and provide calibration rubric checklist (Invariant, Edge cases, Trade-offs)
with assistance level.
- Keep my original wording intact; never overwrite my answers with AI summaries.
- Move unresolved points to `## Open / Gaps`. Set `status: completed`.
6. **Hand off to `document` or `draft-curation`.** Pass completed journal to stage or relocate.
## Your call
- **Backlog triage**: whether to process older unassessed work before today.
- **Review questions**: whether questions target the right decisions, or to skip any question.
- **Save destination**: confirm final journal location (default: `03-records/journal/YYYY-MM-DD.md`).
## Done when
- Scaffold draft is staged with blanks (Phase 1), or filled scaffold is evaluated and completed (Phase 2).
## Hands off to
- `draft-curation`: to curate and relocate completed journal from inbox to canonical archive.
- `practice`: if an unresolved gap warrants an isolated deliberate practice drill.
- `diagnose`: if reflection identified an active, unexplained system failure.
+4 -3
View File
@@ -16,9 +16,10 @@ description: >-
## Steps
1. **Check overdue revisits.** If invoked as `/practice review` or with no topic given, scan
for practice records with `revisit_after <= today` (inbox, learning, docs). If any exist,
surface up to 3 and ask whether to review one or start a new topic. When reviewing,
execute recall-before-reveal per [references/revisit-protocol.md](references/revisit-protocol.md).
for practice records with `revisit_after <= today` in gitignored `.internal/practice/` (and
`docs/` if present). If any exist, surface up to 3 and ask whether to review one or start a
new topic. When reviewing, execute recall-before-reveal per
[references/revisit-protocol.md](references/revisit-protocol.md).
2. **Establish target.** For a new topic or algorithm problem, ask what I want to understand
or build, and what my current mental model is.
3. **Help at lowest level that works**, moving up only when I am stuck:
@@ -1,7 +1,7 @@
# Practice Record Template
Default location: configured notes inbox (or project `docs/`) as `practice-YYYY-MM-DD-<topic>.md`.
Before saving, ask where it goes (2-3 options, configured notes inbox recommended).
Default location: gitignored `.internal/practice/practice-YYYY-MM-DD-<topic>.md` at the repository root (or current directory). Ensure `.internal/` is listed in `.gitignore`.
Before saving, confirm whether to save to `.internal/practice/` (recommended) or discard.
```markdown
---
@@ -7,9 +7,8 @@ Protocol for spacing and successive relearning in `practice`. Implements recall-
## 1. Discovery
When `/practice` runs without arguments, or with `/practice review`, scan for existing practice records in:
- Notes inbox (e.g. `00-inbox/` or configured vault inbox)
- Learning guides (e.g. `04-learning/`)
- Project-local documentation (e.g. `docs/`)
- Repository-local `.internal/practice/` (gitignored personal practice records)
- Project-local documentation (`docs/` if present)
Filter for markdown files where frontmatter has `type: practice` and `revisit_after` is on or before today's date (`YYYY-MM-DD`). If matches exist, surface up to 3 due topics and ask whether to review one or start a new topic.
+15 -12
View File
@@ -2,30 +2,32 @@
name: reconcile-docs
description: >-
Audit, reconcile, and generate canonical repository documentation (README.md,
ARCHITECTURE.md, docs/adr/, ROADMAP.md) against commit history, code reality,
and active plans. Use when updating a repository's official documentation.
For capturing session notes or personal insights into the vault, use document.
ARCHITECTURE.md, docs/adr/, ROADMAP.md, docs/designs/*.md) against commit
history, code reality, Gitea delivery state, and active plans. Use when
updating a repository's official documentation. For capturing a single
session's decision, debug record, or insight into repo docs, use document.
---
# Reconcile Docs
## Use when
- `/reconcile-docs [history-path]`: audit or reconcile repository documentation against history and active plans.
- Not for capturing a single session's insight (use `/document`).
- Not for triaging inbox notes into vault directories (use `draft-curation`).
- `/reconcile-docs [history-path]`: audit or reconcile repository documentation against history, Gitea state, and active plans.
- Closing a milestone or resolving mid-milestone design spec drift flagged by `code-review` or `implement-slice`.
- Not for capturing a single session's insight or incident record (use `/document`).
## Steps
1. **Discover Present State.** Inspect working-tree status, repository source, tests, configuration, and existing docs. Build a present-state inventory of components, responsibilities, boundaries, and dependencies.
2. **Reconstruct History.** Read chronological notes and commit history from the provided history source (vault records, discussions, previous ADRs). Extract decisions, rejected alternatives, migrations, constraints, and incidents. Classify each observation.
3. **Extract Future Intent.** Identify active plans, roadmaps, and open proposals. Classify each as committed, planned, exploratory, or superseded.
4. **Reconcile and Detect Conflicts.** Correlate past claims, present code reality, and future plans using [references/reconciliation-matrix.md](references/reconciliation-matrix.md). Flag contradictions (such as historical claims contradicted by code, or plans masquerading as current implementation).
1. **Discover Present State.** Inspect working-tree status, repository source, tests, configuration, `AGENTS.md`, and existing docs. Build a present-state inventory of components, responsibilities, boundaries, and dependencies.
2. **Reconstruct History.** Read chronological notes and commit history from the repository (`git log`, `docs/discussions/`, `docs/debug/`, `docs/adr/`, or an optional history path) and, when a Gitea remote exists, read merged PRs and published `code-review` PR comments/reviews via `gt` (using `gt-usage` read-only queries). Extract decisions, accepted trade-offs, mid-slice contract pivots, rejected alternatives, migrations, and incidents.
3. **Extract Future Intent.** Identify active plans, roadmaps (`ROADMAP.md`, `docs/designs/*.md`), and, when a Gitea remote exists, read open/closed Gitea milestones, issues, and Project Board column placement (`Completed` vs. `Backlog`, `Ready`, `Work in Progress`, `Review`) read-only via `gt`. Classify each item as committed, planned, exploratory, or superseded. Never mutate Gitea issues, PRs, or board cards.
4. **Reconcile and Detect Conflicts.** Correlate past claims, present code reality, and future plans using [references/reconciliation-matrix.md](references/reconciliation-matrix.md). Flag contradictions (historical claims contradicted by code, mid-slice spec drift in `docs/designs/*.md`, or `Backlog` plans masquerading as current implementation).
5. **Human Checkpoint.** Present a Reconciliation Report following [references/checkpoint-format.md](references/checkpoint-format.md) listing present architecture, recovered decisions, resolved and unresolved conflicts, and proposed document mutations. Stop for user approval.
6. **Draft or Update Canonical Docs.** Once approved, generate or update target artifacts following [references/doc-contracts.md](references/doc-contracts.md) in order:
- `README.md` (identity, purpose, high-level navigation)
- `ARCHITECTURE.md` (canonical present-state system model only)
- `docs/adr/` (accepted or superseded decision records with context)
- `ROADMAP.md` (intentional future direction only)
7. **Verify Consistency.** Run cross-document consistency checks: verify no future claims in ARCHITECTURE, no obsolete claims in README, consistent terminology, and valid links.
- `ROADMAP.md` (intentional future direction and completed milestones)
- `docs/designs/*.md` (when an active multi-slice design spec has drifted behind merged slices)
7. **Verify Consistency.** Run cross-document consistency checks: verify no future claims in ARCHITECTURE, no obsolete claims in README or active design specs, consistent terminology, and valid links.
## Your call
- History source location if not specified or ambiguous.
@@ -38,3 +40,4 @@ description: >-
## Hands off to
- `git-manager`: for branch setup or committing updated documentation files.
- `gitea-plan`: when reconciled `ROADMAP.md` or `docs/designs/*.md` require new or updated Gitea milestones, issues, or board reconciliation.
@@ -24,7 +24,7 @@ During Step 5 of `reconcile-docs`, the agent pauses before modifying or creating
## 4. Conflict Log
| Conflict | Source Claim | Code Evidence | Proposed Resolution |
| :--- | :--- | :--- | :--- |
| Historical Contradiction | [e.g. Brain notes claim PostgreSQL] | [Code uses SQLite WAL] | [Supersede note, draft migration ADR] |
| Historical Contradiction | [e.g. Earlier discussion claims PostgreSQL] | [Code uses SQLite WAL] | [Supersede note, draft migration ADR] |
| Premature Promotion | [e.g. Plan states gRPC API ready] | [Only REST API exists] | [Move to ROADMAP near-term] |
| Zombie Documentation | [e.g. README mentions Worker daemon] | [Worker removed in commit abc1234] | [Remove from README/ARCHITECTURE] |
@@ -99,3 +99,14 @@ Only items that represent intentional, validated future trajectory belong here.
### Contract Invariants
- Never include implemented features as active roadmap items.
- Avoid dumping every scratchpad TODO into the roadmap; include only items with deliberate commitment or research interest.
---
## 5. Active Design Specifications (docs/designs/*.md)
**Core Question**: What is the approved technical specification for an active multi-slice feature or epic?
### Contract Invariants
- When an earlier slice in a multi-slice milestone intentionally evolves a shared interface, config schema, or error taxonomy on `main` (and codifies it in `AGENTS.md` or PR review comments), update the affected sections of `docs/designs/*.md` so subsequent slices (`implement-slice` Step 1) do not build against stale contracts.
- Never modify read-only historical proof-of-concept directories (`docs/poc/`).
@@ -8,9 +8,11 @@ Treat each source according to its temporal role and authority:
| Source | Temporal role | Epistemic authority |
| :--- | :--- | :--- |
| Chronological records (vault notes, logs, discussions) | Past | Historical evidence. Explains how the system arrived here. |
| Repository implementation (code, tests, configuration) | Present | Canonical technical truth. Determines what the system is right now. |
| Existing repository documentation | Present | Canonical unless contradicted by current implementation. |
| Chronological records (`git log`, `docs/discussions/`, `docs/debug/`) | Past | Historical evidence. Explains how the system arrived here. |
| Merged PRs & published `code-review` comments (`gt pr`) | Past -> Present | Primary record of slice-level contract evolutions, accepted trade-offs, and deferred nits. |
| Repository implementation (code, tests, configuration, `AGENTS.md`) | Present | Canonical technical truth. Determines what the system is right now. |
| Existing repository documentation (`ARCHITECTURE.md`, `docs/designs/*.md`) | Present | Canonical unless contradicted by current implementation. |
| Gitea Milestones & Project Board (`Completed` vs. `Backlog`/`Ready`) | Present -> Future | Read-only delivery state: `Completed` cards are present truth; `Backlog`/`Ready` cards are future intent. |
| Active plans (roadmaps, proposals, pending designs) | Future | Planned intent. Describes where the system may go next. |
| ADRs | Past -> Present | Historical decision record that remains valid until superseded. |
| ROADMAP | Future | Intended technical trajectory. |
@@ -53,3 +55,8 @@ Flag contradictions explicitly during reconciliation rather than quietly smoothi
### Amnesiac Implementation
- *Symptom*: The codebase contains complex boundaries, non-standard conventions, or unusual workarounds, but history contains no explanation.
- *Resolution*: Document the current reality in `ARCHITECTURE.md` and surface an ADR candidate during the Step 5 human checkpoint so the engineer can supply the missing rationale.
### Mid-Slice Spec Drift
- *Symptom*: A merged slice intentionally evolved a shared type, configuration model, error class, or boundary (documented in `AGENTS.md` or PR review comments), leaving an active design specification (`docs/designs/*.md`) or `ARCHITECTURE.md` referencing the pre-slice contract.
- *Resolution*: Reconcile the affected sections of `docs/designs/*.md` and `ARCHITECTURE.md` to match the merged implementation on `main` before downstream slices execute.
+48 -2
View File
@@ -15,6 +15,7 @@ Verifies:
9. Skill inventory, line count (<= 80), em-dash absence, and path portability
10. Review comment publishing ownership (code-review drafts, gitea-pr posts with guards)
11. Project board 5-column reconciliation, semantic hex colors, and transition ownership
12. reconcile-docs read-only Gitea ingestion and bidirectional hooks with gitea-plan / implement-slice
"""
import os
@@ -40,7 +41,6 @@ EXPECTED_SKILLS = [
"gt-usage",
"implement-slice",
"inspect-flake-update",
"journal-builder",
"nix-devshell",
"practice",
"reconcile-docs",
@@ -428,8 +428,54 @@ class TestSkillsBehavioralContracts(unittest.TestCase):
"code-review must remain read-only and never execute project board card moves",
)
def test_reconcile_docs_gitea_ingestion_and_hooks(self):
"""Proves reconcile-docs ingests Gitea state read-only and hooks into gitea-plan and implement-slice."""
rd_dir = REPO_ROOT / "skills" / "reconcile-docs"
rd_skill = (rd_dir / "SKILL.md").read_text()
rd_all = "\n".join(p.read_text() for p in rd_dir.rglob("*.md"))
plan_skill = (REPO_ROOT / "skills" / "gitea-plan" / "SKILL.md").read_text()
impl_skill = (REPO_ROOT / "skills" / "implement-slice" / "SKILL.md").read_text()
# 1. reconcile-docs reads Gitea PR comments and board state, and targets docs/designs/*.md
self.assertIn("docs/designs/*.md", rd_skill)
self.assertIn("Project Board", rd_skill)
self.assertIn("Never mutate Gitea issues, PRs, or board cards", rd_skill)
self.assertIn("Mid-Slice Spec Drift", rd_all)
self.assertIsNone(
re.search(r"(/projects/[^\n]*/move|gt (issue|pr|project) (create|edit|close|merge))", rd_all),
"reconcile-docs must never mutate Gitea issues, PRs, or project boards",
)
# 2. Bidirectional hooks across reconcile-docs, gitea-plan, and implement-slice
self.assertIn("gitea-plan", rd_skill)
self.assertIn("reconcile-docs", plan_skill)
self.assertIn("reconcile-docs", impl_skill)
def test_repo_scoped_documentation_and_vault_deprecation(self):
"""Proves ~/Brain, 00-inbox, draft-curation, and journal-builder are deprecated in favor of repo docs/ and .internal/."""
doc_dir = REPO_ROOT / "skills" / "document"
doc_all = "\n".join(p.read_text() for p in doc_dir.rglob("*.md"))
prac_dir = REPO_ROOT / "skills" / "practice"
prac_all = "\n".join(p.read_text() for p in prac_dir.rglob("*.md"))
profile_agents = (REPO_ROOT / "profile" / "AGENTS.md").read_text()
install_sh = (REPO_ROOT / "install.sh").read_text()
# 1. No ~/Brain, 00-inbox, or draft-curation in active skills or profile
for forbidden in ("~/Brain", "00-inbox", "draft-curation", "journal-builder"):
self.assertNotIn(forbidden, doc_all)
self.assertNotIn(forbidden, prac_all)
self.assertNotIn(forbidden, profile_agents)
# 2. Repo-scoped paths present
self.assertIn("docs/adr/", doc_all)
self.assertIn("docs/designs/", doc_all)
self.assertIn(".internal/practice/", prac_all)
self.assertIn("OBSOLETE_SKILLS=(", install_sh)
self.assertIn("journal-builder", install_sh)
self.assertIn("draft-curation", install_sh)
def test_skill_inventory_and_skeletons(self):
"""Proves all 17 active skills meet line count (<= 80), em-dash, and path portability rules."""
"""Proves all 16 active skills meet line count (<= 80), em-dash, and path portability rules."""
for skill_name in EXPECTED_SKILLS:
skill_path = REPO_ROOT / "skills" / skill_name / "SKILL.md"
self.assertTrue(skill_path.exists(), f"Missing skill file: {skill_path}")