detect-project-type
Detect project type and configuration for generic application releases
What this skill does
# Detect Project Type
## Purpose
Analyzes the project directory to determine the project type (Node.js, Python, Rust, Go, Java, generic, Claude Code plugin, or monorepo) and loads or generates appropriate release configuration. This is the foundation for generic release automation that works with any application.
## Input Context
The skill expects to be invoked in a project root directory. It examines:
- Configuration files (`.release-config.json`, `.releaserc.json`)
- Project markers (package.json, Cargo.toml, pyproject.toml, etc.)
- Directory structure (monorepo patterns)
- Version file locations
## Workflow
### 1. Check for Explicit Configuration
First, check if user has provided explicit configuration:
```bash
# Check for config files in order of precedence
if [ -f ".release-config.json" ]; then
config_file=".release-config.json"
elif [ -f ".releaserc.json" ]; then
config_file=".releaserc.json"
elif [ -f ".releaserc" ]; then
config_file=".releaserc"
else
config_file=""
fi
```
If config file exists:
- Parse JSON to extract configuration
- Validate configuration (required fields, file paths exist)
- Return configuration with `config_source: "explicit"`
See [Configuration Reference](../../docs/configuration.md) for schema details.
### 2. Auto-Detect Project Type
If no configuration file, detect project type from filesystem markers:
```bash
# Detection logic (in priority order)
project_type="unknown"
# Check for monorepo first (multiple package.json or project files in subdirs)
if [ $(find packages -name "package.json" 2>/dev/null | wc -l) -gt 1 ] || \
[ $(find apps -name "package.json" 2>/dev/null | wc -l) -gt 1 ]; then
project_type="monorepo"
# Node.js project
elif [ -f "package.json" ]; then
project_type="nodejs"
# Python project
elif [ -f "pyproject.toml" ]; then
project_type="python"
# Rust project
elif [ -f "Cargo.toml" ]; then
project_type="rust"
# Go project
elif [ -f "go.mod" ]; then
project_type="go"
# Java/Gradle project
elif [ -f "build.gradle" ] || [ -f "gradle.properties" ]; then
project_type="java"
# Maven project
elif [ -f "pom.xml" ]; then
project_type="java"
# Claude Code plugin
elif [ -f ".claude-plugin/plugin.json" ]; then
project_type="claude-plugin"
# Claude Code marketplace
elif [ -f ".claude-plugin/marketplace.json" ]; then
project_type="claude-marketplace"
# Generic project with VERSION file
elif [ -f "VERSION" ] || [ -f "version.txt" ] || [ -f ".version" ]; then
project_type="generic"
# Legacy Python (setup.py)
elif [ -f "setup.py" ]; then
project_type="python"
else
project_type="unknown"
fi
```
### 3. Determine Version Files
Based on detected project type, determine version file locations:
**Node.js:**
```bash
version_files=("package.json")
adapter="json"
field="version"
```
**Python:**
```bash
# Check for multiple version sources
version_files=()
if [ -f "pyproject.toml" ]; then
version_files+=("pyproject.toml")
fi
# Look for __version__.py files
if [ -d "src" ]; then
# Find __version__.py in src directory
version_file=$(find src -name "__version__.py" | head -1)
if [ -n "$version_file" ]; then
version_files+=("$version_file")
fi
fi
# Legacy setup.py
if [ -f "setup.py" ]; then
version_files+=("setup.py")
fi
```
**Rust:**
```bash
version_files=("Cargo.toml")
```
**Go:**
```bash
# Go uses git tags for versions, no version file
version_files=()
version_via_tags=true
```
**Java/Gradle:**
```bash
if [ -f "gradle.properties" ]; then
version_files=("gradle.properties")
elif [ -f "build.gradle" ]; then
version_files=("build.gradle")
fi
```
**Maven:**
```bash
version_files=("pom.xml")
```
**Claude Code Plugin:**
```bash
version_files=(".claude-plugin/plugin.json")
```
**Generic:**
```bash
# Find version file by name
if [ -f "VERSION" ]; then
version_files=("VERSION")
elif [ -f "version.txt" ]; then
version_files=("version.txt")
elif [ -f ".version" ]; then
version_files=(".version")
fi
```
### 4. Determine Changelog File
```bash
# Check for existing changelog in common formats
if [ -f "CHANGELOG.md" ]; then
changelog_file="CHANGELOG.md"
elif [ -f "HISTORY.md" ]; then
changelog_file="HISTORY.md"
elif [ -f "CHANGES.md" ]; then
changelog_file="CHANGES.md"
elif [ -f "NEWS.md" ]; then
changelog_file="NEWS.md"
elif [ -f "CHANGES.rst" ]; then
changelog_file="CHANGES.rst"
else
# Will be created
changelog_file="CHANGELOG.md"
fi
```
### 5. Determine Tag Pattern
```bash
# Project-specific tag patterns
case "$project_type" in
"nodejs"|"python"|"rust"|"generic")
tag_pattern="v{version}"
;;
"go")
tag_pattern="v{version}" # Go convention
;;
"java")
tag_pattern="v{version}"
;;
"claude-plugin")
# Use plugin name from plugin.json
plugin_name=$(jq -r '.name' .claude-plugin/plugin.json)
tag_pattern="${plugin_name}-v{version}"
;;
"claude-marketplace")
tag_pattern="marketplace-v{version}"
;;
"monorepo")
tag_pattern="{package}-v{version}"
;;
esac
```
### 6. Detect Monorepo Packages
For monorepo projects, scan for packages:
```bash
monorepo_packages=()
# Check common monorepo patterns
for pattern in "packages/*" "apps/*" "libs/*"; do
for dir in $pattern; do
if [ -d "$dir" ]; then
# Check if directory contains a project marker
if [ -f "$dir/package.json" ] || \
[ -f "$dir/Cargo.toml" ] || \
[ -f "$dir/pyproject.toml" ]; then
monorepo_packages+=("$dir")
fi
fi
done
done
```
### 7. Determine Documentation Files
```bash
documentation_files=("README.md")
# Add common doc patterns
if [ -d "docs" ]; then
documentation_files+=("docs/**/*.md")
fi
if [ -d "website/docs" ]; then
documentation_files+=("website/docs/**/*.md")
fi
```
### 8. Validation
Validate the detected configuration:
**Required validations:**
- At least one version file exists (unless Go project)
- Version files are readable
- Project type is not "unknown"
**Warnings:**
- No changelog file exists (will be created)
- No README.md exists
## Output Format
Return structured configuration:
```json
{
"project_type": "nodejs",
"config_source": "auto-detected",
"version_files": [
{
"path": "package.json",
"adapter": "json",
"field": "version",
"exists": true
}
],
"changelog_file": "CHANGELOG.md",
"changelog_format": "keep-a-changelog",
"tag_pattern": "v{version}",
"tag_message": "Release v{version}",
"conventional_commits": true,
"documentation_files": [
"README.md",
"docs/**/*.md"
],
"monorepo": {
"enabled": false,
"packages": []
},
"validations": {
"errors": [],
"warnings": [
"No CHANGELOG.md found, will be created"
]
}
}
```
## Examples
### Example 1: Node.js Project
**Project structure:**
```
/
├── package.json
├── README.md
└── src/
```
**Detection result:**
```json
{
"project_type": "nodejs",
"config_source": "auto-detected",
"version_files": [
{
"path": "package.json",
"adapter": "json",
"field": "version"
}
],
"changelog_file": "CHANGELOG.md",
"tag_pattern": "v{version}",
"conventional_commits": true
}
```
### Example 2: Python Package
**Project structure:**
```
/
├── pyproject.toml
├── src/
│ └── mypackage/
│ └── __version__.py
└── README.md
```
**Detection result:**
```json
{
"project_type": "python",
"config_source": "auto-detected",
"version_files": [
{
"path": "pyproject.toml",
"adapter": "toml",
"section": "project"
},
{
"path": "src/mypackage/__version__.py",
"adapter": "python-file"
}
],
"changelog_file": "CHANGELOG.md",
"tag_pattern": "v{version}"
}
```
### Example 3: Rust Crate
**Project structure:**
```
/
├── Cargo.toml
├── src/
└── README.md
```
**Detection result:**
```json
{
"project_type": "rust",
"config_source": "auto-detected",
"version_files": [
{
"path": "Cargo.toml",
"adapter": "toml",
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.