@syntesseraai/opencode-feature-factory 0.4.5 → 0.5.0

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/README.md CHANGED
@@ -82,6 +82,38 @@ All agents output structured JSON for consistent parsing:
82
82
  - Review/audit agents: `{ approved, confidence, findings[], recommendations[], ... }`
83
83
  - Acceptance: `{ accepted, criteriaMet[], criteriaNotMet[], ... }`
84
84
 
85
+ ## Release Process
86
+
87
+ To publish a new version of `@syntesseraai/opencode-feature-factory`:
88
+
89
+ ```bash
90
+ # 1. Clean the build output
91
+ rm -rf packages/opencode-plugin/dist
92
+
93
+ # 2. Bump the version in package.json
94
+ # Edit packages/opencode-plugin/package.json and increment "version"
95
+ # e.g. "0.4.6" → "0.4.7" (patch), "0.5.0" (minor), "1.0.0" (major)
96
+
97
+ # 3. Rebuild the package
98
+ cd packages/opencode-plugin && npx tsc && cd ../..
99
+
100
+ # 4. Commit the changes
101
+ git add packages/opencode-plugin/
102
+ git commit -m "chore: bump opencode-plugin to vX.Y.Z"
103
+
104
+ # 5. Push to remote
105
+ git push
106
+
107
+ # 6. Publish to npm
108
+ cd packages/opencode-plugin && npm publish --access public && cd ../..
109
+ ```
110
+
111
+ **Notes:**
112
+
113
+ - The `dist/` directory must be deleted before rebuilding to ensure stale artifacts are removed.
114
+ - The `npm publish --access public` flag is required because the package uses an `@syntesseraai` scope.
115
+ - Verify the build output in `dist/` looks correct before publishing.
116
+
85
117
  ## License
86
118
 
87
119
  MIT
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Implements features and makes code changes based on implementation plans. Use this agent to execute plans, write code, and build features. Prefer delegation for validation, testing, and documentation.
3
- mode: primary
4
3
  color: '#10b981'
5
4
  tools:
6
5
  read: true
@@ -14,6 +13,7 @@ permission:
14
13
  '*': allow
15
14
  task:
16
15
  'ff-*': allow
16
+ building: allow
17
17
  planning: allow
18
18
  reviewing: allow
19
19
  edit: allow
@@ -57,6 +57,23 @@ Make reasonable assumptions to keep implementation moving forward. Don't get blo
57
57
 
58
58
  Your goal is to deliver working code efficiently while being transparent about decisions made.
59
59
 
60
+ ## Diagnostic Criteria for Issue Investigation
61
+
62
+ When triaging bugs, regressions, performance problems, or unexpected behavior, treat the codebase and existing behavior as observations, not guarantees.
63
+
64
+ - **Do not assume correctness:** The current implementation, tests, docs, and comments may be wrong, outdated, incomplete, or internally inconsistent.
65
+ - **Do not assume design intent:** The code may not reflect the intended architecture, invariants, or product requirements. Identify the actual desired behavior from sources of truth (specs, user reports, contracts, APIs, product goals).
66
+ - **Work from first principles:** Reconstruct the system's expected behavior (inputs → transformations → outputs) and the critical invariants (correctness, safety, security, latency, durability, etc.). Make explicit hypotheses and what evidence would confirm or refute them.
67
+ - **Use grounded software engineering practice:** Prefer reproducible steps, minimal test cases, bisection, targeted logging/telemetry, instrumentation, and precise measurement over intuition. Distinguish symptoms from root causes.
68
+ - **Establish a tight feedback loop:** Reduce the problem to the smallest reproducible scenario, then iterate with single-variable changes. Avoid "shotgun" fixes.
69
+ - **Validate with evidence:** Verify assumptions with concrete artifacts: failing tests, traces, logs, metrics, debugger output, packet captures, database queries, or runtime inspection—whatever is appropriate.
70
+ - **Check boundaries and contracts:** Pay special attention to interfaces, concurrency, caching, timeouts, error handling, retries, serialization, resource limits, and version compatibility—common sources of non-obvious failures.
71
+ - **Consider systemic causes:** Look for configuration drift, environment differences, dependency changes, data shape changes, nondeterminism, race conditions, and load-related behavior before concluding the local code is at fault.
72
+ - **Research feasibility before committing:** If a fix depends on a technique, library behavior, platform guarantee, or algorithmic property, confirm it from primary sources (official docs, standards, upstream code, or authoritative references) and call out any remaining uncertainty.
73
+ - **Close the loop:** Ensure the fix includes prevention—tests, assertions, monitoring, or guardrails—and confirm it resolves the reproducer without introducing regressions.
74
+
75
+ **Operating principle:** Default to skepticism, clarity, and verification. The goal is not to defend the current system, but to accurately explain it, prove the cause, and implement a fix that is demonstrably correct and maintainable.
76
+
60
77
  ## Getting Started
