Skip to content

Standard Daily Workflow: Working With an Agent ​

Most developers don't configure every knob up front — you start chatting on a real repository, observe how the agent behaves with your quota and codebase, teach it your recurring workflows as skills and rules, and use real cost data to lock down subagents and failover.

This guide walks through that standard day-to-day workflow from first chat to a self-improving, cost-controlled setup.


The compounding feedback loop ​

mermaid
flowchart LR
    S1["1. Start Chat &\nInitialize Project\nkompile chat • AGENTS.md\ncode-index • configure init"] --> S2["2. Run Real Tasks &\nWatch Quota / Behavior\n/usage • /cost\n/dashboard-* • /insights"]
    S2 --> S3["3. Codify What Works\nskill_manager • script_manager\nrole_manager • memory • draft"]
    S3 --> S4["4. Control Subagents\n& Failover From Real Spend\n/subagent-breakdown\n/subagent-config • /model failover"]
    S4 --> S5["5. Scale & Share\n/workflow • multi_task • Judge\n/gc • kompile sources / peer"]
    S5 -.->|"Every session starts smarter"| S2

Stage 1: Start in chat & initialize your project ​

Open your repository and start in whichever surface fits you best (CLI vs. Web Harness):

bash
cd /path/to/your/repo
kompile chat               # Terminal TUI (runs SetupWizard on first launch)
# or
kompile chat --web         # Multi-project browser workspace on :8081

Once your first chat connects, set up the three project foundations that pay off on every future turn:

  1. Initialize project configuration: Run kompile configure init (or /setup inside chat) so project-scoped settings live in .kompile/.
  2. Build the local code index: Run kompile code-index (or prompt the agent to call local_code_index action=index). This lets the agent jump straight to symbols and semantic matches via code_search / code_graph instead of burning tokens scanning directories.
  3. Seed AGENTS.md: Ask the agent itself to inspect your build system, test commands, and layout and draft a concise AGENTS.md at the repo root:

    "Inspect this repository's build tool, test commands, module layout, and coding conventions, then draft a concise AGENTS.md for future sessions."

  4. Check your baseline: Run kompile explain (or /explain inside chat) to verify active providers, LSP servers, subagent defaults, and installed harnesses in one zero-secret snapshot.

Stage 2: Work normally & observe quota and behavior ​

Use the agent on real bugs, features, and refactors for a few sessions — and check how it actually behaves under your subscription or API budget:

text
/usage                     # Live vendor quota meters (Claude, Codex, agy, OpenCode Go, OpenRouter)
/cost                      # Current session tokens, cache hit rate, and dollar estimate
/dashboard-summary         # High-level overview of turns, tools, judge verdicts, and spend
/dashboard-tokens          # Token distribution across main thread vs. subagents
/dashboard-tools           # Which tools are called most (spot noisy loops or oversized reads)
/subagent-breakdown        # List recent subagents; /subagent-breakdown <id|latest> shows exact token sources

(In the browser, open the /insights tab for cross-session reports and headless /cost queries; from the shell, run kompile usage cost or kompile stats --last=7d.)

What to look for while observing ​

  • Prompt-cache hit rate: Healthy coding loops reuse the prefix cache heavily; repeated full-file shell dumps or unstable prompts break caching and inflate burn.
  • Tool discipline: Confirm the agent is reading targeted line ranges (read/read_batch, grep_batch, lsp) and running builds via build — Kompile's Enforcer catches and redirects raw shell substitutes automatically.
  • Quota velocity: Watch /usage during heavy refactors. If a single parallel fan-out eats a large chunk of your 5-hour/weekly quota, it is time to separate lead vs. worker models (Stage 4).

Stage 3: Teach the agent permanently (Skills, Scripts, Roles, Memory & Drafts) ​

Whenever you notice yourself giving the same multi-step instructions twice — or correcting the same mistake — prompt the agent directly to turn that knowledge into permanent Kompile assets.

1. Prompt the agent to create reusable skills (skill_manager) ​

Instead of re-typing release checklists, PR review rubrics, or debugging playbooks, ask the agent to create a skill:

"Use skill_manager (create_skill, project_scope=true) to create a /release-check skill that runs our unit tests with build, checks lsp action=check on modified files, verifies version bumps, and posts a progress report."

That writes .kompile/skills/release-check.md (or a full package .kompile/skills/release-check/SKILL.md with supporting reference docs when layout="package"). In every future session, typing /release-check expands the exact procedure. See the dedicated Skills & Skill Manager guide.

2. Register repeatable scripts (script_manager) ​

Kompile's script enforcer blocks ad-hoc python3 -c / node -e one-liners so automation stays reviewable and repeatable. When an agent writes a useful verification or parsing script, prompt it:

"Register that checker with script_manager (create_script, project_scope=true, cache_results=true) so future sessions run it via the script tool and reuse cached green runs when inputs haven't changed."

3. Define specialized worker roles (role_manager) ​

