From aai-core
Detects project technology stack from package.json, config files, and code patterns before generating technology-specific code to prevent hallucinations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aai-core:stack-detectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides patterns for detecting a project's technology stack to ensure agents use the correct technology-specific patterns.
This skill provides patterns for detecting a project's technology stack to ensure agents use the correct technology-specific patterns.
Problem: Agents with hardcoded technology examples will hallucinate incorrect code for projects using different technologies.
Solution: Always detect the project's actual technology stack BEFORE writing any code.
# Check for package.json
cat package.json 2>/dev/null || echo "No package.json found"
Examine dependencies and devDependencies for technology indicators.
Look for framework-specific configuration files.
Check existing patterns in the codebase.
Indicators:
- package.json: "react", "react-dom"
- Files: jsx/tsx extensions, React imports
- Config: None required (bundler handles it)
Sub-frameworks:
- "next" → Next.js (App Router if app/ exists, Pages Router if pages/)
- "gatsby" → Gatsby
- "remix" → Remix
- "@tanstack/react-router" → TanStack Router
Indicators:
- package.json: "vue"
- Files: .vue extensions
- Config: vite.config with Vue plugin, or vue.config.js
Sub-frameworks:
- "nuxt" → Nuxt 3
- "nuxt-bridge" → Nuxt Bridge
Indicators:
- package.json: "@angular/core"
- Files: .component.ts, .module.ts, .service.ts
- Config: angular.json
Indicators:
- package.json: "svelte"
- Files: .svelte extensions
- Config: svelte.config.js
Sub-frameworks:
- "@sveltejs/kit" → SvelteKit
Indicators:
- package.json: "solid-js"
- Config: vite.config with Solid plugin
Indicators:
- package.json: "express"
- Files: app.use(), app.get(), Router()
Indicators:
- package.json: "fastify"
- Files: fastify.register(), fastify.get()
Indicators:
- package.json: "@nestjs/core"
- Files: @Controller(), @Injectable(), @Module() decorators
- Config: nest-cli.json
Indicators:
- package.json: "hono"
- Files: new Hono(), app.get()
Indicators:
- package.json: "koa"
- Files: new Koa(), ctx.body
Indicators:
- package.json: "next"
- Files: app/api/*/route.ts (App Router) or pages/api/*.ts (Pages Router)
Indicators:
- package.json: "prisma", "@prisma/client"
- Files: prisma/schema.prisma
- Config: prisma/schema.prisma
Usage patterns:
- prisma.model.findMany()
- PrismaClient import
Indicators:
- package.json: "typeorm"
- Files: @Entity(), @Column() decorators
- Config: ormconfig.json, data-source.ts
Usage patterns:
- getRepository()
- createQueryBuilder()
Indicators:
- package.json: "drizzle-orm"
- Files: drizzle/ directory, *.schema.ts
- Config: drizzle.config.ts
Usage patterns:
- db.select().from()
- pgTable(), mysqlTable()
Indicators:
- package.json: "sequelize"
- Files: Model.define(), sequelize.define()
- Config: .sequelizerc
Indicators:
- package.json: "knex"
- Config: knexfile.js, knexfile.ts
Usage patterns:
- knex('table').select()
- knex.schema.createTable()
PostgreSQL:
- DATABASE_URL contains "postgresql://" or "postgres://"
- package.json: "pg"
MySQL:
- DATABASE_URL contains "mysql://"
- package.json: "mysql2"
SQLite:
- DATABASE_URL contains "file:" or ".db"
- package.json: "better-sqlite3", "sqlite3"
- Files: *.db, *.sqlite files
MongoDB:
- DATABASE_URL contains "mongodb://"
- package.json: "mongodb", "mongoose"
Redux:
- package.json: "@reduxjs/toolkit", "redux"
- Files: createSlice(), configureStore()
Zustand:
- package.json: "zustand"
- Files: create() from zustand
Jotai:
- package.json: "jotai"
- Files: atom(), useAtom()
TanStack Query:
- package.json: "@tanstack/react-query"
- Files: useQuery(), useMutation()
Recoil:
- package.json: "recoil"
- Files: atom(), selector(), useRecoilState()
Pinia:
- package.json: "pinia"
- Files: defineStore()
Vuex:
- package.json: "vuex"
- Files: createStore(), mapState()
Indicators:
- package.json: "tailwindcss"
- Config: tailwind.config.js, tailwind.config.ts
- Files: className with utility classes (flex, p-4, text-lg)
Styled Components:
- package.json: "styled-components"
- Files: styled.div``, css``
Emotion:
- package.json: "@emotion/react", "@emotion/styled"
- Files: css``, styled()
Material UI:
- package.json: "@mui/material"
Chakra UI:
- package.json: "@chakra-ui/react"
Radix UI:
- package.json: "@radix-ui/*"
shadcn/ui:
- Files: components/ui/ directory with Radix-based components
Ant Design:
- package.json: "antd"
Indicators:
- Files: *.module.css, *.module.scss
- Imports: import styles from './Component.module.css'
Jest:
- package.json: "jest"
- Config: jest.config.js, jest.config.ts
- Files: *.test.ts, *.spec.ts with describe/it/expect
Vitest:
- package.json: "vitest"
- Config: vitest.config.ts
- Files: Same as Jest but often in vitest-specific config
Mocha:
- package.json: "mocha"
- Config: .mocharc.js, .mocharc.json
- Often with "chai" for assertions
Playwright:
- package.json: "@playwright/test"
- Config: playwright.config.ts
- Files: *.spec.ts in e2e/ or tests/
Cypress:
- package.json: "cypress"
- Config: cypress.config.ts, cypress.json
- Files: cypress/ directory with e2e/, support/
Zod:
- package.json: "zod"
- Files: z.object(), z.string()
Yup:
- package.json: "yup"
- Files: yup.object(), yup.string()
Joi:
- package.json: "joi"
- Files: Joi.object(), Joi.string()
class-validator (NestJS):
- package.json: "class-validator"
- Files: @IsString(), @IsEmail() decorators
Vite:
- package.json: "vite"
- Config: vite.config.ts
Webpack:
- package.json: "webpack"
- Config: webpack.config.js
esbuild:
- package.json: "esbuild"
- Often used through other tools
Turbopack:
- Next.js 13+ with --turbo flag
Run this detection process before writing code:
## Stack Detection Checklist
1. [ ] Read package.json dependencies
2. [ ] Check for framework config files
3. [ ] Examine existing code patterns
4. [ ] Document detected stack:
- Frontend: _______________
- Backend: _______________
- Database/ORM: _______________
- Testing: _______________
- Styling: _______________
- Validation: _______________
5. [ ] Use ONLY detected technology patterns
1. Read package.json
2. Identify all relevant technologies
3. Load appropriate technology-specific skills
4. Use ONLY patterns from detected stack
5. NEVER assume technology - verify first
1. Ask user to clarify technology stack
2. Check for alternative indicators
3. Default to minimal assumptions
4. Explain any assumptions made
Load technology-specific skills after detection:
react-patterns for React projectsvue-patterns for Vue projectsprisma-patterns for Prisma projectstypeorm-patterns for TypeORM projectsjest-patterns for Jest projectsplaywright-patterns for Playwright projectstailwind-patterns for Tailwind projectsnpx claudepluginhub bradtaylorsf/alphaagent-teamGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.