pizza-self-optimization
БесплатноБез исполняемых скриптовНе проверенSelf-improvement loop for Pizza itself. Use when the user hits a bug, crash, regression, or limitation in Pizza, or asks to improve or optimize Pizza: mine…
от pizza-agent★ 55 звёзд на GitHubОб этом скилле
Pizza Self-Optimization
Turn a problem the user just experienced in Pizza into a merged-quality pull
request against pizza-agent/pizza, using Pizza's own event logs as the evidence
base. Work autonomously, but keep every action auditable and reversible.
0. Preconditions (check once, fail fast)
gh --versionandgh auth statusmust succeed. If not authenticated, ask the user to rungh auth loginand stop — never handle tokens yourself.- Git identity must exist (
git config user.name/user.email); set a local identity in the clone if missing. - Upstream repo:
https://github.com/pizza-agent/pizza(do NOT push to it — PRs come from the user's fork only).
1. Frame the problem
- Restate in one sentence: what happened, where (TUI / desktop / web / RPC / CLI), and whether it is a bug fix or an optimization.
- If the user only reports a vague symptom ("it feels slow", "the menu is weird"), decide what measurable signal would confirm it before touching code.
2. Collect evidence from the local Pizza state
Pizza records everything it does; use it instead of guessing.
- Version:
pizza --version(compare against the repo'spackage.json). - Event log (primary evidence):
~/.pizza/agent/workspaces/<ws_id>/events.sqlite- Find the workspace for the affected project by matching
cwdin~/.pizza/agent/workspaces/*/meta.json. - Schema: table
events(sequence, event_id, workspace_id, runtime_id, actor_id, timestamp, type, payload_json, caused_by, correlation_id, thread_id); sessions/threads index tables sit alongside. - Read-only queries while Pizza is running are safe; if the db is locked or a
-walfile is present, copyevents.sqlite*to a temp dir first and query the copy. - Useful starting points: recent errors (
type like '%ERROR%'), the failing session's events (thread_id), tool-call payloads around the failure. sqlite3CLI may be missing — fall back tonode -ewithnode:sqlite(DatabaseSync), orpython3 -c "import sqlite3...".
- Find the workspace for the affected project by matching
- Debug log:
tail -n 500 ~/.pizza/agent/pizza-debug.logfor stack traces.
Write down: the exact event sequence that shows the problem, and the smallest excerpt (event type + payload fields) that will go into the PR description.
3. Fork, clone, branch
- Persistent working dir (keep between runs so forks stay warm):
~/.pizza-self-optimization/pizza - First run:
gh repo fork pizza-agent/pizza --clone(into that dir). - Later runs:
git fetch upstream main && git checkout main && git reset --hard upstream/mainto rebase onto fresh code. - Branch naming:
fix/<short-slug>oropt/<short-slug>— one issue per branch.
4. Reproduce and diagnose
- Map the evidence to code: event types live in
src/core/event-store/, RPC surface inpackages/rpc/+packages/protocol/, TUI inpackages/tui/, desktop shell inapps/desktop/, web UI inapps/web/, CLI insrc/cli.tsandsrc/main.ts. - Reproduce with the actual payload from the event log where possible (e.g. replay the exact command or RPC message that failed).
- Write the failing test FIRST (vitest,
test/mirroring the source path). A fix without a regression test is not done.
5. Implement
- Minimal, surgical diff. No drive-by refactors, no reformatting untouched code. Match local style (tabs, comment conventions).
- For optimizations: measure before/after (timing, event-log deltas) and put the numbers in the PR.
- Do not modify the user's installed Pizza or their
~/.pizzaconfig — the fix lives in the clone until the user chooses to rebuild/reinstall.
6. Verify
npm test(offline mode is the default) — full suite must be green.- Targeted:
PIZZA_OFFLINE=1 npx vitest --run test/<file>.test.ts. - Web UI changes:
cd apps/web && npm run build. - Core changes:
npm run buildmust succeed.
7. Commit and open the PR
- Conventional commits with a scope, matching
git log(e.g.fix(rpc): ...,feat(skills): ...,fix(ui): ...). One logical commit is usually enough; never mix unrelated changes. git push -u origin HEAD(origin = the fork), then:gh pr create --repo pizza-agent/pizza --base main- PR body sections: Problem (user-visible symptom + event-log excerpt), Root cause, Fix, Verification (test names/output), Notes.
- Report the PR URL to the user at the end.
Guardrails
- One issue per PR; if the log reveals several unrelated problems, open separate branches/PRs (or GitHub issues with evidence) and say so.
- If the root cause is uncertain or the fix would be architectural, STOP after
step 2/4: file
gh issue create --repo pizza-agent/pizzawith the evidence and your analysis, and summarize options for the user instead of guessing. - Never commit secrets, tokens, or absolute paths from the user's machine.
- Never force-push or commit to
main; never push anywhere except the fork. - Ask the user before opening PRs that
Установить pizza-self-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pizza-self-optimization?
Self-improvement loop for Pizza itself. Use when the user hits a bug, crash, regression, or limitation in Pizza, or asks to improve or optimize Pizza: mine the local event logs for evidence, fork and clone the Pizza GitHub repo, reproduce and fix or optimize the code with tests, and open a pull request to pizza-agent/pizza.
Как установить скилл pizza-self-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pizza-self-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic