@tesselate-digital/notion-agent-hive 0.0.8 → 0.0.9

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 (3) hide show
  1. package/README.md +20 -194
  2. package/dist/index.js +37 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,31 +8,27 @@
8
8
 
9
9
  ## Why this exists
10
10
 
11
- Two, ahem, persistent problems with AI coding agents:
11
+ Like many, I've been using LLMs extensively, in every flavour, and with all sorts of harnesses (Claude code, Codex, Copilot, etc.)
12
12
 
13
- **Sessions die at the worst time.** You're mid-feature when rate limits hit or sessions expire. There's no clean way to continue on another platform. You learn to ask agents to write plans in markdown first, but it's easy to forget - and then the context is gone.
13
+ While they can be wildly effective, I found some limitations in my workflow:
14
+
15
+ **Form factor** CLIs can be a bit clunky to collect one's thoughts. I love to write, edit, revisit, add structure through headers and richer markup ... Command line doesn't feel like the best place for that.
14
16
 
15
17
  **You lose track of what actually happened.** When working on larger features that take time, you often switch between your agent and other tasks. Coming back later, it's hard to trace what happened and what the agent was working on. You get a "done!" checklist but lose the 200k tokens of reasoning behind it, leaving you wondering what was actually discussed and implemented.
16
18
 
17
- **Limited task horizon.** Most AI coding sessions work best for small, contained tasks. When you want to tackle more ambitious, long-running features that span multiple sessions or days, you're left managing context manually - if you can at all.
19
+ **Sessions die at the worst time.** Especially when Anthropic cuts your plan allowance. The plan and logs live somewhere in some temp folder, you could do some digging, fire opencode, and let it handle the context all over again, but this is a bit awkward and wasteful.
20
+
21
+ **Limited task horizon.** Models' performance tend to degrade far below their max context size. I found it hard to reliably tackle more ambitious features because of it. Harnesses _may_ compact, or _may_ use subagents, which can help, but feels like a roll of dice. Being diligent, going through plan -> execute loops helps too, but then you're still facing issues 1-3 in this list.
18
22
 
19
23
  ## What this does
20
24
 
21
- Uses **Notion kanban boards as persistent memory** for your entire workflow. Every feature gets:
25
+ This uses Notion as a persistent memory layer and source of truth. Every feature gets:
22
26
 
23
27
  - A dedicated Notion page with the full plan, decisions, and reasoning
24
28
  - An inline kanban board with detailed task tickets
25
29
  - Context that persists across sessions and tools
26
30
 
27
- Why Notion specifically:
28
-
29
- - **You might already be using it at work** - You can easily link the wider context, specs, or designs to the notion agent
30
- - **Pick up where you left off instantly** - Any agent can read tickets and continue, no chat history needed
31
- - **Review what actually happened** - See plans, decisions, and reasoning without digging through conversation logs
32
-
33
- ## How It Works
34
-
35
- A coordinator manages three specialized subagents through a shared Notion board:
31
+ Under the hood, the tool will synchronise a few specialised subagents:
36
32
 
37
33
  | Agent | Role |
38
34
  | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -41,29 +37,17 @@ A coordinator manages three specialized subagents through a shared Notion board:
41
37
  | **Executor** | Implements code for the specific ticket assigned by the Coordinator. Writes findings/work summaries on that ticket, then reports back; does not route itself to other tasks. |
42
38
  | **Reviewer** | Verifies implementations against acceptance criteria. Gates tasks for human review before they can be marked done. |
43
39
 
