Skip to content

Add TanStack Intent skills for AI agent guidance - #3956

Merged
KyleAMathews merged 7 commits into
mainfrom
add-tanstack-intent-skills
Mar 6, 2026
Merged

KyleAMathews merged 7 commits into
mainfrom
add-tanstack-intent-skills

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add TanStack Intent skills to @electric-sql/client and @electric-sql/y-electric so AI coding agents can work with Electric correctly out of the box. Ships 9 skills covering the full developer journey from shape setup to production deployment.

Approach

Skills were generated using the @tanstack/intent scaffold workflow:

  1. Domain Discovery — analyzed source code, docs, and maintainer interview to map 5 domains and 35 failure modes
  2. Tree Generator — chose flat structure across 2 packages (8 skills in typescript-client, 1 in y-electric)
  3. Skill Generation — wrote SKILL.md files with setup patterns, code examples verified against source, and wrong/correct mistake pairs

Each skill targets a specific task (not a concept), with code examples validated against the current source at v1.5.10.

Skills

Skill Package Type Key coverage
electric-shapes client core ShapeStream/Shape config, onError contract, WHERE clauses, type parsers
electric-proxy-auth client core Server proxy setup, ELECTRIC_PROTOCOL_QUERY_PARAMS, secret injection
electric-schema-shapes client core Schema + shape co-design, REPLICA IDENTITY FULL, replica modes
electric-debugging client lifecycle Error retry behavior, MissingHeadersError, fast-loop detection
electric-deployment client lifecycle Docker Compose, env vars, health checks, replication slot cleanup
electric-new-feature client lifecycle Full 5-step setup: schema → proxy → collection → queries → mutations
electric-orm client composition Drizzle/Prisma txid patterns, migration with REPLICA IDENTITY
electric-postgres-security client security Pre-deploy checklist: roles, grants, WAL, connection, publication
electric-yjs y-electric composition ElectricProvider, BYTEA parsing, resume state, awareness

Non-goals

  • No framework-specific skills (TanStack DB handles React/Vue/etc.)
  • No multi-shape-sync skill (experimental feature, may be removed)
  • No runtime code changes

CI Workflows

  • validate-skills.yml — validates SKILL.md files on PRs touching skills/
  • check-skills.yml — checks for stale skills on release, opens review PR
  • notify-intent.yml — notifies TanStack/intent when source or docs change

Verification

cd packages/typescript-client && npx @tanstack/intent validate skills/
cd packages/y-electric && npx @tanstack/intent validate skills/

Both pass with no errors or warnings.

Files changed

  • packages/typescript-client/skills/ — 8 SKILL.md files + 2 reference files (WHERE clause syntax, type parsers)
  • packages/y-electric/skills/ — 1 SKILL.md file
  • packages/*/package.json — added skills + bin to files, @tanstack/intent devDependency, bin entry
  • packages/*/bin/intent.mjs — intent CLI shim
  • .github/workflows/ — 3 new workflow files
  • .gitignore — added _artifacts

🤖 Generated with Claude Code

…dance

Add 9 skills covering shapes, proxy auth, schema design, debugging,
deployment, new feature setup, ORM integration, Postgres security,
and Yjs collaboration. Includes CI workflows for skill validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@electric-sql/react@3956
npm i https://pkg.pr.new/@electric-sql/client@3956
npm i https://pkg.pr.new/@electric-sql/y-electric@3956

commit: a696d14

@codecov

codecov Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (4608e2e) to head (31d4409).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3956       +/-   ##
===========================================
+ Coverage   75.75%   88.78%   +13.02%     
===========================================
  Files          11       25       +14     
  Lines         693     2425     +1732     
  Branches      171      611      +440     
