
EOF

###############################################
# RENDERING RULES
###############################################
cat > "$BASE/RENDERING-RULES.md" << 'EOF'
# Dashboard Rendering Rules

## Error Rendering
If a query errors:
- Clear output container  
- Show error message  
- Show `{}`  
- Do NOT show stale rows  

## Success Rendering
If a query succeeds:
- Clear output container  
- Show rows only  
- No mixed output  

## Containers
Use dedicated containers:
- #custom-output  
- #predefined-output  
- #diagnostics-output  
- #failure-output  

EOF

###############################################
# SECURITY RULES
###############################################
cat > "$BASE/SECURITY.md" << 'EOF'
# Dashboard Security Rules

## SELECT-only mode
Allowed:
- SELECT  
- SHOW  
- DESCRIBE  

Blocked:
- DELETE  
- UPDATE  
- INSERT  
- DROP  
- ALTER  
- TRUNCATE  
- CREATE  

## Behavior
If destructive SQL is detected:
- Block query  
- Show warning  
- Show `{}`  
- Do not execute  
EOF

###############################################
# FUTURE TASKS
###############################################
cat > "$BASE/FUTURE.md" << 'EOF'
# Future Enhancements

- Table selector  
- DB selector  
- Auto-detect tables  
- Auto-detect schemas  
- Performance profiler  
- Remote/local presets  
- Docker container  
- CI pipeline  
EOF

echo "Documentation updated in $BASE/"

