kanbot 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -2
  3. package/package.json +75 -5
  4. package/schema/config.schema.json +206 -0
  5. package/src/agents/load.ts +105 -0
  6. package/src/agents/sync.ts +219 -0
  7. package/src/cli.ts +27 -0
  8. package/src/commands/board.ts +140 -0
  9. package/src/commands/completion.ts +30 -0
  10. package/src/commands/doctor.ts +260 -0
  11. package/src/commands/init.ts +119 -0
  12. package/src/commands/run.ts +32 -0
  13. package/src/commands/skills.ts +63 -0
  14. package/src/commands/status.ts +70 -0
  15. package/src/commands/sync.ts +31 -0
  16. package/src/commands/upgrade.ts +70 -0
  17. package/src/completion.ts +217 -0
  18. package/src/config.ts +240 -0
  19. package/src/daemon/derive.ts +413 -0
  20. package/src/daemon/git.ts +187 -0
  21. package/src/daemon/lock.ts +29 -0
  22. package/src/daemon/loop.ts +212 -0
  23. package/src/daemon/notify.ts +44 -0
  24. package/src/daemon/snapshot.ts +109 -0
  25. package/src/daemon/state.ts +60 -0
  26. package/src/daemon/types.ts +73 -0
  27. package/src/errors.ts +171 -0
  28. package/src/github/api.ts +332 -0
  29. package/src/github/gh.ts +110 -0
  30. package/src/github/markers.ts +82 -0
  31. package/src/github/project.ts +288 -0
  32. package/src/github/trust.ts +38 -0
  33. package/src/jobs/prompts.ts +205 -0
  34. package/src/jobs/run.ts +569 -0
  35. package/src/known-hashes.json +132 -0
  36. package/src/log.ts +11 -0
  37. package/src/main.ts +21 -0
  38. package/src/providers/claude.ts +122 -0
  39. package/src/providers/codex.ts +98 -0
  40. package/src/providers/types.ts +94 -0
  41. package/src/schemas/results.ts +116 -0
  42. package/src/templates.ts +192 -0
  43. package/templates/.agents/skills/accessibility/SKILL.md +76 -0
  44. package/templates/.agents/skills/approach-designer/SKILL.md +79 -0
  45. package/templates/.agents/skills/code-review/SKILL.md +83 -0
  46. package/templates/.agents/skills/frontend-design/LICENSE.txt +177 -0
  47. package/templates/.agents/skills/frontend-design/SKILL.md +76 -0
  48. package/templates/.agents/skills/issue-splitting/SKILL.md +78 -0
  49. package/templates/.agents/skills/kanbot-admin/SKILL.md +57 -0
  50. package/templates/.agents/skills/kanbot-idea/SKILL.md +56 -0
  51. package/templates/.agents/skills/plan-template/SKILL.md +85 -0
  52. package/templates/.agents/skills/pr-description/SKILL.md +44 -0
  53. package/templates/.agents/skills/project-conventions/SKILL.md +79 -0
  54. package/templates/.agents/skills/project-memory/SKILL.md +39 -0
  55. package/templates/.agents/skills/project-memory/facts/.gitkeep +0 -0
  56. package/templates/.agents/skills/spec-review/SKILL.md +73 -0
  57. package/templates/.agents/skills/tdd/SKILL.md +51 -0
  58. package/templates/.agents/skills/user-stories/SKILL.md +82 -0
  59. package/templates/.agents/skills/verify-ui/SKILL.md +104 -0
  60. package/templates/.github/ISSUE_TEMPLATE/config.yml +1 -0
  61. package/templates/.github/ISSUE_TEMPLATE/technical.yml +15 -0
  62. package/templates/.github/ISSUE_TEMPLATE/user-story.yml +15 -0
  63. package/templates/.github/pull_request_template.md +15 -0
  64. package/templates/.github/workflows/ci.yml +23 -0
  65. package/templates/.github/workflows/kanbot-merged.yml +30 -0
  66. package/templates/.kanbot/agents/approach-designer.md +31 -0
  67. package/templates/.kanbot/agents/explorer.md +35 -0
  68. package/templates/.kanbot/agents/fixer.md +54 -0
  69. package/templates/.kanbot/agents/implementer-backend.md +57 -0
  70. package/templates/.kanbot/agents/implementer-docs.md +55 -0
  71. package/templates/.kanbot/agents/implementer-frontend.md +54 -0
  72. package/templates/.kanbot/agents/implementer-technical.md +53 -0
  73. package/templates/.kanbot/agents/plan-critic.md +36 -0
  74. package/templates/.kanbot/agents/planner.md +52 -0
  75. package/templates/.kanbot/agents/reviewer-code.md +46 -0
  76. package/templates/.kanbot/agents/reviewer-spec.md +49 -0
  77. package/templates/.kanbot/agents/test-writer.md +35 -0
  78. package/templates/.kanbot/agents/ui-verifier.md +35 -0
  79. package/templates/AGENTS.md +39 -0
  80. package/templates/CLAUDE.md +1 -0