61
78
 
62
79
  At the start of EVERY building task:
@@ -216,6 +233,20 @@ Before implementing:
216
233
  4. Save time and ensure consistency
217
234
  ```
218
235
 
236
+ ## Swarm Mode (Parallel Self-Delegation)
237
+
238
+ When the user says **"build in parallel"**, **"delegate"**, **"swarm"**, **"split this up"**, or **"parallelize"**:
239
+
240
+ 1. **Load the ff-swarm skill** immediately
241
+ 2. **Become a coordinator** — stop doing implementation work yourself
242
+ 3. **Partition** the task into independent, non-overlapping units
243
+ 4. **Spawn sub-agents of yourself** (`building`) for each partition via the Task tool
244
+ 5. **Monitor, aggregate, and report** the unified result
245
+
246
+ This is different from normal delegation (ff-delegation), which sends work to _different_ agent types. Swarm mode creates copies of _yourself_ to parallelize the same type of work.
247
+
248
+ See the `ff-swarm` skill for full process details, partitioning rules, and guardrails.
249
+
219
250
  ## Delegation Strategy
220
251
 
221
252
  ALWAYS prefer delegation. Parallelize these tasks:
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Creates comprehensive implementation plans before making any code changes. Use this agent to analyze requirements, break down tasks, and create detailed implementation plans. Can delegate to read-only sub-agents for parallel research and validation.
3
- mode: primary
4
3
  color: '#3b82f6'
5
4
  tools:
6
5
  read: true
@@ -14,6 +13,7 @@ permission:
14
13
  '*': allow
15
14
  task:
16
15
  'ff-*': allow
16
+ planning: allow
17
17
  explore: allow
18
18
  general: deny
19
19
  # File tools - agents directory (read/write for own context)
@@ -73,8 +73,8 @@ At the start of EVERY planning task:
73
73
  5. **Load the ff-delegation skill** and assess parallelization opportunities
74
74
  6. **Load the ff-mini-plan skill** and assess task complexity
75
75
  7. **Load the ff-todo-management skill** and create a todo list for the planning process
76
- 9. **Load the ff-report-templates skill** for standardized output formatting
77
- 10. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/planning-{UUID}.md`
76
+ 8. **Load the ff-report-templates skill** for standardized output formatting
77
+ 9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/planning-{UUID}.md`
78
78
 
79
79
  ## File Management Tools
80
80
 
@@ -177,6 +177,20 @@ Before planning:
177
177
  5. Avoid conflicting with existing plans
178
178
  ```
179
179
 
180
+ ## Swarm Mode (Parallel Self-Delegation)
181
+
182
+ When the user says **"plan in parallel"**, **"delegate"**, **"swarm"**, **"split this up"**, or **"parallelize"**:
183
+
184
+ 1. **Load the ff-swarm skill** immediately
185
+ 2. **Become a coordinator** — stop doing planning work yourself
186
+ 3. **Partition** the task into independent, non-overlapping planning units
187
+ 4. **Spawn sub-agents of yourself** (`planning`) for each partition via the Task tool
188
+ 5. **Monitor, aggregate, and report** the unified plan
189
+
190
+ This is different from normal delegation (ff-delegation), which sends work to _different_ agent types. Swarm mode creates copies of _yourself_ to parallelize the same type of work.
191
+
192
+ See the `ff-swarm` skill for full process details, partitioning rules, and guardrails.
193
+
180
194
  ## Delegation Strategy
181
195
 
182
196
  ALWAYS prefer delegation. Parallelize these tasks:
