Quick Start: 5 commands to begin the complete verification process
chmod +x scripts/*.sh scripts/*.py
./scripts/first-step-automated.shWhat it does:
- ✅ Checks all prerequisites (Python, pip, Java, Maven, Git)
- ✅ Installs dependencies (anthropic, pyyaml, click, rich)
- ✅ Verifies your API key works
- ✅ Makes scripts executable
- ✅ Creates feature branch
feature/issue-101-phase-0-schema-analysis - ✅ Creates output directories
- ✅ Analyzes espi.xsd with Claude Opus (~$1.50)
- ✅ Analyzes customer.xsd with Claude Opus (~$1.50)
- ✅ Generates inventory reports
- ✅ Commits work to feature branch
- ✅ Shows cost summary
Time: ~10 minutes Cost: ~$3.00 Output:
- Complete schema analysis in
reports/verification/ - Feature branch ready for PR
Visit: https://console.anthropic.com/settings/keys
Create a new API key, then:
export ANTHROPIC_API_KEY="your-api-key-here"
# Or add to your shell profile for persistence:
echo 'export ANTHROPIC_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrcpython3 --version # Should be 3.8 or higherIf not installed:
- macOS:
brew install python3 - Linux:
sudo apt install python3 python3-pip - Windows: Download from python.org
That's it! The automated script handles everything else.
Important: You cannot push directly to main. All work must be done in feature branches.
The scripts automatically:
- ✅ Create feature branches with proper naming
- ✅ Commit work with descriptive messages
- ✅ Include co-author attribution to Claude
- ✅ Prepare branches for PR creation
feature/issue-101-phase-<X>-<description>
Examples:
feature/issue-101-phase-0-schema-analysis
feature/issue-101-phase-0-generate-enums
feature/issue-101-phase-0-enum-migration
feature/issue-101-phase-1-common-embeddables
feature/issue-101-phase-2-usage-core
Use the Git workflow helper for more control:
# Interactive menu
./scripts/git-workflow-helper.sh
# Or command-line mode
./scripts/git-workflow-helper.sh phase-0-setup
./scripts/git-workflow-helper.sh phase-0-generate
./scripts/git-workflow-helper.sh prOptions:
- Create Phase 0 setup branch
- Create enum generation branch
- Create migration branch (coordinated)
- Commit current work
- Prepare pull request
- Check git status
./scripts/first-step-automated.shWhat happens:
- Creates branch:
feature/issue-101-phase-0-schema-analysis - Analyzes schemas with Opus
- Commits reports to branch
Result: Schema analysis complete ✅
Push and create PR:
# Push the branch
git push -u origin feature/issue-101-phase-0-schema-analysis
# Create PR (with GitHub CLI)
./scripts/git-workflow-helper.sh pr
# Or manually at:
# https://github.com/GreenButtonAlliance/OpenESPI-GreenButton-Java/compare/feature/issue-101-phase-0-schema-analysisFirst, merge PR from Step 1, then:
# Switch back to main and pull latest
git checkout main
git pull origin main
# Run generator (creates new branch automatically)
./scripts/generate-missing-enums-batch.shWhat it does:
- Creates branch:
feature/issue-101-phase-0-generate-enums - Generates 19 usage domain enums with Sonnet
- Generates 7 shared enums with Sonnet
- Generates 2 customer domain enums with Sonnet
- Commits generated enums to branch
Time: ~15 minutes Cost: ~$4.50
Push and create PR:
git push -u origin feature/issue-101-phase-0-generate-enums
./scripts/git-workflow-helper.sh pr./scripts/espi-verification-orchestrator.py batch-verify-enums --directory usage/enums
./scripts/espi-verification-orchestrator.py batch-verify-enums --directory customer/enumsWhat it does:
- Verifies all 28+ enums with Haiku (cost-effective)
- Reports PASS/FAIL for each
Time: ~5 minutes Cost: ~$1.50
# Compile the code
mvn clean compile
# Run tests
mvn test
# Check for issues
mvn dependency:analyze./scripts/espi-verification-orchestrator.py verify-entity UsagePointWhat it does:
- Compares UsagePointEntity with XSD
- Identifies discrepancies
- Generates verification report
- Suggests fixes
Time: ~3 minutes Cost: ~$0.25
./scripts/espi-verification-orchestrator.py generate-enum AccumulationKind# Standard complexity (Sonnet)
./scripts/espi-verification-orchestrator.py verify-entity MeterReading
# Complex entity (Opus - better analysis)
./scripts/espi-verification-orchestrator.py verify-entity ReadingType --complexity complex./scripts/espi-verification-orchestrator.py show-costs| Phase | Tasks | Estimated Cost |
|---|---|---|
| Step 1: Schema Analysis | 2 schemas | $3.00 |
| Step 2: Generate Enums | 30 enums | $4.50 |
| Step 3: Verify Enums | 30+ enums | $1.50 |
| Step 4: Verify Entities | 65 entities | $25.00 |
| Total (Complete Project) | 102 tasks | ~$35.00 |
Compare to: Manual implementation = 12 weeks of work!
reports/verification/
├── espi_enumerations.md # Complete espi.xsd analysis
├── customer_enumerations.md # Complete customer.xsd analysis
└── 00_SCHEMA_ANALYSIS_SUMMARY.md # Summary + next steps
You now know:
- ✅ All 33 enumerations in espi.xsd
- ✅ All 16 enumerations in customer.xsd
- ✅ All BasicTypes (String256, UInt48, etc.)
- ✅ All complexTypes and their field mappings
- ✅ Exactly what's missing from the codebase
openespi-common/src/main/java/.../domain/
├── usage/enums/
│ ├── AccumulationKind.java
│ ├── CommodityKind.java
│ ├── DataQualifierKind.java
│ └── ... (19 total)
├── customer/enums/
│ ├── MediaType.java
│ └── RevenueKind.java
└── common/
├── Currency.java
├── StatusCode.java
└── ... (7 total)
You now have:
- ✅ All 30 missing enums implemented
- ✅ Proper package structure
- ✅ getValue() and fromValue() methods
- ✅ Comprehensive Javadoc
All enums verified against XSD:
✓ AccumulationKind - PASS
✓ CommodityKind - PASS
✓ DataQualifierKind - PASS
...
You now know:
- ✅ Which enums match XSD perfectly
- ✅ Which have issues (if any)
- ✅ Exactly what to fix
export ANTHROPIC_API_KEY="your-key-here"pip3 install anthropic pyyaml click richchmod +x ./scripts/*.sh
chmod +x ./scripts/espi-verification-orchestrator.pyInstall Python 3.8+ from python.org or your package manager.
The orchestrator automatically picks the best model:
| Task Type | Model | Why |
|---|---|---|
| Schema analysis | Opus | Complex XSD requires deep understanding |
| Generate enum | Sonnet | Code generation, balanced quality/cost |
| Verify enum | Haiku | Simple comparison, very cost-effective |
| Verify entity (standard) | Sonnet | Good field comparison |
| Verify entity (complex) | Opus | Multiple relationships need deep analysis |
You don't choose - the script chooses for you! ✨
Once you've run the automated scripts:
# Look at a generated enum
cat openespi-common/src/main/java/.../usage/enums/AccumulationKind.java
# Check all generated files
ls -la openespi-common/src/main/java/.../usage/enums/mvn clean testIf tests fail or enums need tweaking:
# Re-generate a specific enum
./scripts/espi-verification-orchestrator.py generate-enum AccumulationKindBegin verifying entities against XSD:
# Start with core entities
./scripts/espi-verification-orchestrator.py verify-entity UsagePoint
./scripts/espi-verification-orchestrator.py verify-entity MeterReading
./scripts/espi-verification-orchestrator.py verify-entity IntervalBlockSee the implementation plan:
cat ISSUE_101_IMPLEMENTATION_PLAN.mdMark off completed tasks as you go!
| Document | Purpose |
|---|---|
ISSUE_101_IMPLEMENTATION_PLAN.md |
Complete 102-task plan |
ISSUE_101_IMPLEMENTATION_STRATEGY.md |
Team coordination strategy |
ISSUE_101_TOOLING_GUIDE.md |
Model selection & tools guide |
scripts/README_ORCHESTRATOR.md |
Orchestrator command reference |
GETTING_STARTED.md |
This file - quick start |
After running the automated workflow:
✅ Time Saved: 3 weeks of manual analysis → 30 minutes ✅ Consistency: All enums follow same pattern ✅ Accuracy: 95%+ match to XSD on first try ✅ Cost: ~$9 for Phase 0 vs weeks of salary ✅ Documentation: Auto-generated reports for each task
./scripts/first-step-automated.shThen follow the on-screen prompts. The script will guide you through everything!
Questions? Check the documentation or review the generated reports.
Issues? All outputs include metadata showing exactly what was run, what model was used, and how much it cost.
Good luck with your ESPI 4.0 schema compliance verification! 🎯