Agent prompt recipes
olef v3.18.0View Markdown
Most developers rarely type all 359 olef commands by hand—you describe the outcome and let your coding agent drive Olef. Strong prompts name the starting state, the evidence to collect, and the proof required before declaring done.
Fix a crash with before-and-after evidence
Section titled “Fix a crash with before-and-after evidence”The app crashes when I tap Checkout with an empty cart. Use Olef toreproduce the crash, run `olef why` and inspect the stack trace and localstate, make the smallest fix, apply it with `olef app apply`, and provewith a fresh run that tapping Checkout now shows the empty-cart messagewith zero new error logs.Verify Room persistence & WorkManager sync
Section titled “Verify Room persistence & WorkManager sync”Add a task offline in the app, kill and restart the app, and verify with`olef storage` and `olef work` that:1) the task exists in SQLite/Room after restart,2) the sync WorkManager job is enqueued with the expected input data, and3) after triggering `olef work run`, the row flips to `synced = 1`.Report any unmet WorkManager constraints before changing code.Debug a visual or Compose layout issue
Section titled “Debug a visual or Compose layout issue”Read my annotations from the live viewer with `olef pane annotations`.For each note, inspect the mapped Compose source and recompositions(`olef layout recompositions --why`), fix the root cause, apply thechange in place, and show me an updated annotated screenshot (`--annotate a11y`)confirming the layout and tap targets are fixed.Hunt startup regressions, jank & memory leaks
Section titled “Hunt startup regressions, jank & memory leaks”Measure baseline cold startup (`olef perf startup --mode cold --iterations 5`)and scroll jank on the Feed screen (`olef perf frames`). Then open a Detailscreen and press Back three times and run `olef perf leaks`. If anyActivity, Fragment, or ViewModel is retained, trace the GC-root chain inthe code, fix it, and re-run `perf leaks` to confirm zero leaks.Automate a hybrid WebView checkout flow
Section titled “Automate a hybrid WebView checkout flow”Navigate to the embedded WebView payment screen. Use `olef web` to dumpinteractive DOM elements (including Shadow DOM/iframes), enter the testcoupon code, tap Apply, and confirm no native Android dialog is coveringthe button and no uncaught JS errors appear in `olef web console` or `olef why`.Test notifications, App Links & process death
Section titled “Test notifications, App Links & process death”Verify our deep link `https://example.com/order/99` using `olef app applinks`and `olef app resolve-intent`, launch it with `olef app open-intent --expect-front`,then inject process death with `olef fault inject process-death` and provethe order screen restores its state cleanly. Clear all faults when done.Audit accessibility & scaffold test code
Section titled “Audit accessibility & scaffold test code”Run `olef ui audit` and `olef ui audit --a11y` on the Profile and Settingsscreens. Report interactive controls missing stable resource IDs or ComposetestTags and any accessibility issues. Add testTags where missing, then run`olef ui gen` to scaffold a clean Kotlin Screen Object.Record, verify & heal a regression test
Section titled “Record, verify & heal a regression test”Run the sign-in and create-project flow inside an Olef session, add anexplicit `olef record check` on the project dashboard, save it with`olef record save create_project`, and run `olef test run tests/olef/create_project --repeat 3`.If an existing test fails after my refactor, run `olef test heal` and showme the proposed diff before editing the test.Run on a physical phone or share a private build (ocloud)
Section titled “Run on a physical phone or share a private build (ocloud)”Run our checkout regression suite on a physical Pixel via`ocloud devices run ddp:tokay-36 -- olef test run tests/olef/checkout`(confirm daily spend cap first). If it passes, push the debug APK to the"Designers" tester group with `ocloud builds push --share Designers`.For how Olef structures tool responses and error codes, see The agent loop and The output contract.