@gredescerber/agent-crew 0.0.0-stage → 0.6.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 (101) hide show
  1. package/AGENTS.md +25 -0
  2. package/LICENSE +201 -0
  3. package/README.md +418 -2
  4. package/README.ru.md +421 -0
  5. package/adapters/claude/adapter.js +107 -0
  6. package/adapters/codex/adapter.js +101 -0
  7. package/bin/crew.js +60 -0
  8. package/docs/AGENT-SETUP.md +138 -0
  9. package/ecc/profile.json +16 -0
  10. package/evals/README.md +123 -0
  11. package/evals/fixtures/mini-app/README.md +10 -0
  12. package/evals/fixtures/mini-app/contracts/health.json +11 -0
  13. package/evals/fixtures/mini-app/package.json +10 -0
  14. package/evals/fixtures/mini-app/src/cart.js +14 -0
  15. package/evals/fixtures/mini-app/src/handlers.js +16 -0
  16. package/evals/fixtures/mini-app/src/pager.js +7 -0
  17. package/evals/fixtures/mini-app/test/cart.test.js +10 -0
  18. package/evals/fixtures/mini-app/test/handlers.test.js +13 -0
  19. package/evals/fixtures/mini-app/test/pager.test.js +8 -0
  20. package/evals/tasks/add-input-validation.json +15 -0
  21. package/evals/tasks/fix-off-by-one.json +14 -0
  22. package/evals/tasks/handler-per-contract.json +15 -0
  23. package/evals/tasks/judges/add-input-validation.judge.mjs +28 -0
  24. package/evals/tasks/judges/fix-off-by-one.judge.mjs +22 -0
  25. package/evals/tasks/judges/handler-per-contract.judge.mjs +18 -0
  26. package/package.json +46 -4
  27. package/roles/analyst.md +11 -0
  28. package/roles/builder.md +16 -0
  29. package/roles/implementer.md +17 -0
  30. package/roles/integrator.md +12 -0
  31. package/roles/planner.md +19 -0
  32. package/roles/reviewer.md +16 -0
  33. package/roles/scout.md +15 -0
  34. package/skills/crew-brief-analysis/SKILL.md +32 -0
  35. package/skills/crew-kickoff/SKILL.md +77 -0
  36. package/skills/crew-kickoff/task-format.md +215 -0
  37. package/skills/crew-review/SKILL.md +22 -0
  38. package/skills/crew-workflow/SKILL.md +46 -0
  39. package/src/commands/adapters.js +85 -0
  40. package/src/commands/ask.js +123 -0
  41. package/src/commands/board.js +88 -0
  42. package/src/commands/check.js +148 -0
  43. package/src/commands/commit.js +105 -0
  44. package/src/commands/compliance.js +109 -0
  45. package/src/commands/digest.js +64 -0
  46. package/src/commands/doctor.js +48 -0
  47. package/src/commands/eval.js +507 -0
  48. package/src/commands/github.js +169 -0
  49. package/src/commands/guard.js +101 -0
  50. package/src/commands/init.js +76 -0
  51. package/src/commands/kickoff.js +275 -0
  52. package/src/commands/labels.js +28 -0
  53. package/src/commands/merge-ready.js +33 -0
  54. package/src/commands/metrics.js +48 -0
  55. package/src/commands/pr.js +273 -0
  56. package/src/commands/shots.js +51 -0
  57. package/src/commands/status.js +48 -0
  58. package/src/commands/task.js +590 -0
  59. package/src/commands/up.js +355 -0
  60. package/src/commands/upgrade.js +178 -0
  61. package/src/commands/worker.js +322 -0
  62. package/src/core/board.js +127 -0
  63. package/src/core/config.js +83 -0
  64. package/src/core/digest.js +67 -0
  65. package/src/core/exec.js +50 -0
  66. package/src/core/guard.js +273 -0
  67. package/src/core/issues.js +154 -0
  68. package/src/core/lease.js +48 -0
  69. package/src/core/metrics.js +232 -0
  70. package/src/core/output.js +56 -0
  71. package/src/core/prd.js +612 -0
  72. package/src/core/proc.js +52 -0
  73. package/src/core/questions.js +51 -0
  74. package/src/core/queue.js +94 -0
  75. package/src/core/registry.js +143 -0
  76. package/src/core/session.js +61 -0
  77. package/src/core/shots.js +68 -0
  78. package/src/core/supervisor.js +56 -0
  79. package/src/core/version.js +44 -0
  80. package/src/mcp/server.js +81 -0
  81. package/templates/labels.json +23 -0
  82. package/templates/mcp.optional.json +23 -0
  83. package/templates/product/.github/ISSUE_TEMPLATE/epic.yml +22 -0
  84. package/templates/product/.github/ISSUE_TEMPLATE/feedback.yml +36 -0
  85. package/templates/product/.github/ISSUE_TEMPLATE/task.yml +62 -0
  86. package/templates/product/.github/pull_request_template.md +16 -0
  87. package/templates/product/.github/workflows/crew-guard.yml +45 -0
  88. package/templates/product/.github/workflows/crew.yml +118 -0
  89. package/templates/product/AGENTS.md +109 -0
  90. package/templates/product/contracts/README.md +8 -0
  91. package/templates/product/docs/architecture.md +41 -0
  92. package/templates/product/docs/brief-analysis.md +62 -0
  93. package/templates/product/docs/brief.md +25 -0
  94. package/templates/product/docs/playbooks/issues.md +91 -0
  95. package/templates/product/docs/playbooks/preflight.md +28 -0
  96. package/templates/product/docs/playbooks/timeline.md +52 -0
  97. package/templates/product/docs/prd.md +58 -0
  98. package/templates/product/events/event.example.json +10 -0
  99. package/templates/product/tests/acceptance/README.md +9 -0
  100. package/templates/stacks/web-fastapi.json +74 -0
  101. package/templates/stacks/web-node.json +70 -0
