Skip to content

Commit abe07b5

Browse files
Merge branch 'main' into fix/replay-payload-2813-clean
2 parents 8e8caed + a09038b commit abe07b5

File tree

45 files changed

+2431
-557
lines changed

Some content is hidden

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

45 files changed

+2431
-557
lines changed

.claude/rules/database-safety.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
paths:
3+
- "internal-packages/database/**"
4+
---
5+
6+
# Database Migration Safety
7+
8+
- When adding indexes to **existing tables**, use `CREATE INDEX CONCURRENTLY IF NOT EXISTS` to avoid table locks. These must be in their own separate migration file (one index per file).
9+
- Indexes on **newly created tables** (same migration as `CREATE TABLE`) do not need CONCURRENTLY.
10+
- When indexing a **new column on an existing table**, split into two migrations: first `ADD COLUMN IF NOT EXISTS`, then `CREATE INDEX CONCURRENTLY IF NOT EXISTS` in a separate file.
11+
- After generating a migration with Prisma, remove extraneous lines for: `_BackgroundWorkerToBackgroundWorkerFile`, `_BackgroundWorkerToTaskQueue`, `_TaskRunToTaskRunTag`, `_WaitpointRunConnections`, `_completedWaitpoints`, `SecretStore_key_idx`, and unrelated TaskRun indexes.
12+
- Never drop columns or tables without explicit approval.
13+
- New code should target `RunEngineVersion.V2` only.

.claude/rules/docs-writing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
paths:
3+
- "docs/**"
4+
---
5+
6+
# Documentation Writing Rules
7+
8+
- Use Mintlify MDX format. Frontmatter: `title`, `description`, `sidebarTitle` (optional).
9+
- After creating a new page, add it to `docs.json` navigation under the correct group.
10+
- Use Mintlify components: `<Note>`, `<Warning>`, `<Info>`, `<Tip>`, `<CodeGroup>`, `<Expandable>`, `<Steps>`/`<Step>`.
11+
- Code examples should be complete and runnable where possible.
12+
- Always import from `@trigger.dev/sdk`, never `@trigger.dev/sdk/v3`.
13+
- Keep paragraphs short. Use headers to break up content.
14+
- Link to related pages using relative paths (e.g., `[Tasks](/tasks/overview)`).

.claude/rules/legacy-v3-code.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
paths:
3+
- "apps/webapp/app/v3/**"
4+
---
5+
6+
# Legacy V1 Engine Code in `app/v3/`
7+
8+
The `v3/` directory name is misleading - most code here is actively used by the current V2 engine. Only the specific files below are legacy V1-only code.
9+
10+
## V1-Only Files - Never Modify
11+
12+
- `marqs/` directory (entire MarQS queue system: sharedQueueConsumer, devQueueConsumer, fairDequeuingStrategy, devPubSub)
13+
- `legacyRunEngineWorker.server.ts` (V1 background job worker)
14+
- `services/triggerTaskV1.server.ts` (deprecated V1 task triggering)
15+
- `services/cancelTaskRunV1.server.ts` (deprecated V1 cancellation)
16+
- `authenticatedSocketConnection.server.ts` (V1 dev WebSocket using DevQueueConsumer)
17+
- `sharedSocketConnection.ts` (V1 shared queue socket using SharedQueueConsumer)
18+
19+
## V1/V2 Branching Pattern
20+
21+
Some services act as routers that branch on `RunEngineVersion`:
22+
- `services/cancelTaskRun.server.ts` - calls V1 service or `engine.cancelRun()` for V2
23+
- `services/batchTriggerV3.server.ts` - uses marqs for V1 path, run-engine for V2
24+
25+
When editing these shared services, only modify V2 code paths.
26+
27+
## V2 Modern Stack
28+
29+
- **Run lifecycle**: `@internal/run-engine` (internal-packages/run-engine)
30+
- **Background jobs**: `@trigger.dev/redis-worker` (not graphile-worker/zodworker)
31+
- **Queue operations**: RunQueue inside run-engine (not MarQS)
32+
- **V2 engine singleton**: `runEngine.server.ts`, `runEngineHandlers.server.ts`
33+
- **V2 workers**: `commonWorker.server.ts`, `alertsWorker.server.ts`, `batchTriggerWorker.server.ts`

