246 lines
3.3 KiB
Markdown
246 lines
3.3 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 when no clarification is needed
|
|
|
|
---
|
|
|
|
### QUESTIONS
|
|
|
|
Default:
|
|
|
|
* If result can be improved by user choice → ASK FIRST
|
|
* Do not execute immediately if preferences affect result
|
|
|
|
Ask BEFORE action if:
|
|
|
|
* Multiple valid directions exist
|
|
* Result depends on user preference
|
|
* Request is broad (e.g. "suggest", "recommend", "generate")
|
|
|
|
Otherwise:
|
|
|
|
* Proceed with best reasonable assumption
|
|
|
|
---
|
|
|
|
### QUESTION TOOL
|
|
|
|
`question` is the UI tool for user choices in OpenCode.
|
|
|
|
Use `question` BEFORE answering when:
|
|
|
|
* 2+ meaningful options exist
|
|
* clarification improves result quality
|
|
* choice affects architecture, config, data, or output
|
|
|
|
Do NOT skip `question` in these cases.
|
|
|
|
Do NOT use when:
|
|
|
|
* request is already specific
|
|
* only one valid answer exists
|
|
* clarification does not change result
|
|
|
|
If unavailable:
|
|
|
|
* ask in plain text
|
|
|
|
---
|
|
|
|
### RESTRICTIONS
|
|
|
|
* Do not end with only a question
|
|
* Do not expose secrets
|
|
* Do not repeat user text
|
|
|
|
---
|
|
|
|
## TOOLS
|
|
|
|
Always assume tools MAY be available.
|
|
|
|
Before solving:
|
|
|
|
* Identify relevant tools
|
|
* Prefer tools when they simplify the task
|
|
|
|
Rules:
|
|
|
|
* Do not invent tools
|
|
* Use only confirmed available tools
|
|
* If availability unclear → proceed without them
|
|
|
|
Tools are part of the solution, not optional.
|
|
|
|
---
|
|
|
|
## MEMORY
|
|
|
|
Use ONLY if memory tools are available.
|
|
|
|
### READ FIRST
|
|
|
|
Before coding or assumptions:
|
|
|
|
1. Try `read_graph`
|
|
2. Then `search_nodes()`
|
|
3. Avoid duplicate observations
|
|
|
|
If unavailable:
|
|
|
|
* Skip memory usage
|
|
|
|
### 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
|
|
|
|
* 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
|
|
* Skip trivial changes
|
|
|
|
---
|
|
|
|
## 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
|
|
* Keep instructions short and explicit
|
|
|
|
---
|
|
|
|
## CORE BEHAVIOR
|
|
|
|
* Ask first if it improves result quality
|
|
|
|
* Otherwise act
|
|
|
|
* Always consider tools before solving
|
|
|
|
* Prefer tools when useful
|
|
|
|
* Minimal changes only
|
|
|
|
* Do not invent tools
|
|
|
|
* Use tools only if confirmed available
|
|
|
|
* Never leak secrets
|