project-contractor
Enforces a pre-work project analysis phase to ensure full context before making code changes.
Install
mkdir -p .claude/skills/project-contractor && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18764" && unzip -o skill.zip -d .claude/skills/project-contractor && rm skill.zipInstalls to .claude/skills/project-contractor
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Comprehensive codebase survey and understanding system that forces Claude to fully understand a project before making any changes. Use this skill BEFORE starting work on any new or existing project. Triggers on phrases like "start working on", "help me build", "continue the project", "fix my code", "add a feature", or when encountering an unfamiliar codebase. Employs parallel subagent analysis to survey all aspects of a project - architecture, connections, integrations, operations - and creates a living SOURCE-OF-TRUTH.md that becomes the canonical reference. PREVENTS assumptions and guessing. Claude must KNOW before it can DO.Key capabilities
- →Create a survey workspace
- →Dispatch subagents for parallel analysis
- →Collect and synthesize subagent reports
- →Generate SOURCE-OF-TRUTH.md
- →Get user validation before proceeding
- →Map the complete project structure
How it works
The skill orchestrates a complete survey by deploying subagents to map project structure, trace connections, and validate operations. It synthesizes their reports into a SOURCE-OF-TRUTH.md document.
Inputs & outputs
When to use project-contractor
- →Starting work on a new project
- →Returning to an unfamiliar codebase
- →Preparing for large refactors
About this skill
Project Contractor Skill
A contractor doesn't show up and start swinging a hammer. They survey the job site, understand the existing structure, trace the wiring, follow the plumbing, and ONLY THEN make a plan.
This skill enforces that discipline for Claude Code.
The Core Rule
KNOW BEFORE YOU DO
Claude must demonstrate understanding before making changes.
If Claude doesn't know → Claude asks or surveys.
If Claude assumes → Claude is wrong.
When This Skill Triggers
- Starting work on any project for the first time
- Returning to a project after context loss
- User says "help me with my project" without clear scope
- User requests changes to unfamiliar code
- Before any refactoring or restructuring
- Before adding features that touch multiple systems
Phase 0: Pre-Flight Check
Before doing ANYTHING else:
# Check if we've already surveyed this project
if [ -f "SOURCE-OF-TRUTH.md" ]; then
echo "SOURCE-OF-TRUTH.md exists - reading current state"
# Read and validate the existing source of truth
else
echo "No SOURCE-OF-TRUTH.md found - FULL SURVEY REQUIRED"
# Trigger Phase 1
fi
# Check for existing CLAUDE.md
if [ -f "CLAUDE.md" ]; then
echo "CLAUDE.md exists - reading project context"
fi
Critical: If SOURCE-OF-TRUTH.md exists but is outdated (user says things have changed), re-run the survey.
Phase 1: The Complete Survey
Orchestrator Responsibilities
The orchestrator (main Claude instance) MUST:
- Create the survey workspace
- Dispatch subagents for parallel analysis
- Collect and synthesize subagent reports
- Generate SOURCE-OF-TRUTH.md
- Get user validation before proceeding
# Create survey workspace
mkdir -p .contractor-survey/{reports,evidence}
echo "Survey started: $(date)" > .contractor-survey/survey.log
Subagent Deployment
Deploy these subagents in parallel. Each produces a structured report.
SUBAGENT 1: Structure Mapper
ROLE: Map the complete project structure
OUTPUT: .contractor-survey/reports/structure.md
TASKS:
1. Create complete directory tree (excluding node_modules, .git, dist)
2. Identify entry points (index.*, main.*, app.*, server.*)
3. Document the naming conventions used
4. Identify frameworks and major dependencies
5. Note any unusual or non-standard organization
6. Find all configuration files and their purposes
DELIVERABLE FORMAT:
# Structure Report
## Directory Tree
[tree output]
## Entry Points
- Frontend: [path]
- Backend: [path]
- Other: [list]
## Frameworks Detected
- [name]: [version] - [purpose]
## Configuration Files
| File | Purpose | Critical Settings |
|------|---------|-------------------|
## Non-Standard Patterns
- [description]
SUBAGENT 2: Connection Tracer
ROLE: Trace all connections and integrations
OUTPUT: .contractor-survey/reports/connections.md
TASKS:
1. Find all API endpoints (internal and external)
2. Identify database connections and schemas
3. Map WebSocket/real-time connections
4. Trace authentication flows
5. Document third-party service integrations
6. Find all environment variables and their purposes
7. Map inter-service communication patterns
DELIVERABLE FORMAT:
# Connection Report
## Internal APIs
| Endpoint | Method | Handler | Purpose |
|----------|--------|---------|---------|
## External APIs
| Service | Auth Method | Env Vars | Purpose |
|---------|-------------|----------|---------|
## Database Connections
- Type: [PostgreSQL/MongoDB/etc]
- Connection string var: [name]
- Schema location: [path]
## Real-Time Connections
- Protocol: [WebSocket/SSE/MQTT]
- Handler: [file:line]
- Events: [list]
## Environment Variables
| Variable | Purpose | Example | Required |
|----------|---------|---------|----------|
SUBAGENT 3: Operations Validator
ROLE: Validate and document all operational commands
OUTPUT: .contractor-survey/reports/operations.md
TASKS:
1. Find ALL ways to start development servers
2. Find ALL database migration methods
3. Find ALL deployment methods
4. Find ALL test commands
5. Find ALL build commands
6. TEST each command (dry-run if destructive)
7. Document which commands are CANONICAL (actually work)
DELIVERABLE FORMAT:
# Operations Report
## Development Server
CANONICAL COMMAND: [the one that actually works]
TESTED: [yes/no]
RESULT: [output summary]
Alternative methods found (may be outdated):
- [command] - Status: [works/broken/deprecated]
## Database Operations
CANONICAL MIGRATION: [command]
CANONICAL SEED: [command]
Schema location: [path]
## Deployment
CANONICAL DEPLOY: [command or process]
CI/CD: [yes/no - describe]
Manual steps required: [list]
## Testing
CANONICAL TEST: [command]
Coverage: [percentage if available]
## Build
CANONICAL BUILD: [command]
Output location: [path]
SUBAGENT 4: State Analyzer
ROLE: Understand current project state and history
OUTPUT: .contractor-survey/reports/state.md
TASKS:
1. Check git status and recent commits
2. Identify active branches and their purposes
3. Find open issues/todos in code
4. Check for existing documentation and its accuracy
5. Identify any broken or deprecated code
6. Find all TODO/FIXME/HACK comments
7. Assess test coverage and health
DELIVERABLE FORMAT:
# State Report
## Git Status
Current branch: [name]
Uncommitted changes: [yes/no - summary]
Recent commits (last 5):
- [hash] [message] [date]
## Active Branches
| Branch | Purpose | Last Commit |
|--------|---------|-------------|
## Code Health
TODOs found: [count]
FIXMEs found: [count]
HACKs found: [count]
Critical issues: [list]
## Documentation Accuracy
| Doc File | Accurate | Issues |
|----------|----------|--------|
## Test Health
Test coverage: [percentage]
Failing tests: [count]
Skipped tests: [count]
SUBAGENT 5: Dependency Auditor
ROLE: Audit all dependencies and their relationships
OUTPUT: .contractor-survey/reports/dependencies.md
TASKS:
1. List all production dependencies
2. List all dev dependencies
3. Check for unused dependencies
4. Check for outdated dependencies
5. Check for security vulnerabilities
6. Identify circular dependencies
7. Document critical dependencies that everything depends on
DELIVERABLE FORMAT:
# Dependencies Report
## Critical Dependencies
[These are core to the application - breaking changes here break everything]
- [package]: [purpose]
## Production Dependencies
| Package | Version | Purpose | Outdated |
|---------|---------|---------|----------|
## Dev Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
## Issues Found
- Unused: [list]
- Vulnerable: [list]
- Circular: [list]
Phase 2: Synthesis
After all subagents complete, the orchestrator synthesizes their reports into SOURCE-OF-TRUTH.md:
# SOURCE OF TRUTH
Generated: [timestamp]
Project: [name]
Last validated: [timestamp]
## Quick Reference
### Start Development
```bash
[CANONICAL COMMAND FROM OPERATIONS REPORT]
Database Migration
[CANONICAL COMMAND]
Deploy to Production
[CANONICAL COMMAND or PROCESS]
Run Tests
[CANONICAL COMMAND]
Architecture Overview
[Synthesized from Structure + Connections reports]
Frontend
- Framework: [name]
- Entry: path
- Key directories: [list]
Backend
- Framework: [name]
- Entry: path
- Key directories: [list]
Database
- Type: [name]
- Connection: [env var]
- Schema: path
External Integrations
[From Connections report]
| Service | Purpose | Auth | Env Vars |
|---|
Environment Variables Required
[Consolidated from all reports]
| Variable | Purpose | Example | Where Used |
|---|
Known Issues
[From State report]
Files Claude Must Not Touch Without Asking
[Critical files that could break everything]
Assumptions Log
[Start empty - Claude adds here when it makes ANY assumption]
VALIDATION STATUS: [PENDING USER VALIDATION] User validated: [no]
## Phase 3: User Validation
**CRITICAL**: Before proceeding with ANY work, Claude must:
1. Present the SOURCE-OF-TRUTH.md to the user
2. Ask: "Does this accurately reflect your project? Any corrections?"
3. Update based on user feedback
4. Get explicit "yes, proceed" before continuing
```markdown
I've completed the project survey. Here's what I understand:
[Summary of key findings]
**Before I do anything else, I need you to validate this:**
1. Are the canonical commands correct?
2. Are there any integrations I missed?
3. Are there any files I should never touch?
4. Anything else I got wrong?
Once you confirm, I'll update SOURCE-OF-TRUTH.md and we can proceed.
The Assumptions Log
Every time Claude makes an assumption (no matter how small), it MUST be logged:
## Assumptions Log
| Date | Assumption | Basis | Verified |
|------|------------|-------|----------|
| 2024-01-15 | Component uses React hooks | Saw useState import | Yes |
| 2024-01-15 | API uses REST not GraphQL | Found express routes | No - ASK USER |
If an assumption cannot be verified from code:
- Log it as unverified
- ASK THE USER before proceeding
- Update log with answer
Rules of Engagement
Claude MUST:
- Read before writing - Never modify a file without reading it first
- Survey before changing - Run Phase 1 before any significant work
- Ask before assuming - If it's not in SOURCE-OF-TRUTH.md, ask
- Verify before claiming - Test commands actually work
- Update the truth - Keep SOURCE-OF-TRUTH.md current
Claude MUST NOT:
- Restructure without asking - User's structure is intentional
- Add unrequested features - No bathrooms they didn't ask for
- Assume conventions - This project may not follow standards
- Skip the survey - Even for "simple" changes
- Trust outdated docs - Verify everything
When Claude Doesn't Know:
STOP. I don't have enough information to pro
---
*Content truncated.*
When not to use it
- →When the project is already fully understood
- →When the user explicitly states not to survey
- →When only minor, isolated changes are needed
Limitations
- →Claude must demonstrate understanding before making changes
- →Claude must read before writing
- →Claude must survey before changing
How it compares
This skill enforces a structured, multi-faceted survey of a codebase before any changes are made, preventing assumptions and ensuring a complete understanding, unlike immediately starting work.
Compared to similar skills
project-contractor side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| project-contractor (this skill) | 0 | 5mo | Review | Advanced |
| cursor-explorer-mcp | 6 | 8mo | No flags | Intermediate |
| analyzing-projects | 3 | 5mo | Review | Beginner |
| repo-research-analyst | 1 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
cursor-explorer-mcp
sepiabrown
Use for token-expensive operations requiring multi-file analysis - codebase exploration, broad searches, architecture understanding, tracing flows, finding implementations across files. Uses MCP cursor-agent server (company pays) with clean async interface. Do NOT use for single-file analysis, explaining code already in immediate context, or pure reasoning tasks.
analyzing-projects
CloudAI-X
Analyzes codebases to understand structure, tech stack, patterns, and conventions. Use when onboarding to a new project, exploring unfamiliar code, or when asked "how does this work?" or "what's the architecture?"
repo-research-analyst
parcadei
Analyze repository structure, patterns, conventions, and documentation for understanding a new codebase
ark-analysis
mckinsey
Analyze the Ark codebase by cloning the repository to a temporary location. Use this skill when the user asks questions about how Ark works, wants to understand Ark's implementation, or needs to examine Ark source code.
octocode-research
bgauryy
This skill should be used when the user asks to "research code", "how does X work", "where is Y defined", "who calls Z", "trace code flow", "find usages", "review a PR", "explore this library", "understand the codebase", or needs deep code exploration. Handles both local codebase analysis (with LSP semantic navigation) and external GitHub/npm research using Octocode tools.
spec
matteocervelli
>