===========================================
+ Hits          525     2153     +1628     
- Misses        167      270      +103     
- Partials        1        2        +1     
Flag Coverage Δ
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/start 82.83% <ø> (ø)
packages/typescript-client 93.99% <ø> (?)
packages/y-electric 56.05% <ø> (ø)
typescript 88.78% <ø> (+13.02%) ⬆️
unit-tests 88.78% <ø> (+13.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Remove redundant Tension sections (already covered by Common Mistakes)
- Remove duplicated auth code from shapes skill (exists in proxy-auth)
- Fix y-electric library_version to 0.1.36 (was incorrectly 1.5.10)
- Rename notify-playbooks.yml to notify-intent.yml to match purpose
- Remove _artifacts/ from tracking and add to .gitignore
- Remove dead readFileSync in check-skills.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Mar 5, 2026

Copy link
Copy Markdown

✅ Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 6d36089
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/69aa10b785124d0008e9c4ec
😎 Deploy Preview https://deploy-preview-3956--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

KyleAMathews and others added 2 commits March 5, 2026 16:26
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
KyleAMathews and others added 3 commits March 6, 2026 13:14
- Add dev environment docker-compose setup to electric-new-feature
- Add parser vs schema dual-path mistake (sync bypasses TanStack DB schema)
- Inline common auto-parsed types with reference pointer in shapes/new-feature
- Document txid type flexibility (number | bigint | string) in schema-shapes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add wal_level=logical, sslmode=disable, tmpfs to docker-compose
- Match repo's canonical docker-compose pattern (tanstack-db-web-starter)
- Show complete transaction with pg_current_xact_id() in same tx as mutation
- Emphasize txid must be queried inside the same transaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace non-existent createServerFileRoute with correct createFileRoute
  + server.handlers pattern from tanstack-db-web-starter example
- Add concrete Zod schema definition (todoSchema was referenced but undefined)
- Replace abstract api.todos.create() with concrete mutation endpoint
  showing INSERT + pg_current_xact_id() in same transaction
- Add /v1/shape path and Electric Cloud auth conditional to proxy example
- Make proxy route framework-agnostic with note to use your framework's pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KyleAMathews
KyleAMathews merged commit d1e08b8 into main Mar 6, 2026
40 checks passed
@KyleAMathews
KyleAMathews deleted the add-tanstack-intent-skills branch March 6, 2026 21:27
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

This PR has been released! 🚀

The following packages include changes from this PR:

  • @electric-sql/client@1.5.12
  • @electric-sql/y-electric@0.1.38

Thanks for contributing to Electric!

alco pushed a commit that referenced this pull request Mar 9, 2026
## Summary

Add [TanStack Intent](https://github.com/TanStack/intent) skills to
`@electric-sql/client` and `@electric-sql/y-electric` so AI coding
agents can work with Electric correctly out of the box. Ships 9 skills
covering the full developer journey from shape setup to production
deployment.

## Approach

Skills were generated using the `@tanstack/intent scaffold` workflow:
1. **Domain Discovery** — analyzed source code, docs, and maintainer
interview to map 5 domains and 35 failure modes
2. **Tree Generator** — chose flat structure across 2 packages (8 skills
in typescript-client, 1 in y-electric)
3. **Skill Generation** — wrote SKILL.md files with setup patterns, code
examples verified against source, and wrong/correct mistake pairs

Each skill targets a specific task (not a concept), with code examples
validated against the current source at `v1.5.10`.

### Skills

| Skill | Package | Type | Key coverage |
|-------|---------|------|-------------|
| `electric-shapes` | client | core | ShapeStream/Shape config, onError
contract, WHERE clauses, type parsers |
| `electric-proxy-auth` | client | core | Server proxy setup,
ELECTRIC_PROTOCOL_QUERY_PARAMS, secret injection |
| `electric-schema-shapes` | client | core | Schema + shape co-design,
REPLICA IDENTITY FULL, replica modes |
| `electric-debugging` | client | lifecycle | Error retry behavior,
MissingHeadersError, fast-loop detection |
| `electric-deployment` | client | lifecycle | Docker Compose, env vars,
health checks, replication slot cleanup |
| `electric-new-feature` | client | lifecycle | Full 5-step setup:
schema → proxy → collection → queries → mutations |
| `electric-orm` | client | composition | Drizzle/Prisma txid patterns,
migration with REPLICA IDENTITY |
| `electric-postgres-security` | client | security | Pre-deploy
checklist: roles, grants, WAL, connection, publication |
| `electric-yjs` | y-electric | composition | ElectricProvider, BYTEA
parsing, resume state, awareness |

### Non-goals

- No framework-specific skills (TanStack DB handles React/Vue/etc.)
- No multi-shape-sync skill (experimental feature, may be removed)
- No runtime code changes

### CI Workflows

- `validate-skills.yml` — validates SKILL.md files on PRs touching
`skills/`
- `check-skills.yml` — checks for stale skills on release, opens review
PR
- `notify-intent.yml` — notifies TanStack/intent when source or docs
change

## Verification

```bash
cd packages/typescript-client && npx @tanstack/intent validate skills/
cd packages/y-electric && npx @tanstack/intent validate skills/
```

Both pass with no errors or warnings.

## Files changed

- `packages/typescript-client/skills/` — 8 SKILL.md files + 2 reference
files (WHERE clause syntax, type parsers)
- `packages/y-electric/skills/` — 1 SKILL.md file
- `packages/*/package.json` — added `skills` + `bin` to `files`,
`@tanstack/intent` devDependency, `bin` entry
- `packages/*/bin/intent.mjs` — intent CLI shim
- `.github/workflows/` — 3 new workflow files
- `.gitignore` — added `_artifacts`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants