AGENTS.md #28
Merged@k33g wants to merge
feature/agents-file into mainMerged as
3c42ab80f861.39 files changed
renamed
.tickets/issues/0080-structured-output-from-go-type-declarations-in-t.yaml +5 -5 | similarity index 95% | ||
| rename from .tickets/issues/0080-structured-output-from-go-type-declarations.yaml | ||
| rename to .tickets/issues/0080-structured-output-from-go-type-declarations-in-t.yaml | ||
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | 2 | id: 80 |
| 3 | 3 | title: Structured output from Go type declarations in the config |
| 4 | -state: open | |
| 4 | +state: closed | |
| 5 | 5 | author: |
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-10-08T10:00:00.000Z |
| 9 | -updatedAt: 2026-10-08T16:00:00.000Z | |
| 9 | +updatedAt: 2026-10-09T03:16:38.703Z | |
| 10 | 10 | labels: |
| 11 | 11 | - enhancement |
| 12 | 12 | epic: Models |
| @@ -88,7 +88,7 @@ tasks: | ||
| 88 | 88 | updatedAt: 2026-10-08T16:00:00.000Z |
| 89 | 89 | closedAt: 2026-10-08T16:00:00.000Z |
| 90 | 90 | - id: 4 |
| 91 | - title: "Refuse structuredOutput when the agent declares any tool (config error listing the tools)" | |
| 91 | + title: Refuse structuredOutput when the agent declares any tool (config error listing the tools) | |
| 92 | 92 | state: closed |
| 93 | 93 | priority: none |
| 94 | 94 | author: |
| @@ -108,7 +108,7 @@ tasks: | ||
| 108 | 108 | updatedAt: 2026-10-08T16:00:00.000Z |
| 109 | 109 | closedAt: 2026-10-08T16:00:00.000Z |
| 110 | 110 | - id: 6 |
| 111 | - title: "Quality gate (quality skill)" | |
| 111 | + title: Quality gate (quality skill) | |
| 112 | 112 | state: open |
| 113 | 113 | priority: none |
| 114 | 114 | author: |
| @@ -116,7 +116,7 @@ tasks: | ||
| 116 | 116 | email: ph.charriere@gmail.com |
| 117 | 117 | createdAt: 2026-10-08T10:00:00.000Z |
| 118 | 118 | - id: 7 |
| 119 | - title: "Docs EN+FR (how-to + reference/configuration) and .memory update" | |
| 119 | + title: Docs EN+FR (how-to + reference/configuration) and .memory update | |
| 120 | 120 | state: closed |
| 121 | 121 | priority: none |
| 122 | 122 | author: |
| similarity index 95% | |||
| rename from .tickets/issues/0080-structured-output-from-go-type-declarations.yaml | |||
| rename to .tickets/issues/0080-structured-output-from-go-type-declarations-in-t.yaml | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | id: 80 | 2 | id: 80 |
| 3 | title: Structured output from Go type declarations in the config | 3 | title: Structured output from Go type declarations in the config |
| 4 | -state: open | 4 | +state: closed |
| 5 | author: | 5 | author: |
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-10-08T10:00:00.000Z | 8 | createdAt: 2026-10-08T10:00:00.000Z |
| 9 | -updatedAt: 2026-10-08T16:00:00.000Z | 9 | +updatedAt: 2026-10-09T03:16:38.703Z |
| 10 | labels: | 10 | labels: |
| 11 | - enhancement | 11 | - enhancement |
| 12 | epic: Models | 12 | epic: Models |
| @@ -88,7 +88,7 @@ tasks: | |||
| 88 | updatedAt: 2026-10-08T16:00:00.000Z | 88 | updatedAt: 2026-10-08T16:00:00.000Z |
| 89 | closedAt: 2026-10-08T16:00:00.000Z | 89 | closedAt: 2026-10-08T16:00:00.000Z |
| 90 | - id: 4 | 90 | - id: 4 |
| 91 | - title: "Refuse structuredOutput when the agent declares any tool (config error listing the tools)" | 91 | + title: Refuse structuredOutput when the agent declares any tool (config error listing the tools) |
| 92 | state: closed | 92 | state: closed |
| 93 | priority: none | 93 | priority: none |
| 94 | author: | 94 | author: |
| @@ -108,7 +108,7 @@ tasks: | |||
| 108 | updatedAt: 2026-10-08T16:00:00.000Z | 108 | updatedAt: 2026-10-08T16:00:00.000Z |
| 109 | closedAt: 2026-10-08T16:00:00.000Z | 109 | closedAt: 2026-10-08T16:00:00.000Z |
| 110 | - id: 6 | 110 | - id: 6 |
| 111 | - title: "Quality gate (quality skill)" | 111 | + title: Quality gate (quality skill) |
| 112 | state: open | 112 | state: open |
| 113 | priority: none | 113 | priority: none |
| 114 | author: | 114 | author: |
| @@ -116,7 +116,7 @@ tasks: | |||
| 116 | email: ph.charriere@gmail.com | 116 | email: ph.charriere@gmail.com |
| 117 | createdAt: 2026-10-08T10:00:00.000Z | 117 | createdAt: 2026-10-08T10:00:00.000Z |
| 118 | - id: 7 | 118 | - id: 7 |
| 119 | - title: "Docs EN+FR (how-to + reference/configuration) and .memory update" | 119 | + title: Docs EN+FR (how-to + reference/configuration) and .memory update |
| 120 | state: closed | 120 | state: closed |
| 121 | priority: none | 121 | priority: none |
| 122 | author: | 122 | author: |
added
.tickets/issues/0081-support-agents-md-project-instructions-for-the-a.yaml +155 -0 | new file mode 100644 | ||
| @@ -0,0 +1,155 @@ | ||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | |
| 2 | +id: 81 | |
| 3 | +title: Support AGENTS.md (project instructions for the agent) | |
| 4 | +state: open | |
| 5 | +author: | |
| 6 | + name: k33g | |
| 7 | + email: ph.charriere@gmail.com | |
| 8 | +createdAt: 2026-10-09T08:00:00.000Z | |
| 9 | +updatedAt: 2026-10-09T15:00:00.000Z | |
| 10 | +labels: | |
| 11 | + - enhancement | |
| 12 | +epic: Agent Memory | |
| 13 | +related: | |
| 14 | + - 79 | |
| 15 | +body: | | |
| 16 | + ## Goal | |
| 17 | + | |
| 18 | + When mm works in a project that has an `AGENTS.md` file, read it and give its content to the model as project instructions: build/test commands, conventions, what not to touch. Today the only instructions are the config's `system` prompt, the same for every project. | |
| 19 | + | |
| 20 | + `AGENTS.md` (https://agents.md) is a shared convention among coding agents: a plain Markdown file at the repository root, no required fields. In a monorepo, nested `AGENTS.md` files can sit in sub-directories; the one closest to the file being worked on takes precedence, and an explicit instruction from the user in the chat wins over the file. | |
| 21 | + | |
| 22 | + ## Where it plugs in (2026-10-09) | |
| 23 | + | |
| 24 | + - The system message is built in one place: `session.Fresh(system)` (`internal/session/session.go`), called by the line REPL (`internal/agent/agent.go`), `-p` (`RunPrompt`, `RunStructuredPrompt`), the window (`internal/tui/turn.go`, `commands.go` for `/new`), and the ACP façade. | |
| 25 | + - The working directory differs per front end: the process cwd in the terminal, the session's `cwd` in ACP (`ui.Resolve` / the sink's `WorkDir`, as for `sessions.dir` and `trace.dir`). | |
| 26 | + - A `/new`, a `/resume` and a context compression must keep the instructions (they live in the system message, which compression already keeps). | |
| 27 | + | |
| 28 | + ## Decided (2026-10-09, with the user) | |
| 29 | + | |
| 30 | + How the file joins the prompt: | |
| 31 | + | |
| 32 | + - **Appended to `system`**, after the config's own prompt, under a heading naming its origin — `PROJECT INSTRUCTIONS (from <absolute path>)` — never in place of it: `system` says what the agent is, AGENTS.md what the project is. Not a first user message: small models weigh the system message more, and Gemma/Mistral templates refuse two consecutive user turns. Same mechanism as `structuredOutput`'s `OUTPUT FORMAT` paragraph (ticket 80). | |
| 33 | + - **Read at start-up, then again at every `/new` and every new ACP session** — never in the middle of a conversation: a system message that changes mid-way breaks the server's prompt cache (llama.cpp re-reads the whole history; see ticket 53). An edited file is picked up by the next conversation. | |
| 34 | + - Still to settle in the implementation: `/resume` — keep the stored system message, or replace it with the current file (ACP already has `history.WithSystem` for a reloaded session). Compression already keeps the system message as is. | |
| 35 | + - **Size: a warning, not a cut.** The banner says the file's estimated size and its share of the context window (`AGENTS.md: ~6200 tokens, 40 % of the 16k window`) when it is large. An optional cap (e.g. `agentsMd.maxChars`, off by default) may be added; beyond it the file is not truncated silently — truncation can drop the one rule that matters, at the end of the file. | |
| 36 | + | |
| 37 | + Answered by the user in comment 1 (2026-10-09): | |
| 38 | + | |
| 39 | + - **Only `AGENTS.md`** — no `CLAUDE.md` / `.github/copilot-instructions.md` fallback. | |
| 40 | + - **The working directory only** — no walk up to the git root, no nested files concatenated. (Working directory = the process cwd in the terminal and `-p`, the session's `cwd` over ACP.) | |
| 41 | + - **A switch, on by default, with a path override.** | |
| 42 | + - **An asked agent** (`ask_agent`, `/ask`, `mm --ask`) reads it only if ITS OWN config has the switch on — so, the switch being on by default, an asked agent reads the AGENTS.md of the working directory it is started in unless its file says `false`. | |
| 43 | + - **Skipped for structured agents** (`structuredOutput` set, ticket 80): prose instructions would fight the JSON constraint. | |
| 44 | + | |
| 45 | + Settled with the user on 2026-10-09 (the last open points): | |
| 46 | + | |
| 47 | + - **Config shape: a block**, like `trace` and `sessions` — | |
| 48 | + `agentsMd: {enabled: true, path: AGENTS.md}` (enabled by default). A relative `path` is resolved against the WORKING DIRECTORY (the session's cwd over ACP), like `sessions.dir` and `trace.dir` — not against the config file: one `agent.yaml` serves many projects. The optional cap, if added, goes in the same block (`agentsMd.maxChars`, 0 = none). | |
| 49 | + - **`/resume` re-reads the file** and the resumed conversation continues under the current one — the rule already in force: `session.WithSystem` (`internal/session/session.go`) replaces a stored system message with the agent's current prompt, in `store/keeper.go` (terminal, window) and `acp/persist.go` (session/load). No cache cost: a resumed session is re-read whole by the server anyway. | |
| 50 | + - **Beyond the optional cap: the file is SKIPPED**, with a banner warning (`AGENTS.md skipped: <n> characters > agentsMd.maxChars <cap>`) — never truncated: a missing file is a visible state, a half-read one hides the rule that was cut. | |
| 51 | + - **A structured agent that skips an existing AGENTS.md says so neutrally in the banner** (`agents.md: ignored (structured output)`, only when a file exists), not as a warning — the same spirit as `tools: none (structured output: JSON answers)`. No banner in `-p` / `--ask`, so nothing there. | |
| 52 | + | |
| 53 | + No question left open. | |
| 54 | + | |
| 55 | + ## Implemented (2026-10-09, branch `feature/agents-file`) | |
| 56 | + | |
| 57 | + - `internal/agentsmd`: `Load(workDir)` → Disabled / Missing / Loaded / Skipped / Ignored / Unreadable; `System(base, workDir)`. | |
| 58 | + - Wired wherever a conversation starts: line mode (start, /new, /resume, -p), window (start, /new, /resume), ACP (session/new with its cwd, /new, session/load). | |
| 59 | + - Banner column `agents.md: …` + warnings (≥ 20 % of a known window, skipped, unreadable) — `agentsmd_banner.go`. | |
| 60 | + - Live on llmman (Qwen3.5-4B): the model followed a test AGENTS.md (`make check`, a signature); an agent asked with `--ask` read it with its switch on and not with `enabled: false`; a structured agent ignored it and its JSON stayed clean. | |
| 61 | + - Task 6 (quality gate) open: qlty is not installed in the sandbox. | |
| 62 | +tasks: | |
| 63 | + - id: 1 | |
| 64 | + title: Decide the open questions below with the user (which files, where to look, how it joins the system prompt, a switch to turn it off) | |
| 65 | + state: closed | |
| 66 | + priority: none | |
| 67 | + author: | |
| 68 | + name: k33g | |
| 69 | + email: ph.charriere@gmail.com | |
| 70 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 71 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 72 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 73 | + - id: 2 | |
| 74 | + title: "Failing tests first: an AGENTS.md in the working directory reaches the system message; none = system prompt unchanged" | |
| 75 | + state: closed | |
| 76 | + priority: none | |
| 77 | + author: | |
| 78 | + name: k33g | |
| 79 | + email: ph.charriere@gmail.com | |
| 80 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 81 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 82 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 83 | + - id: 3 | |
| 84 | + title: Read AGENTS.md from the session's working directory in every front end (terminal, window, -p, ACP session cwd, an agent asked through ask_agent / --ask) | |
| 85 | + state: closed | |
| 86 | + priority: none | |
| 87 | + author: | |
| 88 | + name: k33g | |
| 89 | + email: ph.charriere@gmail.com | |
| 90 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 91 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 92 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 93 | + - id: 4 | |
| 94 | + title: "Banner / ACP: say which instruction file(s) were loaded, and warn when one is too big" | |
| 95 | + state: closed | |
| 96 | + priority: none | |
| 97 | + author: | |
| 98 | + name: k33g | |
| 99 | + email: ph.charriere@gmail.com | |
| 100 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 101 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 102 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 103 | + - id: 5 | |
| 104 | + title: Live check on llmman with a demo project holding an AGENTS.md | |
| 105 | + state: closed | |
| 106 | + priority: none | |
| 107 | + author: | |
| 108 | + name: k33g | |
| 109 | + email: ph.charriere@gmail.com | |
| 110 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 111 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 112 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 113 | + - id: 6 | |
| 114 | + title: Quality gate (quality skill) | |
| 115 | + state: open | |
| 116 | + priority: none | |
| 117 | + author: | |
| 118 | + name: k33g | |
| 119 | + email: ph.charriere@gmail.com | |
| 120 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 121 | + - id: 7 | |
| 122 | + title: Docs EN+FR (how-to + reference/configuration + explanation) and .memory update | |
| 123 | + state: closed | |
| 124 | + priority: none | |
| 125 | + author: | |
| 126 | + name: k33g | |
| 127 | + email: ph.charriere@gmail.com | |
| 128 | + createdAt: 2026-10-09T08:00:00.000Z | |
| 129 | + updatedAt: 2026-10-09T15:00:00.000Z | |
| 130 | + closedAt: 2026-10-09T15:00:00.000Z | |
| 131 | +comments: | |
| 132 | + - id: 1 | |
| 133 | + author: | |
| 134 | + name: k33g | |
| 135 | + email: ph.charriere@gmail.com | |
| 136 | + createdAt: 2026-10-09T03:27:47.320Z | |
| 137 | + body: |+ | |
| 138 | + ## Answers to open questions: | |
| 139 | + | |
| 140 | + - Which files: `AGENTS.md` only, or also `CLAUDE.md` / `.github/copilot-instructions.md` as fallbacks? | |
| 141 | + - Only `AGENTS.md` | |
| 142 | + | |
| 143 | + - Where to look: the working directory only, or walk up to the git root and concatenate root → cwd (nested files)? | |
| 144 | + - the working directory only | |
| 145 | + | |
| 146 | + - A switch: `agentsMd: true|false` in the config (on by default?), and a path override? | |
| 147 | + - yes and yes and yes | |
| 148 | + | |
| 149 | + - An agent asked through `ask_agent` / `mm --ask`: does it read the AGENTS.md of its asker's project (same cwd), or none? | |
| 150 | + - Only if agentsMd: true in the asked agent config file | |
| 151 | + | |
| 152 | + - Interaction with `structuredOutput` (ticket 80): an instruction file asking for prose would fight the JSON constraint — skip it for structured agents? | |
| 153 | + - skip it for structured agents | |
| 154 | + | |
| 155 | + | |
| new file mode 100644 | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | ||
| 2 | +id: 81 | ||
| 3 | +title: Support AGENTS.md (project instructions for the agent) | ||
| 4 | +state: open | ||
| 5 | +author: | ||
| 6 | + name: k33g | ||
| 7 | + email: ph.charriere@gmail.com | ||
| 8 | +createdAt: 2026-10-09T08:00:00.000Z | ||
| 9 | +updatedAt: 2026-10-09T15:00:00.000Z | ||
| 10 | +labels: | ||
| 11 | + - enhancement | ||
| 12 | +epic: Agent Memory | ||
| 13 | +related: | ||
| 14 | + - 79 | ||
| 15 | +body: | | ||
| 16 | + ## Goal | ||
| 17 | + | ||
| 18 | + When mm works in a project that has an `AGENTS.md` file, read it and give its content to the model as project instructions: build/test commands, conventions, what not to touch. Today the only instructions are the config's `system` prompt, the same for every project. | ||
| 19 | + | ||
| 20 | + `AGENTS.md` (https://agents.md) is a shared convention among coding agents: a plain Markdown file at the repository root, no required fields. In a monorepo, nested `AGENTS.md` files can sit in sub-directories; the one closest to the file being worked on takes precedence, and an explicit instruction from the user in the chat wins over the file. | ||
| 21 | + | ||
| 22 | + ## Where it plugs in (2026-10-09) | ||
| 23 | + | ||
| 24 | + - The system message is built in one place: `session.Fresh(system)` (`internal/session/session.go`), called by the line REPL (`internal/agent/agent.go`), `-p` (`RunPrompt`, `RunStructuredPrompt`), the window (`internal/tui/turn.go`, `commands.go` for `/new`), and the ACP façade. | ||
| 25 | + - The working directory differs per front end: the process cwd in the terminal, the session's `cwd` in ACP (`ui.Resolve` / the sink's `WorkDir`, as for `sessions.dir` and `trace.dir`). | ||
| 26 | + - A `/new`, a `/resume` and a context compression must keep the instructions (they live in the system message, which compression already keeps). | ||
| 27 | + | ||
| 28 | + ## Decided (2026-10-09, with the user) | ||
| 29 | + | ||
| 30 | + How the file joins the prompt: | ||
| 31 | + | ||
| 32 | + - **Appended to `system`**, after the config's own prompt, under a heading naming its origin — `PROJECT INSTRUCTIONS (from <absolute path>)` — never in place of it: `system` says what the agent is, AGENTS.md what the project is. Not a first user message: small models weigh the system message more, and Gemma/Mistral templates refuse two consecutive user turns. Same mechanism as `structuredOutput`'s `OUTPUT FORMAT` paragraph (ticket 80). | ||
| 33 | + - **Read at start-up, then again at every `/new` and every new ACP session** — never in the middle of a conversation: a system message that changes mid-way breaks the server's prompt cache (llama.cpp re-reads the whole history; see ticket 53). An edited file is picked up by the next conversation. | ||
| 34 | + - Still to settle in the implementation: `/resume` — keep the stored system message, or replace it with the current file (ACP already has `history.WithSystem` for a reloaded session). Compression already keeps the system message as is. | ||
| 35 | + - **Size: a warning, not a cut.** The banner says the file's estimated size and its share of the context window (`AGENTS.md: ~6200 tokens, 40 % of the 16k window`) when it is large. An optional cap (e.g. `agentsMd.maxChars`, off by default) may be added; beyond it the file is not truncated silently — truncation can drop the one rule that matters, at the end of the file. | ||
| 36 | + | ||
| 37 | + Answered by the user in comment 1 (2026-10-09): | ||
| 38 | + | ||
| 39 | + - **Only `AGENTS.md`** — no `CLAUDE.md` / `.github/copilot-instructions.md` fallback. | ||
| 40 | + - **The working directory only** — no walk up to the git root, no nested files concatenated. (Working directory = the process cwd in the terminal and `-p`, the session's `cwd` over ACP.) | ||
| 41 | + - **A switch, on by default, with a path override.** | ||
| 42 | + - **An asked agent** (`ask_agent`, `/ask`, `mm --ask`) reads it only if ITS OWN config has the switch on — so, the switch being on by default, an asked agent reads the AGENTS.md of the working directory it is started in unless its file says `false`. | ||
| 43 | + - **Skipped for structured agents** (`structuredOutput` set, ticket 80): prose instructions would fight the JSON constraint. | ||
| 44 | + | ||
| 45 | + Settled with the user on 2026-10-09 (the last open points): | ||
| 46 | + | ||
| 47 | + - **Config shape: a block**, like `trace` and `sessions` — | ||
| 48 | + `agentsMd: {enabled: true, path: AGENTS.md}` (enabled by default). A relative `path` is resolved against the WORKING DIRECTORY (the session's cwd over ACP), like `sessions.dir` and `trace.dir` — not against the config file: one `agent.yaml` serves many projects. The optional cap, if added, goes in the same block (`agentsMd.maxChars`, 0 = none). | ||
| 49 | + - **`/resume` re-reads the file** and the resumed conversation continues under the current one — the rule already in force: `session.WithSystem` (`internal/session/session.go`) replaces a stored system message with the agent's current prompt, in `store/keeper.go` (terminal, window) and `acp/persist.go` (session/load). No cache cost: a resumed session is re-read whole by the server anyway. | ||
| 50 | + - **Beyond the optional cap: the file is SKIPPED**, with a banner warning (`AGENTS.md skipped: <n> characters > agentsMd.maxChars <cap>`) — never truncated: a missing file is a visible state, a half-read one hides the rule that was cut. | ||
| 51 | + - **A structured agent that skips an existing AGENTS.md says so neutrally in the banner** (`agents.md: ignored (structured output)`, only when a file exists), not as a warning — the same spirit as `tools: none (structured output: JSON answers)`. No banner in `-p` / `--ask`, so nothing there. | ||
| 52 | + | ||
| 53 | + No question left open. | ||
| 54 | + | ||
| 55 | + ## Implemented (2026-10-09, branch `feature/agents-file`) | ||
| 56 | + | ||
| 57 | + - `internal/agentsmd`: `Load(workDir)` → Disabled / Missing / Loaded / Skipped / Ignored / Unreadable; `System(base, workDir)`. | ||
| 58 | + - Wired wherever a conversation starts: line mode (start, /new, /resume, -p), window (start, /new, /resume), ACP (session/new with its cwd, /new, session/load). | ||
| 59 | + - Banner column `agents.md: …` + warnings (≥ 20 % of a known window, skipped, unreadable) — `agentsmd_banner.go`. | ||
| 60 | + - Live on llmman (Qwen3.5-4B): the model followed a test AGENTS.md (`make check`, a signature); an agent asked with `--ask` read it with its switch on and not with `enabled: false`; a structured agent ignored it and its JSON stayed clean. | ||
| 61 | + - Task 6 (quality gate) open: qlty is not installed in the sandbox. | ||
| 62 | +tasks: | ||
| 63 | + - id: 1 | ||
| 64 | + title: Decide the open questions below with the user (which files, where to look, how it joins the system prompt, a switch to turn it off) | ||
| 65 | + state: closed | ||
| 66 | + priority: none | ||
| 67 | + author: | ||
| 68 | + name: k33g | ||
| 69 | + email: ph.charriere@gmail.com | ||
| 70 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 71 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 72 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 73 | + - id: 2 | ||
| 74 | + title: "Failing tests first: an AGENTS.md in the working directory reaches the system message; none = system prompt unchanged" | ||
| 75 | + state: closed | ||
| 76 | + priority: none | ||
| 77 | + author: | ||
| 78 | + name: k33g | ||
| 79 | + email: ph.charriere@gmail.com | ||
| 80 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 81 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 82 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 83 | + - id: 3 | ||
| 84 | + title: Read AGENTS.md from the session's working directory in every front end (terminal, window, -p, ACP session cwd, an agent asked through ask_agent / --ask) | ||
| 85 | + state: closed | ||
| 86 | + priority: none | ||
| 87 | + author: | ||
| 88 | + name: k33g | ||
| 89 | + email: ph.charriere@gmail.com | ||
| 90 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 91 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 92 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 93 | + - id: 4 | ||
| 94 | + title: "Banner / ACP: say which instruction file(s) were loaded, and warn when one is too big" | ||
| 95 | + state: closed | ||
| 96 | + priority: none | ||
| 97 | + author: | ||
| 98 | + name: k33g | ||
| 99 | + email: ph.charriere@gmail.com | ||
| 100 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 101 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 102 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 103 | + - id: 5 | ||
| 104 | + title: Live check on llmman with a demo project holding an AGENTS.md | ||
| 105 | + state: closed | ||
| 106 | + priority: none | ||
| 107 | + author: | ||
| 108 | + name: k33g | ||
| 109 | + email: ph.charriere@gmail.com | ||
| 110 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 111 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 112 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 113 | + - id: 6 | ||
| 114 | + title: Quality gate (quality skill) | ||
| 115 | + state: open | ||
| 116 | + priority: none | ||
| 117 | + author: | ||
| 118 | + name: k33g | ||
| 119 | + email: ph.charriere@gmail.com | ||
| 120 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 121 | + - id: 7 | ||
| 122 | + title: Docs EN+FR (how-to + reference/configuration + explanation) and .memory update | ||
| 123 | + state: closed | ||
| 124 | + priority: none | ||
| 125 | + author: | ||
| 126 | + name: k33g | ||
| 127 | + email: ph.charriere@gmail.com | ||
| 128 | + createdAt: 2026-10-09T08:00:00.000Z | ||
| 129 | + updatedAt: 2026-10-09T15:00:00.000Z | ||
| 130 | + closedAt: 2026-10-09T15:00:00.000Z | ||
| 131 | +comments: | ||
| 132 | + - id: 1 | ||
| 133 | + author: | ||
| 134 | + name: k33g | ||
| 135 | + email: ph.charriere@gmail.com | ||
| 136 | + createdAt: 2026-10-09T03:27:47.320Z | ||
| 137 | + body: |+ | ||
| 138 | + ## Answers to open questions: | ||
| 139 | + | ||
| 140 | + - Which files: `AGENTS.md` only, or also `CLAUDE.md` / `.github/copilot-instructions.md` as fallbacks? | ||
| 141 | + - Only `AGENTS.md` | ||
| 142 | + | ||
| 143 | + - Where to look: the working directory only, or walk up to the git root and concatenate root → cwd (nested files)? | ||
| 144 | + - the working directory only | ||
| 145 | + | ||
| 146 | + - A switch: `agentsMd: true|false` in the config (on by default?), and a path override? | ||
| 147 | + - yes and yes and yes | ||
| 148 | + | ||
| 149 | + - An agent asked through `ask_agent` / `mm --ask`: does it read the AGENTS.md of its asker's project (same cwd), or none? | ||
| 150 | + - Only if agentsMd: true in the asked agent config file | ||
| 151 | + | ||
| 152 | + - Interaction with `structuredOutput` (ticket 80): an instruction file asking for prose would fight the JSON constraint — skip it for structured agents? | ||
| 153 | + - skip it for structured agents | ||
| 154 | + | ||
| 155 | + | ||
added
agentsmd_banner.go +57 -0 | new file mode 100644 | ||
| @@ -0,0 +1,57 @@ | ||
| 1 | +package main | |
| 2 | + | |
| 3 | +import ( | |
| 4 | + "fmt" | |
| 5 | + | |
| 6 | + "mm/internal/agentsmd" | |
| 7 | + "mm/internal/config" | |
| 8 | +) | |
| 9 | + | |
| 10 | +// largeAgentsMdShare is the share of the context window (in percent) from | |
| 11 | +// which the banner warns about the size of AGENTS.md: the file rides in the | |
| 12 | +// system message of every request, for the whole conversation. | |
| 13 | +const largeAgentsMdShare = 20 | |
| 14 | + | |
| 15 | +// agentsMdBanner returns the banner's `agents.md:` column (with its leading | |
| 16 | +// " | ", or "" when there is nothing to say) and the warnings about the file. | |
| 17 | +// window is the context window in tokens, 0 when unknown. In ACP mode each | |
| 18 | +// session reads the file of its own cwd, which no session has given yet: the | |
| 19 | +// column only says where it will be looked for. | |
| 20 | +// | |
| 21 | +// col, warnings := agentsMdBanner(false, 16384) | |
| 22 | +// // " | agents.md: /home/me/project/AGENTS.md (~350 tokens)", nil | |
| 23 | +func agentsMdBanner(acpMode bool, window int) (string, []string) { | |
| 24 | + settings := config.Cfg.AgentsMd | |
| 25 | + if !settings.Enabled { | |
| 26 | + return "", nil | |
| 27 | + } | |
| 28 | + if acpMode { | |
| 29 | + return " | agents.md: <session cwd>/" + settings.Path, nil | |
| 30 | + } | |
| 31 | + f := agentsmd.Load("") | |
| 32 | + switch f.Status { | |
| 33 | + case agentsmd.Loaded: | |
| 34 | + return fmt.Sprintf(" | agents.md: %s (~%d tokens)", f.Path, f.Tokens()), largeAgentsMdWarning(f, window) | |
| 35 | + case agentsmd.Ignored: | |
| 36 | + // Neutral, not a warning: a structured agent skips it on purpose. | |
| 37 | + return " | agents.md: ignored (structured output)", nil | |
| 38 | + case agentsmd.Skipped: | |
| 39 | + return " | agents.md: skipped (too long)", []string{fmt.Sprintf( | |
| 40 | + "%s skipped: %d characters > agentsMd.maxChars %d — it is not read at all (shorten it, or raise the limit)", | |
| 41 | + f.Path, f.Chars(), settings.MaxChars)} | |
| 42 | + case agentsmd.Unreadable: | |
| 43 | + return "", []string{fmt.Sprintf("%s cannot be read: %v — no project instructions", f.Path, f.Err)} | |
| 44 | + } | |
| 45 | + return "", nil | |
| 46 | +} | |
| 47 | + | |
| 48 | +// largeAgentsMdWarning says when the file takes a large share of a known | |
| 49 | +// context window. Nothing is cut: the user decides (agentsMd.maxChars). | |
| 50 | +func largeAgentsMdWarning(f agentsmd.File, window int) []string { | |
| 51 | + if window <= 0 || f.Tokens()*100 < window*largeAgentsMdShare { | |
| 52 | + return nil | |
| 53 | + } | |
| 54 | + return []string{fmt.Sprintf( | |
| 55 | + "%s is ~%d tokens, %d %% of the %d-token context window — every request carries it (shorten it, or set agentsMd.maxChars)", | |
| 56 | + f.Path, f.Tokens(), f.Tokens()*100/window, window)} | |
| 57 | +} | |
| new file mode 100644 | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | +package main | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "fmt" | ||
| 5 | + | ||
| 6 | + "mm/internal/agentsmd" | ||
| 7 | + "mm/internal/config" | ||
| 8 | +) | ||
| 9 | + | ||
| 10 | +// largeAgentsMdShare is the share of the context window (in percent) from | ||
| 11 | +// which the banner warns about the size of AGENTS.md: the file rides in the | ||
| 12 | +// system message of every request, for the whole conversation. | ||
| 13 | +const largeAgentsMdShare = 20 | ||
| 14 | + | ||
| 15 | +// agentsMdBanner returns the banner's `agents.md:` column (with its leading | ||
| 16 | +// " | ", or "" when there is nothing to say) and the warnings about the file. | ||
| 17 | +// window is the context window in tokens, 0 when unknown. In ACP mode each | ||
| 18 | +// session reads the file of its own cwd, which no session has given yet: the | ||
| 19 | +// column only says where it will be looked for. | ||
| 20 | +// | ||
| 21 | +// col, warnings := agentsMdBanner(false, 16384) | ||
| 22 | +// // " | agents.md: /home/me/project/AGENTS.md (~350 tokens)", nil | ||
| 23 | +func agentsMdBanner(acpMode bool, window int) (string, []string) { | ||
| 24 | + settings := config.Cfg.AgentsMd | ||
| 25 | + if !settings.Enabled { | ||
| 26 | + return "", nil | ||
| 27 | + } | ||
| 28 | + if acpMode { | ||
| 29 | + return " | agents.md: <session cwd>/" + settings.Path, nil | ||
| 30 | + } | ||
| 31 | + f := agentsmd.Load("") | ||
| 32 | + switch f.Status { | ||
| 33 | + case agentsmd.Loaded: | ||
| 34 | + return fmt.Sprintf(" | agents.md: %s (~%d tokens)", f.Path, f.Tokens()), largeAgentsMdWarning(f, window) | ||
| 35 | + case agentsmd.Ignored: | ||
| 36 | + // Neutral, not a warning: a structured agent skips it on purpose. | ||
| 37 | + return " | agents.md: ignored (structured output)", nil | ||
| 38 | + case agentsmd.Skipped: | ||
| 39 | + return " | agents.md: skipped (too long)", []string{fmt.Sprintf( | ||
| 40 | + "%s skipped: %d characters > agentsMd.maxChars %d — it is not read at all (shorten it, or raise the limit)", | ||
| 41 | + f.Path, f.Chars(), settings.MaxChars)} | ||
| 42 | + case agentsmd.Unreadable: | ||
| 43 | + return "", []string{fmt.Sprintf("%s cannot be read: %v — no project instructions", f.Path, f.Err)} | ||
| 44 | + } | ||
| 45 | + return "", nil | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +// largeAgentsMdWarning says when the file takes a large share of a known | ||
| 49 | +// context window. Nothing is cut: the user decides (agentsMd.maxChars). | ||
| 50 | +func largeAgentsMdWarning(f agentsmd.File, window int) []string { | ||
| 51 | + if window <= 0 || f.Tokens()*100 < window*largeAgentsMdShare { | ||
| 52 | + return nil | ||
| 53 | + } | ||
| 54 | + return []string{fmt.Sprintf( | ||
| 55 | + "%s is ~%d tokens, %d %% of the %d-token context window — every request carries it (shorten it, or set agentsMd.maxChars)", | ||
| 56 | + f.Path, f.Tokens(), f.Tokens()*100/window, window)} | ||
| 57 | +} | ||
added
agentsmd_banner_test.go +89 -0 | new file mode 100644 | ||
| @@ -0,0 +1,89 @@ | ||
| 1 | +package main | |
| 2 | + | |
| 3 | +import ( | |
| 4 | + "os" | |
| 5 | + "path/filepath" | |
| 6 | + "strings" | |
| 7 | + "testing" | |
| 8 | + | |
| 9 | + "mm/internal/config" | |
| 10 | +) | |
| 11 | + | |
| 12 | +// inProject runs the test in a fresh directory holding an AGENTS.md of text | |
| 13 | +// ("" = no file), with the given settings. | |
| 14 | +func inProject(t *testing.T, text string, settings config.AgentsMdConfig) string { | |
| 15 | + t.Helper() | |
| 16 | + saved, savedSchema := config.Cfg.AgentsMd, config.Cfg.OutputSchema | |
| 17 | + config.Cfg.AgentsMd, config.Cfg.OutputSchema = settings, nil | |
| 18 | + t.Cleanup(func() { config.Cfg.AgentsMd, config.Cfg.OutputSchema = saved, savedSchema }) | |
| 19 | + dir := t.TempDir() | |
| 20 | + t.Chdir(dir) | |
| 21 | + if text != "" { | |
| 22 | + if err := os.WriteFile("AGENTS.md", []byte(text), 0o644); err != nil { | |
| 23 | + t.Fatal(err) | |
| 24 | + } | |
| 25 | + } | |
| 26 | + abs, _ := filepath.Abs(filepath.Join(dir, "AGENTS.md")) | |
| 27 | + return abs | |
| 28 | +} | |
| 29 | + | |
| 30 | +var agentsMdOn = config.AgentsMdConfig{Enabled: true, Path: "AGENTS.md"} | |
| 31 | + | |
| 32 | +func TestBannerNamesTheLoadedFile(t *testing.T) { | |
| 33 | + path := inProject(t, strings.Repeat("a", 700), agentsMdOn) | |
| 34 | + col, warnings := agentsMdBanner(false, 100000) | |
| 35 | + if col != " | agents.md: "+path+" (~200 tokens)" || len(warnings) != 0 { | |
| 36 | + t.Errorf("column %q, warnings %v", col, warnings) | |
| 37 | + } | |
| 38 | +} | |
| 39 | + | |
| 40 | +func TestBannerWarnsWhenTheFileFillsTheWindow(t *testing.T) { | |
| 41 | + path := inProject(t, strings.Repeat("a", 700), agentsMdOn) // ~200 tokens | |
| 42 | + _, warnings := agentsMdBanner(false, 1000) // 20 % | |
| 43 | + if len(warnings) != 1 || !strings.Contains(warnings[0], path+" is ~200 tokens, 20 % of the 1000-token context window") { | |
| 44 | + t.Errorf("warnings %v", warnings) | |
| 45 | + } | |
| 46 | + if _, warnings := agentsMdBanner(false, 1001); len(warnings) != 0 { | |
| 47 | + t.Errorf("under 20 %%: %v", warnings) | |
| 48 | + } | |
| 49 | + if _, warnings := agentsMdBanner(false, 0); len(warnings) != 0 { | |
| 50 | + t.Errorf("unknown window: %v", warnings) | |
| 51 | + } | |
| 52 | +} | |
| 53 | + | |
| 54 | +func TestBannerSaysASkippedFileIsNotRead(t *testing.T) { | |
| 55 | + inProject(t, "too long rules", config.AgentsMdConfig{Enabled: true, Path: "AGENTS.md", MaxChars: 5}) | |
| 56 | + col, warnings := agentsMdBanner(false, 0) | |
| 57 | + if col != " | agents.md: skipped (too long)" || len(warnings) != 1 || !strings.Contains(warnings[0], "14 characters > agentsMd.maxChars 5") { | |
| 58 | + t.Errorf("column %q, warnings %v", col, warnings) | |
| 59 | + } | |
| 60 | +} | |
| 61 | + | |
| 62 | +// A structured agent: a neutral mention, no warning — and only when a file | |
| 63 | +// exists. | |
| 64 | +func TestBannerMentionsAFileAStructuredAgentIgnores(t *testing.T) { | |
| 65 | + inProject(t, "prose rules", agentsMdOn) | |
| 66 | + config.Cfg.OutputSchema = map[string]any{"type": "object"} | |
| 67 | + col, warnings := agentsMdBanner(false, 0) | |
| 68 | + if col != " | agents.md: ignored (structured output)" || len(warnings) != 0 { | |
| 69 | + t.Errorf("column %q, warnings %v", col, warnings) | |
| 70 | + } | |
| 71 | +} | |
| 72 | + | |
| 73 | +func TestBannerSaysNothingWithoutAFileOrWhenOff(t *testing.T) { | |
| 74 | + inProject(t, "", agentsMdOn) | |
| 75 | + if col, warnings := agentsMdBanner(false, 0); col != "" || warnings != nil { | |
| 76 | + t.Errorf("no file: column %q, warnings %v", col, warnings) | |
| 77 | + } | |
| 78 | + inProject(t, "rules", config.AgentsMdConfig{Enabled: false, Path: "AGENTS.md"}) | |
| 79 | + if col, warnings := agentsMdBanner(false, 0); col != "" || warnings != nil { | |
| 80 | + t.Errorf("disabled: column %q, warnings %v", col, warnings) | |
| 81 | + } | |
| 82 | +} | |
| 83 | + | |
| 84 | +func TestBannerInACPModeSaysWhereEachSessionLooks(t *testing.T) { | |
| 85 | + inProject(t, "", agentsMdOn) | |
| 86 | + if col, _ := agentsMdBanner(true, 0); col != " | agents.md: <session cwd>/AGENTS.md" { | |
| 87 | + t.Errorf("column %q", col) | |
| 88 | + } | |
| 89 | +} | |
| new file mode 100644 | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | +package main | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "os" | ||
| 5 | + "path/filepath" | ||
| 6 | + "strings" | ||
| 7 | + "testing" | ||
| 8 | + | ||
| 9 | + "mm/internal/config" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +// inProject runs the test in a fresh directory holding an AGENTS.md of text | ||
| 13 | +// ("" = no file), with the given settings. | ||
| 14 | +func inProject(t *testing.T, text string, settings config.AgentsMdConfig) string { | ||
| 15 | + t.Helper() | ||
| 16 | + saved, savedSchema := config.Cfg.AgentsMd, config.Cfg.OutputSchema | ||
| 17 | + config.Cfg.AgentsMd, config.Cfg.OutputSchema = settings, nil | ||
| 18 | + t.Cleanup(func() { config.Cfg.AgentsMd, config.Cfg.OutputSchema = saved, savedSchema }) | ||
| 19 | + dir := t.TempDir() | ||
| 20 | + t.Chdir(dir) | ||
| 21 | + if text != "" { | ||
| 22 | + if err := os.WriteFile("AGENTS.md", []byte(text), 0o644); err != nil { | ||
| 23 | + t.Fatal(err) | ||
| 24 | + } | ||
| 25 | + } | ||
| 26 | + abs, _ := filepath.Abs(filepath.Join(dir, "AGENTS.md")) | ||
| 27 | + return abs | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +var agentsMdOn = config.AgentsMdConfig{Enabled: true, Path: "AGENTS.md"} | ||
| 31 | + | ||
| 32 | +func TestBannerNamesTheLoadedFile(t *testing.T) { | ||
| 33 | + path := inProject(t, strings.Repeat("a", 700), agentsMdOn) | ||
| 34 | + col, warnings := agentsMdBanner(false, 100000) | ||
| 35 | + if col != " | agents.md: "+path+" (~200 tokens)" || len(warnings) != 0 { | ||
| 36 | + t.Errorf("column %q, warnings %v", col, warnings) | ||
| 37 | + } | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +func TestBannerWarnsWhenTheFileFillsTheWindow(t *testing.T) { | ||
| 41 | + path := inProject(t, strings.Repeat("a", 700), agentsMdOn) // ~200 tokens | ||
| 42 | + _, warnings := agentsMdBanner(false, 1000) // 20 % | ||
| 43 | + if len(warnings) != 1 || !strings.Contains(warnings[0], path+" is ~200 tokens, 20 % of the 1000-token context window") { | ||
| 44 | + t.Errorf("warnings %v", warnings) | ||
| 45 | + } | ||
| 46 | + if _, warnings := agentsMdBanner(false, 1001); len(warnings) != 0 { | ||
| 47 | + t.Errorf("under 20 %%: %v", warnings) | ||
| 48 | + } | ||
| 49 | + if _, warnings := agentsMdBanner(false, 0); len(warnings) != 0 { | ||
| 50 | + t.Errorf("unknown window: %v", warnings) | ||
| 51 | + } | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | +func TestBannerSaysASkippedFileIsNotRead(t *testing.T) { | ||
| 55 | + inProject(t, "too long rules", config.AgentsMdConfig{Enabled: true, Path: "AGENTS.md", MaxChars: 5}) | ||
| 56 | + col, warnings := agentsMdBanner(false, 0) | ||
| 57 | + if col != " | agents.md: skipped (too long)" || len(warnings) != 1 || !strings.Contains(warnings[0], "14 characters > agentsMd.maxChars 5") { | ||
| 58 | + t.Errorf("column %q, warnings %v", col, warnings) | ||
| 59 | + } | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +// A structured agent: a neutral mention, no warning — and only when a file | ||
| 63 | +// exists. | ||
| 64 | +func TestBannerMentionsAFileAStructuredAgentIgnores(t *testing.T) { | ||
| 65 | + inProject(t, "prose rules", agentsMdOn) | ||
| 66 | + config.Cfg.OutputSchema = map[string]any{"type": "object"} | ||
| 67 | + col, warnings := agentsMdBanner(false, 0) | ||
| 68 | + if col != " | agents.md: ignored (structured output)" || len(warnings) != 0 { | ||
| 69 | + t.Errorf("column %q, warnings %v", col, warnings) | ||
| 70 | + } | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +func TestBannerSaysNothingWithoutAFileOrWhenOff(t *testing.T) { | ||
| 74 | + inProject(t, "", agentsMdOn) | ||
| 75 | + if col, warnings := agentsMdBanner(false, 0); col != "" || warnings != nil { | ||
| 76 | + t.Errorf("no file: column %q, warnings %v", col, warnings) | ||
| 77 | + } | ||
| 78 | + inProject(t, "rules", config.AgentsMdConfig{Enabled: false, Path: "AGENTS.md"}) | ||
| 79 | + if col, warnings := agentsMdBanner(false, 0); col != "" || warnings != nil { | ||
| 80 | + t.Errorf("disabled: column %q, warnings %v", col, warnings) | ||
| 81 | + } | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +func TestBannerInACPModeSaysWhereEachSessionLooks(t *testing.T) { | ||
| 85 | + inProject(t, "", agentsMdOn) | ||
| 86 | + if col, _ := agentsMdBanner(true, 0); col != " | agents.md: <session cwd>/AGENTS.md" { | ||
| 87 | + t.Errorf("column %q", col) | ||
| 88 | + } | ||
| 89 | +} | ||
added
demo-agents-file/README.en.md +159 -0 | new file mode 100644 | ||
| @@ -0,0 +1,159 @@ | ||
| 1 | +# mini-me demo: the project's instructions (`AGENTS.md`) | |
| 2 | + | |
| 3 | +This directory shows how mini-me reads the `AGENTS.md` file of the project it works in and adds it to its system prompt: the agent then follows the project's rules (which command runs the tests, what not to touch…) without any change to its configuration. The models are served by [llmman](https://github.com/llmmanorg/llmman). Version française : [README.md](README.md). | |
| 4 | + | |
| 5 | +## What is here | |
| 6 | + | |
| 7 | +| File | Role | | |
| 8 | +|---|---| | |
| 9 | +| `project/` | A small "project", **Tangerine**: the directory mm is started in. | | |
| 10 | +| `project/AGENTS.md` | The project's instructions: tests run with `make check` (never `go test`), do not touch `vendor/` or `generated/`, sign every answer `-- Tangerine bot`. | | |
| 11 | +| `project/Makefile`, `project/greet.sh` | What `make check` runs. | | |
| 12 | +| `agent.yaml` | **Bob**, a coding agent (`bash`, file tools, `ask_agent`). He reads `AGENTS.md` (the `agentsMd` setting is written out in full, with its default values). | | |
| 13 | +| `agent.helper.yaml` | **helper**, asked by Bob: no tools, **reads** `AGENTS.md` (the default). | | |
| 14 | +| `agent.reviewer.yaml` | **reviewer**, asked by Bob: no tools, does **not** read `AGENTS.md` (`agentsMd.enabled: false`). | | |
| 15 | + | |
| 16 | +All three agents use `hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | |
| 17 | + | |
| 18 | +## Prerequisites | |
| 19 | + | |
| 20 | +1. llmman running (`llmman serve`, on `127.0.0.1:17434`; from a Docker Sandbox, mm falls back to `host.docker.internal:17434` by itself), and the model pulled: `llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | |
| 21 | +2. `mm` built at the repository root (`go build -o mm .`). | |
| 22 | +3. **Start mm from `project/`**: `AGENTS.md` is looked for in the working directory, not next to the configuration file. | |
| 23 | + | |
| 24 | + ```bash | |
| 25 | + cd demo-agents-file/project | |
| 26 | + ``` | |
| 27 | + | |
| 28 | +## The setting | |
| 29 | + | |
| 30 | +In `agent.yaml` (these are the defaults: a config that never mentions `agentsMd` reads `./AGENTS.md` all the same): | |
| 31 | + | |
| 32 | +```yaml | |
| 33 | +agentsMd: | |
| 34 | + enabled: true # read at the start of every conversation: start-up, /new, /resume | |
| 35 | + path: AGENTS.md # relative to the working directory (the project), not to this file | |
| 36 | + maxChars: 0 # 0 = no limit; above it the file is skipped whole, never cut | |
| 37 | +``` | |
| 38 | + | |
| 39 | +The model receives its `system` prompt, then: | |
| 40 | + | |
| 41 | +```text | |
| 42 | +PROJECT INSTRUCTIONS (from /…/demo-agents-file/project/AGENTS.md) | |
| 43 | +The instructions of the project you work in. Follow them; when the user asks otherwise in the conversation, the user wins. | |
| 44 | + | |
| 45 | +# Project "Tangerine" — instructions for coding agents | |
| 46 | +… | |
| 47 | +``` | |
| 48 | + | |
| 49 | +## 1. The banner says which file is read | |
| 50 | + | |
| 51 | +```bash | |
| 52 | +../../mm ../agent.yaml | |
| 53 | +``` | |
| 54 | + | |
| 55 | +``` | |
| 56 | +mm … | tools: bash, read_file, write_file, edit_file, ask_agent | skills: 0 | yolo: on | agents.md: /…/demo-agents-file/project/AGENTS.md (~125 tokens) | |
| 57 | +``` | |
| 58 | + | |
| 59 | +(The `no skills found` warning is expected: this demo has no skills.) | |
| 60 | + | |
| 61 | +## 2. Bob follows the project's instructions | |
| 62 | + | |
| 63 | +```bash | |
| 64 | +../../mm ../agent.yaml -p "Run the tests." | |
| 65 | +``` | |
| 66 | + | |
| 67 | +``` | |
| 68 | +🛠️ bash: make check | |
| 69 | + │ running the Tangerine checks… | |
| 70 | + │ ✅ all checks passed | |
| 71 | +🤖 ✅ all checks passed | |
| 72 | +``` | |
| 73 | + | |
| 74 | +Bob runs `make check`, the command `AGENTS.md` sets, not a guessed one. | |
| 75 | + | |
| 76 | +**To compare**, move the file aside and ask the same thing. `AGENT_YOLO=false` keeps the commands from running: you see what Bob *wanted* to run. | |
| 77 | + | |
| 78 | +```bash | |
| 79 | +mv AGENTS.md AGENTS.md.off | |
| 80 | +AGENT_YOLO=false ../../mm ../agent.yaml -p "Run the tests." | |
| 81 | +mv AGENTS.md.off AGENTS.md | |
| 82 | +``` | |
| 83 | + | |
| 84 | +``` | |
| 85 | +🛠️ bash: python -m pytest | |
| 86 | + │ [command rejected by the user] | |
| 87 | +🛠️ bash: pytest | |
| 88 | + │ [command rejected by the user] | |
| 89 | +… | |
| 90 | +``` | |
| 91 | + | |
| 92 | +Without instructions the model guesses (here `pytest`, in a project without a line of Python; in a run with `yolo: true` it went as far as `pip3 install pytest`). | |
| 93 | + | |
| 94 | +## 3. An asked agent decides with ITS OWN config | |
| 95 | + | |
| 96 | +When Bob hands a question to another agent (`ask_agent`, `/ask`, `mm --ask`), the asked agent works in the same directory, but **its own** `agentsMd` setting decides whether it reads the file. | |
| 97 | + | |
| 98 | +```bash | |
| 99 | +../../mm ../agent.yaml --ask helper -p "How do I run the tests in this project?" | |
| 100 | +``` | |
| 101 | + | |
| 102 | +``` | |
| 103 | +To run the tests, execute `make check` as instructed by the project's build and test guidelines. Always quote the last line of the command output in your response. | |
| 104 | +-- Tangerine bot | |
| 105 | +``` | |
| 106 | + | |
| 107 | +```bash | |
| 108 | +../../mm ../agent.yaml --ask reviewer -p "How do I run the tests in this project?" | |
| 109 | +``` | |
| 110 | + | |
| 111 | +``` | |
| 112 | +Run the tests by executing the command specified in your project's documentation, typically `npm test` for Node.js projects or `pytest` for Python projects. … | |
| 113 | +``` | |
| 114 | + | |
| 115 | +helper knows `make check` and signs; reviewer (`agentsMd.enabled: false`) gives a generic answer: it never saw the file. | |
| 116 | + | |
| 117 | +## 4. Editing `AGENTS.md` during a session | |
| 118 | + | |
| 119 | +The file is read **at the start of every conversation**, never in the middle of one (changing the system message mid-way would make the server re-read the whole history). To take an edit into account: | |
| 120 | + | |
| 121 | +```bash | |
| 122 | +../../mm ../agent.yaml | |
| 123 | +> Run the tests. # make check | |
| 124 | +``` | |
| 125 | + | |
| 126 | +Edit `AGENTS.md` in another terminal (for instance: the command becomes `sh greet.sh Tangerine`), then: | |
| 127 | + | |
| 128 | +```text | |
| 129 | +> /new | |
| 130 | +🆕 new session: 4 message(s) forgotten | |
| 131 | +> Run the tests. | |
| 132 | +🛠️ bash: sh greet.sh Tangerine | |
| 133 | +``` | |
| 134 | + | |
| 135 | +The new instruction applies from the new conversation on. (In our run Bob then also ran `make check`, despite "Never run make": a 4B model does not honour every prohibition.) | |
| 136 | + | |
| 137 | +`/resume` also reads the current file. | |
| 138 | + | |
| 139 | +## 5. Check what the model received | |
| 140 | + | |
| 141 | +```bash | |
| 142 | +AGENT_TRACE=true ../../mm ../agent.yaml -p "Run the tests." | |
| 143 | +jq -r '.messages[0].content' .mm/traces/*-0001.request.json | |
| 144 | +``` | |
| 145 | + | |
| 146 | +The system message ends with the `PROJECT INSTRUCTIONS (from …)` section. | |
| 147 | + | |
| 148 | +## Good to know | |
| 149 | + | |
| 150 | +- **A small model does not follow every rule every time**: with Qwen3.5-4B, Bob ran `make check` on every try but left out the `-- Tangerine bot` signature; helper, with no tools, added it. Short, concrete instructions work best. | |
| 151 | +- **Size**: the file rides with every request. The banner warns when it takes 20 % or more of the context window; `agentsMd.maxChars` sets a hard limit (above it the file is skipped whole, and the banner says `skipped (too long)`). | |
| 152 | +- **A JSON agent** (`structuredOutput`) never reads `AGENTS.md`; its banner says `agents.md: ignored (structured output)`. See [demo-structured-output](../demo-structured-output/README.en.md). | |
| 153 | +- **In an editor** (Zed…, ACP mode), each session reads the `AGENTS.md` of the project it opened. | |
| 154 | + | |
| 155 | +## Further reading | |
| 156 | + | |
| 157 | +- [Give the agent your project's instructions](../docs/en/how-to/give-project-instructions.md) | |
| 158 | +- [`agentsMd` reference](../docs/en/reference/configuration.md#agentsmd-keys) | |
| 159 | +- [Project instructions — explanation](../docs/en/explanation/project-instructions.md) | |
| new file mode 100644 | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | +# mini-me demo: the project's instructions (`AGENTS.md`) | ||
| 2 | + | ||
| 3 | +This directory shows how mini-me reads the `AGENTS.md` file of the project it works in and adds it to its system prompt: the agent then follows the project's rules (which command runs the tests, what not to touch…) without any change to its configuration. The models are served by [llmman](https://github.com/llmmanorg/llmman). Version française : [README.md](README.md). | ||
| 4 | + | ||
| 5 | +## What is here | ||
| 6 | + | ||
| 7 | +| File | Role | | ||
| 8 | +|---|---| | ||
| 9 | +| `project/` | A small "project", **Tangerine**: the directory mm is started in. | | ||
| 10 | +| `project/AGENTS.md` | The project's instructions: tests run with `make check` (never `go test`), do not touch `vendor/` or `generated/`, sign every answer `-- Tangerine bot`. | | ||
| 11 | +| `project/Makefile`, `project/greet.sh` | What `make check` runs. | | ||
| 12 | +| `agent.yaml` | **Bob**, a coding agent (`bash`, file tools, `ask_agent`). He reads `AGENTS.md` (the `agentsMd` setting is written out in full, with its default values). | | ||
| 13 | +| `agent.helper.yaml` | **helper**, asked by Bob: no tools, **reads** `AGENTS.md` (the default). | | ||
| 14 | +| `agent.reviewer.yaml` | **reviewer**, asked by Bob: no tools, does **not** read `AGENTS.md` (`agentsMd.enabled: false`). | | ||
| 15 | + | ||
| 16 | +All three agents use `hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | ||
| 17 | + | ||
| 18 | +## Prerequisites | ||
| 19 | + | ||
| 20 | +1. llmman running (`llmman serve`, on `127.0.0.1:17434`; from a Docker Sandbox, mm falls back to `host.docker.internal:17434` by itself), and the model pulled: `llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | ||
| 21 | +2. `mm` built at the repository root (`go build -o mm .`). | ||
| 22 | +3. **Start mm from `project/`**: `AGENTS.md` is looked for in the working directory, not next to the configuration file. | ||
| 23 | + | ||
| 24 | + ```bash | ||
| 25 | + cd demo-agents-file/project | ||
| 26 | + ``` | ||
| 27 | + | ||
| 28 | +## The setting | ||
| 29 | + | ||
| 30 | +In `agent.yaml` (these are the defaults: a config that never mentions `agentsMd` reads `./AGENTS.md` all the same): | ||
| 31 | + | ||
| 32 | +```yaml | ||
| 33 | +agentsMd: | ||
| 34 | + enabled: true # read at the start of every conversation: start-up, /new, /resume | ||
| 35 | + path: AGENTS.md # relative to the working directory (the project), not to this file | ||
| 36 | + maxChars: 0 # 0 = no limit; above it the file is skipped whole, never cut | ||
| 37 | +``` | ||
| 38 | + | ||
| 39 | +The model receives its `system` prompt, then: | ||
| 40 | + | ||
| 41 | +```text | ||
| 42 | +PROJECT INSTRUCTIONS (from /…/demo-agents-file/project/AGENTS.md) | ||
| 43 | +The instructions of the project you work in. Follow them; when the user asks otherwise in the conversation, the user wins. | ||
| 44 | + | ||
| 45 | +# Project "Tangerine" — instructions for coding agents | ||
| 46 | +… | ||
| 47 | +``` | ||
| 48 | + | ||
| 49 | +## 1. The banner says which file is read | ||
| 50 | + | ||
| 51 | +```bash | ||
| 52 | +../../mm ../agent.yaml | ||
| 53 | +``` | ||
| 54 | + | ||
| 55 | +``` | ||
| 56 | +mm … | tools: bash, read_file, write_file, edit_file, ask_agent | skills: 0 | yolo: on | agents.md: /…/demo-agents-file/project/AGENTS.md (~125 tokens) | ||
| 57 | +``` | ||
| 58 | + | ||
| 59 | +(The `no skills found` warning is expected: this demo has no skills.) | ||
| 60 | + | ||
| 61 | +## 2. Bob follows the project's instructions | ||
| 62 | + | ||
| 63 | +```bash | ||
| 64 | +../../mm ../agent.yaml -p "Run the tests." | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +``` | ||
| 68 | +🛠️ bash: make check | ||
| 69 | + │ running the Tangerine checks… | ||
| 70 | + │ ✅ all checks passed | ||
| 71 | +🤖 ✅ all checks passed | ||
| 72 | +``` | ||
| 73 | + | ||
| 74 | +Bob runs `make check`, the command `AGENTS.md` sets, not a guessed one. | ||
| 75 | + | ||
| 76 | +**To compare**, move the file aside and ask the same thing. `AGENT_YOLO=false` keeps the commands from running: you see what Bob *wanted* to run. | ||
| 77 | + | ||
| 78 | +```bash | ||
| 79 | +mv AGENTS.md AGENTS.md.off | ||
| 80 | +AGENT_YOLO=false ../../mm ../agent.yaml -p "Run the tests." | ||
| 81 | +mv AGENTS.md.off AGENTS.md | ||
| 82 | +``` | ||
| 83 | + | ||
| 84 | +``` | ||
| 85 | +🛠️ bash: python -m pytest | ||
| 86 | + │ [command rejected by the user] | ||
| 87 | +🛠️ bash: pytest | ||
| 88 | + │ [command rejected by the user] | ||
| 89 | +… | ||
| 90 | +``` | ||
| 91 | + | ||
| 92 | +Without instructions the model guesses (here `pytest`, in a project without a line of Python; in a run with `yolo: true` it went as far as `pip3 install pytest`). | ||
| 93 | + | ||
| 94 | +## 3. An asked agent decides with ITS OWN config | ||
| 95 | + | ||
| 96 | +When Bob hands a question to another agent (`ask_agent`, `/ask`, `mm --ask`), the asked agent works in the same directory, but **its own** `agentsMd` setting decides whether it reads the file. | ||
| 97 | + | ||
| 98 | +```bash | ||
| 99 | +../../mm ../agent.yaml --ask helper -p "How do I run the tests in this project?" | ||
| 100 | +``` | ||
| 101 | + | ||
| 102 | +``` | ||
| 103 | +To run the tests, execute `make check` as instructed by the project's build and test guidelines. Always quote the last line of the command output in your response. | ||
| 104 | +-- Tangerine bot | ||
| 105 | +``` | ||
| 106 | + | ||
| 107 | +```bash | ||
| 108 | +../../mm ../agent.yaml --ask reviewer -p "How do I run the tests in this project?" | ||
| 109 | +``` | ||
| 110 | + | ||
| 111 | +``` | ||
| 112 | +Run the tests by executing the command specified in your project's documentation, typically `npm test` for Node.js projects or `pytest` for Python projects. … | ||
| 113 | +``` | ||
| 114 | + | ||
| 115 | +helper knows `make check` and signs; reviewer (`agentsMd.enabled: false`) gives a generic answer: it never saw the file. | ||
| 116 | + | ||
| 117 | +## 4. Editing `AGENTS.md` during a session | ||
| 118 | + | ||
| 119 | +The file is read **at the start of every conversation**, never in the middle of one (changing the system message mid-way would make the server re-read the whole history). To take an edit into account: | ||
| 120 | + | ||
| 121 | +```bash | ||
| 122 | +../../mm ../agent.yaml | ||
| 123 | +> Run the tests. # make check | ||
| 124 | +``` | ||
| 125 | + | ||
| 126 | +Edit `AGENTS.md` in another terminal (for instance: the command becomes `sh greet.sh Tangerine`), then: | ||
| 127 | + | ||
| 128 | +```text | ||
| 129 | +> /new | ||
| 130 | +🆕 new session: 4 message(s) forgotten | ||
| 131 | +> Run the tests. | ||
| 132 | +🛠️ bash: sh greet.sh Tangerine | ||
| 133 | +``` | ||
| 134 | + | ||
| 135 | +The new instruction applies from the new conversation on. (In our run Bob then also ran `make check`, despite "Never run make": a 4B model does not honour every prohibition.) | ||
| 136 | + | ||
| 137 | +`/resume` also reads the current file. | ||
| 138 | + | ||
| 139 | +## 5. Check what the model received | ||
| 140 | + | ||
| 141 | +```bash | ||
| 142 | +AGENT_TRACE=true ../../mm ../agent.yaml -p "Run the tests." | ||
| 143 | +jq -r '.messages[0].content' .mm/traces/*-0001.request.json | ||
| 144 | +``` | ||
| 145 | + | ||
| 146 | +The system message ends with the `PROJECT INSTRUCTIONS (from …)` section. | ||
| 147 | + | ||
| 148 | +## Good to know | ||
| 149 | + | ||
| 150 | +- **A small model does not follow every rule every time**: with Qwen3.5-4B, Bob ran `make check` on every try but left out the `-- Tangerine bot` signature; helper, with no tools, added it. Short, concrete instructions work best. | ||
| 151 | +- **Size**: the file rides with every request. The banner warns when it takes 20 % or more of the context window; `agentsMd.maxChars` sets a hard limit (above it the file is skipped whole, and the banner says `skipped (too long)`). | ||
| 152 | +- **A JSON agent** (`structuredOutput`) never reads `AGENTS.md`; its banner says `agents.md: ignored (structured output)`. See [demo-structured-output](../demo-structured-output/README.en.md). | ||
| 153 | +- **In an editor** (Zed…, ACP mode), each session reads the `AGENTS.md` of the project it opened. | ||
| 154 | + | ||
| 155 | +## Further reading | ||
| 156 | + | ||
| 157 | +- [Give the agent your project's instructions](../docs/en/how-to/give-project-instructions.md) | ||
| 158 | +- [`agentsMd` reference](../docs/en/reference/configuration.md#agentsmd-keys) | ||
| 159 | +- [Project instructions — explanation](../docs/en/explanation/project-instructions.md) | ||
added
demo-agents-file/README.md +159 -0 | new file mode 100644 | ||
| @@ -0,0 +1,159 @@ | ||
| 1 | +# Démo mini-me : les consignes du projet (`AGENTS.md`) | |
| 2 | + | |
| 3 | +Ce dossier montre comment mini-me lit le fichier `AGENTS.md` du projet dans lequel il travaille et l'ajoute à son prompt système : l'agent suit alors les règles du projet (quelle commande lance les tests, ce qu'il ne faut pas toucher…) sans qu'on modifie sa configuration. Les modèles sont servis par [llmman](https://github.com/llmmanorg/llmman). English version: [README.en.md](README.en.md). | |
| 4 | + | |
| 5 | +## Ce qu'il y a ici | |
| 6 | + | |
| 7 | +| Fichier | Rôle | | |
| 8 | +|---|---| | |
| 9 | +| `project/` | Un petit « projet », **Tangerine** : c'est le dossier dans lequel on lance mm. | | |
| 10 | +| `project/AGENTS.md` | Les consignes du projet : les tests se lancent avec `make check` (jamais `go test`), ne pas toucher `vendor/` ni `generated/`, signer chaque réponse `-- Tangerine bot`. | | |
| 11 | +| `project/Makefile`, `project/greet.sh` | De quoi faire tourner `make check`. | | |
| 12 | +| `agent.yaml` | **Bob**, un agent de code (`bash`, outils de fichiers, `ask_agent`). Il lit `AGENTS.md` (le réglage `agentsMd` y est écrit en entier, avec ses valeurs par défaut). | | |
| 13 | +| `agent.helper.yaml` | **helper**, appelé par Bob : sans outils, il **lit** `AGENTS.md` (réglage par défaut). | | |
| 14 | +| `agent.reviewer.yaml` | **reviewer**, appelé par Bob : sans outils, il **ne lit pas** `AGENTS.md` (`agentsMd.enabled: false`). | | |
| 15 | + | |
| 16 | +Les trois agents utilisent `hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | |
| 17 | + | |
| 18 | +## Prérequis | |
| 19 | + | |
| 20 | +1. llmman qui tourne (`llmman serve`, sur `127.0.0.1:17434` ; depuis un Docker Sandbox, mm se replie tout seul sur `host.docker.internal:17434`), et le modèle téléchargé : `llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | |
| 21 | +2. `mm` compilé à la racine du dépôt (`go build -o mm .`). | |
| 22 | +3. **Lancez mm depuis `project/`** : `AGENTS.md` est cherché dans le répertoire de travail, pas à côté du fichier de configuration. | |
| 23 | + | |
| 24 | + ```bash | |
| 25 | + cd demo-agents-file/project | |
| 26 | + ``` | |
| 27 | + | |
| 28 | +## Le réglage | |
| 29 | + | |
| 30 | +Dans `agent.yaml` (ce sont les valeurs par défaut : une config qui ne mentionne pas `agentsMd` lit `./AGENTS.md` de la même façon) : | |
| 31 | + | |
| 32 | +```yaml | |
| 33 | +agentsMd: | |
| 34 | + enabled: true # lu au début de chaque conversation : démarrage, /new, /resume | |
| 35 | + path: AGENTS.md # relatif au répertoire de travail (le projet), pas à ce fichier | |
| 36 | + maxChars: 0 # 0 = pas de limite ; au-delà, le fichier est ignoré en entier, jamais coupé | |
| 37 | +``` | |
| 38 | + | |
| 39 | +Le modèle reçoit son prompt `system`, puis : | |
| 40 | + | |
| 41 | +```text | |
| 42 | +PROJECT INSTRUCTIONS (from /…/demo-agents-file/project/AGENTS.md) | |
| 43 | +The instructions of the project you work in. Follow them; when the user asks otherwise in the conversation, the user wins. | |
| 44 | + | |
| 45 | +# Project "Tangerine" — instructions for coding agents | |
| 46 | +… | |
| 47 | +``` | |
| 48 | + | |
| 49 | +## 1. La bannière dit quel fichier est lu | |
| 50 | + | |
| 51 | +```bash | |
| 52 | +mm ../agent.yaml | |
| 53 | +``` | |
| 54 | + | |
| 55 | +``` | |
| 56 | +mm … | tools: bash, read_file, write_file, edit_file, ask_agent | skills: 0 | yolo: on | agents.md: /…/demo-agents-file/project/AGENTS.md (~125 tokens) | |
| 57 | +``` | |
| 58 | + | |
| 59 | +(L'avertissement `no skills found` est normal : cette démo n'a pas de skills.) | |
| 60 | + | |
| 61 | +## 2. Bob suit les consignes du projet | |
| 62 | + | |
| 63 | +```bash | |
| 64 | +mm ../agent.yaml -p "Run the tests." | |
| 65 | +``` | |
| 66 | + | |
| 67 | +``` | |
| 68 | +🛠️ bash: make check | |
| 69 | + │ running the Tangerine checks… | |
| 70 | + │ ✅ all checks passed | |
| 71 | +🤖 ✅ all checks passed | |
| 72 | +``` | |
| 73 | + | |
| 74 | +Bob lance `make check`, la commande que fixe `AGENTS.md`, et pas une commande devinée. | |
| 75 | + | |
| 76 | +**Pour comparer**, mettez le fichier de côté et reposez la même question. `AGENT_YOLO=false` empêche les commandes de s'exécuter : on voit ce que Bob *voulait* lancer. | |
| 77 | + | |
| 78 | +```bash | |
| 79 | +mv AGENTS.md AGENTS.md.off | |
| 80 | +AGENT_YOLO=false ../../mm ../agent.yaml -p "Run the tests." | |
| 81 | +mv AGENTS.md.off AGENTS.md | |
| 82 | +``` | |
| 83 | + | |
| 84 | +``` | |
| 85 | +🛠️ bash: python -m pytest | |
| 86 | + │ [command rejected by the user] | |
| 87 | +🛠️ bash: pytest | |
| 88 | + │ [command rejected by the user] | |
| 89 | +… | |
| 90 | +``` | |
| 91 | + | |
| 92 | +Sans consigne, le modèle devine (ici, `pytest`, alors que le projet n'a pas une ligne de Python ; lors d'un essai avec `yolo: true`, il est allé jusqu'à lancer `pip3 install pytest`). | |
| 93 | + | |
| 94 | +## 3. Un agent appelé décide avec SA propre config | |
| 95 | + | |
| 96 | +Quand Bob confie une question à un autre agent (`ask_agent`, `/ask`, `mm --ask`), l'agent appelé travaille dans le même répertoire, mais c'est **son** réglage `agentsMd` qui décide s'il lit le fichier. | |
| 97 | + | |
| 98 | +```bash | |
| 99 | +mm ../agent.yaml --ask helper -p "How do I run the tests in this project?" | |
| 100 | +``` | |
| 101 | + | |
| 102 | +``` | |
| 103 | +To run the tests, execute `make check` as instructed by the project's build and test guidelines. Always quote the last line of the command output in your response. | |
| 104 | +-- Tangerine bot | |
| 105 | +``` | |
| 106 | + | |
| 107 | +```bash | |
| 108 | +mm ../agent.yaml --ask reviewer -p "How do I run the tests in this project?" | |
| 109 | +``` | |
| 110 | + | |
| 111 | +``` | |
| 112 | +Run the tests by executing the command specified in your project's documentation, typically `npm test` for Node.js projects or `pytest` for Python projects. … | |
| 113 | +``` | |
| 114 | + | |
| 115 | +helper connaît `make check` et signe ; reviewer (`agentsMd.enabled: false`) donne une réponse générique : il n'a pas vu le fichier. | |
| 116 | + | |
| 117 | +## 4. Modifier `AGENTS.md` pendant une session | |
| 118 | + | |
| 119 | +Le fichier est lu **au début de chaque conversation**, jamais au milieu (changer le message système en cours de route obligerait le serveur à relire tout l'historique). Pour prendre une modification en compte : | |
| 120 | + | |
| 121 | +```bash | |
| 122 | +../../mm ../agent.yaml | |
| 123 | +> Run the tests. # make check | |
| 124 | +``` | |
| 125 | + | |
| 126 | +Modifiez `AGENTS.md` dans un autre terminal (par exemple : la commande devient `sh greet.sh Tangerine`), puis : | |
| 127 | + | |
| 128 | +```text | |
| 129 | +> /new | |
| 130 | +🆕 new session: 4 message(s) forgotten | |
| 131 | +> Run the tests. | |
| 132 | +🛠️ bash: sh greet.sh Tangerine | |
| 133 | +``` | |
| 134 | + | |
| 135 | +La nouvelle consigne s'applique dès la nouvelle conversation. (Lors de notre essai, Bob a ensuite lancé aussi `make check`, malgré « Never run make » : un modèle 4B ne respecte pas chaque interdiction.) | |
| 136 | + | |
| 137 | +`/resume` relit aussi le fichier actuel. | |
| 138 | + | |
| 139 | +## 5. Vérifier ce que le modèle a reçu | |
| 140 | + | |
| 141 | +```bash | |
| 142 | +AGENT_TRACE=true ../../mm ../agent.yaml -p "Run the tests." | |
| 143 | +jq -r '.messages[0].content' .mm/traces/*-0001.request.json | |
| 144 | +``` | |
| 145 | + | |
| 146 | +Le message système se termine par la section `PROJECT INSTRUCTIONS (from …)`. | |
| 147 | + | |
| 148 | +## Ce qu'il faut savoir | |
| 149 | + | |
| 150 | +- **Un petit modèle ne suit pas toutes les règles à chaque fois** : avec Qwen3.5-4B, Bob a lancé `make check` à chaque essai, mais a oublié la signature `-- Tangerine bot` ; helper, sans outils, l'a mise. Des consignes courtes et concrètes passent mieux. | |
| 151 | +- **Taille** : le fichier part avec chaque requête. La bannière avertit quand il occupe 20 % ou plus de la fenêtre de contexte ; `agentsMd.maxChars` fixe une limite ferme (au-delà, il est ignoré en entier, et la bannière l'indique `skipped (too long)`). | |
| 152 | +- **Un agent JSON** (`structuredOutput`) ne lit jamais `AGENTS.md` ; sa bannière indique `agents.md: ignored (structured output)`. Voir [demo-structured-output](../demo-structured-output/README.md). | |
| 153 | +- **Dans un éditeur** (Zed…, mode ACP), chaque session lit le `AGENTS.md` du projet ouvert. | |
| 154 | + | |
| 155 | +## Pour aller plus loin | |
| 156 | + | |
| 157 | +- [Donner à l'agent les consignes de votre projet](../docs/fr/how-to/give-project-instructions.md) | |
| 158 | +- [Référence de `agentsMd`](../docs/fr/reference/configuration.md#clés-de-agentsmd) | |
| 159 | +- [Consignes du projet — explication](../docs/fr/explanation/project-instructions.md) | |
| new file mode 100644 | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | +# Démo mini-me : les consignes du projet (`AGENTS.md`) | ||
| 2 | + | ||
| 3 | +Ce dossier montre comment mini-me lit le fichier `AGENTS.md` du projet dans lequel il travaille et l'ajoute à son prompt système : l'agent suit alors les règles du projet (quelle commande lance les tests, ce qu'il ne faut pas toucher…) sans qu'on modifie sa configuration. Les modèles sont servis par [llmman](https://github.com/llmmanorg/llmman). English version: [README.en.md](README.en.md). | ||
| 4 | + | ||
| 5 | +## Ce qu'il y a ici | ||
| 6 | + | ||
| 7 | +| Fichier | Rôle | | ||
| 8 | +|---|---| | ||
| 9 | +| `project/` | Un petit « projet », **Tangerine** : c'est le dossier dans lequel on lance mm. | | ||
| 10 | +| `project/AGENTS.md` | Les consignes du projet : les tests se lancent avec `make check` (jamais `go test`), ne pas toucher `vendor/` ni `generated/`, signer chaque réponse `-- Tangerine bot`. | | ||
| 11 | +| `project/Makefile`, `project/greet.sh` | De quoi faire tourner `make check`. | | ||
| 12 | +| `agent.yaml` | **Bob**, un agent de code (`bash`, outils de fichiers, `ask_agent`). Il lit `AGENTS.md` (le réglage `agentsMd` y est écrit en entier, avec ses valeurs par défaut). | | ||
| 13 | +| `agent.helper.yaml` | **helper**, appelé par Bob : sans outils, il **lit** `AGENTS.md` (réglage par défaut). | | ||
| 14 | +| `agent.reviewer.yaml` | **reviewer**, appelé par Bob : sans outils, il **ne lit pas** `AGENTS.md` (`agentsMd.enabled: false`). | | ||
| 15 | + | ||
| 16 | +Les trois agents utilisent `hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | ||
| 17 | + | ||
| 18 | +## Prérequis | ||
| 19 | + | ||
| 20 | +1. llmman qui tourne (`llmman serve`, sur `127.0.0.1:17434` ; depuis un Docker Sandbox, mm se replie tout seul sur `host.docker.internal:17434`), et le modèle téléchargé : `llmman pull hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M`. | ||
| 21 | +2. `mm` compilé à la racine du dépôt (`go build -o mm .`). | ||
| 22 | +3. **Lancez mm depuis `project/`** : `AGENTS.md` est cherché dans le répertoire de travail, pas à côté du fichier de configuration. | ||
| 23 | + | ||
| 24 | + ```bash | ||
| 25 | + cd demo-agents-file/project | ||
| 26 | + ``` | ||
| 27 | + | ||
| 28 | +## Le réglage | ||
| 29 | + | ||
| 30 | +Dans `agent.yaml` (ce sont les valeurs par défaut : une config qui ne mentionne pas `agentsMd` lit `./AGENTS.md` de la même façon) : | ||
| 31 | + | ||
| 32 | +```yaml | ||
| 33 | +agentsMd: | ||
| 34 | + enabled: true # lu au début de chaque conversation : démarrage, /new, /resume | ||
| 35 | + path: AGENTS.md # relatif au répertoire de travail (le projet), pas à ce fichier | ||
| 36 | + maxChars: 0 # 0 = pas de limite ; au-delà, le fichier est ignoré en entier, jamais coupé | ||
| 37 | +``` | ||
| 38 | + | ||
| 39 | +Le modèle reçoit son prompt `system`, puis : | ||
| 40 | + | ||
| 41 | +```text | ||
| 42 | +PROJECT INSTRUCTIONS (from /…/demo-agents-file/project/AGENTS.md) | ||
| 43 | +The instructions of the project you work in. Follow them; when the user asks otherwise in the conversation, the user wins. | ||
| 44 | + | ||
| 45 | +# Project "Tangerine" — instructions for coding agents | ||
| 46 | +… | ||
| 47 | +``` | ||
| 48 | + | ||
| 49 | +## 1. La bannière dit quel fichier est lu | ||
| 50 | + | ||
| 51 | +```bash | ||
| 52 | +mm ../agent.yaml | ||
| 53 | +``` | ||
| 54 | + | ||
| 55 | +``` | ||
| 56 | +mm … | tools: bash, read_file, write_file, edit_file, ask_agent | skills: 0 | yolo: on | agents.md: /…/demo-agents-file/project/AGENTS.md (~125 tokens) | ||
| 57 | +``` | ||
| 58 | + | ||
| 59 | +(L'avertissement `no skills found` est normal : cette démo n'a pas de skills.) | ||
| 60 | + | ||
| 61 | +## 2. Bob suit les consignes du projet | ||
| 62 | + | ||
| 63 | +```bash | ||
| 64 | +mm ../agent.yaml -p "Run the tests." | ||
| 65 | +``` | ||
| 66 | + | ||
| 67 | +``` | ||
| 68 | +🛠️ bash: make check | ||
| 69 | + │ running the Tangerine checks… | ||
| 70 | + │ ✅ all checks passed | ||
| 71 | +🤖 ✅ all checks passed | ||
| 72 | +``` | ||
| 73 | + | ||
| 74 | +Bob lance `make check`, la commande que fixe `AGENTS.md`, et pas une commande devinée. | ||
| 75 | + | ||
| 76 | +**Pour comparer**, mettez le fichier de côté et reposez la même question. `AGENT_YOLO=false` empêche les commandes de s'exécuter : on voit ce que Bob *voulait* lancer. | ||
| 77 | + | ||
| 78 | +```bash | ||
| 79 | +mv AGENTS.md AGENTS.md.off | ||
| 80 | +AGENT_YOLO=false ../../mm ../agent.yaml -p "Run the tests." | ||
| 81 | +mv AGENTS.md.off AGENTS.md | ||
| 82 | +``` | ||
| 83 | + | ||
| 84 | +``` | ||
| 85 | +🛠️ bash: python -m pytest | ||
| 86 | + │ [command rejected by the user] | ||
| 87 | +🛠️ bash: pytest | ||
| 88 | + │ [command rejected by the user] | ||
| 89 | +… | ||
| 90 | +``` | ||
| 91 | + | ||
| 92 | +Sans consigne, le modèle devine (ici, `pytest`, alors que le projet n'a pas une ligne de Python ; lors d'un essai avec `yolo: true`, il est allé jusqu'à lancer `pip3 install pytest`). | ||
| 93 | + | ||
| 94 | +## 3. Un agent appelé décide avec SA propre config | ||
| 95 | + | ||
| 96 | +Quand Bob confie une question à un autre agent (`ask_agent`, `/ask`, `mm --ask`), l'agent appelé travaille dans le même répertoire, mais c'est **son** réglage `agentsMd` qui décide s'il lit le fichier. | ||
| 97 | + | ||
| 98 | +```bash | ||
| 99 | +mm ../agent.yaml --ask helper -p "How do I run the tests in this project?" | ||
| 100 | +``` | ||
| 101 | + | ||
| 102 | +``` | ||
| 103 | +To run the tests, execute `make check` as instructed by the project's build and test guidelines. Always quote the last line of the command output in your response. | ||
| 104 | +-- Tangerine bot | ||
| 105 | +``` | ||
| 106 | + | ||
| 107 | +```bash | ||
| 108 | +mm ../agent.yaml --ask reviewer -p "How do I run the tests in this project?" | ||
| 109 | +``` | ||
| 110 | + | ||
| 111 | +``` | ||
| 112 | +Run the tests by executing the command specified in your project's documentation, typically `npm test` for Node.js projects or `pytest` for Python projects. … | ||
| 113 | +``` | ||
| 114 | + | ||
| 115 | +helper connaît `make check` et signe ; reviewer (`agentsMd.enabled: false`) donne une réponse générique : il n'a pas vu le fichier. | ||
| 116 | + | ||
| 117 | +## 4. Modifier `AGENTS.md` pendant une session | ||
| 118 | + | ||
| 119 | +Le fichier est lu **au début de chaque conversation**, jamais au milieu (changer le message système en cours de route obligerait le serveur à relire tout l'historique). Pour prendre une modification en compte : | ||
| 120 | + | ||
| 121 | +```bash | ||
| 122 | +../../mm ../agent.yaml | ||
| 123 | +> Run the tests. # make check | ||
| 124 | +``` | ||
| 125 | + | ||
| 126 | +Modifiez `AGENTS.md` dans un autre terminal (par exemple : la commande devient `sh greet.sh Tangerine`), puis : | ||
| 127 | + | ||
| 128 | +```text | ||
| 129 | +> /new | ||
| 130 | +🆕 new session: 4 message(s) forgotten | ||
| 131 | +> Run the tests. | ||
| 132 | +🛠️ bash: sh greet.sh Tangerine | ||
| 133 | +``` | ||
| 134 | + | ||
| 135 | +La nouvelle consigne s'applique dès la nouvelle conversation. (Lors de notre essai, Bob a ensuite lancé aussi `make check`, malgré « Never run make » : un modèle 4B ne respecte pas chaque interdiction.) | ||
| 136 | + | ||
| 137 | +`/resume` relit aussi le fichier actuel. | ||
| 138 | + | ||
| 139 | +## 5. Vérifier ce que le modèle a reçu | ||
| 140 | + | ||
| 141 | +```bash | ||
| 142 | +AGENT_TRACE=true ../../mm ../agent.yaml -p "Run the tests." | ||
| 143 | +jq -r '.messages[0].content' .mm/traces/*-0001.request.json | ||
| 144 | +``` | ||
| 145 | + | ||
| 146 | +Le message système se termine par la section `PROJECT INSTRUCTIONS (from …)`. | ||
| 147 | + | ||
| 148 | +## Ce qu'il faut savoir | ||
| 149 | + | ||
| 150 | +- **Un petit modèle ne suit pas toutes les règles à chaque fois** : avec Qwen3.5-4B, Bob a lancé `make check` à chaque essai, mais a oublié la signature `-- Tangerine bot` ; helper, sans outils, l'a mise. Des consignes courtes et concrètes passent mieux. | ||
| 151 | +- **Taille** : le fichier part avec chaque requête. La bannière avertit quand il occupe 20 % ou plus de la fenêtre de contexte ; `agentsMd.maxChars` fixe une limite ferme (au-delà, il est ignoré en entier, et la bannière l'indique `skipped (too long)`). | ||
| 152 | +- **Un agent JSON** (`structuredOutput`) ne lit jamais `AGENTS.md` ; sa bannière indique `agents.md: ignored (structured output)`. Voir [demo-structured-output](../demo-structured-output/README.md). | ||
| 153 | +- **Dans un éditeur** (Zed…, mode ACP), chaque session lit le `AGENTS.md` du projet ouvert. | ||
| 154 | + | ||
| 155 | +## Pour aller plus loin | ||
| 156 | + | ||
| 157 | +- [Donner à l'agent les consignes de votre projet](../docs/fr/how-to/give-project-instructions.md) | ||
| 158 | +- [Référence de `agentsMd`](../docs/fr/reference/configuration.md#clés-de-agentsmd) | ||
| 159 | +- [Consignes du projet — explication](../docs/fr/explanation/project-instructions.md) | ||
added
demo-agents-file/agent.helper.yaml +26 -0 | new file mode 100644 | ||
| @@ -0,0 +1,26 @@ | ||
| 1 | +# Agent settings — helper: no tools, and it READS the project's AGENTS.md | |
| 2 | +# (agentsMd is on by default). Asked by Bob, it runs in Bob's working | |
| 3 | +# directory, so it gets the same project rules. | |
| 4 | +provider: llmman | |
| 5 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | |
| 6 | +baseUrl: http://127.0.0.1:17434/v1 | |
| 7 | +fallback: http://host.docker.internal:17434/v1 | |
| 8 | + | |
| 9 | +bashTool: false | |
| 10 | +editTools: false | |
| 11 | +planTool: false | |
| 12 | +skillsDir: no-skills | |
| 13 | + | |
| 14 | +acp: | |
| 15 | + name: helper | |
| 16 | + title: Helper (reads AGENTS.md) | |
| 17 | + | |
| 18 | +system: | | |
| 19 | + You are Helper. You answer questions about how to work in a project, in | |
| 20 | + two sentences at most. You have no tools. | |
| 21 | + | |
| 22 | +sampling: | |
| 23 | + temperature: 0.0 | |
| 24 | + max_tokens: 1024 | |
| 25 | + chat_template_kwargs: | |
| 26 | + enable_thinking: false | |
| new file mode 100644 | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | +# Agent settings — helper: no tools, and it READS the project's AGENTS.md | ||
| 2 | +# (agentsMd is on by default). Asked by Bob, it runs in Bob's working | ||
| 3 | +# directory, so it gets the same project rules. | ||
| 4 | +provider: llmman | ||
| 5 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | ||
| 6 | +baseUrl: http://127.0.0.1:17434/v1 | ||
| 7 | +fallback: http://host.docker.internal:17434/v1 | ||
| 8 | + | ||
| 9 | +bashTool: false | ||
| 10 | +editTools: false | ||
| 11 | +planTool: false | ||
| 12 | +skillsDir: no-skills | ||
| 13 | + | ||
| 14 | +acp: | ||
| 15 | + name: helper | ||
| 16 | + title: Helper (reads AGENTS.md) | ||
| 17 | + | ||
| 18 | +system: | | ||
| 19 | + You are Helper. You answer questions about how to work in a project, in | ||
| 20 | + two sentences at most. You have no tools. | ||
| 21 | + | ||
| 22 | +sampling: | ||
| 23 | + temperature: 0.0 | ||
| 24 | + max_tokens: 1024 | ||
| 25 | + chat_template_kwargs: | ||
| 26 | + enable_thinking: false | ||
added
demo-agents-file/agent.reviewer.yaml +30 -0 | new file mode 100644 | ||
| @@ -0,0 +1,30 @@ | ||
| 1 | +# Agent settings — reviewer: no tools, and it does NOT read the project's AGENTS.md | |
| 2 | +# (agentsMd.enabled: false below): its answers are an outside opinion, | |
| 3 | +# free of the project's rules — even though it runs in the project directory. | |
| 4 | +provider: llmman | |
| 5 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | |
| 6 | +baseUrl: http://127.0.0.1:17434/v1 | |
| 7 | +fallback: http://host.docker.internal:17434/v1 | |
| 8 | + | |
| 9 | +bashTool: false | |
| 10 | +editTools: false | |
| 11 | +planTool: false | |
| 12 | +skillsDir: no-skills | |
| 13 | + | |
| 14 | +# The one difference with agent.helper.yaml. | |
| 15 | +agentsMd: | |
| 16 | + enabled: false | |
| 17 | + | |
| 18 | +acp: | |
| 19 | + name: reviewer | |
| 20 | + title: Reviewer (ignores AGENTS.md) | |
| 21 | + | |
| 22 | +system: | | |
| 23 | + You are Reviewer. You answer questions about how to work in a project, in | |
| 24 | + two sentences at most. You have no tools. | |
| 25 | + | |
| 26 | +sampling: | |
| 27 | + temperature: 0.0 | |
| 28 | + max_tokens: 1024 | |
| 29 | + chat_template_kwargs: | |
| 30 | + enable_thinking: false | |
| new file mode 100644 | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | +# Agent settings — reviewer: no tools, and it does NOT read the project's AGENTS.md | ||
| 2 | +# (agentsMd.enabled: false below): its answers are an outside opinion, | ||
| 3 | +# free of the project's rules — even though it runs in the project directory. | ||
| 4 | +provider: llmman | ||
| 5 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | ||
| 6 | +baseUrl: http://127.0.0.1:17434/v1 | ||
| 7 | +fallback: http://host.docker.internal:17434/v1 | ||
| 8 | + | ||
| 9 | +bashTool: false | ||
| 10 | +editTools: false | ||
| 11 | +planTool: false | ||
| 12 | +skillsDir: no-skills | ||
| 13 | + | ||
| 14 | +# The one difference with agent.helper.yaml. | ||
| 15 | +agentsMd: | ||
| 16 | + enabled: false | ||
| 17 | + | ||
| 18 | +acp: | ||
| 19 | + name: reviewer | ||
| 20 | + title: Reviewer (ignores AGENTS.md) | ||
| 21 | + | ||
| 22 | +system: | | ||
| 23 | + You are Reviewer. You answer questions about how to work in a project, in | ||
| 24 | + two sentences at most. You have no tools. | ||
| 25 | + | ||
| 26 | +sampling: | ||
| 27 | + temperature: 0.0 | ||
| 28 | + max_tokens: 1024 | ||
| 29 | + chat_template_kwargs: | ||
| 30 | + enable_thinking: false | ||
added
demo-agents-file/agent.yaml +62 -0 | new file mode 100644 | ||
| @@ -0,0 +1,62 @@ | ||
| 1 | +# Agent settings — Bob, a coding agent that follows the AGENTS.md of the | |
| 2 | +# project it works in (ticket 81). Run him FROM THE PROJECT directory: | |
| 3 | +# | |
| 4 | +# cd demo-agents-file/project | |
| 5 | +# ../../mm ../agent.yaml | |
| 6 | +# | |
| 7 | +# The banner then shows: agents.md: …/project/AGENTS.md (~N tokens) | |
| 8 | +provider: llmman | |
| 9 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | |
| 10 | +baseUrl: http://127.0.0.1:17434/v1 | |
| 11 | +fallback: http://host.docker.internal:17434/v1 | |
| 12 | + | |
| 13 | +# The project's instructions. These are the defaults — written out for the | |
| 14 | +# demo; a config that never mentions agentsMd reads ./AGENTS.md all the same. | |
| 15 | +# enabled read it at the start of every conversation (start-up, /new, /resume) | |
| 16 | +# path relative to the WORKING directory (the project), not to this file | |
| 17 | +# maxChars 0 = no limit; above it the file is skipped whole, never cut | |
| 18 | +agentsMd: | |
| 19 | + enabled: true | |
| 20 | + path: AGENTS.md | |
| 21 | + maxChars: 0 | |
| 22 | + | |
| 23 | +# Two agents Bob can hand work to with `ask_agent`. Each one decides with | |
| 24 | +# ITS OWN agentsMd setting whether it reads the project's AGENTS.md: helper | |
| 25 | +# does (default), reviewer does not (agentsMd.enabled: false). | |
| 26 | +mmConfigs: | |
| 27 | + helper: | |
| 28 | + path: agent.helper.yaml | |
| 29 | + description: A second coding agent with no tools — answers questions about how to work in this project. | |
| 30 | + reviewer: | |
| 31 | + path: agent.reviewer.yaml | |
| 32 | + description: A neutral reviewer with no tools — gives an outside opinion, without the project's rules. | |
| 33 | + | |
| 34 | +bashTool: true | |
| 35 | +editTools: true | |
| 36 | +planTool: false | |
| 37 | +skillsDir: no-skills | |
| 38 | +# Bob's commands and edits run without asking, so that `-p` runs to the end. | |
| 39 | +yolo: true | |
| 40 | +bashTimeout: 1m | |
| 41 | + | |
| 42 | +acp: | |
| 43 | + name: bob | |
| 44 | + title: Bob (coding agent) | |
| 45 | + | |
| 46 | +system: | | |
| 47 | + Your name is Bob. You are a coding agent working in a terminal, with a | |
| 48 | + `bash` tool and file tools (`read_file`, `write_file`, `edit_file`). | |
| 49 | + Never state the output of a command you did not run in this answer. | |
| 50 | + `ask_agent` hands a question to another agent; call it only when the user | |
| 51 | + names that agent. | |
| 52 | + | |
| 53 | +sampling: | |
| 54 | + temperature: 0.0 | |
| 55 | + parallel_tool_calls: false | |
| 56 | + max_tokens: 4096 | |
| 57 | + chat_template_kwargs: | |
| 58 | + enable_thinking: false | |
| 59 | + | |
| 60 | +maxTurns: 20 | |
| 61 | +watchdogTimeout: 2m | |
| 62 | +firstTokenTimeout: 3m | |
| new file mode 100644 | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | +# Agent settings — Bob, a coding agent that follows the AGENTS.md of the | ||
| 2 | +# project it works in (ticket 81). Run him FROM THE PROJECT directory: | ||
| 3 | +# | ||
| 4 | +# cd demo-agents-file/project | ||
| 5 | +# ../../mm ../agent.yaml | ||
| 6 | +# | ||
| 7 | +# The banner then shows: agents.md: …/project/AGENTS.md (~N tokens) | ||
| 8 | +provider: llmman | ||
| 9 | +model: hf.co/unsloth/Qwen3.5-4B-GGUF:Q4_K_M | ||
| 10 | +baseUrl: http://127.0.0.1:17434/v1 | ||
| 11 | +fallback: http://host.docker.internal:17434/v1 | ||
| 12 | + | ||
| 13 | +# The project's instructions. These are the defaults — written out for the | ||
| 14 | +# demo; a config that never mentions agentsMd reads ./AGENTS.md all the same. | ||
| 15 | +# enabled read it at the start of every conversation (start-up, /new, /resume) | ||
| 16 | +# path relative to the WORKING directory (the project), not to this file | ||
| 17 | +# maxChars 0 = no limit; above it the file is skipped whole, never cut | ||
| 18 | +agentsMd: | ||
| 19 | + enabled: true | ||
| 20 | + path: AGENTS.md | ||
| 21 | + maxChars: 0 | ||
| 22 | + | ||
| 23 | +# Two agents Bob can hand work to with `ask_agent`. Each one decides with | ||
| 24 | +# ITS OWN agentsMd setting whether it reads the project's AGENTS.md: helper | ||
| 25 | +# does (default), reviewer does not (agentsMd.enabled: false). | ||
| 26 | +mmConfigs: | ||
| 27 | + helper: | ||
| 28 | + path: agent.helper.yaml | ||
| 29 | + description: A second coding agent with no tools — answers questions about how to work in this project. | ||
| 30 | + reviewer: | ||
| 31 | + path: agent.reviewer.yaml | ||
| 32 | + description: A neutral reviewer with no tools — gives an outside opinion, without the project's rules. | ||
| 33 | + | ||
| 34 | +bashTool: true | ||
| 35 | +editTools: true | ||
| 36 | +planTool: false | ||
| 37 | +skillsDir: no-skills | ||
| 38 | +# Bob's commands and edits run without asking, so that `-p` runs to the end. | ||
| 39 | +yolo: true | ||
| 40 | +bashTimeout: 1m | ||
| 41 | + | ||
| 42 | +acp: | ||
| 43 | + name: bob | ||
| 44 | + title: Bob (coding agent) | ||
| 45 | + | ||
| 46 | +system: | | ||
| 47 | + Your name is Bob. You are a coding agent working in a terminal, with a | ||
| 48 | + `bash` tool and file tools (`read_file`, `write_file`, `edit_file`). | ||
| 49 | + Never state the output of a command you did not run in this answer. | ||
| 50 | + `ask_agent` hands a question to another agent; call it only when the user | ||
| 51 | + names that agent. | ||
| 52 | + | ||
| 53 | +sampling: | ||
| 54 | + temperature: 0.0 | ||
| 55 | + parallel_tool_calls: false | ||
| 56 | + max_tokens: 4096 | ||
| 57 | + chat_template_kwargs: | ||
| 58 | + enable_thinking: false | ||
| 59 | + | ||
| 60 | +maxTurns: 20 | ||
| 61 | +watchdogTimeout: 2m | ||
| 62 | +firstTokenTimeout: 3m | ||
added
demo-agents-file/project/AGENTS.md +12 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
demo-agents-file/project/Makefile +6 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
demo-agents-file/project/greet.sh +3 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/diagrams/packages.drawio +1 -1 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/en/README.md +2 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/en/explanation/architecture.md +1 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
docs/en/explanation/project-instructions.md +38 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
docs/en/how-to/give-project-instructions.md +52 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/en/reference/cli.md +1 -1 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/en/reference/configuration.md +22 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/fr/README.md +2 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/fr/explanation/architecture.md +1 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
docs/fr/explanation/project-instructions.md +38 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
docs/fr/how-to/give-project-instructions.md +52 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/fr/reference/cli.md +1 -1 Large diff collapsed to keep the page fast — load it when you need it.
modified
docs/fr/reference/configuration.md +22 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/acp/acp.go +8 -4 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/acp/agentsmd_test.go +76 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/acp/persist.go +2 -1 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/agent/agent.go +7 -4 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/agent/agentsmd_test.go +32 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/agentsmd/agentsmd.go +134 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/agentsmd/agentsmd_test.go +165 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/agentsmd/example_test.go +29 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/config/agentsmd_test.go +46 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/config/config.go +28 -0 Large diff collapsed to keep the page fast — load it when you need it.
added
internal/tui/agentsmd_test.go +37 -0 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/tui/commands.go +3 -2 Large diff collapsed to keep the page fast — load it when you need it.
modified
internal/tui/turn.go +2 -1 Large diff collapsed to keep the page fast — load it when you need it.
modified
main.go +4 -2 Large diff collapsed to keep the page fast — load it when you need it.