#!/bin/bash
# Build Standard Docs for aiwizard 1.6 - Align to md.perp* + your files
# Purpose: system/wizard to help define project documentation from templates to customization; automate wizard/tool to document code php css html sql sh json based on code
# Each doc has template of standard good project development info/rules/etc; wizard allows changing info and adding project specific info for that section
# Output: project.md naming.coding.standards.md golden.rules.md architecture.md directory.tree.md project.system.requirements (2 tier) agents.md system dependencies os macos dev nginx shared cannot install system level
# Want automated tool to document code functions purpose in/output + admin tools system and app levels + audit and testing tools
# Standard names minimal learning curve: README.md AGENTS.md docs/architecture.md product-spec.md testing.md security.md CHANGELOG.md + coding.standards goldenrules tasks roadmap status + .gitignore .github/prompts

APP_ROOT=$(pwd)
echo "APP_ROOT=$APP_ROOT"

mkdir -p docs/adr docs/runbooks .github/prompts

# 1. Root standard files from md.perp*
cat > README.md <<'MD'
# aiwizard - Documentation Generator Wizard

## Project Purpose
System/wizard to help define project documentation from templates to customization; automate wizard/tool to document code: php, css, html, sql, sh, json, etc - based on code. Each document has template of standard good project development information/rules/etc; wizard allows for changing of that information and adding project specific information for that section.

Output files: project.md, naming.coding.standards.md, golden.rules.md, architecture.md, directory.tree.md, project.system.requirements (2 tier system), agents.md (what/how/agent should interact), system dependencies (php, py, awk, js, mysql, bs5, fontawesome, datatables, charts.js from cdn, not using java, node), os (macos dev - nginx shared web server; cannot install any system level code/apps). Want automated tool to document code: functions, purpose, in/output etc + admin tools system and app levels + audit and testing tools.

## Quick Start
```bash
cd /Users/rbutare/websites/apps/aiwizard/
sudo chown -R $(whoami):staff . && chmod -R 777 data/ docs/ && xattr -cr .
php -S localhost:8000 -t . &
open http://localhost:8000/aiwizard.index.php?section=wizard
# or
open http://rickweb/apps/aiwizard/aiwizard.index.php?section=wizard
