mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
chore(ai tooling): sync harness configs
This commit is contained in:
@@ -47,7 +47,7 @@ Each subagent prompt must include:
|
||||
- **File paths** and context needed to work independently
|
||||
- **Constraints** or edge cases from the plan
|
||||
|
||||
Use `model: "fast"` for straightforward tasks. Omit model for complex ones.
|
||||
Use the `plan-implementer` agent's configured model unless the harness explicitly requires a supported model override for a straightforward task. Omit overrides for complex or cross-cutting tasks.
|
||||
|
||||
Wait for all subagents in a batch to complete before starting the next batch.
|
||||
|
||||
|
||||
@@ -54,16 +54,15 @@ Keep batches balanced. Add thread views (`/:boardIdentifier/thread/:cid`) as nee
|
||||
|
||||
## Step 2: Spawn Profiler Subagents
|
||||
|
||||
Read the profiler subagent definition at `.claude/agents/profiler.md`. Then spawn one `shell` Task per batch **in parallel** (single message, multiple Task calls):
|
||||
Read the profiler subagent definition at `.claude/agents/profiler.md`. Then spawn one `profiler` Task per batch **in parallel** (single message, multiple Task calls):
|
||||
|
||||
```
|
||||
For each batch, create a Task:
|
||||
subagent_type: "shell"
|
||||
subagent_type: "profiler"
|
||||
prompt: |
|
||||
You are a performance profiler. Follow the workflow in .claude/agents/profiler.md.
|
||||
Session name: "prof-N"
|
||||
Routes to profile: /route1, /route2, ...
|
||||
[Include the full profiler workflow from the agent file]
|
||||
Any non-default app URL or extra profiling constraints
|
||||
```
|
||||
|
||||
Spawn up to 4 subagents simultaneously. Each opens its own browser session, navigates routes, scrolls, collects both Web Vitals and react-scan data per route, and returns a structured issues list.
|
||||
|
||||
@@ -7,8 +7,8 @@ description: Test and debug Android APK features using a local Android emulator.
|
||||
|
||||
## Overview
|
||||
|
||||
Delegates APK testing to a **shell subagent** (`model: fast`) to keep the main context clean.
|
||||
The subagent manages the emulator, builds/installs the APK, executes tests, and returns structured diagnostics.
|
||||
Delegates APK testing to the dedicated `test-apk` subagent to keep the main context clean.
|
||||
That subagent manages the emulator, builds and installs only when needed, executes the requested tests, and returns structured diagnostics.
|
||||
|
||||
## Workflow
|
||||
|
||||
@@ -25,14 +25,13 @@ Ask the user (or infer from context) what to test. Common scenarios:
|
||||
| Manual APK interaction | Build, install, launch, capture logcat |
|
||||
| Contract tests (fixtures) | `yarn contract:postimages` |
|
||||
|
||||
### Step 2: Delegate to Shell Subagent
|
||||
### Step 2: Delegate to the `test-apk` Subagent
|
||||
|
||||
Spawn a **shell** subagent with `model: fast`. Use the prompt template below, filling in `{TEST_DESCRIPTION}` with the user's requirements.
|
||||
Spawn the `test-apk` subagent with the prompt template below, filling in `{TEST_DESCRIPTION}` with the user's requirements and any exact commands or classes you want run.
|
||||
|
||||
```
|
||||
Use the Task tool:
|
||||
subagent_type: "shell"
|
||||
model: "fast"
|
||||
subagent_type: "test-apk"
|
||||
prompt: <see Prompt Template below>
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ For each key, check if the English value already exists in `public/translations/
|
||||
|
||||
### Step 3 — Spawn translator subagents
|
||||
|
||||
For **each key**, spawn a `translator` subagent (using the Task tool with `subagent_type: "generalPurpose"` and `model: "fast"`). The prompt for each subagent must include:
|
||||
For **each key**, spawn a `translator` subagent using the Task tool with `subagent_type: "translator"`. The prompt for each subagent must include:
|
||||
- The key name
|
||||
- The English value
|
||||
- An instruction to follow the translator subagent's system prompt
|
||||
@@ -45,7 +45,7 @@ Follow your system prompt for the full workflow (create dictionary file, dry run
|
||||
```
|
||||
|
||||
**Parallelism rules:**
|
||||
- Spawn up to 4 subagents concurrently (Task tool limit).
|
||||
- Spawn up to 4 subagents concurrently.
|
||||
- If there are more than 4 keys, batch them: spawn 4, wait for completion, then spawn the next batch.
|
||||
|
||||
### Step 4 — Report results
|
||||
|
||||
@@ -39,7 +39,7 @@ Batch 3 (parallel): [tasks that depend on batch 2]
|
||||
|
||||
### 3. Execute Batches
|
||||
|
||||
For each batch, spawn `plan-implementer` subagents using Codex's current delegation tool and select the `plan-implementer` agent by name.
|
||||
For each batch, spawn `plan-implementer` subagents using Codex's current delegation tool with `agent_type: "plan-implementer"`.
|
||||
|
||||
Each subagent prompt must include:
|
||||
|
||||
@@ -47,7 +47,7 @@ Each subagent prompt must include:
|
||||
- **File paths** and context needed to work independently
|
||||
- **Constraints** or edge cases from the plan
|
||||
|
||||
If your runtime supports model overrides, use a faster coding model only for straightforward tasks. Omit the override for complex or cross-cutting tasks.
|
||||
Use the `plan-implementer` agent's configured model unless the harness explicitly requires a supported model override for a straightforward task. Omit overrides for complex or cross-cutting tasks.
|
||||
|
||||
Wait for all subagents in a batch to complete before starting the next batch.
|
||||
|
||||
|
||||
@@ -57,11 +57,12 @@ Keep batches balanced. Add thread views (`/:boardIdentifier/thread/:cid`) as nee
|
||||
Read the profiler subagent definition at `.codex/agents/profiler.toml`. Then spawn one `profiler` subagent per batch **in parallel** using Codex's current delegation tool:
|
||||
|
||||
```
|
||||
For each batch, create a subagent request that includes:
|
||||
agent: "profiler"
|
||||
Session name: "prof-N"
|
||||
Routes to profile: /route1, /route2, ...
|
||||
Any non-default app URL or extra profiling constraints
|
||||
For each batch, create a subagent request:
|
||||
agent_type: "profiler"
|
||||
prompt: |
|
||||
Session name: "prof-N"
|
||||
Routes to profile: /route1, /route2, ...
|
||||
Any non-default app URL or extra profiling constraints
|
||||
```
|
||||
|
||||
Spawn up to 4 subagents simultaneously. Each opens its own browser session, navigates routes, scrolls, collects both Web Vitals and react-scan data per route, and returns a structured issues list.
|
||||
|
||||
@@ -31,7 +31,7 @@ Spawn the `test-apk` subagent with the prompt template below, filling in `{TEST_
|
||||
|
||||
```
|
||||
Use Codex's current delegation tool:
|
||||
agent: "test-apk"
|
||||
agent_type: "test-apk"
|
||||
prompt: <see Prompt Template below>
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ For each key, check if the English value already exists in `public/translations/
|
||||
|
||||
### Step 3 — Spawn translator subagents
|
||||
|
||||
For **each key**, spawn a `translator` subagent using Codex's current delegation tool. The prompt for each subagent must include:
|
||||
For **each key**, spawn a `translator` subagent using Codex's current delegation tool with `agent_type: "translator"`. The prompt for each subagent must include:
|
||||
- The key name
|
||||
- The English value
|
||||
- An instruction to follow the translator subagent's system prompt
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
name: profiler
|
||||
model: composer-2
|
||||
description: Performance profiler that browses 5chan routes via playwright-cli, collecting Web Vitals and React rerender data via react-scan. Returns a structured issues list for a batch of routes. Use proactively when profiling browsing performance, finding bottlenecks, or diagnosing excessive React rerenders.
|
||||
---
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
name: test-apk
|
||||
model: composer-2
|
||||
description: Android APK testing specialist that runs the 5chan APK on a local Android emulator. Manages emulator lifecycle, builds and installs debug APK, runs instrumentation tests, captures logcat diagnostics, and debugs WebView upload automation (imgur, postimages). Use proactively when the user asks to test APK features, debug Android uploads, run emulator tests, or investigate WebView automation issues.
|
||||
---
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ Each subagent prompt must include:
|
||||
- **File paths** and context needed to work independently
|
||||
- **Constraints** or edge cases from the plan
|
||||
|
||||
Use `model: "fast"` for straightforward tasks. Omit model for complex ones.
|
||||
Use the `plan-implementer` agent's configured model unless the harness explicitly requires a supported model override for a straightforward task. Omit overrides for complex or cross-cutting tasks.
|
||||
|
||||
Wait for all subagents in a batch to complete before starting the next batch.
|
||||
|
||||
|
||||
@@ -54,16 +54,15 @@ Keep batches balanced. Add thread views (`/:boardIdentifier/thread/:cid`) as nee
|
||||
|
||||
## Step 2: Spawn Profiler Subagents
|
||||
|
||||
Read the profiler subagent definition at `.cursor/agents/profiler.md`. Then spawn one `shell` Task per batch **in parallel** (single message, multiple Task calls):
|
||||
Read the profiler subagent definition at `.cursor/agents/profiler.md`. Then spawn one `profiler` Task per batch **in parallel** (single message, multiple Task calls):
|
||||
|
||||
```
|
||||
For each batch, create a Task:
|
||||
subagent_type: "shell"
|
||||
subagent_type: "profiler"
|
||||
prompt: |
|
||||
You are a performance profiler. Follow the workflow in .cursor/agents/profiler.md.
|
||||
Session name: "prof-N"
|
||||
Routes to profile: /route1, /route2, ...
|
||||
[Include the full profiler workflow from the agent file]
|
||||
Any non-default app URL or extra profiling constraints
|
||||
```
|
||||
|
||||
Spawn up to 4 subagents simultaneously. Each opens its own browser session, navigates routes, scrolls, collects both Web Vitals and react-scan data per route, and returns a structured issues list.
|
||||
|
||||
@@ -7,8 +7,8 @@ description: Test and debug Android APK features using a local Android emulator.
|
||||
|
||||
## Overview
|
||||
|
||||
Delegates APK testing to a **shell subagent** (`model: fast`) to keep the main context clean.
|
||||
The subagent manages the emulator, builds/installs the APK, executes tests, and returns structured diagnostics.
|
||||
Delegates APK testing to the dedicated `test-apk` subagent to keep the main context clean.
|
||||
That subagent manages the emulator, builds and installs only when needed, executes the requested tests, and returns structured diagnostics.
|
||||
|
||||
## Workflow
|
||||
|
||||
@@ -25,14 +25,13 @@ Ask the user (or infer from context) what to test. Common scenarios:
|
||||
| Manual APK interaction | Build, install, launch, capture logcat |
|
||||
| Contract tests (fixtures) | `yarn contract:postimages` |
|
||||
|
||||
### Step 2: Delegate to Shell Subagent
|
||||
### Step 2: Delegate to the `test-apk` Subagent
|
||||
|
||||
Spawn a **shell** subagent with `model: fast`. Use the prompt template below, filling in `{TEST_DESCRIPTION}` with the user's requirements.
|
||||
Spawn the `test-apk` subagent with the prompt template below, filling in `{TEST_DESCRIPTION}` with the user's requirements and any exact commands or classes you want run.
|
||||
|
||||
```
|
||||
Use the Task tool:
|
||||
subagent_type: "shell"
|
||||
model: "fast"
|
||||
subagent_type: "test-apk"
|
||||
prompt: <see Prompt Template below>
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ For each key, check if the English value already exists in `public/translations/
|
||||
|
||||
### Step 3 — Spawn translator subagents
|
||||
|
||||
For **each key**, spawn a `translator` subagent (using the Task tool with `subagent_type: "generalPurpose"` and `model: "fast"`). The prompt for each subagent must include:
|
||||
For **each key**, spawn a `translator` subagent using the Task tool with `subagent_type: "translator"`. The prompt for each subagent must include:
|
||||
- The key name
|
||||
- The English value
|
||||
- An instruction to follow the translator subagent's system prompt
|
||||
@@ -45,7 +45,7 @@ Follow your system prompt for the full workflow (create dictionary file, dry run
|
||||
```
|
||||
|
||||
**Parallelism rules:**
|
||||
- Spawn up to 4 subagents concurrently (Task tool limit).
|
||||
- Spawn up to 4 subagents concurrently.
|
||||
- If there are more than 4 keys, batch them: spawn 4, wait for completion, then spawn the next batch.
|
||||
|
||||
### Step 4 — Report results
|
||||
|
||||
@@ -139,6 +139,7 @@ src/
|
||||
|
||||
- Treat `.codex/`, `.cursor/`, and `.claude/` as repo-managed contributor tooling, not private scratch space.
|
||||
- Keep equivalent workflow files aligned across all toolchains when their directories contain the same skill, hook, or agent.
|
||||
- Keep shared behavior equivalent while preserving harness-specific models, config formats, hook entry points, and tool invocation syntax.
|
||||
- Do not configure `.claude` agents to use `composer-2`; that model is Cursor-only in this repo. Keep `.claude` agent models on Claude-supported options.
|
||||
- Do not configure `.codex/agents/*.toml` with `gpt-5.3-codex` or `gpt-5.3-codex-spark`; standardize Codex agents on `gpt-5.4` unless the user explicitly requests a different model.
|
||||
- When changing shared agent behavior, update the relevant files in `.codex/skills/`, `.cursor/skills/`, `.claude/skills/`, `.codex/agents/`, `.cursor/agents/`, `.claude/agents/`, `.codex/hooks/`, `.cursor/hooks/`, `.claude/hooks/`, and their `hooks.json` or config entry points as needed.
|
||||
|
||||
@@ -20,7 +20,7 @@ If your AI coding assistant supports lifecycle hooks, configure these for this r
|
||||
- New `useEffect`/memo additions get an explicit second look before the agent finishes
|
||||
- Build/lint/type issues caught early
|
||||
- Security visibility via `corepack yarn npm audit`
|
||||
- One shared hook implementation for both Codex and Cursor
|
||||
- One shared hook implementation for Codex, Cursor, and Claude
|
||||
- Temporary task branches stay aligned with the repo's worktree workflow
|
||||
|
||||
## Example Hook Scripts
|
||||
@@ -85,4 +85,4 @@ exit 0
|
||||
|
||||
Configure hook wiring according to your agent tool docs (`hooks.json`, equivalent, etc.).
|
||||
|
||||
In this repo, `.codex/hooks/*.sh` and `.cursor/hooks/*.sh` should stay as thin wrappers that delegate to the shared implementations under `scripts/agent-hooks/`.
|
||||
In this repo, `.codex/hooks/*.sh`, `.cursor/hooks/*.sh`, and `.claude/hooks/*.sh` should stay as thin wrappers that delegate to the shared implementations under `scripts/agent-hooks/`. Harness-specific startup hooks such as Claude's `SessionStart` can live alongside those wrappers when the other harnesses do not have an equivalent entry point.
|
||||
|
||||
@@ -54,6 +54,7 @@ playwright-cli install --skills
|
||||
|
||||
Skill install locations:
|
||||
|
||||
- `.codex/skills/playwright-cli/`
|
||||
- `.cursor/skills/playwright-cli/`
|
||||
- `.claude/skills/playwright-cli/`
|
||||
|
||||
|
||||
+28
-1
@@ -4,7 +4,34 @@ set -euo pipefail
|
||||
|
||||
run_smoke=0
|
||||
wait_timeout="${AGENT_INIT_TIMEOUT_SECONDS:-60}"
|
||||
app_url="${AGENT_APP_URL:-http://5chan.localhost:1355}"
|
||||
|
||||
get_default_app_url() {
|
||||
if [ "${PORTLESS:-}" = "0" ]; then
|
||||
echo "http://5chan.localhost:1355"
|
||||
return
|
||||
fi
|
||||
|
||||
local branch branch_label
|
||||
|
||||
branch="$(git branch --show-current 2>/dev/null || true)"
|
||||
|
||||
if [ -n "$branch" ] && [ "$branch" != "master" ] && [ "$branch" != "main" ]; then
|
||||
branch_label="$(
|
||||
printf '%s' "$branch" \
|
||||
| tr '[:upper:]' '[:lower:]' \
|
||||
| sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//; s/-+/-/g'
|
||||
)"
|
||||
|
||||
if [ -n "$branch_label" ]; then
|
||||
echo "http://${branch_label}.5chan.localhost:1355"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "http://5chan.localhost:1355"
|
||||
}
|
||||
|
||||
app_url="${AGENT_APP_URL:-$(get_default_app_url)}"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
|
||||
Reference in New Issue
Block a user