Context engineering for AI-assisted codebases.
Turn TypeScript annotations and Gherkin specs into a structured, queryable delivery state — living documentation, architecture graphs, and FSM-enforced workflows that AI agents consume without hallucinating.
AI coding agents need architectural context to generate correct code. This package makes code the single source of truth for both humans and machines — annotations in code and Gherkin specs replace manually maintained docs that drift out of date.
# npm
npm install @libar-dev/delivery-process@pre
# pnpm (recommended)
pnpm add @libar-dev/delivery-process@preRequirements: Node.js >= 18.0.0, ESM project ("type": "module" in package.json)
/** @docs */
/**
* @docs-pattern UserAuthentication
* @docs-status roadmap
* @docs-uses SessionManager, TokenValidator
*
* ## User Authentication
*
* Handles user login, logout, and session management.
*/
export class UserAuthentication {
// ...
}Tag prefix is configurable. The
genericpreset uses@docs-*(shown above). The defaultlibar-genericpreset uses@libar-docs-*. See docs/CONFIGURATION.md.
npx generate-docs -g patterns -i "src/**/*.ts" -o docs -fnpx lint-process --stagedThis validates FSM transitions and blocks invalid status changes.
TypeScript annotations define pattern metadata and relationships:
/**
* @libar-docs
* @libar-docs-pattern TransformDataset
* @libar-docs-status completed
* @libar-docs-uses MasterDataset, ExtractedPattern, TagRegistry
*/
export function transformToMasterDataset(input: TransformInput): MasterDataset {
// ...
}Gherkin feature files own planning metadata (status, phase, deliverables). The generator merges both sources into a unified MasterDataset.
Pipeline: Config → Scanner → Extractor → Transformer → Codec — files become patterns, patterns become a MasterDataset, the MasterDataset renders to Markdown and JSON.
All output goes to docs-live/ — 57+ auto-generated files from annotated source code:
| Output | Files | Source |
|---|---|---|
| Product area docs | 7 | @docs-uses, @docs-status, relationship tags |
| Business rules | 7 | Gherkin Rule: Invariant/Rationale blocks |
| Architecture decisions (ADRs) | 7 | Decision feature files |
| Reference guides | 8 | CLI schema, codec patterns, annotations |
| Live Mermaid diagrams | — | @docs-uses, @docs-depends-on relationships |
| API type shapes | — | @docs-shape on TypeScript declarations |
| Validation rules | 3 | Process Guard FSM specs |
| Taxonomy reference | 3 | Tag registry |
| AI context modules | 13 | @docs-claude-module tagged specs |
| Changelog | 1 | Release specs |
Browse it: docs-live/INDEX.md is the navigation hub with reading order, document roles, and product area statistics.
| Command | Purpose | Docs |
|---|---|---|
generate-docs |
Generate documentation from annotated sources | generate-docs --help |
process-api |
Query delivery state for AI coding sessions | Process API Reference |
lint-patterns |
Validate annotation quality (missing tags, etc.) | Validation Rules |
lint-process |
Validate delivery workflow FSM transitions | Process Guard Reference |
lint-steps |
Validate vitest-cucumber feature/step compatibility | Validation Rules |
validate-patterns |
Cross-source validation with Definition of Done checks | Validation Rules |
docs-live/INDEX.md is the navigation hub — 57+ files generated from annotated source code, organized into product areas, reference guides, business rules, ADRs, taxonomy, and validation rules.
| Document | Focus |
|---|---|
| CONFIGURATION.md | Presets, tags, config files |
| METHODOLOGY.md | Core thesis, dual-source "why" |
| GHERKIN-PATTERNS.md | Writing effective specs |
| SESSION-GUIDES.md | Day-to-day AI/dev workflows |
| VALIDATION.md | Automated quality checks |
MIT © Libar AI