@@ -0,0 +1,28 @@
1
+ # Preflight — before the project starts
2
+
3
+ Items marked (event mode) apply only when the project is run as an event such as a hackathon.
4
+
5
+ ## Rules
6
+ - [ ] (event mode) The event's rules are read: is AI allowed? is disclosure required? is prebuilt code allowed in advance?
7
+ - [ ] (event mode) `events/event.json` is filled in: start/end time, `team_members` (GitHub logins of team members only)
8
+
9
+ ## Accounts and access (done by humans, not agents)
10
+ - [ ] Frontend and backend hosting, DB, auth service — accounts are created, someone on the team has access
11
+ - [ ] API keys (LLM, partners/sponsors) — in a shared password manager, **not in the repo**
12
+ - [ ] The GitHub organization, everyone on the team has permissions, Actions are enabled
13
+ - [ ] The repo is set up: `crew github setup` (see the plan) → `crew github setup --apply` — protection of `main`, the variable `CREW_HARNESS`, labels
14
+ - [ ] On a test PR the `crew-guard` status appears: `pending` without a review, `success` after `crew pr review <n> --verdict approve` from another agent
15
+
16
+ ## Machines
17
+ - [ ] Everyone: `crew doctor` is green (node, git, gh authorized, claude/codex installed)
18
+ - [ ] Windows: `git config --global core.longpaths true` (otherwise git fails on long worktree and `node_modules` paths)
19
+ - [ ] Codex: the project is marked as trusted (otherwise it will not read `.codex/config.toml`)
20
+ - [ ] Claude Code: the ECC plugin is installed
21
+ - [ ] Subscription limits are checked and there are spare API keys
22
+
23
+ ## Network and fallbacks
24
+ - [ ] 2+ people have mobile internet to share
25
+ - [ ] A plan for "what we show if everything is down": a recorded demo video
26
+
27
+ ## Human roles
28
+ - [ ] Product lead (acceptance criteria, scope), Architect (contracts), Fleet operator (workers, unblocking, `crew:pause`), Demo owner (demo, E2E, pitch)
@@ -0,0 +1,52 @@
1
+ # Project timeline
2
+
3
+ Agents write the code. Humans decide, approve, test, and present. Every phase has a **time limit and an action when it runs out** — the pipeline does not stall if someone gets stuck or falls asleep.
4
+
5
+ In a normal project the limits are guidelines; scale the absolute numbers to the project. In event mode (hackathon) `T` is the delivery deadline from `events/event.json` and the `T−n` phases are enforced by deadlines.
6
+
7
+ ## Phases
8
+
9
+ | # | Phase | Who | Limit | Done when | Ran out of time → |
10
+ |---|---|---|---|---|---|
11
+ | 0 | **Brief** | human | 10 min | the brief as is in `docs/brief.md` | — |
12
+ | 1 | **Brief analysis** | the analyst agent (`crew-brief-analysis`) | 30 min | `docs/brief-analysis.md`: **demo scenario**, `R*`, stakeholder criteria, assumptions | hand in with assumptions |
13
+ | 2 | **Plan** | planner (`crew-kickoff`) | 30 min | `docs/prd.md` + `architecture.md`, `crew task lint` is green | cut the scope to the demo path |
14
+ | 3 | **Approval** | product lead | 15 min | the PRD has `status: approved` | **after 20 min without an answer** the planner sets `approved by: auto-timeout` |
15
+ | 4 | **Tasks** | planner: `crew kickoff --apply` | 5 min | issues are created | — |
16
+ | 5 | **Skeleton + contracts** | 1–2 agents, `risk:high` | 90 min | web → api → DB is deployed, the E2E hello-world is green, `contracts/api.yaml` | a human looks at what blocks (often — access) |
17
+ | 6 | **Build** | all workers | until T−6 | tasks are moving, main is green | — |
18
+ | 7 | **Freeze** | the product lead announces | T−6 | from here only fixes and polish | — |
19
+ | 8 | **Demo** | demo owner + agents | T−3 | the demo-path E2E is green, **a fallback video is recorded** | show the video |
20
+ | 9 | **Pitch** | humans | T−2 | slides, answers to "how is it built" (`architecture.md`) | — |
21
+ | 10 | **Delivery** | human | T−1 | (event mode) `crew compliance check`, `crew compliance disclosure`, submission | — |
22
+
23
+ **From the brief to the first task in progress — no more than 75 minutes.** This is the main guide for phases 0–4.
24
+
25
+ ## Merging is continuous
26
+ - **Humans have no approve button.** `risk:low` / `risk:med` merge themselves (GitHub auto-merge) when `check` and `crew-guard` are green: the review was done by another agent (`crew pr review`), the rules and other people's acceptance tests are untouched.
27
+ - Humans do not approve, they **notice**: they test the running app, write feedback (the "Feedback" issue), and the planner turns it into tasks. Went completely wrong — `crew:pause`.
28
+ - `risk:high` (skeleton, auth, data, contracts, demo path) is merged by the integrator manually and **first** — everything else stands on it.
29
+ - Tasks with status `waiting` move to `ready` as soon as their dependencies are closed.
30
+ - **Main is red** → all workers fix main, no new tasks are taken. Red for more than 30 minutes → an issue `crew:pause`, call the humans.
31
+
32
+ ## Humans: roles and shifts
33
+
34
+ | Role | Does |
35
+ |---|---|
36
+ | **Product lead** | approves the plan, holds the scope, triages feedback every hour, announces the freeze |
37
+ | **Architect** | looks at the contracts and the skeleton, decides contested technical questions |
38
+ | **Fleet operator** | watches the workers (`crew status`, `crew metrics`), unblocks `blocked`, subscription limits, `crew:pause` |
39
+ | **Demo owner** | the demo scenario, the demo-path E2E, video, slides, pitch |
40
+
41
+ All four **test the running app and write feedback** (the "Feedback" template in Issues): what they did, what they expected, what they saw. Every hour the product lead turns feedback into tasks or PRD changes.
42
+
43
+ **Shifts:** at night at least one person (the fleet operator) is reachable. At night workers take only `risk:low`/`risk:med`; `risk:high` waits until morning if nobody can watch.
44
+
45
+ ## The brief changed along the way
46
+ 1. A human adds the changes to `docs/brief.md` (the "What was said verbally / in chat" section).
47
+ 2. The analyst updates `brief-analysis.md`: **do not renumber old `R*`**, new ones get new numbers, dropped ones are marked "dropped".
48
+ 3. The planner edits the PRD, the product lead approves, new tasks — `crew kickoff --apply` (already created ones are skipped).
49
+ 4. Tasks that are no longer needed are closed by the product lead by hand as "not planned".
50
+
51
+ ## Scope rule
52
+ 1–2 scenarios from the demo, taken to the end, beat 10 half-done. Everything that is not in the demo scenario is cut first.
@@ -0,0 +1,58 @@
1
+ <!-- crew:prd status: draft by: - at: - -->
2
+ # PRD: <product name>
3
+
4
+ > Written by the planner from `docs/brief.md` and `docs/brief-analysis.md` (skill `crew-kickoff`), at most one page of text + task blocks.
5
+ > Block format — `agents/skills/crew-kickoff/task-format.md`. Check: `crew task lint`. Plan: `crew kickoff`.
6
+ > The header on the first line is the approval. `crew kickoff --apply` creates issues only with
7
+ > `<!-- crew:prd status: approved by: <github-login> at: <ISO-time> -->`
8
+ > (no answer from the product lead in 20 minutes — the planner sets `by: auto-timeout`).
9
+
10
+ ## Problem and who it is for
11
+
12
+ <1–2 sentences>
13
+
14
+ ## Demo path
15
+
16
+ The steps stakeholders will see in the demo (judges in event mode). Requirements on this path are must, `risk: high`, done first.
17
+
18
+ 1. <step> — R1
19
+ 2. <step> — R2
20
+ 3. <step> — R3
21
+
22
+ ## Scenarios
23
+
24
+ - <main scenario 1>
25
+
26
+ ## NOT doing
27
+
28
+ - <what was deliberately cut>
29
+
30
+ ## Stakeholder criteria (judging criteria in event mode) → how we satisfy them
31
+
32
+ | Criterion | How we satisfy it |
33
+ |---|---|
34
+ | <from docs/brief.md> | <task / epic> |
35
+
36
+ ## Stack
37
+
38
+ From `crew.config.json → stack`; skeleton generators — `crew.config.json → scaffold`.
39
+
40
+ ## Epics and tasks
41
+
42
+ The first `crew-task` block is always the end-to-end skeleton. The other tasks implicitly wait for it (no need to write `after`).
43
+
44
+ ```crew-task
45
+ id: T1
46
+ title: End-to-end skeleton web → api → deploy
47
+ area: infra
48
+ tier: high
49
+ risk: high
50
+ skeleton: true
51
+ paths: [web/**, api/**, infra/**, .github/**]
52
+ goal: An empty app builds, deploys, and answers an E2E hello-world
53
+ acceptance:
54
+ - Given a clean repository When I run the generators from crew.config.json → scaffold Then crew check is green
55
+ - Given a deployed environment When I open the home page Then I see the api /health response
56
+ tests: [e2e]
57
+ req: [R1]
58
+ ```
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "Example Hackathon 2026",
3
+ "rules_url": "https://example.com/rules",
4
+ "start": "2026-12-05T10:00:00+03:00",
5
+ "end": "2026-12-07T10:00:00+03:00",
6
+ "ai_allowed": true,
7
+ "ai_disclosure_required": true,
8
+ "prebuilt_code": "tooling_only",
9
+ "team_members": ["github-login-1", "github-login-2"]
10
+ }
@@ -0,0 +1,9 @@
1
+ # tests/acceptance/
2
+
3
+ Acceptance tests for tasks' acceptance criteria. The builder writes them in the **first commit** of their task, before the implementation.
4
+
5
+ - One file per task: `test_<issue>_<slug>.*` / `<issue>-<slug>.spec.ts`.
6
+ - You may add new files. **Existing** ones are not changed or deleted: the `crew-guard` check rejects such a PR.
7
+ - The exception is a task whose "Changes acceptance" section lists these files (the `changes_acceptance` field in the PRD). The planner/analyst writes it, usually from human feedback ("login must be by phone, not by email").
8
+ - The reviewer agent checks that every Given/When/Then of the task is covered by a test and that the test is not fitted to the code.
9
+ - For `risk:high` the tests are written by **a different agent** in a separate task, in `tests/pending/<T>/` (CI does not run them there). The main task's executor moves them here unchanged in the first commit: `git mv tests/pending/<T>/* tests/acceptance/`.
@@ -0,0 +1,74 @@
1
+ {
2
+ "about": "React (Vite + TypeScript) + FastAPI (Python, uv). Frontend in web/, backend in api/, OpenAPI contract in contracts/.",
3
+ "areas": {
4
+ "web": [
5
+ "web/**"
6
+ ],
7
+ "api": [
8
+ "api/**"
9
+ ],
10
+ "contracts": [
11
+ "contracts/**"
12
+ ],
13
+ "e2e": [
14
+ "tests/e2e/**",
15
+ "tests/acceptance/**",
16
+ "tests/pending/**"
17
+ ],
18
+ "infra": [
19
+ "infra/**",
20
+ ".github/**",
21
+ "docker-compose.yml"
22
+ ],
23
+ "design": [
24
+ "design/**",
25
+ "web/src/styles/**"
26
+ ],
27
+ "research": [
28
+ "docs/research/**"
29
+ ]
30
+ },
31
+ "scaffold": [
32
+ "npm create vite@latest web -- --template react-ts",
33
+ "uv init --app api && uv add --directory api fastapi uvicorn pydantic && uv add --directory api --dev pytest ruff httpx",
34
+ "npm init playwright@latest -- --quiet tests/e2e"
35
+ ],
36
+ "check": [
37
+ {
38
+ "name": "web-lint",
39
+ "run": "npm --prefix web run lint --if-present",
40
+ "when_exists": "web/package.json"
41
+ },
42
+ {
43
+ "name": "web-types",
44
+ "run": "npm --prefix web exec -- tsc -b web --noEmit",
45
+ "when_exists": "web/tsconfig.json"
46
+ },
47
+ {
48
+ "name": "web-test",
49
+ "run": "npm --prefix web run test --if-present",
50
+ "when_exists": "web/package.json"
51
+ },
52
+ {
53
+ "name": "api-lint",
54
+ "run": "uv run --directory api ruff check .",
55
+ "when_exists": "api/pyproject.toml"
56
+ },
57
+ {
58
+ "name": "api-test",
59
+ "run": "uv run --directory api pytest -q",
60
+ "when_exists": "api/pyproject.toml",
61
+ "ok_exit_codes": [
62
+ 0,
63
+ 5
64
+ ]
65
+ },
66
+ {
67
+ "name": "acceptance",
68
+ "run": "uv run --directory api pytest -q ../tests/acceptance",
69
+ "tests_dir": "tests/acceptance",
70
+ "tests_pattern": "(^test_.*\\.py$)|(_test\\.py$)",
71
+ "timeout_s": 900
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "about": "React (Vite + TypeScript) + Node.js API (Fastify + TypeScript). Everything in one language - faster for agents.",
3
+ "areas": {
4
+ "web": [
5
+ "web/**"
6
+ ],
7
+ "api": [
8
+ "api/**"
9
+ ],
10
+ "contracts": [
11
+ "contracts/**"
12
+ ],
13
+ "e2e": [
14
+ "tests/e2e/**",
15
+ "tests/acceptance/**",
16
+ "tests/pending/**"
17
+ ],
18
+ "infra": [
19
+ "infra/**",
20
+ ".github/**",
21
+ "docker-compose.yml"
22
+ ],
23
+ "design": [
24
+ "design/**",
25
+ "web/src/styles/**"
26
+ ],
27
+ "research": [
28
+ "docs/research/**"
29
+ ]
30
+ },
31
+ "scaffold": [
32
+ "npm create vite@latest web -- --template react-ts",
33
+ "mkdir api && npm --prefix api init -y && npm --prefix api i fastify zod && npm --prefix api i -D typescript tsx vitest @types/node",
34
+ "npm init playwright@latest -- --quiet tests/e2e"
35
+ ],
36
+ "check": [
37
+ {
38
+ "name": "web-lint",
39
+ "run": "npm --prefix web run lint --if-present",
40
+ "when_exists": "web/package.json"
41
+ },
42
+ {
43
+ "name": "web-types",
44
+ "run": "npm --prefix web exec -- tsc -b web --noEmit",
45
+ "when_exists": "web/tsconfig.json"
46
+ },
47
+ {
48
+ "name": "web-test",
49
+ "run": "npm --prefix web run test --if-present",
50
+ "when_exists": "web/package.json"
51
+ },
52
+ {
53
+ "name": "api-types",
54
+ "run": "npm --prefix api exec -- tsc -b api --noEmit",
55
+ "when_exists": "api/tsconfig.json"
56
+ },
57
+ {
58
+ "name": "api-test",
59
+ "run": "npm --prefix api run test --if-present",
60
+ "when_exists": "api/package.json"
61
+ },
62
+ {
63
+ "name": "acceptance",
64
+ "run": "node --test \"tests/acceptance/**/*.test.*js\"",
65
+ "tests_dir": "tests/acceptance",
66
+ "tests_pattern": "\\.test\\.[cm]?js$",
67
+ "timeout_s": 900
68
+ }
69
+ ]
70
+ }