summaryrefslogtreecommitdiff
path: root/IMPLEMENTOR_ROLE.md
diff options
context:
space:
mode:
Diffstat (limited to 'IMPLEMENTOR_ROLE.md')
-rw-r--r--IMPLEMENTOR_ROLE.md22
1 files changed, 19 insertions, 3 deletions
diff --git a/IMPLEMENTOR_ROLE.md b/IMPLEMENTOR_ROLE.md
index be12a9d..330e5e2 100644
--- a/IMPLEMENTOR_ROLE.md
+++ b/IMPLEMENTOR_ROLE.md
@@ -46,6 +46,22 @@
* **Terminal:** Use Bash for `go test`, `go build`, `go mod tidy`, etc.
* **Editing:** Prefer Edit for targeted edits, Write for new files only.
-**Self-Improvement:**
-* **Reflection:** After completing a task, ask: "Did I follow TDD? Is the code clean enough that the Reviewer won't find major issues?"
-* **Optimization:** Look for ways to make your edits more surgical and less prone to breaking surrounding code.
+**Self-Improvement Cycle:**
+
+After completing each task (when marking `[REVIEW_READY]`), perform this cycle:
+
+1. **Reflect (mandatory):** Answer these questions honestly:
+ * Did I write the test first, or did I skip to production code? If I skipped, why?
+ * Did I break any existing tests? If so, was it because I didn't check the full suite early enough?
+ * Did I make surgical edits, or did I rewrite more than necessary?
+ * Were there patterns I repeated manually that could be extracted into a helper?
+
+2. **Improve (1-3 actions):** Based on reflection, perform at least one concrete improvement:
+ * **Test helpers:** If you wrote repetitive test setup or assertions, extract a reusable helper into `handlers_test.go` (e.g., `assertTemplateContains`, `newTestHandler`, mock builders).
+ * **Scripts:** If a manual verification step was needed (checking logs, restarting, deploying), propose or update a script in `scripts/`.
+ * **Bug pattern docs:** If you hit a subtle bug (HTMX targeting, CSRF, nil pointers), add it to the "Common Bug Patterns" section of `MEMORY.md` so it's caught proactively next time.
+ * **Acceptance tests:** If your change broke `test/acceptance_test.go` because of a signature change, consider whether the acceptance test setup could be more resilient (e.g., builder pattern for `handlers.New()`).
+ * **Role definition:** If the workflow instructions didn't match reality (e.g., missing a step, wrong tool name), update this file.
+ * **Code patterns:** If you discovered a cleaner way to handle a common operation (e.g., HTMX partial responses, template data structs), document it in `DESIGN.md` → Development Guide.
+
+3. **Record:** Note what was improved and why in `SESSION_STATE.md` under a "Process Improvements" section so improvements are visible across sessions.