opencode-beads 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/vendor.ts +38 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-beads",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "A plugin for OpenCode that provides integration with the beads issue tracker.",
6
6
  "author": "Josh Thomas <josh@joshthomas.dev>",
package/src/vendor.ts CHANGED
@@ -84,8 +84,7 @@ async function listVendorFiles(relativePath: string): Promise<string[]> {
84
84
  }
85
85
  }
86
86
 
87
- export const BEADS_GUIDANCE = `<beads-guidance>
88
- ## CLI Usage
87
+ const BEADS_CLI_USAGE = `## CLI Usage
89
88
 
90
89
  **Note:** Beads MCP tools are not available in this environment. Use the \`bd\` CLI via bash instead. MCP tool names map directly to \`bd\` commands.
91
90
 
@@ -106,17 +105,47 @@ Use the \`bd\` CLI via bash for beads operations:
106
105
 
107
106
  If a tool is not listed above, try \`bd <tool> --help\`.
108
107
 
109
- Always use \`--json\` flag for structured output.
108
+ Always use \`--json\` flag for structured output.`;
109
+
110
+ const BEADS_SUBAGENT_CONTEXT = `## Subagent Context
111
+
112
+ You are called as a subagent. Your **final message** is what gets returned to the calling agent - make it count.
113
+
114
+ **Your purpose:** Handle both status queries AND autonomous task completion.
115
+
116
+ **For status/overview requests** ("what's next", "show me blocked work"):
117
+ - Run the necessary \`bd\` commands to gather data
118
+ - Process the JSON output internally
119
+ - Return a **concise, human-readable summary** with key information
120
+ - Use tables or lists to organize information clearly
121
+ - Example: "You have 3 ready tasks (2 P0, 1 P1), 5 in-progress, and 8 blocked by Epic X"
122
+
123
+ **For task completion requests** ("complete ready work", "work on issues"):
124
+ - Find ready work, claim it, execute it, close it
125
+ - Report progress as you work
126
+ - End with a summary of what was accomplished
127
+
128
+ **Critical:** Do NOT dump raw JSON in your final response. Parse it, summarize it, make it useful.`;
129
+
130
+ export const BEADS_GUIDANCE = `<beads-guidance>
131
+ ${BEADS_CLI_USAGE}
110
132
 
111
133
  ## Agent Delegation
112
134
 
113
- For multi-step beads work, use the \`task\` tool with \`subagent_type: "beads-task-agent"\`:
114
- - Finding and completing ready work autonomously
135
+ **Default to the agent.** For ANY beads work involving multiple commands or context gathering, use the \`task\` tool with \`subagent_type: "beads-task-agent"\`:
136
+ - Status overviews ("what's next", "what's blocked", "show me progress")
137
+ - Exploring the issue graph (ready + in-progress + blocked queries)
138
+ - Finding and completing ready work
115
139
  - Working through multiple issues in sequence
116
- - Tasks involving claiming, executing, and closing issues
117
- - When asked to "work on beads issues", "complete tasks", or similar
140
+ - Any request that would require 2+ bd commands
141
+
142
+ **Use CLI directly ONLY for single, atomic operations:**
143
+ - Creating exactly one issue: \`bd create "title" ...\`
144
+ - Closing exactly one issue: \`bd close <id> ...\`
145
+ - Updating one specific field: \`bd update <id> --status ...\`
146
+ - When user explicitly requests a specific command
118
147
 
119
- For single, specific operations (check status, create one issue, query info), use \`bd\` CLI directly.
148
+ **Why delegate?** The agent processes multiple commands internally and returns only a concise summary. Running bd commands directly dumps hundreds of lines of raw JSON into context, wasting tokens and making the conversation harder to follow.
120
149
  </beads-guidance>`;
121
150
 
122
151
  export async function loadAgent(): Promise<Config["agent"]> {
@@ -132,7 +161,7 @@ export async function loadAgent(): Promise<Config["agent"]> {
132
161
  return {
133
162
  "beads-task-agent": {
134
163
  description,
135
- prompt: BEADS_GUIDANCE + "\n" + parsed.body,
164
+ prompt: BEADS_CLI_USAGE + "\n\n" + BEADS_SUBAGENT_CONTEXT + "\n\n" + parsed.body,
136
165
  mode: "subagent",
137
166
  },
138
167
  };