feat(sprout-agent): load AGENTS.md and SKILL.md into system prompt#762
Merged
Conversation
8019b36 to
8cc7423
Compare
Collaborator
Author
8cc7423 to
934b530
Compare
sprout-agent had zero support for AGENTS.md or SKILL.md — the only context it got was a hardcoded 1-line system prompt plus whatever sprout-acp assembled. Other harnesses (goose, Claude Code) handle their own loading, so this belongs in sprout-agent, not sprout-acp. At session/new time, walks from git-root to CWD collecting AGENTS.md files, scans .agents/skills/, .goose/skills/, .claude/skills/ for SKILL.md entries with YAML frontmatter, and prepends the combined content to the system prompt. SPROUT_AGENT_NO_HINTS=1 disables.
Reuse mcp::truncate_at_boundary instead of duplicating it in hints.rs, store effective_system_prompt as Arc<str> to avoid a 128KB clone per session/prompt, and strip WHAT doc comments per project style.
…archy sprout-agent only loaded hints from the git-root→CWD chain, missing user-level instructions entirely. Adds home directory as the first layer: ~/AGENTS.md is prepended before project hints, and ~/.agents/skills/ is scanned after CWD-relative dirs (project wins on name conflict). Includes dedup guard when ~ is already in the chain.
934b530 to
ce15067
Compare
wesbillman
approved these changes
May 29, 2026
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.



Add
AGENTS.mdandSKILL.mdsupport to sprout-agent, giving it the same project-hint and skill context that goose and Claude Code already inject for their agents.This belongs in
sprout-agentrather thansprout-acpbecause other harnesses (goose, Claude Code) already handle their own loading — injecting it insprout-acpwould double the context. Atsession/newtimesprout-agentwalks from~/AGENTS.md(global) through the git root to CWD collectingAGENTS.mdfiles, scans.agents/skills/,.goose/skills/, and.claude/skills/forSKILL.mdentries with YAML frontmatter, then appends global skills from~/.agents/skills/. The combined content is prepended to the configured system prompt for that session, computed once at session creation and immutable per-session.SPROUT_AGENT_NO_HINTS=1disables loading entirely.hints.rsmodule:find_git_root,load_hint_files,discover_skills,parse_skill_frontmatter,build_hints_section— all pure sync I/O, tolerates missing files silently~/AGENTS.mdloaded first (before git-root chain);~/.agents/skills/scanned after CWD-relative dirs (project wins on name conflict via first-name-wins dedup)Sessiongainseffective_system_prompt: Arc<str>;Llm::completenow takes an explicitsystem_prompt: &str(mirrors the existingsummarizesignature)