|
| 1 | +# Agents for repo-smith |
| 2 | + |
| 3 | +This document defines the autonomous **agent roles** used when working on this repository. Each agent has a clear purpose, scope, and set of files or symbols it is allowed to interact with. |
| 4 | + |
| 5 | +Agents are designed to be **minimal, scriptable, and composable**, so they can be safely used by humans or automated tooling. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. CI / Test Runner Agent |
| 10 | + |
| 11 | +**Purpose** |
| 12 | +Run and report unit and integration tests. |
| 13 | + |
| 14 | +**Responsibilities** |
| 15 | + |
| 16 | +* Install dependencies |
| 17 | +* Execute pytest suites |
| 18 | +* Surface failures with minimal noise |
| 19 | + |
| 20 | +**Does NOT** |
| 21 | + |
| 22 | +* Modify source code |
| 23 | +* Update specs or documentation |
| 24 | + |
| 25 | +**Typical commands** |
| 26 | + |
| 27 | +* `pip install -r requirements.txt` |
| 28 | +* `pytest -q` |
| 29 | + |
| 30 | +**Key files** |
| 31 | + |
| 32 | +* Tests: [`tests/`](../tests/) |
| 33 | +* Integration entry points: [`tests/integration/steps/test_revert_step.py`](../tests/integration/steps/test_revert_step.py) |
| 34 | +* Config: [`pyproject.toml`](../pyproject.toml), [`requirements.txt`](../requirements.txt) |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## 2. Spec Linter Agent |
| 39 | + |
| 40 | +**Purpose** |
| 41 | +Validate YAML spec files against repository expectations. |
| 42 | + |
| 43 | +**Responsibilities** |
| 44 | + |
| 45 | +* Validate required fields and accepted values |
| 46 | +* Check `initialization.*` fields |
| 47 | +* Fail fast on invalid or ambiguous specs |
| 48 | + |
| 49 | +**Source of truth** |
| 50 | + |
| 51 | +* [`specification.md`](../specification.md) |
| 52 | +* Spec model: [`Spec`](../src/repo_smith/spec.py) |
| 53 | + |
| 54 | +**Does NOT** |
| 55 | + |
| 56 | +* Execute steps |
| 57 | +* Initialize repositories |
| 58 | + |
| 59 | +**Key references** |
| 60 | + |
| 61 | +* Specification: [`specification.md`](../specification.md) |
| 62 | +* Parser / entry point: [`initialize_repo`](../src/repo_smith/initialize_repo.py) |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 3. Repo Initializer / Orchestrator Agent |
| 67 | + |
| 68 | +**Purpose** |
| 69 | +Create repositories from spec files and orchestrate step execution. |
| 70 | + |
| 71 | +**Responsibilities** |
| 72 | + |
| 73 | +* Initialize or clone repositories |
| 74 | +* Parse specs into models |
| 75 | +* Execute steps in declared order |
| 76 | +* Manage lifecycle hooks |
| 77 | + |
| 78 | +**Does NOT** |
| 79 | + |
| 80 | +* Implement step-specific logic |
| 81 | +* Validate spec schema beyond basic parsing |
| 82 | + |
| 83 | +**Inputs** |
| 84 | + |
| 85 | +* YAML specs (e.g. `tests/specs/`) |
| 86 | + |
| 87 | +**Outputs** |
| 88 | + |
| 89 | +* Initialized git repository on disk |
| 90 | +* Exceptions on invalid execution |
| 91 | + |
| 92 | +**Key symbols/files** |
| 93 | + |
| 94 | +* [`initialize_repo`](../src/repo_smith/initialize_repo.py) |
| 95 | +* [`RepoInitializer`](../src/repo_smith/initialize_repo.py) |
| 96 | +* Spec model: [`Spec`](../src/repo_smith/spec.py) |
| 97 | +* Dispatcher: [`Dispatcher`](../src/repo_smith/steps/dispatcher.py) |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## 4. Steps Agent (Execution & Authoring) |
| 102 | + |
| 103 | +**Purpose** |
| 104 | +Author, validate, and execute individual step implementations. |
| 105 | + |
| 106 | +**Responsibilities** |
| 107 | + |
| 108 | +* Implement new step types |
| 109 | +* Parse step arguments |
| 110 | +* Enforce step-level invariants |
| 111 | + |
| 112 | +**Does NOT** |
| 113 | + |
| 114 | +* Control execution order |
| 115 | +* Perform repository-wide orchestration |
| 116 | + |
| 117 | +**Key symbols/files** |
| 118 | + |
| 119 | +* Base class: [`Step`](../src/repo_smith/steps/step.py) |
| 120 | +* Dispatcher: [`Dispatcher`](../src/repo_smith/steps/dispatcher.py) |
| 121 | +* Example steps: |
| 122 | + |
| 123 | + * [`commit_step.py`](../src/repo_smith/steps/commit_step.py) |
| 124 | + * [`revert_step.py`](../src/repo_smith/steps/revert_step.py) |
| 125 | + * [`file_step.py`](../src/repo_smith/steps/file_step.py) |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## 5. Git Helper Agent |
| 130 | + |
| 131 | +**Purpose** |
| 132 | +Wrap and validate git / gh command invocations. |
| 133 | + |
| 134 | +**Responsibilities** |
| 135 | + |
| 136 | +* Define command option schemas |
| 137 | +* Construct safe, explicit git commands |
| 138 | +* Generate tests for command options |
| 139 | + |
| 140 | +**Does NOT** |
| 141 | + |
| 142 | +* Execute high-level steps |
| 143 | +* Modify specs directly |
| 144 | + |
| 145 | +**Key files/symbols** |
| 146 | + |
| 147 | +* Git helper: [`GitHelper`](../src/repo_smith/helpers/git_helper/git_helper.py) |
| 148 | +* Command spec: [`CommandSpec`](../src/repo_smith/helpers/command_spec.py) |
| 149 | +* Option definitions: |
| 150 | + |
| 151 | + * [`tag_options.py`](../src/repo_smith/helpers/git_helper/tag_options.py) |
| 152 | + * [`commit_options.py`](../src/repo_smith/helpers/git_helper/commit_options.py) |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## 6. Files Helper Agent |
| 157 | + |
| 158 | +**Purpose** |
| 159 | +Create and modify filesystem artifacts used by specs and tests. |
| 160 | + |
| 161 | +**Responsibilities** |
| 162 | + |
| 163 | +* Create files and directories |
| 164 | +* Modify file contents deterministically |
| 165 | + |
| 166 | +**Does NOT** |
| 167 | + |
| 168 | +* Invoke git commands |
| 169 | +* Execute steps |
| 170 | + |
| 171 | +**Key file** |
| 172 | + |
| 173 | +* [`FilesHelper`](../src/repo_smith/helpers/files_helper.py) |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +## 7. Docs & Release Agent |
| 178 | + |
| 179 | +**Purpose** |
| 180 | +Maintain documentation and assist with releases. |
| 181 | + |
| 182 | +**Responsibilities** |
| 183 | + |
| 184 | +* Update README and specification |
| 185 | +* Maintain changelog |
| 186 | +* Assist with GitHub Actions-based releases |
| 187 | + |
| 188 | +**Does NOT** |
| 189 | + |
| 190 | +* Modify core execution logic |
| 191 | +* Change spec semantics |
| 192 | + |
| 193 | +**Key files** |
| 194 | + |
| 195 | +* [`README.md`](../README.md) |
| 196 | +* [`specification.md`](../specification.md) |
| 197 | +* GitHub Actions: |
| 198 | + |
| 199 | + * [`.github/workflows/publish.yml`](workflows/publish.yml) |
| 200 | + * [`.github/workflows/bump-version.yml`](workflows/bump-version.yml) |
| 201 | + |
| 202 | +--- |
| 203 | + |
| 204 | +## Usage Notes |
| 205 | + |
| 206 | +* Agents should be callable from the **repository root**. |
| 207 | +* Agents should fail fast and prefer explicit errors. |
| 208 | +* Agents must not infer undocumented behavior. |
| 209 | + |
| 210 | +**Common workflows** |
| 211 | + |
| 212 | +* Run tests: `pytest -q` |
| 213 | +* Lint specs: validate YAML files in `tests/specs/` against [`specification.md`](../specification.md) |
| 214 | +* Initialize repo in tests: call [`initialize_repo`](../src/repo_smith/initialize_repo.py) |
| 215 | + |
| 216 | +--- |
| 217 | + |
| 218 | +## Quick Navigation |
| 219 | + |
| 220 | +* Core orchestrator: [`initialize_repo`](../src/repo_smith/initialize_repo.py) |
| 221 | +* Main entry point: [`RepoSmith`](../src/repo_smith/repo_smith.py) |
| 222 | +* Steps & dispatcher: [`src/repo_smith/steps/`](../src/repo_smith/steps/) |
| 223 | + |
| 224 | +--- |
| 225 | + |
| 226 | +## Non-goals |
| 227 | + |
| 228 | +Agents should **not**: |
| 229 | + |
| 230 | +* Rewrite git history of this repository |
| 231 | +* Push tags or releases without CI confirmation |
| 232 | +* Invent spec behavior not documented or tested |
0 commit comments