collectInitFiles returns files split into root and task dir. Agent configs and spec are both placed in the task directory.
(idStrategy idStrategyConfig)
| 549 | // collectInitFiles returns files split into root and task dir. |
| 550 | // Agent configs and spec are both placed in the task directory. |
| 551 | func collectInitFiles(idStrategy idStrategyConfig) (rootFiles, taskDirFiles []fileToWrite) { |
| 552 | examples := getIDStrategyExamples(idStrategy) |
| 553 | |
| 554 | if !projectInitNoAgent { |
| 555 | agents := getProjectInitAgents() |
| 556 | for _, agent := range agents { |
| 557 | taskDirFiles = append(taskDirFiles, fileToWrite{ |
| 558 | filename: agent.filename, |
| 559 | content: applyIDStrategyReplacements(agent.template, examples), |
| 560 | }) |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | if !projectInitNoSpec { |
| 565 | specContent := applyIDStrategyReplacements(initSpecTemplate, examples) |
| 566 | // Append strategy-specific documentation section |
| 567 | if section := idStrategySpecSection(idStrategy); section != "" { |
| 568 | specContent = append(specContent, []byte(section)...) |
| 569 | } |
| 570 | taskDirFiles = append(taskDirFiles, fileToWrite{ |
| 571 | filename: specFilename, |
| 572 | content: specContent, |
| 573 | }) |
| 574 | } |
| 575 | |
| 576 | return rootFiles, taskDirFiles |
| 577 | } |
| 578 | |
| 579 | func getProjectInitAgents() []agentConfig { |
| 580 | var agents []agentConfig |
no test coverage detected