@@ -30,7 +30,7 @@ use super::{
3030/// Kiro agent.
3131pub struct KiroIntegration ;
3232
33- const PROMPT_MARKER : & str = "## Prefer tracedecay MCP tools " ;
33+ const PROMPT_MARKER : & str = "## TraceDecay: mandatory tool routing " ;
3434const PROMPT_END_MARKER : & str = "<!-- tracedecay:kiro:end -->" ;
3535const KIRO_AGENT_NAME : & str = "tracedecay" ;
3636const OWNED_AGENT_DESCRIPTION : & str =
@@ -615,28 +615,36 @@ fn prompt_rules_text() -> String {
615615
616616fn prompt_rules_text_without_end_marker ( ) -> String {
617617 format ! (
618- "## Prefer tracedecay MCP tools\n \n \
619- Before reading source files or scanning the codebase, use the tracedecay MCP tools \
620- (`tracedecay_context`, `tracedecay_search`, `tracedecay_callers`, `tracedecay_callees`, \
621- `tracedecay_impact`, `tracedecay_node`, `tracedecay_files`, `tracedecay_affected`). \
622- They provide semantic results from a pre-built local knowledge graph and are faster \
623- than broad file reads.\n \n \
618+ "## TraceDecay: mandatory tool routing\n \n \
619+ This project has a live TraceDecay code graph. If there is even a 1% chance a \
620+ tracedecay tool applies, you MUST use it BEFORE Kiro's file reads, codebase scan, \
621+ or `delegate`. This is a mandate, not a preference — you cannot rationalize your \
622+ way out of it.\n \n \
623+ | The moment you are in | Do this first |\n \
624+ |---|---|\n \
625+ | Searching for a symbol or concept | `tracedecay_search` (names) or `tracedecay_context` (concepts) |\n \
626+ | About to read a source file | `tracedecay_outline` -> `tracedecay_body` -> `tracedecay_read` slices |\n \
627+ | \" Who calls X\" / \" what does X call\" / \" trace this\" | `tracedecay_callers` / `tracedecay_callees` |\n \
628+ | About to change code, wondering what breaks | `tracedecay_impact` / `tracedecay_diff_context` / `tracedecay_affected` |\n \
629+ | Project / storage identity question | `tracedecay_active_project` / `tracedecay_storage_status` |\n \
630+ | A prior decision or past conversation is referenced | `tracedecay_message_search` / `tracedecay_lcm_expand_query` |\n \n \
631+ | Red-flag thought | Reality |\n \
632+ |---|---|\n \
633+ | \" Grep is faster for this\" | `tracedecay_search` is one call and pre-ranked. |\n \
634+ | \" I'll just read the whole file\" | `tracedecay_outline` / `tracedecay_body` answer at a fraction of the tokens. |\n \
635+ | \" This is a simple lookup\" | Simple lookups are exactly what the graph is for. |\n \
636+ | \" I already know this codebase\" | The graph is fresher than your memory. Check it. |\n \n \
637+ SUBAGENT-STOP: if you were handed the exact files, symbols, or excerpts to act on, \
638+ do NOT re-run discovery — act on what you were given. Explicit user instructions and \
639+ project rules (CLAUDE.md / AGENTS.md) win over this mandate; the mandate wins over the \
640+ default \" just grep it\" habit. Never fight a direct instruction to satisfy it.\n \n \
624641 Do not use Kiro's `delegate` tool for codebase exploration, architecture mapping, \
625642 call graph work, symbol lookup, or other code research until tracedecay MCP tools \
626643 have been tried. Delegation is still appropriate for long-running execution work \
627644 such as builds, tests, generated reports, or independent implementation tasks.\n \n \
628- For project/storage identity questions, use `tracedecay_active_project` or \
629- `tracedecay_storage_status` instead of inferring from marker files or \
630- direct DB paths.\n \n \
631- If a code analysis question cannot be fully answered by tracedecay MCP tools, prefer \
632- built-in MCP tools first. If the user explicitly needs raw store inspection, use the \
633- resolved graph DB path reported by `tracedecay_storage_status` rather than a hardcoded \
634- repo path. Use SQL for structural queries that go beyond the MCP tools.\n \n \
635645 For durable project/user facts, prefer `tracedecay_fact_store`, \
636- `tracedecay_fact_feedback`, and `tracedecay_memory_status` over ad-hoc notes. Use \
637- `tracedecay_message_search` for active-project transcript recall when prior \
638- conversation context matters. Do not store secrets, credentials, or unnecessary PII \
639- in persistent facts.\n \n \
646+ `tracedecay_fact_feedback`, and `tracedecay_memory_status` over ad-hoc notes. Do not \
647+ store secrets, credentials, or unnecessary PII in persistent facts.\n \n \
640648 {cli_fallback}\n \n \
641649 If you discover a gap where an extractor, schema, or tracedecay tool could answer a \
642650 question natively, propose opening an issue at \
0 commit comments