xiaohongshu
xiaohongshu
dev_invoke_kimi-cli
Delegate testing, QA, and code review tasks to Opencode CLI using Kimi K2.5 model via markdown file handoff. Write test request to TASK.md, Opencode with Kimi K2.5 generates tests/reviews, outputs to OUTPUT.md. Use for test generation, QA verification, edge case detection, code coverage analysis,...
Full skill instructions
Delegate testing, quality assurance, and code review tasks to Opencode CLI using the Kimi K2.5 model via markdown files for input and output.
Claude Code Opencode CLI + Kimi K2.5
| |
+-- Write TASK.md ------------------+
| (test/review requirements) |
| |
+-- Execute: opencode run -m |
| opencode/kimi-k2.5-free |
| "Read TASK.md..." |
| |
| +-- Reads TASK.md
| +-- Generates tests/review
| +-- Writes OUTPUT.md
| |
+-- Read OUTPUT.md <----------------+
| (tests + findings + results) |
v v
Benefits:
| Model | Provider | Use Case | Status |
|---|---|---|---|
opencode/kimi-k2.5-free | Opencode (Moonshot) | Recommended. Free tier, 2,000 req/day, excellent for testing/QA | ✅ Verified |
opencode/kimi-k2.5 | Opencode (Moonshot) | Paid tier with higher rate limits | ✅ Available |
togetherai/moonshotai/Kimi-K2.5 | Together.ai | Alternative provider, same model quality | ✅ Verified |
togetherai/moonshotai/Kimi-K2-5 | Together.ai | Alternative naming convention | ✅ Available |
Default: opencode/kimi-k2.5-free for testing/QA tasks.
Recommendation: Use opencode/kimi-k2.5-free for all testing and QA tasks. Kimi K2.5 excels at:
opencode/kimi-k2.5-free) when:togetherai/moonshotai/Kimi-K2.5) when:opencode run -m opencode/kimi-k2.5-free \
"Read TASK.md in the current directory. Follow the testing instructions. Write all results to OUTPUT.md."
opencode run -m togetherai/moonshotai/Kimi-K2.5 \
"Read TASK.md in the current directory. Follow the testing instructions. Write all results to OUTPUT.md."
# Start opencode TUI with Kimi K2.5 (Opencode)
cd /path/to/project && opencode . -m opencode/kimi-k2.5-free
# Or with Together.ai
cd /path/to/project && opencode . -m togetherai/moonshotai/Kimi-K2.5
# Create a prompt file
echo "Generate unit tests for the Calculator class" > prompt.txt
cat prompt.txt | opencode run -m opencode/kimi-k2.5-free
| Flag | Purpose |
|---|---|
-m, --model | Model to use (e.g., opencode/kimi-k2.5-free) |
-C, --continue | Continue the last session |
-s, --session | Session ID to resume |
--prompt | Initial prompt to send |
-h, --help | Show help |
# Task: [Test Generation / Code Review / QA]
## Objective
[Clear statement of testing/review goal]
### Examples:
- Generate unit tests for user authentication module
- Review payment processing code for security issues
- Create integration tests for API endpoints
- Perform QA verification of search functionality
## Code to Test/Review
### File: src/auth/login.ts
```typescript
// Paste code here
// Paste supporting code
Rate findings: CRITICAL | HIGH | MEDIUM | LOW
tests/ or __tests__/ directory[filename].test.[ext] or [filename].spec.[ext]Write to OUTPUT.md:
## Output File Template (OUTPUT.md)
Opencode with Kimi K2.5 should produce:
```markdown
# Results: [Task Title]
## Summary
[Brief overview of what was accomplished]
## Generated Tests (if applicable)
### Test Files Created
| File | Description | Coverage |
|------|-------------|----------|
| `tests/auth/login.test.ts` | Unit tests for login | 95% |
| `tests/auth/validate.test.ts` | Validation tests | 88% |
### Test Scenarios
#### Happy Path
1. [Test case description]
- Input: [example input]
- Expected: [expected output]
#### Edge Cases
1. [Edge case description]
- Input: [boundary value]
- Expected: [expected behavior]
#### Error Cases
1. [Error scenario]
- Input: [invalid input]
- Expected: [error handling]
## Review Findings (if applicable)
| Severity | Location | Issue | Recommendation |
|----------|----------|-------|----------------|
| CRITICAL | login.ts:45 | SQL injection | Use parameterized queries |
| HIGH | auth.ts:23 | Missing rate limiting | Add rate limiter |
| MEDIUM | users.ts:78 | No input validation | Add Zod validation |
| LOW | utils.ts:12 | Magic number | Extract constant |
## Code Coverage Analysis
- **Overall:** 87%
- **Critical paths:** 95%
- **Uncovered lines:** [list of uncovered code sections]
## Issues Encountered
- [Any problems and resolutions]
## Recommendations
1. [Priority action items]
2. [Secondary improvements]
3. [Testing best practices to adopt]
## Session
Session ID: `<session_id>` (for follow-up)
# Task: Generate Unit Tests for User Authentication
## Objective
Create comprehensive unit tests for the user authentication module covering login, registration, and password reset.
## Code to Test
### File: src/auth/auth.service.ts
```typescript
export class AuthService {
async login(email: string, password: string): Promise<AuthResult> {
const user = await this.userRepo.findByEmail(email);
if (!user) throw new UnauthorizedError('Invalid credentials');
const valid = await bcrypt.compare(password, user.passwordHash);
if (!valid) throw new UnauthorizedError('Invalid credentials');
const token = jwt.sign({ userId: user.id }, process.env.JWT_SECRET);
return { token, user: this.sanitizeUser(user) };
}
async register(email: string, password: string): Promise<User> {
const existing = await this.userRepo.findByEmail(email);
if (existing) throw new ConflictError('Email already exists');
const hash = await bcrypt.hash(password, 10);
return this.userRepo.create({ email, passwordHash: hash });
}
}
tests/auth/Write to OUTPUT.md with test scenarios, generated test code, coverage analysis, and any edge cases identified.
#### 2. Execute Opencode with Kimi K2.5
```bash
opencode run -m opencode/kimi-k2.5-free \
"Read TASK.md in the current directory. Follow the instructions to generate comprehensive unit tests. Write all results to OUTPUT.md."
Review the generated tests, check coverage, and integrate into the test suite.
# Task: Security Review of Payment Processing
## Objective
Perform security-focused code review of payment processing module.
## Code to Review
### File: src/payments/payment.service.ts
[Code here...]
## Review Criteria
Rate findings: CRITICAL | HIGH | MEDIUM | LOW
### Security Focus
- Input validation
- SQL injection risks
- Authentication/authorization
- Sensitive data handling
- PCI compliance
## Context
- B2B SaaS application
- Handles credit card data
- SOC2 compliance required
## Output Format
Write security findings to OUTPUT.md with severity ratings and specific fix recommendations.
opencode run -m opencode/kimi-k2.5-free \
"Read TASK.md, perform security review following the criteria, write findings to OUTPUT.md"
Claude Code reads OUTPUT.md and addresses security issues.
# For Opencode provider (Moonshot AI)
MOONSHOT_API_KEY=xxx # Kimi models via Opencode (if needed)
# For Together.ai provider
TOGETHER_API_KEY=xxx # Kimi models via Together.ai
# Alternative providers
OPENAI_API_KEY=xxx # OpenAI models
GEMINI_API_KEY=xxx # Google Gemini models
Note: Set the appropriate API key for your chosen provider. Opencode will use the key matching the model provider prefix (e.g., togetherai/* models need TOGETHER_API_KEY).
| Limit | Value (Free Tier) |
|---|---|
| Requests/minute | 60 |
| Requests/day | 2,000 |
| Tokens/request | 128K context window |
| Limit | Value |
|---|---|
| Requests/minute | Varies by plan |
| Requests/day | Varies by plan |
| Tokens/request | 128K context window |
Note: Together.ai rate limits depend on your account tier. Check your Together.ai dashboard for current limits.
| Provider | Model Path | API Key | Free Tier |
|---|---|---|---|
| Opencode | opencode/kimi-k2.5-free | Not needed* | 2,000 req/day |
| Opencode | opencode/kimi-k2.5 | Not needed* | Paid |
| Together.ai | togetherai/moonshotai/Kimi-K2.5 | TOGETHER_API_KEY | Varies |
*Opencode may use built-in credits or require authentication via opencode auth
| Task | Kimi K2.5 | Gemini | Codex |
|---|---|---|---|
| Test generation | ✅ | ✅ | ✅ |
| Edge case detection | ✅ | ✅ | ⚠️ |
| Code coverage analysis | ✅ | ✅ | ⚠️ |
| QA verification | ✅ | ✅ | ⚠️ |
| Security-focused code review | ✅ | ✅ | ⚠️ |
| General code review | ✅ | ✅ | ⚠️ |
| Test maintenance | ✅ | ✅ | ✅ |
| Implementation | ⚠️ | ⚠️ | ✅ |
| Refactoring | ⚠️ | ⚠️ | ✅ |
| Large codebase analysis | ✅ | ✅ | ⚠️ |
| Documentation review | ✅ | ✅ | ⚠️ |
Legend:
Use Kimi K2.5 (via Opencode/Together.ai) when:
Use Gemini (via Gemini CLI) when:
Use Codex (via Codex CLI) when:
Works well with:
dev_invoke_gemini-cli - Cross-verify test coverage with Geminidev_invoke_codex-cli - Implement fixes after Kimi identifies issuesusing-git-worktrees - Create isolated workspace for test developmenttriple-model-code-review - Multi-model validationSequence example:
1. Kimi K2.5: Generate tests → Identify uncovered edge cases
2. Codex: Implement missing edge case handling
3. Kimi K2.5: Verify fixes and regenerate tests
4. Gemini: Review final implementation
opencode/kimi-k2.5-free not just kimi-k2.5run command fails, use cat prompt.txt | opencode run ...opencode . -m <model> for complex tasksSolution: Use interactive mode instead:
opencode . -m opencode/kimi-k2.5-free
Solution: This is cosmetic - the output is still generated. Use the interactive mode or piping method.
Solution: Set the appropriate environment variable:
export TOGETHER_API_KEY=your_key_here
# or
export MOONSHOT_API_KEY=your_key_here
opencode --continue to resume last sessionopencode -s <session_id> to resume specific sessionxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience