|
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. |
| 1 | +You are building the open-source project `thinktank` — an ensemble AI coding tool. Each iteration of this loop should close ONE issue via a proper PR workflow. |
2 | 2 |
|
3 | 3 | ## Process for EACH iteration |
4 | 4 |
|
5 | 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) |
| 6 | +- Run `gh issue list --state open --limit 20` to see outstanding issues |
| 7 | +- Run `git log --oneline -5` to see recent work |
| 8 | +- Run `git checkout main && git pull` to ensure you're on latest main |
| 9 | +- Pick the highest-priority open issue using this order: |
| 10 | + 1. Security/critical bugs (#20) |
| 11 | + 2. High-priority bugs and validation (#21, #24) |
| 12 | + 3. Code quality and dead code (#22, #25, #26) |
| 13 | + 4. Test coverage (#23) |
| 14 | + 5. Infrastructure (#27, #28, #30) |
| 15 | + 6. Documentation fixes (#34, #36) |
| 16 | + 7. Features (#29, #31, #32, #33, #35) |
11 | 17 |
|
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 |
| 18 | +### Step 2: Create a branch and implement |
| 19 | +- `git checkout -b issue-N-short-description` |
| 20 | +- Implement the fix/feature for the chosen issue |
| 21 | +- Keep changes focused — one issue per PR |
| 22 | +- Run `npx tsc --noEmit` to verify types |
| 23 | +- Run `npm test` to verify all tests pass |
| 24 | +- Run `npm run lint` to verify lint passes |
| 25 | +- If you add new functionality, add tests for it |
19 | 26 |
|
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 |
| 27 | +### Step 3: Commit and push |
| 28 | +- Stage only relevant files (not .claude/ or .thinktank/) |
| 29 | +- Commit with message referencing the issue |
| 30 | +- Push with `-u origin branch-name` |
23 | 31 |
|
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" |
| 32 | +### Step 4: Create PR with proper template |
| 33 | +Use `gh pr create` with this format: |
| 34 | +``` |
| 35 | +## Summary |
| 36 | +- bullet points |
31 | 37 |
|
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"` |
| 38 | +## Change type |
| 39 | +- [x] applicable type |
41 | 40 |
|
42 | | -### Step 6: Merge |
43 | | -- Merge the PR: `gh pr merge <number> --squash --delete-branch` |
44 | | -- Pull main: `git checkout main && git pull` |
| 41 | +## Related issue |
| 42 | +Closes #N |
45 | 43 |
|
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 |
| 44 | +## How to test |
| 45 | +1. steps |
49 | 46 |
|
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 |
| 47 | +## Breaking changes |
| 48 | +- [ ] yes/no |
| 49 | +``` |
53 | 50 |
|
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 |
| 51 | +### Step 5: Self-review |
| 52 | +- Run `gh pr diff <number> --name-only` to verify only expected files changed |
| 53 | +- Add a review comment with checklist of what you verified |
| 54 | +- Check: types, error handling, imports, test coverage, lint, docs updated if needed |
63 | 55 |
|
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 |
| 56 | +### Step 6: Merge and clean up |
| 57 | +- `gh pr merge <number> --squash --delete-branch` |
| 58 | +- `git checkout main && git pull` |
| 59 | + |
| 60 | +### Step 7: File new issues if needed |
| 61 | +- If you discover something out of scope, file it with `gh issue create` |
| 62 | +- Be specific and actionable |
70 | 63 |
|
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 |
| 64 | +## Quality standards |
| 65 | +- TypeScript strict mode, no `any` |
| 66 | +- All tests must pass before PR |
| 67 | +- Lint must pass before PR |
| 68 | +- Error messages must be actionable |
| 69 | +- Keep functions small and focused |
| 70 | +- Add tests for new code paths |
0 commit comments