project-stage-detection

v2026.09.24

Detect project maturity stage (new/early/mid/mature) from file structure and route to appropriate onboarding workflow

GitHub
Install command
npx skhub add oimiragieo/project-stage-detection
Markdown
SKILL.md

Project Stage Detection

Purpose

Detect the maturity stage of a software project by analyzing its file structure, configuration files, documentation, and test coverage. Route to the appropriate onboarding or initialization workflow based on the detected stage.

When to Invoke

Skill({ skill: 'project-stage-detection' });

Invoke when:

  • Starting work on an unfamiliar repository
  • Onboarding a new project into agent-studio
  • Determining which workflow to apply (bootstrap vs. enhance vs. optimize)
  • Assessing project health at session start
  • The planner needs context about project maturity before decomposing tasks

Stage Definitions

StageDescriptionIndicators
newFreshly initialized, no meaningful contentOnly boilerplate files, no src/
earlyHas core structure but missing key componentssrc/ exists, no tests or CI
midFunctional codebase, gaps in quality infrastructureTests exist, no CI/CD or sparse docs
matureFull-featured with CI/CD, tests, docs, lintingAll quality gates present

Workflow

Step 1: Collect File Structure Evidence

Command:

node .claude/skills/project-stage-detection/scripts/main.cjs --dir <project_root>

Expected output: JSON with stage, confidence, indicators, and recommendations.

Verify: Exit code 0 and valid JSON with a stage field.

Step 2: Evaluate Stage Indicators

The script checks for these indicators, scoring each:

IndicatorWeightChecked Path(s)
Source directory existsHIGHsrc/, lib/, app/
Tests existHIGHtests/, test/, spec/, __tests__/
CI/CD pipeline configuredHIGH.github/workflows/, .gitlab-ci.yml
Package.json / pyproject.tomlMEDpackage.json, pyproject.toml
README exists and non-trivialMEDREADME.md (>500 bytes)
Linting configuredMED.eslintrc*, .ruff.toml, pylintrc
Documentation directoryLOWdocs/, .claude/docs/
Changelog presentLOWCHANGELOG.md, CHANGELOG.rst
Dependencies lockedLOWpackage-lock.json, pnpm-lock.yaml

Step 3: Compute Stage Score

Score RangeStage
0–2new
3–5early
6–7mid
8–9mature

Command to verify score:

node .claude/skills/project-stage-detection/scripts/main.cjs --dir . --json | node -e "const d=require('fs').readFileSync('/dev/stdin','utf8');const r=JSON.parse(d);console.log('Stage:',r.stage,'Score:',r.score,'Confidence:',r.confidence)"

Step 4: Route to Appropriate Workflow

Based on the detected stage:

StageRecommended Action
newInvoke project-onboarding skill to bootstrap
earlyInvoke gap-detection to find missing infrastructure
midInvoke gap-detection then proactive-audit
matureInvoke gap-detection as health check only

Routing command:

// After detection
if (result.stage === 'new') {
  Skill({ skill: 'project-onboarding' });
} else {
  Skill({ skill: 'gap-detection' });
}

Step 5: Write Detection Report

Output location: .claude/context/reports/backend/project-stage-report-YYYY-MM-DD.md

Report format:

# Project Stage Detection Report

**Date:** {{date}}
**Project:** {{project_root}}
**Detected Stage:** {{stage}}
**Confidence:** {{confidence}}%

## Evidence

{{indicators_table}}

## Recommendations

{{recommendations_list}}

Output Schema

See schemas/output.schema.json for the full structured output contract.

Enforcement Hooks

Input validated against schemas/input.schema.json before execution. Output contract defined in schemas/output.schema.json.

Assigned Agents

  • planner — uses on task start to calibrate workflow complexity
  • architect — uses for brownfield assessment before redesign
  • developer — uses to determine onboarding steps for new repos
  • master-orchestrator — uses to route to correct initialization workflow

Memory Protocol

Before starting:

Read .claude/context/memory/learnings.md for any previously detected stage for this project. If the stage was recently detected (within 7 days), skip re-detection and use cached result.

After completing:

Append to .claude/context/memory/learnings.md:

## Project Stage Detection — {{date}}

- Project: {{project_root}}
- Stage: {{stage}} (confidence: {{confidence}}%)
- Key gaps: {{gap_summary}}
- Recommended next action: {{next_action}}

Anti-Patterns

  • Never hard-code stage thresholds — always compute from indicators.
  • Never report mature for a project with no tests — tests are a required mature indicator.
  • Never run detection on .claude/ subdirectories — scan the project root only.
  • Never block on missing files — handle gracefully with existsSync checks.
Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

Not specified

Source path

.claude/skills/project-stage-detection

Default branch

main

Latest commit

64b580e

Tree SHA

42a1df4