fix: slim down token usage
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
engine: "data-driven-v1"
|
||||
goal_file: ".agent/controllers/keystone-seam-audit/goal.md"
|
||||
plan_file: ".agent/controllers/keystone-seam-audit/plan.toon"
|
||||
state_file: ".agent/controllers/keystone-seam-audit/state.toon"
|
||||
standards_file: ".agent/controllers/keystone-seam-audit/standards.md"
|
||||
branch: "codex/keystone-seam-audit"
|
||||
goal_file: ".agent/controllers/teamwise-prompt-lens/goal.md"
|
||||
plan_file: ".agent/controllers/teamwise-prompt-lens/plan.toon"
|
||||
state_file: ".agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
standards_file: ".agent/controllers/teamwise-prompt-lens/standards.md"
|
||||
branch: "codex/teamwise-prompt-lens"
|
||||
continue_until: "fixed-point"
|
||||
max_runs: 12
|
||||
max_wall_clock: 4h
|
||||
@@ -1,6 +1,6 @@
|
||||
version: 1
|
||||
phase: executing
|
||||
goal_status: "in-progress"
|
||||
phase: blocked
|
||||
goal_status: blocked
|
||||
goal_revision: 1
|
||||
current_step_id: null
|
||||
iteration: 0
|
||||
@@ -11,7 +11,7 @@ last_verification: null
|
||||
last_cleanup_summary: null
|
||||
last_full_test_summary: null
|
||||
history[0]:
|
||||
notes[0]:
|
||||
notes[1]: No actionable step remained and autonomous replan produced nothing.
|
||||
planning_session:
|
||||
pending_question: null
|
||||
transcript[4]{role,content}:
|
||||
@@ -20,6 +20,6 @@ planning_session:
|
||||
user,find large files and refactor to smaller files
|
||||
assistant,Planning completed
|
||||
started_at: "1775273562"
|
||||
last_usage_refresh_at: "1775274722"
|
||||
last_usage_refresh_at: "1775275327"
|
||||
last_usage_input_tokens: null
|
||||
last_usage_output_tokens: null
|
||||
5
.agent/controllers/module-mosaic/goal.md
Normal file
5
.agent/controllers/module-mosaic/goal.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Goal
|
||||
|
||||
Refactor the oversized Rust modules in this repository into smaller, focused directory modules without changing runtime behavior, controller flow, or persisted controller file formats.
|
||||
|
||||
Prioritize `src/ui/mod.rs`, `src/model.rs`, `src/process.rs`, `src/storage/toon.rs`, `src/app/workspace_input.rs`, and `src/app/runtime.rs`. End with thin `mod.rs` facades, clear ownership boundaries, stable public APIs or `pub use` reexports where they reduce churn, colocated tests for the moved logic, and a green Rust verification pass.
|
||||
130
.agent/controllers/module-mosaic/plan.toon
Normal file
130
.agent/controllers/module-mosaic/plan.toon
Normal file
@@ -0,0 +1,130 @@
|
||||
version: 6
|
||||
goal_summary: "Refactor the remaining oversized Rust modules into focused directory modules with thin facades, stable public APIs, colocated tests, unchanged controller behavior and persisted formats, then finish with full Rust verification."
|
||||
steps[8]:
|
||||
- id: guardrails
|
||||
title: Add Refactor Guardrails
|
||||
purpose: Lock down the current behavior that must survive file moves before changing module structure.
|
||||
notes: "Completed. Guardrail coverage exists for model, process, storage, app, and UI behavior, including serialized cwd-sensitive TOON tests and the cached session-view shape used by app/UI call sites."
|
||||
inputs[7]: src/model.rs,src/process.rs,src/storage/toon.rs,src/app/tests.rs,src/ui/mod.rs,src/app/session.rs,src/app/mod.rs
|
||||
outputs[5]: Focused tests covering plan/state/schema behavior in the model boundary,"Focused tests covering codex event parsing, usage snapshots, and stderr filtering","Focused tests covering TOON roundtrips, controller discovery, controller id normalization, and cwd-sensitive discovery flows","Focused app tests covering planning command gating, scrolling, and submission behavior","Focused UI tests covering screen rendering, wrapping, and session selection extraction"
|
||||
dependencies[0]:
|
||||
verification[1]:
|
||||
- label: Targeted guardrail tests
|
||||
commands[5]: "cargo test -q model::tests","cargo test -q process::tests","cargo test -q storage::toon::tests","cargo test -q app::tests","cargo test -q ui::tests"
|
||||
cleanup_requirements[2]{label,description}:
|
||||
Colocate new tests,"Keep each new or moved test with the module that owns the behavior instead of adding another catch-all test file."
|
||||
Avoid duplicate fixtures,Reuse existing sample app and model fixtures where possible so the refactor does not create parallel test scaffolding.
|
||||
status: done
|
||||
attempts: 1
|
||||
- id: "model-modules"
|
||||
title: Split Shared Model Types
|
||||
purpose: "Refactor `src/model.rs` into focused submodules while preserving the existing `crate::model::*` surface."
|
||||
notes: "Completed. `src/model.rs` is now a directory facade with focused submodules, stable reexports, and colocated tests protecting schemas, plan helpers, session views, and response types."
|
||||
inputs[1]: src/model.rs
|
||||
outputs[8]: src/model/mod.rs facade reexporting the stable public model API,"src/model/controller.rs for screen, phase, goal status, step status, and controller state types","src/model/plan.rs for task config, plan structs, and plan mutation helpers","src/model/session.rs for session enums, grouping, cursor, cached session-view, and selection helpers",src/model/usage.rs for usage and status snapshot types,"src/model/response.rs for planner, executor, and controller summary response types",src/model/schema.rs for JSON schema builders,Model tests moved beside their owning submodules
|
||||
dependencies[1]: guardrails
|
||||
verification[1]:
|
||||
- label: Model regression tests
|
||||
commands[6]: "cargo test -q model::controller::tests","cargo test -q model::plan::tests","cargo test -q model::session::tests","cargo test -q model::schema::tests","cargo test -q model::usage::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Thin facade,Leave `src/model/mod.rs` as a reexport surface rather than reintroducing large inline implementations there.
|
||||
Serde and schema parity,"Keep existing serde attributes, defaults, and JSON schema output unchanged while splitting the code."
|
||||
No stale aliases,"Remove transitional imports or compatibility types that only mirror the old single-file layout once the facade exports are wired."
|
||||
status: done
|
||||
attempts: 3
|
||||
- id: "process-modules"
|
||||
title: Split Process Execution And Parsing
|
||||
purpose: "Refactor `src/process.rs` into focused modules for codex execution, shell execution, usage snapshots, and event parsing."
|
||||
notes: "Completed. `src/process.rs` was replaced with focused modules and a stable facade. Public entry points remain unchanged, targeted parser and usage tests pass, and no new process-specific warnings were introduced."
|
||||
inputs[2]: src/process.rs,src/model/mod.rs
|
||||
outputs[6]: src/process/mod.rs facade preserving the current public functions,src/process/codex.rs for `run_codex_with_schema` and controller id generation,src/process/shell.rs for shell command execution and command summaries,src/process/usage.rs for usage snapshot helpers,src/process/parser.rs for codex JSON line parsing and rendering helpers,Process parsing tests kept with the parser and usage modules
|
||||
dependencies[2]: guardrails,"model-modules"
|
||||
verification[1]:
|
||||
- label: Process regression tests
|
||||
commands[3]: "cargo test -q process::parser::tests","cargo test -q process::usage::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Stable process API,"Preserve the current `crate::process::*` entry points so controller and app call sites stay unchanged."
|
||||
No parsing drift,"Keep command, tool, thinking, usage, and stderr event behavior identical after extraction."
|
||||
Cull moved dead code,Delete obsolete inline helpers in the old file instead of leaving duplicate parser or usage logic behind.
|
||||
status: done
|
||||
attempts: 1
|
||||
- id: "storage-toon-modules"
|
||||
title: Split TOON Persistence Helpers
|
||||
purpose: "Refactor `src/storage/toon.rs` into focused persistence, discovery, codec, and id helper modules without changing file formats."
|
||||
notes: "Completed. `src/storage/toon.rs` is now a focused directory module with stable facade exports, shared codec helpers, preserved cwd-sensitive discovery behavior, and passing targeted plus full test runs."
|
||||
inputs[2]: src/storage/toon.rs,src/model/mod.rs
|
||||
outputs[6]: src/storage/toon/mod.rs facade preserving the current storage API,src/storage/toon/files.rs for controller file creation and markdown read/write helpers,src/storage/toon/codec.rs for shared TOON read and write helpers,"src/storage/toon/controllers.rs for controller creation, listing, summaries, discovery, and timestamp helpers","src/storage/toon/ids.rs for normalization, uniqueness, fallback, and suffix helpers","Storage tests split between codec, discovery, and id modules"
|
||||
dependencies[2]: guardrails,"model-modules"
|
||||
verification[1]:
|
||||
- label: Storage regression tests
|
||||
commands[5]: "cargo test -q storage::toon::codec::tests","cargo test -q storage::toon::controllers::tests","cargo test -q storage::toon::ids::tests","cargo test -q storage::toon::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
No format drift,"Keep persisted markdown and TOON content shape byte-compatible except for harmless formatting already produced by existing helpers."
|
||||
Single codec path,Route all TOON encoding and decoding through shared codec helpers instead of leaving duplicate inline file logic.
|
||||
"Preserve cwd-sensitive tests","Keep the existing cwd mutex and discovery test discipline intact so file-system behavior stays deterministic."
|
||||
status: done
|
||||
attempts: 1
|
||||
- id: "app-runtime-modules"
|
||||
title: Split App Runtime Lifecycle
|
||||
purpose: "Refactor `src/app/runtime.rs` into focused modules for workspace lifecycle, runtime events, and usage refresh while keeping `App` behavior stable."
|
||||
notes: "Completed. `src/app/runtime.rs` now routes through focused runtime modules with stable `impl App` entry points, expanded colocated tests, and a clean repository-wide verification pass after extraction."
|
||||
inputs[5]: src/app/runtime.rs,src/app/mod.rs,src/process/mod.rs,src/storage/toon/mod.rs,src/app/session.rs
|
||||
outputs[5]: src/app/runtime/mod.rs coordinating the runtime submodules,"src/app/runtime/workspace.rs for open, create, load, picker refresh, and shutdown flows",src/app/runtime/events.rs for draining and applying runtime events plus local session entry helpers,src/app/runtime/usage.rs for usage refresh and state persistence,"Expanded app tests covering event application, usage refresh, workspace open flows, and cached-session reconstruction"
|
||||
dependencies[4]: guardrails,"model-modules","process-modules","storage-toon-modules"
|
||||
verification[1]:
|
||||
- label: App runtime regression tests
|
||||
commands[5]: "cargo test -q app::runtime::events::tests","cargo test -q app::runtime::usage::tests","cargo test -q app::runtime::workspace::tests","cargo test -q app::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Stable App methods,Keep the current `impl App` method names and external call sites intact while moving their bodies into submodules.
|
||||
Single hydration path,Avoid duplicating workspace state initialization and usage snapshot reconstruction across runtime modules.
|
||||
"Contain runtime-only logic",Do not let runtime extraction leak storage or process implementation details into unrelated app modules.
|
||||
status: done
|
||||
attempts: 1
|
||||
- id: "app-workspace-input-modules"
|
||||
title: Split Workspace Input Handling
|
||||
purpose: "Refactor `src/app/workspace_input.rs` into focused keyboard, mouse, command, and submission modules while preserving interaction behavior."
|
||||
notes: "Next execution step. Runtime seams are now stable, so extract interaction logic by ownership boundary while keeping slash commands, planning-mode gating, drag selection, scroll behavior, follow-output resets, warning text, and submission side effects unchanged. Controller recovered this step from stale active state and returned it to todo."
|
||||
inputs[5]: src/app/workspace_input.rs,src/app/mod.rs,src/app/tests.rs,src/ui/mod.rs,src/app/runtime/mod.rs
|
||||
outputs[6]: src/app/workspace_input/mod.rs coordinating workspace input entry points,"src/app/workspace_input/mouse.rs for selection, drag, and wheel handling",src/app/workspace_input/keyboard.rs for key dispatch and navigation,src/app/workspace_input/commands.rs for slash command handling and planning mode gating,src/app/workspace_input/submission.rs for user message submission and local session entry creation,"Expanded colocated tests covering slash commands, selection, drag, scroll, follow-output reset behavior, and submission ordering"
|
||||
dependencies[2]: guardrails,"app-runtime-modules"
|
||||
verification[1]:
|
||||
- label: Workspace input regression tests
|
||||
commands[4]: "cargo test -q app::workspace_input::commands::tests","cargo test -q app::workspace_input::submission::tests","cargo test -q app::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Keep command strings stable,"Do not change existing slash commands, warning text, or planning-mode restrictions during the split."
|
||||
No duplicated reset logic,"Centralize selection and follow-output resets instead of copying the same workspace cleanup code into each input module."
|
||||
Preserve local entry creation,Keep local session entry generation and submission ordering identical so UI and persistence behavior do not drift.
|
||||
status: active
|
||||
attempts: 1
|
||||
- id: "ui-modules"
|
||||
title: Split UI Rendering Helpers
|
||||
purpose: Refactor `src/ui/mod.rs` into focused rendering modules while preserving the current exported helpers and TUI behavior.
|
||||
notes: "Start after workspace input extraction settles the app-facing seams. Keep `src/ui/mod.rs` as a thin facade, preserve wrapping and selection math exactly, and remove the dead `session_row_cells` helper or relocate its behavior into the owning session-rendering module so no dead-code warning survives."
|
||||
inputs[5]: src/ui/mod.rs,src/ui/scroll.rs,src/app/mod.rs,src/model/mod.rs,src/app/workspace_input/mod.rs
|
||||
outputs[9]: src/ui/mod.rs thin facade exporting the stable UI entry points,"src/ui/theme.rs for colors, shared styles, and shell block helpers","src/ui/layout.rs for `WorkspaceLayout`, `SessionView`, and layout calculations",src/ui/picker.rs for controller picker rendering,"src/ui/create_controller.rs for create-controller screen rendering",src/ui/workspace.rs for workspace screen orchestration,"src/ui/session.rs for session row rendering, wrapping, and selection extraction helpers","src/ui/sidebar.rs for plan board, status line, and composer helper rendering",UI tests updated to target the new owning modules without changing rendered behavior
|
||||
dependencies[4]: guardrails,"model-modules","app-runtime-modules","app-workspace-input-modules"
|
||||
verification[1]:
|
||||
- label: UI regression tests
|
||||
commands[4]: "cargo test -q ui::layout::tests","cargo test -q ui::session::tests","cargo test -q ui::tests","cargo test -q"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Thin facade,Keep `src/ui/mod.rs` limited to module wiring and stable reexports instead of leaving business logic there.
|
||||
Preserve selection math,"Keep wrapping, selection clipping, and copied session text behavior identical after extraction."
|
||||
Remove refactor leftovers,Delete dead rendering helpers and stale imports introduced or exposed by the module split.
|
||||
status: todo
|
||||
attempts: 0
|
||||
- id: "final-integration"
|
||||
title: Run Final Cleanup And Verification
|
||||
purpose: "Reconcile imports and module wiring, remove leftover compatibility code, and run the full repository quality gate."
|
||||
notes: "Final pass after the remaining app and UI splits. Clean wiring and refactor leftovers, confirm that stable APIs remain intact, and rerun the full required verification set after any final lint-driven cleanup that does not change behavior."
|
||||
inputs[7]: src/model/mod.rs,src/process/mod.rs,src/storage/toon/mod.rs,src/app/runtime/mod.rs,src/app/workspace_input/mod.rs,src/ui/mod.rs,Cargo.toml
|
||||
outputs[3]: Updated module declarations and imports across `src/`,"Removed dead helpers, stale imports, and compatibility shims left from the large-file split","Green formatting, test, and clippy verification for the refactor"
|
||||
dependencies[6]: "model-modules","process-modules","storage-toon-modules","app-runtime-modules","app-workspace-input-modules","ui-modules"
|
||||
verification[1]:
|
||||
- label: Full verification
|
||||
commands[3]: "cargo fmt --check","cargo test -q","cargo clippy -q --all-targets --all-features"
|
||||
cleanup_requirements[3]{label,description}:
|
||||
Remove leftovers,Delete obsolete inline helpers and transitional reexports once the new module structure is wired in cleanly.
|
||||
Keep structure intentional,"Do not leave empty modules or one-off directories after the refactor is complete."
|
||||
No warning regressions,"Do not introduce new dead-code or stale-import warnings as part of the refactor cleanup."
|
||||
status: todo
|
||||
attempts: 0
|
||||
9
.agent/controllers/module-mosaic/standards.md
Normal file
9
.agent/controllers/module-mosaic/standards.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Standards
|
||||
|
||||
- Preserve existing behavior, controller orchestration, TUI interactions, and on-disk `.md` and `.toon` controller formats throughout the refactor.
|
||||
- Prefer focused directory modules when a file mixes responsibilities or grows past roughly 300 lines, and keep `mod.rs` files as thin facades or reexport surfaces.
|
||||
- Keep public call sites stable unless a narrower API is clearly better, using `pub use` reexports to avoid unnecessary churn.
|
||||
- Split code by ownership boundary: model/state/schema concerns, process execution and parsing, TOON persistence and controller discovery, app runtime lifecycle, workspace input handling, and UI rendering helpers.
|
||||
- Move or add focused tests with the code they protect, especially around model schemas, session grouping and selection, process parsing, storage discovery and id generation, runtime event handling, workspace commands, and UI rendering helpers.
|
||||
- Remove dead helpers, stale imports, and compatibility layers that only mirror the old file layout.
|
||||
- Finish with `cargo fmt --check`, `cargo test -q`, and `cargo clippy -q --all-targets --all-features` passing.
|
||||
43
.agent/controllers/module-mosaic/state.toon
Normal file
43
.agent/controllers/module-mosaic/state.toon
Normal file
@@ -0,0 +1,43 @@
|
||||
version: 1
|
||||
phase: executing
|
||||
stop_reason: null
|
||||
goal_status: "in-progress"
|
||||
goal_revision: 2
|
||||
current_step_id: null
|
||||
iteration: 7
|
||||
replan_required: false
|
||||
completed_steps[5]: guardrails,"model-modules","process-modules","storage-toon-modules","app-runtime-modules"
|
||||
blocked_steps[0]:
|
||||
last_verification:
|
||||
passed: true
|
||||
summary: All commands passed
|
||||
commands[3]: "cargo fmt --check","cargo test -q","cargo clippy -q --all-targets --all-features"
|
||||
output[1]: "running 65 tests\n.................................................................\ntest result: ok. 65 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s"
|
||||
last_cleanup_summary:
|
||||
passed: true
|
||||
summary: "Cleanup accepted for app-runtime-modules"
|
||||
commands[0]:
|
||||
output[3]: Kept runtime behavior stable by preserving the existing `impl App` entry points in `src/app/runtime/mod.rs` and moving only the implementation bodies behind module boundaries.,"Added focused runtime guardrail coverage in `src/app/runtime/events.rs`, `src/app/runtime/usage.rs`, and `src/app/runtime/workspace.rs` instead of expanding the catch-all app test file.","Folded in low-risk cleanup needed for a clean verification pass: collapsed the app event-poll branch in `src/app/mod.rs`, elided a needless lifetime in `src/process/parser.rs`, marked the UI-only helper in `src/ui/mod.rs` as test-only, and explicitly allowed the existing `AppEvent` enum layout instead of changing runtime payload behavior."
|
||||
last_full_test_summary:
|
||||
passed: true
|
||||
summary: All commands passed
|
||||
commands[4]: "cargo test -q app::runtime::events::tests","cargo test -q app::runtime::usage::tests","cargo test -q app::runtime::workspace::tests","cargo test -q app::tests"
|
||||
output[4]: "running 3 tests\n...\ntest result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 62 filtered out; finished in 0.00s","running 2 tests\n..\ntest result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 63 filtered out; finished in 0.00s","running 1 test\n.\ntest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 64 filtered out; finished in 0.00s","running 6 tests\n......\ntest result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 59 filtered out; finished in 0.00s"
|
||||
history[5]{timestamp,kind,detail}:
|
||||
"1775277691","step-complete",Completed guardrails
|
||||
"1775278850","step-complete","Completed model-modules"
|
||||
"1775279170","step-complete","Completed process-modules"
|
||||
"1775279529","step-complete","Completed storage-toon-modules"
|
||||
"1775279938","step-complete","Completed app-runtime-modules"
|
||||
notes[8]: No actionable step remained and autonomous replan produced nothing.,"Recovered stale active step state for module-mosaic. Reset model-modules to todo.","Recovered stale active step state for module-mosaic. Reset model-modules to todo.",No actionable step remained and autonomous replan produced nothing.,"Recovered stale active step state for module-mosaic. Reset process-modules to todo.","Recovered stale active step state for module-mosaic. Reset storage-toon-modules to todo.","Recovered stale active step state for module-mosaic. Reset app-runtime-modules to todo.","Recovered stale active step state for module-mosaic. Reset app-workspace-input-modules to todo."
|
||||
planning_session:
|
||||
pending_question: null
|
||||
transcript[4]{role,content}:
|
||||
user,refactor large files to smaller more maintainable files
|
||||
assistant,Planning completed
|
||||
user,refactor large files
|
||||
assistant,Planning completed
|
||||
started_at: "1775275504"
|
||||
last_usage_refresh_at: "1775280021"
|
||||
last_usage_input_tokens: null
|
||||
last_usage_output_tokens: null
|
||||
3
.agent/controllers/runtime-open/goal.md
Normal file
3
.agent/controllers/runtime-open/goal.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Goal
|
||||
|
||||
Describe the goal for this controller.
|
||||
3
.agent/controllers/runtime-open/plan.toon
Normal file
3
.agent/controllers/runtime-open/plan.toon
Normal file
@@ -0,0 +1,3 @@
|
||||
version: 1
|
||||
goal_summary: No plan yet
|
||||
steps[0]:
|
||||
5
.agent/controllers/runtime-open/standards.md
Normal file
5
.agent/controllers/runtime-open/standards.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Standards
|
||||
|
||||
- Keep code maintainable.
|
||||
- Avoid one-off hacks.
|
||||
- Leave tests green.
|
||||
22
.agent/controllers/runtime-open/state.toon
Normal file
22
.agent/controllers/runtime-open/state.toon
Normal file
@@ -0,0 +1,22 @@
|
||||
version: 1
|
||||
phase: planning
|
||||
stop_reason: null
|
||||
goal_status: unknown
|
||||
goal_revision: 0
|
||||
current_step_id: null
|
||||
iteration: 0
|
||||
replan_required: false
|
||||
completed_steps[0]:
|
||||
blocked_steps[0]:
|
||||
last_verification: null
|
||||
last_cleanup_summary: null
|
||||
last_full_test_summary: null
|
||||
history[0]:
|
||||
notes[0]:
|
||||
planning_session:
|
||||
pending_question: null
|
||||
transcript[0]:
|
||||
started_at: null
|
||||
last_usage_refresh_at: null
|
||||
last_usage_input_tokens: null
|
||||
last_usage_output_tokens: null
|
||||
12
.agent/controllers/teamwise-prompt-lens/goal.md
Normal file
12
.agent/controllers/teamwise-prompt-lens/goal.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Goal
|
||||
|
||||
Turn rough user prompts entered into the controller goal planner into clear, production-quality improvement briefs shaped by a cross-functional software team.
|
||||
|
||||
The controller should:
|
||||
- reinterpret ambiguous or sloppy requests through the perspectives of an architect, product owner, senior engineer, QA engineer, and other relevant software roles;
|
||||
- surface missing context, risks, constraints, edge cases, and acceptance criteria before execution begins;
|
||||
- rewrite the original request into a coherent codebase-improvement prompt that is specific, technically credible, and ready for autonomous planning or implementation;
|
||||
- prefer maintainable, incremental improvements over novelty or one-off solutions;
|
||||
- produce outputs that help downstream agents make sound architectural, implementation, testing, and rollout decisions with minimal back-and-forth.
|
||||
|
||||
Success means a weak initial prompt becomes a well-scoped, team-reviewed execution brief with explicit goals, assumptions, constraints, risks, and verification expectations.
|
||||
89
.agent/controllers/teamwise-prompt-lens/plan.toon
Normal file
89
.agent/controllers/teamwise-prompt-lens/plan.toon
Normal file
@@ -0,0 +1,89 @@
|
||||
version: 1
|
||||
goal_summary: "Define a team-oriented planning controller that transforms rough prompts into implementation-ready improvement briefs using cross-functional software perspectives."
|
||||
steps[6]:
|
||||
- id: "step-01"
|
||||
title: Audit Current Controller Artifacts
|
||||
purpose: "Inspect the existing goal, standards, plan, and state files to replace placeholders and preserve any useful structure."
|
||||
notes: "The current controller files are placeholder-heavy and need concrete intent before automation can rely on them. One or more commands failed"
|
||||
inputs[4]: ".agent/controllers/teamwise-prompt-lens/goal.md",".agent/controllers/teamwise-prompt-lens/standards.md",".agent/controllers/teamwise-prompt-lens/plan.toon",".agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
outputs[3]: Confirmed file inventory,List of placeholder content to replace,Any existing TOON structure worth preserving
|
||||
dependencies[0]:
|
||||
verification[1]:
|
||||
- label: Read current controller files
|
||||
commands[4]: "sed -n '1,200p' .agent/controllers/teamwise-prompt-lens/goal.md","sed -n '1,240p' .agent/controllers/teamwise-prompt-lens/standards.md","sed -n '1,240p' .agent/controllers/teamwise-prompt-lens/plan.toon","sed -n '1,240p' .agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
No stale placeholders,Remove generic placeholder text once the real controller intent is documented.
|
||||
status: active
|
||||
attempts: 4
|
||||
- id: "step-02"
|
||||
title: "Define Cross-Functional Prompt Lens"
|
||||
purpose: "Specify the software-team roles and the exact review dimensions each role contributes to prompt improvement."
|
||||
notes: The controller needs explicit personas so it consistently upgrades prompts instead of producing generic rewrites.
|
||||
inputs[2]: "User request for architect, QA, senior engineer, product owner, and broader team input","Findings from step-01"
|
||||
outputs[3]: Role list for the prompt lens,"Per-role review criteria",Rules for when to include or omit additional roles
|
||||
dependencies[1]: "step-01"
|
||||
verification[1]:
|
||||
- label: Check role coverage in artifacts
|
||||
commands[1]: "rg -n \"architect|product|senior engineer|qa|operations|security|performance\" .agent/controllers/teamwise-prompt-lens"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
Avoid role sprawl,Keep the persona set opinionated and reusable rather than listing every possible specialty.
|
||||
status: todo
|
||||
attempts: 0
|
||||
- id: "step-03"
|
||||
title: Rewrite Goal And Standards
|
||||
purpose: "Replace the placeholder Markdown with controller-specific guidance that matches the desired teamwise prompt transformation behavior."
|
||||
notes: The goal and standards must be explicit because downstream planning quality depends on them.
|
||||
inputs[2]: "Outputs from step-01","Outputs from step-02"
|
||||
outputs[2]: "Updated .agent/controllers/teamwise-prompt-lens/goal.md","Updated .agent/controllers/teamwise-prompt-lens/standards.md"
|
||||
dependencies[1]: "step-02"
|
||||
verification[1]:
|
||||
- label: Validate rewritten Markdown content
|
||||
commands[3]: "sed -n '1,240p' .agent/controllers/teamwise-prompt-lens/goal.md","sed -n '1,260p' .agent/controllers/teamwise-prompt-lens/standards.md","rg -n \"Describe the goal for this controller|placeholder|TODO\" .agent/controllers/teamwise-prompt-lens/goal.md .agent/controllers/teamwise-prompt-lens/standards.md"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
Keep standards actionable,Remove vague quality slogans unless they imply a concrete execution rule.
|
||||
status: todo
|
||||
attempts: 0
|
||||
- id: "step-04"
|
||||
title: Author Planner Workflow In TOON
|
||||
purpose: "Encode the planning workflow so the controller consistently turns sloppy prompts into structured, execution-ready briefs."
|
||||
notes: The main behavioral logic belongs in the plan file because the controller is operating in planning mode.
|
||||
inputs[2]: Rewritten goal and standards,"Cross-functional prompt lens definition"
|
||||
outputs[2]: "Updated .agent/controllers/teamwise-prompt-lens/plan.toon with ordered planning behavior","Explicit output sections for rewritten prompt, assumptions, risks, acceptance criteria, and verification"
|
||||
dependencies[1]: "step-03"
|
||||
verification[1]:
|
||||
- label: Review plan structure
|
||||
commands[2]: "sed -n '1,260p' .agent/controllers/teamwise-prompt-lens/plan.toon","rg -n \"assumptions|risks|acceptance criteria|verification|rewrite|team\" .agent/controllers/teamwise-prompt-lens/plan.toon"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
No dead branches,Remove unused workflow branches or duplicate instructions that would confuse autonomous execution.
|
||||
status: todo
|
||||
attempts: 0
|
||||
- id: "step-05"
|
||||
title: Initialize Stateful Planning Data
|
||||
purpose: "Define the minimal controller state needed to track prompt quality, assumptions, open questions, and plan readiness across runs."
|
||||
notes: State should stay minimal so the controller remains predictable and maintainable.
|
||||
inputs[2]: "Planner workflow from step-04","Existing .agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
outputs[2]: "Updated .agent/controllers/teamwise-prompt-lens/state.toon","Stable state fields for prompt intake, role synthesis, assumptions, risks, and completion status"
|
||||
dependencies[1]: "step-04"
|
||||
verification[1]:
|
||||
- label: Inspect state schema
|
||||
commands[2]: "sed -n '1,240p' .agent/controllers/teamwise-prompt-lens/state.toon","rg -n \"prompt|assumption|risk|question|ready|status\" .agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
Avoid overspecified state,Remove transient or redundant fields that do not support repeated planning runs.
|
||||
status: todo
|
||||
attempts: 0
|
||||
- id: "step-06"
|
||||
title: Validate With Representative Prompt Cases
|
||||
purpose: Check that the controller can upgrade rough prompts into clearer briefs without losing user intent.
|
||||
notes: A few realistic examples are the fastest way to catch missing sections or overcomplicated output rules.
|
||||
inputs[2]: Updated controller artifacts,Representative sloppy prompts about codebase improvements
|
||||
outputs[2]: Validation notes,"Any final wording adjustments to goal, standards, plan, or state"
|
||||
dependencies[1]: "step-05"
|
||||
verification[2]:
|
||||
- label: Run artifact review against sample prompts
|
||||
commands[4]: "sed -n '1,260p' .agent/controllers/teamwise-prompt-lens/goal.md","sed -n '1,260p' .agent/controllers/teamwise-prompt-lens/standards.md","sed -n '1,320p' .agent/controllers/teamwise-prompt-lens/plan.toon","sed -n '1,260p' .agent/controllers/teamwise-prompt-lens/state.toon"
|
||||
- label: Final placeholder sweep
|
||||
commands[1]: "rg -n \"TODO|placeholder|Describe the goal for this controller|TBD\" .agent/controllers/teamwise-prompt-lens"
|
||||
cleanup_requirements[1]{label,description}:
|
||||
Remove ad hoc examples,"Do not leave validation-only sample prompts in production controller files unless intentionally documented."
|
||||
status: todo
|
||||
attempts: 0
|
||||
13
.agent/controllers/teamwise-prompt-lens/standards.md
Normal file
13
.agent/controllers/teamwise-prompt-lens/standards.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Standards
|
||||
|
||||
- Treat every incoming prompt as incomplete until assumptions, constraints, and success criteria are made explicit.
|
||||
- Synthesize perspectives from architecture, product, engineering, QA, and operations when they materially affect the outcome.
|
||||
- Optimize for maintainable codebase improvements, not clever one-off patches.
|
||||
- Preserve the user's core intent while upgrading precision, scope control, and technical quality.
|
||||
- Make missing information visible as assumptions or open questions instead of silently inventing product or system behavior.
|
||||
- Require clear deliverables, acceptance criteria, and verification expectations in the rewritten prompt.
|
||||
- Call out risks, dependencies, migration concerns, and likely regression areas when relevant.
|
||||
- Keep outputs concise enough for autonomous execution, but complete enough to avoid avoidable follow-up.
|
||||
- Prefer incremental, reviewable changes that can keep tests green throughout execution.
|
||||
- Eliminate placeholder language, vague directives, and non-actionable advice from controller artifacts.
|
||||
- Leave tests green.
|
||||
28
.agent/controllers/teamwise-prompt-lens/state.toon
Normal file
28
.agent/controllers/teamwise-prompt-lens/state.toon
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user