|
| 1 | +You are building the open-source project `thinktank` — an ensemble AI coding tool. Each iteration of this loop should make meaningful progress on the project. |
| 2 | + |
| 3 | +## Process for EACH iteration |
| 4 | + |
| 5 | +### Step 1: Assess current state |
| 6 | +- Run `gh issue list --state open` to see outstanding issues |
| 7 | +- Run `git log --oneline -10` to see recent work |
| 8 | +- Run `gh pr list --state all` to see PR history |
| 9 | +- Read any new comments on issues/PRs |
| 10 | +- Decide which issue to tackle this iteration (prefer: lower issue numbers first, unless a dependency requires different ordering) |
| 11 | + |
| 12 | +### Step 2: Create a branch and do the work |
| 13 | +- Create a branch: `git checkout -b issue-N-short-description` |
| 14 | +- Do the implementation work for the chosen issue |
| 15 | +- Write clean, well-structured code |
| 16 | +- Add or update tests where appropriate |
| 17 | +- Run `npx tsc` to verify the build passes |
| 18 | +- Run any existing tests |
| 19 | + |
| 20 | +### Step 3: Dogfooding checkpoint |
| 21 | +- If thinktank's `run` command is functional and relevant to the current task, USE IT to validate your work. For example: `npx tsx src/cli.ts run "review this diff for bugs" -n 2` |
| 22 | +- If thinktank isn't applicable to the current task, skip this step |
| 23 | + |
| 24 | +### Step 4: Create a PR |
| 25 | +- Commit with a clear message referencing the issue: "Fix #N: description" |
| 26 | +- Push the branch |
| 27 | +- Create a PR using `gh pr create` with: |
| 28 | + - Title referencing the issue |
| 29 | + - Body with: ## Summary, ## Changes, ## Testing, ## Issue |
| 30 | + - Link to the issue with "Closes #N" |
| 31 | + |
| 32 | +### Step 5: QA & Self-Review |
| 33 | +- Read your own PR diff: `gh pr diff <number>` |
| 34 | +- Review it critically. Check for: |
| 35 | + - Type safety issues |
| 36 | + - Missing error handling at system boundaries |
| 37 | + - Broken imports or missing exports |
| 38 | + - Any files that should have been updated but weren't (README, types, etc.) |
| 39 | +- If you find issues, fix them and push to the same branch |
| 40 | +- Add a review comment on the PR noting what you checked: `gh pr review <number> --approve --body "Self-review: checked types, error handling, imports, build passes"` |
| 41 | + |
| 42 | +### Step 6: Merge |
| 43 | +- Merge the PR: `gh pr merge <number> --squash --delete-branch` |
| 44 | +- Pull main: `git checkout main && git pull` |
| 45 | + |
| 46 | +### Step 7: File new issues |
| 47 | +- If during your work you noticed something that needs fixing but is out of scope for the current issue, file a new issue with `gh issue create` |
| 48 | +- Be specific: include what you noticed, why it matters, and a proposed fix |
| 49 | + |
| 50 | +### Step 8: Update project state |
| 51 | +- Close the issue if the PR didn't auto-close it |
| 52 | +- Leave a comment on the issue summarizing what was done |
| 53 | + |
| 54 | +## Issue priority guidance |
| 55 | +- #5 (CI) should be done early — it enables the CI badge and catches regressions |
| 56 | +- #8 (linting/DX) pairs well with #5 |
| 57 | +- #7 (templates/community files) is independent and can be done anytime |
| 58 | +- #6 (README polish/badges) depends on #5 being done (for the CI badge) |
| 59 | +- #1 (apply command) is core functionality |
| 60 | +- #3 (test verification) builds on existing code |
| 61 | +- #4 (convergence improvement) builds on #2's learnings |
| 62 | +- #2 (divergence testing) requires a real test scenario |
| 63 | + |
| 64 | +## Code quality standards |
| 65 | +- TypeScript strict mode (already configured) |
| 66 | +- No `any` types unless absolutely necessary |
| 67 | +- Error messages should be actionable ("Failed to create worktree at /path — is this a git repository?" not just "Error") |
| 68 | +- Keep functions small and focused |
| 69 | +- Prefer composition over inheritance |
| 70 | + |
| 71 | +## Important rules |
| 72 | +- NEVER push directly to main — always use branches + PRs |
| 73 | +- EVERY PR must reference an issue |
| 74 | +- If you discover a bug or needed improvement, file an issue FIRST, then fix it |
| 75 | +- Keep PRs focused — one issue per PR (small exceptions for tightly coupled changes) |
| 76 | +- The build must pass before creating a PR |
| 77 | +- Do NOT skip the self-review step — it's what makes the repo look well-maintained |
0 commit comments