Skip to content

Product Functionality Documentation Strategy

Product Functionality Documentation Strategy

Section titled “Product Functionality Documentation Strategy”

Status: Deferred from Session 143 — ready to action
Origin: docs/continuation-prompts/continuation-prompt-kh-s143.md deferred items
Purpose: Define how we systematically document the 7 functional areas in docs/product-functionality/


All 7 functional areas in docs/product-functionality/ are currently Pending:

AreaStatus
search/Pending
content-management/Pending
bid-management/Pending
quality-governance/Pending
knowledge-organisation/Pending
ai-integration/Pending
administration/Pending

The system is now sufficiently mature (143 sessions, 8,416 tests, 39 tables, 38 MCP tools) that the absence of functional documentation creates real friction:

  • Client onboardingdocs/client-documentation/ contains real client artefacts (Platform Overview, Claude Integration Guide) but they drift from the codebase without a grounded source of truth.
  • Cross-agent context — each new session must re-derive system behaviour from the codebase because no authoritative functional reference exists.
  • AI/Prompt Engineering track — the AI touchpoint strategy (docs/reference/ai-touchpoint-map-and-improvement-strategy.md) depends on knowing what each AI touchpoint actually does. Functional docs provide that foundation.

2. Active Parallel Workstreams — Sequencing Constraint

Section titled “2. Active Parallel Workstreams — Sequencing Constraint”

Two workstreams are running in parallel with this documentation track. They will change the codebase in ways that make certain areas immediately stale if documented now:

WorkstreamAreas to Defer
SI Phase 1d (MCP tools, Intelligence MCP App, E2E)Intelligence section of knowledge-organisation/, MCP tool extensions in ai-integration/
AI/PE Phase 1 (Evaluation Foundation — gold standards, eval runners, regression infra)ai-integration/ in full

Rule: Do not document a functional area while it is actively being built. Document it after the relevant workstream phase is complete and committed.


Do not re-derive facts from scratch. Read these before authoring any area:

DocumentPathPurpose
State of the Product (v2.28)docs/reference/state-of-the-product.mdAuthoritative “what is actually built” reference
Schema Quick Referencedocs/reference/SCHEMA-QUICK-REFERENCE.mdAll 39 tables, columns, RLS, RPC functions
Codebase Statsdocs/generated/codebase-stats.mdCurrent counts (routes, components, hooks, tools)
MCP Inventorydocs/generated/mcp-inventory.mdAll 38 tools, 11 resources, 5 prompts with signatures
AI Integration Layersdocs/reference/ai-integration-layers.md5-layer AI architecture
Classification Promptdocs/reference/classification-prompt.mdDomain taxonomy and classification rules
AI Touchpoint Mapdocs/reference/ai-touchpoint-map-and-improvement-strategy.mdAll 18 AI touchpoints across TS/Python pipelines
Design Systemdocs/design/warm-meridian-implementation-spec.mdSemantic tokens, OKLCH colour system, components

Each area follows four phases. Run them sequentially — never skip Phase 3.

Phase 1 — Deep Research (Empirical, No Writing)

Section titled “Phase 1 — Deep Research (Empirical, No Writing)”

A research agent reads the actual codebase for the target area. Output: a research-notes.md scratch file. Do not write final docs in this phase.

What to read:

  1. All API routes under the relevant directory (e.g. /app/api/items/ for content-management)
  2. Key components, hooks, and lib modules (cross-reference docs/generated/codebase-stats.md)
  3. Database tables and RLS policies for the area (use Supabase MCP list_tables, execute_sql)
  4. MCP tools that surface this area (from docs/generated/mcp-inventory.md)
  5. Relevant section of docs/reference/state-of-the-product.md — Section 5 (Feature State)
  6. Existing tests that describe expected behaviour (__tests__/ — they are ground truth)

Output format (research-notes.md):

# Research Notes — [Area]
## API Routes (verified)
## Database Tables & Key Columns
## Key Components & Hooks
## MCP Tool Exposure
## Known Limitations & Rough Edges
## Open Questions

Save to /tmp/research-notes-[area].md — not committed.


Phase 2 — Draft (From Research Notes Only)

Section titled “Phase 2 — Draft (From Research Notes Only)”

A writing agent uses ONLY the research-notes.md and directly verified codebase facts. It produces three documents per area using the templates in docs/product-functionality/_templates/:

TemplateOutput FileWhen
user-journeys.template.md[area]/user-journeys.mdAlways
workflows.template.md[area]/workflows.mdWhen state machines or automation exist
technical.template.md[area]/technical.mdAlways

Writing rules:

  • UK English throughout. DD/MM/YYYY. “organisation” not “organization.”
  • Do not hardcode volatile counts (use docs/generated/ references or queries instead)
  • Note limitations honestly — every feature has rough edges
  • If uncertain about a fact, mark it [VERIFY] rather than guessing
  • Max ~500 lines per file. Split if larger.

A separate agent (or strict self-review phase) takes the Phase 2 draft and actively tries to prove it wrong. For every factual claim:

  • Does this API route actually exist? (ls app/api/... or grep_search)
  • Is this DB column name correct? (check schema, not state-of-the-product — it may lag)
  • Is this MCP tool name current? (check docs/generated/mcp-inventory.md or lib/mcp/tools/)
  • Does this component exist with this name? (find components/ -name "...")
  • Is this behaviour actually tested? (find the test — if there’s no test, flag it)