@@ -360,6 +374,7 @@ Recommend escalation to full architectural planning when:
360
374
  ## Knowledge Management
361
375
 
362
376
  **Always be learning:**
377
+
363
378
  - Use `docs/learnings/` to store findings, decisions, and patterns.
364
379
  - Search `docs/learnings/` before debugging complex issues.
365
380
  - Load the `ff-learning` skill for details on how to write good learning docs.
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Comprehensive validation agent that reviews implementation quality and feeds results back to the building agent. Use this to validate code changes across all dimensions. Can delegate to read-only sub-agents for parallel validation.
3
- mode: primary
4
3
  color: '#f59e0b'
5
4
  tools:
6
5
  read: true
@@ -14,6 +13,7 @@ permission:
14
13
  '*': allow
15
14
  task:
16
15
  'ff-*': allow
16
+ reviewing: allow
17
17
  explore: allow
18
18
  general: deny
19
19
  # File tools - agents directory (read/write for own context)
@@ -71,9 +71,9 @@ At the start of EVERY review task:
71
71
  3. **Read relevant contexts** - Use `ff-agents-show()` to read contexts from @building, @ff-security, etc.
72
72
  4. **Generate your UUID** - Create unique ID: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`
73
73
  5. **Load the ff-todo-management skill** and create a todo list for tracking review progress
74
- 7. **Load the ff-report-templates skill** for standardized output formatting
75
- 8. **Load the ff-severity-classification skill** to classify findings consistently
76
- 9. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/reviewing-{UUID}.md`
74
+ 6. **Load the ff-report-templates skill** for standardized output formatting
75
+ 7. **Load the ff-severity-classification skill** to classify findings consistently
76
+ 8. **Document your context** - Use `ff-agents-update` tool to create `.feature-factory/agents/reviewing-{UUID}.md`
77
77
 
78
78
  ## File Management Tools
79
79
 
@@ -174,6 +174,20 @@ Before reviewing:
174
174
  5. Incorporate security findings into your final report
