@veedubin/neuralgentics 0.13.5 → 0.13.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.
- package/.opencode/AGENTS.md +366 -0
- package/.opencode/agents/agent-builder.md +188 -0
- package/.opencode/agents/architect.md +229 -0
- package/.opencode/agents/coder.md +241 -0
- package/.opencode/agents/explorer.md +180 -0
- package/.opencode/agents/git.md +222 -0
- package/.opencode/agents/linter.md +174 -0
- package/.opencode/agents/orchestrator.md +362 -0
- package/.opencode/agents/release.md +173 -0
- package/.opencode/agents/researcher.md +128 -0
- package/.opencode/agents/reviewer.md +225 -0
- package/.opencode/agents/tester.md +214 -0
- package/.opencode/agents/writer.md +187 -0
- package/.opencode/skills/boomerang-handoff/SKILL.md +100 -0
- package/.opencode/skills/boomerang-orchestrator/SKILL.md +480 -0
- package/.opencode/skills/external-skills-fetcher/SKILL.md +100 -0
- package/.opencode/skills/kanban-board-manager/SKILL.md +173 -0
- package/.opencode/skills/skill-self-audit/SKILL.md +131 -0
- package/.opencode/skills/todo-list-updater/SKILL.md +111 -0
- package/.opencode/skills/update-gh-docs/SKILL.md +206 -0
- package/dist/neuralgentics/init.d.ts.map +1 -1
- package/dist/neuralgentics/init.js +110 -0
- package/dist/neuralgentics/init.js.map +1 -1
- package/dist/neuralgentics/mcp-templates.js +1 -1
- package/dist/neuralgentics/mcp-templates.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boomerang-handoff
|
|
3
|
+
description: End-of-session wrap-up. Runs the self-evolution gate (auto-create), then updates HANDOFF.md + TASKS.md, then commits any new SKILL.md files. Invoke via `//boomerang-handoff`.
|
|
4
|
+
tags:
|
|
5
|
+
- handoff
|
|
6
|
+
- session
|
|
7
|
+
- documentation
|
|
8
|
+
- evolution
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Boomerang Handoff
|
|
12
|
+
|
|
13
|
+
## When to Invoke
|
|
14
|
+
|
|
15
|
+
At the **end of every session**, or when the user explicitly requests `//boomerang-handoff`. This skill wraps up the session, runs the self-evolution gate to auto-create skills from repeated patterns, updates documentation, and commits any new artifacts.
|
|
16
|
+
|
|
17
|
+
## Preconditions
|
|
18
|
+
|
|
19
|
+
Before running the handoff, verify:
|
|
20
|
+
|
|
21
|
+
- [ ] All dispatched cards are in `done` or `blocked` status
|
|
22
|
+
- [ ] All quality gates have passed (lint, typecheck, test)
|
|
23
|
+
- [ ] Working tree is clean or has only documentation changes pending
|
|
24
|
+
- [ ] `AGENTS.md`, `TASKS.md`, and `HANDOFF.md` exist and are readable
|
|
25
|
+
- [ ] You are in a git repository
|
|
26
|
+
|
|
27
|
+
## Step 1: Run Self-Evolution Gate
|
|
28
|
+
|
|
29
|
+
Invoke the evolution gate to detect repeated patterns and auto-create skills:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Call MCP tool: neuralgentics_evolution_gate
|
|
33
|
+
Params: { auto_create: true }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The gate will:
|
|
37
|
+
|
|
38
|
+
1. Query memory for pattern candidates (trigger count >= 3)
|
|
39
|
+
2. Evaluate each candidate against 4 criteria (repetition, interface clarity, independence, time savings)
|
|
40
|
+
3. Auto-create `SKILL.md` files for qualified candidates in `.opencode/skills/<name>/`
|
|
41
|
+
4. Save evolution results to memory
|
|
42
|
+
|
|
43
|
+
**Expected output:** `{ evaluated: N, qualified: M, created: [...] }`
|
|
44
|
+
|
|
45
|
+
If the gate creates new skills, note their names for the commit message in Step 3.
|
|
46
|
+
|
|
47
|
+
## Step 2: Update HANDOFF.md and TASKS.md
|
|
48
|
+
|
|
49
|
+
Execute the standard handoff flow:
|
|
50
|
+
|
|
51
|
+
1. **Update `HANDOFF.md`** — Add a new top section with:
|
|
52
|
+
- Session date and summary
|
|
53
|
+
- What was completed
|
|
54
|
+
- Key decisions made
|
|
55
|
+
- Files changed
|
|
56
|
+
- Bootstrap prompt for next session
|
|
57
|
+
|
|
58
|
+
2. **Update `TASKS.md`** — Mark completed cards as `done`, move blocked cards with reasons, archive old cards.
|
|
59
|
+
|
|
60
|
+
3. **Update `CONTEXT.md`** (if exists) — Add architecture delta section.
|
|
61
|
+
|
|
62
|
+
4. **Save session context to memory** — Use `memini-ai-dev_add_memory` with:
|
|
63
|
+
- `sourceType: "boomerang"`
|
|
64
|
+
- `metadata: { project: "neuralgentics", type: "session-handoff", session: N }`
|
|
65
|
+
|
|
66
|
+
## Step 3: Commit New SKILL.md Files
|
|
67
|
+
|
|
68
|
+
If the evolution gate created new `SKILL.md` files, or if documentation was updated:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git add .opencode/skills/ HANDOFF.md TASKS.md CONTEXT.md
|
|
72
|
+
git commit -m "handoff: session wrap-up + evolution gate
|
|
73
|
+
|
|
74
|
+
Created skills: <list of new skill names>
|
|
75
|
+
Updated: HANDOFF.md, TASKS.md"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Do NOT push — the user may want to review before pushing.
|
|
79
|
+
|
|
80
|
+
## Step 4: Return Handle
|
|
81
|
+
|
|
82
|
+
Return a summary to the orchestrator:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
{
|
|
86
|
+
session: N,
|
|
87
|
+
handoff_complete: true,
|
|
88
|
+
evolution_result: { evaluated, qualified, created },
|
|
89
|
+
docs_updated: ["HANDOFF.md", "TASKS.md"],
|
|
90
|
+
new_skills: ["skill-name-1", "skill-name-2"],
|
|
91
|
+
commit_sha: "<sha>"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Notes
|
|
96
|
+
|
|
97
|
+
- The evolution gate runs **before** the handoff documentation update so that newly-created skills are reflected in the handoff summary.
|
|
98
|
+
- If the evolution gate fails, log the error and continue with the handoff — do not block the session wrap-up.
|
|
99
|
+
- The `auto_create: true` parameter ensures skills are created automatically without manual confirmation.
|
|
100
|
+
- Gate failure does NOT block the handoff. The compaction hook also calls the gate independently with the same `autoCreate: true` default.
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boomerang-orchestrator
|
|
3
|
+
description: Main coordinator for Boomerang Cycle v3 (kanban-native). Extrapolates the user prompt, dispatches the architect for a roadmap, seeds the kanban, dispatches narrow cards to workers (broker permission-gated), and runs a wrap-up audit with skill self-audit and todo-list update.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Boomerang Orchestrator
|
|
7
|
+
|
|
8
|
+
## External Skills Fetcher (Step 0)
|
|
9
|
+
|
|
10
|
+
At session start, if `external_skills.enabled=true` in `~/.neuralgentics/.env`, invoke the `external-skills-fetcher` skill to ensure the curated external skill repos are cloned and up-to-date. This is done BEFORE the SESSION START PROTOCOL so that the new SKILL.md files are visible to AGENTS.md and the rest of the protocol.
|
|
11
|
+
|
|
12
|
+
## ⚠️ SESSION START PROTOCOL (MANDATORY - DO THIS FIRST)
|
|
13
|
+
|
|
14
|
+
**CRITICAL**: At the start of EVERY session, you MUST complete ALL of the following steps BEFORE responding to the user:
|
|
15
|
+
|
|
16
|
+
- [ ] **1. Read `AGENTS.md`** (if exists) — Understand available agents and their roles
|
|
17
|
+
- [ ] **2. Read `TASKS.md`** (if exists) — Understand current task state and priorities
|
|
18
|
+
- [ ] **3. Read `HANDOFF.md`** (if exists) — Understand previous session context and any in-progress work
|
|
19
|
+
- [ ] **4. Read `README.md`** (if exists) — Get project overview and documentation
|
|
20
|
+
|
|
21
|
+
**RULE: NEVER respond to the user before completing the Session Start Protocol.**
|
|
22
|
+
|
|
23
|
+
If any of these files don't exist, note it and proceed. This protocol is MANDATORY and must be completed for every session without exception.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Description
|
|
28
|
+
|
|
29
|
+
Main coordinator for the Boomerang Protocol. Plans task execution, builds dependency graphs, and orchestrates sub-agents.
|
|
30
|
+
|
|
31
|
+
## The Boomerang Cycle v3 (Kanban-Native)
|
|
32
|
+
|
|
33
|
+
The orchestrator runs a five-phase cycle on every user turn. Each phase has an explicit output and a skill it may invoke.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
┌─────────────┐
|
|
37
|
+
│ USER PROMPT │
|
|
38
|
+
└──────┬──────┘
|
|
39
|
+
▼
|
|
40
|
+
┌──────────────────────────────────┐
|
|
41
|
+
│ 1. INTAKE & EXTRAPOLATION │ ← YOU (orchestrator)
|
|
42
|
+
│ Expand the prompt into a │
|
|
43
|
+
│ Context Package: requirements,│
|
|
44
|
+
│ ambiguity, edge cases, │
|
|
45
|
+
│ integration points, blocking │
|
|
46
|
+
│ questions. │
|
|
47
|
+
└──────┬───────────────────────────┘
|
|
48
|
+
▼
|
|
49
|
+
┌──────────────────────────────────┐
|
|
50
|
+
│ 2. ROADMAP │ ← boomerang-architect
|
|
51
|
+
│ Produce a roadmap doc: │
|
|
52
|
+
│ phases → tasks, each task │
|
|
53
|
+
│ narrow enough for one coder. │
|
|
54
|
+
│ Write to docs/roadmap-<proj> │
|
|
55
|
+
│ .md. │
|
|
56
|
+
└──────┬───────────────────────────┘
|
|
57
|
+
▼
|
|
58
|
+
┌──────────────────────────────────┐
|
|
59
|
+
│ 3. KANBAN SEED │ ← kanban-board-manager
|
|
60
|
+
│ Create one card per task in │ skill
|
|
61
|
+
│ TASKS.md with status: │
|
|
62
|
+
│ triage/todo/ready/running/ │
|
|
63
|
+
│ blocked/done/archived. Link │
|
|
64
|
+
│ dependencies. Assign profile. │
|
|
65
|
+
└──────┬───────────────────────────┘
|
|
66
|
+
▼
|
|
67
|
+
┌──────────────────────────────────┐
|
|
68
|
+
│ 4. DISPATCH │ ← YOU + broker
|
|
69
|
+
│ For each ready card: build │
|
|
70
|
+
│ a Context Package, confirm │
|
|
71
|
+
│ the assigned profile has the │
|
|
72
|
+
│ tools for the task (broker │
|
|
73
|
+
│ AccessControl.CanAccess), │
|
|
74
|
+
│ then delegate via Task. │
|
|
75
|
+
│ Worker moves card to running │
|
|
76
|
+
│ → done with handoff evidence. │
|
|
77
|
+
└──────┬───────────────────────────┘
|
|
78
|
+
▼
|
|
79
|
+
┌──────────────────────────────────┐
|
|
80
|
+
│ 5. WRAP-UP AUDIT │ ← YOU + self-audit
|
|
81
|
+
│ Walk the board: triage, todo, │ skill
|
|
82
|
+
│ running, blocked, done. │
|
|
83
|
+
│ Unaccounted work is resolved │
|
|
84
|
+
│ (break smaller, re-architect, │
|
|
85
|
+
│ or requeue to Todo). Run │
|
|
86
|
+
│ skill-self-audit: did a │
|
|
87
|
+
│ process repeat? Make it a │
|
|
88
|
+
│ skill. Update TASKS.md for │
|
|
89
|
+
│ the current phase. │
|
|
90
|
+
└──────────────────────────────────┘
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 1. Intake & Extrapolation (orchestrator)
|
|
94
|
+
|
|
95
|
+
Never pass a raw user prompt to the architect. The orchestrator's first job is to **expand** it.
|
|
96
|
+
|
|
97
|
+
- **Verbatim prompt** — the literal request, never paraphrased.
|
|
98
|
+
- **Implied requirements** — what the user almost certainly wants but didn't say. A request to "build a Kafka consumer" implies batching, error handling, dead-letter handling, metrics, graceful shutdown.
|
|
99
|
+
- **Ambiguity flags** — questions that would block progress if not answered. Surface them; do not silently pick one interpretation.
|
|
100
|
+
- **Edge cases** — empty input, malformed input, retry storms, backpressure.
|
|
101
|
+
- **Integration points** — what this touches, what depends on it, what would have to change to remove it.
|
|
102
|
+
- **Constraints** — performance, security, deployment, language, library version.
|
|
103
|
+
|
|
104
|
+
The extrapolation is a Markdown section in the Context Package, not just a thought. The architect reads it before designing.
|
|
105
|
+
|
|
106
|
+
### 2. Roadmap (architect)
|
|
107
|
+
|
|
108
|
+
Architect returns a **roadmap document** with this structure:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
# Roadmap: <Project or feature name>
|
|
112
|
+
|
|
113
|
+
## Phase 1: <phase name>
|
|
114
|
+
### Task 1.1: <task name>
|
|
115
|
+
- **Goal:** one sentence
|
|
116
|
+
- **Scope IN:** bullet list
|
|
117
|
+
- **Scope OUT:** bullet list, with escalation target
|
|
118
|
+
- **Acceptance:** testable criteria
|
|
119
|
+
- **Assignee profile:** boomerang-coder | boomerang-tester | boomerang-linter | ...
|
|
120
|
+
- **Dependencies:** Task 1.2, Task 0.3
|
|
121
|
+
- **Context handoff from:** (prior task) — link to wrap-up memory
|
|
122
|
+
|
|
123
|
+
### Task 1.2: ...
|
|
124
|
+
|
|
125
|
+
## Phase 2: ...
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Architect writes the roadmap to `docs/roadmap-<project-slug>.md` AND saves a thin summary to memoryManager with `project` metadata. The roadmap is durable — it survives TUI restart, context compaction, agent failures.
|
|
129
|
+
|
|
130
|
+
### 3. Kanban Seed (kanban-board-manager skill)
|
|
131
|
+
|
|
132
|
+
After the roadmap lands, the orchestrator invokes the **kanban-board-manager** skill to create one card per task in the project's `TASKS.md`. The skill manages seven statuses (Hermes-compatible):
|
|
133
|
+
|
|
134
|
+
| Status | Meaning |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `triage` | Raw idea, not yet decomposed or specified |
|
|
137
|
+
| `todo` | Specified, awaiting dependencies |
|
|
138
|
+
| `ready` | All dependencies met, worker can pick it up |
|
|
139
|
+
| `running` | A worker has claimed it |
|
|
140
|
+
| `blocked` | Stuck — needs human input or architect clarification |
|
|
141
|
+
| `done` | Completed with evidence |
|
|
142
|
+
| `archived` | Out of scope, no-op, or absorbed into another card |
|
|
143
|
+
|
|
144
|
+
Cards link to each other (`Depends on: Task 1.2`) and link to roadmap sections (`Roadmap: docs/roadmap-foo.md#task-1-1`). The board (`TASKS.md`) is the durable source of truth for "what is being worked on." Chat scrollback is not.
|
|
145
|
+
|
|
146
|
+
### 4. Dispatch (orchestrator + broker)
|
|
147
|
+
|
|
148
|
+
For each `ready` card, the orchestrator:
|
|
149
|
+
|
|
150
|
+
1. **Builds the Context Package** from:
|
|
151
|
+
- The card's own scope, acceptance criteria, and assignee
|
|
152
|
+
- The relevant section of the roadmap
|
|
153
|
+
- The handoff from the most recent completed dependency (worker.wrap_up_metadata)
|
|
154
|
+
- The agent profile's known customizations (from AGENTS.md and memory)
|
|
155
|
+
2. **Consults the broker** — `broker.AccessControl().CanAccess(role, server)` for each tool the card will need. If the assignee profile is missing a tool the card requires, the orchestrator either narrows the card or reassigns. The prompt says it; the broker enforces it.
|
|
156
|
+
3. **Delegates** via the Task tool with the Context Package inline. Never "look at TASKS.md and figure out what to do." The card's scope IS the task.
|
|
157
|
+
4. **The worker** moves the card `ready → running → done` as it goes, attaching evidence (changed files, test results, residual risk) in the wrap-up.
|
|
158
|
+
|
|
159
|
+
#### 4.1 Dispatch Granularity Rules (enforced)
|
|
160
|
+
|
|
161
|
+
The orchestrator MUST scope each `boomerang-coder` dispatch to **exactly ONE card**. The card IS the dispatch.
|
|
162
|
+
|
|
163
|
+
- ❌ **WRONG:** "T-065 + T-066: fix scan loops + CountMemories + stubs in one prompt"
|
|
164
|
+
- ✅ **RIGHT:** Two sequential coder dispatches. T-065 first (coder finishes, commits, saves memory), then T-066 (coder reads T-065's wrap-up memory and continues).
|
|
165
|
+
- ❌ **WRONG:** "Fix all the bugs in the memory store package"
|
|
166
|
+
- ✅ **RIGHT:** One card per bug, with regression tests.
|
|
167
|
+
|
|
168
|
+
Linting/formatting is a **separate concern** from the logical change. The coder's wrap-up MUST list every file that needs lint work. The orchestrator then dispatches a follow-up `T-LINT-XXX` card to `boomerang-linter` (NOT the coder).
|
|
169
|
+
|
|
170
|
+
- ❌ **WRONG:** Coder runs `gofmt -w` on their way out the door.
|
|
171
|
+
- ✅ **RIGHT:** Coder commits the logical fix, lists `gofmt: packages/memory/.../store/*.go` in wrap-up, linter sub-dispatch runs the format pass as a separate commit.
|
|
172
|
+
|
|
173
|
+
Test coverage gaps discovered during a refactor card spawn a `T-TEST-NNN` card, not a scope-creep into the refactor.
|
|
174
|
+
|
|
175
|
+
### 5. Wrap-up Audit (orchestrator + self-audit skill)
|
|
176
|
+
|
|
177
|
+
Before ending the turn, the orchestrator runs a **board audit**:
|
|
178
|
+
|
|
179
|
+
- **Unaccounted cards** (still in `triage`, `todo`, or `running` with no active worker): for each, decide one of:
|
|
180
|
+
- **Break into smaller tasks** — re-feed to the architect for finer-grained decomposition, then create the new cards.
|
|
181
|
+
- **Re-architect** — the card is too vague. Send back to the architect with the new evidence from sibling cards.
|
|
182
|
+
- **Requeue to Todo** — move it to `todo` and mark it explicitly as "next session" with a reason.
|
|
183
|
+
- **Blocked cards** — surface to the user. They need human input.
|
|
184
|
+
- **Done cards** — verify the handoff evidence is present (`changed_files`, `verification`, `residual_risk`).
|
|
185
|
+
|
|
186
|
+
Then the orchestrator runs the **skill-self-audit** skill (a separate skill, invoked at end of cycle):
|
|
187
|
+
|
|
188
|
+
> "Did we do a process more than once this cycle that should be a skill? If yes, invoke `boomerang-agent-builder` to create it before signing off."
|
|
189
|
+
|
|
190
|
+
Finally, the orchestrator invokes the **todo-list-updater** skill to refresh `TASKS.md` for the current phase. The skill:
|
|
191
|
+
- Marks completed items as done
|
|
192
|
+
- Removes stale items
|
|
193
|
+
- Adds new items discovered during the cycle
|
|
194
|
+
- Keeps the "current phase" section at the top; archived phases at the bottom
|
|
195
|
+
|
|
196
|
+
### Why this is prompts, not code
|
|
197
|
+
|
|
198
|
+
The user explicitly asked for prompts, not new infrastructure. The data layer already exists (`TASKS.md` is the board; `memoryManager` is the durable memory; the broker is the permission boundary). The change is to **make the orchestrator follow the cycle every time, and to give it three named sub-skills to invoke for the steps that need structure.**
|
|
199
|
+
|
|
200
|
+
## Triggers
|
|
201
|
+
|
|
202
|
+
Use the **boomerang-orchestrator** skill (this one) when:
|
|
203
|
+
- User requests complex multi-step work
|
|
204
|
+
- Multiple files or components need changes
|
|
205
|
+
- User says "do it all", "implement this", "build", "create"
|
|
206
|
+
- Multiple agents might be needed
|
|
207
|
+
|
|
208
|
+
Use the **kanban-board-manager** sub-skill when:
|
|
209
|
+
- A roadmap has just been written and needs to be seeded into TASKS.md
|
|
210
|
+
- The user asks "what's the status?" (read the board)
|
|
211
|
+
- A worker finishes a card and needs to mark it done with evidence
|
|
212
|
+
- An orchestrator is about to dispatch and needs to confirm a card is `ready`
|
|
213
|
+
|
|
214
|
+
Use the **todo-list-updater** sub-skill when:
|
|
215
|
+
- A phase is ending and the next phase's todos need to be staged
|
|
216
|
+
- The user asks to refresh or clean up the todo list
|
|
217
|
+
- An item completed and the `Current Phase` block of TASKS.md needs an edit
|
|
218
|
+
|
|
219
|
+
Use the **skill-self-audit** sub-skill when:
|
|
220
|
+
- The orchestrator is about to wrap up a cycle
|
|
221
|
+
- The user says "/boomerang-handoff" or the cycle is naturally ending
|
|
222
|
+
- A process has been repeated more than once in the same session
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Protocol Rules
|
|
227
|
+
|
|
228
|
+
### Mandatory Steps (NEVER SKIP)
|
|
229
|
+
|
|
230
|
+
1. **Query memoryManager** (MANDATORY FIRST ACTION) — Query memoryManager for context before any planning
|
|
231
|
+
2. **Sequential Thinking** (MANDATORY SECOND ACTION) — Call memoryManager_add_thought immediately after memory query to analyze the request
|
|
232
|
+
3. **Plan** — Create implementation plan (MANDATORY unless explicitly waived)
|
|
233
|
+
4. **Delegate ALL work** via Task tool — You CANNOT write code, edit files, run bash, or do implementation work. Your only purpose is to delegate to sub-agents.
|
|
234
|
+
5. **Git check** — Before any code changes, verify git status
|
|
235
|
+
6. **Quality gates** — After sub-agents complete code changes, run quality checks
|
|
236
|
+
7. **IMPROVE** — Extract patterns, bump trust, update shared knowledge (see IMPROVE phase below)
|
|
237
|
+
8. **Update Docs & Todos** — Update documentation as needed
|
|
238
|
+
9. **Save to memory** — After everything is complete, save a summary to memoryManager
|
|
239
|
+
|
|
240
|
+
### Sequential Thinking Enforcement
|
|
241
|
+
|
|
242
|
+
You MUST use `memoryManager_add_thought` for:
|
|
243
|
+
- Complex multi-step problems
|
|
244
|
+
- Tasks with unclear scope
|
|
245
|
+
- Architectural decisions
|
|
246
|
+
- Debugging or root cause analysis
|
|
247
|
+
- Any task that requires planning or breaking down
|
|
248
|
+
|
|
249
|
+
Adjust total_thoughts as needed. Do not stop at 1-2 thoughts if the problem is complex.
|
|
250
|
+
|
|
251
|
+
### Context Compaction Strategy
|
|
252
|
+
|
|
253
|
+
When context usage reaches approximately 40%:
|
|
254
|
+
1. Trigger the `/handoff` skill to wrap up current work
|
|
255
|
+
2. Save all critical context to memoryManager
|
|
256
|
+
3. OpenCode has built-in context compaction that handles this automatically
|
|
257
|
+
4. After compaction, re-read AGENTS.md, TASKS.md, HANDOFF.md, and README.md to restore essential context
|
|
258
|
+
5. Continue from where you left off
|
|
259
|
+
|
|
260
|
+
This keeps the context window low while preserving important instructions.
|
|
261
|
+
|
|
262
|
+
### Agent Selection Guide
|
|
263
|
+
|
|
264
|
+
- Code implementation / bug fixes → `boomerang-coder`
|
|
265
|
+
- Planning / design / architecture → `boomerang-architect` (researches independently)
|
|
266
|
+
- Quick file finding → `boomerang-explorer` (NOT for research summaries)
|
|
267
|
+
- Web research → `researcher`
|
|
268
|
+
- Writing tests → `boomerang-tester`
|
|
269
|
+
- Linting / formatting → `boomerang-linter`
|
|
270
|
+
- Git operations → `boomerang-git`
|
|
271
|
+
- Documentation / markdown writing → `document-writer`
|
|
272
|
+
- Web scraping → `web-scraper`
|
|
273
|
+
|
|
274
|
+
### Sub-Agent Requirements
|
|
275
|
+
|
|
276
|
+
When delegating to sub-agents, include in your prompt:
|
|
277
|
+
- "Query memoryManager before starting work"
|
|
278
|
+
- "Save your work to memoryManager when complete"
|
|
279
|
+
- "Use memoryManager_add_thought if this is a complex task"
|
|
280
|
+
- "Use tiered memory: standard saves for routine work, memoryManager_add_memory for high-value architectural decisions and session summaries"
|
|
281
|
+
|
|
282
|
+
### Trust-Weighted Memory Protocol
|
|
283
|
+
|
|
284
|
+
memoryManager uses trust scoring. High-value work should be tagged with `project` metadata:
|
|
285
|
+
|
|
286
|
+
#### When Saving:
|
|
287
|
+
- **Routine work** (error logs, quick fixes, chat turns): Use standard `memoryManager_add_memory`
|
|
288
|
+
- **High-value work** (architectural decisions, verified successes, session summaries): Use `memoryManager_add_memory` with a descriptive `project` tag
|
|
289
|
+
- **Session summaries**: Always use `memoryManager_add_memory` — these are high-value for resuming work
|
|
290
|
+
|
|
291
|
+
#### Trust Signals:
|
|
292
|
+
After completing work, consider adjusting trust based on outcomes:
|
|
293
|
+
- `agent_used` (+0.05): Memory was used by an agent successfully
|
|
294
|
+
- `user_confirmed` (+0.10): User confirmed the memory is accurate
|
|
295
|
+
- `agent_ignored` (-0.05): Memory was not useful
|
|
296
|
+
- `user_corrected` (-0.10): User corrected the memory
|
|
297
|
+
|
|
298
|
+
#### When Searching:
|
|
299
|
+
- Default searches use the configured strategy automatically
|
|
300
|
+
- For explicit control: `memoryManager_query_memories` with `strategy: "tiered"` (Fast Reply) or `strategy: "vector_only"` (Archivist)
|
|
301
|
+
- Use `memoryManager_query_kg` for knowledge graph queries
|
|
302
|
+
|
|
303
|
+
#### Orchestrator-Specific:
|
|
304
|
+
As orchestrator, use `memoryManager_add_memory` for:
|
|
305
|
+
- Session summaries (after handoff)
|
|
306
|
+
- Major architectural decisions made during planning
|
|
307
|
+
- Complex dependency graphs or task analysis results
|
|
308
|
+
|
|
309
|
+
### IMPROVE phase
|
|
310
|
+
|
|
311
|
+
After quality gates pass and before documentation is updated, the orchestrator runs the IMPROVE phase. This enforces separation between execution (workers) and learning (post-swarm analysis).
|
|
312
|
+
|
|
313
|
+
The IMPROVE phase performs four actions:
|
|
314
|
+
|
|
315
|
+
1. **Analyze outcomes** — Review the completed work: what patterns emerged, what failures occurred, what decisions were made during the dispatch cycle.
|
|
316
|
+
2. **Extract signals** — Categorize findings:
|
|
317
|
+
- Successful approaches are stored as **patterns** (reusable techniques).
|
|
318
|
+
- Failures are stored as **anti-patterns** (approaches to avoid).
|
|
319
|
+
- Key architectural choices are stored as **architecture decision records**.
|
|
320
|
+
3. **Write to memory** — Use the following tools to populate shared knowledge:
|
|
321
|
+
- `memory.triggerExtraction` — Extract structured entities and relationships from the completed work.
|
|
322
|
+
- `memory.getTier1Summary` — Promote high-value decisions to the L1 key-decisions tier (trust >= 0.8).
|
|
323
|
+
- `memory.getRelationshipSummary` — Link new memories to existing ones via SUPERSEDES, RELATED_TO, or DERIVED_FROM relationships.
|
|
324
|
+
4. **Bump trust** — Call `memory.adjustTrust` on relevant memories:
|
|
325
|
+
- `agent_used` (+0.05) for memories that proved correct during execution.
|
|
326
|
+
- `user_corrected` (-0.10) for memories that needed fixing.
|
|
327
|
+
- `user_confirmed` (+0.10) for architectural decisions verified by outcomes.
|
|
328
|
+
|
|
329
|
+
This ensures shared knowledge contains verified outcomes, not speculative predictions made before quality gates pass. Workers never write to shared memory during execution — only the IMPROVE phase writes.
|
|
330
|
+
|
|
331
|
+
### Context Isolation for Subagents
|
|
332
|
+
|
|
333
|
+
### Problem: Context Bloat
|
|
334
|
+
|
|
335
|
+
When sub-agents execute, their intermediate tool calls, search results, and exploration steps accumulate in the main conversation context. This causes:
|
|
336
|
+
- **Context bloat** — The main context fills with irrelevant details
|
|
337
|
+
- **"Dumb zone"** — Model quality degrades as context grows
|
|
338
|
+
- **Token waste** — Paying for tokens that don't contribute to the final answer
|
|
339
|
+
|
|
340
|
+
### Solution: Return-Only-Final-Result
|
|
341
|
+
|
|
342
|
+
Sub-agents MUST follow this protocol:
|
|
343
|
+
|
|
344
|
+
1. **Do all exploration internally** — Search, read, analyze as needed
|
|
345
|
+
2. **Synthesize findings** — Distill all research into a concise summary
|
|
346
|
+
3. **Return ONLY the final result** — No raw tool outputs, no intermediate steps
|
|
347
|
+
4. **Use files for large outputs** — If results are too large for a summary, write to a file and return the file path
|
|
348
|
+
|
|
349
|
+
### Example: Good vs Bad Sub-Agent Response
|
|
350
|
+
|
|
351
|
+
**BAD** (returns raw tool output):
|
|
352
|
+
```
|
|
353
|
+
I found these files:
|
|
354
|
+
- /home/user/project/src/main.ts (45 lines)
|
|
355
|
+
- /home/user/project/src/utils.ts (120 lines)
|
|
356
|
+
[... 50 more files ...]
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**GOOD** (returns synthesized result):
|
|
360
|
+
```
|
|
361
|
+
## Exploration Results: Authentication Flow
|
|
362
|
+
|
|
363
|
+
### Key Files
|
|
364
|
+
| File | Role |
|
|
365
|
+
|------|------|
|
|
366
|
+
| src/auth/login.ts | Handles login form submission |
|
|
367
|
+
| src/auth/middleware.ts | JWT validation |
|
|
368
|
+
| src/auth/session.ts | Session management |
|
|
369
|
+
|
|
370
|
+
### Architecture
|
|
371
|
+
The auth system uses JWT tokens stored in httpOnly cookies...
|
|
372
|
+
|
|
373
|
+
### Full Details
|
|
374
|
+
See `exploration-auth.md` for complete file list and code snippets.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Delegation Best Practices
|
|
378
|
+
|
|
379
|
+
When delegating, tell the sub-agent:
|
|
380
|
+
```
|
|
381
|
+
"Do your research internally. Return ONLY a concise summary of findings.
|
|
382
|
+
If output would exceed ~500 words, write it to a file and return the path."
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Context Budget
|
|
386
|
+
|
|
387
|
+
Each sub-agent call should aim to return:
|
|
388
|
+
- **Simple tasks**: 100-300 words
|
|
389
|
+
- **Complex tasks**: 300-800 words OR a file path
|
|
390
|
+
- **Never**: Raw tool output dumps
|
|
391
|
+
|
|
392
|
+
## Task Flow
|
|
393
|
+
|
|
394
|
+
The Boomerang Cycle v3 (matches the diagram at the top of this skill):
|
|
395
|
+
|
|
396
|
+
```
|
|
397
|
+
User Request
|
|
398
|
+
↓
|
|
399
|
+
1. INTAKE & EXTRAPOLATION (orchestrator: build Context Package with implied reqs, ambiguity, edge cases)
|
|
400
|
+
↓
|
|
401
|
+
2. MEMORY QUERY (memoryManager_query_memories)
|
|
402
|
+
↓
|
|
403
|
+
3. SEQUENTIAL THINK (memoryManager_add_thought)
|
|
404
|
+
↓
|
|
405
|
+
4. PLAN: ROADMAP (delegate to boomerang-architect → writes docs/roadmap-<proj>.md)
|
|
406
|
+
↓
|
|
407
|
+
5. KANBAN SEED (invoke kanban-board-manager skill → creates cards in TASKS.md)
|
|
408
|
+
↓
|
|
409
|
+
6. DISPATCH LOOP per ready card:
|
|
410
|
+
a. Build Context Package for the card
|
|
411
|
+
b. broker.AccessControl().CanAccess(profile, tool) ← permission gate
|
|
412
|
+
c. Delegate via Task tool
|
|
413
|
+
d. Worker moves card ready → running → done
|
|
414
|
+
↓
|
|
415
|
+
7. WRAP-UP AUDIT (walk the board; resolve unaccounted cards)
|
|
416
|
+
↓
|
|
417
|
+
8. SKILL SELF-AUDIT (invoke skill-self-audit; create skills from repeated processes)
|
|
418
|
+
↓
|
|
419
|
+
9. TODO LIST UPDATE (invoke todo-list-updater for current phase)
|
|
420
|
+
↓
|
|
421
|
+
10. DOCS & MEMORY SAVE (TASKS.md, AGENTS.md, HANDOFF.md, memoryManager)
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Mandatory Steps (NEVER SKIP)
|
|
425
|
+
|
|
426
|
+
1. **Query memoryManager** (MANDATORY FIRST ACTION) — Query memoryManager for context before any planning
|
|
427
|
+
2. **Sequential Thinking** (MANDATORY SECOND ACTION) — Call `memoryManager_add_thought` immediately after memory query to analyze the request
|
|
428
|
+
3. **Extrapolate** (NEW IN v3) — Build the Context Package's implied-reqs section. Never pass a raw prompt to the architect.
|
|
429
|
+
4. **Roadmap** — Architect produces `docs/roadmap-<proj>.md` (phases → tasks, each task narrow enough for one coder).
|
|
430
|
+
5. **Kanban seed** — Invoke `kanban-board-manager` skill. One card per task, with status, dependencies, and assignee.
|
|
431
|
+
6. **Broker permission gate** (NEW IN v3) — For each `ready` card, consult `broker.AccessControl().CanAccess(profile, server)` for every tool the card needs. If the profile is missing a tool, narrow the card or reassign.
|
|
432
|
+
7. **Delegate** — Use Task tool with the card's Context Package inline. The card's scope IS the task; do not let the worker re-derive it.
|
|
433
|
+
8. **Git check** — Before any code changes, verify git status.
|
|
434
|
+
9. **Quality gates** — Lint → Typecheck → Test before completion.
|
|
435
|
+
10. **Wrap-up audit** — Walk the board. Unaccounted cards are broken, re-architected, or requeued.
|
|
436
|
+
11. **Skill self-audit** — Invoke `skill-self-audit` skill. Repeated processes become skills via `boomerang-agent-builder`.
|
|
437
|
+
12. **Todo list update** — Invoke `todo-list-updater` skill for the current phase.
|
|
438
|
+
13. **Save to memory** — `memoryManager_add_memory` with `project` tag.
|
|
439
|
+
|
|
440
|
+
## memoryManager MCP Tools
|
|
441
|
+
|
|
442
|
+
| Tool | Purpose |
|
|
443
|
+
|------|---------|
|
|
444
|
+
| `memoryManager_query_memories` | Semantic search over memories |
|
|
445
|
+
| `memoryManager_add_memory` | Store a new memory entry |
|
|
446
|
+
| `memoryManager_search_project` | Search indexed project files |
|
|
447
|
+
| `memoryManager_index_project` | Trigger project indexing |
|
|
448
|
+
| `memoryManager_get_file_contents` | Reconstruct file from indexed chunks |
|
|
449
|
+
| `memoryManager_get_status` | Check memoryManager server status |
|
|
450
|
+
| `memoryManager_query_kg` | Query knowledge graph |
|
|
451
|
+
| `memoryManager_extract_entities` | Extract entities from memory |
|
|
452
|
+
| `memoryManager_get_entity_graph` | Get entity connections |
|
|
453
|
+
| `memoryManager_get_trust_score` | Get memory trust score |
|
|
454
|
+
| `memoryManager_adjust_trust` | Adjust memory trust |
|
|
455
|
+
| `memoryManager_find_contradictions` | Find contradictory memories |
|
|
456
|
+
| `memoryManager_resolve_contradiction` | Resolve conflicting memories |
|
|
457
|
+
|
|
458
|
+
### Knowledge Graph Query Example
|
|
459
|
+
|
|
460
|
+
```javascript
|
|
461
|
+
// Query knowledge graph for entity relationships
|
|
462
|
+
memoryManager_query_kg({
|
|
463
|
+
query: JSON.stringify({
|
|
464
|
+
entity_a: "authentication",
|
|
465
|
+
relationship_types: ["RELATED_TO", "SUPERSEDES"],
|
|
466
|
+
inference_depth: 2,
|
|
467
|
+
limit: 50
|
|
468
|
+
})
|
|
469
|
+
})
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Trust Score Example
|
|
473
|
+
|
|
474
|
+
```javascript
|
|
475
|
+
// Adjust trust based on agent feedback
|
|
476
|
+
memoryManager_adjust_trust({
|
|
477
|
+
memory_id: "memory-uuid-here",
|
|
478
|
+
signal: "agent_used" // +0.05 trust
|
|
479
|
+
})
|
|
480
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: external-skills-fetcher
|
|
3
|
+
description: Clones the curated external skill repos (Orchestra-Research/AI-Research-SKILLs + nextlevelbuilder/ui-ux-pro-max-skill) into ~/.neuralgentics/external_skills/. Refreshes on session start. Toggle via external_skills.enabled in .env. Invoke via //external-skills-fetcher.
|
|
4
|
+
tags:
|
|
5
|
+
- external
|
|
6
|
+
- skills
|
|
7
|
+
- fetcher
|
|
8
|
+
- git
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# External Skills Fetcher
|
|
12
|
+
|
|
13
|
+
## When to Invoke
|
|
14
|
+
|
|
15
|
+
- **At session start** — the plugin's session-start hook invokes this skill automatically (before the SESSION START PROTOCOL so that the new SKILL.md files are visible to AGENTS.md and the rest of the protocol).
|
|
16
|
+
- **Manually** — via `//external-skills-fetcher` when the user wants to refresh external skills mid-session.
|
|
17
|
+
- **At release time** — `scripts/release.sh` calls the fetcher before building the dist tarball.
|
|
18
|
+
|
|
19
|
+
## Preconditions (Step 0)
|
|
20
|
+
|
|
21
|
+
- [ ] `git` is installed and on PATH
|
|
22
|
+
- [ ] Network is available (offline is handled gracefully)
|
|
23
|
+
- [ ] `~/.neuralgentics/` exists (created by `install.sh`)
|
|
24
|
+
|
|
25
|
+
## Step 1: Read `.env`
|
|
26
|
+
|
|
27
|
+
Read `external_skills.enabled` from the project's `.env` file (or `~/.neuralgentics/.env` as fallback).
|
|
28
|
+
|
|
29
|
+
- If unset or `false` → log `[external-skills-fetcher] external_skills.enabled is false — skipping` and return `{ enabled: false }`.
|
|
30
|
+
- If `true` → proceed to Step 2.
|
|
31
|
+
|
|
32
|
+
## Step 2: Clone / Refresh Repositories
|
|
33
|
+
|
|
34
|
+
Ensure `~/.neuralgentics/external_skills/` exists. For each configured repository:
|
|
35
|
+
|
|
36
|
+
### Repo 1: AI-Research-SKILLs
|
|
37
|
+
- **URL:** `https://github.com/Orchestra-Research/AI-Research-SKILLs.git`
|
|
38
|
+
- **Target dir:** `~/.neuralgentics/external_skills/ai-research-skills/`
|
|
39
|
+
- **License:** MIT
|
|
40
|
+
- **Attribution:** `Copyright 2025 Claude AI Research Skills Contributors. Used under MIT License.`
|
|
41
|
+
|
|
42
|
+
### Repo 2: ui-ux-pro-max-skill
|
|
43
|
+
- **URL:** `https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git`
|
|
44
|
+
- **Target dir:** `~/.neuralgentics/external_skills/ui-ux-pro-max-skill/`
|
|
45
|
+
- **License:** MIT
|
|
46
|
+
- **Attribution:** `Copyright 2024 Next Level Builder. Used under MIT License.`
|
|
47
|
+
|
|
48
|
+
**Clone logic (per repo):**
|
|
49
|
+
1. If target dir does not exist → `git clone --depth 1 <url> <target-dir>`
|
|
50
|
+
2. If target dir exists → `cd <target-dir> && git pull --ff-only`
|
|
51
|
+
- If `git pull` fails (network error, no upstream) → log warning and continue. Do NOT throw.
|
|
52
|
+
3. After clone/refresh, capture the current HEAD commit SHA: `git -C <target-dir> rev-parse HEAD`
|
|
53
|
+
|
|
54
|
+
## Step 3: Write MANIFEST.json
|
|
55
|
+
|
|
56
|
+
Write `~/.neuralgentics/external_skills/MANIFEST.json`:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"version": 1,
|
|
61
|
+
"updated_at": "<ISO 8601 timestamp>",
|
|
62
|
+
"repos": {
|
|
63
|
+
"ai-research-skills": {
|
|
64
|
+
"url": "https://github.com/Orchestra-Research/AI-Research-SKILLs.git",
|
|
65
|
+
"commit_sha": "<40-char hex SHA>",
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"attribution": "Copyright 2025 Claude AI Research Skills Contributors. Used under MIT License."
|
|
68
|
+
},
|
|
69
|
+
"ui-ux-pro-max-skill": {
|
|
70
|
+
"url": "https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git",
|
|
71
|
+
"commit_sha": "<40-char hex SHA>",
|
|
72
|
+
"license": "MIT",
|
|
73
|
+
"attribution": "Copyright 2024 Next Level Builder. Used under MIT License."
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Step 4: Return Handle
|
|
80
|
+
|
|
81
|
+
Return to the orchestrator:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"enabled": true,
|
|
86
|
+
"manifest_path": "~/.neuralgentics/external_skills/MANIFEST.json",
|
|
87
|
+
"repos": {
|
|
88
|
+
"ai-research-skills": { "status": "cloned", "commit_sha": "<sha>" },
|
|
89
|
+
"ui-ux-pro-max-skill": { "status": "refreshed", "commit_sha": "<sha>" }
|
|
90
|
+
},
|
|
91
|
+
"errors": []
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Notes
|
|
96
|
+
|
|
97
|
+
- **Offline-safe:** If `git pull` fails due to no network, log a warning and continue. The existing clone is still usable.
|
|
98
|
+
- **Idempotent:** Running the fetcher multiple times is safe. `git pull --ff-only` on an already-up-to-date repo is a no-op.
|
|
99
|
+
- **First install:** On a fresh `install.sh` run, the tarball may include a pre-bundled `share/external_skills/` snapshot. The fetcher will `git pull` to refresh it on first session start.
|
|
100
|
+
- **MANIFEST.json is the source of truth** for commit SHAs and attribution. The Go catalog reads this file to stamp provenance on external skills.
|