feat(agents): add named agents with AgentFactory integration for consistent agent triggering#338
feat(agents): add named agents with AgentFactory integration for consistent agent triggering#338sti0 wants to merge 1 commit into
Conversation
76993c0 to
865aded
Compare
|
Good job Timo!
|
Named Agents: - Add The Engineer (sonnet), The Architect (opus), The Intern (haiku) - Add NamedAgents.yaml with agent definitions and backstories - Add NamedAgent.hbs template for named agent prompts - Add --named and --role parameters to AgentFactory - Add --list-named to show available named agents and role mappings Workflows: - Add UseNamedAgent.md workflow for spawning named agents - Fix SpawnParallelAgents.md to use valid subagent_type "general-purpose" - Update SKILL.md to reference workflows instead of inline docs - Update README.md and INSTALL.md with all workflow files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
865aded to
3e8a6cd
Compare
|
Why does PAI implement a parallel agent system instead of extending claude's? this seems to lead to inconsistent invocation - sometimes, the model decides to run the PAI agent and other times it can try to run a claude sub-agent task. This PR goes in a great direction but still doesn't bridge the two. Not to mention the poor UX of having two claude /commands (/agents and /Agents) and a .claude/agents and a .claude/CORE/Agents/. Anyone have opinions on this? |
|
Thank you @sti0 for this named agents feature! 🙏 We've released PAI v2.1 which restructured everything from The named agents concept is great - if you'd like to re-apply this against See the release: https://github.com/danielmiessler/PAI/releases/tag/v2.1.0 |
This PR needs slightly adjustments if #322 gets merged first.
Summary
The Problem
Named agents existed in concept but didn't trigger consistently.
The previous implementation had named agent definitions scattered across documentation, but lacked the critical integration with AgentFactory that custom/dynamic agents had. This meant:
AgentFactory.ts --traits "..."→ JSON output → Task()AgentFactory.ts --named engineer→ JSON output → Task()Custom agents followed a disciplined workflow:
AgentFactory.tswith traitsTask()withsubagent_type: "general-purpose"Named agents had no equivalent path, leading to:
The Solution
Named agents now use the same AgentFactory workflow as custom agents.
New CLI Parameters
Named Agent Definitions
engineerarchitectinternRole Mappings
Semantic role names automatically resolve to the appropriate named agent:
implementer,developer,coderspec_reviewer,architecture,design,plannercode_quality_reviewer,quality,reviewergrunt_work,simple_task,quick_taskChanges
New Files
Data/NamedAgents.yamlTemplates/NamedAgent.hbsModified Files
Tools/AgentFactory.ts--named,--role,--list-namedsupport;NamedAgentDefinitioninterfaceSKILL.mdREADME.mdINSTALL.mdDeleted Files
AgentPersonalities.mdTest Plan
--list-namedshows all three agents with roles--named engineergenerates valid prompt with correct model (sonnet)--named architectgenerates valid prompt with correct model (opus)--named interngenerates valid prompt with correct model (haiku)--role implementercorrectly resolves to engineer--role spec_reviewercorrectly resolves to architect--traits "security,skeptical,thorough"still works (backward compatibility)[AGENT:engineer]tag for voice integrationMigration
No breaking changes. Existing
--traitsusage continues to work.New capability: Use
--namedor--rolefor persistent agent identities instead of ad-hoc trait composition.🤖 Generated with Claude Code