Skip to content

Commit 588a8b4

Browse files
authored
Merge pull request #16 from lambda-curry/feat/starter-improvements
2 parents 52e6729 + ea6d54b commit 588a8b4

106 files changed

Lines changed: 11635 additions & 349 deletions

File tree

Some content is hidden

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

.beads/.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SQLite databases
2+
*.db
3+
*.db?*
4+
*.db-journal
5+
*.db-wal
6+
*.db-shm
7+
8+
# Daemon runtime files
9+
daemon.lock
10+
daemon.log
11+
daemon.pid
12+
bd.sock
13+
sync-state.json
14+
last-touched
15+
16+
# Local version tracking (prevents upgrade notification spam after git ops)
17+
.local_version
18+
19+
# Legacy database files
20+
db.sqlite
21+
bd.db
22+
23+
# Worktree redirect file (contains relative path to main repo's .beads/)
24+
# Must not be committed as paths would be wrong in other clones
25+
redirect
26+
27+
# Merge artifacts (temporary files from 3-way merge)
28+
beads.base.jsonl
29+
beads.base.meta.json
30+
beads.left.jsonl
31+
beads.left.meta.json
32+
beads.right.jsonl
33+
beads.right.meta.json
34+
35+
# Sync state (local-only, per-machine)
36+
# These files are machine-specific and should not be shared across clones
37+
.sync.lock
38+
sync_base.jsonl
39+
40+
# NOTE: Do NOT add negation patterns (e.g., !issues.jsonl) here.
41+
# They would override fork protection in .git/info/exclude, allowing
42+
# contributors to accidentally commit upstream issue databases.
43+
# The JSONL files (issues.jsonl, interactions.jsonl) and config files
44+
# are tracked by git by default since no pattern above ignores them.

.beads/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Beads - AI-Native Issue Tracking
2+
3+
Welcome to Beads! This repository uses **Beads** for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.
4+
5+
## What is Beads?
6+
7+
Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.
8+
9+
**Learn more:** [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
10+
11+
## Quick Start
12+
13+
### Essential Commands
14+
15+
```bash
16+
# Create new issues
17+
bd create "Add user authentication"
18+
19+
# View all issues
20+
bd list
21+
22+
# View issue details
23+
bd show <issue-id>
24+
25+
# Update issue status
26+
bd update <issue-id> --status in_progress
27+
bd update <issue-id> --status done
28+
29+
# Sync with git remote
30+
bd sync
31+
```
32+
33+
### Working with Issues
34+
35+
Issues in Beads are:
36+
- **Git-native**: Stored in `.beads/issues.jsonl` and synced like code
37+
- **AI-friendly**: CLI-first design works perfectly with AI coding agents
38+
- **Branch-aware**: Issues can follow your branch workflow
39+
- **Always in sync**: Auto-syncs with your commits
40+
41+
## Why Beads?
42+
43+
**AI-Native Design**
44+
- Built specifically for AI-assisted development workflows
45+
- CLI-first interface works seamlessly with AI coding agents
46+
- No context switching to web UIs
47+
48+
🚀 **Developer Focused**
49+
- Issues live in your repo, right next to your code
50+
- Works offline, syncs when you push
51+
- Fast, lightweight, and stays out of your way
52+
53+
🔧 **Git Integration**
54+
- Automatic sync with git commits
55+
- Branch-aware issue tracking
56+
- Intelligent JSONL merge resolution
57+
58+
## Get Started with Beads
59+
60+
Try Beads in your own projects:
61+
62+
```bash
63+
# Install Beads
64+
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
65+
66+
# Initialize in your repo
67+
bd init
68+
69+
# Create your first issue
70+
bd create "Try out Beads"
71+
```
72+
73+
## Learn More
74+
75+
- **Documentation**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
76+
- **Quick Start Guide**: Run `bd quickstart`
77+
- **Examples**: [github.com/steveyegge/beads/examples](https://github.com/steveyegge/beads/tree/main/examples)
78+
79+
---
80+
81+
*Beads: Issue tracking that moves at the speed of thought*

.beads/config.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Beads Configuration File
2+
# This file configures default behavior for all bd commands in this repository
3+
# All settings can also be set via environment variables (BD_* prefix)
4+
# or overridden with command-line flags
5+
6+
# Issue prefix for this repository (used by bd init)
7+
# If not set, bd init will auto-detect from directory name
8+
# Example: issue-prefix: "myproject" creates issues like "myproject-1", "myproject-2", etc.
9+
# issue-prefix: ""
10+
11+
# Use no-db mode: load from JSONL, no SQLite, write back after each command
12+
# When true, bd will use .beads/issues.jsonl as the source of truth
13+
# instead of SQLite database
14+
# no-db: false
15+
16+
# Disable daemon for RPC communication (forces direct database access)
17+
# no-daemon: false
18+
19+
# Disable auto-flush of database to JSONL after mutations
20+
# no-auto-flush: false
21+
22+
# Disable auto-import from JSONL when it's newer than database
23+
# no-auto-import: false
24+
25+
# Enable JSON output by default
26+
# json: false
27+
28+
# Default actor for audit trails (overridden by BD_ACTOR or --actor)
29+
# actor: ""
30+
31+
# Path to database (overridden by BEADS_DB or --db)
32+
# db: ""
33+
34+
# Auto-start daemon if not running (can also use BEADS_AUTO_START_DAEMON)
35+
# auto-start-daemon: true
36+
37+
# Debounce interval for auto-flush (can also use BEADS_FLUSH_DEBOUNCE)
38+
# flush-debounce: "5s"
39+
40+
# Git branch for beads commits (bd sync will commit to this branch)
41+
# IMPORTANT: Set this for team projects so all clones use the same sync branch.
42+
# This setting persists across clones (unlike database config which is gitignored).
43+
# Can also use BEADS_SYNC_BRANCH env var for local override.
44+
# If not set, bd sync will require you to run 'bd config set sync.branch <branch>'.
45+
# sync-branch: "beads-sync"
46+
47+
# Multi-repo configuration (experimental - bd-307)
48+
# Allows hydrating from multiple repositories and routing writes to the correct JSONL
49+
# repos:
50+
# primary: "." # Primary repo (where this database lives)
51+
# additional: # Additional repos to hydrate from (read-only)
52+
# - ~/beads-planning # Personal planning repo
53+
# - ~/work-planning # Work planning repo
54+
55+
# Integration settings (access with 'bd config get/set')
56+
# These are stored in the database, not in this file:
57+
# - jira.url
58+
# - jira.project
59+
# - linear.url
60+
# - linear.api-key
61+
# - github.org
62+
# - github.repo

.beads/interactions.jsonl

Whitespace-only changes.

.beads/issues.jsonl

Lines changed: 8 additions & 0 deletions
Large diffs are not rendered by default.

.beads/metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"database": "beads.db",
3+
"jsonl_export": "issues.jsonl"
4+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
description: Project overview and context for react-router-starter
3+
alwaysApply: true
4+
---
5+
6+
# Project Context
7+
8+
## What This Repo Is
9+
10+
**react-router-starter** is a monorepo starter for React Router 7 apps with best practices from reportory: Storybook, @lambdacurry/forms, Vitest + React Testing Library, and shared Cursor rules.
11+
12+
## Structure
13+
14+
- **apps/todo-app** – Reference app (React Router 7, Vite, Tailwind v4, forms, Storybook, tests).
15+
- **packages/** – Shared packages (e.g. `@todo-starter/ui`, `@todo-starter/utils`) used by apps.
16+
- **.cursorrules/** – Cursor AI rules (project context, React Router, Storybook, forms, testing, monorepo, UI).
17+
18+
## Issue Tracking
19+
20+
This project uses **Beads (bd)** for issues. See `AGENTS.md` for workflow.
21+
22+
```bash
23+
bd ready # Find available work
24+
bd show <id> # View issue details
25+
bd update <id> --status in_progress # Claim work
26+
bd close <id> # Complete work
27+
bd sync # Sync with git
28+
```
29+
30+
## Quality Gates (todo-app)
31+
32+
From `apps/todo-app/package.json`:
33+
34+
- **Test:** `npm run test:run` or `npm run test:ci` (Vitest)
35+
- **Lint:** `npm run lint` (Biome)
36+
- **Typecheck:** `npm run typecheck` (tsc)
37+
- **Build:** `npm run build` (react-router build)
38+
- **Storybook:** `npm run storybook` (dev), `npm run build-storybook` (build)
39+
40+
Run these from `apps/todo-app` or via workspace root scripts if defined.
41+
42+
## Conventions
43+
44+
- **Routing:** File-based routes in `app/routes/`; use loaders/actions and route types.
45+
- **Forms:** @lambdacurry/forms + remix-hook-form + Zod; see `.cursorrules/lambda-curry-forms.mdc`.
46+
- **Tests:** Vitest + React Testing Library; use `renderWithRouter` for router-dependent components; see `apps/todo-app/TESTING.md` and `.cursorrules/testing-best-practices.mdc`.
47+
- **Styling:** Tailwind CSS v4; mobile-first; prefer existing UI components.
48+
49+
## Rule Order
50+
51+
Cursor rules in `.cursorrules/` are applied as configured. `00-project-context.mdc` is intended to load first (naming prefix) to establish project context; other rule files add domain-specific guidance (React Router, Storybook, forms, testing, monorepo, UI).
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,19 @@
11
---
2+
description: React Router 7 routing, loaders, actions, and component patterns
3+
globs: apps/**/app/routes/**/*.tsx, apps/**/app/**/*.tsx
24
alwaysApply: true
35
---
46

57
# React Router 7 Cursor Rules
68

79
## Route Structure
8-
- Use file-based routing in `app/routes/`
9-
- Route files should export default component and optional meta, loader, action functions
10-
- Use `+types` for route-specific TypeScript types
11-
12-
## Component Patterns
13-
```tsx
14-
// Route component example
15-
import type { Route } from './+types/home';
16-
17-
export const meta: Route.MetaFunction = () => {
18-
return [
19-
{ title: 'Page Title' },
20-
{ name: 'description', content: 'Page description' }
21-
];
22-
};
23-
24-
export default function Home() {
25-
return <div>Content</div>;
26-
}
27-
```
28-
29-
## Data Loading
30-
- Use loaders for server-side data fetching
31-
- Use actions for form submissions and mutations
32-
- Prefer server-side data loading over client-side when possible
3310

34-
## Error Handling
35-
- Implement ErrorBoundary components for route-level error handling
36-
- Use isRouteErrorResponse for proper error type checking
37-
38-
## Navigation
39-
- Use Link component for internal navigation
40-
- Use NavLink for navigation with active states
41-
- Prefer declarative navigation over imperative
42-
43-
## Best Practices
44-
- Keep route components focused on layout and data orchestration
45-
- Extract business logic into custom hooks or utilities
46-
- Use proper TypeScript types from route type definitions
47-
- Implement proper loading and error states
48-
49-
# React Router 7 Cursor Rules
50-
51-
## Route Structure
5211
- Use file-based routing in `app/routes/`
5312
- Route files should export default component and optional meta, loader, action functions
5413
- Use `+types` for route-specific TypeScript types
5514

5615
## Component Patterns
16+
5717
```tsx
5818
// Route component example
5919
import type { Route } from './+types/home';
@@ -71,22 +31,25 @@ export default function Home() {
7131
```
7232

7333
## Data Loading
34+
7435
- Use loaders for server-side data fetching
7536
- Use actions for form submissions and mutations
7637
- Prefer server-side data loading over client-side when possible
7738

7839
## Error Handling
40+
7941
- Implement ErrorBoundary components for route-level error handling
8042
- Use isRouteErrorResponse for proper error type checking
8143

8244
## Navigation
45+
8346
- Use Link component for internal navigation
8447
- Use NavLink for navigation with active states
8548
- Prefer declarative navigation over imperative
8649

8750
## Best Practices
51+
8852
- Keep route components focused on layout and data orchestration
8953
- Extract business logic into custom hooks or utilities
9054
- Use proper TypeScript types from route type definitions
9155
- Implement proper loading and error states
92-

.cursorrules/storybook.mdc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
description: Storybook setup and patterns for React Router apps
3+
globs: apps/**/.storybook/**/*.ts, apps/**/.storybook/**/*.tsx, apps/**/*.stories.@(ts|tsx)
4+
alwaysApply: false
5+
---
6+
7+
# Storybook Cursor Rules
8+
9+
## Setup (todo-app)
10+
11+
- **Framework:** `@storybook/react-vite` with Vite config from app root
12+
- **Stories:** `../app/**/*.stories.@(ts|tsx)`
13+
- **Addons:** `@storybook/addon-essentials`, `@storybook/addon-links`
14+
- **Config:** `main.ts` uses `viteFinal` to resolve `vite.config.ts` for path aliases and Tailwind
15+
16+
## React Router in Storybook
17+
18+
Components that use `Link`, `useNavigate`, `useFetcher`, or `useHref` need router context. Use a global decorator in `preview.tsx`:
19+
20+
```tsx
21+
import type { ComponentType } from 'react';
22+
import { createMemoryRouter, RouterProvider } from 'react-router-dom';
23+
24+
const withRouter = (Story: ComponentType) => {
25+
const router = createMemoryRouter(
26+
[{ path: '/', element: <Story /> }],
27+
{ initialEntries: ['/'] }
28+
);
29+
return <RouterProvider router={router} />;
30+
};
31+
32+
const preview: Preview = {
33+
decorators: [withRouter, withTodoProvider], // add app providers as needed
34+
// ...
35+
};
36+
```
37+
38+
## Patterns
39+
40+
- **Single route:** One route with `element: <Story />` and `initialEntries: ['/']` (or desired path)
41+
- **App providers:** Add decorators for context providers (e.g. TodoProvider) so stories match app behavior
42+
- **Global styles:** Import app `globals.css` in `preview.tsx` so Tailwind and theme apply
43+
44+
## Scripts
45+
46+
- **Dev:** `npm run storybook` (port 6006)
47+
- **Build:** `npm run build-storybook` (static output for deployment)
48+
49+
## Best Practices
50+
51+
- Keep stories colocated with components (`component.stories.tsx`)
52+
- Use args and controls for props; use decorators for router and providers
53+
- Prefer one default export with a descriptive title; use named exports for variants

0 commit comments

Comments
 (0)