agentleFS
kivo360kivo360/OmoiOS/.claude/skills/litho-budgeted-analysis/SKILL.md

litho-budgeted-analysis

Skill79 starsChanged 10 months agoApache-2.0View on GitHub

Profile a repository, inspect existing Litho/deepwiki-rs cache state, generate a repo-local Litho config that preserves the user's current global model/provider, and run deepwiki-rs within a target time budget. Use when Claude needs to analyze a repo quickly with Litho, auto-tune exclusions and boundary settings by repo size, reuse cache intelligently, or create a filtered local copy for very large repos.

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 13 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a fast, repo-local Litho run plan without changing the user's global model choice.

    line 8
  2. Distinctive:

    Prefer a direct run.

    line 16
  3. Distinctive:

    Use filtered-copy mode only when the repo is too large for the time budget.

    line 17
  4. Distinctive:

    If you want the simplest possible local test, run exactly one file:

    line 23
  5. Distinctive:

    If you want a detached background run instead:

    line 35
  6. Distinctive:

    only tunes safe runtime knobs like exclusions, boundary settings, chunking, and concurrency

    line 75
  7. Distinctive:

    does not overwrite the global config

    line 76
  8. Distinctive:

    If automatic global-config detection is wrong or unavailable, pass it explicitly:

    line 78
  9. Very specific:

    Use --dry-run first when you want to inspect the generated plan:

    line 101
  10. Very specific:

    Use --detach when you want the command to return immediately and monitor progress separately:

    line 107
  11. Distinctive:

    Always prefer the wrapper in this skill:

    line 117
  12. Very specific:

    if the current repo's .venv is broken, falls back automatically to uv run --python "$(which python3)" ...

    line 125
  13. Distinctive:

    start / last output / finish timestamps

    line 139
  14. Very specific:

    Never change provider, model_efficient, or model_powerful away from the user's current settings.

    line 145
  15. Distinctive:

    Prefer direct runs with pruning before filtered-copy mode.

    line 146
  16. Very specific:

    Treat filtered-copy mode as a last resort for very-large repos or when the estimated runtime exceeds the budget.

    line 147
  17. Distinctive:

    Do not auto-delete cache. Reuse it when fresh.

    line 148
  18. Distinctive:

    Keep root configs, source files, migrations, schemas, and key architecture docs in filtered-copy mode.

    line 149
  19. Very specific:

    Read references/heuristics.md when you need the exact repo-class thresholds, cache freshness logic, or filtered-copy inclusion rules.

    line 153

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Litho Budgeted Analysis

Create a fast, repo-local Litho run plan without changing the user's global model choice.

Workflow

  1. Profile the repo.
  2. Detect the effective global Litho config path if possible.
  3. Inspect .litho/cache freshness.
  4. Generate litho.local.toml in the target repo.
  5. Prefer a direct run.
  6. Use filtered-copy mode only when the repo is too large for the time budget.

Scripts

0. Use the one-file local launcher

If you want the simplest possible local test, run exactly one file:

bash scripts/run_local_litho.sh /path/to/repo 15

That script:

  • runs the full budgeted Litho workflow for the target repo
  • streams progress in the current terminal
  • writes .litho/run.log
  • writes .litho/run-status.json

If you want a detached background run instead:

bash scripts/run_local_litho.sh /path/to/repo 15 --detach

Then watch progress with:

bash scripts/watch_litho_progress.sh /path/to/repo

1. Profile the repo

Run:

bash scripts/uv_run.sh scripts/profile_repo.py --repo-path /path/to/repo

This returns JSON including:

  • tracked file count
  • source-like file count
  • total/source-like bytes
  • largest directories
  • cache presence/freshness
  • detected global Litho config path
  • repo class (small, medium, large, very-large)

2. Generate the local config

Run:

bash scripts/uv_run.sh scripts/generate_litho_config.py --repo-path /path/to/repo

Behavior:

  • writes /path/to/repo/litho.local.toml
  • preserves the user's existing provider/model settings
  • only tunes safe runtime knobs like exclusions, boundary settings, chunking, and concurrency
  • does not overwrite the global config

If automatic global-config detection is wrong or unavailable, pass it explicitly:

bash scripts/uv_run.sh scripts/generate_litho_config.py --repo-path /path/to/repo --global-config /path/to/global/litho.toml

3. Run Litho with a time budget

Run:

bash scripts/uv_run.sh scripts/run_litho_analysis.py --repo-path /path/to/repo --time-budget-minutes 15

Behavior:

  • profiles first
  • generates/refreshes litho.local.toml
  • chooses direct vs filtered-copy mode
  • chooses cache-aware flags (--skip-preprocessing when safe)
  • executes through zsh -ic with alias-safe handling
  • writes .litho/run.log and .litho/run-status.json in the target repo
  • updates status with phase, command, PID, timestamps, and exit code

Use --dry-run first when you want to inspect the generated plan:

bash scripts/uv_run.sh scripts/run_litho_analysis.py --repo-path /path/to/repo --time-budget-minutes 15 --dry-run

Use --detach when you want the command to return immediately and monitor progress separately:

bash scripts/uv_run.sh scripts/run_litho_analysis.py --repo-path /path/to/repo --time-budget-minutes 15 --detach
tail -f /path/to/repo/.litho/run.log
cat /path/to/repo/.litho/run-status.json

4. Run through the uv fallback wrapper

Always prefer the wrapper in this skill:

bash scripts/uv_run.sh scripts/profile_repo.py --repo-path /path/to/repo

Behavior:

  • uses uv run with the PEP 723 script metadata
  • if the current repo's .venv is broken, falls back automatically to uv run --python "$(which python3)" ...
  • keeps the logic self-contained inside this skill directory

5. Watch progress explicitly

Run:

bash scripts/watch_litho_progress.sh /path/to/repo

It prints:

  • current phase
  • PID
  • start / last output / finish timestamps
  • current exit code if finished
  • tail of .litho/run.log

Rules

  • Never change provider, model_efficient, or model_powerful away from the user's current settings.
  • Prefer direct runs with pruning before filtered-copy mode.
  • Treat filtered-copy mode as a last resort for very-large repos or when the estimated runtime exceeds the budget.
  • Do not auto-delete cache. Reuse it when fresh; ignore it when stale.
  • Keep root configs, source files, migrations, schemas, and key architecture docs in filtered-copy mode.

Heuristic Reference

Read references/heuristics.md when you need the exact repo-class thresholds, cache freshness logic, or filtered-copy inclusion rules.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.