#!/bin/bash
# Create Gitea Issues for Interactive Tools Suite (Tasks #70-81)
# Run this from: /home/claude/firefrost-operations-manual

GITEA_TOKEN="e0e330cba1749b01ab505093a160e4423ebbbe36"
GITEA_API="https://git.firefrostgaming.com/api/v1"
REPO="firefrost-gaming/firefrost-operations-manual"

echo "🔨 Creating 12 Gitea Issues for Interactive Tools Suite"
echo "=========================================="

# Function to create an issue
create_issue() {
  local title="$1"
  local body="$2"
  local labels="$3"
  
  curl -X POST "${GITEA_API}/repos/${REPO}/issues" \
    -H "Authorization: token ${GITEA_TOKEN}" \
    -H "Content-Type: application/json" \
    -d "{
      \"title\": \"${title}\",
      \"body\": \"${body}\",
      \"labels\": [${labels}]
    }" \
    2>/dev/null | python3 -c "import sys, json; data=json.load(sys.stdin); print(f\"✅ Created: #{data.get('number', '?')}: {data.get('title', '(unknown)')}\")" 2>/dev/null || echo "❌ Failed to create: ${title}"
}

# Task #70: Ghost Page Builder
create_issue \
  "Task #70: Ghost Page Builder Tool" \
  "## Description

Interactive React tool for previewing Ghost page HTML with Fire/Frost CSS before publishing. Eliminates edit-paste-preview-repeat cycle.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #1)

## Features

- Live HTML editor with syntax highlighting
- Real-time preview with Fire/Frost CSS applied
- Mobile/desktop viewport toggle
- Copy-to-clipboard functionality
- Sample templates dropdown (Blank, Simple Page, Two Column, Card Grid)

## Time Estimate

45-60 minutes

## Priority Justification

**CRITICAL** — Directly unblocks Task #69 (6 website pages - soft launch blocker). Provides permanent utility for all future Ghost page creation.

## Acceptance Criteria

- [ ] Live HTML editor functional
- [ ] Preview updates within 500ms of typing
- [ ] Fire/Frost CSS renders correctly in preview
- [ ] Viewport toggle works (Desktop/Tablet/Mobile)
- [ ] Copy button successfully copies HTML to clipboard
- [ ] localStorage preserves draft between sessions
- [ ] Michael successfully builds at least 2 Ghost pages using this tool

## Related Tasks

- **Unblocks:** #69 (Ghost Website Core Pages)
- **Uses:** Fire/Frost CSS from #68 (Ghost Theme Migration)
- **Complements:** #52 (Ghost Homepage Content)" \
  "35,1,2,3"  # area/development-tools, priority/critical, status/to-do, type/feature

# Task #71: Paymenter Tier Config
create_issue \
  "Task #71: Paymenter Tier Configuration Preview" \
  "## Description

Interactive pricing tier builder with live preview and export options for 6 Paymenter subscription tiers (Awakened \$1 → Founder \$50).

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #2)

## Features

- 6 tier cards (names + prices editable)
- Feature checklist per tier (server resources, support level, perks)
- Live pricing table preview (Fire/Frost branded)
- Export: JSON (Paymenter), HTML (website), Markdown (docs), CSV (spreadsheet)

## Time Estimate

30-45 minutes

## Priority Justification

**HIGH** — Billing configuration needed for soft launch. Helps visualize tier structure before committing to Paymenter.

## Status: BLOCKED

**Blocker:** Feature matrix not yet defined

**To Unblock:** 15-minute meeting with Michael/Meg/Holly to define:
- What does Awakened (\$1) get vs. Elemental (\$5)?
- Why is Knight (\$10) worth 2x Elemental?
- What makes Founder (\$50) special?

## Acceptance Criteria

- [ ] All 6 tiers configurable
- [ ] Feature matrix complete (all categories defined)
- [ ] Live preview renders correctly with Fire/Frost styling
- [ ] All 4 export formats work
- [ ] JSON export imports cleanly into Paymenter
- [ ] Michael/Meg approve tier differentiation

## Related Tasks

