AgentSkillsCN

tech-stack-detection

仅从现有项目中的现有文件(如 package.json、tsconfig 等)自动检测技术栈。仅适用于已有成熟代码的现有项目,以发现已安装的组件。对于尚未确定技术栈的新项目,请改用 stack-advisor 技能。

SKILL.md
--- frontmatter
name: tech-stack-detection
description: Auto-detects technology stack from existing project files (package.json, tsconfig, etc.). Use ONLY for existing projects with established code to discover what's already installed. For NEW projects where tech stack hasn't been decided, use stack-advisor skill instead.

Tech Stack Detection Skill

Automatically detects project technology stack from configuration files for existing projects.

⚠️ For Existing Projects Only

This skill scans project files to detect what's already installed. For new projects where you need to choose a tech stack, use the stack-advisor skill instead.

When to Use

ScenarioUse This Skill?
Existing project with code✅ Yes - detect installed stack
New project, user knows stack❌ No - user provides to /speckit.plan
New project, user unsure❌ No - use stack-advisor Q&A

Detection Patterns

Node.js / TypeScript

FileIndicates
package.jsonNode.js project
tsconfig.jsonTypeScript
package-lock.jsonnpm
yarn.lockYarn
pnpm-lock.yamlpnpm
bun.lockbBun

Testing Frameworks

FileFramework
playwright.config.tsPlaywright
playwright.config.jsPlaywright
jest.config.jsJest
jest.config.tsJest
vitest.config.tsVitest
cypress.config.jsCypress

Build Tools / Frameworks

FileFramework
vite.config.tsVite
next.config.jsNext.js
nuxt.config.tsNuxt
astro.config.mjsAstro
svelte.config.jsSvelteKit
angular.jsonAngular
webpack.config.jsWebpack

Python

FileIndicates
pyproject.tomlModern Python
setup.pyPython package
requirements.txtpip dependencies
Pipfilepipenv
poetry.lockPoetry
pytest.inipytest

Other Languages

FileLanguage/Framework
Cargo.tomlRust
go.modGo
GemfileRuby
composer.jsonPHP
pom.xmlJava Maven
build.gradleJava Gradle

Quick Detection Commands

bash
# Bash - Run detection script
./.github/skills/tech-stack-detection/scripts/detect-stack.sh

# PowerShell - Run detection script
.\.github\skills\tech-stack-detection\scripts\detect-stack.ps1

Output Format

Scripts output JSON:

json
{
  "language": "typescript",
  "runtime": "node",
  "package_manager": "npm",
  "frameworks": ["next.js", "react"],
  "testing": ["playwright", "jest"],
  "build_tools": ["webpack"],
  "detected_files": [
    "package.json",
    "tsconfig.json",
    "playwright.config.ts"
  ]
}

Skill Creation Based on Stack

After detection, create appropriate skills:

bash
# For React + TypeScript project
python .github/skills/skill-creator/scripts/init_skill.py react-patterns --path .github/skills

# For Next.js project
python .github/skills/skill-creator/scripts/init_skill.py nextjs-patterns --path .github/skills

Resources

  • scripts/detect-stack.sh - Stack detection (Bash)
  • scripts/detect-stack.ps1 - Stack detection (PowerShell)