Auto-detect programming languages, frameworks, and tools used in the project
Detect programming languages, frameworks, and tools used in the project.
Scan project root for these files:
# Node.js/TypeScript
package.json
package-lock.json
yarn.lock
pnpm-lock.yaml
tsconfig.json
# Python
requirements.txt
requirements-dev.txt
pyproject.toml
setup.py
setup.cfg
Pipfile
poetry.lock
# Go
go.mod
go.sum
# Rust
Cargo.toml
Cargo.lock
# Java/Kotlin
pom.xml
build.gradle
build.gradle.kts
settings.gradle
# Ruby
Gemfile
Gemfile.lock
# PHP
composer.json
composer.lock
# Elixir
mix.exs
mix.lock
# Dart/Flutter
pubspec.yaml
pubspec.lock
# Clojure
project.clj
build.boot
# Crystal
shard.yml
shard.lock
# Scala
build.sbt
# Swift
Package.swift
Package.resolved
# C/C++
CMakeLists.txt
Makefile
configure.ac
# Haskell
package.yaml
*.cabal
stack.yaml
For each file found, extract information:
package.json (Node.js/TypeScript)
# Detect TypeScript
if grep -q '"typescript"' package.json || grep -q '"@types/'" package.json; then
echo "typescript"
fi
# Detect frameworks
dependencies=$(cat package.json | grep -A 100 '"dependencies"' | grep -E '"(react|vue|angular|next|express|fastify|nest|@nestjs/core)"' | sed 's/.*"\([^"]*\)".*/\1/')
requirements.txt / pyproject.toml (Python)
# Detect Python
echo "python"
# Detect frameworks
if grep -qE "(django|flask|fastapi|tornado)" requirements.txt 2>/dev/null; then
grep -E "(django|flask|fastapi|tornado)" requirements.txt | sed 's/==.*//' | head -1
fi
if grep -qE "(django|flask|fastapi|tornado)" pyproject.toml 2>/dev/null; then
grep -E "(django|flask|fastapi|tornado)" pyproject.toml | sed 's/.*"\([^"]*\)".*/\1/'
fi
go.mod (Go)
# Detect Go
echo "go"
# Detect frameworks
if grep -qE "(gin|echo|fiber|go-chi|grpc)" go.mod; then
grep -E "(gin|echo|fiber|go-chi|grpc)" go.mod | sed 's/.*\t//' | head -1
fi
Cargo.toml (Rust)
# Detect Rust
echo "rust"
# Detect frameworks
if grep -qE "(actix|axum|rocket|tokio)" Cargo.toml; then
grep -E "(actix|axum|rocket|tokio)" Cargo.toml | sed 's/.* = "\([^"]*\)".*/\1/'
fi
Create language map:
{
"package.json": ["javascript", "typescript"],
"tsconfig.json": ["typescript"],
"requirements.txt": ["python"],
"pyproject.toml": ["python"],
"setup.py": ["python"],
"go.mod": ["go"],
"Cargo.toml": ["rust"],
"pom.xml": ["java"],
"build.gradle": ["java", "kotlin"],
"Gemfile": ["ruby"],
"composer.json": ["php"],
"mix.exs": ["elixir"],
"pubspec.yaml": ["dart"],
"project.clj": ["clojure"],
"shard.yml": ["crystal"],
"build.sbt": ["scala"]
}
Also check for source files:
.ts → TypeScript.tsx → TypeScript React.js → JavaScript.jsx → JavaScript React.py → Python.go → Go.rs → Rust.java → Java.kt → Kotlin.rb → Ruby.php → PHP.ex → Elixir.dart → Dart.clj → Clojure.cr → Crystal.scala → ScalaParse dependencies to detect frameworks:
JavaScript/TypeScript Frameworks
{
"react": "React",
"react-dom": "React",
"next": "Next.js",
"nuxt": "Nuxt",
"vue": "Vue",
"vue-router": "Vue",
"angular": "Angular",
"@angular/core": "Angular",
"@angular/common": "Angular",
"svelte": "Svelte",
"svelte-kit": "SvelteKit",
"express": "Express",
"fastify": "Fastify",
"nest": "NestJS",
"@nestjs/core": "NestJS",
"@nestjs/common": "NestJS",
"koa": "Koa",
"hapi": "Hapi"
}
Python Frameworks
{
"django": "Django",
"djangorestframework": "Django REST Framework",
"flask": "Flask",
"fastapi": "FastAPI",
"tornado": "Tornado",
"aiohttp": "aiohttp",
"quart": "Quart",
"sanic": "Sanic",
"starlette": "Starlette"
}
Go Frameworks
{
"github.com/gin-gonic/gin": "Gin",
"github.com/labstack/echo/v4": "Echo",
"github.com/gofiber/fiber/v2": "Fiber",
"github.com/go-chi/chi/v5": "Chi",
"google.golang.org/grpc": "gRPC",
"github.com/gorilla/mux": "Mux"
}
Rust Frameworks
{
"actix-web": "Actix Web",
"axum": "Axum",
"rocket": "Rocket",
"tokio": "Tokio",
"warp": "Warp",
"tide": "Tide"
}
{
"vite": "Vite",
"webpack": "Webpack",
"rollup": "Rollup",
"parcel": "Parcel",
"esbuild": "esbuild",
"babel": "Babel",
"tsc": "TypeScript Compiler",
"pytest": "pytest",
"jest": "Jest",
"vitest": "Vitest",
"mocha": "Mocha",
"jasmine": "Jasmine",
"go test": "Go Test",
"cargo test": "Cargo Test",
"gradle": "Gradle",
"maven": "Maven"
}
Save to .opencode/config/stack.json:
{
"languages": ["typescript", "python"],
"frameworks": ["React", "FastAPI"],
"package_managers": ["npm", "pip"],
"build_tools": ["Vite", "pytest"],
"test_frameworks": ["Vitest", "pytest"],
"detected_at": "2026-01-18T13:45:00Z",
"manual_override": false,
"files_detected": [
"package.json",
"tsconfig.json",
"requirements.txt",
"pyproject.toml"
]
}
Stack Detection Summary
Languages:
✓ TypeScript (from package.json, tsconfig.json)
✓ Python (from requirements.txt, pyproject.toml)
Frameworks:
✓ React (from package.json)
✓ FastAPI (from requirements.txt)
Package Managers:
✓ npm (from package.json)
✓ pip (from requirements.txt)
Build Tools:
✓ Vite (from package.json)
✓ pytest (from pyproject.toml)
Test Frameworks:
✓ Vitest (from package.json)
✓ pytest (from requirements.txt)
Configuration saved to: .opencode/config/stack.json
Check if .opencode/config/stack.json exists and has manual_override: true
{
"detected": {
"languages": ["typescript", "python"],
"frameworks": ["React", "FastAPI"]
},
"override": {
"languages": ["typescript"],
"frameworks": ["React"]
},
"merged": {
"languages": ["typescript"],
"frameworks": ["React"],
"manual_override": true
}
}
Detected stack: TypeScript, Python, React, FastAPI
Manual override: TypeScript, React
Which to use?
1) Detected stack
2) Manual override
3) Merge both
Select option [1/2/3]:
/skill detect-stack
/skill detect-stack --override '{"languages": ["typescript"], "frameworks": ["react"]}'
Provide manual stack configuration
/skill detect-stack --append '{"languages": ["rust"]}'
Append to detected stack
/skill detect-stack --json
Output JSON only
/skill detect-stack --force
Force re-detection (overwrite existing config)
None required
STACK_OVERRIDE: JSON string with manual overrideSTACK_APPEND: JSON string with items to appendFORCE_DETECT: Set to "1" to force re-detectionOUTPUT_FORMAT: json or text (default: text)builder: Analyzes project structure and filesWarning: No package manager files found
Stack cannot be auto-detected
Please manually configure stack in .opencode/config/stack.json or add package manager files
Warning: Language 'erlang' detected but not supported
Adding to stack with default configuration
Consider manually adding lint/test commands to scripts
Error: Failed to parse package.json
Reason: Invalid JSON
Please check file format or manually configure stack
$ /skill detect-stack
[Scan Project Files]
Searching for package manager files...
✓ Found: package.json
✓ Found: tsconfig.json
✓ Found: requirements.txt
✓ Found: pyproject.toml
✓ Found: go.mod
[Analyze Languages]
Detected:
✓ TypeScript (from package.json, tsconfig.json)
✓ Python (from requirements.txt, pyproject.toml)
✓ Go (from go.mod)
[Analyze Frameworks]
Analyzing package.json...
✓ React detected
✓ Next.js detected
✓ Vitest detected
Analyzing requirements.txt...
✓ FastAPI detected
✓ pytest detected
Analyzing go.mod...
✓ Gin detected
[Generate Stack Report]
Stack Detection Summary
Languages:
✓ TypeScript
✓ Python
✓ Go
Frameworks:
✓ React, Next.js
✓ FastAPI
✓ Gin
Package Managers:
✓ npm
✓ pip
✓ go
Build Tools:
✓ Vite
✓ pytest
✓ Go Test
Test Frameworks:
✓ Vitest
✓ pytest
✓ Go Test
Configuration saved to: .opencode/config/stack.json
[Confirmation]
Is this stack correct? [yes/no/edit]:
> yes
✓ Stack detection complete!
Next steps:
- Run /skill update-stack-config to configure linting and testing
- Review .opencode/config/stack.json
- Manually edit stack.json if needed
.opencode/config/stack.json.opencode/config/stack.json.opencode/config/stack.json--force to re-detect.opencode/config/stack.jsonAdd custom language patterns:
{
"language_patterns": {
".erl": "erlang",
"*.ex": "elixir"
}
}
Add custom framework patterns:
{
"framework_patterns": {
"phoenix": "Phoenix Framework",
"play": "Play Framework"
}
}
Add custom file mappings:
{
"file_mappings": {
"rebar.config": ["erlang"],
"mix.exs": ["elixir"]
}
}