/SKILL.md
Bootstrap or extend a new or early-stage Next.js App Router + TypeScript repository around a Ralph-style task-promotion loop. Use when Codex needs to ask the founder product and architecture questions, generate or update the repo-local markdown knowledge base, create the initial scaffold or the next feature wave, install or adapt Ralph loop scripts, and explain how to run one cycle or a longer unattended loop.
npx skillsauth add stevennana/mina-ralph-loop-bootstrap-nextjs mina-ralph-loop-bootstrap-nextjsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build the repository in this order:
Use this skill for new repositories or very early repositories that still lack a stable docs tree, scaffold contract, and loop harness. Also use it to extend a repo that was already bootstrapped by this skill when the current queue is complete and the founder wants the next feature wave defined.
Read these references before asking questions or writing files:
Open templates and copied Ralph assets only when you need them:
assets/templates/root/assets/templates/docs/assets/templates/ralph/Use these scripts when bootstrapping:
scripts/render_docs.pyscripts/install_ralph.pyscripts/companion_skills.pyscripts/finalize_bootstrap_state.pyInspect the target repository first.
For continuation runs:
docs/exec-plans/active/docs/exec-plans/completed/Before making implementation claims or writing replacement code, search the codebase first. Do not assume a feature, helper, route, or test is missing just because the first search result was incomplete.
Before product analysis, before reviewing the user’s reference implementation in depth, before founder discovery, and before writing docs, check whether the pinned companion skill set is already installed under ~/.codex/skills.
Use python3 <skill>/scripts/companion_skills.py status as the source of truth for that pinned companion-skill set.
If the user allows companion skills:
python3 <skill>/scripts/companion_skills.py install <skill>) instead of leading with manual clone/copy commandsRecommended companion skills by area:
prisma-cli for database and schema worknextjs-app-router-patterns for Next.js App Router patternsfrontend-design and frontend-responsive-ui for UI and responsive design workclean-architecture for architecture and boundary shapingPinned manual install commands:
git clone https://github.com/prisma/skills.git
cp -r skills/prisma-cli ~/.codex/skills/prisma-cli
git clone https://github.com/sickn33/antigravity-awesome-skills.git
cp -r antigravity-awesome-skills/skills/nextjs-app-router-patterns ~/.codex/skills/
git clone https://github.com/am-will/codex-skills.git
cp -r codex-skills/skills/frontend-design ~/.codex/skills/
cp -r codex-skills/skills/frontend-responsive-ui ~/.codex/skills/
git clone https://github.com/MKToronto/python-clean-architecture-codex.git
cp -r python-clean-architecture-codex/.agents/skills/clean-architecture ~/.codex/skills/clean-architecture
Helper script usage:
python3 <skill>/scripts/companion_skills.py status --json
python3 <skill>/scripts/companion_skills.py command prisma-cli
python3 <skill>/scripts/companion_skills.py install prisma-cli
Ask the user questions in stages, not all at once. Before the first substantive product question, follow this exact startup order:
Plan mode recommendationcontinue when ready to begin the interviewDo not combine the handoff with the first product question.
Do not combine the companion-skill installation decision with the continue handoff in the same prompt.
Do not repeat the startup guidance twice.
At the startup handoff stage, do not ask for product intent yet; wait for the user to say continue or otherwise clearly indicate readiness.
Do not deeply review the user’s desired product/reference before the companion-skill installation decision is resolved.
At the startup handoff, tell the user that Plan mode enables selectable option lists for interview questions and recommend switching to Plan mode if they want that UI.
If companion skills are missing, summarize all missing pinned companion skills first, ask whether the user wants them auto-installed before product analysis and the first interview question, and then handle accepted installs one by one.
After the install decision is finished, send a separate prompt for the Plan mode recommendation and continue handoff.
Do not replace the pinned install commands with guessed skill-installer or upstream-catalog commands unless the user explicitly asks to use the installer flow.
Install and propose companion skills one at a time rather than dumping every missing skill at once.
If the session remains in Default mode, continue with one-question-at-a-time plain-text questions, suggested options, and free-form fallback.
Prefer one question at a time unless the user explicitly asks for batching.
For each interview question:
In Plan mode, prefer the built-in selectable option-list flow when available.
In Default mode, treat those options as plain-text suggestions rather than clickable UI controls.
Do not require the user to prepare answers in a separate editor unless they want to.
For continuation runs, do a delta interview rather than repeating the full bootstrap interview. Ask only what is needed to define the next feature tranche and its tests without guessing.
The interview must make the test strategy explicit before scaffolding starts. Do not accept vague answers like "we should have decent coverage" or "we can add tests later." It must also identify the distinct in-scope user-visible features so the generated specs and task queue can be sliced by feature instead of collapsing everything into one generic flow. You need a clear statement of:
Cover at least:
If a feature depends on an outside resource such as AI chat, a third-party API, external auth, or other remote infrastructure, require that feature to appear in an E2E scenario before the related task can promote. If a feature wave is mostly UI or UX work, use references/ui-verification.md and make the UI promotion contract explicit before plan generation starts.
Use references/interview-checklist.md as the stop condition. Do not start writing the docs until the answers are sufficient to fill the required markdown set in references/doc-baseline.md. If the test strategy is still ambiguous, keep asking. For continuation runs, also use references/expansion-mode.md to decide whether the next wave is specific enough to write new specs and active plans.
Create a temporary answers JSON file from the interview.
/tmp/ralph-bootstrap-answers.json unless the user wants the answers stored in-repo.Render the baseline templates:
python3 <skill>/scripts/render_docs.py --answers /tmp/ralph-bootstrap-answers.json --repo-root <target-repo>
Then expand the rendered docs into project-specific content.
docs/references/ and preserve the useful project-specific takeaways there.AGENTS.md stays short and points into the docs tree.taskmeta blocks and deterministic checks.When the answers JSON includes structured feature data:
FEATURE_SPECS with one entry per distinct user-visible featureSLICE_SIZE to micro, balanced, or coarse to control task granularityBACKLOG_DEPTH to values such as next wave, 10-15 tasks, ~2-3 days, or a task-count targetTARGET_EXEC_TASK_COUNT when the founder wants an explicit queue lengthEXEC_TASKS with a sequenced task queue rather than only the baseline trioscripts/render_docs.py materialize those feature specs and executable task files alongside the baseline docsIf FEATURE_SPECS is present and EXEC_TASKS is omitted, scripts/render_docs.py will derive a queue whose size follows the selected SLICE_SIZE and BACKLOG_DEPTH controls. Multiple exec-plans may map to the same product spec when that is required to keep the slices narrow.
If EXEC_TASKS is provided but still collapses multiple product specs into broad tasks, the renderer should fail instead of silently accepting the queue.
For continuation runs:
docs/references/ current when new user-provided references appearBefore writing or revising exec-plans:
Create exec-plan pages only after the supporting docs are sufficiently detailed.
Rules:
After generating the queue:
Use references/nextjs-ts-preset.md as the scaffold contract.
For v1 of this skill, the scaffold is opinionated:
node --import tsx --test for unit testsIf the generated app depends on persistent runtime state such as SQLite/Prisma or local runtime preparation, follow references/runtime-startup.md. For operator-visible Next.js server logs outside the test path, also follow references/server-logging.md.
The generated scaffold must match the docs and expose these commands:
npm run lintnpm run typechecknpm run buildnpm run test:unitnpm run test:e2enpm run verifyFor stateful apps, also expose deterministic runtime-prep and startup-proof commands such as:
npm run db:preparenpm run start:smokeFor operator-visible manual startup, generated repos should also expose:
npm run start:loggedAnd document:
logs/ directory locationtrace, debug, info, warn, and errorDo not install the Ralph loop before these commands and their underlying file layout make sense.
Do not describe a promotion-ready repo unless the test commands are wired into the actual promotion contract.
Do not treat build as proof that the shipped runtime can start.
During implementation, prefer the smallest targeted check that proves the changed unit or slice still works. For example:
npm run verify as the promotion gate for task completionstart path depends on prepared runtime state@ui-* Playwright command and make screenshots, responsive assertions, and accessibility checks part of the promotion contractDuring the initial bootstrap run, stop at the foundation boundary. Do not implement the queued feature tasks during the bootstrap session. The skill may complete only the foundation/bootstrap task needed to guarantee the harness environment.
Install the copied Ralph assets into the repo:
python3 <skill>/scripts/install_ralph.py --repo-root <target-repo>
Then adapt the copied files to the new repo.
Required adaptations:
package.jsonTreat assets/templates/ralph/ as the starting point, not as an immutable drop-in.
After the docs, scaffold, Ralph assets, and deterministic verification are in place:
docs/exec-plans/completed/docs/exec-plans/active/state/ so Ralph can start from the first real feature taskUse:
python3 <skill>/scripts/finalize_bootstrap_state.py --repo-root <target-repo>
This step should happen during the bootstrap session. Do not run the Ralph loop itself from the bootstrap session just to advance feature tasks.
Create an initial active queue that fits the new product.
At minimum include:
Treat that as a floor, not a target.
If the product has multiple distinct user-visible features, generate as many small active tasks as needed to represent them.
Queue depth should follow the founder's requested backlog size. When the founder does not specify one, default to SLICE_SIZE=balanced and BACKLOG_DEPTH=10-15 tasks.
Do not stop at one task per feature spec when a large feature still needs to be broken into smaller promotion-ready slices.
Each active task must have:
taskmetaPromotion rules must be explicit in each task:
taskmeta.promotion_mode = deterministic_only so passing deterministic UI checks is sufficient for promotion without human reviewFor continuation runs, create the next queue wave rather than replacing history wholesale. The next wave should normally include:
Update docs/exec-plans/active/index.md so the new sequence is readable as the next tranche of work.
Do not hide multiple major feature fronts inside a single “first slice” task.
If the founder asks for a longer backlog, continue splitting the in-scope feature fronts until the requested backlog depth is represented or the current docs can no longer support narrower plans without guessing.
When the initial queue has been completed and the founder wants more features, stay in the same skill.
Use this expansion loop:
taskmeta, checks, and promotion rulesDo not jump straight into implementation of new features without first refreshing the docs and task queue. For continuation runs, treat the deliverable as planning-only by default:
Do not modify application code, routes, schemas, tests, or runtime wiring in the same continuation pass unless the user later gives a new explicit implementation request against a specific active exec-plan after the queue refresh is complete. If the user says something broad like “implement the plan” while the continuation interview or queue-refresh work is still in progress, treat that as ambiguous and finish the docs/exec-plan refresh first.
Before finishing, verify as much as the environment allows.
Minimum expectation:
scripts/ralph/state/README.md existsstate/current-task.txt points at the first real feature task or NONE only when the queue is truly exhaustedIf the environment allows package installation and test execution, run the project verification commands and at least a dry scripts/ralph/status.sh check.
If subagents are available, use them primarily for exploration, search, or summarization. Keep validation comparatively constrained: avoid fanning out broad concurrent test/build runs that create noisy backpressure or conflicting interpretations of failure.
If the same environment-specific blocker appears three times for the current task:
Generated Ralph loops should also treat worker.jsonl updates as the worker heartbeat.
If the worker phase goes silent past the configured stall timeout, mark the cycle as stalled, stop the unattended loop, preserve evidence, and hand off to operator triage instead of waiting forever on codex exec.
Do not treat a first stall as automatic RCA-plan creation.
Branch into the blocker/RCA path only after the same environment-specific blocker has repeated enough times to satisfy the exceptional-flow rule.
If the user explicitly allows companion skills and they are installed, consider using them before planning or implementation when they fit the work:
prisma-cli for database and schema worknextjs-app-router-patterns for Next.js App Router patternsfrontend-design and frontend-responsive-ui for UI and responsive design workclean-architecture for architecture and boundary shapingDo not assume they are present. Prefer checking and recommending them before documentation starts. Use them only when installed and clearly relevant.
AGENTS.md short; push depth into docs/.worker.jsonl progress, not from guessed Codex internal health, and surface compact o/x/! cycle marks in state/run-log.md.state/current-task.txt synchronized with runnable tasks in docs/exec-plans/active/, and use NONE only when the runnable queue is actually exhausted.start:logged path and server log levels so humans can inspect real server flow without relying only on Ralph artifacts.core-flow.md and one oversized first-slice task when the product clearly has several feature fronts.docs/exec-plans/active/.A successful run leaves the target repo with:
scripts/ralph/state/README.mddevelopment
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.