@syntesseraai/opencode-feature-factory 0.1.23 → 0.1.25

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.23",
4
+ "version": "0.1.25",
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",
@@ -325,7 +325,9 @@ export async function createQualityGateHooks(input: PluginInput): Promise<Partia
325
325
  const sanitizedOutput = truncateOutput(sanitizeOutput(ciOutput), 20);
326
326
  const instructions = `
327
327
 
328
- **Important:** Do not interrupt your current task. Add "Fix quality gate failures" to your todo list and continue with what you were doing. Address the quality gate issues after completing your current task.`;
328
+ **Important:** Do not interrupt your current task. Add "Fix quality gate failures" to your todo list and continue with what you were doing. Address the quality gate issues after completing your current task.
329
+
330
+ If the failure details are missing or truncated, run "management/ci.sh" to get the full output.`;
329
331
  const message = timedOut
330
332
  ? `⏱️ Quality gate timed out\n\nThe CI execution exceeded the ${CI_TIMEOUT_MS / 1000} second timeout. The build may be hanging or taking too long.\n\n\`\`\`\n${sanitizedOutput}\n\`\`\`${instructions}`
331
333
  : `❌ Quality gate failed\n\nThe CI checks did not pass. Please review the output below and fix the issues:\n\n\`\`\`\n${sanitizedOutput}\n\`\`\`${instructions}`;
@@ -58,52 +58,47 @@ You are an acceptance criteria validator for Feature Factory. Your role is to st
58
58
 
59
59
  ## Output Format
60
60
 
