clikit-plugin 0.3.11 → 0.3.13

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.
@@ -0,0 +1,45 @@
1
+ export type AugmentRewriteMode = "plain" | "execution-contract";
2
+ export type AugmentTaskIntent = "implement" | "debug" | "refactor" | "review" | "research" | "docs" | "test-fix" | "explain" | "general";
3
+ export type PromptLeverageIntensity = "Light" | "Standard" | "Deep";
4
+ export interface PromptLeverageBlocks {
5
+ objective: string;
6
+ context: string;
7
+ workStyle: string;
8
+ toolRules: string;
9
+ outputContract: string;
10
+ verification: string;
11
+ doneCriteria: string;
12
+ }
13
+ export interface AugmentPromptOptions {
14
+ mode?: AugmentRewriteMode | "auto";
15
+ }
16
+ export interface AugmentRefinementInput {
17
+ original: string;
18
+ enhanced: string;
19
+ intent: AugmentTaskIntent;
20
+ mode: AugmentRewriteMode;
21
+ intensity: PromptLeverageIntensity;
22
+ blocks: PromptLeverageBlocks;
23
+ }
24
+ export interface AugmentRefinementOptions extends AugmentPromptOptions {
25
+ refine?: (input: AugmentRefinementInput) => Promise<string | undefined>;
26
+ }
27
+ export interface AugmentPromptResult {
28
+ original: string;
29
+ enhanced: string;
30
+ intent: AugmentTaskIntent;
31
+ mode: AugmentRewriteMode;
32
+ intensity: PromptLeverageIntensity;
33
+ blocks: PromptLeverageBlocks;
34
+ enhancementSource?: "deterministic" | "llm";
35
+ fallbackReason?: string;
36
+ }
37
+ export declare function detectTaskIntent(draft: string): AugmentTaskIntent;
38
+ export declare function resolveRewriteMode(configuredMode: AugmentRewriteMode | "auto", intent: AugmentTaskIntent): AugmentRewriteMode;
39
+ export declare function inferIntensity(draft: string, intent: AugmentTaskIntent): PromptLeverageIntensity;
40
+ export declare function buildPromptLeverageBlocks(draft: string, intent: AugmentTaskIntent, intensity: PromptLeverageIntensity): PromptLeverageBlocks;
41
+ export declare function augmentPrompt(draft: string, options?: AugmentPromptOptions): AugmentPromptResult;
42
+ export declare function augmentPromptWithRefinement(draft: string, options?: AugmentRefinementOptions): Promise<AugmentPromptResult>;
43
+ export declare function formatExecutionContract(draft: string, blocks: PromptLeverageBlocks): string;
44
+ export declare function formatPlainRewrite(draft: string, intent: AugmentTaskIntent, outputContract: string): string;
45
+ //# sourceMappingURL=augment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../../src/tools/augment.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,oBAAoB,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,OAAO,GACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmJD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAajE;AAED,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,kBAAkB,GAAG,MAAM,EAC3C,MAAM,EAAE,iBAAiB,GACxB,kBAAkB,CAMpB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,GACxB,uBAAuB,CAOzB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,uBAAuB,GACjC,oBAAoB,CAUtB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAuBrB;AAED,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAqC9B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,oBAAoB,GAC3B,MAAM,CAgBR;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,EACzB,cAAc,EAAE,MAAM,GACrB,MAAM,CAkBR"}
@@ -2,4 +2,5 @@ export { memoryRead, memorySearch, memoryGet, memoryTimeline, memoryUpdate, memo
2
2
  export { createObservation, getObservationsByType, getObservationsByBead, linkObservations, type ObservationParams, type ObservationResult, } from "./observation";
3
3
  export { contextSummary, type ContextSummaryParams, type ContextSummaryResult, } from "./context-summary";
4
4
  export { cassMemoryContext, cassMemoryMark, cassMemoryReflect, cassMemoryDoctor, cassMemoryOutcome, cassIsAvailable, cassResetCache, type CassMemoryContextParams, type CassMemoryMarkParams, type CassMemoryReflectParams, type CassMemoryOutcomeParams, type CassMemoryDoctorParams, type CassMemoryExecOptions, type CassMemoryResult, } from "./cass-memory";
5
+ export { augmentPrompt, buildPromptLeverageBlocks, detectTaskIntent, formatExecutionContract, formatPlainRewrite, inferIntensity, resolveRewriteMode, type AugmentPromptOptions, type AugmentPromptResult, type AugmentRewriteMode, type AugmentTaskIntent, type PromptLeverageBlocks, type PromptLeverageIntensity, } from "./augment";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,YAAY,EACZ,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,YAAY,EACZ,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,WAAW,CAAC"}
package/dist/tui.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { TuiPluginModule } from "@opencode-ai/plugin/tui";
2
+ declare const CliKitTuiPlugin: TuiPluginModule;
3
+ export default CliKitTuiPlugin;
4
+ //# sourceMappingURL=tui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,QAAA,MAAM,eAAe,EAAE,eAStB,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/dist/tui.js ADDED
@@ -0,0 +1,38 @@
1
+ // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
28
+ var __require = import.meta.require;
29
+
30
+ // src/tui.ts
31
+ var CliKitTuiPlugin = {
32
+ id: "clikit-tui",
33
+ async tui() {}
34
+ };
35
+ var tui_default = CliKitTuiPlugin;
36
+ export {
37
+ tui_default as default
38
+ };
@@ -4,7 +4,7 @@ Use this template when documenting clarified intent before `/create`.
4
4
 
5
5
  **Output path:** `.opencode/memory/discussions/YYYY-MM-DD-<topic>.md`
6
6
 
7
- This template is optimized for **pre-create discussion**: the report should reduce guessing for `/create`, `/research`, and `/start` by separating locked intent from unresolved technical work.
7
+ This template is optimized for an **interview-style pre-create discussion**: the report should reduce guessing for `/create`, `/research`, and `/start` by separating what the interview already resolved from what still needs downstream work.
8
8
 
9
9
  ---
10
10
 
@@ -22,6 +22,7 @@ bead_id: [optional]
22
22
  **Goal:** [What outcome the user wants]
23
23
  **Why now:** [Why this needs to be clarified before planning]
24
24
  **Assumptions:** [Any assumptions made due to incomplete context, or "None"]
25
+ **Interview focus:** [Which gray areas the discussion prioritized first]
25
26
 
26
27
  ---
27
28
 
@@ -34,6 +35,8 @@ bead_id: [optional]
34
35
 
35
36
  ## Locked Decisions
36
37
 
38
+ Record only decisions that the interview actually resolved. If a topic stayed uncertain, move it to **Open Questions** instead of implying certainty.
39
+
37
40
  ### Decision 1: [Title]
38
41
  - **Decision:** [Confirmed choice]
39
42
  - **Why it matters:** [Why `/create` or `/research` must preserve it]
@@ -48,6 +51,8 @@ bead_id: [optional]
48
51
 
49
52
  ## Confirmed Assumptions
50
53
 
54
+ Use this section for defaults accepted during the interview because prior artifacts or codebase evidence made them reasonable.
55
+
51
56
  - **Assumption:** [What was assumed]
52
57
  - **Confirmed by:** [user / artifact / codebase pattern]
53
58
  - **Notes:** [Any caveat]
@@ -56,6 +61,8 @@ bead_id: [optional]
56
61
 
57
62
  ## Open Questions
58
63
 
64
+ Use this section for planning-critical ambiguity that the interview intentionally left unresolved.
65
+
59
66
  - **Question:** [Unresolved item]
60
67
  - **Why unresolved:** [Reason]
61
68
  - **Next owner:** `/create` | `/research` | user
@@ -88,4 +95,5 @@ bead_id: [optional]
88
95
  ## Planning Notes
89
96
 
90
97
  - [Specific instruction `/create` should preserve in the plan]
98
+ - [If useful: which question order or interview framing worked best for this topic]
91
99
  ```
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "name": "clikit-plugin",
3
- "version": "0.3.11",
4
- "description": "OpenCode plugin 7 agents, 14 commands, 26 skills, 11 hooks",
3
+ "version": "0.3.13",
4
+ "description": "Workflow layer for OpenCode — agents, commands, hooks, memory, and verification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "bin": {
9
- "clikit": "./dist/cli.js"
9
+ "clikit": "dist/cli.js"
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
14
  "import": "./dist/index.js"
15
15
  },
16
+ "./tui": {
17
+ "types": "./dist/tui.d.ts",
18
+ "import": "./dist/tui.js"
19
+ },
16
20
  "./schema.json": "./dist/clikit.schema.json"
17
21
  },
18
22
  "files": [
@@ -20,16 +24,17 @@
20
24
  "src/agents",
21
25
  "skill",
22
26
  "command",
23
- "memory",
27
+ "memory/_templates",
28
+ "memory/project",
24
29
  "AGENTS.md",
25
30
  "README.md"
26
31
  ],
27
32
  "scripts": {
28
- "build": "bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly && cp src/clikit.schema.json dist/clikit.schema.json",
29
- "clean": "rm -rf dist",
33
+ "build": "bun build src/index.ts src/cli.ts src/tui.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly && cp src/clikit.schema.json dist/clikit.schema.json",
34
+ "clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true});\"",
30
35
  "lint": "tsc --noEmit",
31
36
  "prepublishOnly": "bun run clean && bun run build",
32
- "postpublish": "rm -rf ~/.cache/opencode/node_modules/clikit-plugin && rm -f ~/.cache/opencode/bun.lock && echo '✓ Cleared OpenCode plugin cache — next start will install fresh'",
37
+ "postpublish": "node -e \"const fs=require('fs'); const os=require('os'); const path=require('path'); const root=path.join(os.homedir(),'.cache','opencode'); fs.rmSync(path.join(root,'node_modules','clikit-plugin'),{recursive:true,force:true}); fs.rmSync(path.join(root,'bun.lock'),{force:true}); console.log('✓ Cleared OpenCode plugin cache — next start will install fresh');\"",
33
38
  "typecheck": "tsc --noEmit",
34
39
  "verify": "bun run lint && bun run build",
35
40
  "dev": "bun run build --watch"
@@ -1,33 +1,42 @@
1
1
  ---
2
2
  name: beads
3
- description: Use for multi-agent task coordination, file locking, and dependency management via beads-village MCP tools.
3
+ description: Use for multi-agent task coordination with `br` and optional legacy beads-village helpers.
4
4
  ---
5
5
 
6
6
  # Beads
7
7
 
8
- **AI agents: always use `beads-village_*` MCP tools — never shell `bd` commands.**
8
+ **Preferred tracker:** `br` (`beads_rust`) with `.beads/` storage.
9
+
10
+ Use `br` CLI first for task state. Use `beads-village_*` only as optional legacy compatibility when reservations, inbox-style messaging, or existing local workflows still depend on it.
9
11
 
10
12
  ## Session Cycle
11
13
 
12
14
  ```
13
- init → ls(ready) → show → claim → reserve(files)workdone
15
+ br init → br ready --json br show <id> --json br update <id> --status in_progress --claim → workbr close <id> --reason "Completed" --json br sync --flush-only
14
16
  ```
15
17
 
16
- ## Core Tools
17
-
18
- | Tool | Purpose |
19
- |------|---------|
20
- | `beads-village_init(team=…)` | **First call every session** |
21
- | `beads-village_ls(status="ready")` | List unblocked tasks |
22
- | `beads-village_show(id)` | Read task details |
23
- | `beads-village_claim()` | Claim next ready task |
24
- | `beads-village_add(title, typ, pri, tags, deps)` | Create issue |
25
- | `beads-village_reserve(paths, reason)` | Lock files before editing |
26
- | `beads-village_done(id, msg)` | Complete + auto-release locks |
27
- | `beads-village_msg(subj, global=true, to="all")` | Broadcast |
28
- | `beads-village_inbox(unread=true)` | Read messages |
29
- | `beads-village_status(include_agents=true)` | Workspace overview |
30
- | `beads-village_sync()` | Git push/pull |
18
+ ## Preferred Commands
19
+
20
+ | Command | Purpose |
21
+ |---------|---------|
22
+ | `br init` | Initialize `.beads/` if missing |
23
+ | `br ready --json` | List unblocked tasks |
24
+ | `br show <id> --json` | Read task details |
25
+ | `br create --title ... --description ... --type ... --priority ...` | Create issue |
26
+ | `br update <id> --status in_progress --claim` | Claim/start work |
27
+ | `br close <id> --reason "Completed" --json` | Complete work |
28
+ | `br sync --flush-only` | Flush `.beads/` state before commit/push |
29
+ | `br sync --import-only` | Re-import `.beads/` state after pull/rebase |
30
+
31
+ ## Optional Legacy MCP Helpers
32
+
33
+ | Tool | Use only when... |
34
+ |------|------------------|
35
+ | `beads-village_reserve(paths, reason)` | You need explicit file reservations in a shared workspace |
36
+ | `beads-village_reservations()` | You need to inspect existing locks |
37
+ | `beads-village_inbox(unread=true)` | Your team still uses village-style messaging |
38
+ | `beads-village_status(include_agents=true)` | You need legacy workspace/agent discovery |
39
+ | `beads-village_msg(...)` | You need a compatibility broadcast path |
31
40
 
32
41
  ## Issue Schema
33
42
 
@@ -35,7 +44,7 @@ init → ls(ready) → show → claim → reserve(files) → work → done
35
44
  typ: task | bug | feature | epic | chore
36
45
  pri: 0=critical 1=high 2=normal 3=low 4=backlog
37
46
  tags: fe | be | devops | qa
38
- deps: ["bv-id"] or ["discovered-from:bv-id"]
47
+ deps: ["br-id"] or ["discovered-from:br-id"]
39
48
  ```
40
49
 
41
50
  ## When to Create Issues
@@ -43,13 +52,4 @@ deps: ["bv-id"] or ["discovered-from:bv-id"]
43
52
  - Trivial (< 2 min, 1-line): skip, just do it
44
53
  - Non-trivial (2+ min, 2+ files): create issue first, then work
45
54
 
46
- ## v1.3 API Correct Names
47
-
48
- | ❌ Old | ✅ Correct |
49
- |--------|-----------|
50
- | `beads-village_ready` | `beads-village_ls(status="ready")` |
51
- | `beads-village_broadcast` | `beads-village_msg(global=true, to="all")` |
52
- | `beads-village_discover` | `beads-village_status(include_agents=true)` |
53
-
54
- See [references/api-reference.md](references/api-reference.md) for full tool params and examples.
55
- - MCP: `beads-village` — see [mcp.json](mcp.json)
55
+ Legacy `beads-village` remains optional compatibility only. Do not make it a hard prerequisite in new workflows.
@@ -3,7 +3,7 @@
3
3
  "beads-village": {
4
4
  "type": "local",
5
5
  "command": ["npx", "-y", "beads-village"],
6
- "description": "Multi-agent task coordination, file locking, issue tracking",
6
+ "description": "Optional legacy Beads Village compatibility for reservations and messaging",
7
7
  "tools": [
8
8
  "beads-village_init",
9
9
  "beads-village_add",
@@ -1,4 +1,7 @@
1
- # Beads API Reference
1
+ # Legacy Beads Village API Reference
2
+
3
+ This reference documents the optional `beads-village_*` MCP helpers only.
4
+ For primary task tracking, use `br` CLI first.
2
5
 
3
6
  ## Full Tool Parameters
4
7
 
@@ -38,7 +41,7 @@ importance: string
38
41
  thread: string
39
42
  ```
40
43
 
41
- ## Example: Build Agent Session
44
+ ## Example: Legacy Compatibility Session
42
45
 
43
46
  ```
44
47
  beads-village_init(team="myproject")
@@ -56,9 +59,11 @@ beads-village_done(id="bv-42", msg="Fixed null check in token validation")
56
59
  beads-village_sync()
57
60
  ```
58
61
 
59
- ## File Locking Protocol
62
+ ## File Locking Protocol (optional legacy)
60
63
 
61
64
  1. `beads-village_reservations()` — check what's locked before editing
62
65
  2. `beads-village_reserve(paths=[…])` — lock your files
63
66
  3. TTL default: 10 min — extend for longer tasks
64
67
  4. `beads-village_done()` — auto-releases all locks, no manual release needed
68
+
69
+ When possible, prefer the `br` workflow documented in `skill/beads/SKILL.md` and use these helpers only when your local runtime still depends on Beads Village.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Each `.md` file in this directory defines an agent. The frontmatter sets model, tools, and permissions. The markdown body becomes the agent's system prompt. Loaded by `index.ts` using gray-matter.
4
4
 
5
+ > Permission model note: `tools.*` exposes capability, while `permission.*` authorizes whether that capability may run. For file changes, OpenCode uses `permission.edit` as the canonical file-modification permission for `edit`, `write`, `patch`, and `multiedit`, so do not expect a separate `permission.write` key even when an agent frontmatter includes `tools.write: true`.
6
+
5
7
  ## Agent Roles
6
8
 
7
9
  | Agent | Role | Mode | Modifies Code? |
@@ -58,23 +60,23 @@ On-demand specialists (invoke only when needed):
58
60
 
59
61
  ## Beads Task Management
60
62
 
61
- Agents use **Beads** (`beads-village_*` MCP tools) for persistent task tracking.
63
+ Agents prefer **Beads Rust** (`br`) for persistent task tracking. `beads-village_*` MCP tools are optional legacy helpers, not a mandatory dependency.
62
64
 
63
- **Policy:** Beads is used for non-trivial work. Trivial fixes (typo, single-line) skip Beads and execute immediately.
65
+ **Policy:** Non-trivial work should use `.beads/` tracking when available. Trivial fixes (typo, single-line) skip Beads and execute immediately.
64
66
 
65
67
  **Core cycle:**
66
68
  ```
67
- beads-village_initbeads-village_status/include_agents beads-village_inboxbeads-village_ls(status="ready") beads-village_show(id)beads-village_add (if needed) → beads-village_claim beads-village_reservations beads-village_reserve → work → verify → beads-village_donebeads-village_sync
69
+ br init br ready --jsonbr show/list --jsonbr create (if needed) → br update --status in_progress --claim → work → verify → br close br sync --flush-only
68
70
  ```
69
71
 
70
72
  Execution happens one **Task Packet** at a time.
71
73
 
72
- - **@build**: Creates issues for non-trivial tasks, claims and closes on completion
73
- - **@build**: Reads issue context before claiming, reserves packet files, verifies evidence, and syncs on completion
74
- - **@plan**: Creates issues for every plan task after plan approval
75
- - **Subagents**: Read-only — do not create/modify Beads issues
74
+ - **@build**: Creates issues for non-trivial tasks, claims/starts them, verifies evidence, and closes them on completion
75
+ - **@build**: May use optional `beads-village_reserve` locks when the MCP is installed, but must not assume they exist
76
+ - **@plan**: Creates task-tracking issues after plan approval when the workflow calls for it
77
+ - **Subagents**: Read-only — do not create/modify `.beads/` task state unless explicitly instructed by a primary agent workflow
76
78
 
77
- `todowrite` is for in-session UI display only. Beads persists across sessions.
79
+ `todowrite` is for in-session UI display only. `.beads/` persists across sessions.
78
80
 
79
81
  ## Delegation Rules
80
82
 
@@ -38,7 +38,7 @@ permission:
38
38
  You are the Build Agent — the primary executor and orchestrator. You own the full execution lifecycle: intake → bootstrap → context → implement → verify → close.
39
39
 
40
40
  **Reference documents (read these before modifying behavior):**
41
- - Beads policy & API: `.opencode/AGENTS.md` → Beads section, `.opencode/skill/beads/SKILL.md`
41
+ - Beads Rust policy & workflow: `.opencode/AGENTS.md` → Beads section, `.opencode/skill/beads/SKILL.md`
42
42
  - Explore/navigation policy: `.opencode/src/agents/explore.md`
43
43
  - Shared-workspace workflow (legacy skill path): `.opencode/skill/using-git-worktrees/SKILL.md`
44
44
  - Task Packet schema: `.opencode/schemas.md`
@@ -84,7 +84,7 @@ Every message enters here first. Route silently before acting.
84
84
 
85
85
  ---
86
86
 
87
- ## Phase 1 — Beads + Shared Workspace Bootstrap
87
+ ## Phase 1 — Task Tracking + Shared Workspace Bootstrap
88
88
 
89
89
  **Required for non-trivial code work. Skip for trivial (< 2 min, 1-line) fixes and read-only tasks.**
90
90
 
@@ -93,58 +93,58 @@ Every message enters here first. Route silently before acting.
93
93
 
94
94
  > Reference: `.opencode/AGENTS.md`, `skill/beads/SKILL.md`
95
95
 
96
- ### Two layers — understand the difference
96
+ ### Preferred tracker model
97
97
 
98
98
  | Layer | Role | Interface |
99
99
  |-------|------|-----------|
100
- | **bd (control plane)** | Create/update/query issues and reflect shared-workspace task state. | `bd` CLI — shell commands |
101
- | **beads-village (execution loop)** | Init session, claim, lock files, execute, close. | `beads-village_*` MCP tools |
100
+ | **`br` CLI (primary)** | Create, inspect, claim/start, close, and sync task state in `.beads/`. | `br` shell commands |
101
+ | **`beads-village_*` MCP (optional legacy)** | Reservations, inbox-style messaging, and compatibility workflows when already installed. | `beads-village_*` tools |
102
102
 
103
- > **AI agents use `beads-village_*` MCP tools never shell `bd` commands for claiming/locking/closing.**
103
+ > Use `br` as the default tracker. Use `beads-village_*` only when the local runtime already provides it and you need compatibility features like reservations or inbox messaging.
104
104
 
105
105
  ---
106
106
 
107
- ### 1.1 beads-village Join workspace (always first)
107
+ ### 1.1 Initialize tracker state
108
+
109
+ ```bash
110
+ br init # ensure .beads/ exists
111
+ br ready --json # see claimable work
112
+ br list --json # inspect current task inventory
113
+ git status --short --branch # inspect local state before editing
114
+ ```
115
+
116
+ Optional legacy compatibility checks when the MCP exists:
108
117
 
109
118
  ```
110
- beads-village_init(team="project") # ALWAYS first — every session, no exceptions
111
- beads-village_status(include_agents=true) # who's active, workspace overview
112
- beads-village_inbox(unread=true) # messages or blockers from other agents
113
- beads-village_ls(status="ready") # what issues are unblocked and claimable
119
+ beads-village_status(include_agents=true)
120
+ beads-village_inbox(unread=true)
121
+ beads-village_reservations()
114
122
  ```
115
123
 
116
124
  ---
117
125
 
118
- ### 1.2 bd Control plane (find or create issue)
126
+ ### 1.2 Find or create the tracked issue
119
127
 
120
- If the task matches an existing ready issue → go to §1.3 (claim).
128
+ If the task already maps to an existing ready issue → go to §1.3.
121
129
 
122
- If no existing issue covers this task, create one:
130
+ If no tracked issue covers this non-trivial task, create one:
123
131
 
124
- ```
125
- beads-village_add(
126
- title="<concise task title>",
127
- typ="task|bug|feature|chore",
128
- pri=<0=critical · 1=high · 2=normal · 3=low>,
129
- tags=["be"|"fe"|"devops"|...],
130
- desc="<goal, context, files expected>"
131
- )
132
+ ```bash
133
+ br create --title "<concise task title>" --description "<goal, context, files expected>" --type task --priority <0-4>
132
134
  ```
133
135
 
134
- **No bd issue → no execution for non-trivial tasks.**
136
+ **No tracked issue → no execution for non-trivial tasks when `br` is available.**
135
137
 
136
138
  ---
137
139
 
138
- ### 1.3 beads-village — Claim (read context first, then claim)
140
+ ### 1.3 Claim / start the issue
139
141
 
140
- ```
141
- beads-village_show(<issue-id>) # read full context BEFORE claiming
142
- beads-village_claim() # claims the next ready task in the queue
142
+ ```bash
143
+ br show <issue-id> --json # read full context BEFORE starting
144
+ br update <issue-id> --status in_progress --claim # claim / start work
143
145
  ```
144
146
 
145
- > ⚠️ `beads-village_claim()` claims by queue position, not by ID.
146
- > After calling it, immediately confirm via `beads-village_show` that the task you received is the one you intended.
147
- > If a different task was claimed, release it and coordinate with the user or other agents.
147
+ If the tracker shows a different scope than expected, stop and coordinate before editing.
148
148
 
149
149
  ### 1.4 Shared workspace — guard the default-branch checkout
150
150
 
@@ -169,24 +169,16 @@ Shared-workspace rules:
169
169
 
170
170
  **No worktree is required or desired for non-trivial execution.**
171
171
 
172
- ### 1.5 beads-village File locking
172
+ ### 1.5 Optional file locking
173
173
 
174
- Check existing locks before touching anything:
174
+ If legacy reservations are available, inspect and reserve before editing:
175
175
 
176
176
  ```
177
177
  beads-village_reservations()
178
+ beads-village_reserve(paths=["<file1>", "<file2>"], reason="<issue-id>")
178
179
  ```
179
180
 
180
- Lock the files in scope:
181
-
182
- ```
183
- beads-village_reserve(
184
- paths=["<file1>", "<file2>"],
185
- reason="<issue-id>"
186
- )
187
- ```
188
-
189
- Locks auto-release when `beads-village_done` is called.
181
+ If reservations are not available, use explicit `files_in_scope`, `git status`, and handoff discipline as the coordination primitive instead of blocking execution.
190
182
 
191
183
  ---
192
184
 
@@ -267,7 +259,7 @@ Work one packet at a time. Complete fully before starting the next.
267
259
 
268
260
  ### Rules
269
261
 
270
- - Only touch files declared in `files_in_scope` and reserved via `beads-village_reserve`
262
+ - Only touch files declared in `files_in_scope`; if legacy reservations are available, reserve them before editing
271
263
  - If implementation requires a file outside scope: **stop and escalate** — do not self-expand
272
264
  - Follow any runtime workflow override injected at session start
273
265
  - Never suppress type errors (`as any`, `@ts-ignore`, `@ts-expect-error`)
@@ -302,8 +294,12 @@ Then persist the blocker — in this exact order:
302
294
  - what was tried (approach 1 and 2)
303
295
  - exact error output from each attempt
304
296
  - current state of changed files
305
- 2. **Broadcast the blocker** so other agents don't re-claim the task:
297
+ 2. **Broadcast the blocker** so other agents do not duplicate the work:
306
298
  ```
299
+ # Preferred tracker update
300
+ br show <issue-id> --json
301
+
302
+ # Optional legacy broadcast when beads-village exists
307
303
  beads-village_msg(
308
304
  subj="<issue-id> blocked",
309
305
  body="<error summary + handoff path>",
@@ -339,7 +335,7 @@ All checks under both A and B must pass before outputting the Evidence Bundle.
339
335
 
340
336
  ### 4.2 Evidence Bundle (mandatory output)
341
337
 
342
- Before calling `beads-village_done`, output this block verbatim:
338
+ Before closing the active tracked issue, output this block verbatim:
343
339
 
344
340
  ```
345
341
  ## Evidence Bundle
@@ -369,24 +365,26 @@ If any check in A or B fails: do **not** output the bundle — return to Phase 3
369
365
 
370
366
  ## Phase 5 — Close & Sync
371
367
 
372
- ### 5.1 beads-village — Close execution loop
368
+ ### 5.1 Close execution loop
373
369
 
370
+ ```bash
371
+ br close <issue-id> --reason "Completed" --json
374
372
  ```
375
- beads-village_done(
376
- id="<issue-id>",
377
- msg="<what was done, key files touched, any notable decisions>"
378
- )
379
- ```
380
373
 
381
- This closes the execution loop and auto-releases all file locks.
374
+ If optional legacy reservations were used, release or let them expire after completion.
375
+
376
+ ### 5.2 Sync tracker state
377
+
378
+ After close, sync `.beads/` state so the shared workspace reflects the latest tracker data:
382
379
 
383
- ### 5.2 bd — Control plane sync
380
+ ```bash
381
+ br sync --flush-only
382
+ ```
384
383
 
385
- After done, sync state so other agents see the update:
384
+ Optional legacy broadcast when the MCP exists:
386
385
 
387
386
  ```
388
- beads-village_sync() # push git-backed state to remote
389
- beads-village_msg( # optional: broadcast if blocking others
387
+ beads-village_msg(
390
388
  subj="<issue-id> done",
391
389
  body="<summary>",
392
390
  global=true, to="all"
@@ -406,7 +404,7 @@ git push # publish shared-checkout updates after verific
406
404
  If a session ends before the task is complete, run `/handoff` — see `command/handoff.md` for the full procedure.
407
405
 
408
406
  Rules specific to mid-task handoff:
409
- - **Do not** call `beads-village_done` — leave the issue open so the next session can claim it
407
+ - **Do not** call `br close` — leave the issue open so the next session can continue it
410
408
  - The shared workspace state stays intact for continuation
411
409
 
412
410
  ---
@@ -414,13 +412,13 @@ Rules specific to mid-task handoff:
414
412
  ## Guardrails
415
413
 
416
414
  **Always:**
417
- - Phase 1 (bd issue + shared-workspace checks) before any **non-trivial** code change
415
+ - Phase 1 (tracked issue + shared-workspace checks) before any **non-trivial** code change
418
416
  - Output Evidence Bundle before closing
419
417
  - Work one packet at a time
420
418
  - Stay inside reserved file scope
421
419
 
422
420
  **Never:**
423
- - Execute non-trivial work without a bd issue
421
+ - Execute non-trivial work without a tracked issue when `br` is available
424
422
  - Create a git worktree or per-task branch for routine non-trivial execution unless the user explicitly asks for it
425
423
  - Suppress type errors (`as any`, `@ts-ignore`)
426
424
  - Silently expand scope beyond `files_in_scope`