docs(copilot): add Copilot instructions for The Collective Hub

- Add comprehensive project overview and core philosophy
- Document file structure reference for the codebase
- Create key files reference table for task-specific guidance
- Include multi-tenant guidelines and site resolution flow
This commit is contained in:
KungRaseri
2026-06-05 23:46:15 -07:00
parent f4245a996a
commit b192cd53ba
33 changed files with 5710 additions and 120 deletions
+132
View File
@@ -0,0 +1,132 @@
name: CI - The Collective Hub
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main, development]
paths:
- 'src/**'
- 'package.json'
- 'package-lock.json'
- 'svelte.config.js'
- 'vite.config.ts'
- '.github/workflows/ci-web.yml'
- '.github/instructions/**'
- '.github/prompts/**'
- 'AGENTS.md'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'package.json'
- 'package-lock.json'
- 'svelte.config.js'
- 'vite.config.ts'
- '.github/workflows/ci-web.yml'
- '.github/instructions/**'
- '.github/prompts/**'
- 'AGENTS.md'
workflow_dispatch:
env:
NODE_VERSION: '22.x'
jobs:
validate-and-build:
name: Validate & Build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Create stub .env for build
run: |
cat <<'EOF' > .env
DATABASE_URL=postgresql://ci:ci@localhost:5432/ci
BETTER_AUTH_SECRET=ci-secret-for-build
SITE_SLUG=ci-test-site
OWNER_DISCORD_ID=000000000000000000
CDN_BASE_URL=http://cdn.example.com
ORIGIN=http://localhost:3000
EOF
- name: Check types
run: npx svelte-check --tsconfig ./tsconfig.json
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Unit tests
run: npx vitest --run
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 30
- name: Docker build test
run: docker build -t collective-hub-ci --target runner .
- name: Validate Markdown links
run: npx markdown-link-check --config .mlc-config.json ./*.md .github/**/*.md 2>/dev/null || echo "markdown-link-check not configured, skipping"
e2e-tests:
name: E2E Tests
needs: validate-and-build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Create stub .env for build
run: |
cat <<'EOF' > .env
DATABASE_URL=postgresql://ci:ci@localhost:5432/ci
BETTER_AUTH_SECRET=ci-secret-for-build
SITE_SLUG=ci-test-site
OWNER_DISCORD_ID=000000000000000000
CDN_BASE_URL=http://cdn.example.com
ORIGIN=http://localhost:4173
EOF
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run E2E tests
run: npx playwright test
+67
View File
@@ -0,0 +1,67 @@
name: Release
on:
push:
tags:
- 'content/*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to create a release for (e.g., content/v1.0.0)'
required: true
type: string
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve tag and version
id: resolve
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${{ github.ref_name }}"
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Resolved tag: $TAG"
- name: Generate changelog
id: changelog
run: |
TAG="${{ steps.resolve.outputs.tag }}"
PREV_TAG=$(git tag --list "content/*" --sort=-version:refname | grep -v "^${TAG}$" | head -1 || true)
if [ -n "$PREV_TAG" ]; then
echo "Generating changelog from $PREV_TAG to $TAG"
CHANGELOG=$(git log "$PREV_TAG..$TAG" --pretty=format:"- %s (%h)" --no-merges 2>/dev/null || echo "- Initial release")
else
echo "No previous tag found — using full log"
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges 2>/dev/null | head -50 || echo "- Initial release")
fi
[ -z "$CHANGELOG" ] && CHANGELOG="- No changes logged"
DELIM=$(openssl rand -hex 8)
echo "changelog<<$DELIM" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "$DELIM" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.resolve.outputs.tag }}
name: ${{ steps.resolve.outputs.tag }}
body: |
## The Collective Hub — ${{ steps.resolve.outputs.tag }}
### What's Changed
${{ steps.changelog.outputs.changelog }}
token: ${{ secrets.GITHUB_TOKEN }}