config: full APAW agent infrastructure + Phantom project files

- Added all agent definitions (.kile/agents/*.md)
- Added commands, rules, skills, shared modules
- Added src/, scripts/, tests/, docker/, agent-evolution/
- Extracted 3 archives: website/, workspace/, release/
- Created .env with Gitea creds for UniqueSoft/Phantom
- Created docs/ with project-specific guides
- Added .gitignore for node_modules
This commit is contained in:
NW
2026-05-18 17:53:59 +01:00
parent b680c5aeca
commit 863a67db8e
56 changed files with 8590 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
# Architect Indexer Dockerfile
# Scans target project codebase and generates .architect/ directory
#
# Usage:
# docker compose -f docker/docker-compose.architect.yml build
# docker compose -f docker/docker-compose.architect.yml run --rm architect-indexer
# docker compose -f docker/docker-compose.architect.yml run --rm architect-indexer --mode incremental
# ── Build stage ────────────────────────────────────────────────────
FROM oven/bun:1-alpine AS builder
WORKDIR /build
# Copy dependency files first (cache layer)
COPY package.json ./
# bun.lock might not exist; handle gracefully
COPY bun.lock* ./
# Install dependencies
RUN bun install 2>/dev/null || npm install 2>/dev/null || true
# Copy source for build
COPY tsconfig.json ./
COPY src/ ./src/
# Build TypeScript
RUN bun run build 2>/dev/null || npx tsc 2>/dev/null || true
# ── Production stage ────────────────────────────────────────────────
FROM node:20-alpine AS production
WORKDIR /app
# Security: non-root user
RUN addgroup -S apaw && adduser -S apaw -G apaw
# Copy built artifacts
COPY --from=builder /build/dist/ ./dist/
COPY --from=builder /build/node_modules/ ./node_modules/
COPY --from=builder /build/package.json ./
# Copy .kilo configs for agent context
COPY .kilo/agents/architect-indexer.md ./agents/architect-indexer.md
COPY .kilo/skills/project-mapping/ ./skills/project-mapping/
COPY .kilo/rules/ ./rules/
# Ensure .architect template directory exists
COPY .architect/ /template/.architect/
# Default project mount point
ENV PROJECT_ROOT=/project
ENV NODE_ENV=production
ENV TZ=UTC
# Healthcheck: verify .architect/ was generated
HEALTHCHECK --interval=60s --timeout=15s --start-period=10s --retries=2 \
CMD test -d /project/.architect || exit 1
USER apaw
# Run the indexer script (compiled from TypeScript)
ENTRYPOINT ["node", "dist/kilocode/scripts/run-architect-indexer.js"]
CMD ["--target", "/project"]

View File

@@ -0,0 +1,33 @@
# Playwright MCP Docker Image for E2E Testing
# Based on official Microsoft Playwright image
FROM mcr.microsoft.com/playwright:v1.58.2-noble
# Set working directory
WORKDIR /app
# Install dependencies
RUN npm install -g @playwright/mcp@latest
# Create directories for tests
RUN mkdir -p .test/screenshots/{baseline,current,diff} .test/reports
# Set environment variables
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV PLAYWRIGHT_MCP_BROWSER=chromium
# HEADLESS=false by default - browser is VISIBLE for observation
# Set PLAYWRIGHT_MCP_HEADLESS=true for CI/CD
ENV PLAYWRIGHT_MCP_HEADLESS=false
# Expose port for MCP server
EXPOSE 8931
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8931/health || exit 1
# Default command - MCP server (HEADED by default - browser visible)
# Browser window will be visible for observation
CMD ["node", "/usr/local/lib/node_modules/@playwright/mcp/cli.js", \
"--browser", "chromium", \
"--no-sandbox", "--port", "8931", "--host", "0.0.0.0"]

View File

@@ -0,0 +1,48 @@
# Architect Indexer Service
# Scans project codebase and generates/updates .architect/ directory
#
# Usage:
# Full index (first run):
# docker compose -f docker/docker-compose.architect.yml run architect-indexer
#
# Incremental update:
# docker compose -f docker/docker-compose.architect.yml run architect-indexer --mode incremental
#
# Index a specific project path:
# docker compose -f docker/docker-compose.architect.yml run architect-indexer --target /project
#
# Re-build image:
# docker compose -f docker/docker-compose.architect.yml build
services:
architect-indexer:
build:
context: ..
dockerfile: docker/Dockerfile.architect-indexer
container_name: apaw-architect-indexer
volumes:
# Mount target project for scanning and .architect/ output
- ..:/project:rw
# Exclude node_modules from mount (use container's own)
- /project/node_modules
# Exclude .kilo internal deps from scan
- /project/.kilo/node_modules
environment:
- PROJECT_ROOT=/project
- NODE_ENV=production
- TZ=UTC
# Gitea integration (optional, for posting indexing comments)
- GITEA_API_URL=${GITEA_API_URL:-https://git.softuniq.eu/api/v1}
- GITEA_TOKEN=${GITEA_TOKEN:-}
- GITEA_ISSUE=${GITEA_ISSUE:-}
working_dir: /project
networks:
- architect-network
restart: "no"
labels:
- "com.apaw.service=architect-indexer"
- "com.apaw.description=Project codebase indexer - generates .architect/ directory"
networks:
architect-network:
driver: bridge

View File

@@ -0,0 +1,129 @@
# Web Testing Infrastructure
# Covers: Visual Regression, Link Checking, Form Testing, Console Errors
#
# Usage:
# Local app testing (bridge network):
# docker compose -f docker/docker-compose.web-testing.yml up visual-tester
#
# External site testing (host network for DNS):
# docker compose --profile external -f docker/docker-compose.web-testing.yml up visual-tester
#
# Override target URL:
# TARGET_URL=https://example.com docker compose --profile external -f docker/docker-compose.web-testing.yml up visual-tester
#
# Gitea integration:
# GITEA_ISSUE=42 docker compose --profile external -f docker/docker-compose.web-testing.yml up visual-tester
services:
# ─── Screenshot Capture: Create Baselines ─────────────────────────
screenshot-baseline:
image: mcr.microsoft.com/playwright:v1.52.0-noble
container_name: apaw-screenshot-baseline
working_dir: /app
volumes:
- ../tests:/app/tests
environment:
- TARGET_URL=${TARGET_URL:-http://host.docker.internal:3000}
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
- DNS_RESOLUTION_ORDER=hostname-first
command: >
sh -c "cd /app/tests && npm install --ignore-scripts 2>/dev/null;
node scripts/capture-screenshots.js baseline"
extra_hosts:
- "host.docker.internal:host-gateway"
shm_size: '2gb'
ipc: host
network_mode: ${NETWORK_MODE:-bridge}
# ─── Screenshot Capture: Create Current ──────────────────────────
screenshot-current:
image: mcr.microsoft.com/playwright:v1.52.0-noble
container_name: apaw-screenshot-current
working_dir: /app
volumes:
- ../tests:/app/tests
environment:
- TARGET_URL=${TARGET_URL:-http://host.docker.internal:3000}
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
- DNS_RESOLUTION_ORDER=hostname-first
command: >
sh -c "cd /app/tests && npm install --ignore-scripts 2>/dev/null;
node scripts/capture-screenshots.js current"
extra_hosts:
- "host.docker.internal:host-gateway"
shm_size: '2gb'
ipc: host
network_mode: ${NETWORK_MODE:-bridge}
# ─── Visual Regression: Compare Screenshots ──────────────────────
visual-compare:
image: node:20-alpine
container_name: apaw-visual-compare
working_dir: /app
volumes:
- ../tests:/app/tests
environment:
- PIXELMATCH_THRESHOLD=0.05
- BASELINE_DIR=/app/tests/visual/baseline
- CURRENT_DIR=/app/tests/visual/current
- DIFF_DIR=/app/tests/visual/diff
- REPORTS_DIR=/app/tests/reports
command: >
sh -c "cd /app/tests && npm install --ignore-scripts 2>/dev/null;
node scripts/compare-screenshots.js"
# ─── Full Visual Test Pipeline ──────────────────────────────────
# Captures current screenshots and compares against baselines
visual-tester:
image: mcr.microsoft.com/playwright:v1.52.0-noble
container_name: apaw-visual-tester
working_dir: /app
volumes:
- ../tests:/app/tests
environment:
- TARGET_URL=${TARGET_URL:-http://host.docker.internal:3000}
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
- PIXELMATCH_THRESHOLD=${PIXELMATCH_THRESHOLD:-0.05}
- PAGES=${PAGES:-/,/admin/login}
- BASELINE_DIR=/app/tests/visual/baseline
- CURRENT_DIR=/app/tests/visual/current
- DIFF_DIR=/app/tests/visual/diff
- REPORTS_DIR=/app/tests/reports
- GITEA_ISSUE=${GITEA_ISSUE:-}
- GITEA_TOKEN=${GITEA_TOKEN:-}
- GITEA_USER=${GITEA_USER:-}
- GITEA_PASSWORD=${GITEA_PASSWORD:-}
- DNS_RESOLUTION_ORDER=hostname-first
command: >
sh -c "cd /app/tests && npm install --ignore-scripts 2>/dev/null;
node scripts/visual-test-pipeline.js"
extra_hosts:
- "host.docker.internal:host-gateway"
shm_size: '2gb'
ipc: host
network_mode: ${NETWORK_MODE:-bridge}
# ─── Console Error Monitor ──────────────────────────────────────
console-monitor:
image: mcr.microsoft.com/playwright:v1.52.0-noble
container_name: apaw-console-monitor
working_dir: /app
volumes:
- ../tests:/app/tests
environment:
- TARGET_URL=${TARGET_URL:-http://host.docker.internal:3000}
- REPORTS_DIR=/app/tests/reports
- GITEA_ISSUE=${GITEA_ISSUE:-}
- GITEA_TOKEN=${GITEA_TOKEN:-}
- GITEA_USER=${GITEA_USER:-}
- GITEA_PASSWORD=${GITEA_PASSWORD:-}
- DNS_RESOLUTION_ORDER=hostname-first
command: >
sh -c "cd /app/tests && npm install --ignore-scripts 2>/dev/null;
node scripts/console-error-monitor-standalone.js"
extra_hosts:
- "host.docker.internal:host-gateway"
shm_size: '2gb'
ipc: host
network_mode: ${NETWORK_MODE:-bridge}

54
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,54 @@
version: '3.8'
services:
playwright-mcp:
build:
context: .
dockerfile: Dockerfile.playwright
container_name: playwright-mcp
ports:
- "8931:8931"
volumes:
- ./:/app
- /app/node_modules
environment:
- PLAYWRIGHT_MCP_BROWSER=chromium
- PLAYWRIGHT_MCP_HEADLESS=false
- PLAYWRIGHT_MCP_NO_SANDBOX=true
- PLAYWRIGHT_MCP_PORT=8931
- PLAYWRIGHT_MCP_HOST=0.0.0.0
- DISPLAY=${DISPLAY:-:0}
restart: unless-stopped
shm_size: '2gb'
ipc: host
security_opt:
- seccomp:unconfined
# For visual debugging (headed mode)
playwright-headed:
image: mcr.microsoft.com/playwright:v1.58.2-noble
container_name: playwright-headed
ports:
- "8932:8931"
volumes:
- ./:/app
environment:
- DISPLAY=$DISPLAY
command: >
npx @playwright/mcp@latest
--browser chromium
--port 8931
--host 0.0.0.0
profiles:
- debug
# For running tests locally
test-runner:
image: mcr.microsoft.com/playwright:v1.58.2-noble
container_name: playwright-test
volumes:
- ./:/app
working_dir: /app
command: npx playwright test
profiles:
- test