|
| 1 | +# Codex Goal Loops |
| 2 | + |
| 3 | +This document lists high-level `/goal` prompts for keeping Cortex healthy. |
| 4 | +The point is to move from manual prompts to repo-level instructions. |
| 5 | + |
| 6 | +Each loop should discover what needs doing, make safe fixes, and stop only when the repo is cleaner or a human decision is needed. |
| 7 | +The long-term goal is a codebase that keeps its roadmap, issues, docs, tests, CI, and releases in sync with minimal manual prompting. |
| 8 | + |
| 9 | +## Repo Maintenance |
| 10 | + |
| 11 | +What this loop is: regular repo health management. |
| 12 | + |
| 13 | +Description: Use this as the default maintenance loop. |
| 14 | +It checks docs, roadmap status, backlog health, tests, CI, dependencies, and release readiness. |
| 15 | +It fixes safe problems and writes down anything that needs a decision. |
| 16 | + |
| 17 | +Prompt to run: |
| 18 | + |
| 19 | +```md |
| 20 | +/goal Cortex has completed a full repo maintenance pass, with safe fixes applied and remaining decisions clearly documented. |
| 21 | +Stop when the maintenance report is written and all safe fixes are complete, or when a human decision blocks progress. |
| 22 | + |
| 23 | +Read `README.md`, `docs/prd.md`, `docs/roadmap.md`, `docs/loops.md`, open GitHub issues, recent merged PRs, current GitHub Actions status, `Cargo.toml`, and the Rust test suite. |
| 24 | + |
| 25 | +Check: |
| 26 | +- README matches current user-facing behavior. |
| 27 | +- PRD is still product direction, not shipped-feature evidence. |
| 28 | +- Roadmap status matches GitHub issues and merged work. |
| 29 | +- Open issues are actionable or clearly parked. |
| 30 | +- Tests cover the most important pure editor behavior. |
| 31 | +- CI and release workflows match the commands developers actually run. |
| 32 | +- Dependencies look intentional and in scope. |
| 33 | + |
| 34 | +Apply safe fixes: |
| 35 | +- Update stale docs when the correct wording is clear. |
| 36 | +- Update roadmap ticket links and status from GitHub issue state. |
| 37 | +- Add or adjust focused tests for clear pure-logic gaps. |
| 38 | +- Fix small CI, docs, or dependency issues when intent is obvious. |
| 39 | +- Comment on or close only issues that are clearly stale, duplicate, or obsolete. |
| 40 | + |
| 41 | +Write `docs/repo-maintenance.md` with: |
| 42 | +- Date |
| 43 | +- Checks run |
| 44 | +- Fixes made |
| 45 | +- Issues updated or closed |
| 46 | +- Tests run |
| 47 | +- CI status |
| 48 | +- Release readiness notes |
| 49 | +- Human decisions needed |
| 50 | + |
| 51 | +Do not make product direction changes without approval. |
| 52 | +Do not publish releases. |
| 53 | +Do not create tags. |
| 54 | +Do not batch risky implementation work into the maintenance pass. |
| 55 | + |
| 56 | +Success means the repo is easier to trust and the remaining work is explicit. |
| 57 | +``` |
| 58 | + |
| 59 | +## Roadmap Update |
| 60 | + |
| 61 | +What this loop is: keep the roadmap accurate. |
| 62 | + |
| 63 | +Description: Use this when the roadmap may be stale. |
| 64 | +It compares roadmap phases with GitHub issues, merged PRs, docs, and current code. |
| 65 | +It updates the roadmap at the milestone level and creates or recommends missing tickets. |
| 66 | + |
| 67 | +Prompt to run: |
| 68 | + |
| 69 | +```md |
| 70 | +/goal `docs/roadmap.md` accurately shows what is done, what is planned, what is not ticketed, and which GitHub issues track each phase. |
| 71 | +Stop when the roadmap is updated or when product direction needs human approval. |
| 72 | + |
| 73 | +Read `docs/prd.md`, `docs/roadmap.md`, `README.md`, open and closed GitHub issues, recently merged PRs, and current source layout. |
| 74 | + |
| 75 | +Update `docs/roadmap.md` so it stays high level: |
| 76 | +- Keep simple phase names. |
| 77 | +- Show status as Done, Planned, or Not ticketed. |
| 78 | +- Link tracking issues for each phase. |
| 79 | +- Keep includes and not-included lists short. |
| 80 | +- Keep release-note guidance grounded in shipped work. |
| 81 | +- Remove detailed acceptance criteria and implementation plans. |
| 82 | + |
| 83 | +Create or recommend GitHub issues when: |
| 84 | +- A roadmap phase says Not ticketed. |
| 85 | +- A planned phase is too broad to work safely. |
| 86 | +- Current code has moved ahead of the roadmap. |
| 87 | +- A done phase has missing tracking links. |
| 88 | + |
| 89 | +Do not treat PRD, README, or roadmap claims as proof that features shipped. |
| 90 | +Use merged PRs, direct commits, linked issues, and current code for factual updates. |
| 91 | +Do not change product direction without approval. |
| 92 | + |
| 93 | +Success means a reader can answer: |
| 94 | +- What is done? |
| 95 | +- What is next? |
| 96 | +- What tickets track it? |
| 97 | +- What still needs product judgment? |
| 98 | +``` |
| 99 | + |
| 100 | +## Backlog Management |
| 101 | + |
| 102 | +What this loop is: keep issues useful. |
| 103 | + |
| 104 | +Description: Use this when the issue list is noisy or stale. |
| 105 | +It reviews the backlog, closes obvious junk, and leaves the remaining issues actionable. |
| 106 | + |
| 107 | +Prompt to run: |
| 108 | + |
| 109 | +```md |
| 110 | +/goal The Cortex GitHub backlog is useful: every open issue is actionable, intentionally parked, or waiting on a clear decision. |
| 111 | +Stop when every open issue has been reviewed or when product judgment is required. |
| 112 | + |
| 113 | +Read `docs/prd.md`, `docs/roadmap.md`, and all open GitHub issues for `owainlewis/cortex`. |
| 114 | + |
| 115 | +For each issue, decide whether it is: |
| 116 | +- Actionable now. |
| 117 | +- Planned for a roadmap phase. |
| 118 | +- Blocked. |
| 119 | +- Duplicate. |
| 120 | +- Stale. |
| 121 | +- Out of scope. |
| 122 | +- Unclear. |
| 123 | + |
| 124 | +Apply safe updates: |
| 125 | +- Close duplicates and obsolete issues with a short comment. |
| 126 | +- Add clarifying comments to blocked or unclear issues. |
| 127 | +- Recommend labels or milestone placement when useful. |
| 128 | +- Create follow-up issues only when the missing work is clear and not already tracked. |
| 129 | + |
| 130 | +Write `docs/backlog-management.md` with issue counts, actions taken, open questions, and recommended next issues to work. |
| 131 | + |
| 132 | +Do not close issues that require product judgment. |
| 133 | +Do not add broad speculative issues. |
| 134 | + |
| 135 | +Success means the backlog can drive work without another manual cleanup pass. |
| 136 | +``` |
| 137 | + |
| 138 | +## Milestone Management |
| 139 | + |
| 140 | +What this loop is: manage a roadmap phase from tickets to merged work. |
| 141 | + |
| 142 | +Description: Use this for a larger demo. |
| 143 | +It works through one roadmap phase, one ticket at a time, and keeps status current. |
| 144 | + |
| 145 | +Prompt to run: |
| 146 | + |
| 147 | +```md |
| 148 | +/goal The [NEEDS: milestone] Cortex milestone is complete according to its tracking tickets and merged PRs. |
| 149 | +Stop when every ticket in the milestone is merged, or when the next ticket is blocked by product direction, failing auth, failing checks, or unclear acceptance criteria. |
| 150 | + |
| 151 | +Read `docs/prd.md`, `docs/roadmap.md`, and every tracking issue for the milestone. |
| 152 | +Confirm the issue order and dependency order. |
| 153 | + |
| 154 | +For each ticket: |
| 155 | +- Confirm it still fits the roadmap. |
| 156 | +- Create a focused branch. |
| 157 | +- Make the smallest complete implementation. |
| 158 | +- Add or update focused tests for changed behavior. |
| 159 | +- Run the required verification and `cargo test`. |
| 160 | +- Open a PR with issue link, summary, tests, and known limitations. |
| 161 | +- Fix failing checks. |
| 162 | +- Merge only when the PR is ready. |
| 163 | +- Update issue and roadmap status as needed. |
| 164 | + |
| 165 | +Do not batch unrelated tickets into one PR. |
| 166 | +Do not expand the milestone while delivering it. |
| 167 | +Do not change product direction without approval. |
| 168 | + |
| 169 | +Success means the milestone is done or the remaining blocker is clearly documented. |
| 170 | +``` |
| 171 | + |
| 172 | +## Quality Management |
| 173 | + |
| 174 | +What this loop is: keep behavior tested and reliable. |
| 175 | + |
| 176 | +Description: Use this when code quality matters more than shipping new features. |
| 177 | +It reviews tests, finds real bugs, runs smoke checks where practical, and records gaps. |
| 178 | + |
| 179 | +Prompt to run: |
| 180 | + |
| 181 | +```md |
| 182 | +/goal Cortex has completed a quality pass, with confirmed bugs fixed, important test gaps addressed, and remaining risks documented. |
| 183 | +Stop when the quality report is written and the first safe batch of fixes passes. |
| 184 | + |
| 185 | +Read `README.md`, `docs/prd.md`, `docs/roadmap.md`, current source, and tests. |
| 186 | + |
| 187 | +Review: |
| 188 | +- Buffer editing. |
| 189 | +- Save safety. |
| 190 | +- Dirty state. |
| 191 | +- Cursor movement. |
| 192 | +- Key dispatch. |
| 193 | +- Slash commands. |
| 194 | +- Picker behavior. |
| 195 | +- Syntax highlighting. |
| 196 | +- Rendering bounds. |
| 197 | +- Terminal cleanup. |
| 198 | +- Filesystem errors. |
| 199 | + |
| 200 | +For each suspected issue, prove it with a test, reproduction, or clear code path. |
| 201 | +Fix only confirmed bugs with clear expected behavior. |
| 202 | +Add focused pure-logic tests where they will prevent regressions. |
| 203 | +Run `cargo test`. |
| 204 | + |
| 205 | +Write `docs/quality-management.md` with: |
| 206 | +- Tests reviewed |
| 207 | +- Tests added |
| 208 | +- Bugs fixed |
| 209 | +- Smoke checks run |
| 210 | +- Risks left open |
| 211 | +- Follow-up issues recommended |
| 212 | + |
| 213 | +Do not refactor unrelated code. |
| 214 | +Do not fix speculative issues without proof. |
| 215 | + |
| 216 | +Success means the repo is safer than before and the remaining risks are visible. |
| 217 | +``` |
| 218 | + |
| 219 | +## Release Management |
| 220 | + |
| 221 | +What this loop is: prepare and verify a release. |
| 222 | + |
| 223 | +Description: Use this before tagging or publishing. |
| 224 | +It drafts release notes, checks readiness, verifies CI and install docs, and stops before release actions that need approval. |
| 225 | + |
| 226 | +Prompt to run: |
| 227 | + |
| 228 | +```md |
| 229 | +/goal Cortex is ready for release [NEEDS: version], with source-linked release notes and a readiness report. |
| 230 | +Stop when the release is ready for human approval or when a named blocker prevents release. |
| 231 | + |
| 232 | +Inputs: |
| 233 | +- Target version: [NEEDS: version] |
| 234 | +- Base tag: [NEEDS: previous release tag or first-release range] |
| 235 | + |
| 236 | +Read `docs/prd.md`, `docs/roadmap.md`, `README.md`, `Cargo.toml`, release workflow files, open issues, merged PRs, direct commits, and linked issues. |
| 237 | + |
| 238 | +Draft `docs/releases/[version]-draft.md`: |
| 239 | +- Use merged PRs, direct commits, and linked issues as sources. |
| 240 | +- Do not use PRD, roadmap, or README as proof that behavior shipped. |
| 241 | +- Group changes into user-facing changes, fixes, performance, docs, internal changes, breaking changes, and security notes. |
| 242 | +- Link every shipped claim to a source. |
| 243 | +- Flag unclear impact for review. |
| 244 | + |
| 245 | +Write `docs/releases/[version]-readiness.md`: |
| 246 | +- Version metadata |
| 247 | +- Local checks run |
| 248 | +- GitHub Actions status |
| 249 | +- Release workflow status |
| 250 | +- Install and update docs status |
| 251 | +- Open blockers |
| 252 | +- Exact next release steps |
| 253 | + |
| 254 | +Run relevant local checks, including `cargo test`. |
| 255 | + |
| 256 | +Do not create tags. |
| 257 | +Do not publish a GitHub release. |
| 258 | +Do not edit a live changelog unless explicitly asked. |
| 259 | + |
| 260 | +Success means a human can approve or block the release from the reports. |
| 261 | +``` |
| 262 | + |
| 263 | +## CI and Install Management |
| 264 | + |
| 265 | +What this loop is: keep build, install, and release automation healthy. |
| 266 | + |
| 267 | +Description: Use this when CI, nightly builds, release artifacts, install scripts, or update commands need review. |
| 268 | +It checks the automation as a system instead of treating each workflow as a separate task. |
| 269 | + |
| 270 | +Prompt to run: |
| 271 | + |
| 272 | +```md |
| 273 | +/goal Cortex CI, install, and release automation are consistent, tested where possible, and documented. |
| 274 | +Stop when automation is green and documented, or when a permission, secret, or product decision blocks progress. |
| 275 | + |
| 276 | +Read GitHub Actions workflows, install scripts, update command implementation and docs, `Cargo.toml`, `README.md`, and recent workflow runs. |
| 277 | + |
| 278 | +Check: |
| 279 | +- CI runs the expected Rust checks. |
| 280 | +- Local commands match CI commands. |
| 281 | +- Release workflow triggers from the expected tags. |
| 282 | +- Artifact names match install and update docs. |
| 283 | +- Nightly builds are understandable and not confused with releases. |
| 284 | +- Version output and update surfaces match docs. |
| 285 | + |
| 286 | +Fix safe mismatches. |
| 287 | +Run local checks. |
| 288 | +Inspect recent GitHub Actions runs. |
| 289 | +Write `docs/ci-install-management.md` with checks run, fixes made, current status, and remaining risks. |
| 290 | + |
| 291 | +Do not remove checks to make CI pass. |
| 292 | +Do not change secrets, signing, or publishing permissions. |
| 293 | +Do not create tags or publish releases. |
| 294 | + |
| 295 | +Success means automation is understandable and safe to rely on. |
| 296 | +``` |
| 297 | + |
| 298 | +## Demo Prep |
| 299 | + |
| 300 | +What this loop is: prepare the repo for a Codex `/goal` demo. |
| 301 | + |
| 302 | +Description: Use this before recording or presenting. |
| 303 | +It chooses the best goal loops to show and checks that the repo state will not confuse the audience. |
| 304 | + |
| 305 | +Prompt to run: |
| 306 | + |
| 307 | +```md |
| 308 | +/goal The Cortex repo is ready for a live Codex `/goal` demo. |
| 309 | +Stop when the demo plan is written or when a blocker needs human choice. |
| 310 | + |
| 311 | +Read `docs/loops.md`, `docs/roadmap.md`, `docs/prd.md`, `README.md`, GitHub issue state, current branch, and worktree status. |
| 312 | + |
| 313 | +Pick three demo options: |
| 314 | +- A short safe loop. |
| 315 | +- A medium useful loop. |
| 316 | +- A larger ambitious loop. |
| 317 | + |
| 318 | +For each option, explain: |
| 319 | +- What it demonstrates. |
| 320 | +- What artifact it will produce. |
| 321 | +- How long it may take. |
| 322 | +- What could go wrong. |
| 323 | +- What the fallback is. |
| 324 | + |
| 325 | +Check that roadmap status, issue state, release docs, and worktree status are explainable. |
| 326 | +Apply small documentation fixes only when they make the demo more truthful. |
| 327 | +Write `docs/demo-prep.md`. |
| 328 | + |
| 329 | +Do not hide real repo state. |
| 330 | +Do not rewrite the repo just for presentation polish. |
| 331 | + |
| 332 | +Success means the demo has a clear plan and safe fallback options. |
| 333 | +``` |
0 commit comments