aradotso/trending-skills/kwcode-local-coding-agent
Claude Code and agent skill by aradotso/trending-skills
- community
Checking that the SKILL.md file is still in the repository.
KWCode (天工开物) — a CLI coding agent optimized for local open-source models (8B-30B), featuring deterministic expert pipelines, BM25+AST code location, runtime debugging, and a self-improving flywheel — all running fully offline.
Install
npx vskill@latest install aradotso/trending-skills/kwcode-local-coding-agentSKILL.md
KWCode Local Coding Agent
Skill by ara.so — Daily 2026 Skills collection.
KWCode is a CLI coding agent designed specifically for local open-source models (8B–30B parameters). Unlike cloud-first agents (Claude Code, Cursor), KWCode uses a deterministic expert pipeline where the LLM only classifies and generates — all routing, validation, and decision-making is handled by deterministic code. This lets small models succeed where they would otherwise hallucinate or loop.
Installation
Requirements: Python 3.10+, any OpenAI-compatible API (local or cloud).
Quick Start
On first launch, KWCode runs a setup wizard to configure your model connection.
Configuration
Connect to a local inference engine (Ollama example)
Connect to a cloud API (no local GPU needed)
Environment variable approach
Recommended models by VRAM
| VRAM | Model | |
|---|---|---|
| 4 GB | gemma3:4b | |
| 8 GB | qwen3:8b | |
| 16 GB | qwen3:14b | |
| 24 GB+ | qwen3:30b-a3b |
Key Commands
All commands are entered inside the kwcode REPL (> prompt).
Core task commands
Planning & safety
Shows execution steps and risk level (High / Medium / Low) before touching any file. Requires confirmation.
Manually snapshot current project state. KWCode also auto-snapshots before each task.
Restore to the last checkpoint if a task goes wrong.
Multi-task orchestration (DAG)
Interactive multi-task example:
Search enhancement
Without Docker, KWCode falls back to DuckDuckGo automatically.
Statistics & flywheel
Shows tasks completed, estimated time saved, and flywheel expert promotions.
API management
Project Configuration Files
KWCode looks for these files in your project root and injects them as context:
| File | Purpose | |
|---|---|---|
KWCODE.md | Project-level rules, conventions, coding standards. Injected per task type. | |
PROJECT.md | Auto-maintained project summary (Layer 1 memory). | |
EXPERT.md | Domain expert knowledge accumulated by the flywheel (Layer 2). | |
PATTERN.md | Recurring code patterns learned from your project (Layer 3). | |
REFLECTION.md | Structured log of past failures and lessons (auto-updated). |
Example KWCODE.md
How the Expert Pipeline Works
Every user input flows through five deterministic stages:
The LLM is only called at Generator and Reviewer stages. Everything else is deterministic Python.
Code Examples
Trigger a bugfix task
KWCode will:
- BM25-locate
user_service.py+ trace call graph for hidden dependencies - Generate a minimal patch (only changed lines)
- Run
pytestautomatically - If failing: inject runtime variable values via
sys.settraceand retry
Trigger a test generation task
KWCode injects the TestGen SKILL.md, locates PaymentProcessor via AST, generates tests, and verifies they pass.
Use the Python API (programmatic access)
Multi-task via Python API
Three-Stage Retry Logic
When Verifier fails, KWCode does not repeat the same attempt:
| Attempt | Strategy | |
|---|---|---|
| 1st | Normal task description sent to Generator | |
| 2nd | Error message + sys.settrace runtime variable dump injected; LLM reflects on why attempt 1 failed | |
| 3rd | Minimal-change constraint enforced; Debug Subagent provides full pytest --tb=long trace |
After 3 failures, task is marked failed and rolled back to checkpoint.
Troubleshooting
Model returns garbled output or loops
Check that your local inference engine is running:
KWCode can't find the right file
BM25 needs indexed content. If your project is new:
If the file uses an unusual extension, add it to KWCODE.md:
pytest not found / tests not running
Or set in KWCODE.md:
Search not working (DuckDuckGo blocked)
Context window overflow with large projects
KWCode auto-compresses context when it approaches the limit, but you can tune aggressiveness:
Flywheel expert not promoting
Promotion requires: ≥5 successes of the same task type → backtest pass rate ≥ baseline → 10-run A/B test with >10% improvement. Check flywheel status:
Skill Domains (SKILL.md Library)
KWCode ships with 15 built-in domain skills injected at Generator stage:
| Skill | Triggers | |
|---|---|---|
BugFix | fix, bug, error, crash, 修复 | |
FastAPI | fastapi, route, endpoint, async | |
TestGen | test, pytest, unittest, 测试 | |
API | api, rest, http, request | |
DeepSeekAPI | deepseek, r1, v3 | |
Docstring | docstring, document, 注释 | |
MyBatis | mybatis, mapper, xml, sql | |
Office | excel, word, ppt, spreadsheet | |
Refactor | refactor, clean, extract, 重构 | |
SpringBoot | spring, springboot, java | |
SQLOpt | sql, query, optimize, index | |
TypeHint | type hint, annotation, mypy | |
UniApp | uniapp, vue, miniprogram |
Custom skills can be added by placing a SKILL_<name>.md file in your project root or ~/.kwcode/skills/.
Data & Privacy
- All processing is local. No code, file contents, or task descriptions leave your machine.
- Model inference: your local engine or your chosen cloud API endpoint only.
- Search: SearXNG self-hosted (recommended) or DuckDuckGo (queries only, no code).
- Statistics: stored in
~/.kwcode/stats.db(SQLite, local only). - Reflection/memory files: written to your project directory, fully under your control.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kwcode-local-coding-agent/SKILL.md
Popularity
- Repository stars
- 70
- Repository forks
- 13
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 8 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aradotso/trending-skills/kwcode-local-coding-agent)