Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
55210d7
chore: readme tweak+
marlonmarcello Jun 15, 2026
57a62b3
docs: add config setup plan
marlonmarcello Jun 15, 2026
8350bd2
docs: link config setup plan
marlonmarcello Jun 15, 2026
34b9069
feat: add layered config manager
marlonmarcello Jun 15, 2026
7dbb639
chore: agents instrucitons for commit+
marlonmarcello Jun 15, 2026
f9674b9
feat: add settings CLI command
marlonmarcello Jun 15, 2026
a66ed35
feat: add settings TUI config editor
marlonmarcello Jun 15, 2026
5b2b10d
fix: remove solid preload from bunfig
marlonmarcello Jun 15, 2026
e1864c9
refactor: componentize settings form UI
marlonmarcello Jun 15, 2026
4515cdc
chore: changeset
marlonmarcello Jun 15, 2026
c5b9664
feature: UI/UX tweaks and componetization
marlonmarcello Jun 15, 2026
cf3efe3
chore: doc tweak
marlonmarcello Jun 15, 2026
a2c0010
fix: bun native file operations
marlonmarcello Jun 15, 2026
934b64c
fix: preload input
marlonmarcello Jun 15, 2026
873eb64
refactor: status bar provider
marlonmarcello Jun 15, 2026
b625a81
chore: remove useless hint+
marlonmarcello Jun 15, 2026
0da4ab9
refactor: export order
marlonmarcello Jun 15, 2026
ae2392e
chore: doc tweaks
marlonmarcello Jun 15, 2026
baf51c3
chore: state manager plans
marlonmarcello Jun 15, 2026
212cc53
feature: basic state manager
marlonmarcello Jun 15, 2026
ed1b779
feature: adds env for config dir
marlonmarcello Jun 15, 2026
7bd90cf
refactor: moves from JSON to YAML
marlonmarcello Jun 17, 2026
0e4ff03
chore: doc tweak
marlonmarcello Jun 17, 2026
9ddb271
fix: crypto mentioins
marlonmarcello Jun 17, 2026
3b453d1
chore: changeset
marlonmarcello Jun 17, 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
5 changes: 5 additions & 0 deletions .changeset/cute-ideas-show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wtc": minor
---

feature: adds a state manager and config manager
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
quality:
name: Lint, Typecheck & Test
Expand Down
83 changes: 43 additions & 40 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
# wtc — AI Agent Instructions

## Overview

`wtc` is a CLI/TUI tool for managing GitHub repos, AWS Amplify projects, and Teamwork tasks. Built with Bun + OpenTUI (core functional API, no JSX framework).
`wtc` is a CLI/TUI tool for managing GitHub repos, AWS Amplify projects, and Teamwork tasks. Built with Bun + OpenTUI Solid.

## Important Files

Before making changes, read these files for context:

- **`plans/PLAN.md`** — Full project roadmap, architecture, conventions, all phases
- **`plans/MVP.md`** — Current MVP scope and deliverables
- **`package.json`** — Scripts and dependencies
- **`tsconfig.json`** — TypeScript configuration (strict mode)

## Tech Stack

| Concern | Choice |
| ----------------- | --------------------------------- |
| Runtime | Bun |
| TUI | `@opentui/solid` + `solid-js` |
| CLI parser | yargs |
| Linter | oxlint |
| Formatter | oxfmt |
| Test runner | bun test |
| Pre-commit | husky + lint-staged |
| Release versions | Changesets |
| Encryption | Web Crypto (AES-256-GCM + PBKDF2) |
| Config validation | zod |
| Concern | Choice |
| ----------------- | ----------------------------- |
| Runtime | Bun |
| TUI | `@opentui/solid` + `solid-js` |
| CLI parser | yargs |
| Linter | oxlint |
| Formatter | oxfmt |
| Test runner | bun test |
| Pre-commit | husky + lint-staged |
| Release versions | Changesets |
| Config validation | zod |

## Conventions

### Branching

```
(feature|fix|chore)/TASK-XXXXX
```

### Commits

Conventional commits: `feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`

- Always check-in with user first before making the commit so they can check diff and ask for changes
- Make small commits so it's easy to see progress and revert changes
- Stop at a breakpoint before every commit and before continuing to the next main step. The user will inspect the diff themselves; do not commit or continue until they explicitly approve.

### TypeScript

- strict mode, no `any`, no `as` casts where avoidable
Expand All @@ -50,39 +42,50 @@ Conventional commits: `feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`
- Functions: `camelCase`
- Tests: `*.test.ts` in `tests/` mirroring `src/` structure

### File Organization / Helper Scope

