This file helps future Codex sessions ramp up quickly in this repository.
- Package:
@libar-dev/architect - Purpose: context engineering toolkit that extracts patterns from TypeScript + Gherkin into a queryable delivery state, generated docs, and workflow enforcement.
- Core principle: code/spec annotations are the source of truth; generated docs are projections.
- Manual docs index:
/Users/darkomijic/dev-projects/delivery-process/docs/INDEX.md - Config entry point:
/Users/darkomijic/dev-projects/delivery-process/architect.config.ts - Live generated area index:
/Users/darkomijic/dev-projects/delivery-process/docs-live/PRODUCT-AREAS.md - Key generated area docs:
/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/ANNOTATION.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/CONFIGURATION.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/CORE-TYPES.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/DATA-API.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/GENERATION.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/PROCESS.md/Users/darkomijic/dev-projects/delivery-process/docs-live/product-areas/VALIDATION.md
- External tutorial source:
/Users/darkomijic/dev-projects/architect-tutorials/TUTORIAL-ARTICLE-v1.md - Tutorial goal: bootstrap from blank project to full docs/query flow (
11 patterns,26 generated filesin demo scenario). - Treat tutorial outputs as illustrative; validate commands against current CLI behavior before codemods/docs changes.
- Important known alignment points from tutorial review:
architect overviewincludes the Data API helper section in output (not always shown in article snippets).- Current
architect-generate --list-generatorsoutput does not includeproduct-area-docs. architect-generateaccepts both repeated-gflags and comma-separated generator lists.- Shape-derived entries can affect counts and
stubsoutput (shape patterns appear as separate entries). arch contextgroups only patterns carrying explicit@architect-arch-context.
When guiding users in external repos, pick command style based on config format:
- If the repo uses
architect.config.js(or no config), package binaries are fine:
npx architect-generate --help
npx architect --help
npx architect-lint-patterns --help
npx architect-guard --help
npx architect-validate --help- If the repo uses
architect.config.ts, usetsx-based wrappers (or switch to.jsconfig).- Reason: plain Node execution may fail to import
.tsconfig files in some environments.
- Reason: plain Node execution may fail to import
Use architect.config.ts or .js as the main integration contract and keep scripts thin wrappers around package CLIs.
- Pipeline:
Config -> Scanner -> Extractor -> Transformer -> Codec. - Central read model:
PatternGraph(consumed by docs generation, Data API, and validators). - Preset in this repo config:
libar-generic(@architect-*tags). - Source ownership invariant:
- TypeScript owns runtime relationships (
uses,used-by, category-like tags). - Gherkin owns planning/process metadata (
depends-on, quarter, team, phase, deliverables).
- TypeScript owns runtime relationships (
- Source code:
/Users/darkomijic/dev-projects/delivery-process/src - Feature specs (roadmap/process/decisions/releases):
/Users/darkomijic/dev-projects/delivery-process/architect/specs/Users/darkomijic/dev-projects/delivery-process/architect/decisions/Users/darkomijic/dev-projects/delivery-process/architect/releases
- Design stubs (non-compiled on purpose):
/Users/darkomijic/dev-projects/delivery-process/architect/stubs - Tests:
- Feature files:
/Users/darkomijic/dev-projects/delivery-process/tests/features - Step definitions:
/Users/darkomijic/dev-projects/delivery-process/tests/steps
- Feature files:
Session types and expected outcomes:
- Planning: create/update roadmap
.featurespec (status typicallyroadmap). - Design: produce decision specs and/or stubs in
architect/stubs/(no implementation). - Implementation: transition
roadmap -> active -> completedwhile implementing deliverables.
FSM/protection conventions:
roadmap/deferred: fully editableactive: scope-locked (do not add deliverables)completed: hard-locked (changes require unlock-reason tag)
Use the CLI instead of broad file exploration whenever possible:
pnpm architect:query -- overview
pnpm architect:query -- scope-validate <PatternName> implement
pnpm architect:query -- context <PatternName> --session implement
pnpm architect:query -- dep-tree <PatternName>
pnpm architect:query -- files <PatternName> --relatedUseful discovery commands:
pnpm architect:query -- list --status roadmap --names-only
pnpm architect:query -- arch blocking
pnpm architect:query -- stubs --unresolved
pnpm architect:query -- unannotated --path srcCore dev:
pnpm build
pnpm typecheck
pnpm lint
pnpm testProcess/quality checks:
pnpm architect:lint-steps
pnpm architect:lint-patterns
pnpm architect:guard
pnpm validate:patterns
pnpm validate:dod
pnpm validate:all- Main generated output root from config:
docs-generated/ - Product area and ADR outputs are overridden to
docs-live/in config.
Common commands:
pnpm docs:product-areas
pnpm docs:reference
pnpm docs:decisions
pnpm docs:allRule: do not hand-edit generated artifacts when regeneration is the intended flow.
Current built-in generator list is discovered from CLI (architect-generate --list-generators).
Do not assume undocumented generator names are available without checking.
- This repo follows strict Gherkin-first testing:
- Specs in
.feature - Step definitions in
.steps.ts - Avoid introducing classic
*.test.tsfiles for new coverage unless explicitly requested.
- Specs in
- Never commit skipped/only tests (
it.skip,it.only,describe.skip,describe.only). - For
vitest-cucumber:Scenario: use Cucumber expressions ({string},{int}) and function params.ScenarioOutline: use<column>placeholders and read viavariables.column.
- Keep edits focused; prefer changing source-of-truth files over generated docs.
- If changing tags/taxonomy/config, run relevant validation and at least targeted docs generation.
- For workflow/status/deliverable changes, run process guard checks before finalizing.
- Read
docs/INDEX.mdandarchitect.config.ts. - Run
pnpm architect:query -- overview. - If working on a specific pattern, run:
pnpm architect:query -- scope-validate <PatternName> implementpnpm architect:query -- context <PatternName> --session <design|implement>
- Make minimal source changes.
- Run targeted tests + relevant lint/validation.
- Regenerate docs if source annotations/specs/config changed.
There is currently no dedicated interactive onboarding command in this package. If implementing one, design for existing-repo adoption first:
- Command shape
- Add a new bin command (example:
architect-init) so users can runnpx architect-init.
- Add a new bin command (example:
- Wizard responsibilities
- Detect package manager and module mode (
type: module). - Scaffold
architect.config.tswith chosen preset and discovered source globs. - Offer optional npm scripts for
architect, docs generation, and validation commands. - Optionally scaffold starter folders (
architect/specs,architect/stubs) and sample spec/stub templates.
- Detect package manager and module mode (
- Safety requirements
- Dry-run mode and explicit overwrite confirmations.
- Never silently overwrite existing
architect.config.tsor user scripts.
- Success criteria
- User can run
architect overviewandarchitect-generate --list-generatorsimmediately after setup.
- User can run