Output: a verification report listing:

  • ✅ Verified claims (count)
  • ❌ Contradictions (with correction)
  • ⚠️ Unverifiable claims marked [VERIFY]

Apply all corrections before Phase 4.


  1. Apply all Phase 3 corrections to the draft files
  2. Save finalised docs to docs/product-functionality/[area]/
  3. Update the status table in docs/product-functionality/README.md
  4. If the area has MCP-facing exposure, check whether docs/client-documentation/Knowledge Hub — Claude Integration Guide.md needs updating
  5. If the area significantly changes client understanding of the product, flag docs/client-documentation/Knowledge Hub — Platform Overview.md for a follow-up sync session

Section titled “5. Recommended Area Sequence (Stability-First)”

Do not document in impact order. Document in stability order — areas that are not changing come first, so docs are useful immediately without risk of immediate obsolescence.

Tier 1 — Document Now (Stable, not touched by SI or PE)

Section titled “Tier 1 — Document Now (Stable, not touched by SI or PE)”

These areas have been stable since approximately S112-S115:

PriorityAreaRationale
1quality-governance/Stable since S114. Bridges, verification, review cadence — mature.
2search/Consolidated and closed since S111-S113. Well-bounded.
3administration/Settings, roles, cron, notifications. Unchanged for many sessions.
4bid-management/State machine, 3-pass drafting, DOCX export. Core is stable.

Continuation prompt for Tier 1: docs/continuation-prompts/continuation-prompt-kh-doc-track-1.md

Tier 2 — Document Now, Flag One Section (Mostly Stable)

Section titled “Tier 2 — Document Now, Flag One Section (Mostly Stable)”
PriorityAreaNote
5content-management/Stable. Source document diff at Phase 4 complete. Safe to document.
6knowledge-organisation/Document KB org, taxonomy, entity graph, guides, coverage now. Mark the Sector Intelligence workspace subsection [PENDING — SI Phase 1d] and defer it.
PriorityAreaDefer Until
7ai-integration/After AI/PE Phase 1 completes. Documenting now means rewriting once eval infrastructure lands.

Every doc must carry a header so staleness is explicit rather than hidden:

> **Last verified:** Session NNN (DD Month YYYY) **Pending updates:** [describe
>
> > what is expected to change, or "None — stable area"]

When a parallel workstream session changes a feature covered by an existing doc, the /update-docs skill will automatically:

  1. Add an ## Updates — Session NNN addendum to the affected doc
  2. Update the Last verified header
  3. Mark sections needing fuller review with [NEEDS REVIEW — updated S{NNN}]

A full rewrite of the affected section is then scheduled in the next dedicated documentation session.


7. Agent Allocation for Parallel Execution

Section titled “7. Agent Allocation for Parallel Execution”

Multiple areas can be researched in parallel (Phase 1 is read-only). Drafting and verification must be sequential per area to prevent file ownership conflicts.

Recommended parallel grouping for Tier 1:

Wave 1 (Phase 1 — parallel research agents):
Agent A — quality-governance/
Agent B — search/ + administration/ (small enough to bundle)
Agent C — bid-management/
Wave 2 (Liam reviews research notes before drafting begins):
Wave 3 (Phase 2+3 — sequential per area, can run concurrently across areas):
Agent A — Draft + verify quality-governance/
Agent B — Draft + verify search/ and administration/
Agent C — Draft + verify bid-management/
Wave 4:
Phase 4 finalisation + /update-docs + /handoff

Use isolation: worktree (per CLAUDE.md) when agents touch the same files.


8. Continuation Prompt for Starting This Track

Section titled “8. Continuation Prompt for Starting This Track”

The ready-to-use continuation prompt for Tier 1 (stable areas) is:

docs/continuation-prompts/continuation-prompt-kh-doc-track-1.md

Copy its content into a new session in the knowledge-hub repository. It covers quality-governance/, search/, administration/, and bid-management/ across 6 work packages (3 research + 3 draft/verify).

For Tier 2 and Tier 3 areas, a new continuation prompt will be generated via /handoff at the end of the Tier 1 session, once actual session state is known.


Once 3+ functional areas are documented, run a dedicated sync session:

  1. Read all completed docs/product-functionality/[area]/ files
  2. Cross-reference against docs/client-documentation/Knowledge Hub — Platform Overview.md and Knowledge Hub — Claude Integration Guide.md
  3. Identify stale claims, missing features, and outdated tool descriptions
  4. Update client docs, adversarially verify, commit

Do not update client docs piecemeal after each area — wait for a critical mass so the sync is coherent and complete.


Before marking any area “Complete” in the README status table:

  • All three template documents produced (user-journeys.md, technical.md, and workflows.md if applicable)
  • Adversarial verification passed (all [VERIFY] items resolved or explicitly accepted)
  • API route names verified against actual codebase
  • Table/column names verified against Supabase schema (not just state-of-the-product)
  • MCP tool names verified against docs/generated/mcp-inventory.md
  • README status table updated
  • Limitation section honest and non-empty (every feature has rough edges)