@capybara-hq/plugin-collab 0.0.0-stage → 0.1.0-rc.1

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.
package/icon.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" shape-rendering="crispEdges"><title>Projects</title><style>@media (prefers-color-scheme: dark){path{fill:#FF6A13}}</style><path fill="#CC4609" d="M14 1.4h1.35v1.35h-1.35zM12.65 2.75h4.05v1.35h-4.05zM4.55 4.1h14.85v1.35h-14.85zM3.2 5.45h12.15v1.35h-12.15zM16.7 5.45h2.7v1.35h-2.7zM1.85 6.8h17.55v1.35h-17.55zM1.85 8.15h17.55v1.35h-17.55zM1.85 9.5h17.55v1.35h-17.55zM3.2 10.85h13.5v1.35h-13.5zM3.2 12.2h2.7v1.35h-2.7zM8.6 12.2h1.35v1.35h-1.35zM12.65 12.2h2.7v1.35h-2.7zM3.2 13.55h2.7v1.35h-2.7zM8.6 13.55h1.35v1.35h-1.35zM12.65 13.55h2.7v1.35h-2.7z"/><path fill="#CC4609" d="M21.7 15.1h1.15v1.15h-1.15zM20.55 16.25h2.3v1.15h-2.3zM14.8 17.4h1.15v1.15h-1.15zM19.4 17.4h2.3v1.15h-2.3zM14.8 18.55h2.3v1.15h-2.3zM18.25 18.55h2.3v1.15h-2.3zM15.95 19.7h3.45v1.15h-3.45zM17.1 20.85h1.15v1.15h-1.15z"/></svg>
@@ -0,0 +1,240 @@
1
+ -- Runs with search_path "plugin_collab, public": table names carry no schema prefix.
2
+ -- Ids from the kernel (org, account, agent, conversation) are stored as text. Every table has
3
+ -- org_id; every query filters it. Actor JSON: {"accountId"} or {"accountId","agentId","conversationId"}.
4
+
5
+ CREATE TABLE IF NOT EXISTS projects (
6
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
7
+ org_id text NOT NULL,
8
+ key text NOT NULL,
9
+ name text NOT NULL,
10
+ description text NOT NULL DEFAULT '',
11
+ archived boolean NOT NULL DEFAULT false,
12
+ next_item_number integer NOT NULL DEFAULT 1,
13
+ owner_account_id text NOT NULL,
14
+ created_at timestamptz NOT NULL DEFAULT now()
15
+ );
16
+ CREATE UNIQUE INDEX IF NOT EXISTS projects_org_key ON projects (org_id, key);
17
+
18
+ CREATE TABLE IF NOT EXISTS project_members (
19
+ org_id text NOT NULL,
20
+ project_id uuid NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
21
+ account_id text NOT NULL,
22
+ role text NOT NULL CHECK (role IN ('owner', 'member', 'guest')),
23
+ function_label text,
24
+ -- The member's agent a default assignment with `memberAgent` hands the item to.
25
+ default_agent_id text,
26
+ created_at timestamptz NOT NULL DEFAULT now(),
27
+ PRIMARY KEY (project_id, account_id)
28
+ );
29
+ CREATE INDEX IF NOT EXISTS project_members_org_account ON project_members (org_id, account_id);
30
+
31
+ CREATE TABLE IF NOT EXISTS workflows (
32
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
33
+ org_id text NOT NULL,
34
+ project_id uuid NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
35
+ item_type text NOT NULL,
36
+ created_at timestamptz NOT NULL DEFAULT now()
37
+ );
38
+ CREATE UNIQUE INDEX IF NOT EXISTS workflows_project_type ON workflows (project_id, item_type);
39
+
40
+ CREATE TABLE IF NOT EXISTS statuses (
41
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
42
+ org_id text NOT NULL,
43
+ workflow_id uuid NOT NULL REFERENCES workflows (id) ON DELETE CASCADE,
44
+ key text NOT NULL,
45
+ name_zh text NOT NULL,
46
+ name_en text NOT NULL,
47
+ category text NOT NULL CHECK (category IN ('backlog', 'todo', 'in_progress', 'review', 'done', 'canceled')),
48
+ position integer NOT NULL DEFAULT 0,
49
+ next_keys text[],
50
+ gate jsonb,
51
+ default_assignment jsonb,
52
+ created_at timestamptz NOT NULL DEFAULT now()
53
+ );
54
+ CREATE UNIQUE INDEX IF NOT EXISTS statuses_workflow_key ON statuses (workflow_id, key);
55
+
56
+ CREATE TABLE IF NOT EXISTS item_types (
57
+ org_id text NOT NULL,
58
+ project_id uuid NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
59
+ key text NOT NULL,
60
+ name_zh text NOT NULL,
61
+ name_en text NOT NULL,
62
+ icon text,
63
+ workflow_id uuid REFERENCES workflows (id) ON DELETE SET NULL,
64
+ created_at timestamptz NOT NULL DEFAULT now(),
65
+ PRIMARY KEY (project_id, key)
66
+ );
67
+
68
+ CREATE TABLE IF NOT EXISTS items (
69
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
70
+ org_id text NOT NULL,
71
+ project_id uuid NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
72
+ number integer NOT NULL,
73
+ type text NOT NULL,
74
+ title text NOT NULL,
75
+ description text NOT NULL DEFAULT '',
76
+ status_key text NOT NULL,
77
+ -- Who asked for the item (its creator); assignment never changes it.
78
+ requester_account_id text NOT NULL,
79
+ responsible_account_id text,
80
+ executing_agent_id text,
81
+ -- 0 none, 1 urgent, 2 high, 3 medium, 4 low.
82
+ priority integer NOT NULL DEFAULT 3 CHECK (priority BETWEEN 0 AND 4),
83
+ labels text[] NOT NULL DEFAULT '{}',
84
+ parent_id uuid REFERENCES items (id) ON DELETE SET NULL,
85
+ fields jsonb NOT NULL DEFAULT '{}'::jsonb,
86
+ version integer NOT NULL DEFAULT 1,
87
+ -- What the executing agent is doing on the item (from the kernel's run.lifecycle hook): null
88
+ -- until its first run or once the assignment changes. Not an edit: no version bump.
89
+ agent_state text CHECK (agent_state IN ('working', 'waiting', 'idle', 'declined')),
90
+ -- The work conversation the state was read from (the pair's subject conversation).
91
+ agent_conversation_id text,
92
+ agent_state_at timestamptz,
93
+ -- The item version of the write that last changed the (person, agent) pair: the version in the
94
+ -- dedupe key of the pair's item.assigned event, so a decline of an older offer is told apart.
95
+ assigned_version integer NOT NULL DEFAULT 1,
96
+ closed_at timestamptz,
97
+ created_at timestamptz NOT NULL DEFAULT now(),
98
+ updated_at timestamptz NOT NULL DEFAULT now()
99
+ );
100
+ CREATE UNIQUE INDEX IF NOT EXISTS items_project_number ON items (project_id, number);
101
+ CREATE INDEX IF NOT EXISTS items_org_responsible ON items (org_id, responsible_account_id);
102
+ CREATE INDEX IF NOT EXISTS items_org_agent ON items (org_id, executing_agent_id);
103
+ CREATE INDEX IF NOT EXISTS items_parent ON items (parent_id);
104
+ CREATE INDEX IF NOT EXISTS items_org_project_status ON items (org_id, project_id, status_key);
105
+ -- The conversation panels find the item a conversation serves by its last work conversation.
106
+ CREATE INDEX IF NOT EXISTS items_org_agent_conversation ON items (org_id, agent_conversation_id)
107
+ WHERE agent_conversation_id IS NOT NULL;
108
+
109
+ CREATE TABLE IF NOT EXISTS item_links (
110
+ org_id text NOT NULL,
111
+ from_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
112
+ to_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
113
+ kind text NOT NULL CHECK (kind IN ('blocks', 'relates', 'duplicates')),
114
+ CHECK (from_id <> to_id),
115
+ created_at timestamptz NOT NULL DEFAULT now(),
116
+ PRIMARY KEY (from_id, to_id, kind)
117
+ );
118
+ CREATE INDEX IF NOT EXISTS item_links_to ON item_links (to_id);
119
+
120
+ CREATE TABLE IF NOT EXISTS comments (
121
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
122
+ org_id text NOT NULL,
123
+ item_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
124
+ author jsonb NOT NULL,
125
+ body text NOT NULL,
126
+ created_at timestamptz NOT NULL DEFAULT now()
127
+ );
128
+ CREATE INDEX IF NOT EXISTS comments_item ON comments (item_id, created_at);
129
+
130
+ CREATE TABLE IF NOT EXISTS activity (
131
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
132
+ org_id text NOT NULL,
133
+ item_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
134
+ actor jsonb NOT NULL,
135
+ kind text NOT NULL,
136
+ detail jsonb NOT NULL DEFAULT '{}'::jsonb,
137
+ -- For entries that owe an inbox notice (assigned, handoff_unresolved, created with a
138
+ -- responsible person): when it was decided
139
+ -- (posted, not owed, or given up after a day). Null = still owed.
140
+ notified_at timestamptz,
141
+ created_at timestamptz NOT NULL DEFAULT now()
142
+ );
143
+ CREATE INDEX IF NOT EXISTS activity_item ON activity (item_id, created_at);
144
+ -- Notices still owed: the request path posts its own write's, the org drain job the rest.
145
+ CREATE INDEX IF NOT EXISTS activity_unnotified ON activity (org_id, created_at)
146
+ WHERE notified_at IS NULL AND kind IN ('assigned', 'handoff_unresolved', 'created');
147
+ -- The item a conversation serves (the conversation panels): agent writes by conversation.
148
+ CREATE INDEX IF NOT EXISTS activity_conversation ON activity (org_id, (actor->>'conversationId'))
149
+ WHERE actor ? 'conversationId';
150
+
151
+ CREATE TABLE IF NOT EXISTS artifacts (
152
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
153
+ org_id text NOT NULL,
154
+ item_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
155
+ kind text NOT NULL,
156
+ name text NOT NULL,
157
+ version integer NOT NULL DEFAULT 1,
158
+ -- An http(s) link (stored files are a follow-up).
159
+ url text NOT NULL,
160
+ author jsonb NOT NULL,
161
+ created_at timestamptz NOT NULL DEFAULT now()
162
+ );
163
+ CREATE INDEX IF NOT EXISTS artifacts_item ON artifacts (item_id, created_at);
164
+
165
+ CREATE TABLE IF NOT EXISTS decisions (
166
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
167
+ org_id text NOT NULL,
168
+ item_id uuid NOT NULL REFERENCES items (id) ON DELETE CASCADE,
169
+ kind text NOT NULL CHECK (kind IN ('question', 'gate')),
170
+ asker jsonb NOT NULL,
171
+ addressee_account_id text NOT NULL,
172
+ question text NOT NULL,
173
+ options jsonb NOT NULL DEFAULT '[]'::jsonb,
174
+ recommendation jsonb,
175
+ blocking boolean NOT NULL DEFAULT false,
176
+ state text NOT NULL DEFAULT 'open' CHECK (state IN ('open', 'answered', 'canceled', 'expired')),
177
+ answer jsonb,
178
+ deadline_at timestamptz,
179
+ gate_target text,
180
+ -- A gate: the status the item was in when the move was requested. The gate is stale (canceled)
181
+ -- once the item is neither there nor at gate_target.
182
+ gate_from text,
183
+ -- Bumped each time the decision is re-addressed (addressee removed, demoted, confirmer changed):
184
+ -- its notify job id carries it.
185
+ address_gen integer NOT NULL DEFAULT 0,
186
+ -- Inbox items of earlier addressees, resolved by the next notify and when the decision closes.
187
+ stale_inbox_item_ids text[] NOT NULL DEFAULT '{}',
188
+ -- The inbox items posted for the decision (the addressee's, the reminder, the escalation), all
189
+ -- resolved once it is answered.
190
+ inbox_item_ids text[] NOT NULL DEFAULT '{}',
191
+ -- Everyone the decision is addressed to now, sorted: the addressee of a question, every
192
+ -- confirmer of a gate. A re-address compares this set with the computed one.
193
+ addressees text[] NOT NULL DEFAULT '{}',
194
+ -- The inbox items of each recipient by step: { "<accountId>": { "notify": id, "remind": id } }.
195
+ -- A recipient who leaves the set has theirs resolved; a newcomer gets a notice.
196
+ inbox_by_account jsonb NOT NULL DEFAULT '{}'::jsonb,
197
+ -- When the addressee's inbox item, the deadline reminder and the escalation to the project owner
198
+ -- were posted: each is posted once (the jobs that post them run at least once).
199
+ notified_at timestamptz,
200
+ reminded_at timestamptz,
201
+ escalated_at timestamptz,
202
+ created_at timestamptz NOT NULL DEFAULT now(),
203
+ answered_at timestamptz
204
+ );
205
+ CREATE INDEX IF NOT EXISTS decisions_item ON decisions (item_id, created_at);
206
+ CREATE INDEX IF NOT EXISTS decisions_item_open ON decisions (item_id) WHERE state = 'open';
207
+ CREATE INDEX IF NOT EXISTS decisions_addressee_open ON decisions (org_id, addressee_account_id) WHERE state = 'open';
208
+
209
+ -- Events owed to ctx.triggers.emit, written in the transaction of the change they describe.
210
+ -- The summary is rendered when the event is emitted (with people's and agents' names) from
211
+ -- `detail`: the item key and title plus what changed (excerpts already cut to 500 characters).
212
+ CREATE TABLE IF NOT EXISTS event_outbox (
213
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
214
+ org_id text NOT NULL,
215
+ type text NOT NULL,
216
+ subject jsonb NOT NULL,
217
+ facts jsonb NOT NULL DEFAULT '{}'::jsonb,
218
+ detail jsonb NOT NULL DEFAULT '{}'::jsonb,
219
+ dedupe_key text NOT NULL,
220
+ audience jsonb,
221
+ -- Who made the change (Actor JSON); its accountId is the cause of a UI write.
222
+ actor jsonb NOT NULL,
223
+ -- The kernel's cause handle of the tool call behind the change (ctx.triggers.causeOf, valid
224
+ -- 24 h); null for a person's own write.
225
+ cause_handle text,
226
+ emitted_at timestamptz,
227
+ -- Set when the event can never be emitted (refused for good, or older than a day): logged, kept
228
+ -- for 30 days, never retried.
229
+ failed_at timestamptz,
230
+ -- Emit attempts that failed (a counter for logs; no cutoff).
231
+ attempts integer NOT NULL DEFAULT 0,
232
+ created_at timestamptz NOT NULL DEFAULT now()
233
+ );
234
+ CREATE UNIQUE INDEX IF NOT EXISTS event_outbox_dedupe ON event_outbox (org_id, dedupe_key);
235
+ CREATE INDEX IF NOT EXISTS event_outbox_pending ON event_outbox (org_id, created_at)
236
+ WHERE emitted_at IS NULL AND failed_at IS NULL;
237
+ CREATE INDEX IF NOT EXISTS event_outbox_settled ON event_outbox (org_id, emitted_at)
238
+ WHERE emitted_at IS NOT NULL;
239
+ CREATE INDEX IF NOT EXISTS event_outbox_failed ON event_outbox (org_id, failed_at)
240
+ WHERE failed_at IS NOT NULL;
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-collab",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-rc.1",
4
+ "type": "module",
5
+ "license": "Apache-2.0",
6
+ "description": "Project tracker for people and agents: projects, requirements, tasks and bugs with workflows, confirmation steps, decisions and artifacts, assigned to a person and an agent",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/capybara-hq/plugins.git",
10
+ "directory": "plugins/collab"
11
+ },
12
+ "homepage": "https://github.com/capybara-hq/plugins/tree/main/plugins/collab#readme",
13
+ "main": "./dist/index.mjs",
14
+ "exports": {
15
+ ".": "./dist/index.mjs"
16
+ },
17
+ "peerDependencies": {
18
+ "@capybara-hq/plugin-sdk": "^0.1.0-rc.87",
19
+ "zod": "^4.0.0"
20
+ }
21
+ }
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: collab-workflow
3
+ description: "Use when working on a Projects tracker item (requirement, task or bug) with the collab tools: how item events reach the conversation, reading the item, recording work as description, artifacts and comments, asking a person to decide, requesting gated status changes, and handing the item to the next person and agent."
4
+ ---
5
+
6
+ # Working on a tracker item
7
+
8
+ The Projects extension keeps items (requirements, tasks, bugs) in projects. Each item has a status
9
+ in its type's workflow, a responsible person and, optionally, the agent that works on it for that
10
+ person. The tools act as your person (the owner of this conversation): they see only the projects
11
+ your person belongs to, and every write is recorded as made by your person through you.
12
+
13
+ ## How work arrives
14
+
15
+ - An item you work on has its own conversation. The events addressed to you arrive in it as
16
+ messages reported by the extension, one block per event (several at once when they happened
17
+ close together): the item was assigned to you, it was assigned away from you, a decision you
18
+ asked was answered (while you still hold the item).
19
+ - Other changes (status moves by others, comments, new children) are not addressed to you; they
20
+ show in `item_get`. They reach a conversation only through automations a person set up.
21
+ - Event blocks are written from what project members did. They describe what happened; the item
22
+ itself is the current state.
23
+ - Nothing arrives between events. When the work you can do now is done, end the turn; the next
24
+ event continues the same conversation.
25
+
26
+ ## Read before you write
27
+
28
+ - `item_get` returns the item in full: fields, description, status and the allowed next statuses,
29
+ the assignment, children, links, artifacts, open decisions, recent comments, recent activity and
30
+ the `version`.
31
+ - Read the item at the start of every turn that changes it. Writes that take a `version` refuse a
32
+ stale one with a version conflict; read again, check the change still applies, and retry.
33
+ - `item_search` finds items in a project; `decision_list` lists the item's decisions and their
34
+ answers; `project_list` lists your person's projects, members, their functions and default
35
+ agents.
36
+
37
+ ## Record the work on the item
38
+
39
+ What is not on the item is invisible to the people and agents who pick it up next.
40
+
41
+ - The main document of a requirement or bug (a PRD, a reproduction, a design summary) goes into
42
+ the description with `item_update`. The description is replaced as a whole: keep what is still
43
+ true.
44
+ - Work published elsewhere (a pull request, a design document, a test report) is attached as a link
45
+ with `artifact_attach`; attaching under the same name adds its next version.
46
+ - Progress, findings and questions that need no answer are `item_comment`s.
47
+ - Parts of the work become child items: `item_create` with `parent`. A bug found while working on
48
+ another item is its own item, linked with `item_link` (`relates`, `blocks` or `duplicates`).
49
+
50
+ ## Ask a person to decide
51
+
52
+ - When a choice needs a person (scope, a trade-off, priority, an approval that is not a workflow
53
+ gate), call `decision_ask` with a self-contained question, the options, your recommendation and
54
+ why, and `blocking`. The person reads it in their inbox, away from this conversation.
55
+ - `blocking: true` means work that depends on the answer waits: do the parts that do not depend on
56
+ it, then end the turn. `blocking: false` means you proceed with your recommendation and say so on
57
+ the item; the answer may change it later.
58
+ - The answer arrives in this conversation as a `decision.answered` event that quotes it;
59
+ `decision_list` shows the decision and the answer in full.
60
+ - Check `decision_list` before asking: a question already open or answered is not asked again.
61
+ - No tool answers a decision; only a person does.
62
+
63
+ ## Status changes and gates
64
+
65
+ - `item_transition` moves the item to one of the allowed next statuses at the version you read.
66
+ - Some statuses are gated: entering them needs a person's confirmation (for example the project
67
+ owner's review before a requirement is ready, the requester's acceptance before it is done). A
68
+ transition into a gated status does not move the item. It opens a gate request for the confirming
69
+ person and reports who it waits on; the item stays where it is.
70
+ - A parent whose children are all closed moves from in progress to acceptance by itself, and that
71
+ move opens the done request to the requester at once; it is not requested again by hand.
72
+ - The confirmation is a person's act on the web or in their inbox; no tool performs it. The
73
+ outcome arrives as an answer to the gate decision while you still hold the item; when the
74
+ confirmed move hands the item to someone else, you receive the unassignment instead. Until then
75
+ the request stands; the gate is not requested again.
76
+
77
+ ## Handing off
78
+
79
+ - Handing off is moving the item to the next status. A status may have a default assignment: the
80
+ member with a function (engineering, QA, ...) and their agent. Entering it reassigns the item to
81
+ them, and the new pair receives it as work.
82
+ - Assigning the item yourself (`item_assign`, or `item_create` with a responsible person) to your
83
+ own person happens at once; assigning anyone else asks your person to confirm first.
84
+ - When the item is assigned away from you, writes to it from this conversation fail with
85
+ "no longer assigned". Reads still work. The work on that item is no longer yours: stop and do not retry.
86
+ - Before handing off, leave the item in a state the next person can pick up: the description
87
+ current, artifacts attached, open questions in decisions or comments.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: prd-writing
3
+ description: "Use when drafting or revising a product requirements document (PRD) for a Projects requirement: the sections a PRD has, how it lives in the item description, which open choices become decisions, and when the requirement is ready for review."
4
+ ---
5
+
6
+ # Writing a PRD for a requirement
7
+
8
+ A PRD states what to build and why, precisely enough that an engineer can design it and a tester
9
+ can check it, without prescribing the implementation. It lives in the requirement's description
10
+ (`item_update`), so everyone who opens the item reads the current version.
11
+
12
+ ## Shape
13
+
14
+ ```markdown
15
+ ## Problem
16
+ Who has the problem, what they do today, what it costs them. Evidence if there is any.
17
+
18
+ ## Goal
19
+ The outcome in one or two sentences, and how success is measured.
20
+
21
+ ## Users and scenarios
22
+ The users concerned and the scenarios, each as a short narrative from trigger to result.
23
+
24
+ ## Requirements
25
+ Numbered, each testable on its own:
26
+ 1. R1 ... (must)
27
+ 2. R2 ... (should)
28
+
29
+ ## Out of scope
30
+ What this requirement does not cover, to stop scope from growing silently.
31
+
32
+ ## Acceptance criteria
33
+ Observable checks tied to the requirements: "Given ..., when ..., then ..." (R1, R2 ...).
34
+
35
+ ## Open questions
36
+ Choices not yet made, each with the decision asked for it (or "assumed: ..." for a non-blocking
37
+ one).
38
+
39
+ ## Dependencies and risks
40
+ Other items, teams or systems this relies on; what could make it fail.
41
+ ```
42
+
43
+ Leave out a section that has nothing to say rather than filling it.
44
+
45
+ ## Working through it
46
+
47
+ 1. Read the item (`item_get`): the title, any description already written, comments, linked
48
+ items. Search related items (`item_search`) for prior requirements and known bugs.
49
+ 2. Draft the PRD into the description. Mark facts you inferred as assumptions.
50
+ 3. Each open choice that changes what gets built (scope, behavior visible to users, a trade-off
51
+ between requirements) is a decision for the requirement's person: one `decision_ask` per
52
+ choice, with the options, your recommendation and why. A choice that blocks the rest of the
53
+ PRD is `blocking: true`; one you can draft around is `blocking: false`, written into the PRD as
54
+ the recommended option and marked as awaiting the answer.
55
+ 4. When an answer arrives, update the requirements, acceptance criteria and open questions to
56
+ match it.
57
+ 5. The PRD is ready for review when every must-requirement has acceptance criteria and no blocking
58
+ decision is open. Then move the requirement to its review status, and from there request the
59
+ next status: a gated one waits for the confirming person.
60
+
61
+ ## Quality checks
62
+
63
+ - Each requirement is one behavior, testable without reading the others.
64
+ - Acceptance criteria name observable results (what the user sees, what the system stores), never
65
+ "works correctly".
66
+ - Numbers have units and limits (sizes, counts, time).
67
+ - The PRD says what, not how: implementation choices belong to the engineer's design.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: test-planning
3
+ description: "Use when testing a Projects task or verifying a bug fix: deriving a test plan from the parent requirement's acceptance criteria, running it, recording the results on the item, filing bugs linked to the task, and moving the item on or back."
4
+ ---
5
+
6
+ # Testing a task or verifying a fix
7
+
8
+ Testing checks the work against what was asked for, not against what was built. The source of
9
+ truth is the acceptance criteria of the requirement above the task (its parent) and the task's own
10
+ description.
11
+
12
+ ## Test plan
13
+
14
+ Read the task (`item_get`), its parent requirement and linked items, and the artifacts the
15
+ engineer attached (pull requests, design). Then write the plan as a comment (`item_comment`), or
16
+ attach it with `artifact_attach` when it is published elsewhere:
17
+
18
+ ```markdown
19
+ ## Test plan for KEY
20
+ Scope: what is tested and what is not.
21
+ Environment: where it runs (branch, build, device, data).
22
+
23
+ | # | Case | Criterion | Steps | Expected |
24
+ |---|------|-----------|-------|----------|
25
+ | 1 | ... | R1 | ... | ... |
26
+
27
+ Edge cases: empty input, limits, permissions, concurrent use, errors from dependencies.
28
+ Regression: existing behavior next to the change that must still hold.
29
+ ```
30
+
31
+ Every acceptance criterion maps to at least one case. A criterion that cannot be tested as
32
+ written is a question for the requirement's person (`decision_ask`), not a guess.
33
+
34
+ ## Running it
35
+
36
+ - Run the cases in the environment the plan names, and keep the evidence: commands and their
37
+ output, logs, screenshots.
38
+ - Record the result as a comment: each case passed or failed, with the evidence for a failure.
39
+
40
+ ## Bugs
41
+
42
+ - Each failure is its own bug: `item_create` with type `bug`, a title naming the wrong behavior,
43
+ and a description with the steps to reproduce, expected and actual results, the environment
44
+ and the evidence.
45
+ - Link it to the task: `item_link` with `relates` (or `blocks` when the task cannot be accepted
46
+ until it is fixed). Without a responsible person, a new bug follows its workflow's default
47
+ assignment.
48
+ - Search first (`item_search`) so a known bug is linked, not filed twice.
49
+
50
+ ## Moving on
51
+
52
+ - All cases pass and no blocking bug is open: move the task to its done status (or a bug from
53
+ verifying to closed).
54
+ - Failures that block acceptance: move the item back to its in-progress status (a bug back to
55
+ fixing), with a comment listing the failed cases and the bugs filed. A status with a default
56
+ assignment hands the item over by itself; one without keeps it with you, and `item_assign`
57
+ gives it back to the person who worked on it (the activity in `item_get` shows who), after
58
+ your person confirms.