.claude/rules/sdk-packages.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
paths:
3+
- "packages/**"
4+
---
5+
6+
# Public Package Rules
7+
8+
- Changes to `packages/` are **customer-facing**. Always add a changeset: `pnpm run changeset:add`
9+
- Default to **patch**. Get maintainer approval for minor. Never select major without explicit approval.
10+
- `@trigger.dev/core`: **Never import the root**. Always use subpath imports (e.g., `@trigger.dev/core/v3`).
11+
- Do NOT update `rules/` or `.claude/skills/trigger-dev-tasks/` unless explicitly asked. These are maintained in separate dedicated passes.
12+
- Test changes using `references/hello-world` reference project.

.claude/rules/server-apps.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
paths:
3+
- "apps/**"
4+
---
5+
6+
# Server App Changes
7+
8+
When modifying server apps (webapp, supervisor, coordinator, etc.) with **no package changes**, add a `.server-changes/` file instead of a changeset:
9+
10+
```bash
11+
cat > .server-changes/descriptive-name.md << 'EOF'
12+
---
13+
area: webapp
14+
type: fix
15+
---
16+
17+
Brief description of what changed and why.
18+
EOF
19+
```
20+
21+
- **area**: `webapp` | `supervisor` | `coordinator` | `kubernetes-provider` | `docker-provider`
22+
- **type**: `feature` | `fix` | `improvement` | `breaking`
23+
- If the PR also touches `packages/`, just the changeset is sufficient (no `.server-changes/` needed).
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: 📝 CLAUDE.md Audit
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review, synchronize]
6+
paths-ignore:
7+
- "docs/**"
8+
- ".changeset/**"
9+
- ".server-changes/**"
10+
- "**/*.md"
11+
- "references/**"
12+
13+
concurrency:
14+
group: claude-md-audit-${{ github.event.pull_request.number }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
audit:
19+
if: github.event.pull_request.draft == false
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
issues: write
25+
id-token: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Run Claude Code
33+
id: claude
34+
uses: anthropics/claude-code-action@v1
35+
with:
36+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
37+
use_sticky_comment: true
38+
39+
claude_args: |
40+
--max-turns 15
41+
--allowedTools "Read,Glob,Grep,Bash(git diff:*)"
42+
43+
prompt: |
44+
You are reviewing a PR to check whether any CLAUDE.md files or .claude/rules/ files need updating.
45+
46+
## Your task
47+
48+
1. Run `git diff origin/main...HEAD --name-only` to see which files changed in this PR.
49+
2. For each changed directory, check if there's a CLAUDE.md in that directory or a parent directory.
50+
3. Determine if any CLAUDE.md or .claude/rules/ file should be updated based on the changes. Consider:
51+
- New files/directories that aren't covered by existing documentation
52+
- Changed architecture or patterns that contradict current CLAUDE.md guidance
53+
- New dependencies, services, or infrastructure that Claude should know about
54+
- Renamed or moved files that are referenced in CLAUDE.md
55+
- Changes to build commands, test patterns, or development workflows
56+
57+
## Response format
58+
59+
If NO updates are needed, respond with exactly:
60+
✅ CLAUDE.md files look current for this PR.
61+
62+
If updates ARE needed, respond with a short list:
63+
📝 **CLAUDE.md updates suggested:**
64+
- `path/to/CLAUDE.md`: [what should be added/changed]
65+
- `.claude/rules/file.md`: [what should be added/changed]
66+
67+
Keep suggestions specific and brief. Only flag things that would actually mislead Claude in future sessions.
68+
Do NOT suggest updates for trivial changes (bug fixes, small refactors within existing patterns).
69+
Do NOT suggest creating new CLAUDE.md files - only updates to existing ones.

.github/workflows/vouch-check-pr.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
check-pr:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: mitchellh/vouch/action/check-pr@main
16+
- uses: mitchellh/vouch/action/check-pr@c6d80ead49839655b61b422700b7a3bc9d0804a9 # v1.4.2
1817
with:
1918
pr-number: ${{ github.event.pull_request.number }}
2019
auto-close: true

.github/workflows/vouch-manage-by-issue.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
contains(github.event.comment.body, 'denounce') ||
1717
contains(github.event.comment.body, 'unvouch')
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: mitchellh/vouch/action/manage-by-issue@main
19+
- uses: mitchellh/vouch/action/manage-by-issue@c6d80ead49839655b61b422700b7a3bc9d0804a9 # v1.4.2
2120
with:
2221
comment-id: ${{ github.event.comment.id }}
2322
issue-id: ${{ github.event.issue.number }}

0 commit comments

Comments
 (0)