✨ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7.3 KiB
BlackRoad OS Templates
Copy-Paste-Ready Templates for Everything
This directory contains templates that make development, deployment, and documentation effortless. Every template follows the copy-paste-and-learn philosophy: perfect commands that work immediately and teach by doing.
Available Templates
1. Terminal Commands Template
File: TERMINAL-COMMANDS-TEMPLATE.md
The revolutionary template that changes how we work with terminals. Contains copy-paste-ready command blocks for:
- Cloudflare deployment
- Railway deployment
- Local development
- SSH operations
- File management
- Git workflows
- Environment setup
- Testing
- Docker operations
Why this matters: No more nano nightmares, no more mkdir mistakes, no more SSH struggles. Just copy, paste, learn.
Quick Example:
# Deploy complete API
cd cloudflare-workers
wrangler deploy blackroad-unified-api.js --config wrangler-unified-api.toml
# Initialize databases
wrangler d1 execute blackroad-users --file=../cloudflare-d1-schemas.sql
# Deploy edge router
wrangler deploy blackroad-edge-router.js
2. README Template
File: README-TEMPLATE.md
Standard README structure with copy-paste-ready sections:
- Quick Start (copy-paste installation)
- Usage examples (copy-paste commands)
- API reference (copy-paste curl commands)
- Deployment (copy-paste deploy blocks)
- Troubleshooting (copy-paste debug commands)
3. Deployment Guide Template
File: DEPLOYMENT-GUIDE-TEMPLATE.md
Complete deployment documentation template with:
- Platform-specific deployment blocks
- Verification commands
- Rollback procedures
- Multi-cloud deployment
- Post-deployment checks
4. Script Template
File: SCRIPT-TEMPLATE.sh
Bash script template with:
- Proper error handling (
set -euo pipefail) - Interactive menu mode
- Direct command mode
- Logging
- Color output
- Help documentation
- Copyright headers
5. Copy-Paste Commands Library
File: COPY-PASTE-COMMANDS-LIBRARY.md
The ultimate command reference - organized by category:
- Quick Deployments
- Service Management
- Git Operations
- Environment Setup
- Testing
- Docker
- SSH & Remote
- File Operations
- Debugging
- Security & Secrets
- Emergency Procedures
The Philosophy
Why Copy-Paste-Ready?
Before (traditional docs):
To deploy, run the wrangler deploy command with your config file.
User has to:
- Remember syntax
- Type it correctly
- Figure out config file path
- Hope it works
After (copy-paste-ready):
# Deploy complete API
cd cloudflare-workers
wrangler deploy blackroad-unified-api.js --config wrangler-unified-api.toml
# Verify deployment
wrangler pages deployment list --project-name=blackroad-io
User:
- Copies block
- Pastes in terminal
- It works perfectly
- Comments teach what happened
Benefits
- Zero Cognitive Load - No thinking required, just copy and paste
- Self-Documenting - Comments explain the what AND why
- Machine-Teachable - AI learns from the pattern
- Error-Proof - No manual typing mistakes
- Context-Preserved - Full context in every block
- Teaching by Doing - Learn while executing
How to Use These Templates
For New Services
- Copy
README-TEMPLATE.md - Replace placeholders with your service details
- Test all copy-paste command blocks
- Ensure every command works perfectly
- Commit with the service
For New Scripts
- Copy
SCRIPT-TEMPLATE.sh - Customize functions for your needs
- Test interactive menu mode
- Test direct command mode
- Make executable:
chmod +x script.sh
For Documentation
- Use
TERMINAL-COMMANDS-TEMPLATE.mdpatterns - Every command must be copy-paste ready
- Include comments explaining each step
- Add verification commands
- Test before publishing
For Deployment Guides
- Copy
DEPLOYMENT-GUIDE-TEMPLATE.md - Fill in platform-specific sections
- Test every deployment block
- Include rollback procedures
- Add verification steps
Template Standards
Every template must follow these rules:
1. Comments Explain Everything
# What this does and why
command --flag value
2. Commands Work Perfectly
Test every command block before documenting it. No broken examples.
3. Full Context Provided
# Navigate to correct directory
cd ~/blackroad-sandbox/cloudflare-workers
# Deploy with specific config
wrangler deploy service.js --config wrangler-service.toml
4. Verification Included
# Deploy
railway up --service api-gateway
# Verify deployment worked
railway status
curl https://api.blackroad.io/health
5. Grouped Logically
# Step 1: Setup
command1
# Step 2: Execute
command2
# Step 3: Verify
command3
6. No Manual Edits Required
Use environment variables or heredocs instead of "edit this file manually":
# Good - copy-paste ready
cat >> .env <<'EOF'
TOKEN=paste-your-token-here
EOF
# Bad - requires manual editing
# Edit .env and add your token
Quick Reference
Most Common Patterns
Deploy to Cloudflare:
cd cloudflare-workers
wrangler deploy service.js --config wrangler-service.toml
wrangler pages deployment list --project-name=blackroad-io
Deploy to Railway:
export RAILWAY_TOKEN=your-token-here
railway link project-id
railway up --service service-name
railway status
Start Local Services:
cd ~/blackroad-sandbox
./start-all.sh
./br health
Run Tests:
pytest -m unit -v
pytest -m integration -v
pytest --cov=. --cov-report=html
Contributing New Templates
When creating a new template:
- Follow the philosophy - Copy-paste-ready with teaching comments
- Test thoroughly - Every command must work perfectly
- Document clearly - Explain what and why
- Include verification - Show how to check it worked
- Add to this index - Update this file with new template
# Create new template
cat > templates/NEW-TEMPLATE.md <<'EOF'
# Template content here
EOF
# Test the template
# [test steps]
# Update index
cat >> templates/INDEX.md <<'EOF'
### X. New Template Name
**File**: `NEW-TEMPLATE.md`
[Description]
EOF
# Commit
git add templates/
git commit -m "docs: Add new template for [purpose]"
git push origin main
Examples in the Wild
These templates are used throughout BlackRoad OS:
DEPLOY-QUICK-REFERENCE.md- Uses deployment patternsTEST_COMMANDS.md- Uses testing patternsRAILWAY-WEBHOOK-DEPLOYMENT-GUIDE.md- Uses deployment template- All
blackroad-*.shscripts - Use script template - All service READMEs - Use README template
Future Templates
Planned templates:
- API Documentation Template
- Integration Guide Template
- Database Migration Template
- Security Audit Template
- Performance Testing Template
- Monitoring Setup Template
Copyright
# ============================================================================
# BlackRoad OS - Proprietary Software
# Copyright (c) 2025 BlackRoad OS, Inc. / Alexa Louise Amundson
# All Rights Reserved.
# ============================================================================
Remember: Great templates are copy-paste-ready, self-documenting, and teach by doing. If someone has to type something manually, the template isn't good enough yet.