Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
17de75e
Refactor codec architecture docs to reference doc generator
darko-mijic Feb 22, 2026
bcec973
Detail Phase 4 spec with 4 new Rules and 18 scenarios for architectur…
darko-mijic Feb 22, 2026
f8becfc
docs: replace Configuration Architecture with product-area pointer
darko-mijic Feb 22, 2026
ba2279d
docs: absorb Source Systems into ANNOTATION product area and merge an…
darko-mijic Feb 22, 2026
5912e9e
docs: replace Workflow Integration with PROCESS product-area pointer
darko-mijic Feb 22, 2026
65cf070
docs: trim Key Design Patterns (DD-5)
darko-mijic Feb 22, 2026
4d4d991
docs: apply DD-9 editorial trim and remove tutorial sections
darko-mijic Feb 22, 2026
309a01d
spec: mark Chunk A deliverables complete
darko-mijic Feb 22, 2026
b8e67ba
docs: regenerate after Chunk A edits
darko-mijic Feb 22, 2026
1a545d0
docs: annotate master-dataset and pipeline types for shape extraction
darko-mijic Feb 22, 2026
12a70f7
docs: add pipeline-architecture convention annotations
darko-mijic Feb 22, 2026
c429942
docs: add master-dataset-views diagram source and ARCHITECTURE-TYPES …
darko-mijic Feb 22, 2026
edd17b0
docs: regenerate reference docs for architecture types
darko-mijic Feb 22, 2026
3a3dfd5
docs: restore when-to-use headings for pipeline architecture conventions
darko-mijic Feb 22, 2026
b992a48
docs: replace architecture manual sections with generated pointers an…
darko-mijic Feb 22, 2026
45da385
test: add coverage for architecture refactoring and reference generators
darko-mijic Feb 22, 2026
b24a95d
chore: regenerate docs and include all pending changes
darko-mijic Feb 22, 2026
025675b
chore: advance ArchitectureDocRefactoring to active and close Phase 4…
darko-mijic Feb 22, 2026
1fd3f51
chore: complete ArchitectureDocRefactoring pattern (FSM active→comple…
darko-mijic Feb 22, 2026
69d9b77
fix: convention-extractor heading match for structured JSDoc
darko-mijic Mar 5, 2026
aed86d8
chore: add DocsLiveConsolidation spec (Phase 37, roadmap)
darko-mijic Mar 5, 2026
695ae08
feat: implement DocsLiveConsolidation (Phase 37, active)
darko-mijic Mar 5, 2026
9e928e9
chore: complete DocsLiveConsolidation (Phase 37, active→completed)
darko-mijic Mar 5, 2026
828dae7
chore: regenerate docs and remove docs-generated/ from tracking
darko-mijic Mar 5, 2026
02b4c9f
chore: add roadmap specs and planning artifacts for docs consolidation
darko-mijic Mar 5, 2026
9842a5b
feat: implement GeneratedDocQuality (Phase 38, roadmap→active)
darko-mijic Mar 5, 2026
1676b42
chore: complete GeneratedDocQuality (Phase 38, active→completed)
darko-mijic Mar 5, 2026
577e971
chore: design SessionGuidesModuleSource (Phase 39, spec revision)
darko-mijic Mar 5, 2026
d307d5c
chore: design PublishingRelocation (Phase 40, spec revision)
darko-mijic Mar 5, 2026
e7a5248
chore: design GherkinPatternsRestructure (Phase 41, spec revision)
darko-mijic Mar 5, 2026
0f2c4b4
chore: design ReadmeRationalization (Phase 42, spec revision)
darko-mijic Mar 5, 2026
07c58aa
chore: design ProcessApiHybridGeneration (Phase 43, spec revision)
darko-mijic Mar 5, 2026
fc94da5
chore: implement SessionGuidesModuleSource (Phase 39, roadmap→active)
darko-mijic Mar 5, 2026
8d9f2e1
chore: implement PublishingRelocation (Phase 40, roadmap→active)
darko-mijic Mar 5, 2026
1de72ff
chore: complete PublishingRelocation (Phase 40, active→completed)
darko-mijic Mar 5, 2026
bf56e83
feat: implement ClaudeModuleGeneration (Phase 25, roadmap→active)
darko-mijic Mar 5, 2026
55a39a6
chore: complete ClaudeModuleGeneration (Phase 25, active→completed)
darko-mijic Mar 5, 2026
d78bf87
chore: complete SessionGuidesModuleSource (Phase 39, active→completed)
darko-mijic Mar 5, 2026
55872d4
feat: implement GherkinPatternsRestructure (Phase 41, roadmap→active)
darko-mijic Mar 5, 2026
dd6eca8
chore: complete GherkinPatternsRestructure (Phase 41, active→completed)
darko-mijic Mar 5, 2026
88b8703
feat: implement ReadmeRationalization (Phase 42, roadmap→active)
darko-mijic Mar 5, 2026
45454dd
chore: complete ReadmeRationalization (Phase 42, active→completed)
darko-mijic Mar 5, 2026
d75e302
feat: implement ProcessApiHybridGeneration (Phase 43, roadmap→active)
darko-mijic Mar 5, 2026
e9af881
chore: complete ProcessApiHybridGeneration (Phase 43, active→completed)
darko-mijic Mar 5, 2026
12da06b
fix: harden ClaudeModuleCodec parsing, complete 3 FSM transitions, re…
darko-mijic Mar 5, 2026
b455907
refactor: unify triple-duplicated table parser, reuse slugify utility
darko-mijic Mar 5, 2026
69fb2b3
refactor: simplify codecs, add byProductArea view, enforce claudeSect…
darko-mijic Mar 5, 2026
59012f7
refactor: reuse canonical utilities, fix ADR-006 violation, eliminate…
darko-mijic Mar 6, 2026
99dab5f
refactor: consolidate duplicate section builders in ProcessApiReferen…
darko-mijic Mar 6, 2026
59c878c
fix: correct stale line counts in docs/INDEX.md for ARCHITECTURE.md a…
darko-mijic Mar 6, 2026
1ac4421
chore: gitignore .plans/ directory and untrack existing plan files
darko-mijic Mar 6, 2026
8072c58
style: fix prettier formatting in 2 source files
darko-mijic Mar 6, 2026
8a96d44
fix: remove unused BusinessRuleAnnotations type import
darko-mijic Mar 6, 2026
fde7698
fix: address 8 valid PR review comments from CodeRabbit
darko-mijic Mar 6, 2026
6c81851
style: fix prettier formatting in architecture-doc-refactoring steps
darko-mijic Mar 6, 2026
e708f7f
fix: add prettier format check to pre-push hook
darko-mijic Mar 6, 2026
b8f13e6
fix: make pre-commit hook executable
darko-mijic Mar 6, 2026
fc60b6b
feat: reduce CLAUDE.md from 1,085 to 670 lines via Process Data API m…
darko-mijic Mar 6, 2026
223ace6
feat: consolidate generated docs to docs-live/ and restore manual docs/
darko-mijic Mar 6, 2026
48172a7
fix: replace Generation product area wall-of-text intro with structur…
darko-mijic Mar 6, 2026
c6f9d44
feat: implement WP-3/4/5/6/7 — 4 codecs, loadPreambleFromMarkdown, 90…
darko-mijic Mar 6, 2026
37c98a7
feat: implement WP-2 IndexCodec, Phase 1 taxonomy, Phase 5 guide trim…
darko-mijic Mar 6, 2026
efcaa83
chore: transition EnhancedIndexGeneration roadmap → active
darko-mijic Mar 6, 2026
bdbbda7
chore: transition EnhancedIndexGeneration active → completed
darko-mijic Mar 6, 2026
b8c8457
fix: restore manual docs/ files — preserve as reference until quality…
darko-mijic Mar 6, 2026
d43fc41
fix: simplify code, add missing Rule descriptions, regenerate docs
darko-mijic Mar 6, 2026
5069717
fix: make docs-live/INDEX.md index only auto-generated docs, not manu…
darko-mijic Mar 6, 2026
b6c5058
fix: address PR #32 review comments — specs and stubs consistency
darko-mijic Mar 6, 2026
97e24e2
fix: update README to reflect docs-live/ consolidation
darko-mijic Mar 6, 2026
5c91ac9
1.0.0-pre.2
darko-mijic Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"plansDirectory": "./.plans",
"attribution": {
"commit": "",
"pr": ""
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ node_modules/
dist/
*.tsbuildinfo

# Generated intermediate artifacts (not website-published)
docs-generated/

# IDE
.idea/
.vscode/
Expand Down Expand Up @@ -36,3 +39,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.plans/
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
set -e

echo "Running format check..."
pnpm format:check

echo "Running tests..."
pnpm test

Expand Down
668 changes: 123 additions & 545 deletions CLAUDE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/PUBLISHING.md → MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Publishing Guide
# Maintainer Guide

This guide covers how to publish `@libar-dev/delivery-process` to npm.

Expand Down
429 changes: 36 additions & 393 deletions README.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions _claude-md/CLAUDE-MODULES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Claude Modules

#### Generated Modules

1 module(s) generated from annotated behavior specs.

| Module | Section | Source Pattern | Content |
| --- | --- | --- | --- |
| session-workflows | workflow | SessionGuidesModuleSource | 9 rules |
49 changes: 1 addition & 48 deletions _claude-md/api/data-api-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,7 @@ Query delivery process state directly from the terminal. **Use this instead of r

**Run `pnpm process:query -- --help` for the full command reference**, including workflow recipes, session types, architecture queries, output modifiers, and available API methods.

#### Session Start Recipe

1. `pnpm process:query -- overview` — project health (progress, active phases, blockers)
2. `pnpm process:query -- scope-validate <pattern> <session-type>` — pre-flight check (FSM, deps, prereqs)
3. `pnpm process:query -- context <pattern> --session <type>` — curated context bundle

Session types: `planning` (minimal), `design` (full: stubs + deps + deliverables), `implement` (focused: deliverables + FSM + tests).

#### Key Commands

| Command | When to Use |
| ----------------------- | ------------------------------------------------------------------------------------- |
| `scope-validate` | **Highest impact** — prevents wasted sessions by catching violations before you start |
| `context --session` | Primary context gathering — replaces manual file reads |
| `dep-tree <pattern>` | Understand dependency chains before implementation |
| `list --status roadmap` | Find available patterns to work on |
| `arch blocking` | Find patterns stuck on incomplete dependencies |
| `stubs --unresolved` | Find design stubs missing implementations |
| `rules` | Business rules and invariants from Gherkin `Rule:` blocks |
| `files <pattern>` | File reading list with implementation paths — replaces manual path discovery |
| `decisions <pattern>` | Design decisions (AD-N) from stub descriptions |
| `pdr <number>` | Cross-reference patterns mentioning a PDR number |
| `handoff --pattern` | Capture session-end state for multi-session work |

#### Annotation Exploration

Run these **before** making annotation changes — they prevent debugging cycles:

| Command | When to Use |
| -------------------------- | ----------------------------------------------------------------------------- |
| `unannotated --path <dir>` | Find TS files missing `@libar-docs` — **run first** in any enrichment session |
| `tags` | Tag usage inventory (counts per tag and value) |
| `sources` | File inventory by type (TS, Gherkin, Stubs) |
| `query getPattern <name>` | Full pattern JSON including `extractedShapes` and `productArea` |

**Lesson learned:** `unannotated --path src/types` would have immediately caught missing `@libar-docs` annotations on `result.ts` and `errors.ts` — saving ~30 minutes of debugging why shapes weren't appearing in generated docs.

#### Architecture Queries

Query architectural structure directly — avoids explore agents for structural questions:

| Command | When to Use |
| --------------------- | ---------------------------------------------------- |
| `arch coverage` | Annotation completeness across the project |
| `arch context [name]` | Patterns in bounded context (list all if no name) |
| `arch layer [name]` | Patterns in architecture layer (list all if no name) |
| `arch dangling` | Broken references — pattern names that don't resolve |
| `arch orphans` | Isolated patterns with no relationships |
See the **Context Gathering Protocol** section above for mandatory session start commands and query recipes.

#### Tips

Expand Down
88 changes: 0 additions & 88 deletions _claude-md/authoring/feature-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,6 @@ Rule: Reservations use atomic claim

Code stubs live in `delivery-process/stubs/{pattern-name}/` — annotated TypeScript with `throw new Error("not yet implemented")`.

#### Rule Block Structure (Mandatory)

Every feature file MUST use `Rule:` blocks with structured descriptions:

```gherkin
Rule: Reservations prevent race conditions

**Invariant:** Only one reservation can exist for a given key at a time.

**Rationale:** Check-then-create patterns have TOCTOU vulnerabilities.

**Verified by:** Concurrent reservations, Expired reservation cleanup

@acceptance-criteria @happy-path
Scenario: Concurrent reservations
...
```

| Element | Purpose | Extracted By |
| ------------------ | --------------------------------------- | ------------------------ |
| `**Invariant:**` | Business constraint (what must be true) | Business Rules generator |
| `**Rationale:**` | Business justification (why it exists) | Business Rules generator |
| `**Verified by:**` | Comma-separated scenario names | Traceability generator |

#### Feature Description Structure

Choose headers that fit your pattern (flexible, not rigid):

| Structure | Headers | Best For |
| ---------------- | ------------------------------------------ | ------------------------- |
| Problem/Solution | `**Problem:**`, `**Solution:**` | Pain point to fix |
| Value-First | `**Business Value:**`, `**How It Works:**` | TDD-style, Gherkin spirit |
| Context/Approach | `**Context:**`, `**Approach:**` | Technical patterns |

Always include a benefits table:

```gherkin
**Business Value:**
| Benefit | Impact |
| ... | ... |
```

#### Valid Rich Content

| Content Type | Syntax | Appears in Docs |
| ------------- | ----------------------- | ---------------- |
| Plain text | Regular paragraphs | Yes |
| Bold/emphasis | `**bold**`, `*italic*` | Yes |
| Tables | Markdown pipe tables | Yes |
| Lists | `- item` or `1. item` | Yes |
| DocStrings | `"""typescript`...`"""` | Yes (code block) |
| Comments | `# comment` | No (ignored) |

#### Forbidden in Feature Descriptions

| Forbidden | Why | Alternative |
Expand All @@ -82,41 +29,6 @@ Always include a benefits table:
| Nested DocStrings | Gherkin parser error | Reference code stub file |
| `#` at line start | Gherkin comment — kills parsing | Remove, use `//`, or step DocStr |

#### Description `"""` Blocks vs Step DocStrings (CRITICAL)

**`"""` inside Feature/Rule descriptions is plain text, NOT a DocString.** Only `"""` as step arguments (Given/When/Then) creates real DocStrings. This means description content between `"""` is subject to Gherkin parser rules — including `#` = comment.

**Symptom:** `expected: #EOF, #BackgroundLine... got 'some-content'`

```gherkin
Rule: My Rule

"""bash
# This breaks! Parser sees Gherkin comment, terminates description
generate-docs --output docs
"""
```

**Workarounds:**

| Approach | When to Use |
| --------------------------- | ---------------------------------- |
| Remove `#` lines | Simple cases |
| Use `//` for comments | When comment syntax doesn't matter |
| Move to step DocString | When you need code with `#` |
| Reference stub file instead | Complex examples (preferred) |

**Safe pattern — step DocString (content is real DocString, `#` is safe):**

```gherkin
Scenario: Example usage
Given the following script:
"""bash
# This is safe — real DocString, not description text
generate-docs --output docs
"""
```

#### Tag Value Constraints

**Tag values cannot contain spaces.** Use hyphens instead:
Expand Down
11 changes: 1 addition & 10 deletions _claude-md/authoring/gherkin-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,7 @@ Feature: Process Guard Linter
| Value-First | `**Business Value:**`, `**How It Works:**` | TDD-style specs |
| Context/Approach | `**Context:**`, `**Approach:**` | Technical patterns |

#### Tag Conventions

| Tag | Purpose |
| ---------------------- | --------------------------- |
| `@happy-path` | Primary success scenario |
| `@edge-case` | Boundary conditions |
| `@error-handling` | Error recovery scenarios |
| `@validation` | Input validation rules |
| `@acceptance-criteria` | Required for DoD validation |
| `@integration` | Cross-component behavior |
Tag inventory: `pnpm process:query -- tags` (counts per tag and value across all sources).

#### Rule Block Structure (Mandatory)

Expand Down
41 changes: 16 additions & 25 deletions _claude-md/core/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,19 @@ CONFIG → SCANNER → EXTRACTOR → TRANSFORMER → CODEC
- **Pipeline Factory**: Shared `buildMasterDataset()` in `src/generators/pipeline/build-pipeline.ts` — all consumers (orchestrator, process-api, validate-patterns) call this instead of wiring inline pipelines. Per-consumer behavior via `PipelineOptions`.
- **Single Read Model** (ADR-006): MasterDataset is the sole read model. No consumer re-derives data from raw scanner/extractor output. Anti-patterns: Parallel Pipeline, Lossy Local Type, Re-derived Relationship.

### Module Structure

| Module | Purpose |
| -------------------------- | -------------------------------------------------------------------- |
| `src/config/` | Configuration factory, presets (generic, ddd-es-cqrs) |
| `src/taxonomy/` | Tag definitions - categories, status values, format types |
| `src/scanner/` | TypeScript and Gherkin file scanning |
| `src/extractor/` | Pattern extraction from AST/Gherkin |
| `src/generators/` | Document generators, orchestrator, and pipeline factory |
| `src/generators/pipeline/` | `buildMasterDataset()` factory, `mergePatterns()`, dataset transform |
| `src/renderable/` | Markdown codec system |
| `src/validation/` | FSM validation, DoD checks, anti-patterns |
| `src/lint/` | Pattern linting and process guard |
| `src/api/` | Query layer: Data API CLI, business rules query (`rules-query.ts`) |
| `delivery-process/stubs/` | Design session code stubs (outside src/ for TS/ESLint isolation) |

**Live inventory:** `pnpm process:query -- arch context` and `pnpm process:query -- arch layer` reflect the actual annotated codebase structure.

### Three Presets

| Preset | Tag Prefix | Categories | Use Case |
| ------------------------- | -------------- | ---------- | ---------------------------------- |
| `libar-generic` (default) | `@libar-docs-` | 3 | Simple projects (this package) |
| `ddd-es-cqrs` | `@libar-docs-` | 21 | DDD/Event Sourcing architectures |
| `generic` | `@docs-` | 3 | Simple projects with @docs- prefix |
**Live module inventory:** `pnpm process:query -- arch context` and `pnpm process:query -- arch layer`

### Decision Specs

Architecture and process decisions are recorded as annotated Gherkin specs in `delivery-process/decisions/`:

| Spec | Key Decision |
| ------- | -------------------------------------------------------------------------- |
| ADR-001 | Taxonomy canonical values — tag registry is the single source of truth |
| ADR-002 | Gherkin-only testing — no `.test.ts` files, all tests are `.feature` |
| ADR-003 | Source-first pattern architecture — code drives docs, not the reverse |
| ADR-005 | Codec-based markdown rendering — Zod codecs transform data to markdown |
| ADR-006 | Single read model — MasterDataset is the sole read model for all consumers |
| PDR-001 | Session workflow commands — Process Data API CLI design decisions |

Query decisions: `pnpm process:query -- decisions <pattern>`
14 changes: 4 additions & 10 deletions _claude-md/core/common-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ pnpm test <pattern> # Run tests matching pattern (e.g., pnpm test scanner)
# Linting
pnpm lint # ESLint on src and tests
pnpm lint:fix # Auto-fix lint issues
pnpm lint-patterns # Lint pattern annotations in src/**/*.ts

# Validation
pnpm validate:patterns # Cross-source pattern validation
pnpm validate:dod # Definition of Done validation
pnpm validate:all # All validations including anti-patterns
# Validation + Documentation
pnpm validate:all # All validations including anti-patterns and DoD
pnpm docs:all # Generate all doc types

# Documentation generation
pnpm docs:patterns # Generate pattern docs
pnpm docs:all # Generate all doc types (patterns, roadmap, remaining, changelog)

# Data API (see "Data API CLI" section for full reference)
# Data API (see Context Gathering Protocol above)
pnpm process:query -- --help # All subcommands and options
pnpm process:query -- context <pattern> --session design # Session context bundle
pnpm process:query -- overview # Project health summary
Expand Down
40 changes: 40 additions & 0 deletions _claude-md/core/context-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### Context Gathering Protocol (MANDATORY)

**Rule: Always query the Process Data API BEFORE using grep, explore agents, or reading files.**

The API returns structured, current data using 5-10x less context than file reads. Annotations and relationships in source files feed the API — invest in annotations, not manual notes.

#### PR / Session Start (run these FIRST)

| Step | Command | What You Get |
| ---- | ---------------------------------------------------------- | ------------------------------------------- |
| 1 | `pnpm process:query -- overview` | Project health, active phases, blockers |
| 2 | `pnpm process:query -- scope-validate <pattern> <session>` | Pre-flight: FSM violations, missing deps |
| 3 | `pnpm process:query -- context <pattern> --session <type>` | Curated context bundle for the session |
| 4 | `pnpm process:query -- files <pattern> --related` | File reading list with implementation paths |

Session types: `planning` (minimal), `design` (full: stubs + deps + deliverables), `implement` (focused: deliverables + FSM + tests).

#### When You Need More Context

| Need | Command (NOT grep) | Why |
| ----------------------- | ------------------------------------------- | ------------------------------------------- |
| Find code structure | `arch context [name]` / `arch layer [name]` | Structured by annotations, not file paths |
| Find dependencies | `dep-tree <pattern>` | Shows status of each dependency |
| Find business rules | `rules --pattern <name>` | Extracted from Gherkin Rule: blocks |
| Find unannotated files | `unannotated --path <dir>` | Catches missing @libar-docs markers |
| Check FSM state | `query getProtectionInfo <status>` | Protection level + allowed actions |
| Check valid transitions | `query getValidTransitionsFrom <status>` | Valid next states from current status |
| Tag inventory | `tags` | Counts per tag and value across all sources |
| Annotation coverage | `arch coverage` | Files with/without @libar-docs annotations |

#### Why Annotations Beat Grep

- **Structured**: `arch context` groups by bounded context; grep returns unstructured matches
- **Queryable**: `rules --only-invariants` extracts 140+ business rules; grep can't parse Rule: blocks
- **Feed generation**: Annotations produce generated docs; grep results are ephemeral
- **Discoverable**: `unannotated --path` finds gaps; grep doesn't know what's missing

**When adding new code:** Add `@libar-docs` annotations and relationship tags (`@libar-docs-depends-on`, `@libar-docs-uses`) so future sessions can discover the code via API queries instead of grep.

Full CLI reference: `pnpm process:query -- --help`
Loading
Loading