File size: 6,729 Bytes
0dbc9de | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | ---
title: κ·μΉ
description: OpenCodeμ λν μ¬μ©μ μ μ μ§μΉ¨ μ€μ .
---
`AGENTS.md` νμΌμ λ§λ€ μ μλλ‘ opencodeμ μ¬μ©μ μ μ μ§μΉ¨μ μ 곡 ν μ μμ΅λλ€. Cursorμ κ·μΉκ³Ό μ μ¬ν©λλ€. LLMμ 컨ν
μ€νΈμ ν¬ν¨λ μ§μΉ¨μ ν΅ν΄ νΉμ νλ‘μ νΈμ λν νλμ μ¬μ©μ μ μν©λλ€.
---
## μ΄κΈ°ν
μλ‘μ΄ `AGENTS.md` νμΌμ λ§λ€λ €λ©΄ `/init` λͺ
λ Ήμ opencodeμμ μ€νν μ μμ΅λλ€.
:::tip
νλ‘μ νΈμ `AGENTS.md` νμΌμ Gitμ ν¬μ
ν΄μΌ ν©λλ€.
:::
νλ‘μ νΈκ° 무μμΈμ§ μ΄ν΄νκ³ `AGENTS.md` νμΌμ μμ±ν©λλ€. μ΄ λμλ§ opencodeλ νλ‘μ νΈλ₯Ό λ μ νμν©λλ€.
κΈ°μ‘΄ `AGENTS.md` νμΌμ΄μλ κ²½μ°μ΄ μΆκ°νλ €κ³ ν©λλ€.
---
## μ
μ΄ νμΌμ μλμΌλ‘ λ§λ€ μλ μμ΅λλ€. λ€μμ `AGENTS.md` νμΌμ λ£μ μμλ κ²λ€μ μμ
λλ€.
```markdown title="AGENTS.md"
# SST v3 Monorepo Project
This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management.
## Project Structure
- `packages/` - Contains all workspace packages (functions, core, web, etc.)
- `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts)
- `sst.config.ts` - Main SST configuration with dynamic imports
## Code Standards
- Use TypeScript with strict mode enabled
- Shared code goes in `packages/core/` with proper exports configuration
- Functions go in `packages/functions/`
- Infrastructure should be split into logical files in `infra/`
## Monorepo Conventions
- Import shared modules using workspace names: `@my-app/core/example`
```
μ°λ¦¬λ μ¬κΈ°μ νλ‘μ νΈ λ³ μ§μΉ¨μ μΆκ°νκ³ μ΄κ²μ νμ ν΅ν΄ 곡μ λ©λλ€.
---
## μ ν
opencodeλ λν λ€μ μμΉμμ `AGENTS.md` νμΌμ μ½μ΅λλ€. κ·Έλ¦¬κ³ μ΄κ²μ λ€λ₯Έ λͺ©μ μ λ΄μ¬ν©λλ€.
## νλ‘μ νΈ
νλ‘μ νΈ λ³ κ·μΉμ λν νλ‘μ νΈ λ£¨νΈμ `AGENTS.md`λ₯Ό λ°°μΉν©λλ€. μ΄ λλ ν 리 λλ νμ λλ ν 리μμ μμ
ν λλ§ μ μ©λ©λλ€.
## μ μ
λν `~/.config/opencode/AGENTS.md` νμΌμμ κΈλ‘λ² κ·μΉμ κ°μ§ μ μμ΅λλ€. μ΄ λͺ¨λ opencode μΈμ
μμ μ μ©λ©λλ€.
μ΄κ²μ Gitμ μ λ
νμ§ μκ±°λ νκ³Ό 곡μ νμ§ μκΈ° λλ¬Έμ LLMμ΄ λ°λ₯΄λ λͺ¨λ κ°μΈ κ·μΉμ μ§μ νλ κ²μ΄ μ’μ΅λλ€.
### Claude μ½λ νΈνμ±
Claude Codeμμ λ§μ΄κ·Έλ μ΄μ
νλ κ²½μ°, opencodeλ Claude Codeμ νμΌ μ»¨λ²€μ
μ fallbacksλ‘ μ§μν©λλ€.
- ** κ·μΉ ** : νλ‘μ νΈ λλ ν 리μ `CLAUDE.md` (`AGENTS.md`κ° μ‘΄μ¬νμ§ μλ κ²½μ° μ¬μ©)
- ** κΈλ‘λ² κ·μΉ**: `~/.claude/CLAUDE.md` (`~/.config/opencode/AGENTS.md`κ° μ‘΄μ¬νμ§ μλ κ²½μ° μ¬μ©) -**Skills**: `~/.claude/skills/` β [Agent Skills](/docs/skills/)λ₯Ό μ°Έμ‘°νμμμ€.
Claude Code νΈνμ±μ λΉνμ±ννλ €λ©΄ μ΄λ¬ν νκ²½ λ³μ μ€ νλλ₯Ό μ€μ νμμμ€.
```bash
export OPENCODE_DISABLE_CLAUDE_CODE=1 # Disable all .claude support
export OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 # Disable only ~/.claude/CLAUDE.md
export OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 # Disable only .claude/skills
```
---
## μ°μ μμ
opencodeκ° μμλ λ, μ΄ μμμ μλ κ·μΉ νμΌμ μ°Ύμ΅λλ€:
1. **Local νμΌ ** νμ¬ λλ ν 리μμ μΆμ (`AGENTS.md`, `CLAUDE.md`)
2. ** κΈλ‘λ² νμΌ ** `~/.config/opencode/AGENTS.md`
3. **Claude μ½λ νμΌ ** `~/.claude/CLAUDE.md`μμ (무ν¨ν)
첫 λ²μ§Έ μΌμΉ νμΌμ κ° λ²μ£Όμμ μΉλ¦¬ν©λλ€. μλ₯Ό λ€μ΄, `AGENTS.md`μ `CLAUDE.md` λͺ¨λκ°μλ κ²½μ° `AGENTS.md` λ§ μ¬μ©λ©λλ€. μ μ¬νκ², `~/.config/opencode/AGENTS.md`λ `~/.claude/CLAUDE.md`μ μ μ§ν©λλ€.
---
## μ¬μ©μ μ μ μ§μΉ¨
`opencode.json` λλ κΈλ‘λ² `~/.config/opencode/opencode.json`μμ μ¬μ©μ μ§μ λͺ
λ Ή νμΌμ μ§μ ν μ μμ΅λλ€. AGENTS.mdμ 볡μ νμ§ μκ³ κΈ°μ‘΄ κ·μΉμ μ¬μ¬μ© ν μ μμ΅λλ€.
μ:
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"instructions": ["CONTRIBUTING.md", "docs/guidelines.md", ".cursor/rules/*.md"]
}
```
μΉμμ μ§μΉ¨μλ‘λνλ μ격 URLλ μ¬μ©ν μ μμ΅λλ€.
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"instructions": ["https://raw.githubusercontent.com/my-org/shared-rules/main/style.md"]
}
```
μ격 μ§μΉ¨μ 5 μ΄ νμ μμμΌλ‘ fetched.
λͺ¨λ λͺ
λ Ή νμΌμ `AGENTS.md` νμΌκ³Ό κ²°ν©λ©λλ€.
---
## μΈλΆ νμΌ μ°Έμ‘°
opencodeκ° `AGENTS.md`μ μλ μλμ μΌλ‘ νμ€ νμΌ μ°Έμ‘°λ₯Ό νμ§ μλ λμ, λΉμ μ λ κ°μ§ λ°©λ²μΌλ‘ μ μ¬ν κΈ°λ₯μ λ¬μ±ν μ μμ΅λλ€:
## opencode.json μ¬μ©
`instructions`μ `opencode.json` νλλ₯Ό μ¬μ©νλ κ²μ΄ μ’μ΅λλ€.
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"instructions": ["docs/development-standards.md", "test/testing-guidelines.md", "packages/*/AGENTS.md"]
}
```
### AGENTS.mdμ μλ μ§μΉ¨
`AGENTS.md`μ λͺ
μλ μ§μΉ¨μ μ 곡ν¨μΌλ‘μ¨ μΈλΆ νμΌμ μ½μ μ μμ΅λλ€. μ¬κΈ°μ μ€μ©μ μΈ μ:
```markdown title="AGENTS.md"
# TypeScript Project Rules
## External File Loading
CRITICAL: When you encounter a file reference (e.g., @rules/general.md), use your Read tool to load it on a need-to-know basis. They're relevant to the SPECIFIC task at hand.
Instructions:
- Do NOT preemptively load all references - use lazy loading based on actual need
- When loaded, treat content as mandatory instructions that override defaults
- Follow references recursively when needed
## Development Guidelines
For TypeScript code style and best practices: @docs/typescript-guidelines.md
For React component architecture and hooks patterns: @docs/react-patterns.md
For REST API design and error handling: @docs/api-standards.md
For testing strategies and coverage requirements: @test/testing-guidelines.md
## General Guidelines
Read the following file immediately as it's relevant to all workflows: @rules/general-guidelines.md.
```
μ΄ μ κ·Όλ²μ λ€μκ³Ό κ°μ΅λλ€:
- λͺ¨λ, μ¬μ¬μ© κ°λ₯ν κ·μΉ νμΌ μμ±
- symlinks λλ git submodulesλ₯Ό ν΅ν΄ νλ‘μ νΈ μ λ°μ κ±Έμ³ κ·μΉ 곡μ
- μμΈν κ°μ΄λλ₯Ό μ°Έμ‘°νλ©΄μ AGENTS.md concise μ μ§
- νΉμ μμ
μ νμν κ²½μ°μλ§ opencode λ‘λ νμΌ μ μ§
:::tip
곡μ νμ€μ κ°μ§ monorepos λλ νλ‘μ νΈλ₯Ό μν΄, glob λ³Έμ κ°μ§ `opencode.json`λ₯Ό μ¬μ©νμ¬ (`packages/*/AGENTS.md` κ°μ΄)λ μλ μ§μ 보λ€λ λ μ μ§κ°λ₯ν©λλ€.
:::
|