ocs-stats
v1.2.6
Published
OpenCode Skills - One-click installer with gamified XP stats
Downloads
1,237
Maintainers
Readme
OpenCode Skills & Agents
A collection of reusable skills and agents for OpenCode - an AI-powered development assistant that runs in your terminal.
What This Does
When you add these files to your project, OpenCode will:
- Follow your coding conventions (formatting, patterns, etc.)
- Write commit messages in your preferred format
- Audit your code for security vulnerabilities
- Use proper patterns for your tech stack
Installation
Method 1: NPX (Recommended)
cd /path/to/your/project
npx ocs-statsThat's it! The .opencode folder will be created in your project.
Global install (shared across all projects):
npx ocs-stats --globalMethod 2: Download ZIP
- Click the green "Code" button at the top of this page
- Select "Download ZIP"
- Extract the ZIP file
- Copy the
templates/.opencodefolder to your project root
your-project/
├── .opencode/ ← Paste this folder here
├── src/
├── package.json
└── ...Method 3: Clone & Copy
git clone https://github.com/Zen0space/opencode-skills.git
cp -r opencode-skills/templates/.opencode /path/to/your/project/Verify Installation
cd /path/to/your/project
opencodeOpenCode automatically loads any .opencode folder in your project root.
Check Your Progress
Use the stats command to view your agent progress:
# Security agent
npx ocs-stats stats
# Testing agent
npx ocs-stats stats testingExample output:
╔══════════════════════════════════════╗
║ SECURITY AGENT ║
╠══════════════════════════════════════╣
║ Level 1 - Novice ║
║ XP: [█████████░░░░░░░░] 85/150 ║
║ Progress: 57% ║
║ ║
║ Stats: ║
║ * Issues Fixed: 4 ║
║ * Audits Done: 2 ║
║ * Patterns Added: 1 ║
║ * XP Penalties: 0 ║
╚══════════════════════════════════════╝Update Skills
npx ocs-stats updateWhat's Included
Agents
| Agent | Description |
|-------|-------------|
| security | Security expert with XP-based leveling system for auditing and fixing vulnerabilities |
| testing | Testing expert for unit, integration, and E2E tests with Playwright integration |
Skills
| Skill | Description |
|-------|-------------|
| commit | Commit message conventions (type(scope): description format) |
| memories | Session memory for tracking work context and pending tasks |
| mobile | Mobile development (React Native, Flutter, Swift) |
| security | Security patterns, auth approach, and anti-patterns |
| testing | Testing patterns (Vitest, Jest, React Testing Library, Playwright) |
| webapp | Web development (React, Vue, Svelte, Angular) |
Customization
Understand Session Memory
The memories skill tracks your current work session:
- Current Focus: What you're actively working on
- Recent Work: Last changes made
- Pending Tasks: TODOs to complete
- Context Notes: Important decisions and gotchas
The agent reads and updates this file automatically. You can also edit it manually.
Update Commit Conventions (Optional)
Edit .opencode/skills/commit/SKILL.md if you use different commit formats.
Remove What You Don't Need
# Remove mobile skill if you're not building a mobile app
rm -rf .opencode/skills/mobile
# Remove security agent if you don't need security audits
rm -rf .opencode/agents/security
rm -rf .opencode/securitySecurity Agent Features
The security agent includes an XP-based leveling system that tracks your progress:
| Level | Title | XP Required | |-------|-------|-------------| | 1 | Novice | 0 | | 2 | Apprentice | 150 | | 3 | Practitioner | 450 | | 4 | Expert | 900 | | 5 | Master | 1,500 | | 6 | Grandmaster | 3,000 |
XP Awards (Fix-Only System)
| Action | XP | |--------|-----| | Fix critical issue | +60 XP | | Fix high issue | +35 XP | | Fix medium issue | +15 XP | | Fix low issue | +10 XP | | Add security pattern | +30 XP | | Complete package audit | +75 XP |
Preflight Checklist
Before risky operations (auth changes, DB schema, middleware), the agent:
- Shows a dry-run preview
- Confirms user permission
- Documents rollback plan
Testing Agent Features
The testing agent helps you write tests with an XP-based leveling system:
| Level | Title | XP Required | Focus | |-------|-------|-------------|-------| | 1 | Novice | 0 | Basic unit tests | | 2 | Apprentice | 150 | Integration tests | | 3 | Practitioner | 450 | E2E tests | | 4 | Expert | 900 | Test patterns & mocking | | 5 | Master | 1,500 | Full coverage strategies | | 6 | Grandmaster | 3,000 | Testing excellence |
XP Awards
| Action | XP | |--------|-----| | Write unit test | +10 XP | | Write integration test | +15 XP | | Write E2E test | +20 XP | | Fix broken test | +10 XP | | Add test pattern | +30 XP | | Complete package test suite | +100 XP |
Playwright Integration
When you need E2E testing:
- The testing agent checks for Playwright MCP
- If not configured, prompts you to enable it
- Creates
opencode.jsonwith Playwright MCP config - Installs
@playwright/testand browser binaries
File Structure
.opencode/
├── agents/
│ ├── security.md # Security audit agent
│ └── testing.md # Testing agent
├── skills/
│ ├── commit/SKILL.md # Commit conventions
│ ├── memories/SKILL.md # Session memory (auto-updated)
│ ├── mobile/SKILL.md # Mobile patterns (RN, Flutter, Swift)
│ ├── security/SKILL.md # Security patterns
│ ├── testing/SKILL.md # Testing patterns
│ └── webapp/SKILL.md # Web patterns (React, Vue, Svelte, Angular)
├── security/
│ ├── xp.json # XP tracking (auto-updated)
│ └── knowledge.md # Accumulated findings (auto-updated)
└── testing/
├── xp.json # Testing XP tracking (auto-updated)
└── knowledge.md # Testing patterns & lessons (auto-updated)For Contributors
opencode-skills/
├── package.json # npm package config
├── bin/cli.js # CLI entry point
├── src/ # Source files
│ ├── init.js
│ ├── display.js
│ └── stats.js
├── templates/ # Files copied to user projects
│ ├── agents/
│ │ ├── security.md
│ │ └── testing.md
│ ├── skills/
│ ├── security/
│ └── testing/
├── README.md
└── LICENSEPublishing to npm:
npm login
npm publishTroubleshooting
OpenCode not finding my skills
- Make sure
.opencodefolder is in your project root (same level aspackage.json) - Check that skill files are named
SKILL.md(uppercase)
Skills not working as expected
- Open the
SKILL.mdfile and verify the content - Make sure the frontmatter (between
---) is valid YAML
Want to reset security XP?
Delete the tracking files and OpenCode will recreate them:
rm .opencode/security/xp.json
rm .opencode/security/knowledge.mdWant to reset testing XP?
rm .opencode/testing/xp.json
rm .opencode/testing/knowledge.mdContributing
Feel free to submit issues and pull requests to improve these skills and agents.
License
MIT License - see LICENSE for details.
