Skip to content

Commit 5dee49d

Browse files
committed
Merge remote-tracking branch 'origin/main' into apple-pay-flow
2 parents 7f8d1e9 + d882002 commit 5dee49d

File tree

136 files changed

+7821
-1305
lines changed

Some content is hidden

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

136 files changed

+7821
-1305
lines changed

.agents/skills/package-filter/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Execute commands in specific packages within the monorepo.
2525
pnpm --filter @cartridge/keychain test
2626

2727
# Build specific package
28-
pnpm --filter @cartridge/controller build
28+
pnpm --filter @cartridge/controller build:deps
2929

3030
# Run dev server for keychain only
3131
pnpm --filter @cartridge/keychain dev

.agents/skills/run-tests/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ If Storybook tests fail with visual differences:
130130

131131
```bash
132132
# Check specific package
133-
pnpm controller build
133+
pnpm controller build:deps
134134
pnpm keychain build
135135
```
136136

.claude/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"Bash(pnpm:storybook:*)",
1818
"Bash(pnpm:e2e:*)",
1919
"Bash(pnpm:--filter:*)",
20+
"Bash(gh:pr:*)",
2021
"Bash(git:status)",
2122
"Bash(git:diff)",
2223
"Bash(git:log)",

.github/workflows/claude-code-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ permissions:
88
contents: read
99
pull-requests: write
1010
issues: read
11-
1211
id-token: write
12+
1313
jobs:
1414
claude-code-review:
1515
runs-on: ubuntu-latest
@@ -25,6 +25,7 @@ jobs:
2525
with:
2626
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
2727
prompt: "/review"
28+
allowed_tools: "Read,Glob,Grep"
2829
# CLAUDE.md is a symlink to AGENTS.md in this repo; keep repo rules there.
2930
claude_args: |
3031
--max-turns 4

.github/workflows/docs-sync.yml

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,33 @@ jobs:
3333
run: |
3434
set -e
3535
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
36-
# Get changed files for the specified commit
3736
git fetch origin
38-
CHANGED_FILES=$(git diff --name-only ${{ github.event.inputs.commit_sha }}~1 ${{ github.event.inputs.commit_sha }})
37+
DIFF_BASE="${{ github.event.inputs.commit_sha }}~1"
38+
DIFF_HEAD="${{ github.event.inputs.commit_sha }}"
3939
else
40-
# Get list of changed files in the merged PR
4140
git fetch origin main
42-
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.merge_commit_sha }})
41+
DIFF_BASE="${{ github.event.pull_request.base.sha }}"
42+
DIFF_HEAD="${{ github.event.pull_request.merge_commit_sha }}"
4343
fi
44+
CHANGED_FILES=$(git diff --name-only "$DIFF_BASE" "$DIFF_HEAD")
45+
# Truncate diff to avoid blowing up the prompt
46+
DIFF_CONTENT=$(git diff "$DIFF_BASE" "$DIFF_HEAD" -- '*.ts' '*.tsx' '*.md' | head -c 60000)
4447
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
4548
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
4649
echo "EOF" >> $GITHUB_OUTPUT
50+
echo "diff_content<<EOF" >> $GITHUB_OUTPUT
51+
echo "$DIFF_CONTENT" >> $GITHUB_OUTPUT
52+
echo "EOF" >> $GITHUB_OUTPUT
4753
4854
- name: Check if docs update needed
4955
id: check-docs
5056
run: |
51-
# Check if changes require documentation updates
5257
NEEDS_DOCS_UPDATE=false
5358
54-
# Define patterns that typically require docs updates
5559
DOCS_PATTERNS=(
56-
"^src/.*\.ts$"
57-
"^src/.*\.tsx$"
5860
"^packages/.*/src/.*\.ts$"
5961
"^packages/.*/src/.*\.tsx$"
60-
"^README\.md$"
61-
"^CHANGELOG\.md$"
6262
"^docs/"
63-
"package\.json$"
6463
"^api/"
6564
"^schema/"
6665
)
@@ -90,71 +89,76 @@ jobs:
9089
uses: anthropics/claude-code-action@beta
9190
with:
9291
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
92+
model: "claude-sonnet-4-5-20250929"
9393
direct_prompt: |
94-
I need you to analyze the changes in this controller repository PR and update the documentation in the cartridge-gg/docs repository accordingly.
94+
Analyze changes in this controller repository and update documentation
95+
in the cartridge-gg/docs repository ONLY if user-facing behavior changed.
9596
9697
**Change Information:**
9798
- Title: ${{ github.event.pull_request.title || format('Manual trigger for commit {0}', github.event.inputs.commit_sha) }}
9899
- Description: ${{ github.event.pull_request.body || 'Manually triggered documentation sync' }}
99100
- Files changed: ${{ steps.changed-files.outputs.changed_files }}
100101
- Commit SHA: ${{ github.event.pull_request.merge_commit_sha || github.event.inputs.commit_sha }}
101102
102-
**Your tasks:**
103-
1. Review the changed files and PR description to understand what functionality was added, modified, or removed
104-
2. Check the docs-repo directory to see what documentation currently exists
105-
3. Determine if any existing documentation needs updates or if new documentation should be created
106-
4. If updates are needed:
107-
- Create or update the appropriate documentation files in the docs-repo directory
108-
- Ensure the documentation accurately reflects the current state of the controller
109-
- Follow the existing documentation style and structure
110-
- Focus on user-facing changes, API changes, new features, or breaking changes
111-
112-
**Important guidelines:**
113-
- Only create documentation updates if they are actually needed
114-
- Don't document internal implementation details unless they affect usage
115-
- If no documentation updates are needed, simply state that and exit
116-
- DO NOT create git branches, commits, or PRs - just update the files
117-
118-
The docs repository is checked out in the `docs-repo` directory. Please analyze the controller changes and update the documentation files accordingly.
103+
**Diff of user-facing files:**
104+
${{ steps.changed-files.outputs.diff_content }}
105+
106+
**Docs repo structure** (checked out in `docs-repo/`):
107+
The site uses Vocs. Content lives in `docs-repo/src/pages/` with three sections:
108+
- `controller/` — wallet, sessions, policies, presets, achievements, inventory, native integrations, examples
109+
- `slot/` — Katana/Torii deployment, billing, scale, paymaster, vRNG, RPC
110+
- `arcade/` — game hub setup, marketplace
111+
Sidebar config is in `docs-repo/vocs.config.ts`.
112+
113+
**Rules — read these carefully:**
114+
1. DEFAULT TO NO CHANGES. Most code PRs do not need docs updates.
115+
Internal refactors, test changes, CI changes, and dependency bumps need nothing.
116+
Only proceed if there is a concrete user-facing change (new API, changed behavior,
117+
new feature, removed feature, changed configuration).
118+
2. SINGLE CANONICAL LOCATION. Each piece of information belongs on exactly one page.
119+
Find the one page that owns the topic and make your substantive edits there.
120+
Other pages MAY add a brief cross-reference linking to the canonical page,
121+
but do NOT duplicate explanations, code samples, or configuration details
122+
across multiple pages.
123+
3. MINIMAL EDITS. Update only the specific section affected. Do not rewrite
124+
surrounding paragraphs, add new sections for context, or reorganize existing content.
125+
4. ONE CODE EXAMPLE per concept. If a code sample is needed, add it once in the
126+
canonical location. Do not add the same or similar examples to multiple pages.
127+
5. Do NOT create git branches, commits, or PRs — just update files.
128+
6. If no documentation updates are needed, state that clearly and exit.
119129
120130
allowed_tools: "Read,Write,Edit,MultiEdit,Glob,Grep"
121131

122132
- name: Create branch and commit changes
123133
if: steps.check-docs.outputs.needs_update == 'true'
124134
working-directory: docs-repo
125135
run: |
126-
# Configure git
127136
git config user.name "github-actions[bot]"
128137
git config user.email "github-actions[bot]@users.noreply.github.com"
129138
130-
# Check if there are any changes
131139
if [ -n "$(git status --porcelain)" ]; then
132-
# Create new branch
133140
BRANCH_NAME="docs-update-$(date +%s)"
134141
git checkout -b "$BRANCH_NAME"
135-
136-
# Add and commit changes
142+
137143
git add .
138144
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
139145
git commit -m "docs: Update documentation for controller commit ${{ github.event.inputs.commit_sha }}
140146
141147
Updates documentation to reflect changes made in commit:
142148
${{ github.event.inputs.commit_sha }}
143-
149+
144150
Manually triggered documentation sync"
145151
else
146152
git commit -m "docs: Update documentation for controller PR #${{ github.event.pull_request.number }}
147153
148154
Updates documentation to reflect changes made in:
149155
${{ github.event.pull_request.title }}
150-
156+
151157
Related controller PR: cartridge-gg/controller#${{ github.event.pull_request.number }}"
152158
fi
153-
154-
# Push branch
159+
155160
git push origin "$BRANCH_NAME"
156-
157-
# Create PR
161+
158162
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
159163
gh pr create \
160164
--title "docs: Update documentation for controller commit ${{ github.event.inputs.commit_sha }}" \
@@ -166,6 +170,7 @@ jobs:
166170
- Trigger: Manual documentation sync
167171
168172
Please review the documentation changes to ensure they accurately reflect the controller updates."
173+
gh pr merge --auto --squash
169174
else
170175
gh pr create \
171176
--title "docs: Update documentation for controller PR #${{ github.event.pull_request.number }}" \
@@ -176,6 +181,7 @@ jobs:
176181
- Files changed: ${{ steps.changed-files.outputs.changed_files }}
177182
178183
Please review the documentation changes to ensure they accurately reflect the controller updates."
184+
gh pr merge --auto --squash
179185
fi
180186
else
181187
echo "No documentation changes were made by Claude"
@@ -186,5 +192,4 @@ jobs:
186192
- name: Cleanup
187193
if: always()
188194
run: |
189-
# Clean up any temporary files or directories
190195
rm -rf docs-repo || true

.github/workflows/e2e.yml

Lines changed: 68 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,68 @@
1-
name: End-to-End tests
2-
on:
3-
push:
4-
branches: [main]
5-
pull_request:
6-
branches: [main]
7-
jobs:
8-
test:
9-
if: always() == 'skip' # temporarily skip cc @jun
10-
timeout-minutes: 60
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v4
15-
with:
16-
node-version: lts/*
17-
- name: Install dependencies
18-
run: npm install -g pnpm && pnpm install
19-
- name: Install Playwright Browsers
20-
run: pnpm exec playwright install --with-deps
21-
- name: Run Playwright tests
22-
run: pnpm exec playwright test
23-
- uses: actions/upload-artifact@v4
24-
if: always()
25-
with:
26-
name: playwright-report
27-
path: playwright-report/
28-
retention-days: 30
1+
name: End-to-End tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
next:
14+
if: always() == 'skip' # temporarily skip cc @jun
15+
permissions:
16+
contents: read
17+
timeout-minutes: 60
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
- name: Install dependencies
25+
run: npm install -g pnpm && pnpm install
26+
- name: Install Playwright Browsers
27+
run: pnpm exec playwright install --with-deps
28+
- name: Run Playwright tests
29+
run: pnpm exec playwright test
30+
- uses: actions/upload-artifact@v4
31+
if: always()
32+
with:
33+
name: playwright-report
34+
path: playwright-report/
35+
retention-days: 30
36+
37+
capacitor:
38+
permissions:
39+
contents: read
40+
timeout-minutes: 60
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 20.x
47+
- uses: actions/cache@v4
48+
with:
49+
path: ~/.pnpm-store
50+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
51+
restore-keys: |
52+
${{ runner.os }}-pnpm-
53+
- uses: pnpm/action-setup@v4
54+
with:
55+
run_install: |
56+
- args: [--frozen-lockfile]
57+
- name: Build
58+
run: pnpm build
59+
- name: Install Playwright Browsers
60+
run: pnpm --filter cartridge-capacitor-example exec playwright install --with-deps chromium
61+
- name: Run Capacitor E2E tests
62+
run: pnpm --filter cartridge-capacitor-example e2e
63+
- uses: actions/upload-artifact@v4
64+
if: failure()
65+
with:
66+
name: capacitor-playwright-report
67+
path: examples/capacitor/playwright-report/
68+
retention-days: 30

.github/workflows/release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ jobs:
3737
run: |
3838
echo "VERSION=$(jq -r '.version' packages/controller/package.json)" >> $GITHUB_OUTPUT
3939
40-
- name: Publish release to npm
41-
if: ${{ github.event.pull_request.head.ref == 'prepare-release' }}
40+
- name: Publish to npm
41+
if: |
42+
github.event.pull_request.head.ref == 'prepare-release' ||
43+
github.event.pull_request.head.ref == 'prepare-prerelease' ||
44+
github.event_name == 'workflow_dispatch'
4245
run: |
43-
pnpm release
44-
45-
- name: Publish prerelease to npm
46-
if: ${{ github.event.pull_request.head.ref == 'prepare-prerelease' }}
47-
run: |
48-
pnpm release:prerelease
46+
VERSION="${{ steps.get_version.outputs.VERSION }}"
47+
if [[ "$VERSION" == *-* ]]; then
48+
pnpm release:prerelease
49+
else
50+
pnpm release
51+
fi
4952
5053
- name: Extract changelog for version
5154
id: get_changelog

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ htmlcov/
5555
.cache
5656
nosetests.xml
5757
coverage.xml
58+
**/coverage/
5859
*.cover
5960
*.py,cover
6061
.hypothesis/

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- SKILLS_INDEX_START -->
2+
[Agent Skills Index]|root: ./agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|agent-browser:{agent-browser.md},clean-build:{clean-build.md},code-review:{code-review.md},codegen:{codegen.md},create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dispatch-release:{dispatch-release.md},find-skills:{find-skills.md},package-filter:{package-filter.md},pre-commit-check:{pre-commit-check.md},release-prep:{release-prep.md},run-tests:{run-tests.md},test:{test.md},update-pr:{update-pr.md},update-storybook-snapshots:{update-storybook-snapshots.md},validate-before-merge:{validate-before-merge.md}
3+
<!-- SKILLS_INDEX_END -->
14
# Repository Guidelines
25

36
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

0 commit comments

Comments
 (0)