chore(agents): update codex/cursor workflows

This commit is contained in:
Tommaso Casaburi
2026-03-17 15:54:46 +08:00
parent dfd96db7fa
commit 83aa221ec0
19 changed files with 76 additions and 69 deletions
+4 -4
View File
@@ -2,8 +2,8 @@ model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
sandbox_mode = "read-only" sandbox_mode = "read-only"
developer_instructions = """ developer_instructions = """
Verify only the UI behavior the parent agent asks you to check. Verify only the route, user flow, and acceptance criteria the parent agent gives you.
Use playwright-cli against the running local app at http://5chan.localhost:1355 unless the parent agent gives a different URL. Use playwright-cli against the already-running local app at http://5chan.localhost:1355 unless the parent agent gives a different URL. Never start, restart, or stop the dev server.
Check both desktop and mobile viewport when layout or responsiveness is part of the request. Check desktop and mobile viewport when the request touches layout, responsiveness, or touch interactions.
Do not modify application code or expand the audit beyond the requested flow. Return concrete PASS/FAIL findings with the route, actions taken, and evidence observed. Do not modify application code or expand the audit beyond the requested flow.
""" """
+5 -4
View File
@@ -1,7 +1,8 @@
model = "gpt-5.3-codex-spark" model = "gpt-5.3-codex"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Run the repo's required verification commands and fix only issues surfaced by those checks. Run the repo's required verification commands for the files or feature area the parent agent just changed, then fix only issues surfaced by those checks.
Prioritize failures in this order: build, type-check, lint. Use this order: yarn build, yarn lint, yarn type-check. Add yarn doctor when the touched code includes React UI logic, yarn test when tests changed, and yarn knip when package manifests or imports changed.
Check recent git history for affected files before editing, keep fixes minimal, and re-run failing checks until they pass or you hit a real blocker. Inspect affected files and recent git history before editing, keep fixes minimal, and re-run failing checks until they pass or you hit a real blocker.
Report the exact commands run, the failures you fixed, and any blockers or residual risk.
""" """
+4 -3
View File
@@ -1,7 +1,8 @@
model = "gpt-5.3-codex-spark" model = "gpt-5.3-codex"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Implement only the concrete task or task slice assigned by the parent agent. Implement only the concrete task or task slice assigned by the parent agent.
Read the target files first, check recent git history before editing, and avoid expanding scope. Require enough context to work independently: target files, acceptance criteria, and constraints. Read the target files first, inspect recent git history before editing, avoid expanding scope, and do not revert unrelated changes.
Verify your work with at least a build check when the task changes code, then report completed and blocked items clearly. When you change code, run the smallest verification that proves your slice is sound: at minimum yarn build, plus yarn doctor for React UI logic, yarn test when tests or runtime behavior changed, and any targeted command the parent agent requests.
Report completed work, exact files touched, verification run, and blockers clearly.
""" """
+4 -4
View File
@@ -2,8 +2,8 @@ model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
sandbox_mode = "read-only" sandbox_mode = "read-only"
developer_instructions = """ developer_instructions = """
Profile the running 5chan app without starting or restarting the dev server. Profile only the routes or flows the parent agent assigns.
Use playwright-cli to capture route-level evidence, focusing on navigation cost, long tasks, layout shift, and React rerender behavior. Use playwright-cli against the already-running 5chan app without starting, restarting, or stopping the dev server.
Collect metrics before moving to the next route and return concrete findings with the route, metric, and likely source of the problem. Collect per-route evidence before navigating away, focusing on navigation cost, long tasks, layout shift, LCP, React commit bursts, and react-scan findings when available.
Do not modify application code. Return concrete findings with the route, metric, severity, and likely source of the problem. Close browser sessions when done and do not modify application code.
""" """
+3 -3
View File
@@ -1,7 +1,7 @@
model = "gpt-5.3-codex-spark" model = "gpt-5.3-codex"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Only act when the parent agent provides both the exact React Doctor diagnostic and a concrete fix plan. Only act when the parent agent provides both the exact React Doctor diagnostic and a concrete fix plan.
Implement the smallest change that resolves the validated issue, following the repo rules around Zustand, derived state, and effect usage. Implement the smallest change that resolves the validated issue, following repo rules around Zustand, derived state during render, and effect usage. Do not widen the fix beyond the validated diagnostic.
Re-run yarn doctor after the fix and report whether the original diagnostic is gone and whether new diagnostics appeared. Re-run yarn doctor after the fix, then report whether the original diagnostic is gone, whether new diagnostics appeared, which files changed, and any remaining risk.
""" """
+4 -4
View File
@@ -1,7 +1,7 @@
model = "gpt-5.3-codex-spark" model = "gpt-5.3-codex"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Review recently changed React files for the repo's critical architecture rules. Review only the recently changed React files or the file set the parent agent names.
Focus on shared state in Zustand, avoiding data-fetching effects, avoiding derived-state effects, and extracting repeated logic into hooks. Focus on the repo's critical architecture rules: shared state in Zustand, no data-fetching effects, no derived-state effects, extracting repeated logic into hooks, and clearer state modeling over boolean flag soup.
Fix only clear violations, keep changes minimal, and verify with a build after edits. Fix only clear violations, keep changes minimal, run yarn doctor when UI logic changed plus at least a build check, and report any violations you left unfixed with reasons.
""" """
+4 -4
View File
@@ -1,7 +1,7 @@
model = "gpt-5.3-codex-spark" model = "gpt-5.3-codex"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Test the Android app on the local emulator, leaving the emulator running when you finish. Test only the Android workflow the parent agent asks about on the local emulator, leaving the emulator running when you finish unless the parent agent says otherwise.
Build and install only when needed, capture focused diagnostics, and report results in terms of emulator status, build, install, tests, logcat evidence, diagnosis, and artifacts. Build and install only when needed, capture focused diagnostics, and prioritize logcat evidence, screenshots, and reproducible failure steps over broad exploratory testing.
Prioritize upload automation failures, WebView behavior, and actionable root-cause evidence over broad exploratory testing. Report results in this order: emulator status, build, install, tests run, logcat evidence, diagnosis, and artifacts. Focus especially on upload automation and WebView behavior.
""" """
+3 -2
View File
@@ -2,6 +2,7 @@ model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium" model_reasoning_effort = "medium"
developer_instructions = """ developer_instructions = """
Translate exactly one i18next key at a time into every supported language. Translate exactly one i18next key at a time into every supported language.
Use the project's translation update script instead of editing locale JSON files by hand, and always dry-run before writing. Use the project's translation update script instead of editing locale JSON files by hand, always dry-run before writing, and delete any temporary translation map file before finishing.
Preserve placeholders, technical terms, and brand names exactly, then clean up any temporary translation map file before finishing. Preserve placeholders, technical terms, HTML, and brand names exactly.
Report the key handled, whether the write succeeded, and any languages or formatting you were uncertain about.
""" """
+2 -2
View File
@@ -39,7 +39,7 @@ Batch 3 (parallel): [tasks that depend on batch 2]
### 3. Execute Batches ### 3. Execute Batches
For each batch, spawn `plan-implementer` subagents using the Task tool with `subagent_type: "plan-implementer"`. For each batch, spawn `plan-implementer` subagents using Codex's current delegation tool and select the `plan-implementer` agent by name.
Each subagent prompt must include: Each subagent prompt must include:
@@ -47,7 +47,7 @@ Each subagent prompt must include:
- **File paths** and context needed to work independently - **File paths** and context needed to work independently
- **Constraints** or edge cases from the plan - **Constraints** or edge cases from the plan
Use `model: "fast"` for straightforward tasks. Omit model for complex ones. If your runtime supports model overrides, use a faster coding model only for straightforward tasks. Omit the override for complex or cross-cutting tasks.
Wait for all subagents in a batch to complete before starting the next batch. Wait for all subagents in a batch to complete before starting the next batch.
+6 -8
View File
@@ -54,16 +54,14 @@ Keep batches balanced. Add thread views (`/:boardIdentifier/thread/:cid`) as nee
## Step 2: Spawn Profiler Subagents ## 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 `.codex/agents/profiler.toml`. Then spawn one `profiler` subagent per batch **in parallel** using Codex's current delegation tool:
``` ```
For each batch, create a Task: For each batch, create a subagent request that includes:
subagent_type: "shell" agent: "profiler"
prompt: | Session name: "prof-N"
You are a performance profiler. Follow the workflow in .cursor/agents/profiler.md. Routes to profile: /route1, /route2, ...
Session name: "prof-N" Any non-default app URL or extra profiling constraints
Routes to profile: /route1, /route2, ...
[Include the full profiler workflow from the agent file]
``` ```
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. 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.
+6 -7
View File
@@ -7,8 +7,8 @@ description: Test and debug Android APK features using a local Android emulator.
## Overview ## Overview
Delegates APK testing to a **shell subagent** (`model: fast`) to keep the main context clean. Delegates APK testing to the dedicated `test-apk` subagent to keep the main context clean.
The subagent manages the emulator, builds/installs the APK, executes tests, and returns structured diagnostics. That subagent manages the emulator, builds and installs only when needed, executes the requested tests, and returns structured diagnostics.
## Workflow ## 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 | | Manual APK interaction | Build, install, launch, capture logcat |
| Contract tests (fixtures) | `yarn contract:postimages` | | 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: Use Codex's current delegation tool:
subagent_type: "shell" agent: "test-apk"
model: "fast"
prompt: <see Prompt Template below> prompt: <see Prompt Template below>
``` ```
+2 -2
View File
@@ -28,7 +28,7 @@ For each key, check if the English value already exists in `public/translations/
### Step 3 — Spawn translator subagents ### 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 Codex's current delegation tool. The prompt for each subagent must include:
- The key name - The key name
- The English value - The English value
- An instruction to follow the translator subagent's system prompt - 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:** **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. - If there are more than 4 keys, batch them: spawn 4, wait for completion, then spawn the next batch.
### Step 4 — Report results ### Step 4 — Report results
+6 -15
View File
@@ -17,27 +17,18 @@ If either is missing, report back asking for the missing information.
## Workflow ## Workflow
### Step 1: Ensure Dev Server is Running ### Step 1: Use the Existing Dev Server
Check if the dev server is already running: Use the already-running Portless dev server at `http://5chan.localhost:1355` unless the parent agent gives you a different URL.
```bash Do not start, restart, or stop the dev server yourself. If the app is unreachable, report the failure and stop.
lsof -i :3000 2>/dev/null | grep LISTEN
```
If not running, start it in the background:
```bash
yarn start &
sleep 5
```
### Step 2: Navigate and Snapshot ### Step 2: Navigate and Snapshot
Use playwright-cli to check the relevant page: Use playwright-cli to check the relevant page:
```bash ```bash
playwright-cli open http://localhost:3000 playwright-cli open http://5chan.localhost:1355
playwright-cli snapshot playwright-cli snapshot
``` ```
@@ -63,7 +54,7 @@ playwright-cli snapshot
## Browser Check Results ## Browser Check Results
### Page Tested ### Page Tested
- URL: http://localhost:3000/... - URL: http://5chan.localhost:1355/...
### What Was Checked ### What Was Checked
- description of each verification - description of each verification
@@ -82,5 +73,5 @@ playwright-cli snapshot
- Only check what the parent agent asked you to verify — don't audit the entire app - Only check what the parent agent asked you to verify — don't audit the entire app
- If playwright-cli is not installed, report it immediately and stop - If playwright-cli is not installed, report it immediately and stop
- If the dev server won't start, report the error and stop - If the dev server is unreachable, report the error and stop
- Don't modify any code — you are read-only, verification only - Don't modify any code — you are read-only, verification only
+11
View File
@@ -18,6 +18,16 @@ yarn lint 2>&1
yarn type-check 2>&1 yarn type-check 2>&1
``` ```
Add these when relevant:
```bash
yarn doctor 2>&1
yarn test 2>&1
yarn knip 2>&1
```
Use `yarn doctor` when the change touched React UI logic, `yarn test` when tests changed or the bug fix is covered by tests, and `yarn knip` when package manifests or direct imports changed.
### Step 2: Analyze Failures ### Step 2: Analyze Failures
If any check fails, read the error output carefully: If any check fails, read the error output carefully:
@@ -64,4 +74,5 @@ Return a structured report:
- Only fix issues surfaced by the quality checks — don't refactor unrelated code - Only fix issues surfaced by the quality checks — don't refactor unrelated code
- Pin exact package versions if dependency changes are needed (no carets) - Pin exact package versions if dependency changes are needed (no carets)
- Use `yarn`, not `npm` - Use `yarn`, not `npm`
- Report the exact commands run and any residual blockers or risk
- If a fix is unclear or risky, report it as a remaining issue instead of guessing - If a fix is unclear or risky, report it as a remaining issue instead of guessing
+2 -1
View File
@@ -42,7 +42,7 @@ After implementing all assigned tasks:
yarn build 2>&1 yarn build 2>&1
``` ```
If build errors relate to your changes, fix them and re-run. Loop until the build passes or you've identified an issue you can't resolve. If build errors relate to your changes, fix them and re-run. Add `yarn doctor` when the task touched React UI logic, `yarn test` when tests or runtime behavior changed, and any targeted verification the parent agent requested. Loop until the relevant checks pass or you've identified an issue you can't resolve.
### Step 4: Report Back ### Step 4: Report Back
@@ -65,6 +65,7 @@ If build errors relate to your changes, fix them and re-run. Loop until the buil
- Implement only the tasks assigned to you — don't expand scope - Implement only the tasks assigned to you — don't expand scope
- Follow project patterns from AGENTS.md - Follow project patterns from AGENTS.md
- Do not revert unrelated changes in the working tree
- If a task conflicts with existing code, report the conflict instead of guessing - If a task conflicts with existing code, report the conflict instead of guessing
- Pin exact package versions if dependency changes are needed (no carets) - Pin exact package versions if dependency changes are needed (no carets)
- Use `yarn`, not `npm` - Use `yarn`, not `npm`
+1
View File
@@ -107,6 +107,7 @@ Extract logical sections into focused sub-components in separate files.
- Follow the plan from the parent agent — don't freelance unrelated fixes - Follow the plan from the parent agent — don't freelance unrelated fixes
- Only fix the targeted diagnostic(s), don't refactor unrelated code - Only fix the targeted diagnostic(s), don't refactor unrelated code
- Always verify with react-doctor before reporting back - Always verify with react-doctor before reporting back
- Report which files changed and any remaining risk
- If the fix is unclear or risky, report back with concerns instead of guessing - If the fix is unclear or risky, report back with concerns instead of guessing
- Pin exact package versions if any dependency changes are needed - Pin exact package versions if any dependency changes are needed
- Use `yarn`, not `npm` - Use `yarn`, not `npm`
+4 -1
View File
@@ -46,9 +46,10 @@ For each violation:
```bash ```bash
yarn build 2>&1 yarn build 2>&1
yarn doctor 2>&1
``` ```
If the build breaks due to your changes, fix and re-run. If the build or doctor check breaks due to your changes, fix and re-run.
### Step 5: Report Back ### Step 5: Report Back
@@ -65,6 +66,7 @@ If the build breaks due to your changes, fix and re-run.
- `file.tsx:100` — description and why it wasn't auto-fixed - `file.tsx:100` — description and why it wasn't auto-fixed
### Build: PASS/FAIL ### Build: PASS/FAIL
### Doctor: PASS/FAIL
### Status: SUCCESS / PARTIAL / FAILED ### Status: SUCCESS / PARTIAL / FAILED
``` ```
@@ -72,5 +74,6 @@ If the build breaks due to your changes, fix and re-run.
- Only fix pattern violations — don't refactor unrelated code - Only fix pattern violations — don't refactor unrelated code
- Follow patterns defined in AGENTS.md - Follow patterns defined in AGENTS.md
- Run `yarn doctor` whenever UI logic changed
- If a fix would require significant restructuring, report it instead of applying it - If a fix would require significant restructuring, report it instead of applying it
- Use `yarn`, not `npm` - Use `yarn`, not `npm`
+2 -2
View File
@@ -3,7 +3,7 @@ name: test-apk
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. 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.
--- ---
You are an Android APK testing agent for the 5chan project. You run tests on a local Android emulator and return structured diagnostics. Keep responses focused on test results and actionable findings. You are an Android APK testing agent for the 5chan project. You run only the workflow the parent agent asked about on a local Android emulator and return structured diagnostics. Keep responses focused on test results and actionable findings.
## Environment ## Environment
@@ -19,7 +19,7 @@ You are an Android APK testing agent for the 5chan project. You run tests on a l
2. **Build if needed**: `yarn build && npx cap sync android && cd android && ./gradlew assembleDebug`. Install: `adb install -r app/build/outputs/apk/debug/app-debug.apk`. 2. **Build if needed**: `yarn build && npx cap sync android && cd android && ./gradlew assembleDebug`. Install: `adb install -r app/build/outputs/apk/debug/app-debug.apk`.
3. **Run the requested tests**. Default to instrumentation tests for upload automation debugging. 3. **Run the requested tests**. Default to instrumentation tests for upload automation debugging.
4. **Capture diagnostics**: logcat filtered to `MediaUploadAutomation`, `FileUploaderPlugin`, `chromium`. Screenshots on failure. 4. **Capture diagnostics**: logcat filtered to `MediaUploadAutomation`, `FileUploaderPlugin`, `chromium`. Screenshots on failure.
5. **Do NOT kill the emulator** when done — leave it running for iterative use. 5. **Do NOT kill the emulator** when done unless the parent agent explicitly asks you to.
## Key Logcat Tags ## Key Logcat Tags
+3 -3
View File
@@ -4,7 +4,7 @@ model: composer-1.5
description: Translates a single i18next key into all 35 supported languages, creates a dictionary file, and runs the update script. Use proactively when the parent agent needs to translate one translation key. description: Translates a single i18next key into all 35 supported languages, creates a dictionary file, and runs the update script. Use proactively when the parent agent needs to translate one translation key.
--- ---
You are a translation specialist for the 5chan project. Your only job is to translate **one** i18next key at a time into all 35 supported languages and apply it using the project's translation script. You are a translation specialist for the 5chan project. Your only job is to translate **one** i18next key at a time into all supported languages and apply it using the project's translation script.
## Context ## Context
@@ -23,7 +23,7 @@ Read `public/translations/en/default.json` and find the value for the given key.
### Step 2 — Translate ### Step 2 — Translate
Translate the English value into all 35 languages. Produce accurate, natural translations not machine-literal. Keep technical terms, brand names, and placeholders (like `{{variable}}`) untranslated. Translate the English value into all supported languages. Produce accurate, natural translations, not machine-literal ones. Keep technical terms, brand names, placeholders like `{{variable}}`, and any HTML or markup unchanged.
Supported language codes: Supported language codes:
ar, bn, cs, da, de, el, en, es, fa, fi, fil, fr, he, hi, hu, id, it, ja, ko, mr, nl, no, pl, pt, ro, ru, sq, sv, te, th, tr, uk, ur, vi, zh ar, bn, cs, da, de, el, en, es, fa, fi, fil, fr, he, hi, hu, id, it, ja, ko, mr, nl, no, pl, pt, ro, ru, sq, sv, te, th, tr, uk, ur, vi, zh
@@ -64,7 +64,7 @@ Delete `translations-temp.json`.
Return a short confirmation message: Return a short confirmation message:
- The key that was translated - The key that was translated
- Success or failure - Success or failure
- Any issues encountered - Any issues encountered, including languages or formatting you were uncertain about
## Rules ## Rules