feat: enhance prompt system with feature-conditional fragments and enriched tool descriptions#77
Merged
yishuiliunian merged 2 commits intomainfrom Apr 4, 2026
Merged
Conversation
…hed tool descriptions, and output styles (#76) Activate the dormant Feature condition mechanism in the fragment system and populate it from config state (memory, hooks, subagent, output style). - Add 6 new prompt fragments: memory guidance, hooks explanation, sub-agent guidelines, anti-hallucination guardrails, explanatory style, learning style - Expand security.md from 2-line OWASP mention to 5-layer threat model - Enhance memory-maintainer agent prompt with 4-type taxonomy and frontmatter format - Enrich tool descriptions for Read, Write, Edit, Fetch, WebSearch, PlanMode, AskUser - Extract prompt post-processing into prompt_post.rs (agent_setup.rs 222→189 lines) - Add output_style setting for configurable response styles - Add feature-conditional fragment tests and plan-mode tool tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Condition::Featuremechanism and wire it from config state (memory, hooks, subagent, output style)Changes
Infrastructure (features wiring)
system_prompt.rs: addfeatures: Vec<String>parameter tobuild_system_promptagent_setup.rs: build features vec from config (memory/hooks/subagent/style), extract MCP append toprompt_post.rssettings.rs: addoutput_style: StringfieldNew prompt fragments (23→29)
core/memory-guidance.md— when/how to use Memory toolcore/hooks.md— treat hook feedback as user inputtools/agent-guidelines.md— sub-agent spawning strategytasks/anti-hallucination.md— no fabrication, verify before referencingstyles/explanatory.md— educational response stylestyles/learning.md— collaborative learning styleEnhanced existing content
security.md— expanded from 2 lines to 5-layer threat modelmemory-maintainer.md— 4-type taxonomy, frontmatter format, merge strategyTool descriptions enriched
Test plan
bazel build //...passesbazel build //... --config=clippyzero warningsbazel test //...— 49/49 pass