Detects TypeScript configuration and available compilation commands in a repository. Returns structured JSON output designed for consumption by the quality-gates-compilation agent...
Detect TypeScript presence and available compilation commands in a repository, returning structured JSON data specifically formatted for the quality-gates-compilation agent to consume.
Invoke this skill during Phase 0 (Environment Detection) of the quality-gates-compilation agent workflow to:
This skill should NOT be invoked for general code review or type checking tasks - only for environment detection.
Search for TypeScript configuration file using Glob tool:
tsconfig.jsonIf NO configuration file found:
typescriptDetected: falseIf configuration file found:
typescriptDetected: trueSearch for TypeScript compilation commands in priority order:
If CLAUDE.md exists:
tsc, typecheck, type-check, compile, make compile, npm run compileRead package.json and examine the scripts section:
Compilation commands (look for these script names):
"compile""type-check""typecheck""tsc""build:types"npm run <script-name>Record package.json as source if command found.
If Makefile exists:
tsc or compilecompile, typecheck, type-check, tscmake <target-name>If no command found in any source:
npx tsc --noEmit"fallback"Construct JSON object with this exact structure:
{
"typescriptDetected": true,
"configFile": {
"path": "tsconfig.json",
"exists": true
},
"command": {
"compile": "npm run compile",
"source": "package.json"
}
}
Field Specifications:
typescriptDetected (boolean): true if tsconfig.json found, false otherwiseconfigFile (object): TypeScript configuration file detailspath (string): Relative path to tsconfig.json (always "tsconfig.json")exists (boolean): Whether file exists (always true if detected)command (object): Compilation command detailscompile (string): Exact command to run for type checkingsource (string): Where command was found ("CLAUDE.md", "package.json", "Makefile", or "fallback")Output the JSON structure in a code block with clear formatting:
## TypeScript Detection Results
```json
{
"typescriptDetected": true,
"configFile": {
"path": "tsconfig.json",
"exists": true
},
"command": {
"compile": "npm run compile",
"source": "package.json"
}
}
```
**Summary:**
- TypeScript detected: Yes/No
- Config file: tsconfig.json
- Command source: <source>
tsconfig.json found but no command:
{
"typescriptDetected": true,
"configFile": {
"path": "tsconfig.json",
"exists": true
},
"command": {
"compile": "npx tsc --noEmit",
"source": "fallback"
}
}
No tsconfig.json found:
{
"typescriptDetected": false,
"configFile": {
"path": "tsconfig.json",
"exists": false
},
"command": {}
}
Command found in multiple sources:
Multiple tsconfig files:
tsconfig.jsonThe quality-gates-compilation agent will:
typescriptDetected to decide whether to proceed or exitcommand.compile for running type checkscommand.source if needed for additional contextThe JSON structure is designed to provide everything the compilation agent needs without requiring additional file reads for command detection.