|
1 | 1 | ## Overview |
2 | 2 |
|
3 | | -This repository provides an opinionated workflow designed to |
4 | | -enhance the performace of teams working with coding agents, |
5 | | -such as OpenAI Codex, Claude Code, Google Jules, GitHub Copilot, |
6 | | -Goose, OpenHands and others. |
| 3 | +This repository provides a highly-opinionated workflow for working |
| 4 | +with cloud and local coding agents, such as Claude Code, Codex, GitHub |
| 5 | +Copilot, Jules, Gemini, Goose, OpenHands and others. |
7 | 6 |
|
8 | | -The workflow standardizes how tasks are defined, and tracked, |
9 | | -leveraging your VCS (e.g. git) as the primary driving interface. |
| 7 | +## Goals |
10 | 8 |
|
11 | | -## Purpose |
| 9 | +The workflow adheres to the following principles, which are implemened |
| 10 | +both when workign with local agents and when working with remote agents: |
12 | 11 |
|
13 | | -The primary goal of this workflow is to: |
| 12 | +1. **The developer provides a coding task through a convenient command-line interface** |
14 | 13 |
|
15 | | -1. **Use git as the primary interface for driving Codex:** |
| 14 | +3. **The agent works in a secure sandbox environment, without asking for confirmation when using tools** |
16 | 15 |
|
17 | | - Provides a convenient way to assign tasks to Codex right |
18 | | - from your command-line. |
| 16 | +4. **The agent presents a complete patch/PR once it reaches a stage where all tests and linters are green** |
19 | 17 |
|
20 | | -2. **Maintain a transparent history:** |
| 18 | +5. **It's easy to start multiple tasks in parallel from the current state of your working tree** |
21 | 19 |
|
22 | | - All task descriptions are committed to Git, creating an |
23 | | - auditable trail and a knowledge base demonstrating how |
24 | | - tasks are approached and solved. |
| 20 | +6. **All tasks are recorded as commits/files in the history of the project** |
25 | 21 |
|
26 | | - This allows team members to learn from each other's practices |
27 | | - and makes `git blame` an effective tool for understanding the |
28 | | - intention behind all code. The workflow injects instructions |
29 | | - that teach the agents how to leverage this. |
| 22 | +Pushing to git becomes the primary interface for starting cloud agents. |
| 23 | +All other interactions with the web UIs of the agents are automated. |
30 | 24 |
|
31 | | -3. **Deal with the current limitations around internet connectivity:** |
| 25 | +Committing all task descriptions in git creates an auditable trail and |
| 26 | +a knowledge base demonstrating how tasks are approached and solved. |
32 | 27 |
|
33 | | - By pre-fetching internet resources mentioned in the task |
34 | | - descriptions, agents such as Codex are more successful at |
35 | | - dealing with problems that require information that is not |
36 | | - part of the codebase. |
| 28 | +This allows team members to learn from each other's practices and makes |
| 29 | +`git blame` an effective tool for understanding the intention behind all |
| 30 | +code. The workflow injects instructions that teach the agents how to |
| 31 | +leverage this. |
37 | 32 |
|
38 | | -4. **Simplify the agents workspace setup:** |
| 33 | +Local agents are started is devcontainers with rich support for different |
| 34 | +interaction patterns: |
39 | 35 |
|
40 | | - The `.agents/codex-setup` script is stored in your repository, |
41 | | - simplifying the maintainance of the workspace. |
| 36 | +- Start one Editor/IDE instance per task to observe the work of the agent |
| 37 | + and review the final |
| 38 | + |
| 39 | +- Push to a designated branch automatically or create a PR. |
| 40 | + |
| 41 | +## Other Practical Benefits |
| 42 | + |
| 43 | +* Local agents can leverage ZFS and Btrfs snapshots to provide the best |
| 44 | + possible agent-start up time. The agent takes advantage of incremental |
| 45 | + compilation when building the project and its test suite. |
| 46 | + |
| 47 | +* The same start-up time and incremental compilations are possible when |
| 48 | + you dispatch the coding tasks to a cluster of self-managed machines in |
| 49 | + an office environment or a private cloud. |
| 50 | + |
| 51 | +* The workflow smooths out the differences between different agent tools |
| 52 | + and cloud environments. Everything can be handled through shared config |
| 53 | + and user interfaces. |
| 54 | + |
| 55 | + The behavior of the cloud agents is modified through prompt engineering |
| 56 | + and automation to implement new workflows such as automatically creating |
| 57 | + PRs, automatically pushing to specific branches, etc. |
| 58 | + |
| 59 | +* The workflow provides a helpful framework for automatically downloading |
| 60 | + relevant internet resources before coding tasks start for agents that |
| 61 | + need to operate offline. |
| 62 | + |
| 63 | +* The workflow provides a framework for working in big monorepos that speeds |
| 64 | + up agent start-up times (both locally and it the cloud) and helps with |
| 65 | + managing the context of the agent in such repositories. |
42 | 66 |
|
43 | 67 | ## Using the Workflow |
44 | 68 |
|
@@ -84,6 +108,46 @@ The primary goal of this workflow is to: |
84 | 108 | The `get-task` script will print the task description for the agent, |
85 | 109 | along with instructions for accessing the downloaded internet resources |
86 | 110 | and working with the git history. |
| 111 | + It also supports a `--get-setup-env` option which prints only the |
| 112 | + environment variable assignments gathered from `@agents-setup` lines. |
| 113 | + |
| 114 | +### Workflow Commands |
| 115 | + |
| 116 | +Task descriptions may include lines beginning with `/` (e.g. `/front-end-task`). |
| 117 | + |
| 118 | +When `get-task` is executed, these lines are replaced with the output of a |
| 119 | +matching programs or text files in the `.agents/workflows` folder of your |
| 120 | +repository. |
| 121 | + |
| 122 | +In other words, in the example above, `get-task` will look either for an |
| 123 | +executable stored in `.agents/workflows/front-end-task` or for a text file |
| 124 | +located at `.agents/workflows/front-end-task.txt` (the contents of this file |
| 125 | +will take the place of the workflow command in the task description, like a |
| 126 | +macro in a programming language). |
| 127 | + |
| 128 | +Executables are typically used when the workflow command has parameters. |
| 129 | + |
| 130 | +Lines starting with `@agents-setup` in either the task file or the workflow |
| 131 | +output are stripped from the final message and interpreted as environment |
| 132 | +variable assignments for the `*-setup` scripts described below. |
| 133 | + |
| 134 | +```shell |
| 135 | +@agent-setup DEV_SHELL=csharp TESTED_COMPONENTS+=backend,db |
| 136 | +``` |
| 137 | + |
| 138 | +A directive may either assign a value (`VAR=value`) or append entries to a |
| 139 | +comma‑separated set using the `VAR+=val1,val2` syntax. When multiple directives |
| 140 | +affect the same variable, the following rules apply: |
| 141 | + |
| 142 | +1. Conflicting direct assignments (different values for the same variable) |
| 143 | + result in an error. |
| 144 | +2. A direct assignment can be combined with one or more appends. The final value |
| 145 | + contains the assigned value plus all appended entries, regardless of their |
| 146 | + order. |
| 147 | +3. One or more append operations without a direct assignment simply combine |
| 148 | + their entries. |
| 149 | + |
| 150 | +Duplicate directives or values are ignored. |
87 | 151 |
|
88 | 152 | ## Supported Agent Systems |
89 | 153 |
|
|
0 commit comments