Skip to content

Commit 6103fd2

Browse files
wishket-pjwJeremyDev87
authored andcommitted
feat: add OpenCode/Crush adapter support and mode-specific agents
- Add OpenCode/Crush AI editor support and implement mode-specific agents for PLAN/ACT/EVAL - Add OpenCode/Crush configuration files (opencode.json, crush.json) - Environment variable-based secret management (FIGMA_API_KEY, GITHUB_TOKEN) - MCP server integration configuration - Add OpenCode custom commands (.opencode/commands/) - plan-feature.md: PLAN mode workflow - implement-tdd.md: ACT mode TDD implementation code-review.md: EVAL mode code review - Add OpenCode adapter documentation (opencode.md, opencode-skills.md) - Add mode-specific agents (plan-mode.json, act-mode.json, eval-mode.json) - Enhance keyword service: Add agent info and delegate info return functionality - Strengthen rules service tests close #127
1 parent 901e4c5 commit 6103fd2

21 files changed

Lines changed: 2808 additions & 21 deletions

.opencode/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# OpenCode Integration for Codingbuddy
2+
3+
This directory contains OpenCode-specific configuration and templates for integrating with the `.ai-rules` system.
4+
5+
## Quick Start
6+
7+
1. **Use existing configuration**: The main `opencode.json` is already configured
8+
2. **For Crush users**: Use `crush.json` instead
9+
3. **Custom commands**: Available in `commands/` directory
10+
11+
## Available Files
12+
13+
### Configuration
14+
- `../opencode.json` - Main OpenCode configuration with .ai-rules integration
15+
- `../crush.json` - Crush-compatible configuration
16+
17+
### Custom Commands
18+
- `commands/plan-feature.md` - PLAN mode workflow command
19+
- `commands/implement-tdd.md` - ACT mode TDD implementation
20+
- `commands/code-review.md` - EVAL mode code review
21+
22+
## Usage Examples
23+
24+
### Basic Workflow
25+
```bash
26+
# 1. Planning
27+
/agent plan
28+
새로운 기능을 계획해줘
29+
30+
# 2. Implementation
31+
/agent build
32+
ACT
33+
34+
# 3. Review
35+
/agent reviewer
36+
EVAL
37+
```
38+
39+
### Using Skills
40+
```bash
41+
/skill brainstorming "대시보드 UI"
42+
/skill test-driven-development "API 구현"
43+
/skill systematic-debugging "성능 이슈"
44+
```
45+
46+
### Custom Commands
47+
```bash
48+
/plan-feature "사용자 인증"
49+
/implement-tdd
50+
/code-review
51+
```
52+
53+
## Agent Overview
54+
55+
| Agent | Mode | Purpose |
56+
|-------|------|---------|
57+
| `plan` | PLAN | Analysis and planning (read-only) |
58+
| `build` | ACT | Full development with file editing |
59+
| `reviewer` | EVAL | Code quality evaluation |
60+
| `architect` | Specialist | Architecture guidance |
61+
| `security` | Specialist | Security assessment |
62+
| `performance` | Specialist | Performance optimization |
63+
| `a11y` | Specialist | Accessibility compliance |
64+
65+
All agents respond in Korean (한국어) and follow .ai-rules standards.
66+
67+
## MCP Integration
68+
69+
The configuration includes these MCP servers:
70+
- `codingbuddy` - Rules search and agent details
71+
- `context7` - Documentation lookup
72+
- `github` - GitHub integration
73+
- `filesystem` - File system operations
74+
75+
## Troubleshooting
76+
77+
### Common Issues
78+
79+
**Agent not responding in Korean:**
80+
- Verify OpenCode Override includes Korean setting
81+
- Check agent prompt configuration
82+
83+
**Permission denied:**
84+
- Use `/agent build` for file editing
85+
- Use `/agent plan` for read-only analysis
86+
87+
**MCP connection issues:**
88+
- Ensure `npx codingbuddy@latest` works
89+
- Check MCP server logs
90+
91+
### Getting Help
92+
93+
1. Read the full guide: `packages/rules/.ai-rules/adapters/opencode.md`
94+
2. Check skills documentation: `packages/rules/.ai-rules/adapters/opencode-skills.md`
95+
3. Review .ai-rules core: `packages/rules/.ai-rules/rules/core.md`
96+
97+
## Migration Notes
98+
99+
### From OpenCode to Crush
100+
- Copy settings from `opencode.json` to `crush.json`
101+
- Update schema reference
102+
- Install Crush: `brew install charmbracelet/tap/crush`
103+
104+
### Adding New Agents
105+
- Define in `agent` section of configuration
106+
- Include Korean language override
107+
- Set appropriate permissions
108+
- Reference .ai-rules agent JSON files

