agentleFS
quochuydevquochuydev/kit/skills/run-app/SKILL.md

run-app

Skill0 starsChanged 8 months agoMITView on GitHub

Detect the local project type, check for required environment variables, and start or restart the app on localhost. Use when the user wants to run, start, or restart their local app, or invokes /run-app.

  • Reads credentials
  • Installs packages

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the current directory for project markers to determine the stack:

    line 15
  2. Very specific:

    If multiple markers exist, prefer docker-compose.yml first, then the primary language marker.

    line 27
  3. Very specific:

    Look for .env.example, .env.sample, .env.template, or environment documentation in the project.

    line 33
  4. Distinctive:

    If any required variables are missing or empty, print a clear setup guide:

    line 37
  5. Distinctive:

    Stop here: if critical variables (like database URLs or required API keys) are missing — do NOT attempt to start the app.

    line 54
  6. Very specific:

    Check if the port is already in use: lsof -ti:<port>

    line 59
  7. Very specific:

    If a process is running on that port, kill it: kill -9 $(lsof -ti:<port>)

    line 60
  8. Very specific:

    If a lock file exists but node_modules / vendor / .venv / target is missing, install first:

    line 65
  9. Very specific:

    Run the start command in the background using the Bash tool with run_in_background: true.

    line 81
  10. Distinctive:

    After launching, briefly confirm:

    line 83
  11. Very specific:

    NEVER expose or log secret values from .env files

    line 93
  12. Distinctive:

    ALWAYS kill the existing process before starting a new one — do not leave orphan processes

    line 94
  13. Very specific:

    If docker-compose.yml exists and the user hasn't said otherwise, prefer docker compose up over bare commands

    line 95
  14. Distinctive:

    If the start command fails, read the error output and suggest a fix rather than silently retrying

    line 96
  15. Very specific:

    Use the project's own scripts (e.g., npm run dev) rather than inventing custom commands

    line 97
  16. Distinctive:

    Do NOT modify any project files — this skill only reads and runs

    line 98

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “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

Run App

Detect the project type, verify environment setup, and start (or restart) the app on localhost.

Process

Step 1 — Detect the project type

Read the current directory for project markers to determine the stack:

Marker fileStackDefault start command
package.jsonNode.jsRead scripts.dev or scripts.start from package.json
requirements.txt / pyproject.toml / setup.pyPythonpython manage.py runserver / uvicorn / flask run (infer from deps)
GemfileRuby / Railsbundle exec rails server
go.modGogo run .
Cargo.tomlRustcargo run
docker-compose.ymlDocker Composedocker compose up
MakefileCheck for run/dev/start targetmake dev or make run

If multiple markers exist, prefer docker-compose.yml first, then the primary language marker. If you cannot determine the stack, ASK:

What command do you normally use to start this app?

Step 2 — Check required environment variables

  1. Look for .env.example, .env.sample, .env.template, or environment documentation in the project.
  2. Compare with the existing .env file (if any).
  3. Also scan the codebase for process.env., os.environ, os.Getenv, ENV[ or similar patterns to discover required variables.

If any required variables are missing or empty, print a clear setup guide:

⚠️  Missing environment variables:

| Variable        | Description              | Where to get it            |
|-----------------|--------------------------|----------------------------|
| DATABASE_URL    | PostgreSQL connection    | Your database provider     |
| API_KEY         | Third-party API key      | https://example.com/keys   |

Create a `.env` file or copy from the template:

  cp .env.example .env

Then fill in the missing values and run /run-app again.

Stop here if critical variables (like database URLs or required API keys) are missing — do NOT attempt to start the app.

Step 3 — Kill any existing process on the target port

  1. Determine the port from: .env, config files, or default for the framework (e.g., 3000, 8000, 8080, 4000).
  2. Check if the port is already in use: lsof -ti:<port>
  3. If a process is running on that port, kill it: kill -9 $(lsof -ti:<port>)
  4. Confirm the port is free before proceeding.

Step 4 — Install dependencies (if needed)

If a lock file exists but node_modules / vendor / .venv / target is missing, install first:

Lock fileInstall command
package-lock.jsonnpm install
yarn.lockyarn install
pnpm-lock.yamlpnpm install
bun.lockbbun install
Gemfile.lockbundle install
requirements.txtpip install -r requirements.txt
poetry.lockpoetry install
go.sumgo mod download
Cargo.lockcargo build

Step 5 — Start the app

Run the start command in the background using the Bash tool with run_in_background: true.

After launching, briefly confirm:

✅ App started on http://localhost:<port>
   Command: <the command used>
   To stop:  kill -9 $(lsof -ti:<port>)

Rules

  • NEVER expose or log secret values from .env files
  • ALWAYS kill the existing process before starting a new one — do not leave orphan processes
  • If docker-compose.yml exists and the user hasn't said otherwise, prefer docker compose up over bare commands
  • If the start command fails, read the error output and suggest a fix rather than silently retrying
  • Use the project's own scripts (e.g., npm run dev) rather than inventing custom commands
  • Do NOT modify any project files — this skill only reads and runs

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.