- Keep helpers scoped to the smallest place that needs them.
- Put values/functions in `consts.ts` only when they are shared across modules or own environment-variable behavior.
- Keep filenames, local paths, and one-module constants inside the module that uses them.
- Do not export helpers only for tests unless they represent meaningful domain behavior.
- Do not create helper functions for one-use expressions.
- Prefer inline local constants over private one-line functions.
- Manager modules should contain domain behavior, not generic wrappers around simple file reads/writes.
- If a helper exists only to make a test easier, reconsider the test or test higher-level behavior instead.

Examples:

- `getCacheDir()` belongs in `src/state/consts.ts` because it is shared and owns `WTC_CACHE_DIR`.
- `getUserConfigDir()` belongs in `src/config/consts.ts` because it owns `WTC_CONFIG_DIR`.
- `STATE_FILE = "tui-state.json"` belongs in `src/state/manager.ts` because only the state manager uses it.
- `getStatePath()` should not exist if it only appends `STATE_FILE` to `getCacheDir()` in one module.
- `formatUserConfig()` is valid because Bun's YAML parser does not preserve comments, so config saves need explicit commented formatting.

## Commands

```bash
bun run dev # Watch mode (src/index.ts)
bun run lint # oxlint
bun run fmt # oxfmt (write)
bun run fmt:check # oxfmt (check only)
bun run check # tsc --noEmit
bun test # Run all tests
bun run build # Build standalone binary
bun run changeset # Add a release changeset
```

## Code Quality Rules

1. All TypeScript must compile with `tsc --noEmit` (strict mode)
2. All code must pass `oxlint` with no errors
3. All code must pass `oxfmt --check` (formatting)
4. All tests must pass (`bun test`)
5. Pre-commit hook runs lint-staged on staged `.ts` files
- [ ] `bun run fmt` passes
- [ ] `bun run lint` passes
- [ ] `bun run check` passes (tsc)
- [ ] `bun test` passes
- [ ] `bun run build` passes
- [ ] No `any` types, no default exports

**NEVER** run the binary compiled files.

## Testing Philosophy

- **Test logic, not layout.** Tests should cover pure functions, business logic, API clients, and utility modules. Do not test TUI rendering (box position, text content, styling against OpenTUI components) — that's the framework's job.
- **No mocks of the OpenTUI renderer.** Module-mocking `@opentui/core` (Box, Text, createCliRenderer, t) adds fragility and tests the mock, not the real behavior. If a function delegates to OpenTUI, trust the function; test what it computes, not how it renders.
- **Prefer real calls over mocks.** For utilities like `checkForUpdate`, test with a real (or near-real) API surface — mock at the HTTP layer only if necessary.
- **Integration tests for CLI flows** are acceptable only when they invoke the binary as a subprocess (e.g., `wtc --version`), but are deferred until Phase 2+.

## Pull Request Checklist

- [ ] `bun run lint` passes
- [ ] `bun run fmt:check` passes
- [ ] `bun run check` passes (tsc)
- [ ] `bun test` passes
- [ ] New code has tests
- [ ] No `any` types, no default exports
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,13 @@ Maintainers create releases by merging the Changesets version PR. Tag creation,
## Before Committing

Pre-commit hooks will automatically run linting and formatting on staged files.

## Development Notes

### Solid JSX at dev time

`bun run dev` uses `--preload=@opentui/solid/preload` to register a Bun runtime plugin that transforms Solid JSX on-the-fly. Do **not** move this preload to `bunfig.toml` — compiled binaries also read that config and crash because `@opentui/solid/preload` calls `registerBunPlugin()`, a Bun runtime API unavailable in standalone executables.

### `--watch` is broken in Bun 1.3.x

The `--watch` (and `--hot`) flags do not restart the process on file changes in this Bun release. This is a known Bun bug, not caused by the preload. Manual restart is required until a fix lands.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup instructions.
## Project Status

- ✅ **Phase 1 (MVP):** Hello World dashboard with tooling, CI/CD, and distribution
- **Phase 2:** Incorporate SolidJS
- **Phase 2:** Incorporate SolidJS
- **Phase 3:** GitHub repo creation
- **Phase 4:** AWS Amplify project bootstrapping
- **Phase 5:** Teamwork API integration
- **Phase 6:** Full TUI dashboard with navigation
- **Phase 7:** Distribution polish

See [plans/PLAN.md](plans/PLAN.md) and [plans/MVP.md](plans/MVP.md) for the full roadmap.
See [plans/PLAN.md](plans/PLAN.md) for the full roadmap.

## License

Expand Down
Loading
Loading