refactor(sisyphus-prompt-builder): rename buildUltraworkAgentTable to buildUltraworkAgentSection
- Rename function to better reflect output format (bullet points, not table) - Change output from markdown table to bullet point list - Update sorting logic while maintaining agent priority 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -308,20 +308,8 @@ export function buildAntiPatternsSection(agents: AvailableAgent[]): string {
|
|||||||
${patterns.join("\n")}`
|
${patterns.join("\n")}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildUltraworkAgentTable(agents: AvailableAgent[]): string {
|
export function buildUltraworkAgentSection(agents: AvailableAgent[]): string {
|
||||||
if (agents.length === 0) {
|
if (agents.length === 0) return ""
|
||||||
return `| Agent | When |
|
|
||||||
|-------|------|
|
|
||||||
| explore (multiple) | Codebase search, patterns, structures |
|
|
||||||
| librarian (multiple) | External docs, GitHub OSS, remote repos |
|
|
||||||
| plan | Work breakdown (NEVER plan yourself) |
|
|
||||||
| oracle | Architecture, debugging after 2+ failures |`
|
|
||||||
}
|
|
||||||
|
|
||||||
const rows: string[] = [
|
|
||||||
"| Agent | When |",
|
|
||||||
"|-------|------|",
|
|
||||||
]
|
|
||||||
|
|
||||||
const ultraworkAgentPriority = ["explore", "librarian", "plan", "oracle"]
|
const ultraworkAgentPriority = ["explore", "librarian", "plan", "oracle"]
|
||||||
const sortedAgents = [...agents].sort((a, b) => {
|
const sortedAgents = [...agents].sort((a, b) => {
|
||||||
@@ -333,11 +321,12 @@ export function buildUltraworkAgentTable(agents: AvailableAgent[]): string {
|
|||||||
return aIdx - bIdx
|
return aIdx - bIdx
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const lines: string[] = []
|
||||||
for (const agent of sortedAgents) {
|
for (const agent of sortedAgents) {
|
||||||
const shortDesc = agent.description.split(".")[0] || agent.description
|
const shortDesc = agent.description.split(".")[0] || agent.description
|
||||||
const suffix = (agent.name === "explore" || agent.name === "librarian") ? " (multiple)" : ""
|
const suffix = (agent.name === "explore" || agent.name === "librarian") ? " (multiple)" : ""
|
||||||
rows.push(`| ${agent.name}${suffix} | ${shortDesc} |`)
|
lines.push(`- **${agent.name}${suffix}**: ${shortDesc}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows.join("\n")
|
return lines.join("\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user