agentleFS
aideploytutoraideploytutor/skill-deploy-share/skills/app-foundation/SKILL.md

app-foundation

Skill2 starsChanged 35 days agoMITView on GitHub

Create a new web product foundation (Next.js + TypeScript + Tailwind + Postgres via Drizzle) that every other skill in skill-deploy-share builds on. Use when the user wants to start a new project, website, app, shop or SaaS from scratch, says "start a new project" or "set up a foundation for my shop", or another skill requires app-foundation.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Where should the folder go?: Default to a new folder named after the product, inside the folder the user is working in.

    line 21
  2. Distinctive:

    If the user already answered either one, don't ask it again.

    line 23
  3. Very specific:

    Use the github-vercel-deploy skill (episode 001).

    line 81
  4. Very specific:

    After installing a skill, add it to stack.json → installed.

    line 90
  5. Distinctive:

    Don't use platform-only APIs, so the project keeps deploying to both Vercel and Cloudflare.

    line 91

≈ “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

app-foundation

Goal: in one step, the user gets a new project that runs locally, deploys to Vercel or Cloudflare, and is ready for the other skills in this repo (database, login, payments, orders...) to stack on top. Follow ../../STACK.md.

The user is probably not a programmer. Speak plainly, keep questions to a minimum, and never ask for passwords or secret keys in the chat.

1. Ask two things (one message)

  • What's the product called? Chinese is fine. It's shown on the homepage and in page titles.
  • Where should the folder go? Default to a new folder named after the product, inside the folder the user is working in.

If the user already answered either one, don't ask it again.

2. Check the computer

node -v    # needs v20.9 or newer
npm -v
git --version
  • Node missing or too old: tell the user to install the LTS version from https://nodejs.org, and say that after installing they need to open a new terminal / restart the AI tool so PATH refreshes. Then check again.
  • git missing: it's fine for now, because it's only needed to deploy. Mention it at the end.

3. Create the project

Resolve the script path relative to this SKILL.md:

node <skill-dir>/scripts/create.mjs --dir "<folder>" --name "<product name>" --json

The script:

  • copies template/ into the folder
  • fills in the name
  • writes stack.json
  • copies .env.example to .env.local
  • runs npm install
  • makes the first git save point

It refuses to overwrite a folder that isn't empty (exit 10). In that case, ask for a new folder name. Don't install into an existing project automatically.

ExitMeaningDo
0createdcontinue
3Node/npm too old or missingstep 2
4npm install failedshow the last lines; usually it's the network. Retry once with npm install in the folder
10folder not emptyask for another name
64bad argumentsfix the command

4. Show it running

cd "<folder>"
npm run dev

Open http://localhost:3000, in the browser tool if you have one, and confirm the homepage shows the product name and the "Next steps" checklist. Also check http://localhost:3000/api/health, which returns "ok": true.

5. Tell the user (short, plain)

  • Where the project is, and that it's running at http://localhost:3000.
  • What they have: a working website foundation. It isn't connected to a database yet, so nothing is stored, and that's expected.
  • What to say next:
    • "Use github-vercel-deploy to deploy this project to GitHub and Vercel" (episode 001) to put it online.
    • "Use db-connect to connect a free database to my project" (episode 003) to save data.

Deploying it

Use the github-vercel-deploy skill (episode 001). Vercel detects Next.js by itself; no settings to change. The first deploy can spend several minutes on "Installing dependencies" (no build cache yet) — tell the user that's normal; later deploys are much faster. Check https://<project>.vercel.app/api/health afterwards.

Rules for everything built on this foundation

These rules are also written into the project's own AGENTS.md, so any AI that opens the project follows them:

  • Tables go in src/db/schema/<system>.ts, prefixed with the system name (e.g. orders_), and are exported from src/db/schema/index.ts.
  • Systems talk through emitEvent() and the core_events table. They never write each other's tables.
  • Secrets live only in environment variables, documented in .env.example.
  • After installing a skill, add it to stack.json → installed.
  • Don't use platform-only APIs, so the project keeps deploying to both Vercel and Cloudflare.

Check an existing project

node <skill-dir>/scripts/create.mjs --check --dir "<folder>"

Other skills run this before installing; exit 3 means app-foundation isn't installed there.

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.