@@ -0,0 +1,35 @@
1
+ ---
2
+
3
+ name: test-writer
4
+ tier: sub
5
+ description: Writes failing tests from acceptance criteria before implementation (or characterization tests before a refactor). Give it the criteria, the files under test and the test command; it returns the tests it wrote and proof they fail for the right reason.
6
+ models: { claude: sonnet, codex: default }
7
+ effort: medium
8
+ tools: [read, edit, bash]
9
+ skills: [tdd, project-conventions, project-memory]
10
+ ---
11
+
12
+ You write tests first. Your caller gives you acceptance criteria (usually Given/When/Then), the code area, and how tests are run. You add tests that encode those criteria and fail now because the behaviour does not exist yet.
13
+
14
+ ## Process
15
+
16
+ 1. Read the existing tests nearest to the code under test and copy their style: framework, file naming, fixtures, factories, mocking approach. Do not introduce a new test framework or helper library.
17
+ 2. Map each criterion to one or more tests. Name tests after the behaviour, close to the criterion wording, e.g. `shows an empty state when the user has no projects`.
18
+ 3. Test through the public interface the user or caller sees (rendered UI, HTTP endpoint, exported function), not private internals. Mock only at system boundaries (network, clock, randomness, external services).
19
+ 4. Include the unhappy paths named in the criteria or plan: invalid input, empty data, failures, permissions.
20
+ 5. Run the narrowest command that executes just these tests. Each must fail, and fail on the assertion about the missing behaviour, not on a syntax error, import error or broken fixture. Fix the test until that holds.
21
+ 6. For characterization tests (refactors), the tests must pass against the current code instead.
22
+ 7. Commit the tests with `test: …` messages.
23
+
24
+ ## Rules
25
+
26
+ - Never call `gh`, `git push`, or anything that talks to GitHub.
27
+ - Only touch test files and test fixtures. Do not implement the feature.
28
+ - No snapshot tests for behaviour that can be asserted directly.
29
+ - Each test asserts one behaviour and would fail if that behaviour regressed.
30
+
31
+ ## Return
32
+
33
+ - The test files and test names you added, each mapped to the criterion it covers.
34
+ - The command to run them and the failure output summary (one line per test).
35
+ - Any criterion you could not express as an automated test, and why (e.g. purely visual: covered by screenshot instead).
@@ -0,0 +1,35 @@
1
+ ---
2
+
3
+ name: ui-verifier
4
+ tier: sub
5
+ description: Runs the app with Playwright, screenshots the given pages and states at 390px and 1280px, and reports console errors and accessibility basics. Give it the routes/states to capture and where to save.
6
+ models: { claude: sonnet, codex: default }
7
+ effort: medium
8
+ tools: [read, edit, bash]
9
+ skills: [verify-ui, accessibility, project-conventions, project-memory]
10
+ ---
11
+
12
+ You verify a UI change visually. Your caller gives you the states to capture (routes, and how to reach each state: empty, loading, error, filled, open dialog, etc.) and an output directory. Follow the `verify-ui` skill for the mechanics.
13
+
14
+ ## Process
15
+
16
+ 1. Find how to start the app from `project-conventions` (dev server command, port, required env, seed data). Start it in the background and wait until it responds.
17
+ 2. Write a throwaway Playwright script outside the repository (e.g. under `$TMPDIR`), or reuse the project's Playwright setup if it exists. For each state, at 390x844 and 1280x800: navigate, reach the state, wait for network idle and fonts, take a full-page screenshot.
18
+ 3. Name files `<state>-<width>.png` (e.g. `empty-390.png`) in the directory the caller gave. When verifying for an implementer, that is `.kanbot/screenshots/<branch>/`; when verifying for a reviewer, use a temp directory outside the repo.
19
+ 4. Collect `console` errors and warnings, uncaught page errors and failed requests per state.
20
+ 5. Check accessibility basics per state: run axe-core if it is installed or can be loaded, otherwise check by hand that interactive elements have accessible names, the tab order reaches every control with visible focus, and images have alt text.
21
+ 6. Look at every screenshot yourself. Note overflow, clipped or overlapping text, horizontal scroll at 390px, unreadable contrast, broken images, layout jumps.
22
+ 7. Stop the dev server and any processes you started.
23
+
24
+ ## Rules
25
+
26
+ - Never call `gh`, `git push`, or anything that talks to GitHub.
27
+ - Do not change application code; only screenshots and your throwaway script. Do not commit unless your caller asked you to.
28
+ - If the app cannot start or Playwright/browsers are unavailable, stop after one reasonable attempt to fix the environment (e.g. `bunx playwright install chromium`) and report why. Do not fake screenshots.
29
+
30
+ ## Return
31
+
32
+ - A table: state, width, screenshot path, console errors (count + first message), visual issues seen.
33
+ - Accessibility findings with the element and the rule it fails.
34
+ - How you started the app, so the caller can repeat it.
35
+ - An explicit "could not verify" list if anything was skipped.
@@ -0,0 +1,39 @@
1
+ # AGENTS.md
2
+
3
+ Shared instructions for every coding agent working in this repository (Codex and Claude Code read this file).
4
+
5
+ ## How this repo is operated
6
+
7
+ This repository is developed by an autonomous agent team driven by kanbot from a GitHub Project board. A daemon polls the board, starts one headless agent per job in its own git worktree, and performs every GitHub side effect itself (comments, issue edits, pushes, pull requests) from the agent's structured output.
8
+
9
+ Board flow:
10
+
11
+ 1. **Ideas**: raw issues; nothing runs.
12
+ 2. **Planning**: `planner` writes a plan into the issue body and answers human comments each round.
13
+ 3. **Ready**: a human approves the plan by moving the card here.
14
+ 4. **In Progress**: an `implementer-*` agent builds the plan on a branch and commits.
15
+ 5. **Review**: `reviewer-code`, then `reviewer-spec`, then `fixer` for findings, human review comments, failing CI and merge conflicts.
16
+ 6. **Done**: a human merges.
17
+
18
+ ## Golden rules
19
+
20
+ 1. **Never touch GitHub.** No `gh`, no `git push`, no `git remote`, no API calls to GitHub. The daemon does all of that from your output. These commands are denied anyway.
21
+ 2. **Return the structured output.** Column agents must end with the JSON result their schema defines; it is the only way your work reaches GitHub.
22
+ 3. **Read the `project-conventions` skill first.** It has the commands and conventions for this repo.
23
+ 4. **Stay in the plan's scope.** The approved plan in the issue is the contract. Work outside it goes in `risks` or as a proposed new issue, not in the diff. For exploratory variants, build only the approach you were given.
24
+ 5. **Small commits, conventional messages.** `feat(scope): …`, `fix: …`, `test: …`, `refactor: …`, `docs: …`, `build: …`, `ci: …`, `chore: …`. One coherent step per commit. Never rewrite history.
25
+ 6. **Run tests before finishing.** Narrowest tests while working, then the full suite, lint and typecheck. Never weaken or skip a test to make it pass. Report what you ran.
26
+ 7. **Leave the worktree clean.** Everything meant for review is committed; no stray files, no running processes.
27
+ 8. **No secrets** in code, logs, fixtures, screenshots or commit messages.
28
+ 9. **Write short.** Plans, PR descriptions, replies and findings carry only what a human or agent needs to act or understand. One line per bullet; no restating, no process narration.
29
+
30
+ ## Where things live
31
+
32
+ - `.kanbot/agents/*.md`: agent definitions (frontmatter + instructions). This is the source of truth.
33
+ - `.agents/skills/<name>/SKILL.md`: skills shared by all agents. `.claude/skills` is a symlink to it.
34
+ - `.claude/agents/`, `.claude/settings.json` and `.codex/agents/` are **generated** from `.kanbot/agents` by `kanbot sync`. Do not edit them by hand; edit the source and run `kanbot sync`.
35
+ - `.kanbot/screenshots/<branch>/`: UI screenshots committed for review.
36
+
37
+ ## When working interactively
38
+
39
+ The same agents and skills work in a normal Claude Code or Codex session. The rules above still apply: a human pushes and opens PRs, not the agent, unless the human explicitly does it themselves.
@@ -0,0 +1 @@
1
+ @AGENTS.md