215 lines
3.5 KiB
Markdown
215 lines
3.5 KiB
Markdown
## AGENTS.md
|
||
|
||
### PRIORITY
|
||
|
||
1. User request
|
||
2. This file
|
||
3. Existing code
|
||
|
||
---
|
||
|
||
## CODE
|
||
|
||
### STACK
|
||
|
||
* .NET / C#
|
||
* ASP.NET Core
|
||
* MCP
|
||
|
||
### STRUCTURE
|
||
|
||
* `Server/` — endpoints
|
||
* `Services/` — business logic
|
||
* `Tools/` — MCP tools
|
||
|
||
### RULES
|
||
|
||
**Before edit**
|
||
|
||
* Read related code
|
||
* Reuse existing patterns
|
||
* Do not over-engineer
|
||
|
||
**After edit**
|
||
|
||
* Run:
|
||
|
||
```
|
||
dotnet build
|
||
```
|
||
* Build must succeed
|
||
* Do not break MCP protocol
|
||
* Keep diff minimal
|
||
|
||
**Style**
|
||
|
||
* Match existing style
|
||
* Avoid duplication
|
||
* Prefer small changes
|
||
|
||
---
|
||
|
||
## COMMUNICATION
|
||
|
||
### LANGUAGE
|
||
|
||
* Output: Russian
|
||
* Code: English
|
||
* Comments/commits: Russian
|
||
|
||
### BEHAVIOR
|
||
|
||
* Be concise
|
||
* Do not explain obvious things
|
||
* Do not produce long texts
|
||
* Prefer action over discussion when safe
|
||
|
||
### QUESTIONS
|
||
|
||
Ask ONLY if:
|
||
|
||
* Multiple valid solutions AND impact is significant
|
||
* Requirements are unclear
|
||
* User must choose between explicit options
|
||
|
||
Otherwise:
|
||
|
||
* Proceed with best reasonable assumption
|
||
|
||
MAXIMIZE USE OF `question` TOOL:
|
||
|
||
* Всегда используй `question` когда есть 2+ варианта выбора
|
||
* Применяй для архитектурных решений, конфигов, данных, внешнего поведения
|
||
* Предлагай явные варианты с краткими описаниями
|
||
* Не переходи к действию без явного выбора по значимым вопросам
|
||
|
||
### QUESTION TOOL
|
||
|
||
`question` is the UI tool for showing questions to the user in OpenCode.
|
||
|
||
Use `question` when:
|
||
|
||
* the user must choose between 2+ options
|
||
* confirmation affects architecture, config, data, or external behavior
|
||
* the choice should be presented as explicit selectable variants
|
||
|
||
Do not use `question` when:
|
||
|
||
* the answer can be inferred safely
|
||
* the issue is minor
|
||
* no real choice exists
|
||
|
||
If `question` is unavailable:
|
||
|
||
* ask in plain text
|
||
|
||
### RESTRICTIONS
|
||
|
||
* Do not end with only a question
|
||
* Do not expose secrets
|
||
* Do not repeat user text
|
||
|
||
---
|
||
|
||
## MEMORY
|
||
|
||
Use ONLY if memory tools are available.
|
||
|
||
### READ FIRST
|
||
|
||
Before coding or making assumptions:
|
||
|
||
1. Try `read_graph`
|
||
2. If needed, try `search_nodes()`
|
||
3. Do not duplicate existing observations
|
||
|
||
If tools are unavailable:
|
||
|
||
* Skip memory operations
|
||
|
||
### KEY FORMAT
|
||
|
||
```text
|
||
lazybear/<type>/<name>
|
||
```
|
||
|
||
Examples:
|
||
|
||
```text
|
||
lazybear/bug/auth-fail
|
||
lazybear/decision/mcp-timeout
|
||
lazybear/config/jira-base-url
|
||
```
|
||
|
||
### ALLOWED TYPES
|
||
|
||
* `architecture`
|
||
* `mcp_tool`
|
||
* `decision`
|
||
* `bug`
|
||
* `config`
|
||
* `task_log`
|
||
|
||
### WRITE ONLY WHEN USEFUL
|
||
|
||
Create or update memory for:
|
||
|
||
* architecture changes → `architecture`
|
||
* new MCP tools → `mcp_tool`
|
||
* major decisions → `decision`
|
||
* important bugs → `bug`
|
||
* config changes → `config`
|
||
* completed non-trivial tasks → `task_log`
|
||
|
||
### RULES
|
||
|
||
* One entity = one type
|
||
* Keep entries short
|
||
* Do not duplicate observations
|
||
* Do not write memory for trivial edits
|
||
|
||
---
|
||
|
||
## SECRETS
|
||
|
||
* Never print secrets
|
||
* Never commit `.env.local`
|
||
|
||
Use:
|
||
|
||
* `.env.local` → runtime
|
||
* `.env.example` → reference
|
||
|
||
---
|
||
|
||
## LINKS
|
||
|
||
Internal:
|
||
|
||
* Relative paths
|
||
* Spaces → `%20`
|
||
|
||
External:
|
||
|
||
* Markdown links only
|
||
|
||
---
|
||
|
||
## EDITING RULES
|
||
|
||
* Do not modify this file unless asked
|
||
* Do not change structure without need
|
||
* Keep instructions short and explicit
|
||
|
||
---
|
||
|
||
## CORE BEHAVIOR
|
||
|
||
* Act first, ask only when needed
|
||
* Use `question` for explicit user-facing choices in OpenCode
|
||
* Prefer safe assumptions
|
||
* Minimal changes only
|
||
* Do not invent tools
|
||
* Use tools only if confirmed available
|
||
* Never leak secrets
|