teamshare-bridge 0.22.5 → 0.22.7

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 (62) hide show
  1. package/README.md +383 -383
  2. package/dist/bridge/install-verify.js +8 -8
  3. package/dist/lib/browser/human-input-guard.js +98 -98
  4. package/dist/lib/browser/screen-change.js +60 -60
  5. package/dist/lib/llm/usage-reader.js +4 -4
  6. package/package.json +70 -70
  7. package/skills/THIRD_PARTY_NOTICES.md +26 -26
  8. package/skills/architect/LICENSE +21 -21
  9. package/skills/codebase-design/LICENSE +21 -21
  10. package/skills/diagnosing-bugs/LICENSE +21 -21
  11. package/skills/domain-modeling/LICENSE +21 -21
  12. package/skills/improve-codebase-architecture/LICENSE +21 -21
  13. package/skills/recover/LICENSE +21 -21
  14. package/skills/review/LICENSE +21 -21
  15. package/skills/tdd/LICENSE +21 -21
  16. package/skills/teamshare-auth-rbac/SKILL.md +78 -78
  17. package/skills/teamshare-cdd/SKILL.md +205 -205
  18. package/skills/teamshare-modularity/SKILL.md +146 -146
  19. package/skills/teamshare-orchestrator-ask/SKILL.md +77 -77
  20. package/skills/teamshare-scaffold/SKILL.md +116 -116
  21. package/templates/backend/.env.example.tpl +13 -13
  22. package/templates/backend/nest-cli.json.tpl +8 -8
  23. package/templates/backend/package.json.tpl +41 -41
  24. package/templates/backend/prisma/schema.prisma.tpl +39 -39
  25. package/templates/backend/src/app.module.ts.tpl +24 -24
  26. package/templates/backend/src/common/filters/all-exceptions.filter.ts.tpl +59 -59
  27. package/templates/backend/src/common/guards/jwt-auth.guard.ts.tpl +27 -27
  28. package/templates/backend/src/common/guards/rbac.guard.ts.tpl +48 -48
  29. package/templates/backend/src/common/interceptors/transform.interceptor.ts.tpl +44 -44
  30. package/templates/backend/src/common/pipes/zod-validation.pipe.ts.tpl +29 -29
  31. package/templates/backend/src/common/swagger/envelope.schemas.ts.tpl +53 -53
  32. package/templates/backend/src/common/swagger/error.schemas.ts.tpl +62 -62
  33. package/templates/backend/src/main.ts.tpl +27 -27
  34. package/templates/backend/src/modules/example/example.controller.ts.tpl +102 -102
  35. package/templates/backend/src/modules/example/example.dto.ts.tpl +14 -14
  36. package/templates/backend/src/modules/example/example.module.ts.tpl +10 -10
  37. package/templates/backend/src/modules/example/example.service.ts.tpl +45 -45
  38. package/templates/backend/tsconfig.json.tpl +26 -26
  39. package/templates/common/.gitignore.tpl +42 -42
  40. package/templates/common/AGENTS.md.tpl +58 -58
  41. package/templates/common/docs/adr/README.md +25 -25
  42. package/templates/common/docs/api-contract.md.tpl +72 -72
  43. package/templates/web/next.config.ts.tpl +7 -7
  44. package/templates/web/package.json.tpl +37 -37
  45. package/templates/web/src/app/globals.css.tpl +48 -48
  46. package/templates/web/src/app/layout.tsx.tpl +25 -25
  47. package/templates/web/src/components/shared/app-button.tsx.tpl +59 -59
  48. package/templates/web/src/components/shared/app-empty-state.tsx.tpl +39 -39
  49. package/templates/web/src/components/shared/app-list-toolbar.tsx.tpl +63 -63
  50. package/templates/web/src/components/shared/app-skeleton.tsx.tpl +14 -14
  51. package/templates/web/src/components/shared/app-table.tsx.tpl +128 -128
  52. package/templates/web/src/components/shared/index.ts.tpl +5 -5
  53. package/templates/web/src/hooks/use-list-state.ts.tpl +72 -72
  54. package/templates/web/src/hooks/use-url-tab.ts.tpl +25 -25
  55. package/templates/web/src/lib/api/client.ts.tpl +123 -123
  56. package/templates/web/src/lib/providers.tsx.tpl +35 -35
  57. package/templates/web/src/lib/query-keys.ts.tpl +21 -21
  58. package/templates/web/src/lib/utils.ts.tpl +7 -7
  59. package/templates/web/src/lib/validation/schemas.ts.tpl +15 -15
  60. package/templates/web/src/modules/example/views/example-list-view.tsx.tpl +97 -97
  61. package/templates/web/tsconfig.json.tpl +23 -23
  62. package/tools/workspace-arbitration-check.mjs +389 -389
