Skip to content

Commit d87dcfc

Browse files
committed
feat: update AGENTS.md
1 parent f69ef03 commit d87dcfc

1 file changed

Lines changed: 33 additions & 20 deletions

File tree

.deepcode/AGENTS.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,47 @@
44

55
```
66
src/
7-
├── cli.tsx # Entry point — parses args, renders Ink App
7+
├── cli.tsx # Entry point — parses args (-p, -v), renders Ink App
88
├── session.ts # SessionManager — LLM loop, compaction, tool orchestration
99
├── settings.ts # Settings resolution from ~/.deepcode/settings.json
10-
├── prompt.ts # System prompt builder, tool definitions, agent-drift-guard skill
10+
├── prompt.ts # System prompt builder, tool definitions, built-in skills
1111
├── common/
1212
│ ├── model-capabilities.ts # Model detection and thinking-mode defaults
13+
│ ├── openai-thinking.ts # OpenAI thinking request options builder
1314
│ ├── file-utils.ts # File read/write with encoding and diff preview
1415
│ ├── shell-utils.ts # Shell path resolution (Git Bash, zsh, bash)
1516
│ ├── state.ts # In-memory file state and snippet tracking
16-
│ └── runtime.ts # Tool validation runtime helpers
17+
│ ├── runtime.ts # Tool validation runtime helpers
18+
│ ├── notify.ts # Desktop notification after LLM turn completion
19+
│ ├── debug-logger.ts # Debug logging for OpenAI API calls
20+
│ └── error-logger.ts # API error logging
1721
├── ui/
1822
│ ├── App.tsx # Root Ink component — state, routing, session orchestration
19-
│ ├── PromptInput.tsx # Multi-line input with slash commands, image paste, skills
23+
│ ├── PromptInput.tsx # Multi-line input with file mentions (@), slash commands, image paste, skills
2024
│ ├── MessageView.tsx # Renders assistant/tool messages with markdown
21-
│ ├── DropdownMenu.tsx # Reusable dropdown for skill/model selection
22-
│ ├── SessionList.tsx # Session picker for /resume
23-
│ ├── promptUndoRedo.ts # Ctrl+- undo / Ctrl+Shift+- redo for prompt input
25+
│ ├── McpStatusList.tsx # MCP server connection status and available tools
26+
│ ├── ProcessStdoutView.tsx # Ctrl+O fullscreen overlay for live process stdout
27+
│ ├── UpdatePrompt.tsx # UpdatePlan task list progress display
28+
│ ├── fileMentions.ts # @-mention file scanning, filtering, and insertion
2429
│ └── ...
2530
├── mcp/
2631
│ ├── mcp-client.ts # MCP client — JSON-RPC communication with MCP servers
27-
│ └── mcp-manager.ts # MCP manager — lifecycle, tool registration, execution
32+
│ └── mcp-manager.ts # MCP manager — lifecycle, tool registration, execution, status
2833
├── tools/
29-
│ ├── executor.ts # ToolExecutor — dispatches tool calls to handlers
30-
│ ├── bash-handler.ts # Executes shell commands
31-
│ ├── read-handler.ts # Reads files and images
34+
│ ├── executor.ts # ToolExecutor — dispatches tool calls to handlers (7 built-in)
35+
│ ├── bash-handler.ts # Executes shell commands with live stdout streaming
36+
│ ├── read-handler.ts # Reads files, images, PDFs, and notebooks
3237
│ ├── write-handler.ts # Creates/overwrites files
33-
│ ├── edit-handler.ts # Scoped string replacements in files
34-
│ ├── web-search-handler.ts # Web search tool
35-
│ └── ask-user-question-handler.ts # Interactive user prompts
36-
├── tests/ # Test suite — one *.test.ts per module
38+
│ ├── edit-handler.ts # Scoped string replacements with snippet tracking
39+
│ ├── update-plan-handler.ts # Updates the task plan progress display
40+
│ ├── web-search-handler.ts # Web search via natural language queries
41+
│ └── ask-user-question-handler.ts # Interactive user prompts with options
42+
├── tests/ # One *.test.ts per source module, plus run-tests.mjs
3743
templates/
3844
├── tools/ # Tool descriptions fed to the LLM
45+
├── skills/ # Built-in skill definitions (agent-drift-guard, plan-and-execute)
3946
├── prompts/ # EJS templates (e.g., init_command.md.ejs)
40-
docs/ # User-facing documentation
47+
docs/ # User-facing documentation (configuration, MCP, skills)
4148
dist/ # Bundled CLI output (gitignored)
4249
```
4350

