Repo Analysis and Improvement Suggestions | Generated by AI
Now I have a thorough picture of the codebase. Here’s my analysis:
Analysis of ww repo
What exists:
- 90+ command modules in a flat
main.pydispatcher (~1573 lines) - Pre-commit: trailing whitespace, ruff, pyright, bandit, detect-secrets, pytest
- CI: 3 workflows (lint, unit test, integration test)
- SQLite command logging (
ww/db.py) - Tests in
tests/(unittest-style, run via pytest in pre-commit) - Integration tests dir exists but is a placeholder (
test_placeholder.py) - ~20+ unwired modules (ml, agent, trading, social, crawler, bot, etc.)
Current issues spotted:
- CI uses
unittest discover, pre-commit usespytest— inconsistent - CI doesn’t run detect-secrets (only in pre-commit)
- Integration test workflow triggers on
integration_tests/**but there’s only a placeholder - No dependency caching in CI (setup-uv but no cache)
- Ruff version
v0.9.10in pre-commit but0.14.13in.ruff_cache— stale
Suggestions for what to add
High impact, low effort
-
Unify CI to use pytest — Change unit_test.yml from
unittest discovertouv run pytest tests/ -x -q. This matches pre-commit and gives consistent behavior. -
Add
detect-secretsto CI — Currently only in pre-commit. If someone bypasses pre-commit (--no-verify), secrets can slip through. Add a step in lint.yml. -
Add dependency caching to CI —
astral-sh/setup-uvsupports caching. Addenable-cache: trueto speed up workflows. -
Add Dependabot or Renovate — Auto-update deps in
pyproject.tomland pre-commit hook revs. Currently everything is manual. -
Delete the integration test placeholder or replace it with real tests. The workflow exists, triggers, and does nothing useful — just noise.
Medium impact
-
Add
ww doctor— A self-diagnostic command that checks: Python version, .env keys present, proxy reachable, OpenRouter API responding, disk space, GPU available. You already have_check_proxy()and env loading — just compose them. -
Add
ww openrouter cost— Your activity command shows spend, but a quick “how much did I spend today/this week” one-liner would be useful given you consume ~1.5B tokens/year. The data is already inget_activity(). -
Add
ww db export— Export command history to CSV/JSON for analysis. The SQLite DB already tracks everything. -
Wire up
ww/agent/modules — You havecode_agent,fix_agent,refactor_agent,optimize_agent,merge_agentetc. sitting unwired. These are high-value for your AI-first workflow. -
Add
ww llm cost— Per-model cost breakdown from OpenRouter, similar toopenrouter activitybut focused on cost optimization (cheapest model for task type, waste detection). -
Add
ww db autocomplete— Command suggestion based on history frequency. You already havedb top— extend it to feed zsh completion.
Nice to have
-
Add ruff rules
I(isort) andUP(pyupgrade) — You’re already using ruff-format, adding import sorting and pyupgrade is free. -
Add
coverageto CI with--fail-under— Already there at 60%, but add a coverage upload step (Codecov or Coveralls) for PR comments. -
Add
pre-commit autoupdateto a monthly cron — Keeps hook revs fresh. -
Add
ww openrouter budget— Set a monthly budget, alert when approaching. The management API has limit info already. -
Add
ww git blame-ai— LLM-poweredgit blamethat explains why a change was made, not just who. Feed the commit message + diff to OpenRouter.
What I’d prioritize first
Given your trajectory toward AI engineering and the fact that you’re the primary user:
ww doctor— saves debugging time when things breakww git blame-ai— differentiator, leverages your LLM infrastructure- Unify CI pytest — 5 min fix, prevents confusion
- Wire
ww/agent/modules — you already built them, just expose them - Dependabot — set and forget, keeps deps fresh
Want me to implement any of these?