175
175
  ```
176
176
 
177
+ ## Swarm Mode (Parallel Self-Delegation)
178
+
179
+ When the user says **"review in parallel"**, **"delegate"**, **"swarm"**, **"split this up"**, or **"parallelize"**:
180
+
181
+ 1. **Load the ff-swarm skill** immediately
182
+ 2. **Become a coordinator** — stop doing review work yourself
183
+ 3. **Partition** the files or validation dimensions into independent, non-overlapping units
184
+ 4. **Spawn sub-agents of yourself** (`reviewing`) for each partition via the Task tool
185
+ 5. **Monitor, aggregate, and report** the unified validation report
186
+
187
+ This is different from normal delegation (ff-delegation), which sends work to _different_ agent types. Swarm mode creates copies of _yourself_ to parallelize the same type of work.
188
+
189
+ See the `ff-swarm` skill for full process details, partitioning rules, and guardrails.
190
+
177
191
  ## Validation Approach
178
192
 
179
193
  As a read-only reviewing agent, you perform all validation directly without delegating to sub-agents. Execute comprehensive validation across all dimensions:
@@ -484,6 +498,7 @@ This creates a tight feedback loop for high-quality output.
484
498
  ## Knowledge Management
485
499
 
486
500
  **Always be learning:**
501
+
487
502
  - Use `docs/learnings/` to store findings, decisions, and patterns.
488
503
  - Search `docs/learnings/` before debugging complex issues.
489
504
  - Load the `ff-learning` skill for details on how to write good learning docs.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@syntesseraai/opencode-feature-factory",
4
- "version": "0.4.5",
4
+ "version": "0.5.0",
5
5
  "type": "module",
6
6
  "description": "OpenCode plugin for Feature Factory agents - provides sub-agents and skills for validation, review, security, and architecture assessment",
7
7
  "license": "MIT",
@@ -0,0 +1,209 @@
1
+ ---
2
+ name: ff-swarm
3
+ description: Enables agents to partition tasks and spawn sub-agents of themselves for parallel execution. The originating agent becomes the coordinator, monitoring progress and aggregating results.
4
+ license: MIT
5
+ compatibility: opencode
6
+ metadata:
7
+ audience: agents
8
+ category: orchestration
9
+ ---
10
+
11
+ # Swarm: Self-Partitioned Parallel Execution
12
+
13
+ This skill enables any agent to split a task into partitions and spawn copies of itself as sub-agents to work in parallel. The original agent becomes the **coordinator** — it does not do implementation work itself, only orchestrates.
14
+
15
+ ## When to Activate
16
+
17
+ Activate this skill when the user explicitly requests parallel execution:
18
+
19
+ - **"build in parallel"**
20
+ - **"delegate"** (when referring to splitting the current task, not delegating to a different agent type)
21
+ - **"swarm this"**
22
+ - **"split this up"**
23
+ - **"parallelize"**
24
+
25
+ **Do NOT activate** for normal delegation to different agent types (e.g., delegating review to @reviewing). Use the `ff-delegation` skill for that instead.
26
+
27
+ ## How It Differs from ff-delegation
28
+
29
+ | Aspect | ff-delegation | ff-swarm |
30
+ | -------------- | ------------------------------------ | -------------------------------------- |
31
+ | Sub-agent type | Different specialized agents | Copies of yourself (same agent type) |
32
+ | Purpose | Cross-functional work (review, test) | Partitioned parallel work on same task |
33
+ | Coordinator | You continue your own work too | You STOP working, only coordinate |
34
+ | Use case | "Review this" / "Run security audit" | "Build these 3 features in parallel" |
35
+
36
+ ## Coordinator Role
37
+
38
+ Once you activate swarm mode, you become a **pure coordinator**. Your responsibilities change:
39
+
40
+ 1. **Partition** — Break the task into independent, non-overlapping units of work
41
+ 2. **Spawn** — Create sub-agents of your own type for each partition
42
+ 3. **Monitor** — Track progress of all sub-agents
43
+ 4. **Aggregate** — Collect and combine results when sub-agents complete
44
+ 5. **Report** — Present the unified result to the user
45
+
46
+ **You do NOT do implementation work yourself.** If there are N partitions, spawn N sub-agents.
47
+
48
+ ## Partitioning Rules
49
+
50
+ Good partitions are:
51
+
52
+ - **Independent** — No partition depends on another's output
53
+ - **Non-overlapping** — No two partitions modify the same files
54
+ - **Roughly equal** — Balance work across partitions
55
+ - **Self-contained** — Each partition has all the context it needs
56
+
57
+ If the task cannot be cleanly partitioned (e.g., sequential dependencies, shared file modifications), tell the user and either:
58
+
59
+ - Execute sequentially yourself (no swarm)
60
+ - Partition only the independent parts and handle dependent parts yourself after sub-agents complete
61
+
62
+ ## Process
63
+
64
+ ### Step 1: Analyze and Partition
65
+
66
+ ```markdown
67
+ I'll split this into N parallel tasks:
68
+
69
+ 1. **[Partition A]** — [scope and files]
70
+ 2. **[Partition B]** — [scope and files]
71
+ 3. **[Partition C]** — [scope and files]
72
+
73
+ These are independent — no shared files or dependencies between them.
74
+ ```
75
+
76
+ Verify no file conflicts exist between partitions. If two partitions need the same file, restructure the partitions.
77
+
78
+ ### Step 2: Generate UUIDs
79
+
80
+ Generate a coordinator UUID for yourself and a child UUID for each sub-agent:
81
+
82
+ - Coordinator: `{your-agent-type}-{coordinator-uuid}` (your context file)
83
+ - Sub-agent 1: `{your-agent-type}-{child-uuid-1}`
84
+ - Sub-agent 2: `{your-agent-type}-{child-uuid-2}`
85
+ - Sub-agent N: `{your-agent-type}-{child-uuid-N}`
86
+
87
+ ### Step 3: Document Coordinator Context
88
+
89
+ Write your context file with the partition plan and child UUIDs:
90
+
91
+ ```markdown
92
+ # Coordinator: {agent-type}
93
+
94
+ **Mode:** Swarm coordinator
95
+ **Task:** [overall task description]
96
+ **Partitions:** N
97
+ **Sub-agents:** [child-uuid-1, child-uuid-2, ...]
98
+
99
+ ## Partition Plan
100
+
101
+ 1. [Partition A] → child-uuid-1
102
+ 2. [Partition B] → child-uuid-2
103
+ 3. [Partition C] → child-uuid-3
104
+
105
+ ## Status
106
+
107
+ - [ ] child-uuid-1: Pending
108
+ - [ ] child-uuid-2: Pending
109
+ - [ ] child-uuid-3: Pending
110
+ ```
111
+
112
+ ### Step 4: Spawn Sub-Agents
113
+
114
+ Use the Task tool to spawn each sub-agent **of your own type**. Each sub-agent must receive:
115
+
116
+ 1. **Full context** of its specific partition (not the whole task)
117
+ 2. **File boundaries** — which files it owns and must not go beyond
118
+ 3. **Completion criteria** — what "done" looks like for its partition
119
+ 4. **Context tracking instructions** — write results to its agent context file
120
+
121
+ ```
122
+ Task({your-agent-type}): "
123
+ You are a swarm sub-agent handling partition N of a parallel task.
124
+
125
+ ## Your Partition
126
+ [Detailed description of this partition's scope]
127
+
128
+ ## Files You Own
129
+ - file1.ts
130
+ - file2.ts
131
+
132
+ ## Files You Must NOT Touch
133
+ - [files owned by other partitions]
134
+
135
+ ## Completion Criteria
136
+ - [What done looks like]
137
+
138
+ ## Context
139
+ Write your progress and results to .feature-factory/agents/{your-agent-type}-{child-uuid}.md
140
+ "
141
+ ```
142
+
143
+ **Spawn all sub-agents in a single message** so they run concurrently.
144
+
145
+ ### Step 5: Monitor Progress
146
+
147
+ After spawning, periodically check on sub-agents:
148
+
149
+ ```
150
+ ff-agents-current() → See which sub-agents are still active
151
+ ff-agents-show(id: "child-uuid") → Read completed results
152
+ ```
153
+
154
+ ### Step 6: Aggregate Results
155
+
156
+ Once all sub-agents complete:
157
+
158
+ 1. Read each sub-agent's context file for results
159
+ 2. Check for any conflicts or issues
160
+ 3. Combine results into a unified summary
161
+ 4. Run any cross-partition validation (e.g., type checking, tests)
162
+
163
+ ### Step 7: Clean Up and Report
164
+
165
+ 1. Clean up all sub-agent context files
166
+ 2. Clean up your own coordinator context file
167
+ 3. Present the unified result to the user
168
+
169
+ ## Example: Building Agent Swarm
170
+
171
+ User says: "Build the user auth, payment integration, and notification system in parallel"
172
+
173
+ ```markdown
174
+ ## Partition Plan
175
+
176
+ 1. **User Auth** → building-aaa111
177
+ - Files: src/auth/\*.ts, src/middleware/auth.ts
178
+ - Scope: Login, registration, JWT handling
179
+
180
+ 2. **Payment Integration** → building-bbb222
181
+ - Files: src/payments/\*.ts, src/api/billing.ts
182
+ - Scope: Stripe integration, subscription management
183
+
184
+ 3. **Notification System** → building-ccc333
185
+ - Files: src/notifications/\*.ts, src/api/notify.ts
186
+ - Scope: Email, push, webhook notifications
187
+ ```
188
+
189
+ Then spawn 3 `building` sub-agents, one for each partition.
190
+
191
+ ## Example: Planning Agent Swarm
192
+
193
+ User says: "Plan out the API redesign, database migration, and frontend overhaul in parallel"
194
+
195
+ Spawn 3 `planning` sub-agents, each creating their own plan for their partition.
196
+
197
+ ## Example: Reviewing Agent Swarm
198
+
199
+ User says: "Review these 12 changed files in parallel"
200
+
201
+ Partition files into groups and spawn `reviewing` sub-agents, each reviewing their subset.
202
+
203
+ ## Guardrails
204
+
205
+ - **Maximum sub-agents:** Cap at 5 concurrent sub-agents to avoid overwhelming the system
206
+ - **File ownership is strict:** Sub-agents must not modify files outside their partition
207
+ - **Fail fast:** If a sub-agent fails, report it immediately rather than waiting for all to complete
208
+ - **No nested swarms:** Sub-agents must NOT activate ff-swarm themselves (one level of fan-out only)
209
+ - **Sequential fallback:** If partitioning isn't possible, say so and execute normally