--- name: agylite-engineering description: Code changes through the Agylite lifecycle (understand, plan, implement, test, verify, reconcile), finished only with recorded evidence — use when asked to build a feature, fix a bug, refactor or migrate code. disable-model-invocation: true --- # Agylite Engineering Produces a finished code change: inside the asked scope, covered by tests that fail without it, verified by `agylite verify`, and recorded in the project plan. It never reports work as done on a confident guess, and it does not deploy. ## Use when · Not for - Use when: a feature, bug fix, refactor, migration or any other change to code. - Not for: reviewing a finished change → `agylite-review` · auth, secrets, payments or input handling → `agylite-security` · only running the checks → `agylite-testing` · a release → `agylite-production` · how a UI looks → `agylite-design`. ## Before you start - **Route.** If the prompt arrived with an `Agylite route:` line, the route is done: use the capabilities it lists. Otherwise run `agylite route "" --paths ` and load only what it selects: `agylite context --request "" …`. - **Guidance order** is the route's `capabilities` order (user requirements → project security → architecture → methodology → specialists → review → simplicity). When two sources disagree, the earlier one wins. - **`confidence: low`** in the route: confirm the intent with the user before you edit. ## Steps Follow the route's `lifecycle` in the order it gives; the order below is the default. Two change types differ: a **bug fix** writes its failing regression test (step 4) before step 3; a **refactor** runs step 5 once before step 3 and must be green both times. 1. **Understand.** `agylite plan locate ""`, then `agylite codebase affected --paths `. Expect: the plan phase the request belongs to, and lists of `files`, `tests` and `unknown`. Read the listed files, not the repository. Move on when: you can say in one sentence what will change and name the files and tests. 2. **Plan.** `agylite plan reconcile ""`. Expect: a task id (`T-…`) with acceptance criteria. A structural choice is recorded with `agylite decide add --kind architecture --topic … --decision … --reason …`. For several files or deliverables, write `GATES.md` (one gate per deliverable, each with the command that proves it) and run `agylite gates lint GATES.md`. Move on when: every criterion can be checked by a test or a command. 3. **Implement.** `agylite plan set-status IN_PROGRESS`. Make the smallest change that meets the criteria, in the patterns the surrounding code uses, and update the callers, fixtures, config and docs it breaks. Move on when: nothing inside the task is left as a placeholder, a stub or a "later". 4. **Test.** Every changed behaviour gets a test. Run it without the change and see it fail for the right reason, then with the change and see it pass. Move on when: each new test has been seen both failing and passing. 5. **Verify.** `agylite verify --task `; add `--browser` for UI work (policy: `config/verification.yaml`; a screenshot alone is never evidence). Expect: each check PASSED, FAILED, NOT_TESTED or BLOCKED, and an evidence file `.agylite/evidence/