44
- ### Ticket Lifecycle
45
-
46
- ```mermaid
47
- flowchart LR
48
- Backlog --> ToDo["To Do"]
49
- ToDo -->|"Executor picks up"| InProgress["In Progress"]
50
- InProgress -->|"Executor reports done"| InTest["In Test"]
51
- InTest -->|"Reviewer approves"| HumanReview["Human Review"]
52
- InTest -->|"Reviewer rejects"| ToDo
53
- HumanReview -->|"Human approves"| Done
54
- HumanReview -->|"Human requests changes"| ToDo
55
-
56
- style Done fill:#2ecc71,color:#fff
57
- style HumanReview fill:#9b59b6,color:#fff
58
- style InTest fill:#e67e22,color:#fff
59
- style InProgress fill:#f1c40f,color:#000
60
- style ToDo fill:#3498db,color:#fff
61
- style Backlog fill:#95a5a6,color:#fff
62
- ```
40
+ It's quite flexible. Fire it with a rough idea, either inline or in a Notion page, and it will interactively create a plan. Give it an existing plan in Notion, and it will resume the work. Just like that, you get:
63
41
 
64
- **Key rule:** No agent can mark a task as Done. Only you can. The human always has final say.
42
+ - **A proper space to think.** Notion pages with headers, tables, and structure. Each step becomes a ticket on a board with rich context, not a checklist item in a terminal.
43
+ - **A proper space to review.** Leave comments on specific parts of the plan. Add notes. Give feedback where it matters, not in a chat thread that scrolls away.
44
+ - **A proper space to supervise.** The board shows you exactly where everything stands at a glance.
65
45
 
66
- A task can also be moved to **Needs Human Input** at any point when a decision requires your judgment. The agent won't guess.
46
+ Each task runs with a fresh context, so you stay in the sweet spot where models perform best. When you want to review what an agent did, just look at the ticket: the work summary and QA report are right there.
47
+
48
+ It also saves money. You can assign a strong model for planning, a fast one for coordination, and a cheaper one for execution, since the thinking has already been done.
49
+
50
+ I'm still toying with different configurations, but had some good results using chatGPT 5.4 mini as the fast coordinator, chatGPT 5.4 (With high effort) or opus 4.6 as the thinker/reviewer, and at this point anything "Not considered SOTA but still good" like KIMI K2.5, GLM-5, or Devstral as the executor, where most of the tokens are spent.
67
51
 
68
52
  ## Installation
69
53
 
