@forgeailab/create-spark 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -4
- package/packs/README.md +132 -0
- package/packs/ai-anthropic/files/app/api/ai/route.ts +57 -0
- package/packs/ai-anthropic/files/lib/anthropic.ts +15 -0
- package/packs/ai-anthropic/pack.toml +32 -0
- package/packs/ai-anthropic/skills/ai-feature-patterns/SKILL.md +87 -0
- package/packs/ai-anthropic/tasks.yaml +9 -0
- package/packs/ai-openai/files/app/api/ai-openai/route.ts +55 -0
- package/packs/ai-openai/files/lib/openai.ts +21 -0
- package/packs/ai-openai/pack.toml +30 -0
- package/packs/ai-openai/tasks.yaml +9 -0
- package/packs/analytics-posthog/files/components/PostHogProvider.tsx +19 -0
- package/packs/analytics-posthog/files/lib/posthog/client.ts +20 -0
- package/packs/analytics-posthog/files/lib/posthog/server.ts +24 -0
- package/packs/analytics-posthog/pack.toml +35 -0
- package/packs/analytics-posthog/tasks.yaml +15 -0
- package/packs/auth-better-auth/files/app/(auth)/login/page.tsx +58 -0
- package/packs/auth-better-auth/files/app/api/auth/[...all]/route.ts +4 -0
- package/packs/auth-better-auth/files/lib/auth.ts +21 -0
- package/packs/auth-better-auth/pack.toml +32 -0
- package/packs/auth-better-auth/tasks.yaml +10 -0
- package/packs/auth-better-auth-pg/files/app/api/auth/[...all]/route.ts +4 -0
- package/packs/auth-better-auth-pg/files/lib/auth.ts +86 -0
- package/packs/auth-better-auth-pg/pack.toml +32 -0
- package/packs/auth-better-auth-pg/tasks.yaml +17 -0
- package/packs/auth-supabase/files/app/(auth)/login/page.tsx +64 -0
- package/packs/auth-supabase/files/app/auth/callback/route.ts +15 -0
- package/packs/auth-supabase/files/middleware.ts +41 -0
- package/packs/auth-supabase/pack.toml +34 -0
- package/packs/auth-supabase/tasks.yaml +10 -0
- package/packs/db-postgres/files/compose/postgres.yml +28 -0
- package/packs/db-postgres/files/docker-compose.include.yml +1 -0
- package/packs/db-postgres/files/docker-compose.yml +6 -0
- package/packs/db-postgres/files/drizzle.config.ts +10 -0
- package/packs/db-postgres/files/lib/db/index.ts +10 -0
- package/packs/db-postgres/files/lib/db/schema.ts +11 -0
- package/packs/db-postgres/pack.toml +53 -0
- package/packs/db-postgres/tasks.yaml +11 -0
- package/packs/db-sqlite/files/drizzle.config.ts +10 -0
- package/packs/db-sqlite/files/lib/db.ts +8 -0
- package/packs/db-sqlite/files/lib/schema.ts +13 -0
- package/packs/db-sqlite/pack.toml +34 -0
- package/packs/db-sqlite/tasks.yaml +6 -0
- package/packs/db-supabase/files/lib/supabase/client.ts +8 -0
- package/packs/db-supabase/files/lib/supabase/server.ts +27 -0
- package/packs/db-supabase/pack.toml +32 -0
- package/packs/db-supabase/skills/supabase-patterns/SKILL.md +82 -0
- package/packs/db-supabase/tasks.yaml +6 -0
- package/packs/deploy-vercel/files/docs/deploy.md +21 -0
- package/packs/deploy-vercel/files/vercel.json +4 -0
- package/packs/deploy-vercel/pack.toml +30 -0
- package/packs/deploy-vercel/tasks.yaml +14 -0
- package/packs/docker-compose-dev/files/.env.docker.example +2 -0
- package/packs/docker-compose-dev/files/compose/redis.yml +17 -0
- package/packs/docker-compose-dev/files/docker-compose.include.yml +1 -0
- package/packs/docker-compose-dev/files/docker-compose.yml +6 -0
- package/packs/docker-compose-dev/pack.toml +38 -0
- package/packs/docker-compose-dev/tasks.yaml +9 -0
- package/packs/email-resend/files/app/api/email/test/route.ts +38 -0
- package/packs/email-resend/files/emails/welcome.tsx +66 -0
- package/packs/email-resend/files/lib/email.ts +40 -0
- package/packs/email-resend/pack.toml +34 -0
- package/packs/email-resend/tasks.yaml +9 -0
- package/packs/example/pack.toml +69 -0
- package/packs/payments-stripe/files/app/api/billing-portal/route.ts +24 -0
- package/packs/payments-stripe/files/app/api/checkout/route.ts +58 -0
- package/packs/payments-stripe/files/app/api/webhooks/stripe/route.ts +84 -0
- package/packs/payments-stripe/files/lib/stripe.ts +60 -0
- package/packs/payments-stripe/pack.toml +49 -0
- package/packs/payments-stripe/skills/stripe-patterns/SKILL.md +93 -0
- package/packs/payments-stripe/tasks.yaml +16 -0
- package/packs/sync-zero/files/components/ZeroProvider.tsx +3 -0
- package/packs/sync-zero/files/compose/zero-cache.yml +26 -0
- package/packs/sync-zero/files/docker-compose.include.yml +1 -0
- package/packs/sync-zero/files/docker-compose.yml +6 -0
- package/packs/sync-zero/files/lib/zero/client.ts +18 -0
- package/packs/sync-zero/files/lib/zero/schema.ts +17 -0
- package/packs/sync-zero/files/zero.config.ts +26 -0
- package/packs/sync-zero/pack.toml +61 -0
- package/packs/sync-zero/skills/zero-patterns/SKILL.md +69 -0
- package/packs/sync-zero/tasks.yaml +16 -0
- package/packs/testing-playwright/files/e2e/example.spec.ts +7 -0
- package/packs/testing-playwright/files/playwright.config.ts +33 -0
- package/packs/testing-playwright/pack.toml +25 -0
- package/packs/testing-playwright/tasks.yaml +9 -0
- package/packs/ui-shadcn/files/app/globals.css +56 -0
- package/packs/ui-shadcn/files/components/ui/button.tsx +47 -0
- package/packs/ui-shadcn/files/components/ui/card.tsx +33 -0
- package/packs/ui-shadcn/files/lib/utils.ts +6 -0
- package/packs/ui-shadcn/files/postcss.config.mjs +7 -0
- package/packs/ui-shadcn/files/tailwind.config.ts +57 -0
- package/packs/ui-shadcn/pack.toml +44 -0
- package/packs/ui-shadcn/skills/shadcn-dashboard-patterns/SKILL.md +85 -0
- package/packs/ui-shadcn/tasks.yaml +6 -0
- package/presets/docs-site.toml +4 -0
- package/presets/internal-tool.toml +4 -0
- package/presets/lean-saas.toml +4 -0
- package/presets/local-ai-mvp.toml +4 -0
- package/presets/saas-classic.toml +4 -0
- package/src/paths.ts +22 -4
- package/templates/README.md +43 -0
- package/templates/astro/README.md +3 -0
- package/templates/astro/template.toml +4 -0
- package/templates/astro-starlight/README.md +3 -0
- package/templates/astro-starlight/template.toml +4 -0
- package/templates/nextjs/.ai/architecture.md +13 -0
- package/templates/nextjs/.ai/board.md +7 -0
- package/templates/nextjs/.ai/product-spec.md +11 -0
- package/templates/nextjs/.claude/skills/.gitkeep +0 -0
- package/templates/nextjs/.codex/skills/.gitkeep +0 -0
- package/templates/nextjs/AGENTS.md +95 -0
- package/templates/nextjs/CLAUDE.md +3 -0
- package/templates/nextjs/README.md +20 -0
- package/templates/nextjs/anvil.config.json +4 -0
- package/templates/nextjs/app/(app)/home/page.tsx +43 -0
- package/templates/nextjs/app/(app)/home/posts-panel.tsx +83 -0
- package/templates/nextjs/app/(app)/layout.tsx +12 -0
- package/templates/nextjs/app/(auth)/login/page.tsx +97 -0
- package/templates/nextjs/app/globals.css +23 -0
- package/templates/nextjs/app/layout.tsx +20 -0
- package/templates/nextjs/app/page.tsx +39 -0
- package/templates/nextjs/lib/auth-placeholder.ts +21 -0
- package/templates/nextjs/lib/posts-placeholder.ts +30 -0
- package/templates/nextjs/next.config.ts +5 -0
- package/templates/nextjs/package.json +26 -0
- package/templates/nextjs/postcss.config.mjs +7 -0
- package/templates/nextjs/template.toml +4 -0
- package/templates/nextjs/tsconfig.json +27 -0
- package/templates/nextjs/types/post.ts +13 -0
- package/templates/one/README.md +5 -0
- package/templates/one/template.toml +4 -0
- package/templates/vite-react/README.md +3 -0
- package/templates/vite-react/template.toml +4 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
|
|
4
|
+
export function Card({ className, ...props }: React.ComponentProps<'div'>) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)}
|
|
8
|
+
{...props}
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
14
|
+
return <div className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
18
|
+
return (
|
|
19
|
+
<div className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} />
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
24
|
+
return <div className={cn('text-sm text-muted-foreground', className)} {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
28
|
+
return <div className={cn('p-6 pt-0', className)} {...props} />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
32
|
+
return <div className={cn('flex items-center p-6 pt-0', className)} {...props} />;
|
|
33
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
darkMode: ['class'],
|
|
5
|
+
content: [
|
|
6
|
+
'./app/**/*.{ts,tsx,mdx}',
|
|
7
|
+
'./components/**/*.{ts,tsx,mdx}',
|
|
8
|
+
'./lib/**/*.{ts,tsx,mdx}',
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {
|
|
12
|
+
borderRadius: {
|
|
13
|
+
lg: 'var(--radius)',
|
|
14
|
+
md: 'calc(var(--radius) - 2px)',
|
|
15
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
16
|
+
},
|
|
17
|
+
colors: {
|
|
18
|
+
background: 'hsl(var(--background))',
|
|
19
|
+
foreground: 'hsl(var(--foreground))',
|
|
20
|
+
card: {
|
|
21
|
+
DEFAULT: 'hsl(var(--card))',
|
|
22
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
23
|
+
},
|
|
24
|
+
popover: {
|
|
25
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
26
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
27
|
+
},
|
|
28
|
+
primary: {
|
|
29
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
30
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
31
|
+
},
|
|
32
|
+
secondary: {
|
|
33
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
34
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
35
|
+
},
|
|
36
|
+
muted: {
|
|
37
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
38
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
39
|
+
},
|
|
40
|
+
accent: {
|
|
41
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
42
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
43
|
+
},
|
|
44
|
+
destructive: {
|
|
45
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
46
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
47
|
+
},
|
|
48
|
+
border: 'hsl(var(--border))',
|
|
49
|
+
input: 'hsl(var(--input))',
|
|
50
|
+
ring: 'hsl(var(--ring))',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
plugins: [],
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default config;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name = "ui-shadcn"
|
|
2
|
+
version = "1.0.0"
|
|
3
|
+
category = "ui"
|
|
4
|
+
description = "Shadcn-style UI primitives for Next.js dashboards."
|
|
5
|
+
provides = ["ui-kit"]
|
|
6
|
+
requires = []
|
|
7
|
+
conflicts = ["ui-kit"]
|
|
8
|
+
requires_runtime = ["react"]
|
|
9
|
+
compatible_scaffolds = ["nextjs"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
runtime = [
|
|
13
|
+
"@radix-ui/react-slot",
|
|
14
|
+
"class-variance-authority",
|
|
15
|
+
"clsx",
|
|
16
|
+
"tailwind-merge",
|
|
17
|
+
"lucide-react",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[files]]
|
|
21
|
+
mode = "create"
|
|
22
|
+
from = "lib/utils.ts"
|
|
23
|
+
to = "lib/utils.ts"
|
|
24
|
+
|
|
25
|
+
[[files]]
|
|
26
|
+
mode = "create"
|
|
27
|
+
from = "components/ui/button.tsx"
|
|
28
|
+
to = "components/ui/button.tsx"
|
|
29
|
+
|
|
30
|
+
[[files]]
|
|
31
|
+
mode = "create"
|
|
32
|
+
from = "components/ui/card.tsx"
|
|
33
|
+
to = "components/ui/card.tsx"
|
|
34
|
+
|
|
35
|
+
[[files]]
|
|
36
|
+
mode = "append"
|
|
37
|
+
from = "app/globals.css"
|
|
38
|
+
to = "app/globals.css"
|
|
39
|
+
|
|
40
|
+
[skills]
|
|
41
|
+
copy = ["skills/shadcn-dashboard-patterns"]
|
|
42
|
+
|
|
43
|
+
[tasks]
|
|
44
|
+
file = "tasks.yaml"
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shadcn-dashboard-patterns
|
|
3
|
+
description: Compose shadcn-style primitives into dense, practical dashboard layouts without drifting into marketing UI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: shadcn-dashboard-patterns
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
|
|
10
|
+
Build dashboard screens from small primitives that stay easy to scan, resize,
|
|
11
|
+
and extend. Use the shadcn component style as a starting point, not as a reason
|
|
12
|
+
to turn every section into a card.
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
|
|
16
|
+
- Start with the user's job, not the component catalog.
|
|
17
|
+
- Put navigation, filters, and primary actions where repeat users expect them.
|
|
18
|
+
- Prefer one clear page title, one toolbar, and one main content region.
|
|
19
|
+
- Use cards for repeated objects, stat summaries, forms, and modal content.
|
|
20
|
+
- Do not wrap the whole page in a decorative card.
|
|
21
|
+
- Keep radii at `rounded-lg` or below unless the app theme says otherwise.
|
|
22
|
+
- Use `cn()` for class merging and keep variants close to the component.
|
|
23
|
+
|
|
24
|
+
## Layout
|
|
25
|
+
|
|
26
|
+
- Use a shell with a sidebar or top nav only when there are real destinations.
|
|
27
|
+
- Keep dashboard width constrained with `mx-auto w-full max-w-7xl px-4`.
|
|
28
|
+
- Use `gap-4` or `gap-6`; avoid ornamental whitespace in operational views.
|
|
29
|
+
- Put status, owner, date, and filters near the table or list they affect.
|
|
30
|
+
- Align destructive actions away from the primary happy path.
|
|
31
|
+
- Keep tables full width and let dense data breathe through row height.
|
|
32
|
+
- Use sticky headers only when the table is long enough to justify them.
|
|
33
|
+
|
|
34
|
+
## Cards
|
|
35
|
+
|
|
36
|
+
- A card should represent one thing: a metric, a record, a form, or a chart.
|
|
37
|
+
- Do not nest cards inside cards.
|
|
38
|
+
- Use `CardHeader`, `CardContent`, and `CardFooter` only when each region helps.
|
|
39
|
+
- Small metric cards should use compact labels, one strong value, and a trend.
|
|
40
|
+
- Empty cards should show the empty state for that object, not generic help copy.
|
|
41
|
+
- Repeated cards need stable height or clear wrapping behavior.
|
|
42
|
+
|
|
43
|
+
## Buttons
|
|
44
|
+
|
|
45
|
+
- Primary buttons create or commit work.
|
|
46
|
+
- Secondary buttons reveal adjacent options.
|
|
47
|
+
- Ghost buttons belong in rows, toolbars, and low-emphasis actions.
|
|
48
|
+
- Icon buttons need an accessible label.
|
|
49
|
+
- Use `asChild` when routing through `Link`, not nested buttons or anchors.
|
|
50
|
+
- Keep button labels short and concrete: `Save`, `Invite`, `Export`.
|
|
51
|
+
- Avoid full-width buttons on desktop unless the panel itself is narrow.
|
|
52
|
+
|
|
53
|
+
## Forms
|
|
54
|
+
|
|
55
|
+
- Group fields by workflow, not by database table.
|
|
56
|
+
- Put validation text next to the field that caused it.
|
|
57
|
+
- Use disabled and pending states during server actions.
|
|
58
|
+
- Use destructive copy only for irreversible actions.
|
|
59
|
+
- Keep advanced settings collapsed until they are needed.
|
|
60
|
+
- Use consistent input widths inside the same form group.
|
|
61
|
+
|
|
62
|
+
## Tables And Lists
|
|
63
|
+
|
|
64
|
+
- Use a table when users compare many rows across the same fields.
|
|
65
|
+
- Use a list when records have mixed metadata and short actions.
|
|
66
|
+
- Keep row actions at the trailing edge.
|
|
67
|
+
- Expose bulk actions only after selection exists.
|
|
68
|
+
- Use badges sparingly for status, plan, role, or risk.
|
|
69
|
+
- Do not use color as the only status signal.
|
|
70
|
+
|
|
71
|
+
## Empty, Loading, Error
|
|
72
|
+
|
|
73
|
+
- Empty states should offer the next valid action.
|
|
74
|
+
- Loading states should preserve the final layout shape.
|
|
75
|
+
- Error states should say what failed and offer retry or recovery.
|
|
76
|
+
- Avoid giant empty illustrations inside work dashboards.
|
|
77
|
+
- Do not teach the whole product in an empty state.
|
|
78
|
+
|
|
79
|
+
## Motion And Polish
|
|
80
|
+
|
|
81
|
+
- Prefer subtle color, border, and shadow changes over large motion.
|
|
82
|
+
- Keep hover states predictable across cards, rows, and buttons.
|
|
83
|
+
- Respect reduced motion when adding transitions.
|
|
84
|
+
- Check mobile wrapping for toolbar actions and long entity names.
|
|
85
|
+
- Make the first useful workflow visible without a landing page.
|
package/src/paths.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFileSync, statSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, resolve } from 'node:path';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
'
|
|
4
|
+
const catalogRootError =
|
|
5
|
+
'Catalog directories (templates/, packs/) not found. Set SPARK_ROOT to point at the spark monorepo, or install via the published @forgeailab/create-spark npm package.';
|
|
6
6
|
|
|
7
7
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
8
8
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -32,6 +32,15 @@ function hasWorkspacePackageJson(dir: string): boolean {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
// A catalog root is any directory containing the `templates/` and `packs/`
|
|
36
|
+
// folders we need. Two cases produce one:
|
|
37
|
+
// 1) The monorepo root (dev). Also has a `package.json` with `workspaces`.
|
|
38
|
+
// 2) The published @forgeailab/create-spark package directory (npm install).
|
|
39
|
+
// The publish script bundles templates/ and packs/ into the tarball.
|
|
40
|
+
function isCatalogRoot(dir: string): boolean {
|
|
41
|
+
return isDirectory(join(dir, 'templates')) && isDirectory(join(dir, 'packs'));
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
function isMonorepoRoot(dir: string): boolean {
|
|
36
45
|
return hasWorkspacePackageJson(dir) && isDirectory(join(dir, 'templates'));
|
|
37
46
|
}
|
|
@@ -42,15 +51,24 @@ export function findMonorepoRoot(startDir: string = import.meta.dir): string {
|
|
|
42
51
|
return resolve(override);
|
|
43
52
|
}
|
|
44
53
|
|
|
54
|
+
// Published-package case: this file lives at <package>/src/paths.ts ->
|
|
55
|
+
// walk up one dir to <package>/ which the publish script populates with
|
|
56
|
+
// templates/ and packs/.
|
|
57
|
+
const packageRoot = resolve(import.meta.dir, '..');
|
|
58
|
+
if (isCatalogRoot(packageRoot)) {
|
|
59
|
+
return packageRoot;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Dev / monorepo case: walk up from cwd or src looking for the monorepo.
|
|
45
63
|
let current = resolve(startDir);
|
|
46
64
|
while (true) {
|
|
47
|
-
if (isMonorepoRoot(current)) {
|
|
65
|
+
if (isMonorepoRoot(current) || isCatalogRoot(current)) {
|
|
48
66
|
return current;
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
const parent = dirname(current);
|
|
52
70
|
if (parent === current) {
|
|
53
|
-
throw new Error(
|
|
71
|
+
throw new Error(catalogRootError);
|
|
54
72
|
}
|
|
55
73
|
current = parent;
|
|
56
74
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Template Authoring
|
|
2
|
+
|
|
3
|
+
Templates live under `templates/<name>/` and register a base scaffold for `create-spark`. Each template directory must contain a `template.toml` manifest and may contain scaffold files when the template is stable.
|
|
4
|
+
|
|
5
|
+
## `template.toml`
|
|
6
|
+
|
|
7
|
+
`template.toml` is parsed with `TemplateManifestSchema` from `packages/spark-schema/src/template.ts`.
|
|
8
|
+
|
|
9
|
+
Required fields:
|
|
10
|
+
|
|
11
|
+
- `name`: lowercase template id matching `^[a-z][a-z0-9-]*$`.
|
|
12
|
+
- `status`: `stable` or `planned`.
|
|
13
|
+
- `provides`: array of template capability tags.
|
|
14
|
+
- `description`: one-line human-readable summary.
|
|
15
|
+
|
|
16
|
+
Example:
|
|
17
|
+
|
|
18
|
+
```toml
|
|
19
|
+
name = "nextjs"
|
|
20
|
+
status = "stable"
|
|
21
|
+
provides = ["server", "static", "spa"]
|
|
22
|
+
description = "Next.js App Router scaffold for TypeScript web apps."
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Template Capabilities
|
|
26
|
+
|
|
27
|
+
Template capabilities describe what the base scaffold runtime provides. They are separate from pack capabilities such as `db`, `auth`, or `payments`.
|
|
28
|
+
|
|
29
|
+
Current accepted template capabilities:
|
|
30
|
+
|
|
31
|
+
- `server`: can run server-side application code.
|
|
32
|
+
- `spa`: supports client-side single-page app behavior.
|
|
33
|
+
- `native`: supports native app targets.
|
|
34
|
+
- `edge`: supports edge runtime deployment.
|
|
35
|
+
- `library`: is intended as a reusable package or library scaffold.
|
|
36
|
+
- `monorepo`: is a multi-package workspace scaffold.
|
|
37
|
+
- `static`: can emit static assets or static pages.
|
|
38
|
+
|
|
39
|
+
Use only these exact values until the schema changes. Planned templates should still include a valid `template.toml` so packs and presets can declare compatibility before the full scaffold ships.
|
|
40
|
+
|
|
41
|
+
## Promoting Planned Templates
|
|
42
|
+
|
|
43
|
+
To promote a template from `planned` to `stable`, add the runnable scaffold files under `templates/<name>/`, update `status = "stable"`, and run the manifest parser against every template. Stable templates should be copyable into a new project and runnable without requiring auth, database, billing, email, UI libraries, or AI SDK setup by default.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Astro Template
|
|
2
|
+
|
|
3
|
+
This template is registered for pack compatibility planning, but it is not implemented yet. The planned scope is an Astro content-site scaffold with server rendering, static output support, MDX-oriented content workflows once the template capability schema supports that tag, and the same AI workflow artifacts as the stable Next.js template.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Astro Starlight Template
|
|
2
|
+
|
|
3
|
+
This template is registered for pack compatibility planning, but it is not implemented yet. The planned scope is a static documentation scaffold based on Astro Starlight, with content-focused defaults and the same AI workflow artifacts as the stable Next.js template.
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Operating rules for any agent (Codex, Claude Code, or otherwise) working in this repo. Mirror of the workflow encoded in `.claude/skills/`, so the system stays portable.
|
|
4
|
+
|
|
5
|
+
<!-- SPEC:START -->
|
|
6
|
+
## Spec workflow
|
|
7
|
+
|
|
8
|
+
For proposals/specs/plans, new capabilities, breaking changes, architecture shifts, or behavior-changing perf/security work, keep the source of truth in this project's `.ai/` artifacts first. If the project later adopts formal spec deltas, place them under `docs/spec/changes/<id>-YYYY-MM-DD/`; truth specs after archive live under `docs/spec/specs/`.
|
|
9
|
+
<!-- SPEC:END -->
|
|
10
|
+
|
|
11
|
+
## Operating model
|
|
12
|
+
|
|
13
|
+
This project runs a **planner / implementer / evaluator** loop. The same agent should not plan, build, and grade its own work. Use a strong reasoning model (Opus 4.7 / GPT-5.5) for planning and review; use a faster executor (Sonnet 4.6 / GPT-5 family) for routine implementation.
|
|
14
|
+
|
|
15
|
+
## Source of truth
|
|
16
|
+
|
|
17
|
+
The truth is in repo artifacts, not in chat:
|
|
18
|
+
|
|
19
|
+
- `.ai/product-spec.md` — what the MVP is. Source of acceptance criteria and non-goals.
|
|
20
|
+
- `.ai/architecture.md` — the stack and the cutline (what we are NOT building yet).
|
|
21
|
+
- `.ai/ux-theme.md` — visual direction. Empty / loading / error patterns live here.
|
|
22
|
+
- `.ai/board.md` — every task, with status, dependencies, owners, validation state, linked PR.
|
|
23
|
+
- `.ai/decision-log.md` — locked-in decisions and the reasoning.
|
|
24
|
+
- `.ai/execution-log.md` — append-only history of state changes.
|
|
25
|
+
|
|
26
|
+
If an answer is not in these files, ask the user — do not invent it.
|
|
27
|
+
|
|
28
|
+
## Workflow phases
|
|
29
|
+
|
|
30
|
+
1. **Grill the idea** until it is buildable. Max 5 questions per round. Only questions that change scope or architecture.
|
|
31
|
+
2. **Write the spec.** One MVP slice. Non-goals are mandatory.
|
|
32
|
+
3. **Cut the architecture.** Boring stack > clever stack. Every choice has a "not building yet" sibling.
|
|
33
|
+
4. **Theme the UX.** One vibe, one reference product, concrete tokens.
|
|
34
|
+
5. **Build the board.** Tasks sized for one focused session. Declare `Depends on:` and `Parallel-safe:`.
|
|
35
|
+
6. **Review the board.** Approval gate between planning and execution. No task starts until it is `Approved for execution`.
|
|
36
|
+
7. **Brief each task** before execution. Self-contained, with files-to-inspect, acceptance criteria verbatim, and a verification command.
|
|
37
|
+
8. **Execute one task at a time.** Stay inside the declared file list. No bonus refactors.
|
|
38
|
+
9. **Review independently.** A separate pass checks the diff against acceptance criteria, security, and scope.
|
|
39
|
+
10. **QA-verify** by actually running the app and walking the core user journey.
|
|
40
|
+
11. **Sync the board** from git reality. Trust git, not claims.
|
|
41
|
+
|
|
42
|
+
## Board statuses
|
|
43
|
+
|
|
44
|
+
`Clarifying` → `Approved for planning` → `Approved for execution` → `In progress` → `Needs review` → `Validated`
|
|
45
|
+
|
|
46
|
+
Side states: `Blocked`, `Cut from MVP`.
|
|
47
|
+
|
|
48
|
+
`Validated` requires both a `/code-review` pass and a `/qa-verify` pass for user-facing changes. Execution never grades itself.
|
|
49
|
+
|
|
50
|
+
## Hard rules
|
|
51
|
+
|
|
52
|
+
- Do not edit files outside the current task's declared scope. New discoveries become new tasks in `Clarifying`, not silent edits.
|
|
53
|
+
- Do not pick a stack outside `.ai/architecture.md`. Propose a decision-log update first.
|
|
54
|
+
- Do not mark tasks `Validated` without independent review.
|
|
55
|
+
- Do not move a task to `Approved for execution` from execution skills. Only board-review can.
|
|
56
|
+
- Treat the `Non-goals` section of the spec and the `What we are NOT building yet` section of architecture as a `do-not-build` list. Violations are scope creep, not features.
|
|
57
|
+
- Verification commands must actually run. Type-check passing is not the same as feature working.
|
|
58
|
+
- When `git status` and a self-report disagree, trust git.
|
|
59
|
+
|
|
60
|
+
## Skill / command equivalents
|
|
61
|
+
|
|
62
|
+
Claude Code skills live in `.claude/skills/`. The same operations on Codex should be triggered through the matching workflow names:
|
|
63
|
+
|
|
64
|
+
| Stage | Skill |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| Grill | `mvp-grill`, `idea-sharpen` |
|
|
67
|
+
| Spec | `mvp-spec` |
|
|
68
|
+
| Architecture | `architecture-cutline` |
|
|
69
|
+
| Theme | `ux-theme` |
|
|
70
|
+
| Board | `mvp-board`, `board-review` |
|
|
71
|
+
| Schedule | `parallel-execution`, `next-task` |
|
|
72
|
+
| Execute | `implementation-brief`, `execute-task` |
|
|
73
|
+
| Evaluate | `code-review`, `qa-verify` |
|
|
74
|
+
| Sync | `sync-board` |
|
|
75
|
+
| Watch | `risk-check` |
|
|
76
|
+
|
|
77
|
+
## Model assignment defaults
|
|
78
|
+
|
|
79
|
+
- Planning / reviewing / scoping: **Opus 4.7** or **GPT-5.5**.
|
|
80
|
+
- Routine execution: **Sonnet 4.6** or a GPT-5 family executor.
|
|
81
|
+
- High-risk tasks (auth, payments, migrations, security): planning-quality model for both build and review.
|
|
82
|
+
|
|
83
|
+
## Conventions
|
|
84
|
+
|
|
85
|
+
- Stable task IDs (e.g. `AUTH-001`). Never renumber.
|
|
86
|
+
- Append to `.ai/decision-log.md` whenever a non-obvious choice is made, with: decision, context, alternatives considered, why, risk, revisit condition.
|
|
87
|
+
- Append to `.ai/execution-log.md` one line per state change in `.ai/board.md`.
|
|
88
|
+
- Do not delete board tasks. Move them to `Cut from MVP` with a reason.
|
|
89
|
+
|
|
90
|
+
## Packs
|
|
91
|
+
|
|
92
|
+
Feature packs are installed with the `spark` CLI.
|
|
93
|
+
Use `pack-resolve` to choose the scaffold and pack set, `pack-add` to dry-run
|
|
94
|
+
and install declarative pack changes, then `sync-board` to reconcile `.ai/board.md`
|
|
95
|
+
with the installed capabilities and current repository state.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Next.js Spark Template
|
|
2
|
+
|
|
3
|
+
This is the minimal Next.js 15 + TypeScript scaffold used by `create-spark`.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
Install dependencies, then start the dev server:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun install
|
|
11
|
+
bun dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Next Steps
|
|
15
|
+
|
|
16
|
+
Read `AGENTS.md`, fill in the `.ai/` planning files, and keep `.ai/board.md` current before implementing. Add capabilities only when the board calls for them:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
spark add <pack>
|
|
20
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import { getSessionUser } from '@/lib/auth-placeholder';
|
|
3
|
+
import { PostsPanel } from './posts-panel';
|
|
4
|
+
|
|
5
|
+
export default async function AppHome() {
|
|
6
|
+
const user = await getSessionUser();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<main className="mx-auto max-w-3xl px-6 py-12">
|
|
10
|
+
<header className="flex items-center justify-between">
|
|
11
|
+
<div>
|
|
12
|
+
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-slate-500">
|
|
13
|
+
Home
|
|
14
|
+
</p>
|
|
15
|
+
<h1 className="mt-1 text-2xl font-semibold tracking-tight text-slate-900">
|
|
16
|
+
{user ? `Hello ${user.name}` : 'Hello, friend'}
|
|
17
|
+
</h1>
|
|
18
|
+
</div>
|
|
19
|
+
{!user && (
|
|
20
|
+
<Link
|
|
21
|
+
href="/login"
|
|
22
|
+
className="rounded-md border border-slate-300 bg-white px-3 py-1.5 text-xs font-medium text-slate-700 shadow-sm hover:bg-slate-50"
|
|
23
|
+
>
|
|
24
|
+
Sign in
|
|
25
|
+
</Link>
|
|
26
|
+
)}
|
|
27
|
+
</header>
|
|
28
|
+
|
|
29
|
+
{!user && (
|
|
30
|
+
<p className="mt-4 rounded-md border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900">
|
|
31
|
+
No session detected. Install the{' '}
|
|
32
|
+
<code className="rounded bg-amber-100 px-1">auth-better-auth</code>{' '}
|
|
33
|
+
pack to wire real authentication.
|
|
34
|
+
</p>
|
|
35
|
+
)}
|
|
36
|
+
|
|
37
|
+
<section className="mt-8">
|
|
38
|
+
<h2 className="text-sm font-semibold text-slate-700">Your posts</h2>
|
|
39
|
+
<PostsPanel />
|
|
40
|
+
</section>
|
|
41
|
+
</main>
|
|
42
|
+
);
|
|
43
|
+
}
|