Skip to content

Available Codecs Reference

Purpose: Reference document: Available Codecs Reference Detail Level: Full reference


Transforms MasterDataset into a RenderableDocument for Process Guard validation rules reference. Generates VALIDATION-RULES.md and detail files (validation/*.md).

Purpose: Process Guard validation rules reference with FSM diagrams and protection level matrix.

Output Files: VALIDATION-RULES.md (main reference), validation/<category>.md (category details)

  • When generating validation rules reference documentation
  • When creating FSM state transition diagrams
  • When building protection level reference files

Use createValidationRulesCodec(options) to create a configured codec:

Or use the default export for standard behavior:

OptionTypeDefaultDescription
includeFSMDiagrambooleantrueInclude FSM state diagram
includeCLIUsagebooleantrueInclude CLI usage section
includeEscapeHatchesbooleantrueInclude escape hatches section
includeProtectionMatrixbooleantrueInclude protection levels matrix
includeErrorGuidebooleantrueInclude error guide with rationale and alternatives
const codec = createValidationRulesCodec({ includeFSMDiagram: false });
const doc = codec.decode(dataset);
const doc = ValidationRulesCodec.decode(dataset);

Purpose: Development roadmap organized by phase with progress tracking.

Output Files: ROADMAP.md (main roadmap), phases/phase-<N>-<name>.md (phase details)

OptionTypeDefaultDescription
generateDetailFilesbooleantrueCreate phase detail files
filterStatusNormalizedStatusFilter[][]Filter by status
includeProcessbooleantrueShow quarter, effort, team metadata
includeDeliverablesbooleantrueList deliverables per phase
filterPhasesnumber[][]Filter to specific phases

Purpose: Historical record of completed work organized by quarter.

Output Files: COMPLETED-MILESTONES.md (summary), milestones/<quarter>.md (quarter details)

  • When documenting project history and completed phases
  • When generating quarterly achievement summaries
  • When tracking velocity by quarter

Purpose: Active development work currently in progress.

Output Files: CURRENT-WORK.md (summary), current/phase-<N>-<name>.md (active phase details)

  • When monitoring active development across all in-progress phases
  • When generating sprint/session status dashboards
  • When checking which patterns are currently being worked on

Transforms MasterDataset into a RenderableDocument for taxonomy reference output. Generates TAXONOMY.md and detail files (taxonomy/*.md).

Purpose: Taxonomy reference documentation with tag definitions, preset comparison, and format type reference.

Output Files: TAXONOMY.md (main reference), taxonomy/<domain>.md (domain details)

  • When generating the taxonomy reference documentation (TAXONOMY.md)
  • When creating tag reference files for progressive disclosure
  • When building taxonomy overview reports

Use createTaxonomyCodec(options) to create a configured codec:

Or use the default export for standard behavior:

OptionTypeDefaultDescription
includePresetsbooleantrueInclude preset comparison table
includeFormatTypesbooleantrueInclude format type reference
includeArchDiagrambooleantrueInclude architecture diagram
groupByDomainbooleantrueGroup metadata tags by domain
const codec = createTaxonomyCodec({ generateDetailFiles: false });
const doc = codec.decode(dataset);
const doc = TaxonomyDocumentCodec.decode(dataset);

Purpose: Current session context for AI agents and developers.

Output Files: SESSION-CONTEXT.md (session status), sessions/phase-<N>-<name>.md (incomplete phase details)

  • When starting a new implementation session and need to see active work status
  • When generating compact context for AI agent consumption (_claude-md/ output)
  • When checking incomplete phases and their deliverable progress

Purpose: Aggregate view of all incomplete work across phases.

Output Files: REMAINING-WORK.md (summary), remaining/phase-<N>-<name>.md (phase details)

OptionTypeDefaultDescription
includeIncompletebooleantrueInclude planned items
includeBlockedbooleantrueShow blocked items analysis
includeNextActionablebooleantrueNext actionable items section
maxNextActionablenumber5Max items in next actionable
sortBy”phase""priority""effort"
groupPlannedBy”quarter""priority""level"

Transforms MasterDataset into RenderableDocument for PRD/requirements output. Generates PRODUCT-REQUIREMENTS.md and detail files (requirements/*.md).

Purpose: Product requirements documentation grouped by product area or user role.

Output Files: PRODUCT-REQUIREMENTS.md (main index), requirements/<area-slug>.md (area details)

  • When generating product requirements documentation
  • When creating stakeholder-facing PRD documents
  • When organizing requirements by user role or product area

Use createRequirementsCodec(options) for custom options:

OptionTypeDefaultDescription
generateDetailFilesbooleantrueCreate product area detail files
groupBy”product-area""user-role""phase"
filterStatusNormalizedStatusFilter[][]Filter by status (empty = all)
includeScenarioStepsbooleantrueShow Given/When/Then steps
includeBusinessValuebooleantrueDisplay business value metadata
includeBusinessRulesbooleantrueShow Gherkin Rule: sections
const codec = createRequirementsCodec({ groupBy: 'user-role' });
const doc = codec.decode(dataset);

Purpose: Keep a Changelog format changelog grouped by release version.

Output Files: CHANGELOG.md

OptionTypeDefaultDescription
includeUnreleasedbooleantrueInclude unreleased section
includeLinksbooleantrueInclude links
categoryMappingRecord<string, string>{}Map categories to changelog types

Purpose: Timeline to behavior file coverage report.

Output Files: TRACEABILITY.md

  • When auditing which timeline patterns have associated behavior specifications
  • When checking feature file coverage across roadmap phases
  • When identifying patterns missing executable specs

Purpose: Project architecture and status overview.

Output Files: OVERVIEW.md

  • When generating a high-level project dashboard with architecture summary
  • When providing stakeholder-facing status reports
  • When combining completion stats with architecture context

A single codec factory that creates reference document codecs from configuration objects. Convention content is sourced from decision records tagged with @libar-docs-convention.

Purpose: Scoped reference documentation assembling four content layers (conventions, diagrams, shapes, behaviors) into a single document.

Output Files: Configured per-instance (e.g., docs/REFERENCE-SAMPLE.md, _claude-md/architecture/reference-sample.md)

  1. Convention content — Extracted from @libar-docs-convention-tagged patterns (rules, invariants, tables)
  2. Scoped diagrams — Mermaid diagrams filtered by archContext, archLayer, patterns, or include tags
  3. TypeScript shapes — API surfaces from shapeSources globs or shapeSelectors (declaration-level filtering)
  4. Behavior content — Gherkin-sourced patterns from behaviorCategories
  • When generating reference documentation from convention-tagged decisions
  • When creating scoped product area documents with live diagrams
  • When creating both detailed (docs/) and summary (_claude-md/) outputs
  • When assembling multi-layer documents that combine conventions, diagrams, shapes, and behaviors
OptionTypeDescription
conventionTagsstring[]Convention tag values to extract from decision records
diagramScopeDiagramScopeSingle diagram configuration
diagramScopesDiagramScope[]Multiple diagrams (takes precedence over diagramScope)
shapeSourcesstring[]Glob patterns for TypeScript shape extraction
shapeSelectorsShapeSelector[]Fine-grained declaration-level shape filtering
behaviorCategoriesstring[]Category tags for behavior pattern content
includeTagsstring[]Cross-cutting content routing via include tags
preambleSectionBlock[]Static editorial sections prepended before generated content
productAreastringPre-filter all content sources to matching product area
excludeSourcePathsstring[]Exclude patterns by source path prefix
TypeDescription
graph (default)Flowchart with subgraphs by archContext, custom node shapes
sequenceDiagramSequence diagram with typed messages between participants
stateDiagram-v2State diagram with transitions from dependsOn relationships
C4ContextC4 context diagram with boundaries, systems, and relationships
classDiagramClass diagram with archRole stereotypes and typed arrows
VariantExampleBehavior
group only{ group: "api-types" }Match shapes by group tag
source + names{ source: "src/types.ts", names: ["Config"] }Named shapes from file
source only{ source: "src/path/*.ts" }All tagged shapes from glob
const codec = createReferenceCodec(config, { detailLevel: 'detailed' });
const doc = codec.decode(dataset);

Transforms MasterDataset into RenderableDocument for PR-scoped output. Filters patterns by changed files and/or release version tags.

Purpose: PR-scoped view filtered by changed files or release version.

Output Files: working/PR-CHANGES.md

  • When generating PR summaries filtered by changed files
  • When creating release-scoped documentation for PR reviews
  • When building CI/CD outputs focused on PR scope

Use createPrChangesCodec(options) for custom options:

PR Changes codec filters patterns by:

  1. Changed files (matches against pattern.filePath)
  2. Release version (matches against deliverable.release tags)

If both are specified, patterns must match at least one criterion.

const codec = createPrChangesCodec({
changedFiles: ['src/commands/order.ts'],
releaseFilter: 'v1.0.0',
});
const doc = codec.decode(dataset);

Purpose: Pre-planning questions and Definition of Done validation.

Output Files: PLANNING-CHECKLIST.md

  • When starting a new implementation session and need pre-flight validation
  • When generating Definition of Done checklists for active phases
  • When checking readiness criteria before transitioning patterns to active

Purpose: Implementation plans for coding sessions.

Output Files: SESSION-PLAN.md

  • When generating a structured implementation plan for an active coding session
  • When documenting planned deliverables and their execution order
  • When creating session-scoped plans aligned with FSM transitions

Purpose: Retrospective discoveries for roadmap refinement.

Output Files: SESSION-FINDINGS.md

  • When capturing session retrospective findings across all patterns
  • When surfacing discovered gaps, improvements, risks, and learnings
  • When refining roadmap priorities based on implementation discoveries
  • pattern.discoveredGaps — Gap findings
  • pattern.discoveredImprovements — Improvement suggestions
  • pattern.discoveredRisks / pattern.risk — Risk findings
  • pattern.discoveredLearnings — Learned insights

Transforms MasterDataset into a RenderableDocument for pattern registry output. Generates PATTERNS.md and category detail files (patterns/*.md).

Purpose: Pattern registry with category-based organization.

Output Files: PATTERNS.md (main index), patterns/<category>.md (category details)

  • When generating the pattern registry documentation (PATTERNS.md)
  • When creating category-specific pattern detail files
  • When building pattern overview reports with status tracking

Use createPatternsCodec(options) to create a configured codec:

Or use the default export for standard behavior:

OptionTypeDefaultDescription
generateDetailFilesbooleantrueCreate category detail files
detailLevel”summary""standard""detailed"
includeDependencyGraphbooleantrueRender Mermaid dependency graph
includeUseCasesbooleantrueShow use cases section
filterCategoriesstring[][]Filter to specific categories (empty = all)
const codec = createPatternsCodec({ generateDetailFiles: false });
const doc = codec.decode(dataset);
const doc = PatternsDocumentCodec.decode(dataset);

Purpose: Navigation hub composing editorial preamble with MasterDataset statistics.

Output Files: INDEX.md (single page, no detail files)

  • DD-1: New IndexCodec in CodecRegistry (not a ReferenceDocConfig entry)
  • DD-2: Document entries configured statically, not filesystem discovery
  • DD-3: Audience reading paths are full preamble (editorial judgment)
  • DD-4: Key concepts glossary uses preamble
  • DD-5: Standalone codec, not routed through reference codec pipeline
OptionTypeDefaultDescription
preambleSectionBlock[][]Editorial sections (reading paths, document roles, key concepts)
documentEntriesDocumentEntry[][]Static document inventory entries
includeProductAreaStatsbooleantrueProduct area statistics table
includePhaseProgressbooleantruePhase progress summary
includeDocumentInventorybooleantrueUnified document inventory
includePackageMetadatabooleantruePackage metadata header

Assembles reference documents from multiple codec outputs by concatenating RenderableDocument sections. Enables building documents composed from any combination of existing codecs.

Purpose: Assembles documents from multiple child codecs into a single RenderableDocument.

Output Files: Configured per-instance (composes child codec outputs)

  • When building reference docs from multiple codec outputs
  • When composing session briefs from overview + current work + remaining work
  • When referenceDocConfigs need content from arbitrary codecs

Use the factory function with child codecs and options:

Or use composeDocuments directly at the document level:

const codec = createCompositeCodec([OverviewCodec, CurrentWorkCodec, RemainingWorkCodec], {
title: 'Session Brief',
});
const doc = codec.decode(dataset);
const doc = composeDocuments([docA, docB], { title: 'Combined' });

Transforms MasterDataset into RenderableDocuments for CLAUDE.md module generation. Filters patterns with claudeModule tags and generates compact markdown modules suitable for the _claude-md/ directory structure.

Purpose: Generate CLAUDE.md modules from annotated behavior specs.

Output Files: One file per claude-module-tagged pattern at {section}/{module}.md

  • Feature description → skipped (meta-documentation, not operational content)
  • Rule: blocks → H4 sections with invariant + rationale
  • Scenario Outline Examples → decision tables
  • Tables in Rule descriptions → preserved as-is

Use createClaudeModuleCodec(options) for custom options:

const codec = createClaudeModuleCodec({ detailLevel: 'detailed' });
const doc = codec.decode(dataset);

Transforms MasterDataset into a RenderableDocument for business rules output. Generates BUSINESS-RULES.md organized by product area, phase, and feature.

Purpose: Business rules documentation organized by product area, phase, and feature. Extracts domain constraints from Gherkin Rule: blocks.

Output Files: BUSINESS-RULES.md (main index), business-rules/<area-slug>.md (area details)

  • When generating business rules documentation for stakeholders
  • When extracting domain constraints without implementation details
  • When creating compliance or audit documentation from feature specs
  • summary: Statistics only (compact reference)
  • standard: Above + all features with rules inline
  • detailed: Full content including code examples and verification links

Use createBusinessRulesCodec(options) to create a configured codec:

OptionTypeDefaultDescription
groupBy”domain""phase""domain-then-phase"
includeCodeExamplesbooleanfalseInclude code examples from DocStrings
includeTablesbooleantrueInclude markdown tables from descriptions
includeRationalebooleantrueInclude rationale section per rule
filterDomainsstring[][]Filter by domain categories (empty = all)
filterPhasesnumber[][]Filter by phases (empty = all)
onlyWithInvariantsbooleanfalseShow only rules with explicit invariants
includeSourcebooleantrueInclude source feature file link
includeVerifiedBybooleantrueInclude Verified by scenario links
maxDescriptionLengthnumber150Max description length in standard mode
excludeSourcePathsstring[][]Exclude patterns by source path prefix
Product Area (Platform, DeliveryProcess)
└── Phase (21, 15, etc.) or Release (v0.1.0 for DeliveryProcess)
└── Feature (pattern name with description)
└── Rules (inline with Invariant + Rationale)
const codec = createBusinessRulesCodec({ detailLevel: 'summary' });
const doc = codec.decode(dataset);

Transforms MasterDataset into a RenderableDocument containing architecture diagrams (Mermaid) generated from source annotations.

Purpose: Architecture diagrams (Mermaid) generated from source annotations. Supports component and layered views.

Output Files: ARCHITECTURE.md (generated architecture diagrams with component inventory)

  • When generating architecture diagrams from code annotations
  • When visualizing bounded contexts and component relationships
  • When creating layered architecture views (domain/application/infrastructure)

Use createArchitectureCodec(options) to create a configured codec:

Or use the default export for standard behavior:

  • component: System overview with bounded context subgraphs
  • layered: Components organized by architectural layer
OptionTypeDefaultDescription
diagramType”component""layered""component”
includeInventorybooleantrueInclude component inventory table
includeLegendbooleantrueInclude legend for arrow styles
filterContextsstring[][]Filter to specific contexts (empty = all)
const codec = createArchitectureCodec({ diagramType: 'component' });
const doc = codec.decode(dataset);
const doc = ArchitectureDocumentCodec.decode(dataset);

Transforms MasterDataset into RenderableDocument for Architecture Decision Records. Extracts ADRs from patterns with @libar-docs-adr tags.

Purpose: Architecture Decision Records extracted from patterns with @libar-docs-adr tags.

Output Files: DECISIONS.md (ADR index), decisions/<category-slug>.md (category details)

  • When generating Architecture Decision Record documentation
  • When extracting ADRs from feature files with structured annotations
  • When building custom ADR reports with configurable content sections

Use createAdrCodec(options) for custom options:

ADR content is parsed from feature file descriptions:

  • Context: Problem background and constraints
  • Decision: The chosen solution
  • Consequences: Positive and negative outcomes
const codec = createAdrCodec({
groupBy: 'phase',
includeContext: true,
includeDecision: true,
includeConsequences: false,
});
const doc = codec.decode(dataset);