|
7 | 7 | - Invocation assumption: The executing developer has CODEGEN_API_TOKEN in environment and standing approval to create agent runs; note any resource-intensive or production-impacting tasks for review. |
8 | 8 |
|
9 | 9 | ## Inputs |
10 | | -- Required: Task specification (from #TaskPlanner or #TaskPromptBuilder), Codegen CLI installed and authenticated. |
11 | | -- Optional: Specific research packets to include, additional context files, custom prompt sections. |
12 | | -- Request missing info by: Enumerate gaps with example values (e.g., "Provide task ID from tasks.md", "Link research packet for context"); if CLI not authenticated, provide login instructions. |
| 10 | +- Required: Task specification (from #TaskPlanner or #TaskPromptBuilder), Codegen CLI installed and authenticated, repository ID and base branch. |
| 11 | +- Optional: Specific research packets to include, additional context files, custom prompt sections, PR number (if working from existing PR). |
| 12 | +- Request missing info by: Enumerate gaps with example values (e.g., "Provide task ID from tasks.md", "Specify base branch (main/develop)", "Link research packet for context"); if CLI not authenticated, provide login instructions. |
13 | 13 |
|
14 | 14 | ## Resource Strategy |
15 | 15 | - **Codegen CLI** (`codegen` command) - Primary interface for creating agent runs; assumes CLI is installed and authenticated. |
|
37 | 37 |
|
38 | 38 | 2. **Context gathering:** |
39 | 39 | - Read task specification from `.devagent/tasks/<slug>/tasks.md` |
| 40 | + - Identify repository context (repo ID, base branch, or relevant PR) |
40 | 41 | - Pull linked research packets from `.devagent/features/*/research/` |
41 | 42 | - Extract spec sections from `.devagent/features/*/spec/` |
42 | 43 | - Identify file hints and code entry points from task |
|
48 | 49 | **a) Task Overview** |
49 | 50 | - Clear, concise objective statement |
50 | 51 | - Link to source task ID and feature slug |
| 52 | + - Repository context (repo ID/name, base branch, or PR number) |
51 | 53 |
|
52 | 54 | **b) Context & Research** |
53 | 55 | - Key findings from research packets |
|
82 | 84 | - Include all context sections in structured format |
83 | 85 |
|
84 | 86 | 5. **Agent run creation:** |
85 | | - - Create agent via CLI: `codegen create <prompt-file>` |
86 | | - - Or pipe prompt directly: `echo "<prompt>" | codegen create -` |
| 87 | + - Create agent via CLI with repo context: `codegen agent --prompt "$(cat /tmp/prompt.md)" --repo-id <repo-id>` |
| 88 | + - Include base branch info in prompt (agent will create branch from it) |
87 | 89 | - Capture output: agent run ID and web URL |
88 | 90 | - Display web URL for monitoring progress |
89 | 91 |
|
|
119 | 121 | - Use `--json` flag for structured output |
120 | 122 | - Telemetry prompt will default to "no" if stdin unavailable |
121 | 123 | - **Incomplete task context:** List missing pieces (research, specs, file hints) and request from #TaskPlanner or #ResearchAgent. |
| 124 | +- **Missing repository context:** Request repo ID and base branch; check task specification or git config for defaults. |
122 | 125 | - **Rate limiting (>10 req/min):** Wait and retry after 60 seconds; notify requester of delay. |
123 | 126 | - **CLI errors:** Display error output, suggest checking authentication (`codegen org --list`) or CLI version (`codegen update`) |
124 | 127 | - **Unclear acceptance criteria:** Request clarification before creating agent run; prompt quality depends on clear requirements. |
|
214 | 217 | codegen agent --prompt "$(cat /tmp/prompt.md)" |
215 | 218 | ``` |
216 | 219 |
|
217 | | -**Output (formatted):** |
218 | | -``` |
219 | | -╭─────────────────────────── 🤖 Agent Run Created ───────────────────────────╮ |
220 | | -│ │ |
221 | | -│ Agent Run ID: 105016 │ |
222 | | -│ Status: ACTIVE │ |
223 | | -│ Created: October 01, 2025 at 03:43 │ |
224 | | -│ Web URL: https://codegen.com/agent/trace/105016 │ |
225 | | -│ │ |
226 | | -╰──────────────────────────────────────────────────────────────────────────────╯ |
227 | | -
|
228 | | -💡 Track progress with: codegen agents |
229 | | -🌐 View in browser: https://codegen.com/agent/trace/105016 |
230 | | -``` |
231 | | - |
232 | | -**Output (JSON):** |
233 | | -```json |
234 | | -{ |
235 | | - "agent_run_id": 105016, |
236 | | - "status": "ACTIVE", |
237 | | - "web_url": "https://codegen.com/agent/trace/105016", |
238 | | - "created_at": "2025-10-01T03:43:00Z" |
239 | | -} |
240 | | -``` |
241 | | - |
242 | | - |
243 | 220 | **Pull agent work:** |
244 | 221 | ```bash |
245 | 222 | codegen pull # Download branches/changes from completed agents |
@@ -310,6 +287,11 @@ codegen update |
310 | 287 | ``` |
311 | 288 | # Task: [Clear, actionable objective] |
312 | 289 |
|
| 290 | +## Repository Context |
| 291 | +- Repository: [repo name or ID] |
| 292 | +- Base Branch: [main/develop/feature-xyz or PR #123] |
| 293 | +- Target Branch: [branch to create for this work] |
| 294 | +
|
313 | 295 | ## Context |
314 | 296 | [2-3 sentence background on what this task achieves and why] |
315 | 297 |
|
@@ -365,13 +347,17 @@ codegen update |
365 | 347 | ``` |
366 | 348 | #CodegenBackgroundAgent |
367 | 349 | - Task: feature-auth-001 |
| 350 | +- Repository: devagent (ID: 456) |
| 351 | +- Base branch: main |
368 | 352 | - Include research from: .devagent/features/2025-10-01_auth/research/ |
369 | 353 | ``` |
370 | 354 |
|
371 | 355 | **Output:** |
372 | 356 | ```bash |
373 | 357 | ✓ Prompt constructed (1,247 tokens) |
374 | 358 | ✓ Context included: |
| 359 | + - Repository: devagent (ID: 456) |
| 360 | + - Base branch: main |
375 | 361 | - Research: .devagent/features/2025-10-01_auth/research/jwt-comparison.md |
376 | 362 | - Spec: .devagent/features/2025-10-01_auth/spec/core.md |
377 | 363 | - Files: src/middleware/auth.ts, tests/auth.test.ts |
|
0 commit comments