For recurring delegation patterns (codebase explorer, security auditor, test writer, doc updater), prompt the agent to save a named role:

"Use role_manager to create a read-only security-auditor role with read, grep, glob, code_search, and lsp tools so subagent audits can never edit files."

4. Persist standing facts & guardrails (memory & Enforcer) ​

  • Durable project & feedback lessons: Tell the agent "Remember this in memory" whenever you correct a subtle convention, environment gotcha, or architecture rule — Kompile auto-injects relevant memories as <memory_context> on future turns (Persistent Memory).
  • Hard mechanical rules: Promote critical invariants into Enforcer rules (kompile configure enforcer) when you want deterministic pre-tool enforcement.

5. Stage speculative or reviewable edits with draft ​

When you want an agent (or read-and-draft subagents) to prepare changes while waiting on a build window — or let you review a diff before touching your working tree — ask it to work in a draft instead of editing live files:

"Stage this refactor as a Kompile draft first so I can inspect draft action=show and verify it before applying."

Every draft is stored as a JGit commit in .kompile/drafts.git, attributed to the exact session, agent, and model, and applied atomically only if files haven't drifted or been locked. See the dedicated Draft Workflow guide.


Stage 4: Use your cost data to control subagents & failover ​

Once you have a few sessions of real /cost, /usage, and /subagent-breakdown numbers, lock down who runs what so parallel subagents stay fast and economical:

text
# 1. Ban expensive frontier models from ever being dispatched as subagents
/subagent-config ban *opus*
/subagent-config ban *fable*
/subagent-config ban *astra*
/subagent-config ban *neon*

# 2. Pin fast, economical worker defaults (explicit credential name — never borrowed silently)
/subagent-config route openai/gpt-5.6-luna auth=oauth credential=default
/subagent-config role-route explorer fireworks/<fast-open-weight-model>

# 3. Cap concurrency, token spend, and dollar spend per subagent
/subagent-config per-session 4
/subagent-config budget 500000
/subagent-config cost-budget 2.00
/subagent-config preload-tools read,grep,glob,edit,write,bash

Everything persists in ~/.kompile/config/subagent-config.json. Once configured:

  • resolve_model automatically omits banned models before any agent launches task, multi_task, or quorum_task.
  • SubagentAdmission refuses dispatches that violate your bans or concurrency caps.
  • Resumed durable children (subagent_resume) keep their cumulative spend totals — only you can grant a fresh budget via /subagent-config refresh <subagent-id>.

Switch vendors mid-conversation or add failover ladders ​

You can switch vendors, credentials, or models live at any point in a session with /auth (/provider) — or /model <vendor>:<model> in the Web Harness — while keeping your transcript and owned background tasks intact. To automate quota handoffs before hitting a limit, configure backup rungs so a quota wall switches smoothly at a replay-safe request boundary:

text
/auth                         # Switch vendor, auth route, credential, and model live mid-chat
/model failover               # Main chat failover ladder (SessionModelLadder)
/subagent-config failover     # Independent subagent failover ladder

(In the Web Harness, both ladders have visual draft editors in /settings.)


Stage 5: Scale up to multi-model workflows & quality gates ​

With skills, roles, and cost-capped subagents in place, you can run structured multi-agent sessions confidently:

  • Multi-model teams (/workflow): Pair a frontier lead (e.g., Opus / Astra / Sol / Neon) with economical parallel multi_task workers (Luna, Sonnet, Haiku, Hydrogen, Fireworks, Together) and an independent cross-family reviewer via quorum_task or The Judge.
  • Live steering & reactive monitors: Press Ctrl+B to background long subagents, press Enter while busy to queue follow-up thoughts, and inspect every worker's mandatory summary via /progress-reports-subagents. For long builds, CI watches, or blocked file locks, let agents rely on Kompile's event-driven Monitors & Reactive Wake-Ups (process completion monitors, process_notify, edit_coordinator monitor_edit paired with draft, and wait_for_activity) rather than polling — inspect or cancel wake-ups anytime with /process-monitors, /resource-monitor, or the Web Harness /processes (Cancel wake-up) view.
  • Track test health over time: Run /test-milestones to watch pass/fail history across sessions and catch regressions immediately — see Automatic Test Milestone Recording.

Stage 6: Maintain, resume & share across machines ​

  • Keep long sessions clean: Tune /auto-compact so multi-hour threads summarize gracefully before hitting context ceilings.
  • Reclaim disk space periodically: Run /gc (dry-run report first, then /gc run --yes) or audit visually in the Web Harness /storage tab.
  • Pick up effortlessly: Use kompile chat --continue, kompile resume, or kompile resume-all after terminal crashes or reboots — or hand off sessions across vendors (Import, Resume & Vendor Switching).
  • Compound across machines: Push your curated skills, roles, memories, and portable configs to a team blob store or another workstation via Peers & Sources (kompile sources push / kompile peer sync) so every machine benefits from everything you have taught your agents.

Released under the Apache-2.0 License.