@syntesseraai/opencode-feature-factory 0.1.14 → 0.1.15

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/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.1.14",
4
+ "version": "0.1.15",
5
5
  "description": "OpenCode plugin for Feature Factory agents - provides planning, implementation, review, testing, and validation agents",
6
6
  "type": "module",
7
7
  "license": "MIT",
package/src/index.ts CHANGED
@@ -17,7 +17,6 @@ const AGENT_TEMPLATES = [
17
17
  'ff-security.md',
18
18
  'ff-acceptance.md',
19
19
  'ff-well-architected.md',
20
- 'ff-ci.md',
21
20
  'ff-validate.md',
22
21
  ] as const;
23
22
 
@@ -136,7 +135,6 @@ function mergeHooks(...hookSets: Partial<Hooks>[]): Hooks {
136
135
  * - ff-security (subagent): Security audits
137
136
  * - ff-acceptance (subagent): Acceptance criteria validation
138
137
  * - ff-well-architected (subagent): AWS Well-Architected review
139
- * - ff-ci (subagent): Runs CI via management/ci.sh
140
138
  * - ff-validate (subagent): Orchestrates all validation agents in parallel
141
139
  *
142
140
  * ## Quality Gate (StopQualityGate)
@@ -148,9 +146,10 @@ function mergeHooks(...hookSets: Partial<Hooks>[]): Hooks {
148
146
  * - Always overwrites existing files with bundled templates (user changes are not preserved)
149
147
  * - Also syncs on installation.updated event
150
148
  * - Runs quality gate on session.idle (when agent finishes working)
151
- * - Delegates to @ff-ci subagent which runs management/ci.sh
152
- * - On failure: prompts agent with failure output and instructions to fix
153
- * - On success: logs "Quality gate passed."
149
+ * - Executes management/ci.sh directly (no LLM involvement)
150
+ * - On fast feedback: "Quality gate is running, please stand-by for results ..."
151
+ * - On success: "Quality gate passed"
152
+ * - On failure: passes full CI output to LLM for fix instructions
154
153
  * - If management/ci.sh does not exist, quality gate does not run
155
154
  */
156
155
  export const FeatureFactoryPlugin: Plugin = async (input) => {
@@ -127,33 +127,57 @@ export async function createQualityGateHooks(input: PluginInput): Promise<Partia
127
127
  parts: [
128
128
  {
129
129
  type: 'text',
130
- text: `@ff-ci Run the CI checks and report results in markdown format.`,
130
+ text: `🔄 Quality gate is running, please stand-by for results ...`,
131
131
  },
132
132
  ],
133
133
  },
134
134
  });
135
135
 
136
- state.lastRunAt = Date.now();
137
- state.dirty = false;
138
- state.qualityGatePassed = true;
139
-
140
- await log(client, 'debug', 'quality-gate.ci-delegated', { sessionId });
141
-
142
- await client.session.prompt({
143
- path: { id: sessionId },
144
- body: {
145
- parts: [
146
- {
147
- type: 'text',
148
- text: `## ✅ Quality gate passed
136
+ let ciOutput = '';
137
+ let ciPassed = false;
149
138
 
150
- CI checks delegated to @ff-ci agent.
139
+ try {
140
+ const result = await $`cd ${directory} && bash management/ci.sh`.quiet();
141
+ const stdout = result.stdout;
142
+ ciOutput = typeof stdout === 'string' ? stdout : stdout?.toString() || '';
143
+ ciPassed = true;
144
+ } catch (err) {
145
+ const stdout = (err as { stdout?: unknown }).stdout;
146
+ ciOutput = typeof stdout === 'string' ? stdout : stdout?.toString() || String(err);
147
+ ciPassed = false;
148
+ }
151
149
 
152
- Your work meets the quality standards and is ready to proceed.`,
153
- },
154
- ],
155
- },
156
- });
150
+ state.lastRunAt = Date.now();
151
+ state.dirty = false;
152
+ state.qualityGatePassed = ciPassed;
153
+
154
+ if (ciPassed) {
155
+ await client.session.prompt({
156
+ path: { id: sessionId },
157
+ body: {
158
+ parts: [
159
+ {
160
+ type: 'text',
161
+ text: `✅ Quality gate passed`,
162
+ },
163
+ ],
164
+ },
165
+ });
166
+ await log(client, 'debug', 'quality-gate.passed', { sessionId });
167
+ } else {
168
+ await client.session.prompt({
169
+ path: { id: sessionId },
170
+ body: {
171
+ parts: [
172
+ {
173
+ type: 'text',
174
+ text: `❌ Quality gate failed\n\nThe CI checks did not pass. Please review the output below and fix the issues:\n\n\`\`\`\n${ciOutput}\n\`\`\``,
175
+ },
176
+ ],
177
+ },
178
+ });
179
+ await log(client, 'debug', 'quality-gate.failed', { sessionId });
180
+ }
157
181
  }
