From a1c03360d1aa240136e5f1f24835fcedc1409063 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Thu, 8 Oct 2026 00:13:18 -0500 Subject: [PATCH] feat(reconcile-docs): add documentation reconciliation pipeline skill Introduce the reconcile-docs skill to audit, reconcile, and author canonical repository documentation (README, ARCHITECTURE, ROADMAP, docs/adr/) across three temporal epistemic sources: - Past (Brain/history records): historical evidence and decision rationale. - Present (repository code and working tree): canonical technical truth. - Future (active plans): planned direction and proposals. Features: - Step 1-7 workflow with a mandatory Step 5 Human Checkpoint. - Epistemic authority rules and conflict typology (reconciliation-matrix.md). - Target documentation responsibilities and skeletons (doc-contracts.md). - Structured Reconciliation Report template (checkpoint-format.md). - Registered in install.sh active portable skills and README index. --- README.md | 1 + install.sh | 2 +- skills/reconcile-docs/SKILL.md | 37 +++++++ .../references/checkpoint-format.md | 48 +++++++++ .../references/doc-contracts.md | 101 ++++++++++++++++++ .../references/reconciliation-matrix.md | 55 ++++++++++ 6 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 skills/reconcile-docs/SKILL.md create mode 100644 skills/reconcile-docs/references/checkpoint-format.md create mode 100644 skills/reconcile-docs/references/doc-contracts.md create mode 100644 skills/reconcile-docs/references/reconciliation-matrix.md diff --git a/README.md b/README.md index 2bb6cba..19e2b41 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ Every skill features an explicit **"Your call"** checkpoint where the agent paus | **[`git-commit`](skills/git-commit/SKILL.md)** | `/git-commit` | Working-tree inspection, atomic slice decomposition, and Conventional Commit drafting. Human approves every commit. | 54 lines | | **[`document`](skills/document/SKILL.md)** | `/document` | Second-order knowledge classifier (Discussion, ADR, Plan, Debug Record, Knowledge). User confirms type and provides core insight. | 49 lines | | **[`journal-builder`](skills/journal-builder/SKILL.md)** | `/journal-builder` or `/journal` | Retrospective inquiry from engineering history. Probes understanding and discovers learning edges. | 56 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). | 37 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. | 48 lines | ### Vault Extensions (`extensions/`) diff --git a/install.sh b/install.sh index 3a3b5dd..4c5c810 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,7 @@ while [[ $# -gt 0 ]]; do done # Active skills to install -ACTIVE_PORTABLE_SKILLS=(build-skill diagnose document git-commit journal-builder practice) +ACTIVE_PORTABLE_SKILLS=(build-skill diagnose document git-commit journal-builder practice reconcile-docs) ACTIVE_EXTENSION_SKILLS=(draft-curation commit-logger) # Legacy / deprecated skills to clean up or back up if found in target diff --git a/skills/reconcile-docs/SKILL.md b/skills/reconcile-docs/SKILL.md new file mode 100644 index 0000000..8dec2ea --- /dev/null +++ b/skills/reconcile-docs/SKILL.md @@ -0,0 +1,37 @@ +--- +name: reconcile-docs +description: >- + Reconcile historical evidence, present code reality, and future plans into canonical repository documentation. Use when typing /reconcile-docs to audit, update, or generate README, ARCHITECTURE, ROADMAP, or ADRs. +--- + +# 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`). + +## 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). +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. + +## Your call +- History source location if not specified or ambiguous. +- Reconciliation conflict resolutions: whether to supersede, document migration, or drop stale claims. +- Approval of the Reconciliation Report before writing any documentation file. +- Which suggested ADR candidates warrant writing. + +## Done when +- The Reconciliation Report is approved by the user, canonical documentation files are written or updated, and consistency validation passes cleanly. + +## Hands off to +- `git-commit`: to review diffs and commit updated documentation files. diff --git a/skills/reconcile-docs/references/checkpoint-format.md b/skills/reconcile-docs/references/checkpoint-format.md new file mode 100644 index 0000000..38fe68b --- /dev/null +++ b/skills/reconcile-docs/references/checkpoint-format.md @@ -0,0 +1,48 @@ +# Human Checkpoint Report Format + +During Step 5 of `reconcile-docs`, the agent pauses before modifying or creating any files. Present this structured Reconciliation Report for explicit user review and approval. + +## Report Structure + +```markdown +# Documentation Reconciliation Report + +## 1. Present State Summary +- Core components identified in codebase: [list verified components] +- Key boundaries and dependencies: [list verified boundaries] +- Existing docs audit: [e.g. README is obsolete, ARCHITECTURE missing] + +## 2. Historical Discoveries +- Recovered decisions: [list decisions with date and context] +- Pivots and migrations: [list architectural changes confirmed by history] +- Identified constraints / incidents: [list discovered items] + +## 3. Future Intent +- Active roadmap candidates: [list validated near/medium term items] +- Filtered out proposals: [list abandoned or superseded notes excluded from roadmap] + +## 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] | +| 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] | + +## 5. Proposed File Actions +| Target File | Action | Summary of Changes | +| :--- | :--- | :--- | +| `README.md` | Update | Align quick start, prune dead features, link architecture | +| `ARCHITECTURE.md` | Create | Document verified present component topology and boundaries | +| `docs/adr/0001-*.md` | Create | Record rationale for core architectural choices | +| `ROADMAP.md` | Update | Align future milestones with active plans | + +## 6. Open Decisions for You +1. [Specific conflict or ADR candidate requiring user confirmation] +2. [Ambiguous rationale requiring engineer input] +``` + +## Checkpoint Rules + +1. **Hard Pause**: Never start Step 6 (drafting/modifying files) until the user explicitly confirms the proposed actions. +2. **Surface Gaps Honestly**: If an architectural component has no discovered rationale, highlight it in "Open Decisions for You" rather than inventing a backstory. +3. **Editable Options**: Offer concrete options if there is ambiguity regarding whether an abandoned proposal should be documented in an ADR or omitted entirely. diff --git a/skills/reconcile-docs/references/doc-contracts.md b/skills/reconcile-docs/references/doc-contracts.md new file mode 100644 index 0000000..7d86515 --- /dev/null +++ b/skills/reconcile-docs/references/doc-contracts.md @@ -0,0 +1,101 @@ +# Documentation Contracts + +Each reconciled fact belongs in exactly one primary repository document. Follow these boundaries and structures during Step 6 of `reconcile-docs`. + +## 1. README.md + +**Core Question**: What is this project, why does it matter, and how do I get started? + +Keep this file intentionally shallow. It is a portal, not an architectural encyclopedia. + +### Standard Sections +- **Project Identity & Title**: Name and one-sentence purpose. +- **Problem Statement**: What problem does this solve and why build it? +- **Key Capabilities**: Core user-facing features or operational strengths. +- **High-Level Overview**: A concise 10,000-foot summary (or brief diagram). +- **Quick Start / Usage**: Fast install or run commands. +- **Repository Navigation**: Pointers to deeper technical documents (`ARCHITECTURE.md`, `ROADMAP.md`, `docs/adr/`). + +### Contract Invariants +- Never detail component internals, internal schemas, or low-level data flows here (belongs in `ARCHITECTURE.md`). +- Never list speculative feature ideas here (belongs in `ROADMAP.md`). + +--- + +## 2. ARCHITECTURE.md + +**Core Question**: How does the system currently work? + +This represents the canonical present-state technical model. + +### Standard Sections +- **System Overview**: High-level topology and architectural style. +- **Architectural Principles**: Non-negotiable system invariants (e.g. offline-first, immutable ledgers). +- **Components & Responsibilities**: Explicit inventory of subsystems and their boundaries. +- **Data Flow & Lifecycle**: How information traverses the system from entry to persistence. +- **Boundaries**: Runtime, process, network, persistence, and security boundaries. +- **Dependencies**: Key libraries, external services, or system prerequisites. +- **Architectural Constraints**: Hardware, platform, or performance limits. +- **Decision Log Index**: Links to active ADRs in `docs/adr/`. + +### Contract Invariants +- Describes strictly what exists in the repository right now. +- Never write future plans or aspirational designs into this file. +- If a component does not exist in the codebase, it must not appear here. + +--- + +## 3. ADRs (docs/adr/) + +**Core Question**: Why was an important architectural decision made? + +ADRs preserve rationale, trade-offs, and rejected alternatives. Use MADR format (or the repository's established convention). + +### Standard Template (MADR) +```markdown +# ADR-XXXX: [Title] + +- Status: [Accepted | Superseded by ADR-YYYY | Deprecated] +- Date: YYYY-MM-DD +- Deciders: [Names / Roles] + +## Context and Problem Statement +What was the technical challenge, context, or constraint requiring a decision? + +## Decision Outcome +Chosen option: "[Option]", because [justification based on constraints]. + +## Consequences +- Positive: [Positive outcomes and capabilities unlocked] +- Negative: [Trade-offs, maintenance burdens, or limitations accepted] + +## Alternatives Considered +- [Alternative A]: [Why it was rejected] +- [Alternative B]: [Why it was rejected] + +## Related Decisions +- Supersedes [ADR-ZZZZ] / Related to [ADR-WWWW] +``` + +### Contract Invariants +- Every ADR must stem from concrete historical discussions or deliberate human decisions. +- Do not invent decisions the author never made; surface them as questions or candidates instead. + +--- + +## 4. ROADMAP.md + +**Core Question**: Where is the project intentionally going? + +Only items that represent intentional, validated future trajectory belong here. + +### Standard Sections +- **Current Direction**: High-level strategic themes for active development. +- **Near Term**: High-confidence milestones and features scheduled next. +- **Medium Term**: Planned improvements dependent on near-term completions. +- **Future / Exploratory**: Unscheduled proposals and research spikes under consideration. +- **Completed**: Milestone log of completed phases with dates. + +### 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. diff --git a/skills/reconcile-docs/references/reconciliation-matrix.md b/skills/reconcile-docs/references/reconciliation-matrix.md new file mode 100644 index 0000000..14c3442 --- /dev/null +++ b/skills/reconcile-docs/references/reconciliation-matrix.md @@ -0,0 +1,55 @@ +# Reconciliation Matrix + +This guide governs how the agent correlates historical records, present implementation, and future intent during Step 4 of `reconcile-docs`. + +## 1. Epistemic Authority Model + +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. | +| 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. | + +**Guiding Rule**: Historical records explain how the system arrived here; the repository determines what the system is now; active plans describe where it may go next. + +Never allow an old note or obsolete plan to overwrite the actual implementation reality. + +## 2. Reconciliation Mapping + +For every concept, architectural choice, or component candidate, correlate its status across all three temporal domains: + +| Historical state | Current implementation | Future state | Documentation consequence | +| :--- | :--- | :--- | :--- | +| Decision still relevant | Implemented | No change | ADR (why) + ARCHITECTURE (what exists now) | +| Decision changed | New implementation | Migration complete | Supersede old ADR + ARCHITECTURE (current state) | +| Old proposal | Never implemented | Still planned | ROADMAP (planned item) | +| Old proposal | Never implemented | Abandoned | Omit from docs; preserve in discussion archive only | +| Current implementation | No historical rationale | No known change | ARCHITECTURE (document current reality) + consider ADR candidate | +| Current implementation | Important rationale exists | No known change | ADR (record rationale) + ARCHITECTURE | +| Current implementation | Planned replacement | Future migration | ARCHITECTURE (current) + ROADMAP (planned migration) | +| Contradictory records | Repository resolves it | Stable | Document current code truth; record supersession in ADR if needed | + +## 3. Conflict Typology + +Flag contradictions explicitly during reconciliation rather than quietly smoothing them over: + +### Historical Contradiction +- *Symptom*: Notes claim component X is used (e.g. PostgreSQL), but repository code uses Y (e.g. SQLite WAL). +- *Resolution*: Repository code wins for present-state docs. Check chronological records for a pivot or migration. If found, mark the original decision superseded and document the migration in an ADR. + +### Premature Promotion +- *Symptom*: A roadmap, RFC, or discussion note describes a feature or architecture as if it exists, but the codebase does not contain it. +- *Resolution*: Do not include in `ARCHITECTURE.md` or `README.md`. Place into `ROADMAP.md` under the appropriate planning horizon (Near Term, Medium Term, or Exploratory). + +### Zombie Architecture +- *Symptom*: Existing repository documentation references modules, subsystems, or dependencies that were deleted or refactored away. +- *Resolution*: Mark for removal in `ARCHITECTURE.md` and `README.md`. If the removal was a major architectural pivot, record a superseding ADR. + +### 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.