MCPcopy Create free account
hub / github.com/driangle/taskmd / collectInitFiles

Function collectInitFiles

apps/cli/internal/cli/project_init.go:551–577  ·  view source on GitHub ↗

collectInitFiles returns files split into root and task dir. Agent configs and spec are both placed in the task directory.

(idStrategy idStrategyConfig)

Source from the content-addressed store, hash-verified

549// collectInitFiles returns files split into root and task dir.
550// Agent configs and spec are both placed in the task directory.
551func 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
579func getProjectInitAgents() []agentConfig {
580 var agents []agentConfig

Callers 1

runProjectInitFunction · 0.85

Calls 4

getIDStrategyExamplesFunction · 0.85
getProjectInitAgentsFunction · 0.85
idStrategySpecSectionFunction · 0.85

Tested by

no test coverage detected