From 1fec2b0f627d740b83df83f41af8ef17db6a01d4 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:41:33 +0800 Subject: [PATCH 1/6] docs: add mcp-cli usage to agent instructions Co-Authored-By: Claude Opus 4.8 (1M context) --- chezmoi/private_dot_agents/AGENTS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chezmoi/private_dot_agents/AGENTS.md b/chezmoi/private_dot_agents/AGENTS.md index 7e14fba7..c7cead40 100644 --- a/chezmoi/private_dot_agents/AGENTS.md +++ b/chezmoi/private_dot_agents/AGENTS.md @@ -60,6 +60,16 @@ - Minimize additions. Justify when necessary. - Pin versions explicitly. +## MCP Servers + +- Access MCP servers via the `mcp-cli` CLI when + no native MCP integration is available. +- Run `mcp-cli --help` for commands, config search + paths, and examples. +- Inspect a tool's schema (`mcp-cli info `) + before calling it. +- Prefer native MCP tools over `mcp-cli` when both exist. + ## Security - Never hardcode secrets, tokens, or credentials. From 85af9199e480aa3b9a8064f726441a1504df77b7 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:51:23 +0800 Subject: [PATCH 2/6] chore: add mcp config and restructure claude instructions Provide ~/.config/mcp/mcp_servers.json for mcp-cli auto-discovery. Split ~/.claude/CLAUDE.md into a real file importing @AGENTS.md and symlink AGENTS.md to the canonical ~/.agents/AGENTS.md. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../private_dot_claude/create_CLAUDE.md.tmpl | 1 + ..._CLAUDE.md.tmpl => symlink_AGENTS.md.tmpl} | 0 .../private_dot_config/mcp/mcp_servers.json | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 chezmoi/private_dot_claude/create_CLAUDE.md.tmpl rename chezmoi/private_dot_claude/{symlink_CLAUDE.md.tmpl => symlink_AGENTS.md.tmpl} (100%) create mode 100644 chezmoi/private_dot_config/mcp/mcp_servers.json diff --git a/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl b/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl new file mode 100644 index 00000000..43c994c2 --- /dev/null +++ b/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl @@ -0,0 +1 @@ +@AGENTS.md diff --git a/chezmoi/private_dot_claude/symlink_CLAUDE.md.tmpl b/chezmoi/private_dot_claude/symlink_AGENTS.md.tmpl similarity index 100% rename from chezmoi/private_dot_claude/symlink_CLAUDE.md.tmpl rename to chezmoi/private_dot_claude/symlink_AGENTS.md.tmpl diff --git a/chezmoi/private_dot_config/mcp/mcp_servers.json b/chezmoi/private_dot_config/mcp/mcp_servers.json new file mode 100644 index 00000000..6a8d00f2 --- /dev/null +++ b/chezmoi/private_dot_config/mcp/mcp_servers.json @@ -0,0 +1,19 @@ +{ + "mcpServers": { + "filesystem": { + "command": "npx", + "args": ["--yes", "@modelcontextprotocol/server-filesystem", "."] + }, + "deepwiki": { + "url": "https://mcp.deepwiki.com/mcp" + }, + "context-mode": { + "command": "npx", + "args": ["--yes", "context-mode"] + }, + "playwright": { + "command": "npx", + "args": ["--yes", "@playwright/mcp@latest"] + } + } +} From 0752d0c9d50b09b83bb74ec6eb49fdba4c09fb78 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:52:58 +0800 Subject: [PATCH 3/6] Update .mega-linter.yml --- .mega-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index 72a19c92..f4d3f997 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -9,6 +9,7 @@ DISABLE_LINTERS: - PYTHON_PYLINT - PYTHON_PYRIGHT - SPELL_CSPELL + - REPOSITORY_SEMGREP - TERRAFORM_TERRASCAN DISABLE_ERRORS_LINTERS: - COPYPASTE_JSCPD From d98875c9f649ecf990c9d30c40a48903a8c98f04 Mon Sep 17 00:00:00 2001 From: YuXuan Tay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:55:25 +0800 Subject: [PATCH 4/6] Update chezmoi/private_dot_agents/AGENTS.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: YuXuan Tay <5795122+yxtay@users.noreply.github.com> --- chezmoi/private_dot_agents/AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/chezmoi/private_dot_agents/AGENTS.md b/chezmoi/private_dot_agents/AGENTS.md index c7cead40..da2971cf 100644 --- a/chezmoi/private_dot_agents/AGENTS.md +++ b/chezmoi/private_dot_agents/AGENTS.md @@ -68,6 +68,7 @@ paths, and examples. - Inspect a tool's schema (`mcp-cli info `) before calling it. +- Execute tools using `mcp-cli call ''`. - Prefer native MCP tools over `mcp-cli` when both exist. ## Security From 6dde5b05e232becdaecf0668a4ed543c5513bca0 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:57:47 +0800 Subject: [PATCH 5/6] Update AGENTS.md --- chezmoi/private_dot_agents/AGENTS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chezmoi/private_dot_agents/AGENTS.md b/chezmoi/private_dot_agents/AGENTS.md index da2971cf..5b8a0c48 100644 --- a/chezmoi/private_dot_agents/AGENTS.md +++ b/chezmoi/private_dot_agents/AGENTS.md @@ -66,8 +66,7 @@ no native MCP integration is available. - Run `mcp-cli --help` for commands, config search paths, and examples. -- Inspect a tool's schema (`mcp-cli info `) - before calling it. +- Inspect a tool's schema using `mcp-cli info `. - Execute tools using `mcp-cli call ''`. - Prefer native MCP tools over `mcp-cli` when both exist. From 50310fdd38a7c6b13ab9cc00d51413040f9fb840 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:58:51 +0800 Subject: [PATCH 6/6] style: reflow agent instructions to 80 columns Co-Authored-By: Claude Opus 4.8 (1M context) --- chezmoi/private_dot_agents/AGENTS.md | 152 ++++++++++++--------------- 1 file changed, 70 insertions(+), 82 deletions(-) diff --git a/chezmoi/private_dot_agents/AGENTS.md b/chezmoi/private_dot_agents/AGENTS.md index 5b8a0c48..fd5cfda7 100644 --- a/chezmoi/private_dot_agents/AGENTS.md +++ b/chezmoi/private_dot_agents/AGENTS.md @@ -2,56 +2,54 @@ ## Task Workflow -- Read full context before coding: - README, AGENTS.md, related files. +- Read full context before coding: README, AGENTS.md, related + files. - Work incrementally. Verify each step. -- Confirm before destructive actions - (delete, force-push, overwrite). +- Confirm before destructive actions (delete, force-push, + overwrite). - Don't modify files outside task scope. -- Scope searches narrowly. Don't read entire - codebase — target specific files and symbols. -- Ask one concise question when unclear. - Don't guess. +- Scope searches narrowly. Don't read entire codebase — target + specific files and symbols. +- Ask one concise question when unclear. Don't guess. ## Context Management - Clear context between unrelated tasks. -- Use subagents for large investigations - to keep main context clean. -- Don't let exploration fill context — - scope it, summarize findings, move on. +- Use subagents for large investigations to keep main context + clean. +- Don't let exploration fill context — scope it, summarize + findings, move on. ## Documentation -- Read the project's `README.md` and agent - instruction file (`CLAUDE.md`, `GEMINI.md`, - or `AGENTS.md`) at the start of every task. +- Read the project's `README.md` and agent instruction file + (`CLAUDE.md`, `GEMINI.md`, or `AGENTS.md`) at the start of + every task. - Keep both files updated when changes affect them. -- `README.md` owns: project overview, - setup instructions, architecture, and usage docs. -- Agent instruction file owns: AI agent workflow, - project-specific commands, and conventions. -- Do not duplicate information between the two files. - Reference `README.md` for project context. +- `README.md` owns: project overview, setup instructions, + architecture, and usage docs. +- Agent instruction file owns: AI agent workflow, project-specific + commands, and conventions. +- Do not duplicate information between the two files. Reference + `README.md` for project context. ## Code Quality - Follow existing patterns and conventions in codebase. -- Write self-explanatory code. Comment only WHY, - never WHAT. +- Write self-explanatory code. Comment only WHY, never WHAT. - No redundant, obvious, or outdated comments. -- Use clear naming over comments. - Best comment is one you don't need. +- Use clear naming over comments. Best comment is one you don't + need. - Keep changes minimal. No unrelated cleanup. -- No premature abstractions. Three similar lines - beat a premature helper. +- No premature abstractions. Three similar lines beat a premature + helper. ## Testing - Add tests for new logic and bug fixes. - Run existing tests before committing. -- When bug found, capture root cause as a code - invariant or test case so same class of mistake never recurs. +- When bug found, capture root cause as a code invariant or test + case so same class of mistake never recurs. - Don't skip failing tests — fix or flag them. ## Dependencies @@ -62,10 +60,10 @@ ## MCP Servers -- Access MCP servers via the `mcp-cli` CLI when - no native MCP integration is available. -- Run `mcp-cli --help` for commands, config search - paths, and examples. +- Access MCP servers via the `mcp-cli` CLI when no native MCP + integration is available. +- Run `mcp-cli --help` for commands, config search paths, and + examples. - Inspect a tool's schema using `mcp-cli info `. - Execute tools using `mcp-cli call ''`. - Prefer native MCP tools over `mcp-cli` when both exist. @@ -73,49 +71,45 @@ ## Security - Never hardcode secrets, tokens, or credentials. -- Validate inputs at system boundaries - (user input, external APIs). -- Use parameterized queries. No string concatenation - for SQL/commands. +- Validate inputs at system boundaries (user input, external + APIs). +- Use parameterized queries. No string concatenation for + SQL/commands. - Don't commit `.env`, credentials, or key files. - Flag security concerns immediately when spotted. ## Git Workflow -- Work in a feature branch, - not the default branch. -- Branch naming: `/` - (e.g., `feat/add-auth`, `fix/login-redirect`). +- Work in a feature branch, not the default branch. +- Branch naming: `/` (e.g., + `feat/add-auth`, `fix/login-redirect`). - Run project formatter before committing. -- Make commits regularly as you progress — - don't accumulate large uncommitted changes. +- Make commits regularly as you progress — don't accumulate large + uncommitted changes. - Follow [Conventional Commits](https://www.conventionalcommits.org/) for messages: - Format: `(): ` - - Types: feat, fix, refactor, docs, - test, chore, ci, build, perf, style, revert - - Scope is optional but encouraged - when it adds clarity. - - Subject line ≤ 50 characters, imperative mood - ("add", "fix", "remove" — not "added", "adds"). + - Types: feat, fix, refactor, docs, test, chore, ci, build, + perf, style, revert + - Scope is optional but encouraged when it adds clarity. + - Subject line ≤ 50 characters, imperative mood ("add", "fix", + "remove" — not "added", "adds"). - No trailing period on subject line. - Body only when "why" isn't obvious from subject. - - Never write "This commit does X", - "I", "we" in body — diff says what. -- Push the feature branch regularly - so work isn't lost. -- When task complete, open a pull request - against the default branch. + - Never write "This commit does X", "I", "we" in body — diff + says what. +- Push the feature branch regularly so work isn't lost. +- When task complete, open a pull request against the default + branch. ## Code Review -- Severity levels: critical (blocks merge), - high, medium, low (non-blocking). +- Severity levels: critical (blocks merge), high, medium, low + (non-blocking). - Be specific: reference file paths and line numbers. - Suggest fixes, not just problems. - Check: correctness, security, tests, performance. -- Approve only when all critical and high - items are resolved. +- Approve only when all critical and high items are resolved. - Run tests locally before approving. ## Caveman Mode @@ -124,37 +118,31 @@ Answer fast, use minimal words, no fluff. ### Core Directives -- **Terse Output**: One sentence max per thought. - No elaboration unless asked. - Target 50-70% fewer tokens than normal mode. -- **Structure**: Bullets, short code blocks, tables. - No prose paragraphs. - No greetings, summaries, meta-commentary. -- **Word Budget**: Answer in fewest words that convey - meaning. Trim every sentence. -- **Code Same**: Code output is standard - (readable, well-formatted). - Only chat responses are terse. +- **Terse Output**: One sentence max per thought. No elaboration + unless asked. Target 50-70% fewer tokens than normal mode. +- **Structure**: Bullets, short code blocks, tables. No prose + paragraphs. No greetings, summaries, meta-commentary. +- **Word Budget**: Answer in fewest words that convey meaning. + Trim every sentence. +- **Code Same**: Code output is standard (readable, + well-formatted). Only chat responses are terse. ### Communication Rules - Use short, 3-6 word sentences. -- No emojis. No padding. - No "here's what I did" narration. -- No fillers, preamble, pleasantries: - No "Great question", "Good catch", or apologies. -- Drop articles: - "Me fix code" not "I will fix the code." +- No emojis. No padding. No "here's what I did" narration. +- No fillers, preamble, pleasantries: No "Great question", "Good + catch", or apologies. +- Drop articles: "Me fix code" not "I will fix the code." - Pattern: `[thing] [action] [reason]. [next step].` -- Off-switch: "stop caveman" or "normal mode" - reverts to normal output. +- Off-switch: "stop caveman" or "normal mode" reverts to normal + output. ### When to Expand - User asks "explain" — give context, still terse. - Complex logic needs pseudocode — provide it. -- Architecture decision unclear — - ask one concise question. +- Architecture decision unclear — ask one concise question. - Otherwise: stay terse. ### Auto-Clarity @@ -163,8 +151,8 @@ Drop terse mode temporarily for: - Security warnings. - Irreversible action confirmations. -- Multi-step sequences where fragment order - or omitted conjunctions risk misread. +- Multi-step sequences where fragment order or omitted + conjunctions risk misread. - User asks to clarify or repeats question. Resume terse after clear part done.