diff --git a/AGENT.memory.md b/AGENT.memory.md deleted file mode 100644 index 410e3a2..0000000 --- a/AGENT.memory.md +++ /dev/null @@ -1,37 +0,0 @@ -# MEMORY AGENT RULES - -## TRIGGERS — ALWAYS CHECK -- **ON session_start**: read_graph OR search_nodes() -- **ON significant_change**: create_entities OR add_observations -- **ON file_operation**: log to memory if architecture/config/decision - -## KEY FORMAT -- **PREFIX**: `lazybear/` -- **KEY**: `lazybear//` (ex: lazybear/bug/auth-fail) -- **ONE_TYPE_PER_ENTITY**: true - -## ALLOWED TYPES -- architecture | mcp_tool | decision | bug | config | task_log - -## MACHINE-FIRST PRINCIPLES -- ALWAYS use memory for project context, architecture, and decisions -- READ graph before coding or making assumptions -- Don't duplicate observations -- Update memory when state changes significantly - -## SCHEMA -``` -lazybear/{architecture|mcp_tool|decision|bug|config|task_log}/{entity-name} -``` - -## READING PRIORITY -1. Check graph before coding -2. Search nodes for existing context -3. Don't duplicate observations - -## WRITING TRIGGERS -- **Architecture**: create `architecture` entity -- **New MCP tools**: create `mcp_tool` entity -- **Major decisions**: create `decision` entity -- **Config updates**: create `config` entity -- **Completed tasks**: create/update `task_log` entity diff --git a/AGENTS.md b/AGENTS.md index b464c44..c1a97c9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,61 +1,214 @@ -# AGENTS.md — LazyBear MCP -STACK: .NET 10 | ASP.NET Core | ModelContextProtocol.AspNetCore 1.2.0 -STRUCTURE: LazyBear.MCP/{Program.cs, Services/Kubernetes/{K8sConfigTools,K8sDeploymentTools,K8sNetworkTools,K8sPodsTools}, appsettings.json} +## AGENTS.md + +### PRIORITY + +1. User request +2. This file +3. Existing code --- -## [A] КОД — ALWAYS +## CODE -PRE_EDIT: read_file → keep_style → min_diff → no_secrets_in_code -PRE_COMMIT: dotnet build OK | MCP protocol intact -PRIORITY: user > this_file > code_style +### STACK ---- +* .NET / C# +* ASP.NET Core +* MCP -## [B] КОММУНИКАЦИЯ — ALWAYS +### STRUCTURE -LANG: thinking=en (ALWAYS, never zh) | output=ru | code=en | comments+commits=ru -DO: act_first → confirm_if_needed | short_and_precise | sequential_questions | use `question` tool for all user choices (plain-text numbered options) -DONT: end_with_question_only | print_secret_values | commit_.env.local -SECRETS: use .env.local if exists; else state_once + ref .env.example -LINKS: internal=relative_path spaces→%20 | external=markdown_label (not bare URL) -RULES_EDIT: minimal + non_duplicative +* `Server/` — endpoints +* `Services/` — business logic +* `Tools/` — MCP tools -QUESTION_TOOL: - - вопрос: "Полный текст вопроса" (строка) - - header: "Краткий заголовок (макс 30 симв.)" (строка) - - options: массив объектов QuestionOption с полями: - - label: "Отображаемый текст (1-5 слов)" (строка) - - description: "Объяснение выбора" (строка) - - multiple: false (для одиночного выбора) или true (для多选题) +### RULES + +**Before edit** + +* Read related code +* Reuse existing patterns +* Do not over-engineer + +**After edit** + +* Run: - Пример использования: ``` - { - "question": "Выберите ID ресурса:", - "header": "Выберите ID:", - "options": [ - {"label": "Ресурс А", "description": "Первый вариант"}, - {"label": "Ресурс B", "description": "Второй вариант"}, - {"label": "Ресурс C", "description": "Третий вариант"} - ], - "multiple": false - } + dotnet build ``` +* Build must succeed +* Do not break MCP protocol +* Keep diff minimal - Валидация: - - все required поля заполнены - - label не превышает 5 слов - - description поясняет choice +**Style** + +* Match existing style +* Avoid duplication +* Prefer small changes --- -## [C] MEMORY LOG — ALWAYS +## COMMUNICATION -PREFIX: lazybear/ -KEY: lazybear// (ex: lazybear/bug/auth-fail) -TYPES: architecture | mcp_tool | decision | bug | config | task_log -ONE_TYPE_PER_ENTITY: true +### LANGUAGE -ON session_start → read_graph OR search_nodes() -ON significant_change → create_entities OR add_observations +* 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// +``` + +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