@@ -1,206 +1,206 @@
1
- ---
2
- name: teamshare-cdd
3
- description: Documents-driven development for TeamShare. Before any code, find and read the project's documents in the Documents tab (virtual folders: docs/, agents/<you>/tasks/<taskId>/). Write plan.md BEFORE starting, keep progress.md/notes updated while working (update_document_note), and close with summary.md. Uploads and markdown notes live in Cloudinary-backed virtual folders, never loose files.
4
- ---
5
-
6
- # TeamShare Documents-Driven Development (CDD)
7
-
8
- You are working a task in a TeamShare project. In TeamShare, **the project's
9
- Documents tab is the source of truth** — the same way `docs/` + `AGENTS.md`
10
- drive TeamShare's own development at the repo root. Documents are organized
11
- in **virtual folders** (a lowercase path stored on each document; the UI
12
- renders them as a tree). Your job is to work from the docs, write the docs,
13
- and leave the task better documented than you found it.
14
-
15
- ## The document library convention
16
-
17
- Every project document carries a `folderPath` (lowercase kebab segments, `/`
18
- = root, max 8 levels). The folders an agent creates MUST follow this layout:
19
-
20
- ```
21
- docs/ <- shared, project-wide knowledge
22
- ├── contracts/ <- API/endpoint contract notes
23
- ├── adr/ <- ADR-<n>-<title>.md architecture decisions
24
- └── guides/ <- how-to guides for humans + agents
25
- agents/
26
- └── <agent-slug>/ <- ONE folder per agent (short, stable slug)
27
- └── tasks/
28
- └── <taskId>/ <- per-task workspace
29
- ├── plan.md <- written BEFORE starting the work
30
- ├── progress.md <- updated while working (or rely on subtasks)
31
- └── summary.md <- written on completion
32
- reports/ <- milestone reports (optional)
33
- ```
34
-
35
- Rules that are not optional:
36
-
37
- - **Kebab-case** document names ending in `.md` (`.markdown`/`.txt` ok).
38
- - **Lowercase** folder paths; no spaces, no leading/trailing slashes.
39
- - **One folder per agent, one subfolder per task.** Never write outside your
40
- own folder except into `docs/**` when you add shared knowledge.
41
- - Document names are unique enough to be obvious (`plan.md`, `progress.md`,
42
- `summary.md`, `adr-001-auth-rbac.md`).
43
-
44
- ## The workflow — three gates
45
-
46
- ### START (before touching any code)
47
- 1. **Read the cloud project context** via `get_project_context` — the
48
- structured AGENTS.md every agent maintains (overview, architecture,
49
- structure, workflows, conventions, gotchas). This is your map of the
50
- codebase; it tells you where things live BEFORE you explore.
51
- **Section-granular reads:** pass `sections: ["..."]` and fetch ONLY what
52
- you need for this task (e.g. `["conventions","gotchas"]`) — never pull the
53
- whole document to read one section. Omit `sections` only when you
54
- genuinely need everything.
55
- 2. `list_document_folders` + `list_documents` for the project.
56
- 3. Read `docs/contracts`, `docs/adr`, `docs/guides` that exist — they govern
57
- your implementation (same way `docs/api-contract.md` and
58
- `docs/ui-style-guide.md` govern TeamShare's repos).
59
- 4. Read your own task folder if this is a `--continue`/resumed session.
60
- 5. **Write `plan.md` FIRST** via `create_document`: goal, decisions, files to
61
- touch, step list. No code until the plan note exists.
62
- 6. **Move the task to `in_progress`** via `update_task` — you are now working it.
63
-
64
- ### DO (while working)
65
- 7. Check off subtasks (`update_subtask done: true`) and update
66
- `progress.md`/`plan.md` via `update_document_note` as you go — the human
67
- watches the app.
68
- 8. **Checklist items — ALWAYS list first.** Before creating checklist items,
69
- call `list_checklist_items` (pass `taskId` or `subtaskId`) to see what
70
- already exists. Use `update_checklist_item` with the existing ID to toggle
71
- done/rename — do NOT create duplicates. Only call `create_checklist_item`
72
- for genuinely new items. The `get_task` response also includes
73
- `checklistItems` for task-level items, and `list_subtasks` includes them
74
- per subtask.
75
- 9. When you make an architecture decision worth keeping, add it to `docs/adr`
76
- as `ADR-<n>-<title>.md` (short: context → decision → consequences).
77
- 10. Blocked? Use `ask_human` and include a pointer to the relevant note.
78
-
79
- ### DONE (before closing)
80
- 11. **Move the task to `in_review`** via `update_task` — signals the human
81
- to review your work.
82
- 12. Write `summary.md`: what you built, why, how it maps to the plan, links to
83
- related docs, follow-ups.
84
- 13. Post the closing comment referencing the summary doc.
85
- 14. Never leave a task without `plan.md` + `summary.md` notes.
86
- 15. **Git is the runner's job.** After your session the bridge automatically
87
- commits everything in the working tree on branch
88
- `teamshare/<taskId8>`, pushes it and opens a pull request — so do NOT
89
- run git commit/branch/push yourself and never leave work outside the
90
- linked folder; just save your files before finishing. The closing
91
- comment reports the commit/push/PR outcome (or why it was skipped).
92
-
93
- **CRITICAL: Multi-repo structure.** TeamShare is NOT a single git repo at the
94
- root. Each app folder (`frontend/`, `teamshare-backend/`, `teamshare-mobile-app/`,
95
- `teamshare-bridge/`) is its own independent git repository. The root directory is
96
- NOT a git repository. Running `git add`, `git commit`, or `git push` from the root
97
- will fail with "not a git repository" errors. See `docs/agent-guides/multi-repo-git.md`
98
- for the complete workflow.
99
- 16. **Update the project context when reality changed** (mandatory). If your
100
- work added/moved/deleted folders or files that matter, changed commands or
101
- workflows, or established new conventions — call `update_project_context`
102
- with ONLY the section(s) you actually changed and `append: true`, sending
103
- just your addition as the value (`structure`, `workflows`, `conventions`,
104
- `architecture`, `gotchas`). **Section-granular writes:** the backend
105
- merges your addition into the existing section server-side — never
106
- re-send untouched or pre-merged section text, and never re-send whole
107
- sections you only appended to. `append` needs no `baseVersion`; a full
108
- replace still does. BEFORE resolving a task, reflect the soft sections:
109
- call `reflect_context` with the `overview`/`architecture`/`conventions`/
110
- `gotchas` additions you decided are durable (you are the AI that decides —
111
- no other model runs on the hub; `update_project_context` handles the
112
- structural `structure`/`workflows` sections). Review `gotchas` and
113
- `conventions`: anything you learned about this codebase while working
114
- (env quirks, patterns that surprised you) belongs there — append those
115
- points as new bullets. A stale version on a replace means another writer
116
- got there first: re-read via `get_project_context` (with `sections`),
117
- merge, retry. Appending past the 60 000-char section cap fails with
118
- `SECTION_TOO_LARGE` — split the change instead. The next agent depends on
119
- this being accurate — do not leave the map stale.
120
-
121
- ## Task status progression (guidance)
122
-
123
- Status can be set to **any value from any state** — the system allows free
124
- transitions and reversal. No blocking errors. Use this as a guideline:
125
-
126
- ```
127
- open → in_progress → in_review
128
- ```
129
-
130
- | When | Set status to | Why |
131
- |---|---|---|
132
- | You start working the task | `in_progress` | You claimed it, work has begun |
133
- | Work is done, ready for human review | `in_review` | Human should review and approve |
134
-
135
- **Tip:** Set status as you go. The human sees live progress in the app.
136
- You can always reverse (e.g. `in_progress` → `open` if you need to reassess).
137
- Do NOT set `resolved` or `closed` — only humans can approve resolution and close tasks.
138
- The highest status you may set is `in_review`.
139
-
140
- ### Claim discipline (hard rule)
141
-
142
- If you called `claim_task` on a task, you MUST call `release_task` for it
143
- before your session ends — **regardless of the task's status** (even when
144
- it stays `open` or `in_progress` for someone else to review). An unreleased
145
- claim blocks every other agent from touching that task for the whole
146
- 30-minute lease. The bridge also auto-releases all claims made by your
147
- session at exit, but never rely on that: release explicitly as soon as
148
- your work is done.
149
-
150
- ## Build mode (IMP-700) — the project's workflow engine
151
-
152
- Some projects run **build mode**: the project has a build agent, and tasks
153
- marked **ready for dev** (`readyForDev: true`) form an ordered build queue
154
- (`sortOrder` asc, `createdAt` asc) that the agent works **strictly one at a
155
- time, fully completing each**. When you are working a task as part of a build
156
- run, the following rules apply ON TOP of everything above:
157
-
158
- - **Ready for dev is the gate.** A task stays out of the build queue until a
159
- human (or the planner) sets `readyForDev: true`. The queue only contains
160
- `readyForDev=true AND status=open` tasks (plus blocked in-progress ones).
161
- - **Strict order, full completion.** Work the queue in exact order — never
162
- pick a later task while an earlier one is open. Do not move on until the
163
- current task is genuinely complete: build passes, `plan.md` written first,
164
- subtasks checked off, `summary.md` written, status moved to `in_review`.
165
- - **Failure protocol (never block the queue).** If a task cannot be finished,
166
- the BUILD LOOP (not you) handles it: it leaves a `[question]` comment on the
167
- task (marked with the literal prefix `[question]`) and a message in the
168
- project's `#agent-questions` channel, then continues with the next ready
169
- task. When a human answers, the loop resumes the skipped task automatically.
170
- - **Planning (`--draft`).** When the human asks you to plan a build run from a
171
- goal, create the tasks yourself with `create_task`:
172
- - `readyForDev: true` so they enter the queue,
173
- - increasing `sortOrder` (1, 2, 3, ...) so they are worked strictly in order,
174
- - dependencies first (a task that unblocks others comes before them),
175
- - write the plan into `agents/<your-slug>/tasks/<taskId>/plan.md` per task,
176
- and a shared `docs/guides/build-plan.md` note summarizing the order.
177
- - **Progress signals.** Push the task to `in_progress` when you start it and
178
- `in_review` when done — the build loop watches status to decide
179
- done vs. failed, so a task left in `in_progress` at the end of a session is
180
- treated as failed and skipped.
181
-
182
- ## Tools to use
183
-
184
- - `get_project_context <projectId>` — the cloud AGENTS.md (+ version). Pass
185
- `sections: ["conventions","gotchas", …]` to fetch ONLY what you need.
186
- - `update_project_context` — section-granular write: send ONLY the section(s)
187
- you changed with `append: true` (your addition only — the backend merges it;
188
- no `baseVersion` needed). Full replace still needs `baseVersion` (409 =
189
- re-read + merge). Never re-send untouched sections.
190
- - `list_document_folders <projectId>` — the tree, with per-folder counts.
191
- - `list_documents <projectId>` — files (optionally filter by folder).
192
- - `read_document <documentId>` — content (notes return their markdown body).
193
- - `create_document` — write a note (`name`, `content`, `folderPath`).
194
- - `update_document_note <documentId> <content>` — replace a note's body.
195
- - Uploads (PDFs, images, binaries) are Cloudinary-hosted into
196
- `documents/<folderPath>` and recorded as file documents — mirror the same
197
- folder convention.
198
-
199
- ## References
200
-
201
- - `docs/agent-tasks/agent-hub-connection.md` — the agent contract.
202
- - `docs/api-contract.md` — response envelope, pagination, type mirroring.
203
- - TeamShare root `docs/` + `IMPLEMENTATION_TRACKER.md` — the convention this
204
- skill mirrors.
205
- - Backend: `GET /documents/folders`, `POST /documents/note`,
1
+ ---
2
+ name: teamshare-cdd
3
+ description: Documents-driven development for TeamShare. Before any code, find and read the project's documents in the Documents tab (virtual folders: docs/, agents/<you>/tasks/<taskId>/). Write plan.md BEFORE starting, keep progress.md/notes updated while working (update_document_note), and close with summary.md. Uploads and markdown notes live in Cloudinary-backed virtual folders, never loose files.
4
+ ---
5
+
6
+ # TeamShare Documents-Driven Development (CDD)
7
+
8
+ You are working a task in a TeamShare project. In TeamShare, **the project's
9
+ Documents tab is the source of truth** — the same way `docs/` + `AGENTS.md`
10
+ drive TeamShare's own development at the repo root. Documents are organized
11
+ in **virtual folders** (a lowercase path stored on each document; the UI
12
+ renders them as a tree). Your job is to work from the docs, write the docs,
13
+ and leave the task better documented than you found it.
14
+
15
+ ## The document library convention
16
+
17
+ Every project document carries a `folderPath` (lowercase kebab segments, `/`
18
+ = root, max 8 levels). The folders an agent creates MUST follow this layout:
19
+
20
+ ```
21
+ docs/ <- shared, project-wide knowledge
22
+ ├── contracts/ <- API/endpoint contract notes
23
+ ├── adr/ <- ADR-<n>-<title>.md architecture decisions
24
+ └── guides/ <- how-to guides for humans + agents
25
+ agents/
26
+ └── <agent-slug>/ <- ONE folder per agent (short, stable slug)
27
+ └── tasks/
28
+ └── <taskId>/ <- per-task workspace
29
+ ├── plan.md <- written BEFORE starting the work
30
+ ├── progress.md <- updated while working (or rely on subtasks)
31
+ └── summary.md <- written on completion
32
+ reports/ <- milestone reports (optional)
33
+ ```
34
+
35
+ Rules that are not optional:
36
+
37
+ - **Kebab-case** document names ending in `.md` (`.markdown`/`.txt` ok).
38
+ - **Lowercase** folder paths; no spaces, no leading/trailing slashes.
39
+ - **One folder per agent, one subfolder per task.** Never write outside your
40
+ own folder except into `docs/**` when you add shared knowledge.
41
+ - Document names are unique enough to be obvious (`plan.md`, `progress.md`,
42
+ `summary.md`, `adr-001-auth-rbac.md`).
43
+
44
+ ## The workflow — three gates
45
+
46
+ ### START (before touching any code)
47
+ 1. **Read the cloud project context** via `get_project_context` — the
48
+ structured AGENTS.md every agent maintains (overview, architecture,
49
+ structure, workflows, conventions, gotchas). This is your map of the
50
+ codebase; it tells you where things live BEFORE you explore.
51
+ **Section-granular reads:** pass `sections: ["..."]` and fetch ONLY what
52
+ you need for this task (e.g. `["conventions","gotchas"]`) — never pull the
53
+ whole document to read one section. Omit `sections` only when you
54
+ genuinely need everything.
55
+ 2. `list_document_folders` + `list_documents` for the project.
56
+ 3. Read `docs/contracts`, `docs/adr`, `docs/guides` that exist — they govern
57
+ your implementation (same way `docs/api-contract.md` and
58
+ `docs/ui-style-guide.md` govern TeamShare's repos).
59
+ 4. Read your own task folder if this is a `--continue`/resumed session.
60
+ 5. **Write `plan.md` FIRST** via `create_document`: goal, decisions, files to
61
+ touch, step list. No code until the plan note exists.
62
+ 6. **Move the task to `in_progress`** via `update_task` — you are now working it.
63
+
64
+ ### DO (while working)
65
+ 7. Check off subtasks (`update_subtask done: true`) and update
66
+ `progress.md`/`plan.md` via `update_document_note` as you go — the human
67
+ watches the app.
68
+ 8. **Checklist items — ALWAYS list first.** Before creating checklist items,
69
+ call `list_checklist_items` (pass `taskId` or `subtaskId`) to see what
70
+ already exists. Use `update_checklist_item` with the existing ID to toggle
71
+ done/rename — do NOT create duplicates. Only call `create_checklist_item`
72
+ for genuinely new items. The `get_task` response also includes
73
+ `checklistItems` for task-level items, and `list_subtasks` includes them
74
+ per subtask.
75
+ 9. When you make an architecture decision worth keeping, add it to `docs/adr`
76
+ as `ADR-<n>-<title>.md` (short: context → decision → consequences).
77
+ 10. Blocked? Use `ask_human` and include a pointer to the relevant note.
78
+
79
+ ### DONE (before closing)
80
+ 11. **Move the task to `in_review`** via `update_task` — signals the human
81
+ to review your work.
82
+ 12. Write `summary.md`: what you built, why, how it maps to the plan, links to
83
+ related docs, follow-ups.
84
+ 13. Post the closing comment referencing the summary doc.
85
+ 14. Never leave a task without `plan.md` + `summary.md` notes.
86
+ 15. **Git is the runner's job.** After your session the bridge automatically
87
+ commits everything in the working tree on branch
88
+ `teamshare/<taskId8>`, pushes it and opens a pull request — so do NOT
89
+ run git commit/branch/push yourself and never leave work outside the
90
+ linked folder; just save your files before finishing. The closing
91
+ comment reports the commit/push/PR outcome (or why it was skipped).
92
+
93
+ **CRITICAL: Multi-repo structure.** TeamShare is NOT a single git repo at the
94
+ root. Each app folder (`frontend/`, `teamshare-backend/`, `teamshare-mobile-app/`,
95
+ `teamshare-bridge/`) is its own independent git repository. The root directory is
96
+ NOT a git repository. Running `git add`, `git commit`, or `git push` from the root
97
+ will fail with "not a git repository" errors. See `docs/agent-guides/multi-repo-git.md`
98
+ for the complete workflow.
99
+ 16. **Update the project context when reality changed** (mandatory). If your
100
+ work added/moved/deleted folders or files that matter, changed commands or
101
+ workflows, or established new conventions — call `update_project_context`
102
+ with ONLY the section(s) you actually changed and `append: true`, sending
103
+ just your addition as the value (`structure`, `workflows`, `conventions`,
104
+ `architecture`, `gotchas`). **Section-granular writes:** the backend
105
+ merges your addition into the existing section server-side — never
106
+ re-send untouched or pre-merged section text, and never re-send whole
107
+ sections you only appended to. `append` needs no `baseVersion`; a full
108
+ replace still does. BEFORE resolving a task, reflect the soft sections:
109
+ call `reflect_context` with the `overview`/`architecture`/`conventions`/
110
+ `gotchas` additions you decided are durable (you are the AI that decides —
111
+ no other model runs on the hub; `update_project_context` handles the
112
+ structural `structure`/`workflows` sections). Review `gotchas` and
113
+ `conventions`: anything you learned about this codebase while working
114
+ (env quirks, patterns that surprised you) belongs there — append those
115
+ points as new bullets. A stale version on a replace means another writer
116
+ got there first: re-read via `get_project_context` (with `sections`),
117
+ merge, retry. Appending past the 60 000-char section cap fails with
118
+ `SECTION_TOO_LARGE` — split the change instead. The next agent depends on
119
+ this being accurate — do not leave the map stale.
120
+
121
+ ## Task status progression (guidance)
122
+
123
+ Status can be set to **any value from any state** — the system allows free
124
+ transitions and reversal. No blocking errors. Use this as a guideline:
125
+
126
+ ```
127
+ open → in_progress → in_review
128
+ ```
129
+
130
+ | When | Set status to | Why |
131
+ |---|---|---|
132
+ | You start working the task | `in_progress` | You claimed it, work has begun |
133
+ | Work is done, ready for human review | `in_review` | Human should review and approve |
134
+
135
+ **Tip:** Set status as you go. The human sees live progress in the app.
136
+ You can always reverse (e.g. `in_progress` → `open` if you need to reassess).
137
+ Do NOT set `resolved` or `closed` — only humans can approve resolution and close tasks.
138
+ The highest status you may set is `in_review`.
139
+
140
+ ### Claim discipline (hard rule)
141
+
142
+ If you called `claim_task` on a task, you MUST call `release_task` for it
143
+ before your session ends — **regardless of the task's status** (even when
144
+ it stays `open` or `in_progress` for someone else to review). An unreleased
145
+ claim blocks every other agent from touching that task for the whole
146
+ 30-minute lease. The bridge also auto-releases all claims made by your
147
+ session at exit, but never rely on that: release explicitly as soon as
148
+ your work is done.
149
+
150
+ ## Build mode (IMP-700) — the project's workflow engine
151
+
152
+ Some projects run **build mode**: the project has a build agent, and tasks
153
+ marked **ready for dev** (`readyForDev: true`) form an ordered build queue
154
+ (`sortOrder` asc, `createdAt` asc) that the agent works **strictly one at a
155
+ time, fully completing each**. When you are working a task as part of a build
156
+ run, the following rules apply ON TOP of everything above:
157
+
158
+ - **Ready for dev is the gate.** A task stays out of the build queue until a
159
+ human (or the planner) sets `readyForDev: true`. The queue only contains
160
+ `readyForDev=true AND status=open` tasks (plus blocked in-progress ones).
161
+ - **Strict order, full completion.** Work the queue in exact order — never
162
+ pick a later task while an earlier one is open. Do not move on until the
163
+ current task is genuinely complete: build passes, `plan.md` written first,
164
+ subtasks checked off, `summary.md` written, status moved to `in_review`.
165
+ - **Failure protocol (never block the queue).** If a task cannot be finished,
166
+ the BUILD LOOP (not you) handles it: it leaves a `[question]` comment on the
167
+ task (marked with the literal prefix `[question]`) and a message in the
168
+ project's `#agent-questions` channel, then continues with the next ready
169
+ task. When a human answers, the loop resumes the skipped task automatically.
170
+ - **Planning (`--draft`).** When the human asks you to plan a build run from a
171
+ goal, create the tasks yourself with `create_task`:
172
+ - `readyForDev: true` so they enter the queue,
173
+ - increasing `sortOrder` (1, 2, 3, ...) so they are worked strictly in order,
174
+ - dependencies first (a task that unblocks others comes before them),
175
+ - write the plan into `agents/<your-slug>/tasks/<taskId>/plan.md` per task,
176
+ and a shared `docs/guides/build-plan.md` note summarizing the order.
177
+ - **Progress signals.** Push the task to `in_progress` when you start it and
178
+ `in_review` when done — the build loop watches status to decide
179
+ done vs. failed, so a task left in `in_progress` at the end of a session is
180
+ treated as failed and skipped.
181
+
182
+ ## Tools to use
183
+
184
+ - `get_project_context <projectId>` — the cloud AGENTS.md (+ version). Pass
185
+ `sections: ["conventions","gotchas", …]` to fetch ONLY what you need.
186
+ - `update_project_context` — section-granular write: send ONLY the section(s)
187
+ you changed with `append: true` (your addition only — the backend merges it;
188
+ no `baseVersion` needed). Full replace still needs `baseVersion` (409 =
189
+ re-read + merge). Never re-send untouched sections.
190
+ - `list_document_folders <projectId>` — the tree, with per-folder counts.
191
+ - `list_documents <projectId>` — files (optionally filter by folder).
192
+ - `read_document <documentId>` — content (notes return their markdown body).
193
+ - `create_document` — write a note (`name`, `content`, `folderPath`).
194
+ - `update_document_note <documentId> <content>` — replace a note's body.
195
+ - Uploads (PDFs, images, binaries) are Cloudinary-hosted into
196
+ `documents/<folderPath>` and recorded as file documents — mirror the same
197
+ folder convention.
198
+
199
+ ## References
200
+
201
+ - `docs/agent-tasks/agent-hub-connection.md` — the agent contract.
202
+ - `docs/api-contract.md` — response envelope, pagination, type mirroring.
203
+ - TeamShare root `docs/` + `IMPLEMENTATION_TRACKER.md` — the convention this
204
+ skill mirrors.
205
+ - Backend: `GET /documents/folders`, `POST /documents/note`,
206
206
  `PATCH /documents/:id/content`, `GET /documents/:id/raw`.