Commit 83b9754
docs: add 6 major operational sections to instructions
Added comprehensive guidance for day-to-day operations and troubleshooting:
## 1. Communication Guidelines (60 lines)
- When to ask user vs. proceed autonomously
- Always ask: ambiguous requirements, destructive ops, security implications
- Proceed: clear requirements, standard patterns, safe operations
- How to report progress: concise, outcome-focused, avoid over-explanation
- Good vs. bad examples of communication patterns
## 2. Security Best Practices (85 lines)
- Input sanitization with WordPress functions
- Output escaping (context-appropriate)
- SQL injection prevention with $wpdb->prepare()
- Nonce verification for CSRF protection
- Capability checks (never trust roles)
- Credential handling (never log, use 1Password CLI)
- File upload security
## 3. Conflict Resolution (70 lines)
- Git merge conflict resolution workflow
- When to ask user vs. resolve automatically
- Package dependency conflicts (composer.lock, package-lock.json)
- Database migration conflicts
- When/how to abort and ask for help
## 4. Database Operations (95 lines)
- CRITICAL safety procedures: backup first, test on staging
- Safe migration patterns (adding/removing columns, changing data)
- WP CLI database commands (search-replace, query, optimize)
- Complete migration workflow (local → staging → production)
- Rollback procedures
## 5. Rollback Procedures (130 lines)
- Emergency rollback steps (revert deployment immediately)
- Rollback database migrations (restore from backup, reverse migration)
- Rollback code changes (git revert specific commits)
- Rollback dependencies (restore package files)
- Prevention strategies
- Incident communication (during and after)
## 6. Troubleshooting (220 lines)
- CI/CD failures: ShellCheck, PHPCS, test timeouts, build errors
- Git issues: SSH keys, detached HEAD, merge conflicts, unrelated histories
- WP CLI issues: database connection, timeouts, command not found
- Deployment issues: staging not updating, production broken
- Linting issues: local vs. CI differences, missing tools
- Build issues: missing modules, out of memory
- Performance issues: slow site, cache problems
- When to ask for help (clear guidelines)
## Impact
File evolution:
- After Phase 7: 897 lines
- After Phase 8: 1552 lines (+655 lines, +73%)
Now covers complete operational lifecycle:
- ✅ Development workflows
- ✅ Security requirements
- ✅ Database safety
- ✅ Emergency procedures
- ✅ Common problems and solutions
- ✅ Communication patterns
These 6 sections address the most common real-world scenarios
and provide clear, actionable guidance for handling them safely.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 7033000 commit 83b9754
1 file changed
Lines changed: 657 additions & 2 deletions
0 commit comments