architect
Deep reasoning agent. Architecture decisions, security reviews, complex
Tally session token cost vs milestone budget. Warn when a phase is on track to exceed allocation.
$ npx -y skills add FerroxLabs/ijfw --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Tally session token cost vs milestone budget. Warn when a phase is on track to exceed allocation.
name: ijfw-llm-budget-watcher description: "Tally session token cost vs milestone budget. Warn when a phase is on track to exceed allocation." model: sonnet allowed-tools: Read, Bash since: '1.5.0'
Read `.ijfw/metrics/sessions.jsonl` + `.ijfw/observations.jsonl`, compute cumulative cost for the current phase, project trajectory to phase end, warn if budget will be exceeded. v1.4.4 ship-day pressure came partly from not knowing the phase was burning hotter than expected until late.
Token-economy gauge. The metrics tools exist (`mcp-server/src/metrics.js`, `mcp-server/src/cost/aggregator.js`) but they're consumed by the dashboard, not by the workflow agent. This wraps them in a phase-budget contract so the orchestrator gets a budget warning the moment trajectory exceeds allocation, not at retrospective.
1. **Read phase budget** -- look for `.planning/<phase>/BUDGET.md` (single YAML frontmatter key: `usd_cap`). If absent, fall back to a per-phase default of `$50` (configurable input).
2. **Read sessions ledger** -- parse `.ijfw/metrics/sessions.jsonl`. Filter entries to the current phase window:
3. **Aggregate cost** via `mcp-server/src/cost/aggregator.js::buildCostReport` (existing function; pass filtered observations).
4. **Project trajectory**:
line, OR `phase_days` input parameter, OR 7 days default.
5. **Classify**:
6. **Write `.planning/<phase>/LLM-BUDGET.md`**:
# LLM Budget -- <phase> ## Allocation - cap: $<usd_cap> - estimated_finish: <N> dev days ## Current burn - elapsed: <N> days - cumulative_cost: $<X> - burn_rate: $<X>/day ## Trajectory - projected_total: $<X> - headroom: <+/-$X> - verdict: OK | WARN | OVER_BUDGET ## Top-cost sessions (last 5) | session_id | cost | duration_min | tokens | |---|---|---|---|
7. **Exit signal**: emit gate-result.
Standard `gate-result` schema.
severity: HIGH | MEDIUM | PASS
findings:
- kind: OVER_BUDGET | WARN | OK
cap_usd: <number>
projected_usd: <number>
elapsed_days: <number>
burn_rate_usd_per_day: <number>
top_session_id: <string>re-implement cost math; the dashboard and this agent must agree.
(epoch seconds) -- robust across local-tz changes.
the proof telemetry is wired.
is per-phase, not lifetime.
always-runnable; a missing file means "use default", not "fail".
IJFW — It Just F*cking Works. Ferrox Labs' local-first infrastructure for AI coding agents: shared memory, smart routing, multi-AI cross-audits, disciplined workflow.
Repo: FerroxLabs/ijfw
Deep reasoning agent. Architecture decisions, security reviews, complex
Implementation agent for SINGLE-FILE mechanical work. Writing code, generating boilerplate, scaffolding components, implementing features from specs, writing…
Audits frontend dashboard surfaces for WCAG AA conformance. Trigger after any dashboard UI change.
Design-phase WCAG 2.1 AA review of UI artefacts: contrast, semantics, focus, ARIA. Trigger per design review pass.
Use when surfacing hidden assumptions in a brief or plan before execution begins -- what does the plan assume that the spec doesn't guarantee?
Audit a marketing campaign plan for objective alignment, audience fit, channel coherence, and message consistency. Trigger before each campaign-execution wave.