Research: pc-init CLI Scaffold#
Decision 1: CLI Framework#
- Decision: Use
typerfor command definition and argument parsing. - Rationale:
typeris already a project dependency and provides typed options, strong help output, and straightforward testability. - Alternatives considered:
argparse: standard library but more boilerplate for polished UX.click: mature, buttyperprovides better type-driven ergonomics for this codebase.
Decision 2: Output Generation Model#
- Decision: Render
.pre-commit-config.yamlfrom deterministic filesystem presets (lang/<language>/+ optionalframework/<framework>/), then write with stable ordering. - Rationale: Uses user-maintained preset folders as the single source of truth while still satisfying deterministic output and minimal extensible profiles.
- Alternatives considered:
- Hardcoded in-memory profiles: simple bootstrapping but drifts from user-owned preset files.
- Dynamic remote metadata fetch: flexible but introduces nondeterminism and network dependency.
Decision 3: Framework Modeling#
- Decision: Model frameworks independently from languages; framework primary_languages are informational recommendations and are not validation gates.
- Rationale: Matches clarified behavior where frameworks can be combined with any selected languages while still documenting intended pairings.
- Alternatives considered:
- Nest frameworks under language profiles: simpler lookup but cannot express cross-language frameworks cleanly.
Decision 4: Overwrite Behavior#
- Decision: Default to no-overwrite; overwrite only when
--forceis present. - Rationale: Prevents accidental data loss and keeps non-interactive automation predictable.
- Alternatives considered:
- Interactive prompt: less CI-friendly.
- Backup and overwrite by default: surprising side effects in existing repos.
Decision 5: Validation and Quality Gates#
- Decision: Enforce TDD workflow with
pytestand strict static checks withpyreflybefore merge. - Rationale: Required by constitution and reduces regressions in profile composition logic.
- Alternatives considered:
- Relaxed type checking: lower initial friction but weaker correctness guarantees.