docs: Update AGENTS.md with smart migration workflow

Updates:
- Added Smart Migration Workflow (Detect, Plan, Preserve, Convert, Rebuild, Enhance, Test)
- Updated Dockerfile specs (npm install, port 80)
- Added migrate_existing_website.py to WHERE TO LOOK
- Migration planning with risk assessment
- Content preservation guarantees
This commit is contained in:
Kunthawat Greethong
2026-03-12 09:26:01 +07:00
parent 20d1e24389
commit 6e61723f76

View File

@@ -1,7 +1,7 @@
# PROJECT KNOWLEDGE BASE
**Generated:** 2026-03-08
**Updated:** 2026-03-09 (Website Creator + SEO Skills Complete)
**Updated:** 2026-03-10 (Smart Migration + Dockerfile Fixes)
**Type:** OpenCode Skills Collection - PDPA-Compliant Website Generator with Auto-Deploy + SEO Multi-Channel Marketing
---
@@ -25,7 +25,19 @@ Personal collection of OpenCode skills for AI-powered terminal coding assistant.
-**Image integration** - Auto-generate/edit images for content
-**Auto-publish** - Direct write to Astro content collections
### **Latest Updates (2026-03-09):**
### **Latest Updates (2026-03-10):**
-**Smart Migration Workflow** - Detect, Plan, Preserve, Convert, Rebuild, Enhance, Test
-**Tech Stack Detection** - Auto-detects Astro, Tailwind, CSS frameworks
-**Migration Planning** - Risk assessment before migration
-**Content Preservation** - Keeps ALL inline CSS and content exactly
-**Dockerfile** - Uses npm install (not npm ci), port 80 only
-**Website Creator** - Reverted to Dockerfile deployment
-**Thai Legal Templates** - PDPA-compliant Privacy Policy & Terms of Service
-**Cookie Consent** - Working implementation (blocks cookies until consent)
-**Template Structure** - Consistent structure for all websites
-**Build Testing** - Test build before deployment
### **Previous Updates (2026-03-09):**
-**Website Creator** - Reverted to Dockerfile deployment
-**Thai Legal Templates** - PDPA-compliant Privacy Policy & Terms of Service
-**Cookie Consent** - Working implementation (blocks cookies until consent)
@@ -71,6 +83,7 @@ opencode-skill/
| Install all skills | `scripts/install-skills.sh` | Uses unified .env, copies to `~/.config/opencode/` |
| Add new skill | `skills/skill-creator/` | Use create_skill.py to scaffold |
| Generate website (AUTO-DEPLOY) | `skills/website-creator/scripts/create_astro_website.py` | ✅ Auto-syncs to Gitea, auto-deploys to Easypanel |
| **Migrate Existing Website** | `skills/website-creator/scripts/migrate_existing_website.py` | ✅ Smart migration with tech detection |
| **Website Templates** | `skills/website-creator/scripts/templates/` | ✅ Thai legal templates, cookie consent |
| Sync to Gitea (standalone) | `skills/gitea-sync/scripts/sync.py` | Create/update repos, push code |
| Deploy to Easypanel (standalone) | `skills/easypanel-deploy/scripts/deploy.py` | Uses username/password auth (Dockerfile) |
@@ -160,7 +173,7 @@ description: Brief description. Use when user wants to [action].
- **Monitoring:** Checks deployment status 3 times
- **Auto-fix:** Triggers redeploy if deployment fails
- **Output:** Returns both Gitea repo URL and Easypanel deployment URL
- **Build method:** Dockerfile (not nixpacks)
- **Build method:** Dockerfile (npm install, port 80 only)
### Thai Legal Compliance (NEW 2026-03-09)
- **Privacy Policy:** PDPA-compliant template (Thai Personal Data Protection Act)
@@ -170,14 +183,36 @@ description: Brief description. Use when user wants to [action].
- **DPO Requirements:** Template includes DPO contact section
- **PDPC Complaints:** Template includes complaint procedures
### Build Testing (NEW 2026-03-09)
Before deployment, website-creator tests:
- Docker build completes successfully
- All pages are accessible
- Cookie consent blocks tracking scripts
- Contact forms work
- Mobile responsiveness
- Backend functions (if applicable)
### Smart Migration Workflow (NEW 2026-03-10)
For migrating existing websites safely:
1. **DETECT** - Auto-detects tech stack (Astro, Tailwind, CSS)
2. **PLAN** - Creates detailed migration plan with risks
3. **PRESERVE** - Keeps ALL inline CSS and content exactly
4. **CONVERT** - Converts CSS frameworks (Tailwind v3→v4)
5. **REBUILD** - Fresh Astro install with preserved content
6. **ENHANCE** - Adds new features (cookie consent, PDPA)
7. **TEST** - Comprehensive testing before deployment
**Usage:**
```bash
# Create migration plan first
python3 skills/website-creator/scripts/migrate_existing_website.py \
--input "./existing-website" \
--output "./migrated-website" \
--plan-only
# Review plan, then proceed with migration
python3 skills/website-creator/scripts/migrate_existing_website.py \
--input "./existing-website" \
--output "./migrated-website"
```
**Benefits:**
- ✅ No more broken CSS
- ✅ No more failed deployments
- ✅ All inline styles preserved
- ✅ All routes preserved
- ✅ Plan before migrating (safe!)
### Unified Credentials (NEW 2026-03-08)
- Single `/.env` file for ALL skills