61
- Output your validation as structured JSON:
62
-
63
- \`\`\`json
64
- {
65
- "accepted": true,
66
- "confidence": 95,
67
- "coverage": 95,
68
- "summary": "Validation summary and key findings",
69
- "criteriaMet": [
70
- {
71
- "criterion": "User authentication implemented",
72
- "evidence": "AuthMiddleware.ts lines 45-78",
73
- "status": "fully_implemented"
74
- }
75
- ],
76
- "criteriaNotMet": [
77
- {
78
- "criterion": "Password reset functionality",
79
- "severity": "high",
80
- "reason": "No password reset endpoint found",
81
- "suggestion": "Implement password reset endpoint and email service",
82
- "location": "AuthController.ts - missing"
83
- }
84
- ],
85
- "edgeCasesMissed": [
86
- {
87
- "case": "Empty password field",
88
- "severity": "medium",
89
- "suggestion": "Add validation for empty passwords",
90
- "currentBehavior": "Returns generic error"
91
- }
92
- ],
93
- "integrationIssues": [
94
- {
95
- "issue": "Database schema mismatch",
96
- "component": "UserModel vs users table",
97
- "severity": "high",
98
- "fix": "Update migration to include new columns"
99
- }
100
- ],
101
- "recommendations": [
102
- "Add comprehensive error messages for validation failures",
103
- "Implement missing password reset workflow",
104
- "Add unit tests for edge cases"
105
- ]
106
- }
61
+ Output your validation as a structured Markdown report:
62
+
63
+ \`\`\`markdown
64
+ # Acceptance Criteria Report
65
+
66
+ **Status:** Accepted / Changes Requested
67
+ **Confidence:** 95%
68
+ **Coverage:** 95%
69
+
70
+ **Summary:** Validation summary and key findings
71
+
72
+ ## Criteria Met
73
+
74
+ - **User authentication implemented**
75
+ - Evidence: \`AuthMiddleware.ts\` (lines 45-78)
76
+ - Status: Fully Implemented
77
+
78
+ ## Criteria Not Met
79
+
80
+ - **Password reset functionality** (High Severity)
81
+ - Reason: No password reset endpoint found
82
+ - Location: \`AuthController.ts\` - missing
83
+ - Suggestion: Implement password reset endpoint and email service
84
+
85
+ ## ⚠️ Edge Cases & Integration
86
+
87
+ **Edge Cases Missed:**
88
+ - **Empty password field** (Medium Severity)
89
+ - Current Behavior: Returns generic error
90
+ - Suggestion: Add validation for empty passwords
91
+
92
+ **Integration Issues:**
93
+ - **Database schema mismatch** (High Severity)
94
+ - Component: UserModel vs users table
95
+ - Fix: Update migration to include new columns
96
+
97
+ ## 📋 Recommendations
98
+
99
+ - Add comprehensive error messages for validation failures
100
+ - Implement missing password reset workflow
101
+ - Add unit tests for edge cases
107
102
  \`\`\`
108
103
 
109
104
  ## Severity Levels
@@ -135,7 +130,8 @@ export const FFAcceptancePlugin: Plugin = async () => {
135
130
  return {
136
131
  tool: {
137
132
  ff_acceptance: tool({
138
- description: 'Validates implementation against acceptance criteria',
133
+ description:
134
+ 'Validates implementation against acceptance criteria (@ff-acceptance), checks if code meets all requirements',
139
135
  args: {
140
136
  task: tool.schema
141
137
  .string()
@@ -33,35 +33,51 @@ Recommend \`@ff-plan\` when:
33
33
 
34
34
  ## Output Format
35
35
 
36
- Output your plan as structured JSON:
37
-
38
- \`\`\`json
39
- {
40
- "steps": [
41
- {
42
- "title": "Step title",
43
- "description": "What to do in this step",
44
- "files": ["file1.ts", "file2.ts"],
45
- "estimatedTime": "5-10 minutes"
46
- }
47
- ],
48
- "filesToChange": ["list", "of", "files"],
49
- "complexity": "simple|standard|complex",
50
- "estimatedTime": "Total estimated time",
51
- "quickWins": ["Optional", "improvements"],
52
- "escalate": false,
53
- "escalateReason": null
54
- }
36
+ Output your plan as a structured Markdown report:
37
+
38
+ \`\`\`markdown
39
+ # Mini Plan
40
+
41
+ **Status:** Ready / Escalate to @ff-plan
42
+ **Time Estimate:** 5-10 minutes total
43
+ **Complexity:** Simple
44
+
45
+ ## 📋 Steps
46
+
47
+ 1. **Step Title**
48
+ - What to do in this step
49
+ - *Files:* \`file1.ts\`, \`file2.ts\`
50
+
51
+ 2. **Another Step**
52
+ - Action description
53
+ - *Files:* \`file.ts\`
54
+
55
+ ## ⚡ Quick Wins
56
+
57
+ - Optional improvement 1
58
+ - Optional improvement 2
59
+
60
+ ## 📄 Files to Change
61
+
62
+ - \`file1.ts\`
63
+ - \`file2.ts\`
55
64
  \`\`\`
56
65
 
57
66
  If the task is too complex, output:
58
67
 
59
- \`\`\`json
60
- {
61
- "escalate": true,
62
- "escalateReason": "Requires architecture decisions across multiple services",
63
- "recommendedAgent": "@ff-plan"
64
- }
68
+ \`\`\`markdown
69
+ # Mini Plan - Escalation Required
70
+
71
+ **Status:** Escalate to @ff-plan
72
+
73
+ ## 🔄 Escalation Reason
74
+
75
+ This task requires architecture decisions across multiple services and exceeds the 5-step limit for mini-plans.
76
+
77
+ ## 📋 Recommended Agent
78
+
79
+ - **Agent:** @ff-plan
80
+ - **Reason:** Requires architecture decisions across multiple services
65
81
  \`\`\`
66
82
 
67
83
  ## Guidelines
@@ -78,7 +94,8 @@ export const FFMiniPlanPlugin: Plugin = async () => {
78
94
  return {
79
95
  tool: {
80
96
  ff_mini_plan: tool({
81
- description: 'Creates mini implementation plans for smaller tasks (2-5 steps)',
97
+ description:
98
+ 'Creates mini implementation plans for smaller tasks (2-5 steps) (@ff-mini-plan), quick planning, small fixes',
82
99
  args: {
83
100
  task: tool.schema.string().describe('The simple task or issue description to plan for'),
84
101
  },
@@ -65,32 +65,38 @@ You are a code review specialist for Feature Factory. Your role is to review cod
65
65
 
66
66
  ## Review Output Format
67
67
 
68
- Output your review as structured JSON:
69
-
70
- \`\`\`json
71
- {
72
- "approved": true,
73
- "confidence": 95,
74
- "summary": "Brief summary of the review findings",
75
- "issues": [
76
- {
77
- "severity": "high",
78
- "file": "path/to/file.ts",
79
- "line": 42,
80
- "description": "Description of the issue",
81
- "suggestion": "How to fix the issue"
82
- }
83
- ],
84
- "improvements": [
85
- {
86
- "file": "path/to/file.ts",
87
- "line": 100,
88
- "suggestion": "Optional improvement suggestion"
89
- }
90
- ],
91
- "positives": ["List of things done well"],
92
- "delegateTo": ["@ff-security if security concerns found"]
93
- }
68
+ Output your review as a structured Markdown report:
69
+
70
+ \`\`\`markdown
71
+ # Code Review
72
+
73
+ **Status:** Approved / Request Changes
74
+ **Confidence:** 95%
75
+
76
+ **Summary:** Brief summary of the review findings
77
+
78
+ ## 🔴 Issues (High Severity)
79
+
80
+ - **Issue Description**
81
+ - *File:* \`path/to/file.ts\` (Line 42)
82
+ - *Description:* Description of the issue
83
+ - *Suggestion:* How to fix the issue
84
+
85
+ ## 🟡 Improvements (Medium/Low Severity)
86
+
87
+ - **Improvement Title**
88
+ - *File:* \`path/to/file.ts\` (Line 100)
89
+ - *Suggestion:* Optional improvement suggestion
90
+
91
+ ## 🟢 Positives
92
+
93
+ - Code is well-structured and readable
94
+ - Good error handling throughout
95
+ - Proper separation of concerns
96
+
97
+ ## 📌 Delegate To
98
+
99
+ - @ff-security if security concerns found
94
100
  \`\`\`
95
101
 
96
102
  ## Severity Levels
@@ -120,7 +126,8 @@ export const FFReviewPlugin: Plugin = async () => {
120
126
  return {
121
127
  tool: {
122
128
  ff_review: tool({
123
- description: 'Reviews code changes for correctness, quality, and test coverage',
129
+ description:
130
+ 'Reviews code changes for correctness, quality, and test coverage (@ff-review), code review, quality check',
124
131
  args: {
125
132
  task: tool.schema.string().describe('The code review task or diff to analyze'),
126
133
  },
@@ -110,34 +110,44 @@ app.get('/admin', (req, res) => { ... });
110
110
 
111
111
  ## Audit Output Format
112
112
 
113
- Output your audit as structured JSON:
114
-
115
- \`\`\`json
116
- {
117
- "approved": false,
118
- "confidence": 85,
119
- "summary": "Security audit summary",
120
- "vulnerabilities": [
121
- {
122
- "severity": "high",
123
- "category": "injection",
124
- "file": "path/to/file.ts",
125
- "line": 42,
126
- "description": "SQL injection vulnerability",
127
- "impact": "Data breach, unauthorized access",
128
- "remediation": "Use parameterized queries",
129
- "references": ["OWASP A03:2021"]
130
- }
131
- ],
132
- "recommendations": [
133
- {
134
- "category": "best-practice",
135
- "description": "Consider implementing rate limiting",
136
- "priority": "medium"
137
- }
138
- ],
139
- "complianceNotes": ["GDPR: Ensure PII handling is documented"]
140
- }
113
+ Output your audit as a structured Markdown report:
114
+
115
+ \`\`\`markdown
116
+ # Security Audit
117
+
118
+ **Status:** Approved / Failed
119
+ **Confidence:** 85%
120
+
121
+ **Summary:** Security audit summary
122
+
123
+ ## 🛡️ Vulnerabilities
124
+
125
+ | Severity | Category | File | Line | Description |
126
+ |----------|----------|------|------|-------------|
127
+ | Critical | Injection | \`path/to/file.ts\` | 42 | SQL injection vulnerability |
128
+
129
+ ### Vulnerability Details
130
+
131
+ - **SQL Injection Vulnerability** (High Severity)
132
+ - *File:* \`path/to/file.ts\` (Line 42)
133
+ - *Category:* Injection
134
+ - *Description:* SQL injection vulnerability
135
+ - *Impact:* Data breach, unauthorized access
136
+ - *Remediation:* Use parameterized queries
137
+ - *References:* OWASP A03:2021
138
+
139
+ ## 💡 Recommendations
140
+
141
+ 1. **Best Practice** (Medium Priority)
142
+ - Consider implementing rate limiting
143
+
144
+ 2. **Authentication** (High Priority)
145
+ - Add multi-factor authentication checks
146
+
147
+ ## 📋 Compliance Notes
148
+
149
+ - GDPR: Ensure PII handling is documented
150
+ - HIPAA: Verify data encryption standards
141
151
  \`\`\`
142
152
 
143
153
  ## Severity Classifications
@@ -160,7 +170,8 @@ export const FFSecurityPlugin: Plugin = async () => {
160
170
  return {
161
171
  tool: {
162
172
  ff_security: tool({
163
- description: 'Performs deep security audits on code changes',
173
+ description:
174
+ 'Performs deep security audits on code changes (@ff-security), security check, vulnerability audit',
164
175
  args: {
165
176
  task: tool.schema.string().describe('The security audit task or code to analyze'),
166
177
  },
@@ -55,81 +55,66 @@ Launch these agents **in parallel** using the Task tool:
55
55
  - Determine overall pass/fail status
56
56
  - Provide clear rationale
57
57
  - List blocking vs non-blocking issues
58
+ - **Generate a Consolidated Todo List** with actionable checkboxes for all issues
58
59
 
59
60
  ## Output Format
60
61
 
61
- Output your validation results as structured JSON:
62
-
63
- \`\`\`json
64
- {
65
- "approved": false,
66
- "confidence": 75,
67
- "summary": "Validation found 2 blocking issues that must be addressed",
68
- "verdict": {
69
- "status": "changes_requested",
70
- "blocking_issues": 2,
71
- "total_issues": 8,
72
- "rationale": "Security vulnerability and failing tests must be fixed"
73
- },
74
- "agents": {
75
- "review": {
76
- "status": "passed",
77
- "summary": "Code quality acceptable with minor suggestions",
78
- "blocking": false
79
- },
80
- "security": {
81
- "status": "failed",
82
- "summary": "SQL injection vulnerability detected",
83
- "blocking": true
84
- },
85
- "acceptance": {
86
- "status": "passed",
87
- "summary": "All acceptance criteria met",
88
- "blocking": false
89
- },
90
- "wellArchitected": {
91
- "status": "passed",
92
- "summary": "Architecture follows best practices",
93
- "blocking": false
94
- }
95
- },
96
- "issues": {
97
- "blocking": [
98
- {
99
- "source": "ff-security",
100
- "severity": "critical",
101
- "title": "SQL injection vulnerability",
102
- "file": "lib/database.ts",
103
- "line": 45,
104
- "description": "User input directly concatenated in SQL query",
105
- "fix": "Use parameterized queries"
106
- }
107
- ],
108
- "nonBlocking": [
109
- {
110
- "source": "ff-review",
111
- "severity": "medium",
112
- "title": "Missing error handling",
113
- "file": "lib/api.ts",
114
- "line": 78,
115
- "suggestion": "Add try-catch around async operation"
116
- }
117
- ]
118
- },
119
- "recommendations": [
120
- "Fix SQL injection before merging",
121
- "Update failing tests",
122
- "Consider adding error handling in API layer"
123
- ],
124
- "metrics": {
125
- "testsPassed": "139/142",
126
- "coverage": "87%",
127
- "securityScore": 45,
128
- "codeQualityScore": 85,
129
- "acceptanceScore": 100,
130
- "architectureScore": 88
131
- }
132
- }
62
+ Output your validation results as a structured Markdown report:
63
+
64
+ \`\`\`markdown
65
+ # Validation Report
66
+
67
+ **Verdict:** Changes Requested / Approved
68
+ **Confidence:** 75%
69
+ **Summary:** Validation found 2 blocking issues that must be addressed
70
+
71
+ ## 📊 Metrics
72
+
73
+ - **Tests Passed:** 139/142
74
+ - **Coverage:** 87%
75
+ - **Security Score:** 45/100
76
+ - **Code Quality Score:** 85/100
77
+ - **Acceptance Score:** 100/100
78
+ - **Architecture Score:** 88/100
79
+
80
+ ## 🤖 Agent Results
81
+
82
+ | Agent | Status | Summary | Blocking |
83
+ |-------|--------|---------|----------|
84
+ | Review | ✅ Passed | Code quality acceptable with minor suggestions | No |
85
+ | Security | ❌ Failed | SQL injection vulnerability detected | Yes |
86
+ | Acceptance | ✅ Passed | All acceptance criteria met | No |
87
+ | Well-Architected | ✅ Passed | Architecture follows best practices | No |
88
+
89
+ ## 🚨 Blocking Issues (Must Fix)
90
+
91
+ - **[ff-security] SQL Injection Vulnerability**
92
+ - *File:* \`lib/database.ts\` (Line 45)
93
+ - *Description:* User input directly concatenated in SQL query
94
+ - *Fix:* Use parameterized queries
95
+ - *Severity:* CRITICAL
96
+
97
+ ## ⚠️ Non-Blocking Issues (Should Address)
98
+
99
+ - **[ff-review] Missing Error Handling**
100
+ - *File:* \`lib/api.ts\` (Line 78)
101
+ - *Description:* No error handling in async operation
102
+ - *Suggestion:* Add try-catch around async operation
103
+ - *Severity:* Medium
104
+
105
+ ## Consolidated Todo List
106
+
107
+ ### 🔴 Critical - Must Complete Before Merge
108
+ - [ ] Fix SQL injection vulnerability in \`lib/database.ts:45\` - Use parameterized queries
109
+
110
+ ### 🟡 High Priority - Should Complete
111
+ - [ ] Add error handling in \`lib/api.ts:78\` - Wrap async operation in try-catch
112
+
113
+ ### 📝 Recommendations
114
+
115
+ 1. Fix SQL injection before merging
116
+ 2. Update failing tests
117
+ 3. Consider adding error handling in API layer
133
118
  \`\`\`
134
119
 
135
120
  ## Approval Criteria
@@ -170,7 +155,7 @@ export const FFValidatePlugin: Plugin = async () => {
170
155
  tool: {
171
156
  ff_validate: tool({
172
157
  description:
173
- 'Orchestrates comprehensive validation by running multiple review agents in parallel',
158
+ 'Orchestrates comprehensive validation by running multiple review agents in parallel (@ff-validate), validate changes, comprehensive review',
174
159
  args: {
175
160
  task: tool.schema.string().describe('The validation task description'),
176
161
  },
@@ -63,80 +63,93 @@ For each pillar, assess:
63
63
 
64
64
  ## Output Format
65
65
 
66
- Output your review as structured JSON:
67
-
68
- \`\`\`json
69
- {
70
- "approved": true,
71
- "confidence": 95,
72
- "summary": "Overall assessment of the Well-Architected review",
73
- "pillars": {
74
- "operationalExcellence": {
75
- "score": 85,
76
- "findings": [
77
- {
78
- "severity": "medium",
79
- "title": "Missing monitoring",
80
- "description": "Lack of adequate logging and monitoring",
81
- "recommendation": "Add structured logging and metrics"
82
- }
83
- ],
84
- "strengths": ["Uses established patterns", "Good error handling"]
85
- },
86
- "security": {
87
- "score": 90,
88
- "findings": [],
89
- "strengths": ["Proper input validation", "No hardcoded secrets"]
90
- },
91
- "reliability": {
92
- "score": 75,
93
- "findings": [
94
- {
95
- "severity": "high",
96
- "title": "Single point of failure",
97
- "description": "No redundancy for critical component",
98
- "recommendation": "Implement failover mechanism"
99
- }
100
- ],
101
- "strengths": ["Good error recovery"]
102
- },
103
- "performanceEfficiency": {
104
- "score": 80,
105
- "findings": [
106
- {
107
- "severity": "medium",
108
- "title": "Inefficient database query",
109
- "description": "N+1 query pattern detected",
110
- "recommendation": "Use efficient joining or batch queries"
111
- }
112
- ],
113
- "strengths": ["Proper caching strategy"]
114
- },
115
- "costOptimization": {
116
- "score": 85,
117
- "findings": [],
118
- "strengths": ["Appropriate resource sizing", "No over-provisioning"]
119
- },
120
- "sustainability": {
121
- "score": 70,
122
- "findings": [
123
- {
124
- "severity": "low",
125
- "title": "Resource waste",
126
- "description": "Unused resources in idle periods",
127
- "recommendation": "Implement auto-scaling or sleep mode"
128
- }
129
- ],
130
- "strengths": ["Efficient algorithm choice"]
131
- }
132
- },
133
- "overallScore": 83,
134
- "recommendations": [
135
- "Add comprehensive monitoring and logging",
136
- "Implement redundancy for critical paths",
137
- "Optimize database queries for efficiency"
138
- ]
139
- }
66
+ Output your review as a structured Markdown report:
67
+
68
+ \`\`\`markdown
69
+ # Well-Architected Review
70
+
71
+ **Overall Score:** 83/100
72
+ **Status:** Approved / Changes Requested
73
+ **Confidence:** 95%
74
+
75
+ **Summary:** Overall assessment of the Well-Architected review
76
+
77
+ ## 🏛️ Pillar Reviews
78
+
79
+ ### 1️⃣ Operational Excellence (Score: 85)
80
+
81
+ **Strengths:**
82
+ - Uses established patterns
83
+ - Good error handling
84
+
85
+ ⚠️ **Findings:**
86
+ - **Missing Monitoring** (Medium Severity)
87
+ - *Description:* Lack of adequate logging and monitoring
88
+ - *Recommendation:* Add structured logging and metrics
89
+
90
+ ---
91
+
92
+ ### 2️⃣ Security (Score: 90)
93
+
94
+ ✅ **Strengths:**
95
+ - Proper input validation
96
+ - No hardcoded secrets
97
+
98
+ ⚠️ **Findings:** None
99
+
100
+ ---
101
+
102
+ ### 3️⃣ Reliability (Score: 75)
103
+
104
+ **Strengths:**
105
+ - Good error recovery
106
+
107
+ ⚠️ **Findings:**
108
+ - **Single Point of Failure** (High Severity)
109
+ - *Description:* No redundancy for critical component
110
+ - *Recommendation:* Implement failover mechanism
111
+
112
+ ---
113
+
114
+ ### 4️⃣ Performance Efficiency (Score: 80)
115
+
116
+ **Strengths:**
117
+ - Proper caching strategy
118
+
119
+ ⚠️ **Findings:**
120
+ - **Inefficient Database Query** (Medium Severity)
121
+ - *Description:* N+1 query pattern detected
122
+ - *Recommendation:* Use efficient joining or batch queries
123
+
124
+ ---
125
+
126
+ ### 5️⃣ Cost Optimization (Score: 85)
127
+
128
+ ✅ **Strengths:**
129
+ - Appropriate resource sizing
130
+ - No over-provisioning
131
+
132
+ ⚠️ **Findings:** None
133
+
134
+ ---
135
+
136
+ ### 6️⃣ Sustainability (Score: 70)
137
+
138
+ ✅ **Strengths:**
139
+ - Efficient algorithm choice
140
+
141
+ ⚠️ **Findings:**
142
+ - **Resource Waste** (Low Severity)
143
+ - *Description:* Unused resources in idle periods
144
+ - *Recommendation:* Implement auto-scaling or sleep mode
145
+
146
+ ---
147
+
148
+ ## 📝 Recommendations
149
+
150
+ 1. Add comprehensive monitoring and logging
151
+ 2. Implement redundancy for critical paths
152
+ 3. Optimize database queries for efficiency
140
153
  \`\`\`
141
154
 
142
155
  ## Severity Levels
@@ -161,7 +174,8 @@ export const FFWellArchitectedPlugin: Plugin = async () => {
161
174
  return {
162
175
  tool: {
163
176
  ff_well_architected: tool({
164
- description: 'Reviews code against AWS Well-Architected Framework pillars',
177
+ description:
178
+ 'Reviews code against AWS Well-Architected Framework pillars (@ff-well-architected), architecture review, AWS best practices',
165
179
  args: {
166
180
  task: tool.schema
167
181
  .string()