Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<a href="#limits">Limits</a>
</p>

One commit gate and two skill files for coding agents.
One commit gate and three skill files for coding agents.

The gate is the part that cannot be ignored: it rejects a commit or a pull request whose message does not carry the five-key slice report. The skills describe how to produce one.

Expand Down Expand Up @@ -60,6 +60,7 @@ npm run gate:check -- pr-body.md
| --- | --- | --- |
| **`steerloop`** | Interaction gates: when to stop, what a slice is, what the report contains | Every coding task, at the start |
| **`craftloop`** | Engineering depth: spec, architecture, security, verification, git and PR delivery | Substantial work |
| **`webperf`** | Web performance: symptom to one fix with the instrument that proves it | A slow page, or a change touching loading, bundles, images, queries |

`craftloop` is vendored here with two sentences changed: an unanswered gate counts as a blocker, and a value the request does not state is the user's decision rather than a default to invent.

Expand Down Expand Up @@ -135,6 +136,8 @@ The per-cell checks behind both tables are committed: [`evals/results/2026-11-04
skills/steerloop/SKILL.md the contract
skills/craftloop/SKILL.md the method
skills/craftloop/references/ security rules, loaded on demand
skills/webperf/SKILL.md web performance router
skills/webperf/references/ 31 recipes, one per symptom
gate/steerloop-gate.mjs the report validator
gate/steerloop-gate.test.mjs 26 tests, run by npm test
.githooks/commit-msg hook that calls the validator
Expand Down
6 changes: 3 additions & 3 deletions assets/readme/build_hero.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def hero() -> None:
canvas.paste(panel, (500, 16), panel)

d = ImageDraw.Draw(canvas)
d.text((72, 104), "AGENT SKILLS · TWO FILES", font=font("consola.ttf", 17), fill=MUTED)
d.text((72, 104), "AGENT SKILLS · THREE FILES", font=font("consola.ttf", 17), fill=MUTED)
d.text((72, 146), "steerloop", font=font("segoeuib.ttf", 92), fill=FG)
d.text((74, 262), "One slice at a time. The agent asks", font=font("segoeui.ttf", 25), fill=(201, 205, 210))
d.text((74, 296), "before it writes code.", font=font("segoeui.ttf", 25), fill=(201, 205, 210))
Expand All @@ -55,7 +55,7 @@ def hero() -> None:
d.text((90, 362), cmd, font=cf, fill=ACCENT)

d.line([(72, 420), (72 + tw + 36, 420)], fill=(58, 58, 58))
d.text((72, 430), "skills/steerloop · skills/craftloop · MIT", font=font("consola.ttf", 14), fill=DIM)
d.text((72, 430), "skills/steerloop · skills/craftloop · skills/webperf · MIT", font=font("consola.ttf", 14), fill=DIM)
canvas.save(HERE / "hero.png", optimize=True)


Expand All @@ -65,7 +65,7 @@ def social() -> None:
panel = art_panel((700, 590), (200, 120, 1480, 940))
canvas.paste(panel, (500, 20), panel)
d = ImageDraw.Draw(canvas)
d.text((72, 96), "AGENT SKILLS · PAIR", font=font("consola.ttf", 18), fill=MUTED)
d.text((72, 96), "AGENT SKILLS · THREE", font=font("consola.ttf", 18), fill=MUTED)
d.text((70, 140), "steerloop", font=font("segoeuib.ttf", 96), fill=FG)
d.text((74, 262), "One slice at a time.", font=font("segoeui.ttf", 28), fill=(201, 205, 210))
d.text((74, 300), "The agent asks before", font=font("segoeui.ttf", 28), fill=(201, 205, 210))
Expand Down
Binary file modified assets/readme/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/readme/social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions skills/webperf/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: webperf
description: "Use when a website is slow, or when a change touches loading, rendering, images, fonts, bundles, long lists, network requests, caching, or database queries. Routes one symptom to one fix and one way to verify it."
---

# Web performance

Find the symptom, apply one fix, verify it with the instrument that found it.

One topic per slice. If the fix does not apply to this stack, say so and change nothing.

## Start from a measurement

A performance change without a before number is a guess. Take the number first:
Lighthouse on a throttled profile, the Network panel, `EXPLAIN`, or the server log.
Repeat the same measurement after the fix and report both.

## Route by symptom

| Symptom | Fix | Verify with |
| --- | --- | --- |
| Blank screen while data loads | Skeleton shaped like the real content; errors rendered apart | Throttled network: shape appears, not a spinner |
| Heavy images | WebP/AVIF with the original as fallback, explicit width and height | Network: modern type, no layout shift |
| Images below the fold | `loading="lazy"` for those only | First paint loads fewer requests |
| External fonts | Self-host woff2, only used weights, `font-display` | Network: fonts from own origin |
| Large JS bundle | Split by route, dynamic import for editors, maps, charts | Build report before and after |
| Third-party scripts | `defer`/`async`, load after first interaction | Page interactive without them |
| Slow first content | Server render or static generation for public pages | View source contains the text |
| Long lists | Virtualize; keep scroll, search and focus | DOM holds only visible rows |
| Duplicate API calls | One call per screen, or a query cache | Network: no identical requests in a row |
| Request per keystroke | Debounce, cancel the previous request, one constant for the delay | Type fast: one request |
| Unbounded lists from the API | Page or cursor plus a limit, a "has more" flag | One page per request |
| Sequential independent calls | Run them in parallel, keep dependent ones ordered | Network: requests start together |
| Text responses uncompressed | Brotli with Gzip as fallback; skip already-compressed types | `content-encoding` header |
| Static files without cache policy | Long `immutable` cache for hashed names, short for HTML | Second load served from cache |
| Static files from the app server | CDN prefix in one setting | Network: CDN origin |
| Query inside a loop (N+1) | Join or eager loading | Query count does not grow with the list |
| Full table scans | Index for the frequent `WHERE`/`JOIN`/`ORDER BY`, migration | `EXPLAIN` uses the index |
| Whole rows where two fields are needed | Select the columns | Query log names them |
| Connection per request | Pool with a maximum and a wait timeout | Open connections stay bounded |
| External calls without a timeout | Timeout plus bounded retries, defined user-facing error | Point at a slow host: it aborts |
| Slow work inside the request | Background job, immediate "accepted" with a status | Request returns at once, result arrives |
| UI waiting on the server | Optimistic update with rollback; never for payments | Click is instant, error reverts |
| Repeated reads of static data | Cache with a named key and a TTL, invalidate on write | Second read misses the database |
| No visibility | OpenTelemetry traces, Core Web Vitals from real users | Slow request visible in the trace |

## Do not

- Add memoization everywhere. Only where a profile shows the rerender.
- Change infrastructure, regions, replicas, or a paid service without asking first.
- Ship a perf change without the before and after number.

## Full recipes

[`references/prompts.md`](references/prompts.md) holds 31 recipes, one per topic above, kept in Russian. Read the numbered section that matches the symptom: the wording is more specific than this table, and each recipe ends with its own check.

Take one recipe per slice. Run its check. If the recipe does not fit this stack, say so and change nothing.
Loading
Loading