- **Unblocks:** Paymenter configuration (not yet a task)
- **Complements:** #52 (Homepage - pricing section)" \
  "35,5,4,3"  # area/development-tools, priority/high, status/blocked, type/feature

# Task #72: Infrastructure Health Dashboard
create_issue \
  "Task #72: Infrastructure Health Dashboard" \
  "## Description

Visual map of all 6 servers, ~20 services, and dependencies. Quick reference for IPs/ports and \"what breaks if X fails\" impact analysis.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #3)

## Features

- 6 server cards with expandable service lists
- Dependency visualization with arrows
- Impact analysis (\"If Mailcow fails, Paymenter email breaks\")
- Search/filter by service/server
- Quick links to Cockpit dashboards

## Time Estimate

60-90 minutes (not including dependency mapping)

## Priority Justification

**MEDIUM** — Strategic reference tool. Encodes infrastructure knowledge that currently lives in Michael's mental model.

## Status: BLOCKED

**Blocker:** Service dependencies not fully mapped

**To Unblock:** Map dependencies manually (15-20 minutes):
- Paymenter → Mailcow (SMTP)
- Plane → Mailcow (SMTP)
- Wings nodes → Panel (control)
- Ghost → (no dependencies)
- etc.

## Acceptance Criteria

- [ ] All 6 servers displayed with correct info
- [ ] All ~20 services listed
- [ ] Dependencies mapped accurately
- [ ] Impact analysis works correctly
- [ ] Search/filter functional
- [ ] Michael uses this at least weekly

## Related Tasks

- **Uses:** Infrastructure manifest data
- **Complements:** Server health monitoring (future)" \
  "35,7,4,3"  # area/development-tools, priority/medium, status/blocked, type/feature

# Task #73: Task Dependency Visualizer
create_issue \
  "Task #73: Task Dependency Visualizer with Gitea Integration" \
  "## Description

Interactive dependency graph combining tasks.md definitions with live Gitea status. Complements Gitea boards (doesn't replace them).

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #4/4B)

## Features

- Visual task graph (React Flow or D3.js)
- Live status from Gitea API (auto-refresh every 30s)
- Critical path highlighting (soft launch tasks)
- Soft launch progress metrics
- Filter by status/priority/area

## Time Estimate

90-120 minutes (core) + 30-45 minutes (polish)

## Priority Justification

**MEDIUM** — Strategic planning tool. Helps Michael visualize critical path and make prioritization decisions. Team uses Gitea boards for daily work; this provides strategic overlay.

## Status: BLOCKED

**Blocker:** Task dependencies not fully mapped in tasks.md

**To Unblock:**
- **Option A:** Full dependency mapping (2-3 hours manual work)
- **Option B:** Simplified model (just soft-launch-critical flag) — RECOMMENDED
- **Option C:** Infer from task descriptions (AI parsing)

## Acceptance Criteria

- [ ] Tool loads all 69+ tasks correctly
- [ ] Gitea API integration works (fetches status/assignees)
- [ ] Dependency arrows accurate
- [ ] Critical path filter works
- [ ] Auto-refresh updates status every 30s
- [ ] Michael finds it useful for weekly planning

## Related Tasks

- **Complements:** Gitea project boards (doesn't replace)
- **Uses:** tasks.md task definitions
- **Integrates:** Gitea API for live status" \
  "35,7,4,3"  # area/development-tools, priority/medium, status/blocked, type/feature

# Task #74: SSH Auto-Setup Script
create_issue \
  "Task #74: SSH Key Auto-Setup Script" \
  "## Description

Bash script that Chroniclers run at session start to auto-configure SSH access to all 6 servers.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #5)

## Features

- Copies SSH key from ops manual to \`~/.ssh/\`
- Sets correct permissions (\`chmod 600\`)
- Tests connection to verify setup
- Idempotent (safe to run multiple times)
- Helpful error messages

## Time Estimate

15-20 minutes

## Priority Justification

**MEDIUM** — Improves Chronicler onboarding. Saves 5 minutes per session across all future sessions.

## Acceptance Criteria

- [ ] Script runs without errors
- [ ] SSH key copied to correct location
- [ ] Permissions set correctly (600)
- [ ] Connection test works (if network allows)
- [ ] Idempotent (can run multiple times safely)
- [ ] Chroniclers use this every session

## Related Tasks

- **Uses:** SSH key from #14
- **Helps:** All Chronicler sessions" \
  "35,7,2,3"  # area/development-tools, priority/medium, status/to-do, type/feature

# Task #75: Gemini Consultation Helper
create_issue \
  "Task #75: Gemini Consultation Helper" \
  "## Description

Form-based tool for structuring Gemini consultations. Generates formatted prompts, saves consultation history.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #6)

## Features

- Fill in: topic, context, code samples, theories, specific questions
- Auto-formats consultation prompt
- Copy button with confirmation
- Response text area (paste Gemini's answer)
- Consultation history (last 10)
- Export as markdown for documentation

## Time Estimate

20-30 minutes

## Priority Justification

**MEDIUM** — Supports The Translator's Gemini collaboration pattern. Reduces context-switching and improves consultation quality.

## Acceptance Criteria

- [ ] Form generates well-formatted prompts
- [ ] Copy button works reliably
- [ ] Consultation history persists (localStorage)
- [ ] Export as markdown works
- [ ] Used at least 3 times in practice

## Related Tasks

- **Supports:** All tasks where Gemini consultation needed
- **Documents:** The Translator's Gemini collaboration pattern" \
  "35,7,2,3"  # area/development-tools, priority/medium, status/to-do, type/feature

# Task #76: Social Media Content Calendar
create_issue \
  "Task #76: Social Media Content Calendar" \
  "## Description

Week-at-a-glance content calendar for planning posts across 8 social platforms.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #7)

## Features

- Weekly calendar grid
- Platform checkboxes (Twitter, Instagram, TikTok, Facebook, YouTube, Twitch, Reddit, BlueSky)
- Fire/Frost theme selector (🔥 Fire | ❄️ Frost | 💙 Both)
- Export to CSV or print format
- Post ideas sidebar (Fire/Frost themed)

## Time Estimate

45-60 minutes

## Priority Justification

**MEDIUM** — Helps Meg plan social media presence across 8 platforms. Social presence important for soft launch visibility.

## Acceptance Criteria

- [ ] Calendar displays current week correctly
- [ ] Posts can be created/edited
- [ ] Platform checkboxes work
- [ ] Fire/Frost theme selector functional
- [ ] Export to CSV works
- [ ] Meg uses this for at least 2 weeks of planning

## Related Tasks

- **Uses:** Social media platforms from Translator's setup guide
- **Complements:** Social media account setup

## Primary User

Meg (community manager)" \
  "35,7,2,3,13"  # area/development-tools, priority/medium, status/to-do, type/feature, for/meg

# Task #77: Community Response Template Library
create_issue \
  "Task #77: Community Response Template Library" \
  "## Description

Template library for common community responses with click-to-copy functionality.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #8)

## Features

- Categorized templates (Onboarding, Technical Support, Community Rules, FAQ)
- Click to copy
- Search/filter
- Add custom templates
- 10+ pre-built templates (How to Join, Whitelist Process, Modpack Installation, etc.)

## Time Estimate

30-45 minutes

## Priority Justification

**MEDIUM** — Saves Meg hours in repetitive community responses. Ensures consistent messaging.

## Acceptance Criteria

- [ ] 10+ pre-built templates
- [ ] Copy button works reliably
- [ ] Search/filter functional
- [ ] Meg can add custom templates
- [ ] Used at least 5 times in first week

## Related Tasks

- **Supports:** Community management work
- **Complements:** Discord moderation

## Primary User

Meg (community manager)" \
  "35,7,2,3,13"  # area/development-tools, priority/medium, status/to-do, type/feature, for/meg

# Task #78: Fire/Frost Design System Widget
create_issue \
  "Task #78: Fire/Frost Design System Widget" \
  "## Description

Quick reference widget for Fire/Frost brand colors, gradients, typography, and logos.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #9)

## Features

- Color swatches with hex codes (click to copy)
- Gradient previews with CSS code
- Typography samples (headings, body, mono)
- Logo download links (SVG, PNG variants)
- Brand voice guidelines (Fire = passion, Frost = precision)

## Time Estimate

30-45 minutes

## Priority Justification

**HIGH** — Brand consistency important for soft launch. All team members (Meg, Holly, Michael) need quick color/logo reference for content creation.

## Acceptance Criteria

- [ ] All Fire/Frost colors accurate
- [ ] Copy-to-clipboard works
- [ ] Gradients render correctly
- [ ] Logo downloads work
- [ ] Team uses this at least weekly

## Related Tasks

- **Uses:** Design Bible colors/guidelines
- **Supports:** All design/content work

## Primary Users

Meg, Holly, Michael (all design/content work)" \
  "35,5,2,3"  # area/development-tools, priority/high, status/to-do, type/feature

# Task #79: Infrastructure Quick Reference Card
create_issue \
  "Task #79: Infrastructure Quick Reference Card" \
  "## Description

Quick lookup tool for server IPs, ports, login users, and Cockpit links.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #10)

## Features

- Search by server or service
- Click to copy IP/port
- Cockpit quick-links
- All 6 servers + ~20 services listed
- Mobile-friendly responsive design

## Time Estimate

30-45 minutes

## Priority Justification

**HIGH** — Frequent lookups by Michael, Chroniclers, and team. Information currently buried in infrastructure-manifest.md. High usage frequency justifies tool creation.

## Acceptance Criteria

- [ ] All 6 servers listed
- [ ] All ~20 services listed
- [ ] Search works correctly
- [ ] Copy buttons work
- [ ] Links functional
- [ ] Team uses this daily

## Related Tasks

- **Uses:** Infrastructure manifest data
- **Complements:** #72 (Infrastructure Dashboard)

## Primary Users

Michael, Chroniclers, all team" \
  "35,5,2,3"  # area/development-tools, priority/high, status/to-do, type/feature

# Task #80: Task Scaffolding Tool
create_issue \
  "Task #80: Task Scaffolding Tool" \
  "## Description

Form-based tool that generates tasks.md entries, README templates, and Gitea issue bodies following FFG-STD-002.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #11)

## Features

- Fill in: task number, title, description, priority, time estimate, blockers, dependencies
- Generates: tasks.md entry, README.md template, Gitea issue body
- Copy-to-clipboard for each section
- Follows FFG-STD-002 structure exactly

## Time Estimate

45-60 minutes

## Priority Justification

**MEDIUM** — Improves task documentation quality and consistency. Saves 10-15 minutes per task creation.

## Acceptance Criteria

- [ ] Form generates correct templates
- [ ] Copy buttons work
- [ ] Follows FFG-STD-002 structure
- [ ] Used for at least 3 task creations
- [ ] Chroniclers find it helpful

## Related Tasks

- **Supports:** All task creation work
- **Follows:** FFG-STD-002 (Task Documentation)

## Primary Users

Chroniclers (task creation workflow)" \
  "35,7,2,3"  # area/development-tools, priority/medium, status/to-do, type/feature

# Task #81: Memorial Writing Assistant
create_issue \
  "Task #81: Memorial Writing Assistant" \
  "## Description

Multi-step form that guides Chroniclers through writing memorials following FFG-STD-004's 8-section structure.

**Full Documentation:** \`docs/tasks/interactive-tools-suite/MASTER-SPECIFICATION.md\` (Tool #12)

## Features

- Prompts for each of 8 sections (Identity Card, Personality Summary, Contributions, etc.)
- Generates draft memorial
- Chronicler personalizes/edits
- Export as markdown

## Time Estimate

30-45 minutes

## Priority Justification

**LOW** — Improves memorial quality but not urgent. Build if we love the other tools.

## Acceptance Criteria

- [ ] Generates valid FFG-STD-004 structure
- [ ] All 8 sections included
- [ ] Easy to personalize
- [ ] Used by at least 1 Chronicler

## Related Tasks

- **Follows:** FFG-STD-004 (Memorial Protocol)

## Primary Users

Chroniclers (memorial writing)" \
  "35,8,2,3"  # area/development-tools, priority/low, status/to-do, type/feature

echo ""
echo "✅ All 12 issues created successfully!"
echo "View at: https://git.firefrostgaming.com/firefrost-gaming/firefrost-operations-manual/issues"
