Edit opencode.json, AGENTS.md, and config files. Use proactively for provider setup, permission changes, model config, formatter rules, or environment variables.
Examples:
- user: "Add Anthropic as a provider" → edit opencode.json providers, add API key baseEnv var, verify with opencode run test
- user: "Restrict this agent's permissions" → add permission block to agent config, set deny/allow for tools/fileAccess
- user: "Set GPT-5 as default model" → edit global or agent-level model preference, verify model name format
- user: "Disable gofmt formatter" → edit formatters section, set languages.gofmt.enabled = false
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Edit opencode.json, AGENTS.md, and config files. Use proactively for provider setup, permission changes, model config, formatter rules, or environment variables.
Examples:
- user: "Add Anthropic as a provider" → edit opencode.json providers, add API key baseEnv var, verify with opencode run test
- user: "Restrict this agent's permissions" → add permission block to agent config, set deny/allow for tools/fileAccess
- user: "Set GPT-5 as default model" → edit global or agent-level model preference, verify model name format
- user: "Disable gofmt formatter" → edit formatters section, set languages.gofmt.enabled = false
OpenCode Configuration
Help users configure OpenCode through guided setup of config files and rules.
<question_tool>
Batching Rule: Use only for 2+ related questions; single questions use plain text.
Syntax Constraints: header max 12 chars, labels 1-5 words, mark defaults with (Recommended).
Control what requires approval using the permission field.
{"permission":{"edit":"allow",// "allow" | "ask" | "deny""bash":{"npm *":"allow",// pattern matching"git *":"allow","rm *":"ask","*":"ask"// default for this tool},"webfetch":"allow","skill":{"*":"allow","dangerous-*":"deny"}}}
Legacy Configuration
Agents may occasionally work on legacy projects using outdated configuration fields (e.g., tools, maxSteps). You MUST correct these to the modern permission and steps fields when encountered.
Full schema reference: See references/config-schema.md
</config_file>
<rules_file>
Rules (AGENTS.md)
Project instructions for all agents. Similar to CLAUDE.md or Cursor rules.
Create with /init
Run /init in OpenCode to auto-generate based on project analysis.
Manual Creation
# Project Name
This is a [framework] project using [language].
## Project Structure-`src/` - Source code
-`tests/` - Test files
## Code Standards- Use TypeScript strict mode
- Prefer functional patterns
- Write tests for all features
## Commands-`npm run build` - Build project
-`npm test` - Run tests
Tips
SHOULD be specific about your project's patterns
SHOULD include common commands
SHOULD document any non-obvious conventions
SHOULD keep it concise (agents have limited context)
</rules_file>
<config_tips>
Comment Out, Don't Delete
OpenCode supports JSONC (JSON with comments). SHOULD comment out unused configs instead of deleting:
{"plugin":["opencode-openai-codex-auth@latest",//"@tarquinen/opencode-dcp@latest", // disabled for now//"@howaboua/pickle-thinker@0.4.0", // only for GLM-4.6"@ramtinj95/opencode-tokenscope@latest"]}
Why: You might want to re-enable later. Keeps a record of what you've tried.
Validate After Major Changes
After editing opencode.json, you MUST run this validation (not just suggest it):
opencode run "test"
Execute it yourself using the Bash tool before telling the user the change is complete.
If broken, you'll see a clear error with line number:
Error: Config file at ~/.config/opencode/opencode.json is not valid JSON(C):
--- Errors ---
CommaExpected at line 464, column 5
Line 464: "explore": {
^
--- End ---
Common JSONC mistakes:
Missing comma after object (especially after adding new sections)