agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/other/modernizing-expressjs/.agents/skills/scaffolding-nextjs-foundation/SKILL.md

scaffolding-nextjs-foundation

Skill416 starsChanged 31 days agoApache-2.0View on GitHub

Generates a new Next.js application with Tailwind, TypeScript, and modern dependencies based on audit specifications. Use when beginning the scaffolding phase of a greenfield codebase rewrite.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run npx shadcn@latest init to set up Tailwind CSS and the components directory.

    line 27
  2. Very specific:

    MongoDB & Auth Connection: If connecting to legacy MongoDB, install mongodb@latest.

    line 31
  3. Very specific:

    CRITICAL: When the modern-app runs on the host (e.g., npm run dev), it cannot resolve internal Docker hostnames like mongo.

    line 33
  4. Very specific:

    If mongodb@7+ is used: Do NOT install @auth/mongodb-adapter (it currently has peer conflicts with v7).

    line 35
  5. Very specific:

    If mongodb@^6 is acceptable: Install mongodb@^6 and @auth/mongodb-adapter@latest.

    line 36
  6. Very specific:

    Remove default boilerplate from src/app/page.tsx and src/app/globals.css to create a blank canvas for the next subagents.

    line 43
  7. Very specific:

    Ensure npm run build succeeds on the empty foundation.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Objective

Establish the baseline directory structure and dependencies for the modern rewrite of the legacy application.

Instructions for the Scaffold Subagents

Copy this checklist and track your progress:

Task Progress:
- [ ] Step 1: Initialize Next.js
- [ ] Step 2: Initialize UI
- [ ] Step 3: Install Core Dependencies
- [ ] Step 4: Clean the Scaffold
- [ ] Step 5: Verification

Step 1. Initialize Next.js

Execute the create-next-app command in the designated modernization directory (usually the root of the new repo). * Command: npx -y create-next-app@latest . --typescript --tailwind --eslint --app --src-dir --import-alias "@/*" * Note: Ensure you are running this in the correct output directory (e.g., modern-app/) and not inside the legacy legacy-app/ folder.

Step 2. Initialize UI

Run npx shadcn@latest init to set up Tailwind CSS and the components directory.

Step 3. Install Core Dependencies

Evaluate the Business_Logic_Rules.md artifact (found in docs/legacy-audit/). Based on those rules, install the necessary modern replacements explicitly using the @latest tag so the 10-year old versions are avoided. * MongoDB & Auth Connection: If connecting to legacy MongoDB, install mongodb@latest. * Connection Secret: Plan for the .env.local initialization. * CRITICAL: When the modern-app runs on the host (e.g., npm run dev), it cannot resolve internal Docker hostnames like mongo. You MUST use localhost (e.g., mongodb://localhost:27017/db_name) to bridge onto the exposed container port. * Auth Strategy Selection: * If mongodb@7+ is used: Do NOT install @auth/mongodb-adapter (it currently has peer conflicts with v7). Instead, use a JWT strategy (next-auth@latest) and the native driver for manual account/user lookups in the authorize callback. * If mongodb@^6 is acceptable: Install mongodb@^6 and @auth/mongodb-adapter@latest. * Additional Packages: * For payload validation, install zod@latest. * For legacy Mongoose methods like password hashing, install bcrypt@latest and -D @types/bcrypt@latest. * Command Example (MongoDB 7 / JWT): npm install next-auth@latest mongodb@latest zod@latest bcrypt@latest && npm install -D @types/bcrypt@latest

Step 4. Clean the Scaffold

Remove default boilerplate from src/app/page.tsx and src/app/globals.css to create a blank canvas for the next subagents.

Step 5. Verification

Ensure npm run build succeeds on the empty foundation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.