Skills / mina ralph loop bootstrap nextjs
mina ralph loop bootstrap nextjs
Codex Ralph Loop Skill for the nextjs
Installation
Kompatibilitaet
Beschreibung
mina-ralph-loop-bootstrap-nextjs
mina-ralph-loop-bootstrap-nextjs is a Codex skill for bootstrapping or extending a brand new or very early-stage repository into a Ralph-style task-promotion repo.
The skill is intentionally opinionated in v1. It supports only:
- Next.js App Router
- TypeScript
- npm
- ESLint
- Playwright
- unit tests via
node --import tsx --test
Its job is to:
- interview the founder until product and architecture ambiguity is removed
- generate a repo-local markdown knowledge base
- scaffold the initial Next.js app to match those docs
- install and adapt Ralph loop scripts
- seed an initial active task queue with deterministic checks
- document how to run one loop or an unattended loop
- re-enter a bootstrapped repo later to define the next feature wave and its exec-plans
Harness Flow
This is the end-to-end harness-engineering flow the skill is meant to apply, from founder discovery through repeated Ralph-loop execution and later feature-wave expansion.
Core Model
This skill follows the harness-engineering model:
- the repository is the system of record
AGENTS.mdin generated repos stays short and points intodocs/- product, architecture, quality, reliability, security, and plans live in markdown
- active tasks are executable contracts with
taskmeta - promotion depends on deterministic checks, with a separate evaluator step for normal tasks and deterministic-only promotion available for UI-focused tasks
- failing required test commands block promotion
It also adopts a few practical Ralph-style operating rules:
- search the codebase before assuming something is not implemented
- keep tasks narrow and promotion-oriented
- prefer targeted checks while iterating, then use
verifyas the promotion gate - document why important tests exist so future loops do not weaken them accidentally
- if a feature depends on an outside resource such as AI chat, it should be covered by an E2E scenario before promotion
- if a feature wave is mostly UI or UX work, require a dedicated
@ui-*Playwright command plus screenshot, responsive, and accessibility checks before promotion - if the same environment-specific blocker repeats three times, branch into an RCA/fix exec-plan instead of stalling the original task forever
- if the app has persistent runtime state, prove the production-style startup path explicitly instead of assuming
buildis enough - generated Ralph loops must fail closed on prompt-render errors and must not keep running on stale
current-task.txtstate
Repository Layout
SKILL.md: operating contract for Codexreferences/: harness model, doc baseline, interview checklist, and Next.js presetreferences/feature-slicing.md: rules for turning product features into multiple specs and small executable tasksreferences/doc-quality-loop.md: quality gate for refining docs and exec-plan pages until they are decision-completereferences/environment-blockers.md: exceptional path for repeated environment-specific verification blockersreferences/runtime-startup.md: contract for proving production-style startup in stateful appsreferences/server-logging.md: contract for operator-visible Next.js server logging,start:logged, and log-level configurationreferences/ui-verification.md: contract for deterministic UI/UX promotion via Playwright tags, screenshots, and accessibility checksassets/templates/docs/references/README.md: rule for turning user-provided references into durable repo-local reference notesscripts/render_docs.py: renders the baseline docs into a target reposcripts/install_ralph.py: installs the Ralph assets into a target reposcripts/companion_skills.py: checks, prints commands for, and installs the pinned companion skillsscripts/finalize_bootstrap_state.py: archives the completed foundation task and leaves feature tasks queued for Ralphscripts/template_utils.py: shared rendering helpersreferences/expansion-mode.md: rules for generating the next active queue after the initial tranche is completeassets/templates/root/: root-file templatesassets/templates/docs/: docs-tree templatesassets/templates/ralph/: copied Ralph loop adaptation baseagents/openai.yaml: optional skill shortcut metadata
Skill Workflow
The skill is meant to run in this order:
- inspect the target repo
- interview the founder until the docs can be written without guessing The interview must also produce a concrete test strategy and explicit promotion-blocking checks.
- map the distinct user-visible features that need their own specs and task slices
- render the baseline docs tree
- expand those docs into project-specific material
User-provided local or online references should be analyzed into
docs/references/and kept for future iterations. - improve the supporting architecture/design/product docs until they are specific enough
- generate smaller exec-plan pages for individual features
- review each exec-plan page one by one and loop on quality if needed
- scaffold the Next.js app to match the docs
- install and adapt the Ralph loop
- finalize the bootstrap task state without running feature tasks
- seed the initial active task queue
- validate commands and hand back operator guidance
Limitations
Current v1 limitations:
- optimized for empty or very early repositories
- not yet a generic multi-framework bootstrapper
- does not yet support FastAPI, Go, or arbitrary stacks
- copied Ralph assets are a starting point, not guaranteed drop-ins
- copied Ralph assets should still fail closed on invalid current-task state and prompt-render failures
- generated docs may still need project-specific rewriting after first render
- the skill repo does not yet include a full self-regression harness
Bootstrap Boundary
The bootstrap session should only guarantee the harness environment:
- docs rendered and tightened
- minimal scaffold in place
- Ralph installed and aligned
- deterministic commands working
- production-style startup proven when the app depends on runtime state
- operator-visible
npm run start:loggedlogging available for manual server inspection - bootstrap foundation task archived into
docs/exec-plans/completed/ - remaining feature tasks left in
docs/exec-plans/active/for the Ralph loop
The skill should not pre-execute the queued feature tasks during the initial bootstrap run.
Repeated Blockers
If a similar environment-specific verification blocker happens three times on the same task:
- stop retrying that task unchanged
- persist the blocker signature and RCA evidence
- auto-create a small blocker-specific exec-plan
- switch the queue to that blocker plan
- return to the original task afterward through normal promotion
Continue After The Initial Plans Are Done
The same skill should be used after the first queue is complete.
The intended follow-on workflow is:
- inspect completed plans and current specs
- interview only for the next feature delta
- update product specs and design docs first
- create the next active exec-plans
- keep the same promotion rules and required test gates
- stop there and hand back the refreshed queue
Important continuation boundary:
- use this skill to refresh the harness-engineering docs and create the next exec-plan wave
- do not start application-code implementation in the same continuation pass
- after the queue exists, let Ralph or a later explicit implementation request pick up one active task
Example prompt in a later Codex session:
Use $mina-ralph-loop-bootstrap-nextjs to plan the next feature wave for this repo. Read the completed plans, update the docs first, and create the next active exec-plans with explicit promotion-blocking tests.
If you want implementation after that planning pass, do it as a separate follow-up against a specific active task, for example:
Implement docs/exec-plans/active/021-search-retrieval.md and do not broaden beyond that task contract.
Useful follow-on prompt when implementation drift is suspected:
Use $mina-ralph-loop-bootstrap-nextjs to inspect this repo, search before assuming missing implementations, update the docs first, and create the next smallest promotion-ready task wave.
Enable The Skill In A New Codex Project
Codex discovers local skills from ~/.codex/skills/<skill-name>. The simplest setup is a symlink from your skill checkout into that directory.
1. Install the skill into Codex
From any shell:
mkdir -p ~/.codex/skills
ln -s /absolute/path/to/mina-ralph-loop-bootstrap-nextjs ~/.codex/skills/mina-ralph-loop-bootstrap-nextjs
If the symlink already exists and you want to refresh it:
rm ~/.codex/skills/mina-ralph-loop-bootstrap-nextjs
ln -s /absolute/path/to/mina-ralph-loop-bootstrap-nextjs ~/.codex/skills/mina-ralph-loop-bootstrap-nextjs
For this repository specifically, the installed path is commonly:
ln -s /Users/stevenna/PycharmProjects/mina-ralph-loop-bootstrap-nextjs ~/.codex/skills/mina-ralph-loop-bootstrap-nextjs
2. Open the target repository in Codex
Start a Codex session with the new or early-stage project as the working directory.
3. Invoke the skill by name
In the Codex session, explicitly ask for the skill:
Use $mina-ralph-loop-bootstrap-nextjs to bootstrap this repository.
You can also give the short brief inline:
Use $mina-ralph-loop-bootstrap-nextjs to bootstrap this repository into a docs-first Ralph-style Next.js App Router + TypeScript project.
4. Check companion skills before product analysis
Before product analysis, before reviewing the user’s reference implementation in depth, before founder discovery, and before writing specs, the skill should check whether the pinned companion skill set is already installed in ~/.codex/skills.
If the customer allows them, this recommendation should happen before documentation starts because these skills can affect:
- interview framing
- architecture and boundary decisions
- route and App Router structure
- database and schema choices
- UI and responsive design direction
If companion skills are missing, the skill should tell the user that clearly, summarize all missing pinned companion skills up front, and ask whether to auto-install them before continuing.
The default startup path should use python3 scripts/companion_skills.py install <skill> one skill at a time.
Manual clone/copy commands should be shown as fallback guidance or when the user asks for them directly.
It should not block on upstream catalog verification first; the pinned commands in this skill are the source of truth for that startup message.
It should propose and install them one skill at a time rather than dumping all missing skills at once.
5. Answer the discovery questions
The skill will ask staged founder questions covering:
- product identity and user
- v1 scope and non-goals
- domain model
- routes and core flows
- storage/runtime assumptions
- quality bar and required tests
- reliability and security constraints
The stop condition is not just "enough detail to scaffold." The interview must make the test strategy explicit enough that the generated plans can say which checks are required and which failures block promotion. That includes calling out external-resource features that must be covered by E2E before promotion. It should also identify the distinct user-visible features that need separate specs and smaller task slices.
Preferred interaction style:
- before the first substantive product question, the skill should first resolve companion-skill installation, then review the product/reference context, then separately handle
Planmode guidance, then separately give a shortcontinuehandoff - the skill should ask one question at a time
- when appropriate, it should offer a few reasonable options and mark a recommended one
- the user should always be able to ignore the options and answer in free form
- at the start of founder discovery, it should recommend
Planmode if the user wants selectable option lists
In Plan mode, the skill should prefer selectable option lists when the session supports them. In Default mode, these remain plain-text options. The user does not need to prepare answers in another editor unless they prefer to draft them there.
The startup message should end by telling the user to say continue when ready for the first interview question.
The startup message should be printed once, not duplicated.
The companion-skill install decision and the continue handoff should not be asked in the same prompt.
The companion-skill install decision should happen before deep product/reference review.
Recommended Companion Skills
If the customer allows them and they are relevant to the work, consider installing and using these companion skills before planning or implementation.
Database skill
git clone https://github.com/prisma/skills.git
cp -r skills/prisma-cli ~/.codex/skills/prisma-cli
Next.js skill
git clone https://github.com/sickn33/antigravity-awesome-skills.git
cp -r antigravity-awesome-skills/skills/nextjs-app-router-patterns ~/.codex/skills/
UI design 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/
Architecture skill
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
When available and allowed:
- use
prisma-clibefore documentation, planning, and implementation of database schema or migration work - use
nextjs-app-router-patternsbefore documentation, planning, and implementation of App Router structure - use
frontend-designorfrontend-responsive-uibefore documentation, planning, and implementation of significant UI work - use
clean-architecturebefore documentation, planning, and implementation of major boundaries or system structure
Companion Skill Helper Script
This repo includes a pinned helper for the startup flow:
python3 scripts/companion_skills.py status --json
python3 scripts/companion_skills.py command nextjs-app-router-patterns
python3 scripts/companion_skills.py install nextjs-app-router-patterns
Recommended startup behavior:
- check which pinned companion skills are missing
- summarize all missing pinned companion skills
- ask whether to auto-install them before product analysis and the interview
- if the user accepts, install the first one
- move to the next accepted missing skill
- only then review the product/reference context in depth
- start the interview only after the user is ready to continue
6. Let the skill materialize the repo
The expected output includes:
AGENTS.mdARCHITECTURE.mddocs/PRODUCT_SENSE.mddocs/FRONTEND.mddocs/PLANS.mddocs/DESIGN.mddocs/QUALITY_SCORE.mddocs/RELIABILITY.mddocs/SECURITY.mddocs/design-docs/*docs/product-specs/*docs/exec-plans/active/*scripts/ralph/*state/README.md- a minimal Next.js scaffold with deterministic commands
Typical Generation Commands
When the skill is run manually or extended, these scripts are the entry points:
python3 scripts/render_docs.py --answers /tmp/ralph-bootstrap-answers.json --repo-root /path/to/target-repo
python3 scripts/install_ralph.py --repo-root /path/to/target-repo
python3 scripts/finalize_bootstrap_state.py --repo-root /path/to/target-repo
If the answers JSON includes structured FEATURE_SPECS and EXEC_TASKS, scripts/render_docs.py now materializes:
- multiple product spec files under
docs/product-specs/ - a feature-sliced active queue under
docs/exec-plans/active/ - refreshed
index.mdfiles for those directories
If FEATURE_SPECS is present without EXEC_TASKS, the renderer derives a queue whose depth follows the selected SLICE_SIZE and BACKLOG_DEPTH controls. Multiple exec-plans may point at the same product spec when that is needed to keep the tasks narrow.
If EXEC_TASKS is present but a task spans multiple product specs, the renderer now fails instead of accepting an oversized queue.
Operating A Generated Repo
After the skill finishes bootstrapping a target repo, the normal operator entrypoints are the generated Ralph scripts inside that target repo.
Run one full cycle:
./scripts/ralph/run-once.sh
./scripts/ralph/status.sh
Run a longer unattended loop:
./scripts/ralph/run-loop.sh
Or with a custom sleep interval between cycles:
RALPH_LOOP_SLEEP_SECONDS=45 ./scripts/ralph/run-loop.sh
Run the generated Next.js server with a persistent operator log:
npm run start:logged
LOG_LEVEL=debug npm run start:logged
Monitor current state and logs:
./scripts/ralph/status.sh
tail -f state/run-log.md
cat state/current-cycle.json
cat state/evaluation.json
cat state/backlog.md
cat state/last-result.txt
ls logs/
tail -f logs/next-server-*.log
Generated Ralph loops now support a compact cycle-health line inside state/run-log.md:
o= cycle completed and task promotedx= cycle completed but stayed not-done, failed, or auto-branched into RCA!= worker stalled during that cycle
A single ! does not mean the blocker RCA exec-plan should be created immediately.
It means the unattended loop preserved stall evidence and recorded the blocker signature first.
Only repeated environment-specific blockers on the same task should branch into the RCA/fix exec-plan flow, and generated loops now auto-create that RCA task on the third identical blocker.
Example:
- health: oo!xooo
Important state files in generated repos:
state/current-task.txt: current active task idstate/current-cycle.json: live phase/status for the current runstate/evaluation.json: latest deterministic-check and evaluator resultstate/run-log.md: compact operator log across cyclesstate/backlog.md: rendered queue snapshotstate/task-history.md: completed-task historystate/artifacts/: per-cycle worker, evaluator, commit, and prompt artifactsscripts/ralph/manual-promote.sh: explicit operator override for stalled-but-done tasks, with optional reason and artifact arguments
Generated repos should treat server logging as part of the normal operator contract:
npm run start:loggedshould create a timestamped log file underlogs/LOG_LEVELshould control server verbosity for manual debugging- server-side code should support at least
trace,debug,info,warn, anderror
Enhancing This Skill
If you are improving the skill itself, start with AGENT.md, then read:
SKILL.mdreferences/scripts/assets/templates/
Keep the contract, references, templates, and generated repo expectations synchronized. The fastest way to break this skill is to update one layer and leave the others behind.
Aehnliche Skills
last30days skill
AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
frontend slides
Create beautiful slides on the web using Claude's frontend skills
context mode
Context window optimization for AI coding agents. Sandboxes tool output, 98% reduction. 14 platforms
claude seo
Universal SEO skill for Claude Code. 19 sub-skills, 12 subagents, 3 extensions (DataForSEO, Firecrawl, Banana). Technical SEO, E-E-A-T, schema, GEO/AEO, backlinks, local SEO, maps intelligence, Google APIs, and PDF/Excel reporting.
claude ads
Comprehensive paid advertising audit & optimization skill for Claude Code. 250+ checks across Google, Meta, YouTube, LinkedIn, TikTok, Microsoft & Apple Ads with weighted scoring, parallel agents, industry templates, and AI creative generation.
claude obsidian
Claude + Obsidian knowledge companion. Persistent, compounding wiki vault based on Karpathy's LLM Wiki pattern. /wiki /save /autoresearch