@@ -84,92 +68,6 @@ This command:
84
68
  - A Notion workspace with an [integration/API token](https://www.notion.so/my-integrations)
85
69
  - The [Notion MCP server](https://github.com/makenotion/notion-mcp-server) configured in OpenCode
86
70
 
87
- ### Local Development
88
-
89
- If you're developing from this repo instead of installing a published npm package, use a local plugin file.
90
-
91
- OpenCode auto-loads `.ts` plugin files from `~/.config/opencode/plugins/` (or `$OPENCODE_CONFIG_DIR/plugins` / `$XDG_CONFIG_HOME/opencode/plugins` if you use those).
92
-
93
- 1. Build the plugin bundle:
94
-
95
- ```bash
96
- bun install
97
- bun build src/index.ts --outdir dist --target bun --format esm
98
- ```
99
-
100
- 2. Create `~/.config/opencode/plugins/notion-agent-hive.ts`:
101
-
102
- ```ts
103
- import { NotionAgentHivePlugin } from "/absolute/path/to/notion-agent-hive/dist/index.js";
104
-
105
- export { NotionAgentHivePlugin };
106
- ```
107
-
108
- 3. Create `~/.config/opencode/notion-agent-hive.json` to choose models for each internal agent:
109
-
110
- ```json
111
- {
112
- "agents": {
113
- "coordinator": { "model": "openai/gpt-5.2" },
114
- "thinker": { "model": "openai/gpt-5.4", "variant": "xhigh" },
115
- "executor": { "model": "kimi-for-coding/k2p5" },
116
- "reviewer": { "model": "openai/gpt-5.4", "variant": "xhigh" }
117
- },
118
- "fallback": {
119
- "enabled": true,
120
- "chains": {}
121
- }
122
- }
123
- ```
124
-
125
- 4. Configure your Notion MCP server in `~/.config/opencode/opencode.json` if you haven't already:
126
-
127
- ```json
128
- {
129
- "mcp": {
130
- "notion": {
131
- "type": "remote",
132
- "url": "https://mcp.notion.com/mcp"
133
- }
134
- }
135
- }
136
- ```
137
-
138
- 5. Restart OpenCode.
139
- 6. Start a session with the `notion agent hive` agent.
140
-
141
- When you change plugin source, rebuild `dist/index.js` so OpenCode picks up the new code.
142
-
143
- ### Published Package
144
-
145
- ```bash
146
- bunx @tesselate-digital/notion-agent-hive install
147
- ```
148
-
149
- This command:
150
-
151
- 1. Adds `@tesselate-digital/notion-agent-hive` to the `plugin` array in `~/.config/opencode/opencode.json` (or `$OPENCODE_CONFIG_DIR/opencode.json` / `$XDG_CONFIG_HOME/opencode/opencode.json`)
152
- 2. Creates a `~/.config/opencode/notion-agent-hive.json` starter config (or the matching `$OPENCODE_CONFIG_DIR` / `$XGD_CONFIG_HOME` location)
153
-
154
- If you want per-project overrides, create `notion-agent-hive.json` in the project root manually.
155
-
156
- Then configure your Notion MCP server in `~/.config/opencode/opencode.json` if you haven't already:
157
-
158
- ```json
159
- {
160
- "mcp": {
161
- "notion": {
162
- "type": "npx",
163
- "command": "npx",
164
- "args": ["-y", "@notionhq/notion-mcp-server"],
165
- "env": {
166
- "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NOTION_TOKEN\"}"
167
- }
168
- }
169
- }
170
- }
171
- ```
172
-
173
71
  ### Configuring Models
174
72
 
175
73
  There are two places to configure models, merged at startup:
@@ -181,15 +79,7 @@ There are two places to configure models, merged at startup:
181
79
 
182
80
  Project config takes precedence. Agent keys are merged individually — setting `thinker` in the project config does not wipe out `executor` from your global config.
183
81
 
184
- Restart OpenCode for changes to take effect.
185
-
186
- ---
187
-
188
- Model IDs use the `provider/model-name` format that OpenCode uses — any provider configured in your OpenCode setup works here.
189
-
190
- The public agent name is `notion agent hive`, but the model config key is still `coordinator`.
191
-
192
- The `$schema` path depends on how you installed the plugin. For local development or global config, it's simplest to omit `$schema`.
82
+ Example config:
193
83
 
194
84
  ```json
195
85
  {
@@ -202,27 +92,7 @@ The `$schema` path depends on how you installed the plugin. For local developmen
202
92
  }
203
93
  ```
204
94
 
205
- Each agent has a distinct role, so you can tune them independently:
206
-
207
- | Agent | Role | Suggested model profile |
208
- | --------------- | ------------------------------------ | ----------------------------------------------------------- |
209
- | **coordinator** | Dispatches agents, moves tickets | Fast and cheap — it mostly routes, not thinks |
210
- | **thinker** | Deep research, feature decomposition | Most capable model you have — this is where quality matters |
211
- | **executor** | Code implementation | Balanced — good at coding tasks |
212
- | **reviewer** | QA verification, criteria checking | Same tier as executor |
213
-
214
- #### Variants
215
-
216
- Some providers support model-specific variants such as `"xhigh"` or `"max"`:
217
-
218
- ```json
219
- {
220
- "agents": {
221
- "thinker": { "model": "openai/gpt-5.4", "variant": "xhigh" },
222
- "reviewer": { "model": "anthropic/claude-opus-4", "variant": "max" }
223
- }
224
- }
225
- ```
95
+ Restart OpenCode for changes to take effect.
226
96
 
227
97
  #### Fallback chains
228
98
 
@@ -257,47 +127,3 @@ You can also pass the full chain directly as the `model` value — the first ent
257
127
  }
258
128
  }
