coding-strategy
Consult before ANY coding task. Chooses the optimal coding agent strategy based on task complexity, available free tokens, parallelism potential, and provider quotas. Covers: OpenClaw sub-agents, Codex CLI, Claude Flow swarms/hive-minds, Jules (Google), GitHub Copilot coding models, Augment Code, Kimi K2.5, and OpenAI gpt-5.3-codex. All agents must read this before writing code.
What this skill does
# Coding Strategy Skill
**Read this before ANY coding task.** Even small ones. The goal: maximize free tokens, spread load across providers, and pick the right tool for the job.
---
## Provider Inventory
### Tier 1 — Free / Subscription-Included (use first)
| Provider | Access | Best For | How to Invoke |
|----------|--------|----------|---------------|
| **GitHub Copilot** | Token auth (subscription) | Fast tasks, code completion, reviews | `sessions_spawn` with `model: "github-copilot/claude-sonnet-4.5"` or any copilot model |
| **OpenAI Codex CLI** | OAuth ($20/mo subscription) | Complex single-file tasks, full-auto mode | `exec pty:true command:"codex exec --full-auto 'prompt'" workdir:/path` |
| **Kimi K2.5** | API key (kimi-coding) | Reasoning-heavy tasks, architecture, large context | `sessions_spawn` with `model: "kimi-coding/k2p5"` |
| **Jules** (Google) | API key: `op://DeLoSecrets/Jules/API Key` | Async background coding, PR generation | See Jules section below |
| **Augment (auggie)** | CLI at `~/.bun/bin/auggie` | Code generation, refactoring, indexing | See Augment section below |
### Tier 2 — Pay-per-token (use intentionally)
| Provider | Access | Best For | Cost |
|----------|--------|----------|------|
| **Anthropic Sonnet** | Token auth | Complex multi-step coding, tool use | Moderate |
| **Anthropic Opus** | Token auth | Architecture decisions, hard debugging | Expensive — use sparingly |
| **OpenAI gpt-5.3-codex** | API key | Heavy coding, long context | Moderate-high |
| **Google Gemini Pro** | Gemini CLI auth | Large context analysis, doc generation | Moderate |
### Tier 3 — Orchestration (for complex multi-file work)
| Tool | What It Does | When to Use |
|------|-------------|-------------|
| **Claude Flow Swarm** | 15-agent hierarchical mesh | Large features spanning many files |
| **Claude Flow Hive-Mind** | Queen-led consensus coordination | Architecture decisions, code review |
| **OpenClaw sub-agents** | `sessions_spawn` parallel workers | Independent tasks that don't need shared state |
---
## Decision Matrix
### Step 1: Classify the task
| Task Type | Examples | Complexity |
|-----------|----------|------------|
| **Trivial** | Fix a typo, add an import, rename variable | Single file, <10 lines |
| **Small** | Add a function, write a test, fix a bug | Single file, <100 lines |
| **Medium** | New component, API endpoint, refactor module | 2-5 files, <500 lines |
| **Large** | New feature, service, cross-cutting refactor | 5-20 files, architecture changes |
| **Epic** | New product scaffold, major migration | 20+ files, multi-day |
### Step 2: Pick the strategy
| Complexity | Strategy | Provider Priority |
|------------|----------|-------------------|
| **Trivial** | Do it inline (you ARE a coding agent) | No external agent needed |
| **Small** | Single sub-agent | GitHub Copilot → Kimi K2.5 → Codex CLI |
| **Medium** | Single sub-agent OR Codex CLI (full-auto) | Codex CLI → Kimi K2.5 → Sonnet sub-agent |
| **Large** | Claude Flow swarm OR parallel sub-agents | Claude Flow → parallel Codex instances → Jules (async) |
| **Epic** | Claude Flow hive-mind + parallel Codex + Jules | All hands on deck — spread across every provider |
### Step 3: Maximize free tokens
**Always exhaust free/subscription tiers before pay-per-token:**
1. **GitHub Copilot models** — included in subscription, use freely
2. **Codex CLI** — $20/mo flat, use `--full-auto` or `--yolo` liberally
3. **Kimi K2.5** — generous free tier, great for reasoning
4. **Jules** — included in Google Max plan, async background work
5. **Augment** — free tier tokens available
6. THEN fall back to Anthropic Sonnet/Opus or OpenAI API
---
## Provider-Specific Instructions
### Codex CLI (OpenAI)
```bash
# One-shot task (PTY required!)
exec pty:true workdir:/path/to/repo command:"codex exec --full-auto 'Your task description'"
# Background for longer work
exec pty:true workdir:/path/to/repo background:true command:"codex exec --full-auto 'Your task. When done, run: openclaw gateway wake --text \"Done: brief summary\" --mode now'"
# YOLO mode (no sandbox, no approvals — fastest)
exec pty:true workdir:/path/to/repo command:"codex exec --yolo 'Your task'"
# Code review
exec pty:true workdir:/path/to/repo command:"codex review --base origin/main"
```
**Key:** Codex needs a git repo. Model: `gpt-5.3-codex`. Config: `~/.codex/config.toml`.
### Claude Flow (Multi-Agent Orchestration)
```bash
# Initialize in project (one-time)
exec workdir:/path/to/repo command:"claude-flow init"
# Swarm — hierarchical 15-agent mesh for large features
exec pty:true workdir:/path/to/repo background:true command:"claude-flow swarm start -o 'Build the REST API with auth, tests, and docs' -s development"
# Hive-Mind — consensus-based for architecture decisions
exec pty:true workdir:/path/to/repo background:true command:"claude-flow hive-mind init -t hierarchical-mesh"
# Then spawn workers:
exec pty:true command:"claude-flow hive-mind spawn --claude"
# Submit task:
exec command:"claude-flow hive-mind task 'Refactor auth module for OAuth2 support'"
# Check status
exec command:"claude-flow swarm status"
exec command:"claude-flow hive-mind status"
```
**Key:** Claude Flow has hooks in `.claude-flow/` that enable self-learning. Projects with heavy Claude Flow use should have `claude-flow init` run first.
### Jules (Google AI Coding Agent)
Jules works asynchronously — submit tasks via the Google AI Studio / Jules interface, it creates PRs.
```bash
# Get the API key
JULES_KEY=$(op read "op://DeLoSecrets/Jules/API Key")
# Jules is primarily browser-based at jules.google.com
# For API access, check current docs — the API surface is evolving
# Key pattern: submit task → Jules works in background → creates PR → you review
# For now, use browser automation or the web interface:
# 1. Navigate to jules.google.com
# 2. Connect repo
# 3. Submit task description
# 4. Jules creates a branch + PR asynchronously
```
**API Key:** `op://DeLoSecrets/Jules/API Key`
**Best for:** Async background tasks where you don't need the result immediately. Submit the task, let Jules work, pull the PR when ready. Great for fire-and-forget work while other agents handle synchronous tasks.
### Augment Code (auggie CLI)
```bash
# One-shot task (print mode)
exec pty:true workdir:/path/to/repo command:"auggie -p 'Your task description'"
# Interactive mode
exec pty:true workdir:/path/to/repo background:true command:"auggie 'Your task description'"
# Quiet mode (only final output)
exec pty:true workdir:/path/to/repo command:"auggie -q 'Your task'"
# With image input
exec pty:true workdir:/path/to/repo command:"auggie --image screenshot.png 'Implement this UI'"
# Ask mode (read-only, no edits — good for analysis)
exec pty:true workdir:/path/to/repo command:"auggie --ask 'Explain the auth flow in this codebase'"
```
**Binary:** `~/.bun/bin/auggie`
**Best for:** Code generation, refactoring, codebase-aware tasks. Has workspace indexing for deep context.
**Note:** First run in a new workspace triggers an indexing step. Use `--print` from workspace root to index.
### OpenClaw Sub-Agents (Built-in)
```python
# Spawn a coding sub-agent on a free provider
sessions_spawn(
task="Implement the user settings page with React and TypeScript",
model="github-copilot/claude-sonnet-4.5", # FREE via subscription
label="settings-page"
)
# Spawn on Kimi for reasoning-heavy work
sessions_spawn(
task="Architect the event sourcing system for order processing",
model="kimi-coding/k2p5", # Free tier
label="event-sourcing-arch"
)
# Parallel workers — different providers, different tasks
sessions_spawn(task="Write unit tests for auth module", model="github-copilot/gpt-5.2-codex", label="auth-tests")
sessions_spawn(task="Write integration tests for API", model="kimi-coding/k2p5", label="api-tests")
sessions_spawn(task="Update API documentation", model="github-copilot/gemini-3-flash-preview", label="api-dRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.