summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.opencode/opencode.jsonc1
-rw-r--r--AGENTS.md13
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--STYLE_GUIDE.md12
4 files changed, 15 insertions, 13 deletions
diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc
index ce4a6658b..c34163889 100644
--- a/.opencode/opencode.jsonc
+++ b/.opencode/opencode.jsonc
@@ -4,6 +4,7 @@
// "enterprise": {
// "url": "https://enterprise.dev.opencode.ai",
// },
+ "instructions": ["STYLE_GUIDE.md"],
"provider": {
"opencode": {
"options": {
diff --git a/AGENTS.md b/AGENTS.md
index 22b305dac..5a95fc509 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,16 +1,3 @@
-## IMPORTANT
-
-- Try to keep things in one function unless composable or reusable
-- DO NOT do unnecessary destructuring of variables
-- DO NOT use `else` statements unless necessary
-- DO NOT use `try`/`catch` if it can be avoided
-- AVOID `try`/`catch` where possible
-- AVOID `else` statements
-- AVOID using `any` type
-- AVOID `let` statements
-- PREFER single word variable names where possible
-- Use as many bun apis as possible like Bun.file()
-
## Debugging
- To test opencode in the `packages/opencode` directory you can run `bun dev`
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2fc5737d7..6a24995e8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -42,6 +42,8 @@ Want to take on an issue? Leave a comment and a maintainer may assign it to you
> [!NOTE]
> After touching `packages/opencode/src/server/server.ts`, run "./packages/sdk/js/script/build.ts" to regenerate the JS sdk.
+Please try to follow the [style guide](./STYLE_GUIDE.md)
+
### Setting up a Debugger
Bun debugging is currently rough around the edges. We hope this guide helps you get set up and avoid some pain points.
diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md
new file mode 100644
index 000000000..164f69bd4
--- /dev/null
+++ b/STYLE_GUIDE.md
@@ -0,0 +1,12 @@
+## Style Guide
+
+- Try to keep things in one function unless composable or reusable
+- DO NOT do unnecessary destructuring of variables
+- DO NOT use `else` statements unless necessary
+- DO NOT use `try`/`catch` if it can be avoided
+- AVOID `try`/`catch` where possible
+- AVOID `else` statements
+- AVOID using `any` type
+- AVOID `let` statements
+- PREFER single word variable names where possible
+- Use as many bun apis as possible like Bun.file()