_detect-project-root
Skill50 starsChanged 20 days agoApache-2.0View on GitHub
Internal helper to detect the basic structure of the current project (project name, monorepo vs single app, web directory path, Next.js detection). Returns a minimal set of 4 variables that most add-* skills need at the very beginning of their execution. Idempotent and fast. Not meant to be invoked directly by users.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- flavien-ia/hypervibe-harnessword for word, first seen Oct 23, 2026
Other versions1 project uses a version of this.
Word for word · 1
- flavien-ia/hypervibe-harness★ 50100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository89 other files it gives its agents.
- accessibilitySkill
- add-2faSkill
- add-agent-dashboardSkill
- add-aiSkill
- add-analyticsSkill
- add-authSkill
- add-automationSkill
- add-backup-dbSkill
- add-collabSkill
- add-cronSkill
- add-dark-modeSkill
- add-dbSkill
- add-domainSkill
- add-emailSkill
- add-github-authSkill
- add-google-authSkill
- add-i18nSkill
- _add-keyringSkill
- add-mapSkill
- add-notification-centerSkill
- add-push-notificationSkill
- add-pwaSkill
- add-roleSkill
- add-routineSkill
- add-storageSkill
- add-stripeSkill
- add-testSkill
- bootstrapSkill
- _check-depsSkill
- cleanSkill
- _collect-secretSkill
- _convert-to-turborepoSkill
- _create-agentSkill
- _create-cloudflare-workerSkill
- _create-contact-pageSkill
- _create-render-workerSkill
- _create-routineSkill
- _create-workflowSkill
- delete-projectSkill
- _dns-brevoSkill
- _dns-cloudflareSkill
- _dns-gandiSkill
- _dns-godaddy-manualSkill
- _dns-hostingerSkill
- _dns-infomaniak-manualSkill
- _dns-ionos-manualSkill
- _dns-lwsSkill
- _dns-namecheapSkill
- _dns-ovhSkill
- _dns-porkbunSkill
- _dns-resendSkill
- _dns-squarespace-manualSkill
- eco-auditSkill
- _ensure-aiSkill
- _ensure-vaultSkill
- _generate-secretSkill
- geoSkill
- _get-secretSkill
- gscSkill
- _hash-passwordSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use plain, non-technical business language.
- Distinctive: line 14
When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.
- Very specific: line 58
If the root name contains -monorepo suffix (e.g.
- Very specific: line 73
If PROJECT_NAME is empty or IS_NEXTJS=no:
- Very specific: line 109
Every add-* skill should call this in Step 1 (or wherever it currently does test -f package.json), replacing the ad-hoc detection code.
- Very specific: line 124
Do not try to add these to _detect-project-root.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Detect Project Root - Internal helper
Communication
- Detect the user's language from the conversation (the user's own messages, anywhere in the session - not just this invocation: a bare slash command like
/bootstrapcarries no language signal by itself). If nothing in the conversation gives a signal, fall back to the OS locale (node -e "console.log(Intl.DateTimeFormat().resolvedOptions().locale)") before defaulting to English. ALWAYS reply in that language for every user-facing message: questions, progress, confirmations, summaries, errors - including any example text quoted in this skill, which is illustrative and must be translated, never sent verbatim. - Use plain, non-technical business language. Never expose internal script names (*.mjs) or jargon; describe actions in human terms.
- When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.
- Show progress as a short natural-language checklist (in-progress and done states).
You detect the basic structure of the current project and return a minimal set of variables that the caller can reuse. You work silently, without bothering the user unless the project cannot be detected.
What this helper returns
A 4-variable snapshot:
| Variable | Possible values | Used by |
PROJECT_NAME | my-app, hypervibe, etc. | Everything: R2 bucket names, workers, monorepo packages, render.yaml, etc. |
WEB_DIR | . (single app) or apps/web (monorepo) | add-db, add-cron, add-auth, _create-*-worker |
IS_MONOREPO | yes / no | add-automation, add-db, _create-cloudflare-worker, _create-render-worker |
IS_NEXTJS | yes / no | All add-* skills (to refuse if the project is not Next.js) |
This is intentionally minimal. Specific checks like HAS_DB, HAS_AUTH, HAS_RESEND remain inline in the skills that need them - they are contextual and shouldn't pollute every skill's context.
Step 1 - Detect monorepo vs single app
test -d apps/web && echo "monorepo" || echo "single"Set IS_MONOREPO accordingly:
monorepo→IS_MONOREPO=yes,WEB_DIR=apps/websingle→IS_MONOREPO=no,WEB_DIR=.
Step 2 - Read the project name
For single app (WEB_DIR=.):
node -e "process.stdout.write(require('./package.json').name)"For monorepo (WEB_DIR=apps/web):
- Try the root
package.jsonfirst (Bootstrap's convention is that the root package has the "real" project name):node -e "process.stdout.write(require('./package.json').name)" - If the root name contains
-monoreposuffix (e.g.hypervibe-monorepo), strip it to get the logical project name. - Fallback: read
apps/web/package.jsonif root is missing.
Set PROJECT_NAME.
Step 3 - Verify Next.js
node -e "const p=require('./WEB_DIR/package.json'); process.stdout.write(p.dependencies?.next || p.devDependencies?.next || 'none')"Replace WEB_DIR with the detected value. If the output is none, set IS_NEXTJS=no. Otherwise IS_NEXTJS=yes.
Step 4 - Sanity check
If PROJECT_NAME is empty or IS_NEXTJS=no:
Tell the user:
I cannot detect a Next.js project in the current folder. Check that:
- You are at the root of the project (or in
apps/web/ another T3 folder)- A
package.jsonexists and listsnextas a dependencyIf this is a new project, run
/bootstrapfirst.
Then return an error state to the caller (so it can abort).
Step 5 - Return the snapshot
Report to the caller in this exact format so it can parse the values:
PROJECT_NAME=<value>
WEB_DIR=<value>
IS_MONOREPO=<yes|no>
IS_NEXTJS=<yes|no>Example success output:
PROJECT_NAME=hypervibe
WEB_DIR=apps/web
IS_MONOREPO=yes
IS_NEXTJS=yesThe caller reads these 4 lines and uses them throughout its own execution without having to redetect anything.
When to invoke this helper
Every add-* skill should call this in Step 1 (or wherever it currently does test -f package.json), replacing the ad-hoc detection code. The invocation is a single line:
Invoke
_detect-project-rootto get PROJECT_NAME, WEB_DIR, IS_MONOREPO, IS_NEXTJS.
The helper is idempotent - calling it multiple times in the same session is fine (it just re-reads the filesystem).
What this helper does NOT detect
These checks remain inline in the skills that need them, because they are contextual and used by only 1-2 skills each:
HAS_REAL_DB- mandatory robust check (used byadd-auth,add-backup-db, and any skill that needs a real cloud DB): (1)DATABASE_URLpresent in.env, AND (2) its value does not point to local and is not a placeholder - reject if the value matches@localhost:/@127\.0\.0\.1:/placeholder///postgres:postgres@/YOUR_DB(bootstrapped T3 projects ship a default likepostgresql://postgres:password@localhost:5432/testthat passes Zod validation but is not wired up), AND (3) adrizzle.config.ts/.jsexists (root,apps/web/, orpackages/db/). NEVER rely ongrep DATABASE_URL .envalone - guaranteed false positives.HAS_AUTH- checksrc/server/auth.ts→ only used byadd-google-auth,add-github-authHAS_RESEND/HAS_BREVO- check API key presence → only used byadd-domainVERCEL_LINKED- check.vercel/project.json→ only used by_setup-github-deploy,add-domain,_push-env-vars
Do not try to add these to _detect-project-root. The helper stays minimal.
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
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.

