Commit bae487d
Changed files (1)
lib
elelem
lib/elelem/agent.rb
@@ -137,10 +137,18 @@ module Elelem
# Codebase
#{repo_map}
PROMPT
- prompt += "\n\n#{IO.read("AGENTS.md")}" if File.exist?("AGENTS.md")
+ prompt += "\n\n# Project Instructions\n#{agents_md}" if agents_md
prompt
end
+ def agents_md
+ Pathname.pwd.ascend.each do |dir|
+ file = dir / "AGENTS.md"
+ return file.read if file.exist?
+ end
+ nil
+ end
+
def git_branch
return unless File.exist?(".git")
"branch: #{`git branch --show-current`.strip}"