Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix: dynamically inject skill names into tool descriptions and system prompt

9 months ago

5d770ff
Authored
Claude2/10/2026, 6:09:41 PM
Three issues fixed:

1. Skill tool never called: The skill tool description and system prompt
   hardcoded wrong skill names ("xlsx", "pptx", "docx") while actual skill
   directories are named "spreadsheet", "slides", "doc". Models saw the
   mismatch and skipped the tool to avoid errors. Now:
   - Skill tool description is built dynamically from discovered skills
   - System prompt uses {{skillNames}} and {{skillExamples}} template
     variables populated from actual skill metadata at startup
   - Discovered skills are threaded through the call chain:
     loadSystemPromptWithSkills → startServer → session → agent → ToolContext

2. Bash pre-approval confusion: "Every bash command requires user approval"
   was ambiguous — GPT-5-mini interpreted it as "use the ask tool to get
   permission before calling bash." Reworded to clarify that approval is
   handled automatically by the tool infrastructure.

3. Output format discipline: Added "Output Format Compliance" section to the
   system prompt instructing models to respect strict output format
   requirements (e.g., raw JSON) without wrapping in prose or code fences.

https://claude.ai/code/session_01Ut2tjQrS7fYNry4gcpXhVx

Parentd00beb7

8 files changed
  • prompts/system.md+10−9
  • scripts/run_raw_agent_loops.ts+3−2
  • src/agent.ts+5−2
  • src/prompt.ts+45−2
  • src/server/session.ts+8−2
  • src/server/startServer.ts+3−2
  • src/tools/context.ts+3−0
  • src/tools/skill.ts+20−5