- Add bash script (siter-solar-analysis.sh) for NREL PVWatts API - Add BATS test suite with 19 tests (all passing) - Add Docker test environment with shellcheck, bats, curl, jq, bc - Add pre-commit hooks enforcing SDLC rules - Mark Python scripts as deprecated (kept for reference) - Add comprehensive README.md and AGENTS.md documentation - Add .env.example for configuration template - Add .gitignore excluding private data (base-bill/, .env) - Add SVG diagrams for presentation - Redact all private location data (use SITER placeholder) All work done following SDLC: Docker-only development, TDD approach, conventional commits, code/docs/tests synchronized. Generated with Crush Assisted-by: GLM-5 via Crush <crush@charm.land>
5.0 KiB
5.0 KiB
SITER Solar Project - Agent Documentation
This document provides technical reference for AI agents working on this project.
Software Development Lifecycle (SDLC)
Host System: Git and Docker ONLY
All work must be done inside Docker containers. The host system is ONLY for:
- Git operations - commit, push, pull, branch, etc.
- Docker operations - build, run, exec, etc.
Never run code, tests, or other tools directly on the host system.
Development Workflow
-
Build Docker image:
docker build -f Dockerfile.test -t siter-solar-test . -
Run tests inside Docker:
docker run --rm siter-solar-test -
Run analysis inside Docker:
docker run --rm -e NREL_API_KEY=your_key siter-solar-test /app/solar-analysis/siter-solar-analysis.sh --scenarios -
Make atomic commits using conventional commit format:
feat:- New featurefix:- Bug fixdocs:- Documentation onlytest:- Adding/updating testsrefactor:- Code refactoringchore:- Maintenance tasks
Code/Docs/Tests Synchronization
Code, documentation, and tests MUST be kept in sync at all times.
- When changing code, update tests and documentation in the same commit
- When changing documentation, verify code still matches
- When changing tests, ensure code passes new tests
- Pre-commit hooks enforce this synchronization
Privacy Requirements
CRITICAL: This is a public repository. All private data must be removed.
What MUST NOT be committed:
- Real addresses or locations (use "SITER" as placeholder)
- Account numbers, contract IDs, or meter numbers
- The
base-bill/directory (contains personal billing data) .envfile (contains real coordinates and API keys)
What should be committed:
.env.example- Template with placeholder values- All code and documentation with "SITER" as location identifier
- SVG images and analysis scripts
Location Data:
- Use configurable environment variables:
SITER_LAT,SITER_LON - Default to central Texas coordinates (30.44, -97.62)
- Never commit specific addresses
File Structure
siter-solar/
├── AGENTS.md # This file
├── README.md # Project documentation
├── .env.example # Environment template
├── .env # Gitignored - actual values
├── .gitignore # Excludes private data
├── Dockerfile.test # Test environment
├── v2-siter-solar-plan.md # Main proposal document
├── images/ # SVG diagrams for presentation
│ ├── v2-image-1.svg # System architecture diagram
│ ├── v2-image-2.svg # Monthly production chart
│ ├── v2-image-3.svg # ROI/payback timeline
│ └── v2-image-4.svg # System size comparison
└── solar-analysis/ # NREL PVWatts analysis tools
├── siter-solar-analysis.sh # Main bash script (production)
├── tests/ # BATS test suite
│ └── siter-solar-analysis.bats
├── solar_estimate.py # DEPRECATED - kept for reference
├── solar_optimal.py # DEPRECATED - kept for reference
├── solar_optimized.py # DEPRECATED - kept for reference
├── Dockerfile # Production image
└── run-analysis.sh # Docker wrapper
Running NREL Analysis
Using Bash Script (Recommended)
Inside Docker:
# Basic analysis
./siter-solar-analysis.sh
# With custom API key
./siter-solar-analysis.sh -k YOUR_API_KEY
# Compare system sizes
./siter-solar-analysis.sh --scenarios
# JSON output
./siter-solar-analysis.sh --json
# Custom configuration
./siter-solar-analysis.sh -p 20 -w 400 --lat 30.5 --lon -97.7
Python Scripts (DEPRECATED)
The Python scripts are kept for reference only. Use the bash script instead.
Key Parameters
| Parameter | Value | Notes |
|---|---|---|
| System Capacity | 4.0 kW DC | 16 × 250W panels |
| Array Type | Fixed Open Rack | Ground mount |
| Tilt | 30° | Optimal for latitude |
| Azimuth | 180° | South-facing |
| Losses | 14% (default) | Can optimize to 8% |
Base Power Contract Details
- Energy Rate: $0.085/kWh (fixed through Oct 2028)
- Solar Buyback: $0.04/kWh (credits apply to entire bill)
- Subscription Fee: $10/month
ROI Calculation Method
- Annual production from NREL PVWatts (kWh/year)
- Self-consumption: 60% × production × $0.085/kWh
- Grid export: 40% × production × $0.04/kWh
- Total annual value = self-consumption + export
- Payback = Total investment / annual value
Testing
Run tests inside Docker:
docker build -f Dockerfile.test -t siter-solar-test .
docker run --rm siter-solar-test
Updating the Analysis
- Modify
siter-solar-analysis.shas needed - Update tests in
tests/siter-solar-analysis.bats - Run tests to verify changes
- Update
v2-siter-solar-plan.mdwith new estimates - Commit all changes together in atomic commit