@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,22 @@
1
+ name: Epic
2
+ description: A large user scenario that is sliced into tasks.
3
+ labels: ["epic"]
4
+ body:
5
+ - type: textarea
6
+ id: scenario
7
+ attributes:
8
+ label: User scenario
9
+ description: What the user can do once the epic is done.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: tasks
14
+ attributes:
15
+ label: Tasks
16
+ description: Links to tasks (#N). Vertical slices, not layers.
17
+ value: |
18
+ - [ ] #
19
+ - type: textarea
20
+ id: demo
21
+ attributes:
22
+ label: How to demo
@@ -0,0 +1,36 @@
1
+ name: Feedback
2
+ description: Tested the running app - what is wrong or what to improve. The product lead regularly turns feedback into tasks.
3
+ labels: ["feedback"]
4
+ body:
5
+ - type: dropdown
6
+ id: kind
7
+ attributes:
8
+ label: What is it
9
+ options: ["Bug", "Design / UX", "Functionality", "Idea"]
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: did
14
+ attributes:
15
+ label: What you did
16
+ description: Steps to reproduce. A link to the page of the running app.
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: expected
21
+ attributes:
22
+ label: What you expected
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: actual
27
+ attributes:
28
+ label: What you saw
29
+ description: You can paste a screenshot (Ctrl+V).
30
+ - type: dropdown
31
+ id: severity
32
+ attributes:
33
+ label: How important
34
+ options: ["Breaks the demo", "Noticeable to stakeholders", "Minor"]
35
+ validations:
36
+ required: true
@@ -0,0 +1,62 @@
1
+ name: Task
2
+ description: One task for one agent. Without acceptance criteria an agent will not take it.
3
+ labels: ["status:needs-spec"]
4
+ body:
5
+ - type: textarea
6
+ id: goal
7
+ attributes:
8
+ label: Goal
9
+ description: One sentence - why this task exists.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: acceptance
14
+ attributes:
15
+ label: Acceptance criteria
16
+ description: Given / When / Then. Every item must be verifiable by a test.
17
+ value: |
18
+ - [ ] Given ... When ... Then ...
19
+ validations:
20
+ required: true
21
+ - type: input
22
+ id: contract
23
+ attributes:
24
+ label: Contract
25
+ description: A link to a part of the contract, e.g. contracts/api.yaml#/paths/~1auth
26
+ - type: input
27
+ id: paths
28
+ attributes:
29
+ label: Allowed paths
30
+ description: For example web/src/features/auth/**
31
+ - type: input
32
+ id: after
33
+ attributes:
34
+ label: Dependencies
35
+ description: "After #N, #M - until they are closed the task stays in status:waiting (crew task promote moves it to ready)"
36
+ - type: input
37
+ id: req
38
+ attributes:
39
+ label: Brief requirements
40
+ description: Requirement IDs from docs/brief-analysis.md, e.g. R1, R3
41
+ - type: textarea
42
+ id: changes_acceptance
43
+ attributes:
44
+ label: Changes acceptance
45
+ description: "Only if the task changes EXISTING acceptance tests (e.g. because of feedback). One path per line: tests/acceptance/test_12_login.py. The task's PR cannot change any other existing tests (crew-guard)."
46
+ - type: textarea
47
+ id: out_of_scope
48
+ attributes:
49
+ label: Out of scope
50
+ - type: dropdown
51
+ id: risk
52
+ attributes:
53
+ label: Risk
54
+ options: ["low", "med", "high"]
55
+ - type: textarea
56
+ id: tests
57
+ attributes:
58
+ label: Required tests
59
+ value: |
60
+ - [ ] unit
61
+ - [ ] contract
62
+ - [ ] e2e (if it touches the demo path)
@@ -0,0 +1,16 @@
1
+ Closes #
2
+
3
+ **Agent:** `` <!-- claude/opus, codex/..., human -->
4
+
5
+ ## What was done
6
+ -
7
+
8
+ ## Checks
9
+ - [ ] `crew check` is green
10
+
11
+ ## Review checklist (filled in by a reviewer from another vendor, with evidence: file:line or test)
12
+ - [ ] Behavior regressions / the demo path is not broken
13
+ - [ ] Security assumptions (secrets, auth, untrusted input, prompt injection)
14
+ - [ ] Data integrity and conformance to `contracts/`
15
+ - [ ] Error handling (no swallowed exceptions, fallbacks for LLM/API)
16
+ - [ ] Rollout safety (can be rolled back, main stays demo-ready)
@@ -0,0 +1,45 @@
1
+ # PR rules without a human "approve" button (crew guard). Sets the crew-guard commit status -
2
+ # a required check in main's protection (crew github setup).
3
+ #
4
+ # Why pull_request_target and issue_comment: both events take THIS file and crew.config.json from main,
5
+ # not from the PR branch, so a PR cannot weaken the check for itself. PR code is not run here -
6
+ # only the file list and comments are read via the GitHub API, so write permissions are safe.
7
+ #
8
+ # failure - the PR touches agent/CI rules or someone else's acceptance tests, or the reviewer asks for changes;
9
+ # pending - waiting for an agent review (crew pr review); success - can be merged (auto-merge will do it).
10
+ name: crew-guard
11
+
12
+ on:
13
+ pull_request_target:
14
+ types: [opened, synchronize, reopened, edited, labeled, unlabeled]
15
+ issue_comment:
16
+ types: [created, edited] # crew pr review writes a comment → recompute the status
17
+ workflow_dispatch:
18
+ inputs:
19
+ pr: { description: "PR number", required: true }
20
+
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ statuses: write # the crew-guard commit status
26
+
27
+ jobs:
28
+ guard:
29
+ if: github.event_name != 'issue_comment' || (github.event.issue.pull_request && (contains(github.event.comment.body, 'crew:review') || contains(github.event.comment.body, 'crew:waive')))
30
+ runs-on: ubuntu-latest
31
+ concurrency:
32
+ group: crew-guard-${{ github.event.pull_request.number || github.event.issue.number || inputs.pr }}
33
+ cancel-in-progress: true
34
+ steps:
35
+ # checkout without ref → main (base). We do not take the PR branch: its code is not needed here and must not be executed.
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-node@v4
38
+ with: { node-version: 22 }
39
+ - name: Install agent-crew (npm, pinned version)
40
+ run: npm install -g "${{ vars.CREW_HARNESS }}"
41
+ - name: crew guard
42
+ env:
43
+ GH_TOKEN: "${{ github.token }}"
44
+ PR: "${{ github.event.pull_request.number || github.event.issue.number || inputs.pr }}"
45
+ run: crew guard --pr "$PR" --report --json
@@ -0,0 +1,118 @@
1
+ # Code checks: linter, types, tests from crew.config.json. They work the same for Claude, Codex, and humans.
2
+ # PR rules (protected files, acceptance tests, agent review) live in crew-guard.yml, which runs from main.
3
+ # Requires the variable CREW_HARNESS (Settings → Variables), e.g. @gredescerber/agent-crew@0.6.0
4
+ # (installed from the public npm registry at a pinned version; no token).
5
+ # Main's protection, the variable, and the labels are set up by `crew github setup --apply`.
6
+ name: crew
7
+
8
+ on:
9
+ pull_request:
10
+ types: [opened, synchronize, reopened]
11
+ push:
12
+ branches: [main]
13
+ schedule:
14
+ - cron: "*/15 * * * *" # return expired task leases
15
+ # closing an issue → tasks that were waiting for it (status:waiting) move to ready (job promote)
16
+ issues:
17
+ types: [closed]
18
+ workflow_dispatch:
19
+
20
+ # Minimal permissions by default: the check job runs code from the PR (tests), so it needs no write access.
21
+ # issues: write is only for sweep (returning expired leases) and promote (waiting → ready).
22
+ permissions:
23
+ contents: read
24
+ pull-requests: read
25
+
26
+ jobs:
27
+ # The job name `check` is the required-check context in main's protection (crew github setup).
28
+ check:
29
+ if: github.event_name != 'schedule' && github.event_name != 'issues'
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ with: { fetch-depth: 0 }
34
+ - uses: actions/setup-node@v4
35
+ with: { node-version: 22 }
36
+ - uses: astral-sh/setup-uv@v6
37
+ - name: Install agent-crew (npm, pinned version)
38
+ run: npm install -g "${{ vars.CREW_HARNESS }}"
39
+ - name: Generated configs are up to date
40
+ run: crew adapters build --check --json
41
+ # On PRs the checks come from the base commit: an agent cannot "go green" by replacing check in crew.config.json with true.
42
+ # On push to main there is no base - crew.config.json from the commit itself is used.
43
+ - name: crew.config.json from the base commit (PR only)
44
+ if: github.event_name == 'pull_request'
45
+ env: { BASE_SHA: "${{ github.event.pull_request.base.sha }}" }
46
+ run: |
47
+ if git cat-file -e "$BASE_SHA:crew.config.json" 2>/dev/null; then
48
+ git show "$BASE_SHA:crew.config.json" > crew.config.json
49
+ echo "crew.config.json taken from base $BASE_SHA"
50
+ else
51
+ echo "::warning::The base commit has no crew.config.json - using the version from the PR"
52
+ fi
53
+ # Clean runner: without node_modules the lint/tsc/test steps from crew.config.json fail on every PR.
54
+ # Python dependencies are installed by `uv run` itself (it syncs the api/ environment before running).
55
+ - name: Product dependencies (web/, api/)
56
+ run: |
57
+ for d in web api; do
58
+ if [ -f "$d/package-lock.json" ]; then npm --prefix "$d" ci --no-audit --no-fund
59
+ elif [ -f "$d/package.json" ]; then npm --prefix "$d" install --no-audit --no-fund
60
+ fi
61
+ done
62
+ - name: crew check
63
+ run: crew check --json
64
+ - name: Event-mode compliance check (no-op unless event mode is configured)
65
+ env: { GH_TOKEN: "${{ github.token }}" }
66
+ run: crew compliance check --json
67
+
68
+ sweep:
69
+ if: github.event_name == 'schedule'
70
+ runs-on: ubuntu-latest
71
+ permissions:
72
+ contents: write # crew merge-ready merges ready PRs
73
+ issues: write # change status labels and write release markers
74
+ pull-requests: write # recompute crew-guard and merge ready PRs
75
+ statuses: write # the crew-guard commit status
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+ - uses: actions/setup-node@v4
79
+ with: { node-version: 22 }
80
+ - name: Install agent-crew (npm, pinned version)
81
+ run: npm install -g "${{ vars.CREW_HARNESS }}"
82
+ - env: { GH_TOKEN: "${{ github.token }}" }
83
+ run: crew task sweep --json
84
+ # A same-vendor review is counted via fallback_minutes, but the status will not recompute without an event.
85
+ # Every 15 minutes we recompute crew-guard for open PRs (code and config come from main, PR code is not executed).
86
+ - name: Recompute crew-guard for open PRs
87
+ env: { GH_TOKEN: "${{ github.token }}" }
88
+ run: |
89
+ for n in $(gh pr list --state open --json number --jq '.[].number'); do
90
+ crew guard --pr "$n" --report --json > /dev/null || true
91
+ done
92
+
93
+ # Merge PRs that are ready but not auto-merged (risk:high, or auto-merge off): no agent session needed.
94
+ - name: Merge ready PRs
95
+ env: { GH_TOKEN: "${{ github.token }}" }
96
+ run: crew merge-ready --json
97
+
98
+ # Team status in one pinned issue (no LLM): who waits for a human, stale leases, PRs, idle members.
99
+ - name: Update crew digest
100
+ env: { GH_TOKEN: "${{ github.token }}" }
101
+ run: crew digest --post --json
102
+
103
+ # An issue was closed → waiting tasks whose crew:after are all closed become ready.
104
+ promote:
105
+ if: github.event_name == 'issues'
106
+ runs-on: ubuntu-latest
107
+ concurrency: { group: crew-promote, cancel-in-progress: false }
108
+ permissions:
109
+ contents: read
110
+ issues: write # change status labels and write a comment
111
+ steps:
112
+ - uses: actions/checkout@v4
113
+ - uses: actions/setup-node@v4
114
+ with: { node-version: 22 }
115
+ - name: Install agent-crew (npm, pinned version)
116
+ run: npm install -g "${{ vars.CREW_HARNESS }}"
117
+ - env: { GH_TOKEN: "${{ github.token }}" }
118
+ run: crew task promote --json
@@ -0,0 +1,109 @@
1
+ # AGENTS.md — rules for working in this repository
2
+
3
+ This file is read by all agents (Claude Code via CLAUDE.md, Codex directly, and others).
4
+ It is short on purpose. Details are in `agents/skills/*` and `docs/playbooks/*`; read them when needed.
5
+
6
+ **Language.** Write everything that goes to GitHub (issues, PRs, comments, commit messages, review notes, handoffs) and to other agents in English. Talk to the human in the language the human uses with you.
7
+
8
+ ## Who we are
9
+ A team of humans and AI agents builds a software project. Tasks live in GitHub Issues.
10
+ Work is coordinated only through `crew` (CLI or the MCP tools `crew_*`). Do not make agreements "in chat".
11
+
12
+ **Order:** brief (`docs/brief.md`) → brief analysis with a demo scenario (skill `crew-brief-analysis`) → plan (`crew-kickoff`) → approval → tasks → code.
13
+ No product code is written before the plan is approved. Priority always goes to what is visible in the demo scenario.
14
+
15
+ ## The work cycle (mandatory)
16
+ 1. `crew task next [--area <area>] [--tier <low|mid|high>]` — what to do. It first hands out work that unblocks the team: `artifacts.kind: fix` (your PR is waiting for you: reviewer changes, red check, conflict with main), `merge` (merge a ready PR) or `review` (review per the skill `crew-review`), then tasks — first from your area (the `crew-team` block in `docs/prd.md`). Do what `next_actions` says.
17
+ 2. `crew task claim <id>` — take it. Work **only** in the created worktree/branch.
18
+ 3. Read the task (`gh issue view <id>`), especially the **acceptance criteria**.
19
+ 4. Tests for the acceptance criteria first, then the implementation.
20
+ 5. `crew check` — until it is green. Only a full run counts: `crew check --only <step>` is for debugging.
21
+ 6. `crew commit -m "feat: ..."` — a commit with trailers (do not use a bare `git commit`). Works only on the task's branch.
22
+ 7. `crew pr open` — submit the work. After review changes, `crew commit` and `crew pr open` again (a second PR is not created). Then `crew task next`.
23
+
24
+ **Lease.** The task is yours while you are active: `crew check` and `crew commit` renew the lease themselves. If you think or wait for more than 30 minutes without them, run `crew task heartbeat <id>`. If a command returned `lease_lost`, the task was given to someone else: do not push your branch, leave a note in the issue about what you got done, and take a new task.
25
+
26
+ Every `crew` command returns JSON: `status`, `summary`, `next_actions`, `artifacts`, `error`.
27
+ **Do what `next_actions` says.** On an error look at `error.retry` and `error.stop_when`.
28
+
29
+ ## The executor and its subagents
30
+ A task is taken by the **executor** — the agent that ran `crew task claim`. It is like a contractor: it may call its own subagents as needed, but **it submits the work and answers for it**.
31
+ - Subagents may: search code and documentation, write tests and code on the executor's assignment, check the executor's code before submission (code-reviewer, security-reviewer), run `crew check`.
32
+ - Executor only: `crew task next` / `claim` / `release` / `status`, `crew commit`, `crew pr open`. A subagent does not take a new task or submit a PR.
33
+ - Subagents work in the task's worktree and in its area. In parallel — only reading and searching; edits to the same files go one at a time, otherwise they overwrite each other.
34
+ - A subagent's review before submission is useful, but it is **not** the review for `crew-guard`: only a review by another agent counts (`crew pr review` not from the executor or its subagents).
35
+ - Every subagent spends the subscription limits of whoever owns the laptop. Call them when it really speeds up the task.
36
+
37
+ **Who gets what (saving limits).** The executor on the senior model thinks and verifies; cheaper helpers do the work:
38
+
39
+ | Helper | Model (`crew.config.json → tiers`) | Assign |
40
+ |---|---|---|
41
+ | `scout` | low — Claude: haiku | searching code, reading documentation, running `crew check` with a brief retelling of errors. Changes nothing |
42
+ | `implementer` | mid — Claude: sonnet | code or tests on a clear assignment: what, in which files, by which criteria |
43
+ | the executor itself | high — Claude: opus | analyzing the task, decisions, contracts, verifying the helpers' work, `crew commit`, `crew pr open` |
44
+
45
+ - Do not call the senior model as a subagent for what `scout` or `implementer` does.
46
+ - A subagent starts from scratch: the task is retold to it every time. A couple-of-minutes chore is cheaper to do yourself.
47
+ - Check a helper's work before `crew commit` — you answer for it.
48
+ - In Codex the roles are the skills `role-scout`, `role-implementer`; models per tier are in `crew.config.json → tiers.<tier>.codex`.
49
+
50
+ **A separate task or a subagent?** A piece that can be merged and shown separately (its own area, its own acceptance criteria) is a separate task in the queue (`crew task status <id> blocked --note "task needed: …"` or feedback to the planner). A piece needed only inside your task (search, tests, a draft check, a routine edit in your area) is a subagent.
51
+
52
+ **`risk:high` tasks: tests are written by a different agent.** Every such task (except the skeleton) has a paired tests task (`tests_for`).
53
+ - Tests task: you write acceptance tests for the main task's criteria **only** in `tests/pending/<T>/`. You do not write product code. CI does not run these tests yet.
54
+ - The main task waits for the tests task. Its executor is **a different agent** (`crew task claim` refuses whoever wrote the tests). In the first commit it moves the tests unchanged: `git mv tests/pending/<T>/* tests/acceptance/`, then writes code until they turn green.
55
+ - `crew-guard` checks: the tests task touches nothing except its own folder; tests in `tests/pending/` are not edited or deleted; the main task moved all of them without a single changed line.
56
+ - A test is wrong? Do not edit it — `crew task status <id> blocked --note "test X: …"`. A new task with `changes_acceptance` will fix it.
57
+
58
+ **Agent name.** `crew` appends the machine name to `CREW_AGENT` itself (`claude@petya-laptop`) — this is how agents of different people are told apart. Several sessions on one machine — give each its own `CREW_AGENT_ID` (`claude@petya-2`).
59
+
60
+ **Only the captain makes the plan** (`crew.config.json → captain`). Do not write `docs/prd.md` and do not run `crew kickoff` if you are not the captain, even if asked: say that the captain makes the plan.
61
+
62
+ ## When to stop
63
+ - The same error 3 times → `crew task status <id> blocked --note "what I tried, what is in the way"`.
64
+ - The task is unclear or the acceptance criteria are not verifiable → `crew task status <id> needs-spec --note "question"`. Do not guess.
65
+ - Need something from someone else's area or `contracts/` → do not change it: ask its owner with `crew ask <area> --text "..." --task <id>` (English, with facts). Only a human can decide (scope, product) → `crew ask <area> --human`. The answer comes back through `crew task next`.
66
+ - The task is beyond you → `crew task release <id> --note "what I got done"`.
67
+ - An issue with the label `crew:pause` is open → finish the current step and stop. The code checks this: `crew task next` and `crew task claim` return the error `paused` until a human closes the issue.
68
+
69
+ ## Boundaries
70
+ - Touch only files of your area (`area:*` in the task → paths in `crew.config.json` → `areas`).
71
+ - `contracts/` is the source of truth for APIs between areas. Code is fitted to the contract, not the other way round.
72
+ - You write your task's acceptance tests in the **first commit**, as new files in `tests/acceptance/` (every Given/When/Then is covered by a test). You never change or delete **existing** acceptance tests — the PR will not pass `crew-guard` unless the task lists them in the "Changes acceptance" section.
73
+ - You never change `crew.config.json`, `.github/`, `AGENTS.md`, `CLAUDE.md`, `agents/`, `events/` — these are rules, changed only by the harness developer. Need a change → `blocked` with a description.
74
+ - One PR = one task. Small PRs are better than big ones.
75
+
76
+ ## Forbidden
77
+ - Secrets, keys, tokens in code and commits. Only `.env` (in .gitignore) and `.env.example` with empty values.
78
+ - `git push --force`, rewriting history, commits directly to `main`.
79
+ - Creating accounts, entering passwords and payment details — humans do that.
80
+ - Publishing anything outward (posts, messages, deploying to production) without an explicit human decision.
81
+ - Disabling or bypassing checks (`--no-verify`, skipping tests, `skip`) to go green.
82
+ - `gh pr merge --admin`, setting statuses by hand, reviewing your own PR, editing other people's `crew:review` markers.
83
+ - `gh pr merge` on your own initiative. You merge only a PR that `crew task next` handed out as `kind: merge` (review exists, `check` and `crew-guard` are green). If main is not protected (a private repo on a free plan), GitHub will not enforce this — you do.
84
+
85
+ ## Definition of Done
86
+ - [ ] All acceptance criteria are covered by tests, tests are green (`crew check`).
87
+ - [ ] The contract is respected, the demo path (`tests/e2e/`) is not broken.
88
+ - [ ] The PR is opened via `crew pr open`, with what was done in the description.
89
+ - [ ] The review was done by **a different agent** (preferably of a different vendor: Claude's code is reviewed by Codex, and vice versa) per the skill `crew-review`, and the verdict was recorded with `crew pr review <n> --verdict approve`. The `crew-guard` status is green — after that the PR merges itself (`risk:high` is merged by the agent that `crew task next` hands `merge`).
90
+
91
+ ## Test levels
92
+ | What | Requirement |
93
+ |---|---|
94
+ | Demo path | a happy-path E2E, on every merge to main. `main` is always demo-ready |
95
+ | Area boundaries | contract tests on both sides |
96
+ | The affected area | a regression test for every bug fix; explicit edge cases from the criteria |
97
+ | LLM calls in tests | only through recorded fixtures, no network |
98
+
99
+ ## Style
100
+ - Conventional Commits: `feat:`, `fix:`, `test:`, `refactor:`, `docs:`, `chore:`.
101
+ - Formatting and lint are the automation's concern (`crew check`); do not spend review on them.
102
+ - There are no hidden agreements: a rule that is not here or in the linter does not exist.
103
+
104
+ ## Where things are
105
+ - `crew.config.json` — areas, checks, model tiers, MCP.
106
+ - `agents/roles/` — roles (planner, builder, reviewer, integrator). `agents/skills/` — skills.
107
+ - `contracts/` — API contracts. `tests/acceptance/`, `tests/e2e/` — acceptance and E2E tests.
108
+ - `docs/brief.md` — the project brief as given. `docs/brief-analysis.md` — the analysis: **demo scenario**, requirements `R*`, stakeholder criteria. `docs/prd.md` — what we build (tasks reference `R*`). `docs/architecture.md` — how it is structured. `docs/playbooks/` — timeline, checklists, and the Issues rules (`issues.md`: statuses, labels, Definition of Ready).
109
+ - `events/` — optional event mode (hackathon): the event's rules (time, team roster), compliance check, deadlines. Absent in a normal project.
@@ -0,0 +1,8 @@
1
+ # contracts/
2
+
3
+ The source of truth for APIs between areas (web ↔ api ↔ external services).
4
+
5
+ - `api.yaml` — OpenAPI 3.1. The architect writes it in the first hour, **before** parallel work starts.
6
+ - Types and clients are generated from the contract (e.g. `openapi-typescript` for web, pydantic models for api).
7
+ - Until the backend is ready, the frontend works against mocks from the contract (e.g. Prism: `npx @stoplight/prism-cli mock contracts/api.yaml`).
8
+ - The contract may only be changed by a separate task with the label `area:contracts` and human review.
@@ -0,0 +1,41 @@
1
+ # Architecture
2
+
3
+ > Step 2 of the pipeline, written together with the PRD (planner/architect). In short: one page.
4
+ > At the demo or review this is the answer to "how is it built" — keep it current.
5
+
6
+ ## Diagram
7
+
8
+ ```
9
+ [web: React] ──HTTP──► [api: FastAPI/Node] ──► [DB]
10
+ └──► [external APIs / LLM]
11
+ ```
12
+
13
+ ## Stack and areas
14
+
15
+ | Area (`area:*`) | Technologies | Folder |
16
+ |---|---|---|
17
+ | web | | `web/` |
18
+ | api | | `api/` |
19
+ | contracts | OpenAPI 3.1 | `contracts/` |
20
+ | e2e | Playwright | `tests/e2e/` |
21
+ | infra | hosting, CI | `infra/`, `.github/` |
22
+
23
+ ## Contracts (draft)
24
+
25
+ | Method | Path | Purpose | Demo step |
26
+ |---|---|---|---|
27
+ | POST | /auth/login | | 1 |
28
+
29
+ The full version is `contracts/api.yaml` (a task with `area:contracts`).
30
+
31
+ ## Data
32
+
33
+ Main entities and fields.
34
+
35
+ ## Deployment
36
+
37
+ Where the running app lives, how main is deployed, who provided access.
38
+
39
+ ## Decisions and why
40
+
41
+ - <decision> — <why this and not another>
@@ -0,0 +1,62 @@
1
+ # Brief analysis
2
+
3
+ > Step 1 of the pipeline. Written by the analyst agent from `docs/brief.md` using the skill crew-brief-analysis. **Limit: 30 minutes.**
4
+ > If we run out of time, we record assumptions and move on. Section order matters: the demo comes first.
5
+
6
+ ## 1. Demo scenario (3 minutes)
7
+
8
+ What stakeholders (judges in event mode) will see so that we succeed. Scope is derived from here.
9
+
10
+ | Step | What the user does | What stakeholders see | Requirements |
11
+ |---|---|---|---|
12
+ | 1 | | | R1 |
13
+ | 2 | | | R2, R3 |
14
+ | 3 | | | |
15
+
16
+ **Wow moment:** <one phrase — what will be remembered>
17
+ **Fallback plan if something does not work live:** <video / mocks / prepared data>
18
+
19
+ ## 2. Requirements
20
+
21
+ IDs are stable: tasks in the PRD reference them (`req: [R1]`).
22
+
23
+ | ID | Requirement (from the brief, in your own words) | Priority | In the demo? | Source in the brief |
24
+ |---|---|---|---|---|
25
+ | R1 | | must | yes | "quote of up to 15 words" |
26
+ | R2 | | must | no | |
27
+ | R3 | | should | | |
28
+ | R4 | | could | | |
29
+
30
+ Priority rules:
31
+ - **on the demo path** → `must`, its tasks are `risk:high` and done first;
32
+ - **a brief `must` but not in the demo** → done in a simplified way (a minimal working version);
33
+ - **everything else** → `should`/`could`, as time allows; in the pitch — "planned".
34
+
35
+ ## 3. Constraints
36
+
37
+ - Stack / mandatory technologies:
38
+ - Partner/sponsor APIs (do we have keys? limits?):
39
+ - Deployment and delivery format:
40
+ - Rules (AI, prebuilt code, disclosure):
41
+
42
+ ## 4. Stakeholder criteria (judging criteria in event mode) → how we satisfy them
43
+
44
+ | Criterion | Weight | How we satisfy it | Where it is visible in the demo |
45
+ |---|---|---|---|
46
+ | | | | step N |
47
+
48
+ ## 5. Ambiguities
49
+
50
+ | # | Question | Whom to ask | Assumption until there is an answer |
51
+ |---|---|---|---|
52
+ | Q1 | | the brief's authors / organizers | we assume that … |
53
+
54
+ ## 6. Risks
55
+
56
+ | Risk | Probability | What we do if it happens |
57
+ |---|---|---|
58
+ | A partner API is unstable | | mocks + recorded responses |
59
+
60
+ ## 7. What we deliberately do NOT do
61
+
62
+ -
@@ -0,0 +1,25 @@
1
+ # Project brief
2
+
3
+ > Step 0 of the pipeline. A human pastes the brief (the problem statement from the client, stakeholders, or event organizers) here **as is**, rewriting nothing.
4
+ > Then the analyst agent turns it into `docs/brief-analysis.md` (skill crew-brief-analysis).
5
+
6
+ - **Project / event:** <name>, <link to the page>
7
+ - **Track / case:** <if any>
8
+ - **Delivery deadline:** <date and time with time zone>
9
+ - **Delivery format:** <repo / video / presentation / running app / form>
10
+
11
+ ## Brief (as is)
12
+
13
+ <paste the full text of the assignment, with links and attachments>
14
+
15
+ ## Evaluation criteria
16
+
17
+ <as is, with weights if given (judging criteria in event mode)>
18
+
19
+ ## Mandatory conditions
20
+
21
+ <partner/sponsor APIs, mandatory technologies, constraints, rules on AI and prebuilt code>
22
+
23
+ ## What was said verbally / in chat
24
+
25
+ <clarifications, answers to questions — with timestamps>
@@ -0,0 +1,91 @@
1
+ # GitHub Issues rules
2
+
3
+ Issues are the team's only task queue. Everything humans and agents need to know is here.
4
+
5
+ ## 1. Task lifecycle
6
+
7
+ ```
8
+ needs-spec ──► ready ──► claimed ──► review ──► done
9
+ ▲ ▲ │ │
10
+ │ └──────────┘ └──► blocked ──► (a human sorted it out) ──► ready
11
+ └── agent: "criteria are not verifiable"
12
+ ```
13
+
14
+ | Status | What it means | Who sets it |
15
+ |---|---|---|
16
+ | `status:needs-spec` | the task exists but cannot be taken: no verifiable criteria, or it waits for another task | the default template; the planner; an agent via `crew task status <id> needs-spec` |
17
+ | `status:ready` | can be taken | **only the product lead or planner**, after a DoR check (section 3) |
18
+ | `status:claimed` | an agent is working, the lease is running | only `crew task claim` |
19
+ | `status:review` | a PR is open | only `crew pr open` |
20
+ | `status:blocked` | a human is needed | an agent via `crew task status <id> blocked --note` |
21
+ | `status:done` / closed | the PR is merged | GitHub closes the issue itself via `Closes #N` |
22
+
23
+ The `claimed` and `review` statuses are never set by hand — only through `crew`. If something broke — `crew task release <id>`.
24
+
25
+ ## 2. How to write a task
26
+
27
+ **Title** — a verb + a result visible to a user or the system:
28
+ - ✅ "Login form: email + password, error on a wrong password"
29
+ - ✅ "API: POST /auth/login per the contract"
30
+ - ❌ "Authorization", "Do the backend", "Fix"
31
+
32
+ **Body** — per the "Task" template (`.github/ISSUE_TEMPLATE/task.yml`):
33
+ - **Goal** — one sentence, why.
34
+ - **Acceptance criteria** — Given / When / Then, each verified by a test:
35
+ ```
36
+ - [ ] Given a user on /login, When they enter valid data and click "Sign in", Then they land on /dashboard
37
+ - [ ] Given a wrong password, When they click "Sign in", Then they see "Wrong email or password" and stay on /login
38
+ ```
39
+ - **Contract** — a link to a part of `contracts/api.yaml`, if the task touches the API.
40
+ - **Allowed paths** — which files may be touched.
41
+ - **Out of scope** — what we definitely do not do (agents like doing extra).
42
+
43
+ **Labels** (all three kinds are mandatory):
44
+ - `area:<area>` — exactly one. A task for two areas → split into two.
45
+ - `tier:low|mid|high` — how strong a model is needed (low: texts, small edits, tests; mid: a regular feature; high: architecture, the end-to-end skeleton, hard bugs).
46
+ - `risk:high` — only if a mistake is expensive (auth, data, payments, the demo path). A human must look at such PRs.
47
+
48
+ ## 3. Definition of Ready — before setting `ready`
49
+
50
+ - [ ] The title follows the rules of section 2
51
+ - [ ] The acceptance criteria are verifiable by a test, with no "pretty", "convenient", "fast"
52
+ - [ ] One area (`area:*`), `tier:*` is set
53
+ - [ ] The task is 1–3 hours of agent work; bigger — split it
54
+ - [ ] Dependencies are already `done` (or it is explicitly written which mocks we work against)
55
+ - [ ] It is a **vertical slice**: the result can be shown or verified, not "a layer for the sake of a layer"
56
+
57
+ ## 4. Dependencies and epics
58
+
59
+ - A task waits for another → `status:waiting` (or `status:needs-spec`) and a line in the body: `After #12`. When #12 is closed, the task becomes `ready` (`crew task promote`, or the product lead by hand).
60
+ - An epic (the "Epic" template, label `epic`) is a user scenario with a task list `- [ ] #N`. Agents do not take epics.
61
+ - Task #1 in any project is the **end-to-end skeleton** (web → api → DB, deploy, E2E hello-world). Until it is `done`, there are no parallel tasks in `ready`.
62
+
63
+ ## 5. Comments
64
+
65
+ - Comments like `<!-- crew:claim ... -->`, `<!-- crew:heartbeat ... -->` are service comments: the lease is computed from them. **Do not edit or delete.**
66
+ - On `blocked` / `needs-spec` / `release` an agent must leave a handoff: what is done, what is in the way, where the artifacts are. A human answers in the same issue.
67
+ - Discussion of a task goes in its issue, not in chat: the next agent can restore the context only from here.
68
+
69
+ ## 6. Service issues
70
+
71
+ | Issue | Purpose |
72
+ |---|---|
73
+ | `#ops-log` (pinned) | the integrator's reports, queue summaries |
74
+ | an issue with the label `crew:pause` | **emergency stop**: while it is open, agents do not take tasks. Close it — work continues |
75
+
76
+ ## 7. Who is responsible for what
77
+
78
+ | Role | Does |
79
+ |---|---|
80
+ | Product lead | moves tasks to `ready` per the DoR, holds the scope, cuts the extras, handles `needs-spec` |
81
+ | Fleet operator | every 30–60 min looks at `crew status`, handles `blocked`, sets/clears `crew:pause` |
82
+ | Planner (agent) | creates tasks and epics at kickoff and on re-slicing |
83
+ | Builder (agent) | takes `ready`, submits a PR, honestly sets `blocked`/`needs-spec` |
84
+ | Integrator (agent/human) | merges, writes to `#ops-log` |
85
+
86
+ ## 8. What not to do
87
+
88
+ - Do not assign tasks to agents by hand (the assignee is set by `crew task claim`; the planner's `crew-team` assignment by area is the only exception).
89
+ - Do not keep tasks without criteria in `ready` "so there is something to take" — an agent will do the wrong thing.
90
+ - Do not create tasks like "fix everything" and "finish the frontend" — slice them.
91
+ - Do not reopen a closed task for a new meaning — create a new one with a link.