AgentSkillsCN

tech-stack-detection

通过配置文件与目录结构,自动识别项目的技术栈。当您着手新项目、配置开发工具、需要深入了解项目依赖关系,或为特定技术栈初始化技能时,可调用此功能。

SKILL.md
--- frontmatter
name: tech-stack-detection
description: Detects project technology stack from configuration files and directory structure. Use when starting work on a new project, configuring tools, needing to understand project dependencies, or when initializing skills for a specific tech stack.

Tech Stack Detection Skill

Automatically detects project technology stack to customize behavior and create appropriate skills.

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)