Skip to content

Commit 7813b15

Browse files
authored
Initial commit
0 parents  commit 7813b15

55 files changed

Lines changed: 9866 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/coderabbit.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description: Evaluate CodeRabbit comment and recommend whether to action it
3+
argument-hint: <comment-url>
4+
allowed-tools: Bash(gh api:*), Read, Glob, Grep
5+
---
6+
7+
## 1. Fetch
8+
9+
Parse `$1` to extract owner, repo, and comment ID.
10+
11+
```bash
12+
# strips analysis chain
13+
gh api repos/OWNER/REPO/pulls/comments/COMMENT_ID \
14+
--jq '.body | gsub("<details>\\s*<summary>🧩 Analysis chain</summary>[\\s\\S]*?</details>\\s*"; "")' \
15+
> z_comment.md
16+
```
17+
18+
## 2. Evaluate
19+
20+
CodeRabbit AI is not always right.
21+
22+
Evaluate the comment `z_comment.md` against the context of our codebase and files it references. Assess:
23+
24+
| Criterion | Question |
25+
|-----------|----------|
26+
| **Contextually valid** | Does it make sense with full codebase context? |
27+
| **Valuable** | Worth doing? Good practice? Or is it over-engineering? |
28+
| **Elegant** | Is the suggested fix pragmatic and clean? |
29+
30+
## 3. Recommend
31+
32+
1. **Summary**: Explain the comment (2-4 simple sentences)
33+
34+
2. **Verdict**: [Action | Skip | Clarify]
35+
- **Action** - Valid and valuable; implement (or with modifications)
36+
- **Skip** - Not applicable, over-engineered, or incorrect
37+
- **Clarify** - Need more information before deciding
38+
39+
3. **Reasoning**: Why this verdict (2-3 sentences)
40+
41+
## Output Format
42+
43+
Well structured, use emojis, if using tables keep width <100 chars for readability.

.claude/commands/commit.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
description: Create git commit for staged changes using template
3+
---
4+
5+
# Create a clear Git commit message for **staged** changes
6+
7+
1. Analyse staged changes with commands in `<commit_context>` tags
8+
2. Apply commit template `<template>` with appropriate `<main_prefix>`
9+
3. Adhere to rules in `<rules>` tags
10+
11+
<commit_context>
12+
13+
- Branch context: `git branch --show-current`
14+
- Files changed: `git diff --cached --name-status`
15+
- Change volume: `git diff --cached --stat`
16+
- Detailed changes: `git diff --cached`
17+
</commit_context>
18+
19+
<template>
20+
21+
[main_prefix]: [brief main summary in imperative mood]
22+
23+
[Logical Group Name 1]:
24+
25+
- [Significant changes and impact over minor details]
26+
- ["Just enough detail" for collective project evolution]
27+
28+
[Logical Group Name n (if needed)]:
29+
30+
- [etc.]
31+
32+
[2-3 terse sentences of why / benefit / impact. Wrap at 90 characters]
33+
34+
</template>
35+
36+
<main_prefix>
37+
38+
- `rules:` claude configuration e.g. `**/CLAUDE.md`, `.claude/**/*`
39+
- `test:` adding or updating tests e.g. `tests/**/*`
40+
- `ci:` CI/CD pipeline changes, automated workflows, deployment automation
41+
- `build:` build system changes, compilation process, how code gets packaged
42+
- `perf:` performance improvements
43+
- `fix:` bug fixes (fixes broken functionality)
44+
- `refactor:` code changes that neither fix bugs nor add features
45+
- `style:` code formatting, visual consistency, linting fixes; no functional change
46+
- `chore:` dev workflow, workspace config, dependency updates, dev tools e.g. `.vscode/**/*`, `pyproject.toml`, `.gitignore`
47+
- `docs:` documentation changes only e.g. `README.md`, `docs/**/*.md`
48+
- `feature:` new feature for users (adds functionality)
49+
</main_prefix>
50+
51+
<rules>
52+
53+
- Use British spelling
54+
- Use factual tone, avoid hyperbolic language
55+
- Avoid marketing adjectives (comprehensive, complete, enhanced, improved, etc.)
56+
- Use fitting amount of detail proportional to commit scope
57+
- Wrap the terse sentences so that no line exceeds 90 characters
58+
59+
</rules>

.claude/settings.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"mcp__ide__getDiagnostics",
5+
6+
"Bash(claude mcp get:*)",
7+
"Bash(claude mcp list)",
8+
9+
"mcp__playwright__browser_close",
10+
"mcp__playwright__browser_console_messages",
11+
"mcp__playwright__browser_navigate",
12+
"mcp__playwright__browser_navigate_back",
13+
"mcp__playwright__browser_network_requests",
14+
"mcp__playwright__browser_resize",
15+
"mcp__playwright__browser_run_code",
16+
"mcp__playwright__browser_snapshot",
17+
"mcp__playwright__browser_tabs",
18+
"mcp__playwright__browser_take_screenshot",
19+
"mcp__playwright__browser_wait_for",
20+
21+
"Bash(cat:*)",
22+
"Bash(echo:*)",
23+
"Bash(find:*)",
24+
"Bash(glob:*)",
25+
"Bash(lsof:*)",
26+
"Bash(sed:*)",
27+
"Bash(wc:*)",
28+
"Bash(xargs:*)",
29+
30+
"Bash(git log:*)",
31+
"Bash(gh pr checks:*)",
32+
"Bash(gh pr list:*)",
33+
"Bash(gh run list:*)",
34+
"Bash(gh run view:*)",
35+
36+
"Bash(npm run build)",
37+
"Bash(npm run dev)",
38+
"Bash(npm run start)",
39+
"Bash(npm run check)",
40+
"Bash(npm run lint)",
41+
"Bash(npm run lint:md:*)",
42+
"Bash(npm run test)",
43+
"Bash(npm run test:e2e:*)",
44+
"Bash(npm run test:unit:*)",
45+
"Bash(npm run typecheck)",
46+
"Bash(npx @biomejs/biome:*)",
47+
"Bash(npx lefthook:*)",
48+
"Bash(npx playwright:*)",
49+
50+
"WebFetch(domain:biomejs.dev)",
51+
"WebFetch(domain:docs.github.com)",
52+
"WebFetch(domain:github.com)",
53+
"WebFetch(domain:lefthook.dev)",
54+
"WebFetch(domain:nextjs.org)",
55+
"WebFetch(domain:playwright.dev)",
56+
"WebFetch(domain:tailwindcss.com)",
57+
"WebFetch(domain:ui.shadcn.com)",
58+
"WebFetch(domain:vercel.com)",
59+
"WebFetch(domain:vitest.dev)"
60+
],
61+
62+
"deny": ["Read(**/.env)", "Read(**/.envrc)"],
63+
64+
"ask": []
65+
}
66+
}

