Secure Facebook marketing analysis platform development workflow. Implements AES-256 encryption, rate limiting, Chrome debug security, and secure logging for extracting and analyzing Facebook post patterns while protecting user accounts.
A production-ready, secure Facebook marketing analysis platform that extracts, analyzes, and generates marketing content based on successful post patterns. This skill guides AI agents through secure development, deployment, and maintenance of the PostWriter system.
PostWriter implements military-grade security for Facebook data extraction:
ALWAYS perform security validation before any development work:
```bash
python3 -c "from secure_logging import audit_log_security; audit_log_security('.')"
python3 postwriter.py browser status
python3 -c "from rate_limiter import get_rate_limiter; print(get_rate_limiter().get_statistics())"
python3 postwriter.py chrome-proxy status
```
**CRITICAL**: If any plaintext sessions are detected, IMMEDIATELY encrypt them before proceeding:
```bash
python3 postwriter.py browser encrypt-session --file ./data/browser_profile/session.json
```
Verify all prerequisites are met:
```bash
pip install -r requirements.txt
python3 postwriter.py validate
python3 postwriter.py secure status
```
Set appropriate environment variables:
```bash
export POSTWRITER_ENV=development
export CHROME_DEBUG_PORT=9222
export SECURE_PROXY_PORT=9223
export POSTWRITER_ENV=production
export RATE_LIMIT_STRICT=true
export SECURITY_AUDIT_ENABLED=true
```
#### Browser Security Operations
```bash
python3 postwriter.py browser encrypt-session --file <path>
python3 postwriter.py browser extract-chrome
python3 postwriter.py browser load-session
python3 postwriter.py browser status
```
#### Secure Chrome Debug Connection
```bash
python3 postwriter.py chrome-proxy start
python3 postwriter.py chrome-proxy test
python3 postwriter.py chrome-proxy status
```
#### Data Operations (All Rate Limited)
```bash
python3 postwriter.py sync
python3 postwriter.py analyze
python3 postwriter.py export
```
Run these tests before ANY commit or deployment:
```bash
python3 secure_logging.py
python3 rate_limiter.py
python3 secure_chrome_proxy.py
python3 postwriter.py browser load-session
python3 postwriter.py chrome-proxy test
```
```yaml
security:
encrypt_sessions: true
rate_limiting_enabled: true
secure_chrome_proxy: true
max_requests_per_minute: 20
max_requests_per_hour: 300
facebook:
cookies_path: "./data/cookies.json" # Will be encrypted
scraping:
retry_attempts: 3
scroll_delay: 3.0
pre_scrape_delay: 5
use_secure_storage: true
```
Before ANY release or deployment, verify:
```python
from secure_logging import get_secure_logger
from rate_limiter import get_rate_limiter
logger = get_secure_logger()
incidents = logger.get_security_incidents()
rate_limiter = get_rate_limiter()
stats = rate_limiter.get_statistics()
```
```bash
python3 postwriter.py browser encrypt-session --file <path>
```
```bash
python3 -c "from rate_limiter import get_rate_limiter; print(get_rate_limiter().get_statistics())"
python3 -c "from rate_limiter import get_rate_limiter; get_rate_limiter().reset_backoff()"
```
```bash
python3 postwriter.py chrome-proxy start
python3 postwriter.py chrome-proxy test
```
```
PostWriter/
├── CLAUDE.md # Development documentation
├── secure_logging.py # Security-aware logging
├── rate_limiter.py # Facebook rate limiting
├── secure_browser_storage.py # Encrypted session storage
├── secure_chrome_proxy.py # Chrome debug security
├── config_validator.py # Configuration validation
├── exceptions.py # Security exception handling
├── postwriter.py # Main CLI
└── data/ # Encrypted data storage
├── browser_profile/ # Encrypted sessions only
└── logs/ # Filtered security logs
```
1. **Security first** - All code must pass security audit
2. **Rate limit aware** - All HTTP requests use rate limiter
3. **Secure logging** - Use secure_logging.py for all output
4. **Input validation** - Validate all external inputs
```bash
git checkout -b security/feature-name
python3 postwriter.py validate
git commit -m "feat: implement X with security hardening"
git push origin security/feature-name
```
1. **NEVER commit plaintext sessions** - Use .gitignore protection
2. **ALWAYS encrypt before storage** - Use secure_browser_storage.py
3. **ALWAYS validate inputs** - Use config_validator.py
4. **ALWAYS log security events** - Use secure_logging.py
1. **Start conservative** - Use default rate limits
2. **Monitor for failures** - Watch for rate limit detection
3. **Respect Facebook ToS** - Never bypass rate limits
4. **Use exponential backoff** - Let system self-regulate
1. **Use secure proxy** - Never expose debug port directly
2. **Authenticate all connections** - Require auth tokens
3. **Monitor session activity** - Track all debug requests
4. **Restrict network access** - Localhost only
This workflow achieves:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/postwriter-development-workflow/raw