// Systematic project orientation for unfamiliar codebases. Automatically activates when Claude detects uncertainty about project state, structure, or tooling. Analyzes git state (branch, changes, commits), project type (language, framework, structure), and development tooling (build, test, lint, CI/CD). Provides structured summary with risk flags and recommendations. Use when entering new projects or when working on shaky assumptions.
| name | project-discovery |
| description | Systematic project orientation for unfamiliar codebases. Automatically activates when Claude detects uncertainty about project state, structure, or tooling. Analyzes git state (branch, changes, commits), project type (language, framework, structure), and development tooling (build, test, lint, CI/CD). Provides structured summary with risk flags and recommendations. Use when entering new projects or when working on shaky assumptions. |
| allowed-tools | Bash, Read, Grep, Glob, TodoWrite |
Systematic project orientation to understand codebase state before making changes. Prevents working on incorrect assumptions by establishing clear context about git state, project structure, and development tooling.
Automatic Activation Detection:
Discovery Capabilities:
Output:
This skill automatically activates when Claude's internal reasoning or responses contain uncertainty phrases like:
Rationale: These phrases indicate Claude is working on incomplete context, which can lead to incorrect assumptions, wrong commands, or inappropriate file edits.
Users can explicitly request project discovery with keywords:
Do NOT activate this skill when:
When activated, follow this 5-phase systematic discovery process. Complete all phases before providing the summary.
Goal: Understand version control state to prevent data loss and branch confusion.
Commands to Run:
# Current branch and tracking info
git branch --show-current
git status --short --branch
# Uncommitted changes summary
git status --porcelain | wc -l
git diff --stat
git diff --staged --stat
# Remote sync status
git rev-list --left-right --count HEAD...@{u} 2>/dev/null || echo "No tracking branch"
# Recent commit history (last 10 commits)
git log --oneline --decorate -n 10
# Check for conventional commits pattern
git log --oneline -n 20 | grep -E "^[a-f0-9]+ (feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?:"
What to Extract:
Risk Flags:
Goal: Identify language, framework, and project structure to use correct tooling.
Commands to Run:
# Check for project manifests (determines language/ecosystem)
ls -la | grep -E "(package\.json|Cargo\.toml|pyproject\.toml|go\.mod|Gemfile|pom\.xml|build\.gradle|composer\.json|mix\.exs)"
# Detect monorepo structure
find . -maxdepth 3 -name "package.json" -o -name "Cargo.toml" -o -name "pyproject.toml" | head -20
# Check directory structure
ls -d */ 2>/dev/null | head -20
# Find entry points (main files)
find . -maxdepth 2 -name "main.*" -o -name "index.*" -o -name "app.*" -o -name "__init__.py" 2>/dev/null | head -10
Project Manifest Detection:
| File | Language/Ecosystem | Common Frameworks |
|---|---|---|
package.json | JavaScript/TypeScript | React, Vue, Next.js, Express, Node |
Cargo.toml | Rust | Actix, Rocket, Tokio |
pyproject.toml | Python | Django, FastAPI, Flask |
go.mod | Go | Gin, Echo, Fiber |
Gemfile | Ruby | Rails, Sinatra |
pom.xml / build.gradle | Java | Spring, Quarkus |
composer.json | PHP | Laravel, Symfony |
mix.exs | Elixir | Phoenix |
What to Extract:
Additional Framework Detection:
# JavaScript/TypeScript frameworks
grep -E "(react|vue|next|nuxt|svelte|angular|express|fastify|nest)" package.json 2>/dev/null
# Python frameworks
grep -E "(django|fastapi|flask|pyramid)" pyproject.toml 2>/dev/null
# Check for specific config files
ls | grep -E "(next\.config|vite\.config|webpack\.config|tsconfig|jest\.config|pytest\.ini|setup\.py)"
Goal: Identify build system, test framework, linters, and CI/CD to run correct commands.
Commands to Run:
# Build system detection
ls -la | grep -E "(Makefile|Justfile|package\.json|Cargo\.toml|pyproject\.toml)"
# Check package.json scripts (if JS/TS project)
jq -r '.scripts | keys[]' package.json 2>/dev/null | head -20
# Check Makefile targets
grep "^[a-zA-Z0-9_-]*:" Makefile 2>/dev/null | cut -d: -f1 | head -20
# Test framework detection
find . -maxdepth 3 -name "*test*" -o -name "*spec*" 2>/dev/null | grep -E "\.(js|ts|py|rs|go)$" | head -10
# Linter/formatter detection
ls -la | grep -E "(\.eslintrc|\.prettierrc|ruff\.toml|\.flake8|rustfmt\.toml|\.golangci)"
# Pre-commit hooks
ls -la .git/hooks/ 2>/dev/null | grep -v sample
cat .pre-commit-config.yaml 2>/dev/null | head -20
# CI/CD detection
ls -la .github/workflows/ 2>/dev/null | grep "\.yml"
ls -la .gitlab-ci.yml 2>/dev/null
ls -la .circleci/config.yml 2>/dev/null
What to Extract:
Build System:
Test Framework:
Linters/Formatters:
Pre-commit Hooks:
CI/CD:
Goal: Understand project purpose and setup requirements from documentation.
Commands to Run:
# README first section (project purpose)
head -50 README.md 2>/dev/null
# Check for common documentation files
ls -la | grep -E "(README|CONTRIBUTING|CHANGELOG|LICENSE|ARCHITECTURE|docs/)"
# Look for setup/installation instructions in README
grep -A 10 -i "install\|setup\|getting started" README.md 2>/dev/null | head -30
# Check for documentation directory
ls -la docs/ 2>/dev/null | head -20
What to Extract:
Documentation Quality Indicators:
Goal: Synthesize all findings into actionable summary with risk flags.
Output Format Template:
# Project Discovery Summary
## 📊 Project Overview
- **Type**: [Language] / [Framework] / [Monorepo or Single-project]
- **Purpose**: [One-sentence description from README]
- **Entry Point**: [Main file or startup command]
## 🔀 Git State
- **Branch**: [current-branch-name]
- **Status**: [X files changed, Y staged, Z unstaged] OR [Working tree clean]
- **Remote Sync**: [X commits ahead, Y commits behind] OR [In sync with origin]
- **Last Commit**: [Hash] - [Message] by [Author] ([Time ago])
- **Commit Style**: [Conventional commits detected] OR [Free-form commits]
### ⚠️ Risk Flags
[List any risk flags found in Phase 1, or state "None - safe to proceed"]
## 🛠️ Development Tooling
### Build System
- [Build command: npm run build / cargo build / make / etc.]
### Test Framework
- [Test command: npm test / pytest / cargo test / etc.]
- [Test file location: tests/ or src/__tests__/ or *_test.rs]
### Code Quality
- **Linters**: [ESLint / ruff / clippy / etc.]
- **Formatters**: [Prettier / black / rustfmt / etc.]
- **Pre-commit Hooks**: [Configured] OR [Not configured]
### CI/CD
- [GitHub Actions: X workflows] OR [No CI/CD detected]
- [Workflows: build.yml, test.yml, deploy.yml]
## 📚 Documentation
- **README**: [Present with setup instructions] OR [Missing or minimal]
- **CONTRIBUTING**: [Present] OR [Not present]
- **Other Docs**: [docs/ directory, ARCHITECTURE.md, etc.]
## ✅ Recommendations
[Based on findings, provide 2-4 actionable recommendations, such as:]
1. **Commit uncommitted work** - You have X unstaged files that could be lost
2. **Create feature branch** - Currently on main; create a feature branch before making changes
3. **Pull latest changes** - X commits behind origin/main
4. **Run tests before changes** - Use `[test-command]` to establish baseline
5. **Review setup instructions** - Check README.md for dependencies and setup steps
6. **Safe to proceed** - Working tree clean, branch in sync, tooling detected
---
**Discovery completed in [time]. Ready to work with clear context.**
Risk Flag Priority:
After project discovery, if user asks for deeper investigation:
Explore agentsecurity-audit agentcode-analysis agentProject discovery establishes baseline context; specialized skills handle deep investigation.
If git status fails (not a git repository):
⚠️ **Not a Git Repository**
This skill is designed for git repositories only. This directory does not have a `.git` folder.
**Recommendations:**
1. Initialize git: `git init`
2. Or navigate to a git repository
3. Or use manual exploration tools (ls, find, etc.) for non-git projects
If git repo exists but has no commits:
ℹ️ **Empty Git Repository**
This is a newly initialized git repository with no commits yet.
**Recommendations:**
1. Make initial commit to establish git history
2. Check README.md for project purpose (if exists)
3. Proceed with caution - no version history to reference
If discovery takes >30 seconds (e.g., huge monorepo):
ℹ️ **Large Repository Detected**
Discovery is taking longer than expected. For large monorepos, consider:
1. **Focus on specific subdirectory**: Navigate to relevant sub-project first
2. **Use targeted exploration**: Ask specific questions rather than full discovery
3. **Check monorepo docs**: Often have READMEs explaining structure
If no README.md or minimal content:
⚠️ **Documentation Sparse**
No README.md found or content is minimal.
**Recommendations:**
1. Check commit messages for context about project purpose
2. Examine directory structure and entry points
3. Look for inline code comments
4. Ask user for project context if available
git branch --show-current # Current branch
git status --short --branch # Git state summary
git log --oneline -n 10 # Recent commits
git rev-list --count HEAD...@{u} # Commits ahead/behind remote
ls -la | grep -E "(package\.json|Cargo\.toml|pyproject\.toml|go\.mod)"
find . -maxdepth 3 -name "package.json" # Monorepo detection
jq -r '.scripts | keys[]' package.json # npm scripts
grep "^[a-zA-Z0-9_-]*:" Makefile # Make targets
ls -la .github/workflows/ # GitHub Actions
head -50 README.md # Project description
ls -la | grep -E "(README|CONTRIBUTING)" # Key docs
See examples.md for complete discovery outputs for:
Problem: Claude often works on incomplete assumptions:
Solution: Systematic orientation establishes:
Result: Confident, accurate work on solid foundation rather than shaky assumptions.
For detailed command reference and more examples, see discovery-commands.md and examples.md.