Skip to content

Commit 4b1dd5c

Browse files
committed
feat(site): auto-generate templates from examples dir (#3603)
1 parent e66aff5 commit 4b1dd5c

File tree

284 files changed

+5446
-3599
lines changed

Some content is hidden

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

284 files changed

+5446
-3599
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Example README Template
2+
3+
All example READMEs in `/examples/` should follow this structure with exact section headings:
4+
5+
```markdown
6+
<header with title and description>
7+
8+
## Getting Started
9+
10+
[Setup instructions - how to install dependencies and run the example]
11+
12+
## Features
13+
14+
[3-5 features that highlight what this example demonstrates, focusing on RivetKit concepts:]
15+
16+
- Documents dashboard with pagination, drafts, groups, auto-revalidation
17+
- Collaborative whiteboard app with a fully-featured share menu
18+
- Authentication compatible with GitHub, Google, Auth0, and more
19+
- Document permissions can be scoped to users, groups, and the public
20+
21+
## Prerequisites
22+
23+
[Only include this section if there are non-obvious prerequisites like API keys or external services.
24+
Do not include obvious requirements like "Node.js" or "pnpm". For example:]
25+
26+
- OpenAI API Key
27+
- PostgreSQL database
28+
29+
## Implementation
30+
31+
[Explain the key technical concepts, architecture, or implementation details. Always include GitHub
32+
source code links to key files. For example:]
33+
34+
This example works by packaging your application code and uploading it to Freestyle.
35+
36+
See the implementation in [`src/backend/registry.ts`](https://github.com/rivet-dev/rivet/tree/main/examples/example-name/src/backend/registry.ts).
37+
38+
## Resources
39+
40+
[Link to relevant RivetKit documentation that helps users understand the concepts demonstrated:]
41+
42+
Read more about [actions](/docs/actors/actions) and [state](/docs/actors/state).
43+
44+
## License
45+
46+
[License info - typically MIT]
47+
```
48+
49+
## Section Heading Convention
50+
51+
Use these exact section headings (case-sensitive):
52+
- `## Getting Started` - Setup instructions
53+
- `## Features` - Feature list
54+
- `## Prerequisites` - Only if needed for non-obvious dependencies
55+
- `## Implementation` - Technical details (NOT "How it Works")
56+
- `## Resources` - Links to relevant documentation
57+
- `## License` - License info
58+
59+
## Guidelines
60+
61+
- **Features**: Focus on what RivetKit concepts the example demonstrates, not just what the app does. Highlight patterns like actor communication, state management, WebSocket handling, etc.
62+
- **Prerequisites**: Only include if the example requires non-obvious dependencies (API keys, external services). Skip obvious tooling like Node.js or pnpm.
63+
- **Implementation**: Always required. Explain the technical details and include GitHub source code links to key files.
64+
- **Resources**: Always include links to relevant RivetKit documentation that relates to the concepts in the example.
65+
- **Source Code Links**: Use GitHub links in the format: `https://github.com/rivet-dev/rivet/tree/main/examples/{example-name}/{path}`
66+
- Example: `https://github.com/rivet-dev/rivet/tree/main/examples/ai-agent/src/backend/actors/agent.ts`
67+
- **Formatting**: Do not use em dashes (—). Use hyphens (-) or rephrase sentences instead.
68+
- Preserve existing header content (title, description) and license section.

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ LICENSE*
4747
# Frontend
4848
!frontend/dist/
4949

50+
# RivetKit packages (need pre-built dist for screenshot generation)
51+
!rivetkit-typescript/packages/*/dist/
52+
!engine/sdks/typescript/*/dist/
53+

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ gt m
6868

6969
- If you need to look at the documentation for a package, visit `https://docs.rs/{package-name}`. For example, serde docs live at https://docs.rs/serde/
7070

71+
## Examples
72+
73+
All example READMEs in `/examples/` should follow the format defined in `.claude/resources/EXAMPLE_TEMPLATE.md`.
74+
7175
## Architecture
7276

7377
### Monorepo Structure
@@ -184,3 +188,4 @@ Data structures often include:
184188

185189
- When talking about "Rivet Actors" make sure to capitalize "Rivet Actor" as a proper noun and lowercase "actor" as a generic noun
186190

191+

examples/actor-actions/README.md

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/quickstart-actions/package.json renamed to examples/actor-actions/package.json

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)