These instructions are for AI assistants working in this project.
Always open @/openspec/AGENTS.md when the request:
- Mentions planning or proposals (words like proposal, spec, change, plan)
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
- Sounds ambiguous and you need the authoritative spec before coding
Use @/openspec/AGENTS.md to learn:
- How to create and apply change proposals
- Spec format and conventions
- Project structure and guidelines
Keep this managed block so 'openspec update' can refresh the instructions.
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a hackathon development environment for CloudFest USA 2025, integrating three key technologies:
- FAIR Package Manager - Federated WordPress package distribution using DIDs (Decentralized Identifiers)
- AspireCloud - Open-source WordPress package API (CDN/mirror)
- PatchStack - WordPress vulnerability database API
The hackathon project goal is to build a FAIR Software Security Assistant that screens WordPress plugins/themes against PatchStack vulnerability data and enforces security policies for hosting providers.
The environment combines two Docker orchestration systems:
- wp-env (WordPress Environments) - Manages WordPress, MySQL, and PHP containers
- docker-compose - Manages infrastructure (AspireCloud, PostgreSQL, Traefik, Redis, etc.)
These run on a shared cloudfest-network Docker network, connected via lifecycle hooks in .wp-env.json.
WordPress containers are automatically connected to the cloudfest-network via the afterStart lifecycle script in .wp-env.json. This allows WordPress to communicate with AspireCloud and other services by hostname (e.g., http://aspirecloud:80, redis, mailhog).
The FAIR plugin is automatically cloned from GitHub if not present when running npm run dev:start. The plugin source lives in plugins/fair/ (gitignored) and is loaded directly by wp-env.
The FAIR plugin is auto-configured via config/fair-config.php, which is mapped as a must-use plugin. This file:
- Points FAIR to the local AspireCloud instance
- Enables debug logging
- Configures package update sources
Important:
- Changes to
config/fair-config.phprequire WordPress restart:npm run wp:stop && npm run wp:start - The FAIR plugin source is in
plugins/fair/and changes require WordPress restart - See
docs/contributing-to-fair.mdfor information on contributing changes back to FAIR
The CloudFest FAIR Frontend Team plugin is automatically cloned from GitHub if not present when running npm run dev:start. The plugin source lives in plugins/cloudfest-fair-frontend-team/ (gitignored) and is loaded directly by wp-env.
This plugin provides:
- Frontend UI for the FAIR Security Assistant
- Integration with PatchStack vulnerability data
- Security policy management interface
Important:
- The plugin source is in
plugins/cloudfest-fair-frontend-team/and changes require WordPress restart - Repository: https://github.com/CesarAyalaDev/cloudfest-fair-frontend-team
All services run on the cloudfest-network Docker network and are accessible via:
From your browser (host machine):
- Port-based URLs:
http://localhost:PORT - Example:
http://localhost:8099for AspireCloud
From WordPress container:
- Docker container names:
http://containername:PORT - Example:
http://aspirecloud:80for AspireCloud
npm run dev:start # One-command setup: SSL + services + database + WordPress
npm run dev:stop # Stop all services
npm run dev:logs # Follow all service logs
npm run dev:reset # Complete reset (deletes ALL data)# WordPress only
npm run wp:start # Start WordPress
npm run wp:stop # Stop WordPress
npm run wp:cli -- plugin list # WP-CLI commands
# Infrastructure only
npm run docker:up # Start docker-compose services
npm run docker:down # Stop docker-compose services
# Database operations
npm run db:import # Import AspireCloud SQL snapshot
# SSL setup
npm run setup # Re-run SSL certificate generationAccess WordPress filesystem:
docker exec -it $(docker ps -qf 'name=.*-wordpress-1') bash
cd /var/www/html/wp-content/pluginsQuery local AspireCloud:
curl http://localhost:8099/plugins/info/1.1/Query PatchStack API:
curl -X POST https://vdp-api.patchstack.com/api/sysadmin/v2/reports/vuln/hackathon \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token from .env.example>" \
-d '[{"type":"plugin","name":"woocommerce","version":"1.0.0","exists":false}]'Access PostgreSQL:
docker exec -it cloudfest-aspirecloud-db psql -U postgres -d aspirecloud| Service | Browser URL | Docker Network URL | Credentials |
|---|---|---|---|
| WordPress Admin | http://localhost:8888/wp-admin | N/A | admin / password |
| AspireCloud API | http://localhost:8099 | http://aspirecloud:80 | N/A |
| Mailhog | http://localhost:8025 | http://mailhog:8025 | N/A |
| Adminer | http://localhost:8080 | N/A | postgres / password |
| Traefik Dashboard | http://localhost:8090 | N/A | N/A |
.wp-env.json- WordPress environment configuration, plugins, network lifecycle hooksdocker-compose.yml- Infrastructure services (AspireCloud, Traefik, Redis, PostgreSQL)config/fair-config.php- FAIR plugin auto-configuration (mu-plugin)scripts/setup-ssl.sh- Automated mkcert installation and certificate generationscripts/start-all.sh- Main orchestration script (calls other scripts in sequence)scripts/import-database.sh- AspireCloud database import with zstd decompressiontraefik/dynamic/tls.yml- Traefik TLS certificate configurationsnapshots/aspirecloud_mini_*.sql- AspireCloud database snapshot (24MB)
- wp-env creates its own Docker network by default
- The
afterStartlifecycle hook in.wp-env.jsonconnects WordPress containers tocloudfest-network - Services can be accessed from WordPress by container name:
aspirecloud,redis,mailhog
The start-all.sh script checks if the AspireCloud database is populated before importing:
# Checks table count, imports if < 5 tables
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public'All services are accessible via standard HTTP ports on localhost. No SSL/HTTPS configuration is required for local development. Docker containers communicate with each other using container names on the internal network.
- wp-env manages its own volumes; data persists between
wp:stopandwp:start wp:destroyremoves all data and volumeswp:cleanresets WordPress but keeps the environment- Changes to
.wp-env.jsonrequirewp:destroy && wp:startto take effect
docs/fair-pm-hackathon-guide.md- FAIR protocol, DIDs, Ed25519 signatures, package metadatadocs/patchstack-hackathon-guide.md- PatchStack vulnerability API usagedocs/hackathon-project-brief.md- Project goals, team structure, deliverables
Build a security screening system that:
- Monitors FAIR repositories for new packages
- Queries PatchStack for known vulnerabilities
- Applies configurable security policies (approve/flag/block)
- Provides dashboard for repository status
- FAIR → AspireCloud: FAIR plugin queries AspireCloud for package metadata
- AspireCloud → PostgreSQL: Package data stored in PostgreSQL database
- Plugin Development → PatchStack: Custom plugin should query PatchStack API for vulnerabilities
- Security Labels: FAIR supports moderation labels (see
docs/fair-pm-hackathon-guide.mdline 29)
All services use port-based URLs accessible at http://localhost:PORT:
- AspireCloud: http://localhost:8099
- Mailhog: http://localhost:8025
- Adminer: http://localhost:8080
- WordPress: http://localhost:8888
Check if containers are running:
docker ps | grep cloudfest- Verify docker network:
docker network inspect cloudfest-network - Check WordPress is on network:
docker inspect <wordpress-container-id> - Restart WordPress:
npm run wp:stop && npm run wp:start
Ensure zstd is installed:
- macOS:
brew install zstd - Linux:
sudo apt-get install zstd
If wp-env fails with fatal: couldn't find remote ref latest, ensure .wp-env.json uses a valid core value:
- Use
"core": nullfor latest stable WordPress (recommended) - Or use specific branch:
"core": "WordPress/WordPress#trunk" - Or use specific version:
"core": "WordPress/WordPress#6.4.2"
Note: "latest" is not a valid git reference in the WordPress repository.
Default ports used: 80, 443, 5432, 6379, 8025, 8080, 8090, 8099, 8888, 8889
Change ports in:
docker-compose.yml(infrastructure services).wp-env.json(WordPress ports)
- Add to
.wp-env.jsonplugins array (URL or slug) - Run
npm run wp:destroy && npm run wp:start - Or install via admin panel (persists in wp-env volumes)
- Edit
config/fair-config.php - Restart WordPress:
npm run wp:stop && npm run wp:start - Changes take effect immediately (mu-plugin loads early)
- Query PLC directory:
curl https://plc.directory/<did> - Extract serviceEndpoint from response
- Query package metadata:
curl <serviceEndpoint>/packages/<did>
- Edit
docker-compose.yml - Add service to
cloudfest-network - Run
npm run docker:down && npm run docker:up