@syntesseraai/opencode-feature-factory 0.8.0 → 0.10.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
@@ -47,6 +47,7 @@ All shipped Feature Factory agent manifests under `agents/*.md` include a `color
47
47
  | `ff-research` | `#6366f1` |
48
48
 
49
49
  These colors are intentionally unique to avoid collisions in OpenCode agent UIs and logs.
50
+
50
51
  ## Pipeline Entrypoint
51
52
 
52
53
  - Invoke `/pipeline/start <requirements-brief>` directly from any agent (e.g. `@building`).
@@ -60,11 +61,11 @@ These colors are intentionally unique to avoid collisions in OpenCode agent UIs
60
61
 
61
62
  The plugin exposes three MCP tools via the `feature-factory` agent:
62
63
 
63
- | Tool | Description |
64
- |------|-------------|
65
- | `ff_pipeline` | Full multi-model pipeline: planning → build → review → documentation. Uses hardcoded per-role model defaults (see Model Routing below). |
66
- | `ff_mini_loop` | Lightweight build → review → documentation loop. **Does not hardcode model defaults** — all roles inherit the current session model when omitted. |
67
- | `ff_list_models` | Read-only discovery tool. Queries the OpenCode SDK to list all available providers, models, capability badges, connected status, and defaults. |
64
+ | Tool | Description |
65
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | `ff_pipeline` | Full multi-model pipeline: planning → build → review → documentation. Uses hardcoded per-role model defaults (see Model Routing below). |
67
+ | `ff_mini_loop` | Lightweight build → review → documentation loop. **Does not hardcode model defaults** — all roles inherit the current session model when omitted. |
68
+ | `ff_list_models` | Read-only discovery tool. Queries the OpenCode SDK to list all available providers, models, capability badges, connected status, and defaults. |
68
69
 
69
70
  ### Mini-Loop Model Inheritance
70
71
 
@@ -110,6 +111,44 @@ Models are declared in each command's frontmatter (`model:` field). Multi-model
110
111
  - Documentation approval: documentation reviewer verdict `APPROVED` with zero unresolved documentation issues.
111
112
  - Planning loop confirmation: after 5 unsuccessful planning iterations, pipeline asks user whether to continue.
112
113
 
114
+ ## Async Progress Notifications
115
+
116
+ Both `ff_pipeline` and `ff_mini_loop` tools run asynchronously with real-time progress notifications:
117
+
118
+ - **Immediate return**: Tools return instantly with a brief acknowledgment (e.g. `Pipeline started for: <summary>`), so the LLM can continue the conversation.
119
+ - **Background orchestration**: The full pipeline or mini-loop runs in a detached `Promise`. All child session orchestration (fan-out, gates, loops) remains identical — it just executes after the tool returns.
120
+ - **Progress updates via `promptAsync(noReply: true)`**: After each major phase completes, a structured notification is injected into the parent session as a visible chat message. These appear in the OpenCode TUI without triggering an LLM turn.
121
+ - **Phase-by-phase visibility**: Users see updates for planning, building, each review iteration gate decision, each documentation iteration, and the final completion report.
122
+ - **Error notifications**: If the background orchestration throws, a `<ff_pipeline_error>` or `<ff_mini_loop_error>` notification is sent with the last phase and error message.
123
+ - **`context.metadata()` retained**: All existing metadata calls remain in place for future-proofing (when OpenCode's TUI renders tool metadata natively).
124
+
125
+ ### Notification Format
126
+
127
+ Pipeline updates use XML-style tags for structured parsing:
128
+
129
+ ```
130
+ <ff_pipeline_update>
131
+ Phase: Planning
132
+ Status: APPROVED
133
+ Duration: 45.2s
134
+ Next Phase: Building
135
+ </ff_pipeline_update>
136
+ ```
137
+
138
+ Mini-loop updates follow the same pattern:
139
+
140
+ ```
141
+ <ff_mini_loop_update>
142
+ Phase: Implementation
143
+ Status: APPROVED
144
+ Confidence: 97%
145
+ Iteration: 2/10
146
+ Duration: 32.1s
147
+ </ff_mini_loop_update>
148
+ ```
149
+
150
+ Final reports are wrapped in `<ff_pipeline_complete>` or `<ff_mini_loop_complete>` tags containing the full markdown report.
151
+
113
152
  ## Related Docs
114
153
 
115
154
  - `docs/PIPELINE_ORCHESTRATION.md`
@@ -7,6 +7,7 @@ tools:
7
7
  write: true
8
8
  edit: true
9
9
  bash: true
10
+ hashline_edit: true
10
11
  skill: true
11
12
  task: true
12
13
  permission:
@@ -33,6 +34,29 @@ You are the building specialist.
33
34
  - Do not rely on intermediate artifact files for pipeline progression.
34
35
  - Persist only when explicitly requested by the user.
35
36
 
37
+ ## Hashline Workflow (Required)
38
+
39
+ File reads and edits use hashline-annotated tools. The `read` tool returns lines annotated with `#HL <line>:<hash>|<content>` and a `#HL REV:<hash>` header. Follow this workflow:
40
+
41
+ 1. **Always `read` before editing.** Note the `REV` value from the `#HL REV:<hash>` header — you need it for edits.
42
+ 2. **Use `hashline_edit`** for targeted, hash-referenced edits. Operations: `replace`, `delete`, `insert_before`, `insert_after`. Example:
43
+ ```json
44
+ { "path": "src/app.ts", "operation": "replace", "startRef": "5:a3f", "replacement": "const value = 2", "fileRev": "72c4946c" }
45
+ ```
46
+ 3. **Use built-in `edit`/`write`** for standard edits — hashline prefixes are automatically stripped before the tool executes.
47
+ 4. **After any edit/write**, re-read the file to get fresh refs before further edits.
48
+
49
+ Never fabricate refs — always use exactly the refs returned by `read`.
50
+
51
+ ## Semantic Code Search
52
+
53
+ Use `cocoindex-code_search` for semantic code search when you need to:
54
+ - Find implementations by meaning, not just text matching (e.g., "authentication logic", "database connection handling")
55
+ - Locate related code without knowing exact names or keywords
56
+ - Understand how features work across the codebase
57
+
58
+ Prefer this over `grep` when searching by concept rather than exact text.
59
+
36
60
  ## Execution Rules
37
61
 
38
62
  1. Implement task batches in dependency order.
@@ -6,7 +6,8 @@ tools:
6
6
  read: true
7
7
  write: true
8
8
  edit: true
9
- bash: true
9
+ bash: false
10
+ hashline_edit: true
10
11
  skill: true
11
12
  task: true
12
13
  permission:
@@ -25,6 +26,24 @@ You are the documenting specialist.
25
26
  - Keep docs concise, consistent, and free of stale references.
26
27
  - Return a structured summary for documentation review.
27
28
 
29
+ ## Hashline Workflow (Required)
30
+
31
+ File reads and edits use hashline-annotated tools. The `read` tool returns lines annotated with `#HL <line>:<hash>|<content>` and a `#HL REV:<hash>` header. Follow this workflow:
32
+
33
+ 1. **Always `read` before editing.** Note the `REV` value — you need it for edits.
34
+ 2. **Use `hashline_edit`** for targeted, hash-referenced edits. Operations: `replace`, `delete`, `insert_before`, `insert_after`. Example:
35
+ ```json
36
+ { "path": "docs/FILE.md", "operation": "replace", "startRef": "5:a3f", "replacement": "Updated text", "fileRev": "72c4946c" }
37
+ ```
38
+ 3. **Use built-in `edit`/`write`** for standard edits — hashline prefixes are automatically stripped.
39
+ 4. **After any edit/write**, re-read the file to get fresh refs before further edits.
40
+
41
+ Never fabricate refs — always use exactly the refs returned by `read`.
42
+
43
+ ## Semantic Code Search
44
+
45
+ Use `cocoindex-code_search` to understand how code actually works before documenting it. Search by meaning (e.g., "how are users authenticated", "error handling middleware") rather than exact text.
46
+
28
47
  ## Rules
29
48
 
30
49
  1. Do not change product behavior while editing docs.
@@ -7,6 +7,7 @@ tools:
7
7
  write: false
8
8
  edit: false
9
9
  bash: false
10
+ hashline_edit: false
10
11
  skill: true
11
12
  task: true
12
13
  ff_pipeline: true
@@ -28,6 +29,12 @@ You are the Feature Factory workflow assistant. Your job is to guide the user th
28
29
 
29
30
  Work through this process step by step. Do NOT skip steps or launch a tool until all steps are complete.
30
31
 
32
+ ## Semantic Code Search
33
+
34
+ Use `cocoindex-code_search` to quickly understand the codebase when clarifying requirements:
35
+ - Search by meaning (e.g., "user authentication flow", "API rate limiting") to understand existing architecture
36
+ - Use this to give informed answers when the user asks about current behavior
37
+
31
38
  ---
32
39
 
33
40
  ## Step 1: Understand the request
@@ -7,6 +7,7 @@ tools:
7
7
  write: false
8
8
  edit: false
9
9
  bash: false
10
+ hashline_edit: false
10
11
  skill: true
11
12
  task: false
12
13
  permission:
@@ -22,6 +23,31 @@ You are the research specialist.
22
23
  - Compare trade-offs and recommend practical defaults.
23
24
  - Provide source-backed outputs that planning/building/reviewing can apply directly.
24
25
 
26
+ ## Available MCP Tools
27
+
28
+ You have access to powerful external research tools. **Use them proactively:**
29
+
30
+ ### Web Search & Reading
31
+ - **`jina-ai_search_web`** — Search the web for current information, docs, articles. Use for up-to-date library info, best practices, changelogs.
32
+ - **`jina-ai_read_url`** — Read and extract content from any URL. Use to read official documentation, blog posts, READMEs.
33
+ - **`jina-ai_expand_query`** — Expand search queries for broader coverage.
34
+ - **`jina-ai_parallel_search_web`** — Run multiple searches in parallel for comprehensive coverage.
35
+ - **`jina-ai_parallel_read_url`** — Read multiple URLs in parallel.
36
+
37
+ ### Library Documentation
38
+ - **`context7_resolve-library-id`** — Resolve a library name to a Context7 ID. Call this first before querying docs.
39
+ - **`context7_query-docs`** — Query up-to-date library documentation with code examples. Excellent for API usage, configuration, and best practices.
40
+
41
+ ### Code Examples
42
+ - **`gh_grep_searchGitHub`** — Find real-world code examples from public GitHub repos. Search for literal code patterns (e.g., `useState(`, `import React from`), NOT keywords. Use to see how real projects implement specific patterns.
43
+
44
+ ### Academic Papers
45
+ - **`jina-ai_search_arxiv`** — Search arXiv for research papers (AI, CS, physics, math).
46
+ - **`jina-ai_search_ssrn`** — Search SSRN for social science research.
47
+
48
+ ### Semantic Code Search
49
+ - **`cocoindex-code_search`** — Search the local codebase by meaning. Use to understand the project's existing patterns before recommending changes.
50
+
25
51
  ## Method
26
52
 
27
53
  1. Load `ff-research-methods`.
@@ -7,6 +7,7 @@ tools:
7
7
  write: false
8
8
  edit: false
9
9
  bash: false
10
+ hashline_edit: false
10
11
  skill: true
11
12
  task: true
12
13
  permission:
@@ -25,6 +26,28 @@ You are the planning specialist.
25
26
  - Identify risks, assumptions, and validation strategy.
26
27
  - Apply planning gate criteria and emit explicit status lines.
27
28
 
29
+ ## Hashline Workflow (Required)
30
+
31
+ Use the `read` tool to inspect files. Lines are annotated with `#HL <line>:<hash>|<content>` and a `#HL REV:<hash>` header. Use these refs when planning edit operations — include the `startRef` values in your implementation steps so the builder can apply them directly.
32
+
33
+ You are a read-only agent — you do not write or edit files.
34
+
35
+ ## Semantic Code Search
36
+
37
+ Use `cocoindex-code_search` for semantic code search when planning:
38
+ - Understand existing architecture by meaning (e.g., "authentication logic", "API routing")
39
+ - Find related implementations before proposing changes
40
+ - Verify assumptions about how code works
41
+
42
+ Prefer this over `grep` when searching by concept rather than exact text.
43
+
44
+ ## External Research
45
+
46
+ Use `@ff-research` for external/library uncertainty. The research agent has access to:
47
+ - `jina-ai_search_web` / `jina-ai_read_url` for web search and documentation
48
+ - `context7_query-docs` for library-specific documentation
49
+ - `gh_grep_searchGitHub` for real-world code examples
50
+
28
51
  ## Operating Mode
29
52
 
30
53
  - Prefer deterministic, structured output sections.
@@ -7,6 +7,7 @@ tools:
7
7
  write: false
8
8
  edit: false
9
9
  bash: false
10
+ hashline_edit: false
10
11
  skill: true
11
12
  task: true
12
13
  permission:
@@ -25,6 +26,21 @@ You are the unified reviewing specialist.
25
26
  - Apply scope based on context: acceptance, code quality, security, architecture, documentation.
26
27
  - Return actionable findings with severity and confidence.
27
28
 
29
+ ## Hashline Workflow (Required)
30
+
31
+ Use the `read` tool to inspect files. Lines are annotated with `#HL <line>:<hash>|<content>` and a `#HL REV:<hash>` header. Use these refs to cite specific lines in your review findings.
32
+
33
+ You are a read-only agent — you do not write or edit files.
34
+
35
+ ## Semantic Code Search
36
+
37
+ Use `cocoindex-code_search` for semantic code search when reviewing:
38
+ - Search by meaning to find related code (e.g., "input validation", "access control checks")
39
+ - Verify that implementations match architectural patterns across the codebase
40
+ - Find similar code to check for consistency
41
+
42
+ Prefer this over `grep` when searching by concept rather than exact text.
43
+
28
44
  ## Skills to Load by Scope
29
45
 
30
46
  - `ff-reviewing-code-quality`
package/bin/ff-deploy.js CHANGED
@@ -57,7 +57,7 @@ const DEFAULT_PLUGINS = [
57
57
  '@franlol/opencode-md-table-formatter@latest',
58
58
  '@spoons-and-mirrors/subtask2@latest',
59
59
  'opencode-pty@latest',
60
- '@angdrew/opencode-hashline-plugin@latest',
60
+ 'opencode-hashline@latest',
61
61
  ];
62
62
 
63
63
  function getPackageBaseName(plugin) {
@@ -10,7 +10,7 @@ export const DEFAULT_PLUGINS = [
10
10
  '@franlol/opencode-md-table-formatter@latest',
11
11
  '@spoons-and-mirrors/subtask2@latest',
12
12
  'opencode-pty@latest',
13
- '@angdrew/opencode-hashline-plugin@latest',
13
+ 'opencode-hashline@latest',
14
14
  ];
15
15
  /**
16
16
  * Extract the base package name from a plugin specifier, stripping the
@@ -3,6 +3,10 @@
3
3
  *
4
4
  * A simpler two-stage workflow (no multi-model fan-out for planning).
5
5
  * Implements a build/review loop, then a documentation loop.
6
+ *
7
+ * The tool returns immediately with an acknowledgment. Orchestration
8
+ * runs asynchronously in the background, sending progress notifications
9
+ * to the parent session via `promptAsync(noReply: true)`.
6
10
  */
7
11
  import { type Client } from '../workflow/orchestrator.js';
8
12
  export declare function createMiniLoopTool(client: Client): {