Agent rules
A global AGENTS.md that helps OpenCode plan larger work, ask focused questions, avoid scope creep, and verify results.
Download a ready-made OpenCode configuration with agent rules and useful skills.
No account required. No secrets included.
C:\Users\%USERNAME%\.config\opencode
C:\Users\%USERNAME%\.config\opencode\AGENTS.md
C:\Users\%USERNAME%\.agents\skills
02 / Manifest
A small, legible foundation: one set of global rules, a curated skills library, safer defaults, and Windows instructions that respect your time.
A global AGENTS.md that helps OpenCode plan larger work, ask focused questions, avoid scope creep, and verify results.
Curated skills for frontend design, requirements clarification, debugging, design review, and handoff.
Guidance for avoiding secrets, destructive commands, unnecessary dependencies, and unauthorized Git actions.
Clear paths and copy-ready PowerShell commands. No installer, no administrator prompt, and no account.
03 / Change
The aim is not more automation. It is fewer avoidable mistakes, clearer decisions, and work you can actually review.
The default fog.
The agent guesses. You discover the gaps later.
A working agreement.
The agent reads, asks, checks, and stops before the risky part.
03b / Protocol
The setup encourages OpenCode to work with intention rather than momentum. You keep the final call.
Existing code, docs, and conventions answer more than a long interview does.
Open decisions get resolved without a wall of prompts or invented requirements.
Small changes stay small, reviewable, and easy to reverse if something is wrong.
Typechecks, lint, tests, and the affected user journey are part of the work, not an afterthought.
The running interface matters, including empty, loading, error, and keyboard states.
Authorization stays with you. Approve the specific action, not the category.
04 / Installation
Four steps, one PowerShell window. The package lives in your user profile, so no administrator rights are needed.
Download opencode-windows-basic-setup.zip. In File Explorer, right-click the ZIP and choose Extract All…, then open the extracted folder. Work from the unzipped files, not from inside the ZIP.
explorer "$env:USERPROFILE\Downloads"
Optional: opens your Downloads folder in File Explorer.
Open Windows PowerShell and paste this command. -Force is safe here: it creates missing folders and leaves any existing contents untouched.
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills", "$env:USERPROFILE\.config\opencode"
From the extracted folder, copy the configuration files into .config\opencode and the included skill folders into .agents\skills. If either folder already exists, merge the contents. Do not wipe the folder to make room.
Keep exactly one global AGENTS.md. If you already have one, rename it as a backup and then merge the rules you want to keep.
C:\Users\%USERNAME%\.config\opencode
C:\Users\%USERNAME%\.config\opencode\AGENTS.md
C:\Users\%USERNAME%\.agents\skills
Open the configuration folder to double-check what landed there:
explorer "$env:USERPROFILE\.config\opencode"
explorer "$env:USERPROFILE\.agents\skills"
Run this read-only check. You should see AGENTS.md in the configuration folder and the included skill folders in the skills library.
Get-ChildItem "$env:USERPROFILE\.config\opencode"
Get-ChildItem "$env:USERPROFILE\.agents\skills"
These commands only list folder contents. They do not change anything.
05 / Disclaimer
Understand what commands can execute, what your AI provider receives, and what your finished app must protect. Start with invented data and a separate test environment.
An install is not a passive download. By the time npm install prints added N packages, code from outside your machine has already been fetched — and may already have run.
Worked example / dependency install
npm install actually doesIt resolves a dependency graph, downloads packages, and may run scripts. All of it happens with your user rights.
npm reads package.json, the lockfile, and every transitive dependency. The lockfile pins versions; if it conflicts with package.json, npm may resolve and record new ones.
npm downloads package tarballs from the configured registry, caches them, and expands them into node_modules.
Packages can define preinstall, install, and postinstall scripts. On Windows they usually run through cmd.exe, as you, with no sandbox.
npm updates node_modules, command shims, and sometimes the lockfile. npm ci installs strictly from the lockfile and removes existing node_modules first.
An install can execute code. Watch for typosquatting (a look-alike name), dependency confusion (a public stand-in for a private package), compromised maintainer accounts, and malicious updates. npm audit reports known vulnerabilities; it is not a malware scanner and does not review install scripts.
package.json and the lockfile before installing; use npm ls --all afterwards.npm ci for repeatable installs.npm ci --ignore-scripts skips install scripts, not every risk; native builds may fail.Same pattern / other commands
The command names change. The pattern does not: fetch something, then give it your permissions.
Scroll sideways to see all four columns.
| Command or action | What it does | Main risk | Safer practice |
|---|---|---|---|
npx, pnpm dlx, yarn dlx |
Fetches a package, then runs its binary. | Often uses the latest version; npx --yes skips the prompt, and yarn dlx does not record what it installed. |
Pin a version or use a local dev dependency. |
pip install, uv add, uvx |
Resolves, builds, and installs or runs Python code. | Build steps and installed packages run with your rights; pip does not check for tampering by default. | Use a virtual environment, pin versions, and prefer hashes or a frozen lockfile. |
curl … | iex, iwr … | iex |
Downloads text and executes it in PowerShell. | You run whatever the URL returns, without reviewing it. | Download to a file, read it, verify it, and prefer a VM for anything unfamiliar. |
winget, choco, scoop |
Runs a third-party installer or package script. | The installer or PowerShell script has your rights; hash checks may be optional or bypassable. | Use exact IDs from trusted sources and review package scripts. |
git clone + install/build |
Copies a repository, then runs its install or build command. | The clone is passive; the build that follows executes project code. | Read build files, pin the commit, and isolate unfamiliar projects. |
| Execution-policy change | Allows more PowerShell scripts to run. | The policy is not a security boundary, and Bypass removes warnings. |
Avoid a global change; use -Scope Process for a reviewed script, then close the session. |
| MCP server, plugin, extension | Adds third-party tools inside your editor or agent. | Runs with your file access and can act on your behalf. | Use trusted sources, review configuration, and grant least-privilege tokens. |
| AI-suggested command | A model proposes a shell command. | It can be wrong, stale, or influenced by untrusted text. | Read every flag and destination; keep approvals on ask. |
| Dev container, editor task | Project files can run commands on open or build. | Host-side hooks and automatic tasks can execute before you inspect the project. | Review configuration files and open unfamiliar repos in Restricted Mode. |
Package-manager moderation and hashes reduce some risk; they do not review the vendor’s code. Skills are instructions, but they can still direct the agent to run a command.
Privacy / before you paste
A tool installed on your PC can still send prompts, project files, terminal output, and screenshots to external providers. Check the data flow for your actual product, plan, model, and connected tools.
“No training” does not mean “no transfer.” Check retention, deletion, subprocessors, and exceptions separately. Start with entirely invented test data.
Use placeholders such as <your-name>, <client>, <account-id>, and C:\Users\<user>\project. Removing names alone does not anonymize data if the remaining context identifies someone. Keep sensitive files out of agent access; .gitignore alone does not do that.
Privacy / before you share
At the end of a session, make a redacted copy of any log, transcript, or notes before sharing them. Keep the original local.
session-redacted.txt.C:\Users\, @, and key prefixes; crop screenshots by hand.Replace All can miss a name in a file path, window title, metadata, or image. Review the whole copy. Redaction reduces exposure; it is not containment. Rotate any live secret.
Vibe coding / the finished app
Protecting what you send to the AI is one task. Protecting your app’s users is another. A successful demo, passing tests, or a second AI review cannot establish that an application is secure.
Enforce access rules on the server or in the database for every operation. Hiding a button does not stop a direct request. In a fictional appointment app, users might see only their own appointments while still being able to request someone else’s data.
Use two test accounts with different roles, plus a signed-out session. Check reading, creating, editing, and deleting records, including direct requests for another account’s records. Get an experienced security reviewer involved before handling real users, personal data, or payments.
Vibe coding / a safer start
Possible failures include leaked data, unwanted changes, unsafe dependencies, and runaway spending. These are risks to plan for, rather than a prediction about every AI project.
Read more: OWASP: secure coding with AI and AI agent security.
Personal data / GDPR (DSGVO)
Who determines why and how personal data is processed determines the controller role, regardless of who wrote the code. Email addresses, IP addresses, photos, and location data can identify people too.
Requirements depend on your project, data, and use. This is general orientation, not individual legal advice. Start with the EDPB GDPR guide, its explanation of controller and processor roles, and its data security guidance.
Guidance updated 30 October 2026 from the beginner risk and privacy notes in docs/. Package release remains v1.0.
06 / Boundaries
The package sets a calmer default. It does not turn an AI agent into a security boundary. You still decide what runs and what leaves your machine.
This setup is guidance, not a complete security solution. It reduces accidental actions; it cannot make untrusted instructions trustworthy.
Use a server-side secret store, or a local .env excluded from Git for development. Keep it outside agent access too: .gitignore does not block file reads. Private API and administrative database keys must never reach browser code. Intentionally public keys still need correct access rules. If a secret leaks, revoke it.
Read the included AGENTS.md and every skill folder before use. Skills are instructions: they can influence what the agent does and what it asks to run.
Do not grant broad auto-approval for shell commands, Git pushes, dependency installs, or network access. Approve the specific action, not the category.
Work inside the project folder. Back up existing configuration before merging. Treat unfamiliar skills and copied commands as code to review, not instructions to obey.
No secrets in the archive. The ZIP does not contain API keys, tokens, passwords, or personal data.
07 / Questions
Short answers for the decisions that matter before you drop files into your profile.
Nothing in the archive runs on its own. Installation is a copy, not an execution.
Copy the package into these three locations, where %USERNAME% is your Windows account name:
C:\Users\%USERNAME%\.agents\skillsC:\Users\%USERNAME%\.config\opencodeC:\Users\%USERNAME%\.config\opencode\AGENTS.mdThe AGENTS.md file belongs inside the OpenCode configuration folder. Put the included skill folders directly inside the skills library, not one level deeper.
No. Back up your current file first — for example, rename it to AGENTS.backup.md — then merge the rules you want into one global AGENTS.md. Keep project-specific instructions that already work for you.
If you do not have a global instructions file yet, you can place the included one directly.
Yes. The package is primarily Markdown guidance and skill folders, so it sits alongside the rest of your setup. Keep your existing settings, providers, and model choices.
If a filename already exists, merge rather than replace. Review the contents before overwriting anything you rely on.
The archive contains no API keys, tokens, passwords, or personal data, and nothing in it runs automatically. The site itself has no analytics or third-party scripts.
Instructions and skills can still change how an agent behaves. Review every file before use, keep approvals human, and treat this as guidance rather than a security guarantee. A working AI-built app can still expose data. Test access rules and check data protection duties before using real personal data.
In File Explorer, remove the installed AGENTS.md from C:\Users\%USERNAME%\.config\opencode — or restore your backup — and delete only the skill folders you added under C:\Users\%USERNAME%\.agents\skills.
Leave the rest of your OpenCode configuration alone, then restart OpenCode so it reloads the remaining instructions.