Modern.js For AI

Modern.js provides a toolkit for AI agents that helps developers use AI to efficiently complete feature development, dependency upgrades, and version migration for Modern.js applications.

llms.txt

Modern.js docs follow the llms.txt specification, auto-generated by @rspress/plugin-llms, accessible via /llms.txt or /llms-full.txt:

Most "what is this API / config" questions can be answered from llms.txt. Just let your agent retrieve it on demand; no need to copy docs into your project.

Bundled docs & AGENTS.md

Every new Modern.js project is agent-ready out of the box:

  • Bundled docs: the @modern-js/app-tools package ships the full English docs at node_modules/@modern-js/app-tools/main-doc/docs/en/ — they always match your installed framework version, no network required.
  • AGENTS.md / CLAUDE.md: npx @modern-js/create generates both files by default. AGENTS.md instructs agents to read the bundled docs before writing any Modern.js code (so they don't rely on outdated training data); CLAUDE.md includes it for Claude Code via the @AGENTS.md directive. Pass --no-agents-md to skip generating them; they are also skipped in --sub (subproject) mode, where agent files belong to the monorepo root.

The Modern.js-managed part of AGENTS.md is wrapped in <!-- BEGIN:modernjs-agent-rules --> / <!-- END:modernjs-agent-rules --> markers. Anything you write outside the markers is yours and will never be touched by Modern.js tooling.

Skills

Skills are on-demand AI capabilities following the Agent Skills open standard. User-facing Skills:

SkillIdentifierDescription
Upgrade to v3modernjs-migrate-to-v3Migrate a v2 app to v3: safe rewrites + manual checklist + migration report
Enable featuresmodernjs-feature-enableEnable BFF / SSG / styled-components for v3 apps, and scaffold Tailwind CSS / custom Web Server

Skills are not force-installed or implicitly installed — you install them explicitly. RSC and micro-frontend setups are configuration or architecture decisions, not one-click modernjs-feature-enable actions.

Installing Skills

Modern.js user-facing Skills live in the repo's root skills/ directory and follow the Agent Skills open standard. The recommended way is the standard skills CLI, installing straight from GitHub:

# List installable Skills
npx skills add web-infra-dev/modern.js --list

# Install a single Skill into your agent directory (--agent: claude-code / codex / cursor / ...)
npx skills add web-infra-dev/modern.js --skill modernjs-migrate-to-v3 --agent codex -y

It installs the entire Skill directory (SKILL.md + scripts/ + references/) into the corresponding agent directory, ready to trigger there.

To pin a specific version, append #<ref> (a tag, branch, or commit) to the repo — it installs the Skill as of that ref (replace <tag> with a release tag that contains this Skill):

npx skills add web-infra-dev/modern.js#<tag> --skill modernjs-migrate-to-v3 --agent codex -y