.opencode/commands/code-review.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Code Review Command
2+
3+
## Description
4+
Comprehensive code quality evaluation using Code Reviewer Agent framework.
5+
6+
## Command
7+
```bash
8+
# Read evaluation framework
9+
READ packages/rules/.ai-rules/agents/code-reviewer.json
10+
11+
# Analyze implementation
12+
ANALYZE recent changes:
13+
- Git diff and status
14+
- Code quality metrics
15+
- Test coverage report
16+
- Architecture compliance
17+
18+
# Apply anti-sycophancy rules
19+
EVALUATE objectively:
20+
- Find at least 3 improvement areas
21+
- Use evidence-based assessment
22+
- Reference measurable metrics
23+
- Challenge design decisions
24+
25+
# Multi-dimensional review
26+
ASSESS from perspectives:
27+
- Code Quality (SOLID, DRY, complexity)
28+
- Architecture (layer boundaries, dependencies)
29+
- Security (XSS/CSRF, authentication)
30+
- Performance (bundle size, optimization)
31+
- Accessibility (WCAG 2.1 AA compliance)
32+
- Test Quality (90%+ coverage, TDD workflow)
33+
34+
# Generate improvement plan
35+
CREATE todo list with priorities:
36+
- Critical issues (must fix)
37+
- High priority improvements
38+
- Medium/low enhancements
39+
40+
# Output in Korean
41+
RESPOND in Korean (한국어)
42+
```
43+
44+
## Usage
45+
```bash
46+
# In OpenCode CLI
47+
/code-review
48+
```
49+
50+
## Anti-Sycophancy Rules
51+
- No praise without evidence
52+
- Start with problems, not praise
53+
- Identify measurable gaps
54+
- Provide actionable solutions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Implement TDD Command
2+
3+
## Description
4+
Execute TDD workflow following Red → Green → Refactor cycle with .ai-rules standards.
5+
6+
## Command
7+
```bash
8+
# Read TDD guidelines
9+
READ packages/rules/.ai-rules/rules/augmented-coding.md
10+
11+
# Follow TDD cycle
12+
IMPLEMENT using TDD cycle:
13+
1. RED: Write failing test
14+
2. GREEN: Minimal implementation
15+
3. REFACTOR: Improve structure
16+
4. COMMIT: After green phase
17+
18+
# Quality checks
19+
MAINTAIN:
20+
- TypeScript strict mode (no any)
21+
- 90%+ test coverage
22+
- Pure/impure function separation
23+
- SOLID principles
24+
25+
# Run tests after each step
26+
RUN tests and verify coverage
27+
28+
# Output in Korean
29+
RESPOND in Korean (한국어)
30+
```
31+
32+
## Usage
33+
```bash
34+
# In OpenCode CLI
35+
/implement-tdd
36+
```
37+
38+
## Quality Standards
39+
- No mocking principle
40+
- Real API integration only
41+
- Evidence-based testing
42+
- Incremental commits

.opencode/commands/plan-feature.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# PLAN Feature Command
2+
3+
## Description
4+
Analyze requirements and create structured implementation plan following .ai-rules standards.
5+
6+
## Command
7+
```bash
8+
# Read context
9+
READ packages/rules/.ai-rules/rules/core.md
10+
READ packages/rules/.ai-rules/rules/project.md
11+
READ packages/rules/.ai-rules/rules/augmented-coding.md
12+
13+
# Analyze project state
14+
RUN git status
15+
RUN git log --oneline -10
16+
17+
# Create plan
18+
PLAN implementation for: $1
19+
- Follow TDD cycle for core logic
20+
- Use Test-After for UI components
21+
- Maintain 90%+ test coverage
22+
- Apply SOLID principles
23+
- Generate todo list with priorities
24+
- Include risk assessment
25+
26+
# Output in Korean
27+
RESPOND in Korean (한국어)
28+
```
29+
30+
## Usage
31+
```bash
32+
# In OpenCode CLI
33+
/plan-feature "사용자 등록 기능"
34+
```
35+
36+
## Expected Output
37+
- Structured PLAN mode response
38+
- Todo list creation using todo_write tool
39+
- TDD vs Test-After strategy decision
40+
- File structure planning
41+
- Quality checklist

0 commit comments

Comments
 (0)