259
129
  ```
260
-
261
- ### Usage
262
-
263
- 1. Open OpenCode and start a session with the **notion agent hive** agent
264
- 2. Describe the feature you want to build
265
- 3. The Coordinator dispatches the Thinker, who interrogates you, explores your codebase, and creates the Notion feature page + task board
266
- 4. Say **"execute"** and the Coordinator dispatches tasks to the Executor, runs them through the Reviewer, and surfaces completed work for your review
267
- 5. Review tasks in the **Human Review** column and move them to **Done**, or send them back with comments
268
-
269
- You can close your session at any point. When you come back, point the Coordinator at the same Notion board and pick up where you left off.
270
-
271
- ---
272
-
273
- <details>
274
- <summary><strong>Technical Details</strong></summary>
275
-
276
- ### Repository Structure
277
-
278
- ```
279
- notion-agent-hive/
280
- ├── src/
281
- │ ├── agents/
282
- │ │ ├── types.ts # AgentDefinition + AgentConfig interfaces
283
- │ │ ├── coordinator.ts # notion agent hive agent factory
284
- │ │ ├── thinker.ts # notion-thinker agent factory
285
- │ │ ├── executor.ts # notion-executor agent factory
286
- │ │ └── reviewer.ts # notion-reviewer agent factory
287
- │ ├── cli/
288
- │ │ ├── index.ts # CLI entry point
289
- │ │ └── install.ts # install command
290
- │ ├── config.ts # Config loading + Zod validation
291
- │ ├── fallback.ts # Runtime model fallback manager
292
- │ └── index.ts # Plugin entry point + public API
293
- ├── schema.json # JSON Schema for notion-agent-hive.json
294
- ├── biome.json
295
- ├── tsconfig.json
296
- └── package.json
297
- ```
298
-
299
- ### MCP Requirements
300
-
301
- Only the **Notion MCP server** is required. No other MCP servers are mandatory for core functionality.
302
-
303
- </details>
package/dist/index.js CHANGED
@@ -155,7 +155,14 @@ The coordinator is orchestration-only and must never implement code directly. It
155
155
 
156
156
  ## Communication Style
157
157
 
158
- Be brief. Act, then report results concisely. One line per action. Do not narrate dispatches or explain the workflow. Be direct on errors: "Task X blocked: missing API credentials."
158
+ **TUI output (what the user sees in terminal):** Terse. Action + result only. No background, no reasoning, no "here's what I'm thinking". Examples:
159
+ - "Executor done, moving T-003 to In Test. Dispatching reviewer."
160
+ - "Thinker returned 4 tasks. Creating board."
161
+ - "T-001 blocked: missing API credentials. Moving to Needs Human Input."
162
+
163
+ Do NOT say: "The executor has completed its work and reported that the implementation is ready. Based on this, I will now transition the ticket status and proceed to dispatch the review agent to verify the changes."
164
+
165
+ **Notion content (board, feature pages, tickets):** Exhaustive. The board is the source of truth for both humans and agents. A human should open the board after a week away and understand the feature. Agents load only the ticket content as context, so tickets must be self-contained with full specifications, acceptance criteria, and relevant background.
159
166
 
160
167
  ---
161
168
 
@@ -176,18 +183,19 @@ After obtaining the page ID, fetch the page content via Notion MCP and classify
176
183
  |-------|-----------|--------|
177
184
  | **Empty Board** | Page has no content or only a title | Proceed to Plan Phase with user's request as new feature |
178
185
  | **Existing Thinking Board** | Page contains a kanban database with Status column matching schema | Proceed to Session Resumption |
179
- | **Draft Page** | Page contains content (text, lists, notes) but NO kanban database | Proceed to Draft Conversion |
186
+ | **Draft Page** | Page contains content (text, lists, notes) but NO kanban database | Ask user: overwrite or create sibling? Then proceed to Draft Conversion |
180
187
 
181
188
  ### Draft Conversion
182
189
 
183
- When the user points to a page containing their own draft ideas, notes, or planning content (but no kanban database), treat this as source material for the thinker:
190
+ When the user points to a page containing their own draft ideas, notes, or planning content (but no kanban database):
184
191
 
185
- 1. **Read the draft content** from the Notion page via MCP.
186
- 2. **Dispatch the thinker** with PLAN_FROM_DRAFT (see Plan Phase for dispatch template).
187
- 3. **Process the PLANNING_REPORT** as usual (create feature page, kanban database, task tickets).
188
- 4. **Decide where to create the board:**
189
- - If the draft page is mostly planning notes \u2192 create the kanban as a sibling, link from draft page
190
- - If the draft page should become the feature page \u2192 restructure it: move draft content into a "Background" section, add kanban database link
192
+ 1. **Ask the user** via AskHuman: *"This page has existing content. Should I: (A) Convert this page into the feature board (your draft becomes background context), or (B) Create a separate sibling page for the board and link back to your draft?"*
193
+ 2. **Read the draft content** from the Notion page via MCP.
194
+ 3. **Dispatch the thinker** with PLAN_FROM_DRAFT (see Plan Phase for dispatch template).
195
+ 4. **Process the PLANNING_REPORT** as usual (create feature page, kanban database, task tickets).
196
+ 5. **Create the board based on user's choice:**
197
+ - **(A) Convert this page**: Restructure it by moving draft content into a "Background" section, then add the kanban database.
198
+ - **(B) Create sibling**: Create a new feature page as a sibling, link to it from the draft page, preserve draft as-is.
191
199
 
192
200
  ---
193
201
 
@@ -854,13 +862,31 @@ Before producing any task breakdown, explore the codebase to gather concrete con
854
862
 
855
863
  Break the feature into tasks following these principles:
856
864
 
857
- 1. **Independence first**: Each task should be implementable without waiting for other tasks wherever possible. When dependencies exist, make them explicit.
865
+ 1. **Independence first**: Design tasks that can run in parallel by default.
866
+ - Slice by module/file rather than by workflow step (e.g., "implement auth service" not "implement login, then implement logout")
867
+ - Prefer "implement X in isolation" over "implement X, then wire it up"
868
+ - Extract shared concerns (types, schemas, configs) into dedicated foundation tasks that others depend on
869
+ - If two tasks would touch the same file, question whether they are truly independent or should be merged/resequenced
858
870
  2. **One concern per task**: A task should do one thing well. Do not bundle unrelated changes.
859
871
  3. **Testable**: Each task should have verifiable acceptance criteria.
860
872
  4. **Ordered by dependency**: Tasks that others depend on should be higher priority.
861
- 5. **Right-sized**: A task should be completable in a single agent session. If it feels too large, split it.
873
+ 5. **Small by default**: Prefer many small tasks over few large ones.
874
+ - If a task has more than 5 subtasks, it is too big \u2014 decompose further
875
+ - "Large" complexity is a smell: always ask "can this be two tasks instead?"
876
+ - When in doubt, split. Merging tasks later is easier than debugging a monolithic one.
862
877
  6. **Contract-first handoff**: Every task must be closed at the contract level (what/where/constraints/acceptance), while allowing normal implementation-level leeway.
863
878
 
879
+ #### Dependency Minimization Checklist
880
+
881
+ Before finalizing tasks, verify:
882
+
883
+ - [ ] Each dependency is truly necessary \u2014 would the dependent task fail without it, or is it just convenient ordering?
884
+ - [ ] No chain dependencies that could be broken (A\u2192B\u2192C\u2192D often hides parallelizable work)
885
+ - [ ] Shared concerns (types, schemas, configs) are extracted to foundation tasks rather than duplicated or assumed
886
+ - [ ] No two tasks modify the same file unless absolutely necessary
887
+
888
+ If the checklist fails, refactor the task breakdown before proceeding.
889
+
864
890
  #### Ticket Strictness Rules (Non-Negotiable)
865
891
 
866
892
  Before including a task in your report, enforce these rules:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesselate-digital/notion-agent-hive",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "provenance": true,
5
5
  "repository": {
6
6
  "type": "git",