agentleFS
benmartebenmarte/autoimprove/skills/detect-stack/SKILL.md

detect-stack

Skill5 starsChanged 9 months agoMITView on GitHub

Automatically detect the language, framework, package manager, test runner, linter, and build tool used in the current project. Produces an .claude/autoimprove/config.md file that the improve loop uses as its measurement suite. Run this once before starting the improve loop in a new project.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. JordanCoin/codingskills★ 10same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run these checks to identify the stack:

    line 11
  2. Very specific:

    Test: pytest or python -m pytest

    line 76
  3. Very specific:

    Test: detect from package.json scripts (test, vitest, jest)

    line 82
  4. Very specific:

    Look for make test, make lint, make check, make build targets

    line 116
  5. Distinctive:

    Use this scoring framework regardless of language:

    line 120
  6. Distinctive:

    If a metric doesn't apply (e.g.

    line 129
  7. Distinctive:

    Create the directory and config file:

    line 133
  8. Distinctive:

    If any tool is missing or not configured, suggest the most popular option for that language and offer to help set it up.

    line 197

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Detect Stack Skill

Analyse the project root and produce a .claude/autoimprove/config.md that configures the measurement suite for this specific codebase.

Step 1 — Fingerprint the project

Run these checks to identify the stack:

# Language detection
ls *.go go.mod 2>/dev/null && echo "LANG=go"
ls *.rs Cargo.toml 2>/dev/null && echo "LANG=rust"
ls *.py pyproject.toml setup.py requirements.txt 2>/dev/null && echo "LANG=python"
ls package.json 2>/dev/null && echo "LANG=js"
ls *.java pom.xml build.gradle 2>/dev/null && echo "LANG=java"
ls *.rb Gemfile 2>/dev/null && echo "LANG=ruby"
ls *.php composer.json 2>/dev/null && echo "LANG=php"
ls *.cs *.csproj 2>/dev/null && echo "LANG=csharp"
ls *.swift Package.swift 2>/dev/null && echo "LANG=swift"
ls *.kt *.kts 2>/dev/null && echo "LANG=kotlin"

# Framework detection (JS)
cat package.json 2>/dev/null | grep -E '"next"|"nuxt"|"remix"|"astro"|"svelte"|"react"|"vue"'

# Package manager
ls yarn.lock 2>/dev/null && echo "PKG=yarn"
ls pnpm-lock.yaml 2>/dev/null && echo "PKG=pnpm"
ls bun.lockb 2>/dev/null && echo "PKG=bun"
ls package-lock.json 2>/dev/null && echo "PKG=npm"
ls Pipfile 2>/dev/null && echo "PKG=pipenv"
ls poetry.lock 2>/dev/null && echo "PKG=poetry"
ls Cargo.lock 2>/dev/null && echo "PKG=cargo"

# Test runner
cat package.json 2>/dev/null | grep -E '"jest"|"vitest"|"mocha"|"playwright"|"cypress"'
ls pytest.ini pyproject.toml 2>/dev/null | xargs grep -l "pytest" 2>/dev/null
ls *_test.go 2>/dev/null && echo "TEST=go test"

# Linter
ls .eslintrc* eslint.config* 2>/dev/null && echo "LINT=eslint"
ls .golangci.yml .golangci.yaml 2>/dev/null && echo "LINT=golangci-lint"
ls .rubocop.yml 2>/dev/null && echo "LINT=rubocop"
cat pyproject.toml 2>/dev/null | grep -E "ruff|flake8|pylint"
ls Makefile 2>/dev/null && grep -E "lint|check|fmt" Makefile

# Type checker
cat package.json 2>/dev/null | grep '"typescript"'
ls mypy.ini .mypy.ini 2>/dev/null && echo "TYPES=mypy"
cat pyproject.toml 2>/dev/null | grep -E "mypy|pyright"

Step 2 — Build the measurement suite

Based on what you find, map to these commands:

Language → Commands Reference

Go

  • Type check: go build ./...
  • Test: go test ./...
  • Lint: golangci-lint run or go vet ./...
  • Format check: gofmt -l . | wc -l (unformatted files)

Rust

  • Type check: cargo check
  • Test: cargo test
  • Lint: cargo clippy -- -D warnings
  • Format check: cargo fmt --check

Python

  • Type check: mypy . or pyright (if configured)
  • Test: pytest or python -m pytest
  • Lint: ruff check . or flake8 . or pylint src/
  • Format check: ruff format --check . or black --check .

JavaScript / TypeScript (Node)

  • Type check: npx tsc --noEmit (if tsconfig exists)
  • Test: detect from package.json scripts (test, vitest, jest)
  • Lint: npx eslint . or npm run lint
  • Build: npm run build / yarn build / pnpm build

Next.js / Nuxt / Remix / Astro

  • Same as JS/TS + framework build command
  • Bundle size: check build output for size warnings

Ruby

  • Type check: srb tc (if Sorbet configured)
  • Test: bundle exec rspec or bundle exec rake test
  • Lint: bundle exec rubocop

Java / Kotlin

  • Type check / build: mvn compile or ./gradlew compileKotlin
  • Test: mvn test or ./gradlew test
  • Lint: ./gradlew ktlintCheck or Checkstyle

C# / .NET

  • Type check / build: dotnet build
  • Test: dotnet test
  • Lint: dotnet format --verify-no-changes

PHP

  • Type check: ./vendor/bin/phpstan analyse
  • Test: ./vendor/bin/phpunit
  • Lint: ./vendor/bin/phpcs

Swift

  • Build: swift build
  • Test: swift test
  • Lint: swiftlint

Makefile / custom

  • Look for make test, make lint, make check, make build targets

Step 3 — Assign weights

Use this scoring framework regardless of language:

MetricWeightNotes
Type errors / compile errors40 ptsMust compile cleanly. Errors × penalty.
Build / compile success20 ptsBinary/artifact builds without error
Test suite pass rate30 pts(passing / total) × 30
Lint / style errors10 ptsErrors × penalty, capped at 0

If a metric doesn't apply (e.g. no tests yet, no linter configured), redistribute its weight equally to the others and note it.

Step 4 — Write .claude/autoimprove/config.md

Create the directory and config file:

mkdir -p .claude/autoimprove
# .claude/autoimprove/config.md
<!-- Auto-generated by /autoimprove:setup — edit to customise -->

## Stack
- Language: [detected]
- Framework: [detected or none]
- Package manager: [detected]

## Measurement Commands

### Type Check (40 pts)
\`\`\`bash
[command]
\`\`\`
Error pattern: [regex or grep to count errors]
Penalty: [X] pts per error

### Build (20 pts)
\`\`\`bash
[command]
\`\`\`
Success pattern: [what exit code / output means success]

### Tests (30 pts)
\`\`\`bash
[command]
\`\`\`
Parse pattern: [how to extract pass/fail counts]

### Lint (10 pts)
\`\`\`bash
[command]
\`\`\`
Error pattern: [regex or grep to count errors]
Penalty: [X] pts per error

## Improvement Areas
[list 5-8 language-specific improvement areas based on the detected stack]

## Files to Never Modify
[list lock files, generated files, migration files, .env, etc.]

Step 5 — Confirm with user

Print a summary:

✅ Stack detected: [language] / [framework]
📦 Package manager: [pm]
🧪 Test runner: [runner]
🔍 Linter: [linter]
📐 Type checker: [checker]

Measurement suite written to .claude/autoimprove/config.md.
Run /autoimprove:measure to check your baseline score.

If any tool is missing or not configured, suggest the most popular option for that language and offer to help set it up.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.