When a markdown file has #!/usr/bin/env agent and is executed directly, the agent CLI should detect this and read the file content as the prompt.
./Biz/PodcastItLater/Growth.md
# Error: agent tries to parse 'Biz/PodcastItLater/Growth.md' as prompt text
./Biz/PodcastItLater/Growth.md
# agent detects it's a file path, reads content, strips shebang, uses as prompt
In parseOptions, before using the prompt argument:
1. Check if argPrompt is a file path that exists
2. If so, read the file content
3. Strip the shebang line (#!/usr/bin/env agent) if present
4. Use remaining content as the prompt
-- Pseudocode
argPrompt <- case Docopt.getArg args (Docopt.argument "prompt") of
Nothing -> pure ""
Just path -> do
exists <- Dir.doesFileExist path
if exists && ".md" `List.isSuffixOf` path
then do
content <- TextIO.readFile path
-- Strip shebang line if present
let lines = Text.lines content
pure <| case lines of
(first:rest) | "#!" `Text.isPrefixOf` first -> Text.unlines rest
_ -> content
else pure (Text.pack path)
./Skill.md executes the skill as a prompt (file has shebang, is executable)agent "hello" still works (string prompt)agent Omni/Ide/Coder.md reads file content (explicit file path)