Skip to content
Agentmart
Submit a tool

layer-autoresearch

Autonomous keep/discard experiment loop (after karpathy/autoresearch) that optimises TDK's L1-L4 Docker layers toward the north star of 100 services on a 16…

Skill by flisk-sh

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/flisk-sh-layer-autoresearch

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Autonomous keep/discard experiment loop (after karpathy/autoresearch) that optimises TDK's L1-L4 Docker layers toward the north star of 100 services on a 16 GB machine. Use when asked to run autoresearch on the Docker layers or to optimise the golden/runtime layers experimentally.

Use cases: devops

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/layer-autoresearch

What's inside

Skill name
layer-autoresearch
Description
Autonomous keep/discard experiment loop (after karpathy/autoresearch) that optimises TDK's L1-L4 Docker layers toward the north star of 100 services on a 16 GB machine. Use when asked to run autoresearch on the Docker layers or to optimise the golden/runtime layers experimentally.
License
MIT
Compatibility
Contributor skill. Requires a flisk checkout, Docker and git. Does not deploy.
Metadata
author: flisk-sh · version: 1.0
Instructions
45 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • files: referenced but missing: scripts/autoresearch/layer-eval.sh, scripts/benchmark/container-scale.ts

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Layer autoresearch

Adapted from karpathy/autoresearch `program.md`. You are an autonomous researcher making the Flisk runtime layers cheaper **without removing features**.

## Setup (with the user, once)

1. Agree a run tag (e.g. `sep25`). Create `git checkout -b autoresearch/<tag>` from `main`. The branch must be new.
2. Warn the user: this workspace has an external tool that auto-commits and pushes working-tree edits. Ask them to pause it for the run, because experiment resets must not reach `origin/main`.
3. Read the in-scope files in full:
   - Editable: `engine/topologies/platform/docker/layers/*.star`, `engine/topologies/platform/docker/layers/prisma/*.star`, `engine/topologies/platform/docker/build/golden_image_dockerfile.star`, `engine/topologies/platform/docker/config/healthcheck.star`.
   - Read-only ground truth: `scripts/autoresearch/layer-eval.sh`, `scripts/benchmark/container-scale.ts`, `tests/tilt-engine/test_runtime_container_footprint.py`, and the spec `openspec/specs/runtime-container-footprint` (or its change under `openspec/changes/`).
4. Check that `../flisk-erp-system` exists with built images (`docker images | grep finance_`). If not, ask the human to run `flisk up` there once.
5. Create an untracked `autoresearch-results.tsv` with the header `commit	mem_mib	image_mib	status	description`.
6. Confirm with the user, then start.

## Experiment

Run `scripts/autoresearch/layer-eval.sh > run.log 2>&1` (about 5-10 minutes). Read the results with `grep -A20 '^---' run.log`.

- **Primary metric: `mem_per_service_mib`, lower is better.** This is idle memory per real ERP service, and it is what limits 100 services on 16 GB.
- **Tie-breaker:** if memory is within 0.5 MiB of the best, a lower `unique_per_service_mib` or `service_image_mib` wins, then simpler code.
- **Hard constraints.** `status: ok` requires all 20 services healthy, zero crashes, and passing feature tests. Anything else is a discard, or a crash if it didn't run.
- **Never** edit the eval harness, benchmark, tests or spec. Never remove a user-facing feature: Prisma, Infisical entrypoint, hugo-as-feature, healthchecks, signal handling. Don't add dependencies.

Candidate ideas, from real measurements on 2026-09-25:
- Duplicate `node_modules` copy in the L4 backend runtime (4.2 MB twice per service).
- L1 installs `file`, `bash` and `openssl` into every runtime image (30 MB apk layer). Check what actually needs them first.
- Bun runtime memory flags (e.g. `--smol`) in the resolved `CMD`.
- Distroless or slimmer Bun base for L4.
- Per-service unique layer size.

## Loop (never stop until the human interrupts)

1. Note the current commit.
2. Change the editable files with one idea.
3. `git commit -m "<idea>"`.
4. Run the eval, redirected to `run.log` (don't flood context).
5. If there's no `---` block, `tail -n 50 run.log`. Fix trivial mistakes, otherwise log `crash`.
6. Append a row to `autoresearch-results.tsv` (untracked).
7. If the metric improved and `status: ok`, keep the commit. Otherwise `git reset --hard HEAD~1`.
8. An eval that runs longer than 20 minutes counts as a failure.

The first run is always the unmodified baseline.

From flisk-sh/tdk-skills, MIT.

More from flisk-sh/tdk-skills

Signals

Stars
2
Forks
0
Open issues
11
Last commit (this folder)
Oct 21, 2026 (7 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from flisk-sh

Cite this page

layer-autoresearch skill. Agent Mart. https://agentmart.dev/skills/flisk-sh-layer-autoresearch (last updated 2026-10-24)