@@ -80,7 +87,7 @@ Run the CLI locally for manual testing: `node dist/cli.js` (after `npm run bundl
8087
- **Coverage**: Target meaningful unit tests for core logic (session management, tool handlers, settings resolution, prompt buffer). Test files are in `src/tests/` matching the source module name.
8188
- **Test naming**: `describe`/`test` blocks with descriptive names. Example: `test("SessionManager preserves structured system content when building OpenAI messages", ...)`
8289
- **Relaxed lint rules**: Test files allow `any` and unused vars.
83-
- Run all tests with `npm test` before submitting a PR.
90+
- Run all tests with `npm test` before submitting a PR. A cross-platform test runner is available at `src/tests/run-tests.mjs`.
8491

8592
## Commit & Pull Request Guidelines
8693

@@ -102,12 +109,18 @@ Run the CLI locally for manual testing: `node dist/cli.js` (after `npm run bundl
102109

103110
## Architecture Overview
104111

105-
The CLI renders a terminal UI using [Ink](https://github.com/vadimdemedes/ink) (React for terminals). `SessionManager` drives the LLM interaction loop: it builds system prompts, sends user messages with optional skills/images, streams responses, executes tool calls via `ToolExecutor`, and compacts context when token thresholds are exceeded (512K for DeepSeek V4 models, 128K for others).
112+
The CLI (`@vegamo/deepcode-cli`) renders a terminal UI using [Ink](https://github.com/vadimdemedes/ink) (React for terminals). `SessionManager` drives the LLM interaction loop: it builds system prompts, sends user messages with optional skills/images, streams responses, executes tool calls via `ToolExecutor`, and compacts context when token thresholds are exceeded (512K for DeepSeek V4 models, 128K for others).
106113

107-
Six tools are available to the LLM: `bash`, `read`, `write`, `edit`, `AskUserQuestion`, and `WebSearch`. Tool definitions are registered in `src/tools/executor.ts` and described to the LLM via `src/prompt.ts` and `templates/tools/`.
114+
Seven built-in tools are available to the LLM: `bash`, `read`, `write`, `edit`, `AskUserQuestion`, `UpdatePlan`, and `WebSearch`. Tool definitions are registered in `src/tools/executor.ts` and described to the LLM via `src/prompt.ts` and `templates/tools/`. The `UpdatePlan` tool enables the LLM to display and update a structured task list in the terminal.
115+
116+
**Slash commands**: `/model`, `/new`, `/init`, `/resume`, `/continue`, `/mcp`, `/exit`, plus dynamic `/skill-name` for each loaded skill.
117+
118+
**Key UI features**: `@` file mentions in the prompt input (scans project files), `Ctrl+O` to view live process stdout in fullscreen, `Ctrl+V` to paste images, MCP server status display.
119+
120+
**CLI flags**: `-p <prompt>` / `--prompt` to auto-submit a prompt on launch, `-v` / `--version`, `-h` / `--help`.
108121

109122
## Agent-Specific Instructions
110123

111124
- **AGENTS.md loading**: The CLI loads agent instructions from `./AGENTS.md`, `./.deepcode/AGENTS.md`, or `~/.deepcode/AGENTS.md` (first found wins). Write project-specific guidance for the LLM in any of these.
112125
- **Skills**: Place skill definitions in `~/.agents/skills/<name>/SKILL.md` (user-level) or `./.agents/skills/<name>/SKILL.md` (project-level). Legacy path `./.deepcode/skills/` is also supported. Each SKILL.md uses YAML frontmatter with `name` and `description` fields.
113-
- The built-in `agent-drift-guard` skill is always injected into every session.
126+
- **Built-in skills**: `agent-drift-guard` (detects and corrects execution drift) and `plan-and-execute` (structured task planning with progress tracking). Both are defined in `templates/skills/` and always injected into every session.

0 commit comments

Comments
 (0)