.gitattributes

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Auto detect text files and normalize to LF in repository
2+
# Working tree line endings will be native to the platform
3+
* text=auto
4+
5+
# Shell scripts - force LF (even on Windows)
6+
*.sh text eol=lf
7+
8+
# Windows specific files - keep CRLF
9+
*.bat text eol=crlf
10+
*.cmd text eol=crlf
11+
*.ps1 text eol=crlf
12+
13+
# Common Binary files - never modify line endings
14+
*.dll binary
15+
*.exe binary
16+
*.gif binary
17+
*.jpeg binary
18+
*.jpg binary
19+
*.ico binary
20+
*.mov binary
21+
*.mp4 binary
22+
*.pdf binary
23+
*.png binary
24+
*.tar.gz binary
25+
*.webp binary
26+
*.xlsx binary
27+
*.zip binary

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Dependabot: Automated updates
2+
# - npm:
3+
# Version-updates: Weekly on Sundays, minor/patch grouped, major individual
4+
# Security-updates: Immediate when vulnerabilities detected, grouped
5+
# - GitHub Actions: Keeps workflow action versions current (e.g., actions/checkout)
6+
# Docs: https://docs.github.com/en/code-security/dependabot
7+
8+
version: 2
9+
updates:
10+
# npm dependencies
11+
- package-ecosystem: "npm"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
day: "sunday"
16+
groups:
17+
npm-dependencies:
18+
applies-to: version-updates
19+
update-types:
20+
- "minor"
21+
- "patch"
22+
npm-security:
23+
applies-to: security-updates
24+
update-types:
25+
- "minor"
26+
- "patch"
27+
28+
# GitHub Actions
29+
- package-ecosystem: "github-actions"
30+
directory: "/"
31+
schedule:
32+
interval: "weekly"
33+
day: "sunday"
34+
groups:
35+
github-actions:
36+
applies-to: version-updates
37+
patterns:
38+
- "*"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Lint & Type (biome, tsc)
2+
3+
permissions:
4+
contents: read
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
9+
10+
on:
11+
# Triggers: PR opened, updated (new commits), or reopened
12+
# 1. Runs on remote GitHub Actions server (fresh environment, not local cache)
13+
# 2. Required to pass before PR can be merged to main (enforced by branch protection)
14+
pull_request:
15+
branches: [main]
16+
17+
jobs:
18+
lint-type:
19+
name: Run Lint & Type Checks
20+
timeout-minutes: 10
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
# Step: Checkout code
25+
- uses: actions/checkout@v6
26+
27+
# Step: Setup Node.js
28+
- uses: actions/setup-node@v6
29+
with:
30+
node-version: 'lts/*'
31+
cache: 'npm'
32+
33+
# Step: Install dependencies
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
# Step: Run Biome checks
38+
- name: Run Biome lint & format check
39+
run: npx @biomejs/biome ci --error-on-warnings
40+
41+
# Step: Run TypeScript checks
42+
- name: Run TypeScript type check
43+
run: npx tsc --noEmit --pretty
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# E2E Tests against Vercel Preview Deployments
2+
#
3+
# This workflow runs Playwright tests against Vercel preview deployments.
4+
# It is triggered automatically by Vercel when a deployment to preview succeeds.
5+
#
6+
# How it works:
7+
# 1. Vercel deploys your code to a preview URL
8+
# 2. On success, Vercel sends a repository_dispatch event to GitHub
9+
# 3. This workflow receives the event with the preview URL in the payload
10+
# 4. Playwright tests run against the live Vercel preview deployment
11+
#
12+
# This provides confidence before merging to main (which triggers production deploy).
13+
#
14+
# Reference: https://vercel.com/guides/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment
15+
16+
name: E2E Tests (Vercel Preview)
17+
18+
permissions:
19+
contents: read
20+
statuses: write
21+
22+
on:
23+
# Triggered by Vercel when a deployment succeeds
24+
repository_dispatch:
25+
types:
26+
- "vercel.deployment.success"
27+
28+
# Cancel in-progress runs when a newer deployment succeeds on the same branch.
29+
# Groups by git.ref (branch name) from Vercel's payload, not URL (which is unique per deploy).
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.event.client_payload.git.ref }}
32+
cancel-in-progress: true
33+
34+
# Note: If you have Deployment Protection enabled on Vercel,
35+
# you'll need to configure Protection Bypass for Automation.
36+
# See: https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation
37+
38+
jobs:
39+
e2e-preview:
40+
name: Run E2E Tests on Preview
41+
# Only run for repository_dispatch events (safety check)
42+
if: github.event_name == 'repository_dispatch'
43+
timeout-minutes: 10
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
# Step: Checkout the exact commit that was deployed
48+
# Uses the SHA from Vercel's payload to ensure we test the right code
49+
- uses: actions/checkout@v6
50+
with:
51+
ref: ${{ github.event.client_payload.git.sha }}
52+
53+
# Step: Setup Node.js
54+
- uses: actions/setup-node@v6
55+
with:
56+
node-version: "lts/*"
57+
cache: "npm"
58+
59+
# Step: Install dependencies
60+
- name: Install dependencies
61+
run: npm ci
62+
63+
# Step: Install Playwright Browsers
64+
- name: Install Playwright Browsers
65+
run: npx playwright install chromium webkit --with-deps
66+
67+
# Step: Run E2E tests against Vercel preview URL
68+
# No build needed — we're testing the deployed preview, not localhost
69+
- name: Run Playwright tests
70+
run: npx playwright test
71+
env:
72+
# The Vercel preview URL from the deployment event payload
73+
# This is passed to playwright.config.ts which uses it as baseURL
74+
BASE_URL: ${{ github.event.client_payload.url }}
75+
# Bypass secret for Vercel Deployment Protection (required when protection is enabled)
76+
# This allows Playwright to access protected preview deployments
77+
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
78+
79+
# Step: Upload test report
80+
- uses: actions/upload-artifact@v5
81+
if: ${{ !cancelled() }}
82+
with:
83+
name: playwright-report-vercel-preview
84+
path: .playwright/playwright-report/
85+
retention-days: 30
86+
87+
# Step: Report status back to the PR commit
88+
# Since repository_dispatch runs on main, we must explicitly report status
89+
# to the original commit SHA so the PR's required check is satisfied
90+
- name: Report status to PR
91+
if: always()
92+
uses: actions/github-script@v8
93+
with:
94+
script: |
95+
const state = '${{ job.status }}' === 'cancelled' ? 'error' : '${{ job.status }}';
96+
await github.rest.repos.createCommitStatus({
97+
owner: context.repo.owner,
98+
repo: context.repo.repo,
99+
sha: '${{ github.event.client_payload.git.sha }}',
100+
state: state,
101+
context: 'Run E2E Tests on Preview',
102+
description: 'E2E tests against Vercel preview',
103+
target_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
104+
});

0 commit comments

Comments
 (0)