158
182
 
159
183
  return {
@@ -1,122 +0,0 @@
1
- ---
2
- description: Runs CI checks via management/ci.sh
3
- mode: subagent
4
- tools:
5
- read: true
6
- glob: true
7
- grep: true
8
- ls: true
9
- bash: true
10
- write: false
11
- edit: false
12
- permission:
13
- edit: deny
14
- bash:
15
- 'bash management/ci.sh': allow
16
- 'bash management/ci.sh*': allow
17
- ---
18
-
19
- # CI Agent for Feature Factory
20
-
21
- You are a CI agent for Feature Factory. Your role is to run the project's CI script.
22
-
23
- ## Process
24
-
25
- 1. **Check for ci.sh** - Verify `management/ci.sh` exists
26
- 2. **Run CI script** - Execute `bash management/ci.sh`
27
- 3. **Report results** - Report pass/fail status with output
28
-
29
- ## Execution
30
-
31
- If `management/ci.sh` does not exist, report an error:
32
-
33
- ````
34
- ## CI Results
35
-
36
- **Status:** ✗ CI script not found
37
-
38
- No `management/ci.sh` file exists in this project. CI checks require a CI script at this location.
39
-
40
- Create `management/ci.sh` with your build, lint, and test commands, for example:
41
-
42
- ```bash
43
- #!/bin/bash
44
- set -e
45
-
46
- npm run lint
47
- npm run build
48
- npm run test
49
- ````
50
-
51
- ```
52
-
53
- If the script exists, run it and report results:
54
-
55
- ```
56
-
57
- ## CI Results
58
-
59
- **Status:** ✓ CI passed
60
-
61
- **Command:** bash management/ci.sh
62
-
63
- **Output:**
64
- \`\`\`
65
-
66
- > npm run lint
67
-
68
- ✓ lint passed
69
-
70
- > npm run build
71
-
72
- ✓ build passed
73
-
74
- > npm run test
75
-
76
- ✓ 142 tests passed
77
- \`\`\`
78
-
79
- ```
80
-
81
- ## Failure Handling
82
-
83
- When CI fails, report the failure:
84
-
85
- ```
86
-
87
- ## CI Results
88
-
89
- **Status:** ✗ CI failed
90
-
91
- **Command:** bash management/ci.sh
92
-
93
- **Exit code:** 1
94
-
95
- **Output:**
96
- \`\`\`
97
-
98
- > npm run test
99
-
100
- FAIL **tests**/user-service.test.ts
101
-
102
- ● should validate email
103
-
104
- Expected validation error but got success
105
-
106
- at __tests__/user-service.test.ts:23
107
-
108
- \`\`\`
109
-
110
- **Next steps:**
111
-
112
- 1. Fix the failing tests
113
- 2. Re-run: bash management/ci.sh
114
-
115
- ```
116
-
117
- ## Important Notes
118
-
119
- - Only report results - don't fix issues
120
- - Include relevant output from the CI script
121
- - Report exit code if non-zero
122
- ```