OFTR-001: Project Foundation
Synced from
outfitter/docs/requirements/OFTR-001-project-foundation.md. The repository is the source of truth.
Overview
Section titled “Overview”Outfitter is a TypeScript CLI project. This document specifies the baseline runtime, language, test, lint, and documentation conventions that must exist before feature work grows.
Requirements
Section titled “Requirements”OFTR-001.1: Runtime, Package Manager, and Language
Section titled “OFTR-001.1: Runtime, Package Manager, and Language”Amendment (2026-08-08): statement 2 tied the published engines.node range to
the pinned development runtime, which shipped >=24.18.0 <25 in every 1.x
release. npm resolves a bare npm install -g @ai-outfitter/outfitter as a
version range and silently selects the newest release whose engines the
running Node satisfies, so the upper bound did not warn — it installed 0.11.0
on Node 22.19+, 23.x, and 25+. Statement 2 now separates the two concerns and
statements 8 and 9 forbid an upper bound, because .node-version already
pins the tested runtime for CI.
- The project MUST use TypeScript as its primary implementation language.
- The project MUST pin the exact tested development and CI runtime version in
.node-version. - TypeScript configuration MUST enable strict type checking.
- The CLI workspace MUST provide a separate build TypeScript configuration that emits production files from
code/cli/src/tocode/cli/dist/. - The project MUST use npm as its package manager for the first version.
- The project MUST commit
package-lock.jsonafter dependency installation or updates. - When an implementation library choice remains unclear, the project SHOULD prefer the same library or convention used by pi.dev.
- Every published manifest MUST declare the same
engines.noderange, and that range MUST be>=22.19.0. - The
engines.noderange MUST NOT declare an upper bound, because npm answers an unsatisfiable bound by installing an older major release instead of failing.
OFTR-001.2: Test Framework and Coverage
Section titled “OFTR-001.2: Test Framework and Coverage”- The project MUST use Vitest as its test framework before implementing substantial runtime behavior.
- The test command MUST be runnable from package scripts.
- The coverage command MUST use
@vitest/coverage-v8. - The test configuration MUST enforce at least 99% global coverage for statements, branches, functions, and lines.
- The coverage configuration MUST include all
code/cli/src/**/*.tsfiles even when a source file is not imported by any test. - Tests that validate formal requirements MUST follow the traceability format required by OFTR-008.3.
OFTR-001.3: Linting and Complexity
Section titled “OFTR-001.3: Linting and Complexity”- The project MUST configure ESLint with TypeScript support using
eslint,@eslint/js, andtypescript-eslint. - ESLint MUST enforce a maximum cyclomatic complexity of 10.
- The lint command MUST be runnable from package scripts.
- Production code SHOULD use small command objects and services so the complexity limit remains practical.
OFTR-001.4: Persisted File Format Policy
Section titled “OFTR-001.4: Persisted File Format Policy”- User-editable persisted Outfitter configuration MUST use YAML instead of JSON unless the file is a JSON Schema.
- Every user-editable YAML file format that Outfitter reads MUST have a corresponding JSON Schema.
- Outfitter MUST validate YAML files against their JSON Schemas anywhere those files are read.
- JSON Schema files MAY use JSON because schemas are tooling-facing validation artifacts.
OFTR-001.5: Initial Dependency Set
Section titled “OFTR-001.5: Initial Dependency Set”Amendment (2026-07-01): statements 4, 5, 7, and 8 were removed and statement 10 was added, following the amendment process in docs/requirements/README.md. Rationale: typebox, defu, glob, and hosted-git-info were declared but never imported by any shipped source. Settings and profile merging is implemented by purpose-built merge code with policy-specific semantics (code/cli/src/settings/SettingsMerger.ts), profile discovery walks directories directly, and git URI handling is implemented in code/cli/src/profiles/ProfileCache.ts. Keeping the unused packages pinned only shipped supply-chain surface to every install.
- The project MUST use Commander as the CLI framework.
- The project MUST use
yamlfor YAML parsing and serialization. - The project MUST use AJV for runtime JSON Schema validation.
- REQUIREMENT REMOVED (2026-07-01): TypeBox was never adopted; JSON Schemas are authored as JSON files under
code/cli/src/schemas/. - REQUIREMENT REMOVED (2026-07-01):
defuwas never adopted; controlled settings and profile deep merging use documented merge-specific custom code. - The project MUST use
cross-spawnfor launching inner agent CLI processes. - REQUIREMENT REMOVED (2026-07-01):
globwas never adopted; profile and resource discovery reads directories directly. - REQUIREMENT REMOVED (2026-07-01):
hosted-git-infowas never adopted; hosted git URI parsing is implemented inProfileCache. - The project MAY use
chalkfor terminal diagnostics. - The CLI package MUST NOT declare production dependencies that are not imported by shipped source code.