$npx -y skills add launchdarkly/ai-tooling --skill detectDetect repository stack for LaunchDarkly SDK onboarding: languages, frameworks, package managers, monorepo targets, entrypoints, existing LD usage. Nested under sdk-install; next is plan.
| 1 | # Detect repository stack (SDK install) |
| 2 | |
| 3 | Before installing anything, you must understand the project. Identify what the project is built with and whether LaunchDarkly is already present. |
| 4 | |
| 5 | This skill is nested under [LaunchDarkly SDK Install (onboarding)](../SKILL.md); the parent **Step 1** is **detect**. **Next:** [Generate integration plan](../plan/SKILL.md) unless the decision tree sends you elsewhere. |
| 6 | |
| 7 | ### 1. Language and framework |
| 8 | |
| 9 | Look for the indicator files below (and related root layout), then read the relevant manifests to infer language and framework. |
| 10 | |
| 11 | Look for these files to identify the stack: |
| 12 | |
| 13 | | File | Language/Framework | |
| 14 | |------|--------------------| |
| 15 | | `package.json` | JavaScript/TypeScript (check for React, Next.js, Vue, Angular, Express, React Native, Electron, etc.) | |
| 16 | | `requirements.txt`, `pyproject.toml`, `Pipfile`, `setup.py` | Python (check for Django, Flask, FastAPI) | |
| 17 | | `go.mod` | Go (check for Gin, Echo, Fiber, Chi) | |
| 18 | | `pom.xml`, `build.gradle`, `build.gradle.kts` | Java/Kotlin (check for Spring, Quarkus, Android) | |
| 19 | | `Gemfile` | Ruby (check for Rails, Sinatra) | |
| 20 | | `*.csproj`, `*.sln`, `*.fsproj` | .NET/C# (check for ASP.NET, MAUI, Xamarin, WPF, UWP) | |
| 21 | | `composer.json` | PHP (check for Laravel, Symfony) | |
| 22 | | `Cargo.toml` | Rust (check for Actix, Axum, Rocket) | |
| 23 | | `pubspec.yaml` | Flutter/Dart | |
| 24 | | `Package.swift`, `Podfile`, `*.xcodeproj` | Swift/iOS | |
| 25 | | `AndroidManifest.xml` | Android (also check `build.gradle` for `com.android`) | |
| 26 | | `rebar.config`, `mix.exs` | Erlang/Elixir | |
| 27 | | `CMakeLists.txt`, `Makefile` (with C/C++ patterns) | C/C++ (check for `#include` patterns) | |
| 28 | | `*.cabal`, `stack.yaml` | Haskell | |
| 29 | | `*.lua`, `rockspec` | Lua | |
| 30 | | `manifest`, `*.brs` | Roku (BrightScript) | |
| 31 | | `wrangler.toml` | Cloudflare Workers (edge SDK) | |
| 32 | | `vercel.json` with edge functions | Vercel Edge (edge SDK) | |
| 33 | |
| 34 | Read the dependency file to identify the specific framework. For `package.json`, check both `dependencies` and `devDependencies`. |
| 35 | |
| 36 | If you cannot identify the language or framework: |
| 37 | |
| 38 | **D5 -- BLOCKING:** Call your structured question tool now. |
| 39 | - question: "I couldn't detect the project's language or framework. Which SDK would you like to use?" |
| 40 | - options: Present the available SDKs from [SDK recipes](../../references/sdk/recipes.md) as selectable options. |
| 41 | - STOP. Do not write the question as text. Do not continue until the user selects an option. |
| 42 | |
| 43 | ### 2. Package manager |
| 44 | |
| 45 | Identify how the project installs dependencies: |
| 46 | |
| 47 | | Indicator | Package Manager | |
| 48 | |-----------|----------------| |
| 49 | | `package-lock.json` | npm | |
| 50 | | `yarn.lock` | yarn | |
| 51 | | `pnpm-lock.yaml` | pnpm | |
| 52 | | `bun.lockb` | bun | |
| 53 | | `Pipfile.lock` | pipenv | |
| 54 | | `poetry.lock` | poetry | |
| 55 | | `go.sum` | go modules | |
| 56 | | `Gemfile.lock` | bundler | |
| 57 | |
| 58 | Use the detected package manager for all install commands. If multiple lock files exist, prefer the one that was most recently modified. |
| 59 | |
| 60 | ### 3. Monorepo layout |
| 61 | |
| 62 | Some repositories host multiple packages or services. Look for these indicators: |
| 63 | |
| 64 | | File / pattern | Tool or layout | |
| 65 | |----------------|----------------| |
| 66 | | `pnpm-workspace.yaml` | pnpm workspaces | |
| 67 | | `lerna.json` | Lerna | |
| 68 | | `nx.json` | Nx | |
| 69 | | `turbo.json` | Turborepo | |
| 70 | | `rush.json` | Rush | |
| 71 | | `packages/` directory with multiple `package.json` files | Generic monorepo | |
| 72 | |
| 73 | When any of these apply, **do not assume the repo root is the integration target**: |
| 74 | |
| 75 | **D5 -- BLOCKING:** Call your structured question tool now. |
| 76 | - question: "This is a monorepo. Which package, app, or service should I integrate LaunchDarkly into?" |
| 77 | - options: List the discovered packages/apps as selectable options. |
| 78 | - STOP. Do not write the question as text. Do not continue until the user selects an option. |
| 79 | |
| 80 | Then run the rest of this detect step -- language, package manager, entrypoint, and SDK search -- **in that target directory** (and its subtree), not only at the root. |
| 81 | |
| 82 | ### 4. Application entrypoint |
| 83 | |
| 84 | Find the main file where the application starts. In a monorepo, apply the patterns below within the chosen package after [section 3 Monorepo layout](#3-monorepo-layout). Common patterns: |
| 85 | |
| 86 | - **Node.js (server)**: Check `package.json` `"main"` field, or look for `index.js`, `server.js`, `app.js`, `src/index.ts` |
| 87 | - **NestJS**: Look for `src/main.ts` or `src/main.js` |
| 88 | - **Python**: Look for `app.py`, `main.py`, `manage.py`, `wsgi.py`, or the `[tool.poetry.scripts]` section |
| 89 | - **Go**: Look for `main.go` or `cmd/*/main.go` |
| 90 | - **Java**: Search for `public static void main` or `@SpringBootApplication` |
| 91 | - **Ruby**: Look for `config.ru`, `config/application.rb` |
| 92 | - **React/Vue/Angular**: Look for `src/index.tsx`, `src/main.tsx`, `src/App.tsx`, `src/mai |