Skip to content

Commit 6c09a44

Browse files
committed
merge conflicts
2 parents c2c5e74 + 46847e5 commit 6c09a44

252 files changed

Lines changed: 28704 additions & 26097 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: lab-autoresearch
3+
description: Autonomous experiment loop on top of the Transformer Lab `lab` CLI — pick an idea, queue a job, score it, keep or discard, repeat. Use when the user types `/lab-autoresearch`, says "run autoresearch", "optimize X in a loop", "set up autoresearch for …", or asks to run an autonomous experimentation / optimization loop against Transformer Lab.
4+
allowed-tools: Bash(lab *), Bash(curl *lab.cloud*), Bash(curl *localhost:8338*)
5+
---
6+
7+
# /lab-autoresearch
8+
9+
This skill is the entry point for the autonomous experiment loop. The full spec lives in the `transformerlab-cli` skill — this skill exists so that typing `/lab-autoresearch` resolves to a real skill instead of falling through.
10+
11+
## What to do
12+
13+
1. **Read the spec first.** The authoritative workflow, subcommands (`init <goal>`, `run`, `finalize`), experiment-notes template, loop rules (parallelism, fire-and-advance, stale-job sweep, keep/discard policy, run-description discipline), and natural-language → `lab` mapping all live in:
14+
15+
`.claude/skills/transformerlab-cli/references/autoresearch.md`
16+
17+
(or, in the source repo, `.agents/skills/transformerlab-cli/references/autoresearch.md`)
18+
19+
2. **Then use the `transformerlab-cli` skill** for every `lab` command the loop issues. That skill has the command reference, troubleshooting, and the rule that you must use `lab` (not raw `curl`) for normal operations.
20+
21+
## Quick orientation
22+
23+
The loop is layered on the `lab` CLI:
24+
25+
- One **experiment** per session, one **job** per iteration.
26+
- A job's `-m/--description` is the iteration note; its `score` dict (set via `lab.finish(score=…)`) is the result; `lab job discard` is the keep/discard flag.
27+
- For hyperparameter fan-out, prefer the task's `sweeps:` block over manually queuing N jobs.
28+
- The session plan (objective, files in scope, constraints, backlog, what's been tried) is written to **experiment notes** via `lab notes` — there is no local `autoresearch.md` file.
29+
30+
Everything beyond `init` / `run` / `finalize` (status, keep/discard, sweeps, ideas, stopping running jobs, exiting the loop) is just the agent running the right `lab` call in response to natural-language requests — no dedicated subcommand needed.
31+
32+
**Do not improvise the loop without reading `references/autoresearch.md` first.** The rules around parallelism, fire-and-advance, and stale-job sweeps are load-bearing and not derivable from the `lab` CLI alone.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: react-doctor
3+
description: Use when finishing a feature, fixing a bug, before committing React code, or when the user wants to improve code quality or clean up a codebase. Checks for score regression. Covers lint, dead code, accessibility, bundle size, architecture diagnostics.
4+
version: "1.0.0"
5+
---
6+
7+
# React Doctor
8+
9+
Scans React codebases for security, performance, correctness, and architecture issues. Outputs a 0–100 health score.
10+
11+
## After making React code changes:
12+
13+
Run `npx -y react-doctor@latest . --verbose --diff` and check the score did not regress.
14+
15+
If the score dropped, fix the regressions before committing.
16+
17+
## For general cleanup or code improvement:
18+
19+
Run `npx -y react-doctor@latest . --verbose` (without `--diff`) to scan the full codebase. Fix issues by severity — errors first, then warnings.
20+
21+
## Command
22+
23+
```bash
24+
npx -y react-doctor@latest . --verbose --diff
25+
```
26+
27+
| Flag | Purpose |
28+
| ----------- | --------------------------------------------- |
29+
| `.` | Scan current directory |
30+
| `--verbose` | Show affected files and line numbers per rule |
31+
| `--diff` | Only scan changed files vs base branch |
32+
| `--score` | Output only the numeric score |

.agents/skills/transformerlab-cli/SKILL.md

Lines changed: 145 additions & 34 deletions
Large diffs are not rendered by default.

.agents/skills/transformerlab-cli/references/autoresearch.md

Lines changed: 431 additions & 0 deletions
Large diffs are not rendered by default.

.agents/skills/transformerlab-cli/references/commands.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,25 @@ Add a new task from a local directory containing `task.yaml`, or from a Git repo
120120

121121
**JSON output:** Returns the created task object.
122122

123+
### `task edit <task_id>`
124+
125+
Update an existing task on the server. Three modes:
126+
127+
| Option | Description |
128+
|---|---|
129+
| (no flag) | Interactive — fetches current `task.yaml`, opens `$EDITOR`, validates and PUTs it back. YAML-only. |
130+
| `--from-file <path>` | Replace **only** `task.yaml` from the given path. Leaves `main.py` and other attachments untouched on the server. |
131+
| `--from-dir <path>` | Replace `task.yaml` **and** sibling files (e.g. `main.py`, configs). Zips the directory, uploads, and applies. **Use this whenever the task's `run` references a script file you've also modified — `--from-file` alone will desync the YAML from the script.** |
132+
| `--no-interactive` | Skip confirmation prompt (required in automated contexts) |
133+
| `--dry-run` | With `--from-dir`, preview the upload without submitting |
134+
| `--timeout <seconds>` | Request timeout for fetch/validate/save (default: 300) |
135+
136+
`--from-file` and `--from-dir` are mutually exclusive.
137+
138+
### `task upload <task_id> <path>`
139+
140+
Upload additional files (or a whole directory) into an existing task without touching `task.yaml`. Useful when you want to add an attachment to a task whose YAML is already correct.
141+
123142
### `task delete <task_id>`
124143

125144
Delete a task by ID.
@@ -234,7 +253,7 @@ Stop a running job.
234253

235254
Launch the interactive job monitor TUI (Textual app).
236255

237-
**Warning:** This launches a full terminal UI. **Never use in automated or agent contexts.** Use `job list` + `job machine-logs` instead.
256+
**Warning:** This launches a full terminal UI. **Never use when operating as an AI agent or in non-interactive automation.** Use `job list`, `job info`, and `job task-logs` instead.
238257

239258
---
240259

.agents/skills/transformerlab-cli/references/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ curl -s -H "Authorization: Bearer API_KEY" -H "X-Team-Id: TEAM_ID" \
128128
- `provider delete` → add `--yes`
129129
- `task gallery` → use `--import GALLERY_ID` instead of browsing
130130

131-
**Never use these commands in automated contexts:**
131+
**Never use these commands when operating as an AI agent or in non-interactive automation:**
132132
- `job monitor` (launches TUI)
133133
- `task interactive` (blocks for interactive session)
134134

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,7 @@ test-results/
228228

229229
docs/superpowers/*
230230
.superpowers/
231+
232+
/tmp/
233+
/temp/
234+
.claude/scheduled_tasks.lock

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.15.0
4+
hooks:
5+
- id: ruff
6+
name: ruff check (api, cli, lab-sdk)
7+
args: [--fix, --line-length=120]
8+
files: ^(api|cli|lab-sdk)/.*\.py$
9+
- id: ruff-format
10+
name: ruff format (api, cli, lab-sdk)
11+
args: [--line-length=120]
12+
files: ^(api|cli|lab-sdk)/.*\.py$
13+
14+
- repo: local
15+
hooks:
16+
- id: npm-format
17+
name: npm run format (prettier)
18+
entry: npm run format
19+
language: system
20+
pass_filenames: false
21+
files: ^(src|transformerlab-docs)/.*\.(js|jsx|ts|tsx|json|css|scss|md|mdx|ya?ml)$

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- **Node v22** (v23+ is not supported)
3333
- **Python**: Managed via conda (`~/.transformerlab/envs/transformerlab`). Install with `cd api && ./install.sh`.
3434
- **npm deps**: `npm install` (includes `dotenv-cli`, `cross-env`, `concurrently` used by scripts)
35+
- **pre-commit hooks**: Run `pip install pre-commit && pre-commit install` once after cloning. This wires up `.pre-commit-config.yaml` so `ruff check --fix`, `ruff format`, and `npm run format` run automatically on every commit.
3536

3637
## Architecture
3738

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""add_user_experiment_access_table
2+
3+
Revision ID: 46378c10f132
4+
Revises: 6ccd4a4d9ca1
5+
Create Date: 2026-05-04 13:23:27.122716
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
import sqlalchemy as sa
13+
from transformerlab.db.migration_utils import table_exists
14+
15+
16+
# revision identifiers, used by Alembic.
17+
revision: str = "46378c10f132"
18+
down_revision: Union[str, Sequence[str], None] = "6ccd4a4d9ca1"
19+
branch_labels: Union[str, Sequence[str], None] = None
20+
depends_on: Union[str, Sequence[str], None] = None
21+
22+
23+
def upgrade() -> None:
24+
connection = op.get_bind()
25+
if not table_exists(connection, "user_experiment_access"):
26+
op.create_table(
27+
"user_experiment_access",
28+
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
29+
sa.Column("user_id", sa.String(), nullable=False),
30+
sa.Column("team_id", sa.String(), nullable=False),
31+
sa.Column("experiment_id", sa.String(), nullable=False),
32+
sa.Column(
33+
"last_opened_at",
34+
sa.DateTime(),
35+
server_default=sa.text("(CURRENT_TIMESTAMP)"),
36+
nullable=False,
37+
),
38+
sa.PrimaryKeyConstraint("id"),
39+
sa.UniqueConstraint(
40+
"user_id",
41+
"team_id",
42+
"experiment_id",
43+
name="uq_user_experiment_access",
44+
),
45+
)
46+
op.create_index(
47+
"idx_user_experiment_access_user_team",
48+
"user_experiment_access",
49+
["user_id", "team_id"],
50+
)
51+
52+
53+
def downgrade() -> None:
54+
op.drop_index("idx_user_experiment_access_user_team", table_name="user_experiment_access", if_exists=True)
55+
op.drop_table("user_experiment_access", if_exists=True)

0 commit comments

Comments
 (0)