{
  "markdown": "# sindri\n\nA Claude Code plugin for bounded, target-driven optimization loops.\n\n> In the myth, Sindri is the dwarf smith who forged Mjölnir by iterating under adversity — each hammer-strike tested, kept only if it survived. This plugin is the same pattern: make a change, benchmark it, keep it **only if an independent re-measurement confirms it's better**, revert otherwise, repeat until the target is hit or the pool of ideas is exhausted.\n\nInspired by [karpathy/autoresearch](https://github.com/karpathy/autoresearch) and [davebcn87/pi-autoresearch](https://github.com/davebcn87/pi-autoresearch), adapted to Claude Code.\n\n**One commit per kept experiment. Git is the audit log. The forge runs one way.**\n\n## Install\n\n```text\n/plugin install sindri@claude-community\n/reload-plugins            # or relaunch Claude Code; commands are then live\n```\n\nThen, in any repo you want to optimize:\n\n```text\n/sindri:forge reduce bundle_bytes by 15%\n```\n\nThat's it. No `pip install`, no virtualenv. The Python backend (`sindri-forge`)\nis fetched on demand by [`uv`](https://docs.astral.sh/uv/). If `uv` isn't\ninstalled, `/sindri:forge` prints a one-line install command and stops.\n\n> Sindri is published in the Anthropic community marketplace\n> (`anthropics/claude-plugins-community`). If you haven't added it yet:\n> `/plugin marketplace add anthropics/claude-plugins-community`.\n\nRequirements:\n\n- [`uv`](https://docs.astral.sh/uv/getting-started/installation/) — runs the backend in an isolated environment\n- `git` ≥ 2.30\n- `gh` CLI (authenticated) — needed only for `sindri-finalize` PR creation\n- Claude Code with `Task` + `ScheduleWakeup` tools\n\n**First-run dogfood:** walk through [`docs/DOGFOOD.md`](docs/DOGFOOD.md) on a throwaway repo before pointing sindri at real code — it verifies every skill path and catches environment gaps before you commit an overnight run.\n\n## Quickstart\n\n```bash\n# In the repo you want to optimize:\n/sindri:forge reduce bundle_bytes by 15%\n```\n\nSindri will:\n\n1. Scaffold `.claude/scripts/sindri/benchmark.py` if missing (interactive; asks you to describe the measurement in natural language).\n2. Scan your repo and draft a pool of 10–30 candidates.\n3. Ask you to approve / edit the pool.\n4. Check out a new branch `sindri/reduce-bundle-bytes-15pct` and run the baseline 3×.\n5. Loop autonomously — one experiment per wakeup, ~60s between them.\n6. When the target hits (or the pool drains with ≥1 win), push the branch and open a PR.\n\nCheck in anytime with `/sindri:status`. Halt with `/sindri:stop`. Abandon with `/sindri:clear`.\n\n## Commands\n\nType `/sindri:` in Claude Code and every action is right there in the autocomplete menu — eight\ndiscrete, self-describing commands (no router, no guessing which sub-verb exists):\n\n```text\n> /sindri:\n  /sindri:forge     <goal statement>   Start a new optimization run from a goal — bounded,\n                                        target-driven experiments on any deterministic metric.\n  /sindri:status                       Print the status of the current run (or report none active).\n  /sindri:stop                         Signal the current run to halt at its next wakeup.\n  /sindri:clear                        Abandon the current run — destructive; deletes state + branch.\n  /sindri:setup                        Scaffold or repair the benchmark script for a run.\n  /sindri:help                         Show the command list and a one-line overview of each.\n  /sindri:loop                         ADVANCED. Run one orchestrator tick manually, no reschedule.\n  /sindri:finalize                     ADVANCED. Force a push + PR from the run's kept commits.\n```\n\n`forge`, `status`, `stop`, `clear`, `setup`, and `help` cover the normal lifecycle. `loop` and\n`finalize` are advanced/debug paths — the orchestrator runs them automatically during a live run.\n\n## Architecture\n\n- **Python core** (`src/sindri/`) — pure functions: statistics, state file I/O, git wrappers, pool ordering, termination predicates, PR body rendering.\n- **Skills** (`skills/sindri-*/SKILL.md`) — prose prompts for the decisions that need Claude's inference: scaffolding a benchmark, proposing a candidate pool, orchestrating the loop.\n- **Subagent prompt** (`prompts/experiment-subagent.md`) — the contract every experiment subagent follows. Fresh context per experiment, no context bleed.\n- **Measurement integrity** — a keep is committed on a re-measurement the backend runs *itself* (the trusted, tracked benchmark, in an isolated worktree), never the experiment agent's self-report. The agent proposes a win; vetted code certifies it.\n\nSee [`docs/superpowers/specs/2026-04-19-sindri-design.md`](docs/superpowers/specs/2026-04-19-sindri-design.md) for the full design, and [`docs/security.md`](docs/security.md) for the secret-scanning / leak-prevention setup.\n\n## Development\n\n```bash\nuv pip install -e \".[dev]\"\npytest                                            # all test layers\npytest -m \"not e2e\" -q                            # skip the slow end-to-end loop test\npytest tests/unit/test_plugin_artifacts.py -v     # just artifact validity checks\n./scripts/smoke.sh                                # plumbing smoke in a throwaway repo\n```\n\n### Local plugin install (contributors)\n\n```bash\ngit clone https://github.com/4KMetrics/sindri.git ~/src/sindri\ncd ~/src/sindri && ./scripts/install-plugin.sh   # symlinks the plugin only\n```\n\nTo test local backend edits (instead of the published package), point the\nlauncher at your checkout before running `/sindri:forge`:\n\n```bash\nexport SINDRI_FORGE_SOURCE=\"$(pwd)\"\n```\n\n## License\n\nMIT\n",
  "bytes": 5577,
  "sha": "b8bb686b3a4fa6eef8b0e2dace8bd4b3268e7e00c2e5a95c6afdd1899396b881",
  "repo_slug": "4kmetrics/sindri",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_4kmetrics_sindri_sindri_da6845f6/readme"
}