repo-readiness
npx skills add https://github.com/vamseeachanta/workspace-hub --skill repo-readiness
Agent 安装分布
Skill 文档
Repository Readiness Skill
Automatically prepare repositories for new work by analyzing configuration, structure, mission, and establishing complete work context.
Quick Start
# Manual trigger
/repo-readiness
# Auto-triggers before:
# - New task execution
# - Feature development
# - SPARC workflow initiation
# - Agent assignment
# Direct check
./scripts/check_repo_readiness.sh <repo-name>
When to Use
AUTO-EXECUTES (via hook):
- Before starting any new task in a repository
- When switching to a different repository
- Before SPARC specification phase
- Before agent assignment for new work
MANUAL TRIGGER:
- When repository context is unclear
- Before major refactoring
- After long breaks from a repository
- When onboarding to an existing project
- Before cross-repo coordination
Prerequisites
- Repository is cloned locally
- Git is initialized
- Read access to repository files
- (Optional) Internet for external documentation lookup
Overview
The repo-readiness skill performs comprehensive analysis of a repository to establish complete work context before executing any new tasks. It replaces manual context gathering with automated, systematic preparation.
What It Analyzes
- Configuration: CLAUDE.md, .claude/, .agent-os/
- Structure: Directory organization, module architecture
- Mission: Product vision, objectives, technical decisions
- State: Git status, dependencies, environment setup
- Standards: Compliance with workspace-hub standards
- Context: Historical decisions, conventions, patterns
Output
Generates a comprehensive readiness report with:
- Configuration summary
- Structure analysis
- Mission & objectives extraction
- Readiness assessment (â Ready / â ï¸ Needs Attention / â Not Ready)
- Recommended actions
- Context for AI agents
Core Operations
1. Configuration Analysis
Analyzes:
â Root CLAUDE.md
â .claude/CLAUDE.md (extended config)
â .claude.json (MCP settings)
â .mcp.json (MCP servers)
â .agent-os/ configuration
â Repository-specific rules
Extracts:
- Critical rules and constraints
- File organization standards
- Testing requirements
- AI agent guidelines
- Tool preferences (UV, pytest, etc.)
- Integration points
Example Output:
## Configuration Summary
### CLAUDE.md Status: â
Found
- **Location**: /root/CLAUDE.md
- **Critical Rules**:
- TDD mandatory
- YAGNI principle
- UV environment required
- **File Organization**: Modular structure enforced
- **Testing**: pytest with 80% coverage minimum
- **AI Guidelines**: Question before implementation
### Extended Config: â
Found (.claude/CLAUDE.md)
- SPARC methodology enabled
- MCP integration configured
- HTML reporting standards defined
### MCP Configuration: â
Found
- Active servers: claude-flow, browser-automation
- Tools available: 47 MCP tools
2. Structure Assessment
Analyzes:
â Directory organization
â Module architecture
â File naming conventions
â Test structure
â Documentation presence
â Script organization
Checks Against:
- FILE_ORGANIZATION_STANDARDS.md
- Repository best practices
- Module patterns
- Naming conventions
Example Output:
## Structure Assessment
### Directory Organization: â
Compliant
repo/ âââ src/ â Present â âââ modules/ â Modular structure âââ tests/ â Present â âââ unit/ â Organized â âââ integration/ â Organized âââ docs/ â Present âââ config/ â Present âââ scripts/ â Present âââ data/ â Present âââ reports/ â Present
### Module Architecture: â
Well-Organized
- **Modules Found**: 5
- data_processor/
- visualization/
- analysis/
- reporting/
- utilities/
### Naming Conventions: â ï¸ Minor Issues
- â
Python files use snake_case
- â
Modules use lowercase
- â ï¸ 2 files need organization (see details)
### Test Coverage: â
Good
- Unit tests: 45 files
- Integration tests: 12 files
- Test coverage: 85% (target: 80%)
3. Mission & Objectives Extraction
Sources:
â .agent-os/product/mission.md
â .agent-os/product/tech-stack.md
â .agent-os/product/roadmap.md
â .agent-os/product/decisions.md
â README.md
â docs/OVERVIEW.md
Extracts:
- Project purpose and vision
- Key objectives
- Technical stack
- Architecture decisions
- Current roadmap
- Recent decisions
Example Output:
## Mission & Objectives
### Project Purpose
Energy data analysis and visualization platform for offshore oil & gas operations.
### Key Objectives
1. Process BSEE production data with 99.9% accuracy
2. Generate interactive HTML reports with Plotly
3. NPV analysis for economic evaluation
4. Marine safety incident tracking
5. Support 10+ concurrent analysis workflows
### Technical Stack
- **Language**: Python 3.11+
- **Environment**: UV package manager
- **Testing**: pytest with 85% coverage
- **Visualization**: Plotly (interactive only)
- **Data**: Pandas, Polars
- **Reporting**: HTML with embedded plots
### Recent Decisions (Last 30 Days)
1. Migrated to UV from pip (2024-12-15)
2. Standardized on Plotly for all visualizations (2024-12-10)
3. Implemented SPARC workflow (2024-12-01)
4. State Assessment
Checks:
â Git status (clean/dirty)
â Branch information
â Remote status
â Dependencies installed
â Environment setup
â Recent commits
â Open issues/PRs
Example Output:
## Repository State
### Git Status: â
Clean
- **Branch**: main
- **Commits ahead**: 0
- **Commits behind**: 0
- **Uncommitted changes**: None
- **Last commit**: 2024-12-20 14:23 - "Update NPV calculation logic"
### Environment: â
Ready
- UV environment: â
Detected (.venv/)
- Dependencies: â
Synchronized (pyproject.toml == uv.lock)
- Python version: â
3.11.7
### Dependencies Status: â ï¸ 2 Updates Available
- plotly: 5.17.0 â 5.18.0 (minor)
- pandas: 2.1.3 â 2.1.4 (patch)
5. Standards Compliance
Validates:
â Logging standards
â Testing framework standards
â HTML reporting standards
â File organization standards
â Development workflow compliance
Example Output:
## Standards Compliance
### Logging Standards: â
Compliant
- Standard format implemented
- Five log levels configured
- Rotation configured (10MB, 5 backups)
### Testing Standards: â
Compliant
- pytest configured
- Coverage threshold: 80% (current: 85%)
- Unit + integration tests present
### HTML Reporting: â
Compliant
- Interactive plots only (Plotly)
- CSV data with relative paths
- Reports in reports/ directory
### File Organization: â
Compliant
- Modular src/ structure
- Tests mirror source
- Documentation organized
6. Context Preparation
Generates:
â AI agent context summary
â Key conventions to follow
â Common patterns
â Recent changes
â Known issues
â Quick reference
Example Output:
## AI Agent Context
### Key Conventions
- **Imports**: Use absolute imports from src/
- **Testing**: Write tests before implementation (TDD)
- **Data Loading**: Use relative paths from reports/
- **Error Handling**: Use custom exceptions in src/exceptions.py
- **Logging**: Use module-level logger = logging.getLogger(__name__)
### Common Patterns
1. **Data Pipeline**: load â validate â process â visualize â report
2. **Configuration**: YAML files in config/input/ directory
3. **Execution**: Bash scripts in scripts/ directory
4. **Reporting**: HTML with Plotly in reports/ directory
### Recent Changes (Last 7 Days)
- Refactored NPV calculation to support multiple discount rates
- Added new marine safety incident categorization
- Updated BSEE data extractor for 2024 format
- Enhanced error handling in data validation
### Known Issues
- Issue #42: Slow performance on files >100MB (workaround documented)
- Issue #38: Timezone handling in date parsing (fix in progress)
### Quick Reference
- Main entry point: `scripts/run_analysis.sh`
- Configuration: `config/input/<feature>.yaml`
- Documentation: `docs/README.md`
- Examples: `examples/`
Readiness Assessment
Overall Readiness Score
Calculated from:
- Configuration completeness (25%)
- Structure compliance (20%)
- Mission clarity (15%)
- State health (20%)
- Standards adherence (20%)
Readiness Levels:
â
READY (90-100%)
- All critical checks passed
- Minor issues documented
- Safe to proceed with new work
â ï¸ NEEDS ATTENTION (70-89%)
- Some issues need addressing
- Can proceed with caution
- Fix issues before major work
â NOT READY (<70%)
- Critical issues present
- Must resolve before proceeding
- Blocks new work
Example Assessment
## Overall Readiness: â
READY (95%)
### Breakdown
- Configuration: â
100% (All configs present and valid)
- Structure: â
95% (2 minor file organization issues)
- Mission: â
100% (Clear objectives and roadmap)
- State: â
90% (2 dependency updates available)
- Standards: â
95% (Full compliance, minor logging improvement)
### Recommended Actions
1. ð¦ Update plotly to 5.18.0 (optional, minor version)
2. ð Organize 2 files in src/utilities/ into subfolders
3. ð Add logging to new marine_safety module (standard practice)
### Safe to Proceed: â
YES
All critical requirements met. Recommended actions can be addressed incrementally.
Execution Checklist
Pre-Check:
- Repository path is valid
- Git repository initialized
- Read access to all files
Analysis Phase:
- Read CLAUDE.md (root and .claude/)
- Analyze directory structure
- Extract mission from .agent-os/
- Check git status
- Verify environment setup
- Validate standards compliance
Reporting Phase:
- Generate configuration summary
- Create structure assessment
- Extract mission & objectives
- Report repository state
- Calculate readiness score
- Provide recommended actions
Post-Check:
- Save readiness report to .claude/readiness-report.md
- Update repository context cache
- Provide summary to user or agent
Hook Integration
Pre-Task Hook
This skill auto-executes as a pre-task hook:
Hook Configuration:
# .claude/hooks/pre-task.sh
#!/bin/bash
# Auto-execute repo-readiness before any task
REPO_PATH="$(pwd)"
SKILL_PATH="$HOME/.claude/skills/workspace-hub/repo-readiness"
# Execute readiness check
"$SKILL_PATH/check_readiness.sh" "$REPO_PATH"
# Exit code determines if task can proceed
# 0 = Ready, 1 = Not ready (blocks task)
exit $?
Trigger Conditions:
/create-speccommand/execute-taskscommand/plan-productcommand- Any SPARC workflow phase
- Agent assignment via orchestrator
Bypass Hook (when needed):
# Force task execution even if not ready
SKIP_READINESS_CHECK=1 /execute-tasks "task description"
Post-Task Hook (Optional)
Update readiness state after work:
# .claude/hooks/post-task.sh
#!/bin/bash
# Update readiness cache after task completion
REPO_PATH="$(pwd)"
TASK_ID="$1"
# Re-run readiness to update cache
"$HOME/.claude/skills/workspace-hub/repo-readiness/check_readiness.sh" "$REPO_PATH" --update-cache
# Log task completion
echo "$(date): Task $TASK_ID completed" >> .claude/task-history.log
Automation Scripts
1. Check Readiness Script
Location: .claude/skills/workspace-hub/repo-readiness/check_readiness.sh
#!/bin/bash
# Repository Readiness Check Script
REPO_PATH="${1:-.}"
OUTPUT_FILE="${REPO_PATH}/.claude/readiness-report.md"
# Function: Check configuration
check_configuration() {
local score=0
# Check CLAUDE.md
if [ -f "${REPO_PATH}/CLAUDE.md" ]; then
echo "â
Root CLAUDE.md found"
((score += 25))
else
echo "â Root CLAUDE.md missing"
fi
# Check extended config
if [ -f "${REPO_PATH}/.claude/CLAUDE.md" ]; then
echo "â
Extended CLAUDE.md found"
((score += 25))
fi
# Check .agent-os
if [ -d "${REPO_PATH}/.agent-os" ]; then
echo "â
Agent OS configuration found"
((score += 25))
fi
# Check MCP config
if [ -f "${REPO_PATH}/.claude.json" ] || [ -f "${REPO_PATH}/.mcp.json" ]; then
echo "â
MCP configuration found"
((score += 25))
fi
echo "Configuration Score: ${score}/100"
return $score
}
# Function: Check structure
check_structure() {
local score=0
local required_dirs=("src" "tests" "docs" "config" "scripts")
for dir in "${required_dirs[@]}"; do
if [ -d "${REPO_PATH}/${dir}" ]; then
echo "â
${dir}/ present"
((score += 20))
else
echo "â ï¸ ${dir}/ missing"
fi
done
echo "Structure Score: ${score}/100"
return $score
}
# Function: Check mission
check_mission() {
local score=0
if [ -f "${REPO_PATH}/.agent-os/product/mission.md" ]; then
echo "â
Mission defined"
((score += 50))
fi
if [ -f "${REPO_PATH}/.agent-os/product/roadmap.md" ]; then
echo "â
Roadmap defined"
((score += 50))
fi
echo "Mission Score: ${score}/100"
return $score
}
# Function: Check state
check_state() {
local score=0
cd "$REPO_PATH" || exit 1
# Check git status
if git diff-index --quiet HEAD -- 2>/dev/null; then
echo "â
Git working directory clean"
((score += 50))
else
echo "â ï¸ Uncommitted changes present"
((score += 25))
fi
# Check environment
if [ -d ".venv" ] || [ -d "venv" ]; then
echo "â
Virtual environment detected"
((score += 50))
fi
echo "State Score: ${score}/100"
return $score
}
# Main execution
main() {
echo "========================================"
echo "Repository Readiness Check"
echo "Repository: ${REPO_PATH}"
echo "Timestamp: $(date)"
echo "========================================"
echo ""
# Run all checks
check_configuration
local config_score=$?
check_structure
local struct_score=$?
check_mission
local mission_score=$?
check_state
local state_score=$?
# Calculate overall score
local overall_score=$(( (config_score*25 + struct_score*20 + mission_score*15 + state_score*20) / 80 ))
echo ""
echo "========================================"
echo "Overall Readiness: ${overall_score}%"
if [ $overall_score -ge 90 ]; then
echo "Status: â
READY"
echo "========================================"
return 0
elif [ $overall_score -ge 70 ]; then
echo "Status: â ï¸ NEEDS ATTENTION"
echo "========================================"
return 1
else
echo "Status: â NOT READY"
echo "========================================"
return 2
fi
}
main "$@"
2. Bulk Readiness Check
Check all repos in workspace:
#!/bin/bash
# Check readiness of all repositories in workspace-hub
WORKSPACE_ROOT="/mnt/github/workspace-hub"
READINESS_SCRIPT="$HOME/.claude/skills/workspace-hub/repo-readiness/check_readiness.sh"
# Get all repos from .gitignore
repos=$(grep -E "^[a-z].*/$" "${WORKSPACE_ROOT}/.gitignore" | sed 's/\///')
echo "Checking readiness of all repositories..."
echo ""
# Track results
ready_count=0
attention_count=0
not_ready_count=0
for repo in $repos; do
repo_path="${WORKSPACE_ROOT}/${repo}"
if [ -d "$repo_path" ]; then
echo "Checking: $repo"
if "$READINESS_SCRIPT" "$repo_path" > /dev/null 2>&1; then
echo " â
READY"
((ready_count++))
else
exit_code=$?
if [ $exit_code -eq 1 ]; then
echo " â ï¸ NEEDS ATTENTION"
((attention_count++))
else
echo " â NOT READY"
((not_ready_count++))
fi
fi
fi
done
echo ""
echo "Summary:"
echo " Ready: $ready_count"
echo " Needs Attention: $attention_count"
echo " Not Ready: $not_ready_count"
Error Handling
Missing Configuration
Error: CLAUDE.md not found
â Critical: No CLAUDE.md found in repository root
Action Required:
1. Create CLAUDE.md with repository configuration
2. Use template from workspace-hub/templates/CLAUDE.md
3. Re-run readiness check
Quick Fix:
cp ~/workspace-hub/templates/CLAUDE.md ./CLAUDE.md
Incomplete Structure
Error: Required directories missing
â ï¸ Warning: Required directories missing
Missing: tests/, docs/
Action Required:
1. Create missing directories
2. Follow FILE_ORGANIZATION_STANDARDS.md
3. Re-run readiness check
Quick Fix:
mkdir -p tests/{unit,integration} docs config scripts
Unclear Mission
Error: No mission.md found
â ï¸ Warning: Project mission not defined
Missing: .agent-os/product/mission.md
Action Required:
1. Create .agent-os/product/mission.md
2. Define project purpose and objectives
3. Document technical decisions
Quick Fix:
mkdir -p .agent-os/product
cp ~/workspace-hub/templates/mission.md .agent-os/product/
Dirty Git State
Error: Uncommitted changes present
â ï¸ Warning: Repository has uncommitted changes
Files modified: 5
Action Required:
1. Review uncommitted changes: git status
2. Commit changes: git add . && git commit -m "message"
3. Or stash: git stash
4. Re-run readiness check
Environment Issues
Error: Virtual environment not found
â ï¸ Warning: No virtual environment detected
Action Required:
1. Create UV environment: uv venv
2. Install dependencies: uv pip install -r requirements.txt
3. Activate environment: source .venv/bin/activate
4. Re-run readiness check
Metrics & Success Criteria
Performance Metrics
| Metric | Target | Measurement |
|---|---|---|
| Check Time | < 5 seconds | Time to complete all checks |
| Accuracy | > 95% | Correct readiness assessment |
| False Positives | < 5% | Incorrectly marked as ready |
| False Negatives | < 2% | Incorrectly marked as not ready |
| Cache Hit Rate | > 80% | Using cached readiness data |
Coverage Metrics
| Metric | Target | Current |
|---|---|---|
| Repos with CLAUDE.md | 100% | Track per repo |
| Repos with mission.md | 100% | Track per repo |
| Structure compliance | > 95% | Average across repos |
| Standards adherence | > 90% | Average compliance score |
Adoption Metrics
| Metric | Target | Measurement |
|---|---|---|
| Hook installation | 100% repos | Pre-task hook installed |
| Auto-execution rate | > 95% | Tasks with readiness check |
| Manual check usage | > 10/week | Explicit readiness checks |
| Issue detection | > 50% | Issues caught before work |
Integration Points
With SPARC Workflow
Readiness check before each SPARC phase:
# Before Specification
/repo-readiness â Analyze context â /create-spec
# Before Architecture
/repo-readiness â Verify structure â /sparc-architecture
# Before Implementation
/repo-readiness â Check environment â /execute-tasks
With Compliance Check
Combined health validation:
# Readiness + compliance
/repo-readiness && /compliance-check
# Report both
./scripts/health-check.sh --full
With Agent Orchestration
Provide context to agents:
// Agent receives readiness report
{
"task": "implement-feature-X",
"repository": "digitalmodel",
"readiness": {
"status": "ready",
"score": 95,
"context": {
"conventions": [...],
"patterns": [...],
"recent_changes": [...]
}
}
}
With Repo Sync
Ensure readiness before bulk operations:
# Check readiness before sync
./scripts/repository_sync sync all --check-readiness
Best Practices
1. Run Before Every New Task
# Always start with readiness check
/repo-readiness
# Then proceed with work
/create-spec "new feature"
2. Keep Configuration Updated
# Update CLAUDE.md when rules change
# Update mission.md when objectives change
# Update roadmap.md when priorities shift
3. Address Issues Promptly
# Don't ignore warnings
# Fix structural issues immediately
# Keep environment synchronized
4. Use Cache Wisely
# Cache valid for 1 hour by default
# Force refresh when configuration changes
/repo-readiness --force-refresh
5. Monitor Across All Repos
# Weekly bulk check
./scripts/bulk_readiness_check.sh > reports/readiness-$(date +%Y-%m-%d).txt
# Track trends
# Maintain >95% readiness across all repos
Related Skills
- compliance-check – Standards validation
- repo-sync – Multi-repo management
- sparc-workflow – Development methodology
- session-start-routine – Session initialization
References
- FILE_ORGANIZATION_STANDARDS.md
- AI_AGENT_GUIDELINES.md
- DEVELOPMENT_WORKFLOW.md
- CLAUDE.md – Root configuration template
Version History
- 1.0.0 (2026-01-07): Initial release – comprehensive repository readiness skill with configuration analysis, structure assessment, mission extraction, state checking, standards compliance, auto-hook integration, bulk checking capabilities, error handling, and metrics tracking