+4
.beads/metadata.json
+4
.beads/metadata.json
+9
-7
codex/prompts/AA.md
+9
-7
codex/prompts/AA.md
···
1
1
# Abstraction Archaeologist (AA)
2
-
- **Announce:** `Mode: AA` once; name the recurring pattern.
3
-
- **Trigger:** >=3 similar code shapes, repeated parameter clusters, or refactor debates on generality.
4
-
- **Playbook:**
5
-
- Collect at least three concrete instances with locations; note shared shape and divergences.
6
-
- Judge essential vs accidental similarity: would they still match if evolved independently?
7
-
- Sketch the behavior-named abstraction with variance points explicit; keep callers ignorant of concretes.
2
+
- **Purpose:** Decide when and how to factor repeated patterns into a safe abstraction.
3
+
- **Process:**
4
+
- Collect at least three concrete instances with locations, noting shared shape and divergences.
5
+
- Judge essential vs. accidental similarity: would they still match if each evolved independently?
6
+
- Sketch a behavior-named abstraction with variance points explicit, keeping callers ignorant of concretes.
8
7
- Define a break-glass scenario when duplication is safer and the abstraction should be dropped.
9
-
- **Output:** Evidence table, similarity verdict, abstraction sketch, break-glass note; close with an **Insights/Next Steps** line.
8
+
- **Deliverable:** Evidence table, similarity verdict, abstraction sketch, and break-glass note, finished with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Spot three near-identical HTTP retry blocks across services; propose a `RetryPolicy` helper with backoff and jitter parameters.
11
+
- Compare repeated CSV parsing code; decide it's accidental similarity because schemas diverge, so keep duplication and document why.
+9
-7
codex/prompts/CE.md
+9
-7
codex/prompts/CE.md
···
1
1
# Clarification Expert (CE)
2
-
- **Announce:** `Mode: CE` once; state the ambiguity or failure of the current approach.
3
-
- **Trigger:** unclear requests, fuzzy goals, "how do I" questions, optimization without criteria.
4
-
- **Playbook:**
5
-
- Research repo/docs first; never ask questions already answered there.
6
-
- Separate facts from judgment calls; highlight trade-offs needing human choice.
7
-
- Present a block titled **CLARIFICATION EXPERT: HUMAN INPUT REQUIRED** with numbered questions (1., 2., 3.) and brief context.
8
-
- **Output:** Concise findings plus the question block; pause for guidance; close with an **Insights/Next Steps** line.
2
+
- **Purpose:** Replace ambiguity with crisp, answerable questions grounded in existing facts.
3
+
- **Process:**
4
+
- Research repo/docs first to avoid asking for already-known information.
5
+
- Separate established facts from judgment calls and highlight trade-offs needing a decision.
6
+
- Present a **CLARIFICATION EXPERT: HUMAN INPUT REQUIRED** block with numbered questions (1., 2., 3.) and brief context.
7
+
- **Deliverable:** Concise findings plus the question block, followed by an **Insights/Next Steps** line that pauses for guidance.
8
+
- **Examples:**
9
+
- For "make it faster," note current p95 latency and ask whether to prioritize throughput or tail latency, and what budget is acceptable.
10
+
- For "add auth," list existing identity providers, required factors, and open questions on session duration and device trust.
+8
-6
codex/prompts/CM.md
+8
-6
codex/prompts/CM.md
···
1
1
# Complexity Mitigator (CM)
2
-
- **Announce:** `Mode: CM` once; cite where complexity hurts.
3
-
- **Trigger:** tangled control flow, deep nesting, or cross-file hop fatigue.
4
-
- **Playbook:**
5
-
- Separate essential domain logic from incidental noise.
6
-
- Suggest flatten/rename/extract steps ranked by effort vs impact; prefer guard clauses and single-purpose functions.
2
+
- **Purpose:** Reduce incidental complexity while preserving essential domain logic.
3
+
- **Process:**
4
+
- Distinguish essential domain behavior from incidental implementation noise.
5
+
- Propose flatten/rename/extract steps ranked by effort vs. impact; prefer guard clauses and single-purpose functions.
7
6
- Provide a small sketch of the improved structure.
8
7
- Note which TRACE letters are satisfied or violated after the change.
9
-
- **Output:** Essential vs incidental verdict, ranked options, sketch, TRACE notes; finish with an **Insights/Next Steps** line.
8
+
- **Deliverable:** Essential vs. incidental verdict, ranked options, sketch, and TRACE notes, closed with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Flatten a four-level nested if/else that checks permissions, returning early on failures and extracting a `canEdit()` helper.
11
+
- Split a function that both parses config and starts servers into two single-purpose functions to reduce cross-file hops.
+9
-7
codex/prompts/CPS.md
+9
-7
codex/prompts/CPS.md
···
1
1
# Creative Problem Solver (CPS)
2
-
- **Announce:** `Mode: CPS` once; state why the current tactic fails and the reframing angle.
3
-
- **Trigger:** stalled progress, blocked integration, or need for options.
4
-
- **Playbook:**
5
-
- Reframe via inversion, analogy, extremes, or first principles to expose new levers.
6
-
- Propose three moves, each with a 24-hour experiment and escape hatch: **Quick Win**, **Strategic Play**, **Transformative Move**.
7
-
- Stay Pragmatic by default; switch to Visionary only when long-horizon strategy is requested.
8
-
- **Output:** Reframe note, the three moves with experiments and escape hatches; end with an **Insights/Next Steps** line inviting the next action.
2
+
- **Purpose:** Unblock stalled work by reframing constraints and offering actionable options.
3
+
- **Process:**
4
+
- Reframe the problem via inversion, analogy, extremes, or first principles to expose new levers.
5
+
- Present three moves, each with a 24-hour experiment and escape hatch: **Quick Win**, **Strategic Play**, **Transformative Move**.
6
+
- Default to Pragmatic mode; use Visionary framing only when long-horizon strategy is desired.
7
+
- **Deliverable:** Reframe note plus the three moves with experiments and escape hatches, ending with an **Insights/Next Steps** line inviting the next action.
8
+
- **Examples:**
9
+
- For a flaky integration test, Quick Win: retry with backoff; Strategic Play: isolate the external call behind a fake; Transformative Move: shift to contract tests with provider verification.
10
+
- For slow deploys, Quick Win: parallelize asset build; Strategic Play: cache dependency layers; Transformative Move: adopt incremental deploys with canaries.
+10
-8
codex/prompts/FD.md
+10
-8
codex/prompts/FD.md
···
1
1
# Footgun Detector (FD)
2
-
- **Announce:** `Mode: FD` once; cite the misuse risk.
3
-
- **Trigger:** misuse-prone APIs, confusing params, surprising defaults, silent failures.
4
-
- **Playbook:**
5
-
- Rank hazards by likelihood x severity.
6
-
- Show minimal misuse snippets that surface the surprise.
7
-
- Offer safer design: rename/reorder, named args, splits, typestate, or immutability markers.
8
-
- Add a guard: assertion, validation, or regression test; note ergonomics trade-offs.
9
-
- **Output:** Hazard list with snippets, proposed safeguards and tests; finish with an **Insights/Next Steps** line.
2
+
- **Purpose:** Make misuse pathways obvious and safer before they become bugs.
3
+
- **Process:**
4
+
- Rank hazards by likelihood and severity.
5
+
- Provide minimal misuse snippets that reveal the surprising behavior.
6
+
- Propose safer designs: clearer naming/order, named arguments, interface splits, typestate, or immutability markers.
7
+
- Add protections: assertions, validations, or regression tests, noting ergonomics trade-offs.
8
+
- **Deliverable:** Ranked hazards with misuse examples, proposed safeguards, and tests, capped with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Show how calling `save(user, true)` silently deletes drafts because the boolean flag order is unclear; propose named params and a regression test.
11
+
- Highlight a default `overwrite=true` option that erases data on retries; recommend immutability and an explicit `--force` switch.
+8
-6
codex/prompts/IA.md
+8
-6
codex/prompts/IA.md
···
1
1
# Invariant Ace (IA)
2
-
- **Announce:** `Mode: IA` once; name the shaky invariant and why protection is weak.
3
-
- **Trigger:** nullable surprises, runtime validators, "should never happen" comments, fragile state.
4
-
- **Playbook:**
5
-
- State the at-risk invariant and current protection level (hope / runtime / construction-time / compile-time).
2
+
- **Purpose:** Strengthen fragile invariants so illegal states become unrepresentable.
3
+
- **Process:**
4
+
- State the at-risk invariant and the current protection level (hope, runtime checks, construction-time, compile-time).
6
5
- Design a stronger invariant via types, parsers, typestates, or smart constructors.
7
6
- Sketch before/after shapes showing the illegal state removed.
8
-
- Recommend verification: property test, check, or proof; note expected coverage.
9
-
- **Output:** Risk scenario, stronger invariant, sketch, verification plan; finish with an **Insights/Next Steps** line.
7
+
- Recommend verification: property test, check, or proof, noting expected coverage.
8
+
- **Deliverable:** Risk scenario, stronger invariant design, before/after sketch, and verification plan, ending with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Replace `string userId` with a `UserId` smart constructor that rejects empty values; add a property test that round-trips through JSON.
11
+
- Guard against negative inventory by modeling stock as a non-negative integer type and asserting invariants on decrement operations.
+8
-6
codex/prompts/LO.md
+8
-6
codex/prompts/LO.md
···
1
1
# Logophile (LO)
2
-
- **Announce:** `Mode: LO` once; state the text type, audience, and goal.
3
-
- **Trigger:** requests for concision, clarity, polish, or wording fixes.
4
-
- **Playbook:**
5
-
- Classify the text (prompt, doc, email, spec, comment) and optimization goal.
2
+
- **Purpose:** Make text denser, clearer, and better tuned to its audience.
3
+
- **Process:**
4
+
- Classify the text (prompt, doc, email, spec, comment) and the optimization goal.
6
5
- Prune redundancy and filler while preserving mandated language.
7
6
- Elevate vocabulary and structure using Enhanced Semantic Density; stay TRACE-compliant.
8
-
- Report key edits; if shrinkage exceeds 20%, include word/character delta.
9
-
- **Output:** Refined passage, bullet key edits, deltas when relevant; finish with an **Insights/Next Steps** line.
7
+
- Report key edits; when shrinkage exceeds 20%, include word/character delta.
8
+
- **Deliverable:** Refined passage with key edits (and deltas when relevant), finished with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Compress a 120-word status email to a 60-word update while keeping the blocked/on-track/risks structure.
11
+
- Polish a prompt by replacing filler ("in order to", "very") with precise verbs and noting a 25% word count drop.
+10
-8
codex/prompts/PI.md
+10
-8
codex/prompts/PI.md
···
1
1
# Prove It (PI)
2
-
- **Announce:** `Mode: PI` once; restate the absolute claim and why certainty is suspect.
3
-
- **Trigger:** words like always, never, guaranteed, optimal solution, or "devil's advocate".
4
-
- **Playbook:**
5
-
- List counterexamples, edge cases, and alternative paradigms that could break the claim.
6
-
- Apply logic traps and stress tests; probe limiting cases and opposing assumptions.
7
-
- Synthesize via an "Oracle" step: narrow the claim, map confidence, and mark context boundaries.
8
-
- Propose practical next tests or measurements.
9
-
- **Output:** Refined claim with boundaries, evidence for/against, recommended tests; close with an **Insights/Next Steps** line.
2
+
- **Purpose:** Stress-test absolute claims and reshape them into bounded, evidence-backed statements.
3
+
- **Process:**
4
+
- List plausible counterexamples, edge cases, and alternate paradigms that could break the claim.
5
+
- Apply logic stress tests: limiting cases, inversion, contradiction hunts, and opposing assumptions.
6
+
- Consolidate findings (the "Oracle" step): narrow the claim, map confidence levels, and mark context boundaries.
7
+
- Recommend concrete next tests, measurements, or observations to validate the refined claim.
8
+
- **Deliverable:** Refined claim with boundaries, evidence summary, and recommended tests, followed by a short **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Stress-test "this cache always serves responses under 50ms" by probing p99/p999 latency and failure injection paths.
11
+
- Challenge "the algorithm is always optimal" with adversarial inputs and compare against a brute-force baseline on small domains.
+10
-8
codex/prompts/PR.md
+10
-8
codex/prompts/PR.md
···
1
1
# Provisioner (PR)
2
-
- **Announce:** `Mode: PR` once; confirm the missing tool/signal.
3
-
- **Trigger:** command not found, install/verify requests, or tooling comparisons.
4
-
- **Playbook:**
5
-
- Run pre-flight: check which/versions/PATH and prerequisites.
6
-
- Choose install path in order: Homebrew -> official release -> language package -> manual; state rationale.
7
-
- Perform install or outline exact commands; update PATH/config if needed.
8
-
- Verify with which/--version and a representative command.
2
+
- **Purpose:** Supply the right tooling quickly and safely.
3
+
- **Process:**
4
+
- Run pre-flight checks: `which`, versions, PATH, and prerequisites.
5
+
- Choose the install path in order: Homebrew -> official release -> language package -> manual, stating the rationale.
6
+
- Perform the install or outline exact commands; update PATH/config if needed.
7
+
- Verify with `which`, `--version`, and a representative command.
9
8
- Note one credible alternative and why it was rejected.
10
-
- **Output:** Chosen path, steps taken or to run, verification result, rejected alternative; finish with an **Insights/Next Steps** line.
9
+
- **Deliverable:** Chosen path, steps taken (or to run), verification result, and the rejected alternative, capped with an **Insights/Next Steps** line.
10
+
- **Examples:**
11
+
- Install `jq` via Homebrew after confirming it is missing; verify with `jq --version` and note `python -m json.tool` as the alternative.
12
+
- Outline installing `kubectl` from the official release when Homebrew is unavailable, including PATH export and a `kubectl version --client` check.
+13
codex/prompts/REV.md
+13
codex/prompts/REV.md
···
1
+
# Review (REV)
2
+
- **Purpose:** Assess changes with emphasis on unsoundness, footguns, inessential complexity, and weak or missing invariants.
3
+
- **Process:**
4
+
- Scan for crash/corruption risks and other unsound behaviors.
5
+
- Surface misuse-prone APIs or defaults (footguns) with minimal repro snippets.
6
+
- Flag incidental complexity that obscures intent or maintainability.
7
+
- Identify missing or fragile invariants and suggest stronger guarantees.
8
+
- Order findings by severity and include file:line references when possible.
9
+
- **Deliverable:** Severity-ordered findings with context and suggested fixes, followed by an **Insights/Next Steps** line.
10
+
- **Examples:**
11
+
- Report a potential panic on nil pointer at `handlers/user.go:58`, suggest guarding or parsing earlier.
12
+
- Note a default `deleteOnFail=true` flag as a footgun, recommend flipping the default and adding a test.
13
+
- Highlight a 40-line nested conditional as incidental complexity and propose extracting permission checks into helpers.
+9
-7
codex/prompts/TR.md
+9
-7
codex/prompts/TR.md
···
1
1
# TRACE (TR)
2
-
- **Announce:** `Mode: TR` once; note the confusion point.
3
-
- **Trigger:** reviews, refactors, cognitive load or "what is this?" surprises.
4
-
- **Playbook:**
5
-
- Map cognitive heat: mark [HOT] hard-to-follow, [WARM] pause-and-think, [COOL] smooth.
6
-
- Run TRACE checklist: Type-first, Readability-in-30s, Atomic scope, Cognitive budget, Essential-only (pass/fail each).
7
-
- Log surprise events: misleading names, hidden side effects, complexity spikes.
2
+
- **Purpose:** Evaluate code clarity and recommend surgical refactors using the TRACE lens.
3
+
- **Process:**
4
+
- Map cognitive heat: mark [HOT] hard-to-follow, [WARM] pause-and-think, [COOL] smooth areas.
5
+
- Run the TRACE checklist: Type-first, Readability-in-30s, Atomic scope, Cognitive budget, Essential-only (pass/fail each).
6
+
- Log surprise events such as misleading names, hidden side effects, or complexity spikes.
8
7
- Produce a prioritized, scope-guarded refactor plan.
9
-
- **Output:** Heat map + surprises, TRACE grades, surgical refactor steps; end with an **Insights/Next Steps** line.
8
+
- **Deliverable:** Heat map and surprises, TRACE grades, and refactor steps, capped with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Mark a nested permission check as [HOT], fail Readability/Atomic, and recommend guard clauses plus extracted helpers.
11
+
- Note a misleading function name that mutates state; log as a surprise and suggest renaming with an accompanying unit test.
+10
-9
codex/prompts/UD.md
+10
-9
codex/prompts/UD.md
···
1
1
# Unsoundness Detector (UD)
2
-
- **Announce:** `Mode: UD` once; name the suspected failure and why the current tactic fails.
3
-
- **Trigger:** crashes, data corruption risk, races, leaks, or resource-lifetime doubts.
4
-
- **Playbook:**
5
-
- Rank failure modes (crash > corruption > logic).
6
-
- Trace nullables, concurrency, and lifetimes end-to-end; note the first break point.
7
-
- Provide a concrete counterexample or exploit input.
8
-
- Prescribe the smallest sound fix that removes the entire class.
9
-
- State the new invariant the fix enforces.
10
-
- **Output:** Severity-ordered findings with repro, root cause, fix, invariant; end with an **Insights/Next Steps** line.
2
+
- **Purpose:** Surface and eliminate crash, corruption, and race risks with minimal fixes.
3
+
- **Process:**
4
+
- Rank potential failure modes in order of impact (crash > corruption > logic error).
5
+
- Trace nullables, concurrency, and lifetimes end-to-end to find the first break point.
6
+
- Provide a concrete counterexample or exploit input for each risk.
7
+
- Prescribe the smallest sound fix that removes the entire class of failure and state the new invariant it enforces.
8
+
- **Deliverable:** Severity-ordered findings with repro, root cause, fix, and invariant, ending with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Identify a nil dereference path when `config` is optional, reproduce with an empty env file, and fix by enforcing a parsed config type.
11
+
- Expose a data race on a shared cache map under concurrent writes; add a mutex or channel-based handoff and document the new invariant.
+10
-8
codex/prompts/UN.md
+10
-8
codex/prompts/UN.md
···
1
1
# Universalist (UN)
2
-
- **Announce:** `Mode: UN` once; name the abstraction question.
3
-
- **Trigger:** category-theory cues or API generalization debates.
4
-
- **Playbook:**
5
-
- Map to the simplest fitting construction: product, coproduct, functor/map, limit/colimit, adjunction, etc.
6
-
- Translate that construction into the repo's language; show relationships defining it.
7
-
- State governing laws and the safety/duplication benefit they provide.
8
-
- Suggest a quick law-based test or property to keep it honest.
9
-
- **Output:** Mapped pattern, translation, laws, test recommendation; close with an **Insights/Next Steps** line.
2
+
- **Purpose:** Ground abstractions in the simplest fitting category-theoretic construction.
3
+
- **Process:**
4
+
- Map the problem to a minimal construction (product, coproduct, functor/map, limit/colimit, adjunction, etc.).
5
+
- Translate that construction into the repo's language and show the relationships that define it.
6
+
- State the governing laws and the safety or deduplication benefit they provide.
7
+
- Suggest a quick law-based test or property to keep the abstraction honest.
8
+
- **Deliverable:** Mapped pattern, translation, governing laws, and test recommendation, finished with an **Insights/Next Steps** line.
9
+
- **Examples:**
10
+
- Model a pair of values as a product type to remove parallel parameter lists; test with projection/round-trip laws.
11
+
- Treat error-or-value handling as an `Either`/coproduct; add a property that `map` preserves identity and composition.
+10
codex/prompts/WK.md
+10
codex/prompts/WK.md
···
1
+
# Work (WK)
2
+
- **Purpose:** Finish the current in-progress bead and hand off a ready-for-review change.
3
+
- **Process:**
4
+
- Pick up the in-progress bead and continue until the work is complete.
5
+
- Run build, tests, and formatters before wrapping.
6
+
- Open a PR with the changes; do not merge it.
7
+
- **Deliverable:** PR-ready changes with build/test/format completed.
8
+
- **Examples:**
9
+
- Finish an "add CSV export" bead, run `uv run pytest` and formatters, then open a PR titled "Add CSV export (bd-123)".
10
+
- Complete a lint-fix bead, ensure `npm test` passes, and push a PR without merging.