index.ts: app entrypoint; creates the OpenTUI renderer and mountsApp.src/: core TypeScript source.src/hooks/: controller and keyboard interaction logic.src/ui/components/: presentational TUI components (dialogs, panels, shortcuts).src/git.ts,src/git-process.ts,src/git-status-parser.ts: Git integration and parsing.src/config.ts,src/config-file.ts: config loading, validation, and default config generation.src/ai-commit.ts: AI commit subject generation.src/ai-commit-eval.ts: local evaluator for AI commit outputs (working tree or commit replay).bin/stage: CLI launcher.
bun install: install dependencies.bun run stage: run the TUI from source.stage --dev: run local checkout through the CLI wrapper (see README forSTAGE_DEV_PATH).bunx tsc --noEmit: required typecheck gate before submitting changes.bun run eval:ai: evaluate AI commit output for current working changes.bun run eval:ai -- --commit <sha>: replay a commit in a temp worktree and evaluate generated subject.
- Language: TypeScript (ES modules).
- Follow existing style: 2-space indentation, double quotes, no semicolons, concise functions.
- File names: kebab-case (e.g.,
use-git-tui-keyboard.ts). - Identifiers:
camelCasefor functions/variables,PascalCasefor React components/types. - Prefer single-purpose modules and keep business rules centralized (config parsing and AI logic should not be duplicated).
- No formal test framework is currently configured.
- Minimum validation for every change:
bunx tsc --noEmit- Run relevant
eval:aichecks when touching AI commit logic. - Manual TUI smoke test for changed keyboard/dialog flows.
- Use Conventional Commits (current history pattern):
fix(keyboard): ...,refactor(ui): ...,chore: ...
- Keep subject lines concise and behavior-focused.
- PRs should include:
- Why the change is needed
- What changed (key files)
- Validation performed (commands + manual checks)
- Do not commit secrets (especially
ai.api_keyvalues from.stage.tomlor user config files). - Use
STAGE_CONFIGfor local config overrides when testing variants.