@forgeailab/spark 0.2.0 → 0.3.0
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 +8 -6
- package/src/commands/add.ts +3 -1
- package/src/commands/preset.ts +1 -0
- package/src/internal/board.ts +266 -304
- package/src/io/board.ts +29 -65
- package/src/io/env.ts +8 -3
- package/src/io/files.ts +22 -7
- package/packs/README.md +0 -130
- package/packs/ai-anthropic/files/app/api/ai/route.ts +0 -57
- package/packs/ai-anthropic/files/lib/anthropic.ts +0 -58
- package/packs/ai-anthropic/pack.toml +0 -31
- package/packs/ai-anthropic/skills/ai-feature-patterns/SKILL.md +0 -87
- package/packs/ai-anthropic/tasks.yaml +0 -9
- package/packs/ai-openai/files/app/api/ai-openai/route.ts +0 -55
- package/packs/ai-openai/files/lib/openai.ts +0 -21
- package/packs/ai-openai/pack.toml +0 -30
- package/packs/ai-openai/tasks.yaml +0 -9
- package/packs/analytics-posthog/files/components/PostHogProvider.tsx +0 -19
- package/packs/analytics-posthog/files/lib/posthog/client.ts +0 -20
- package/packs/analytics-posthog/files/lib/posthog/server.ts +0 -24
- package/packs/analytics-posthog/pack.toml +0 -35
- package/packs/analytics-posthog/tasks.yaml +0 -15
- package/packs/auth-better-auth/files/app/(auth)/login/page.tsx +0 -58
- package/packs/auth-better-auth/files/app/api/auth/[...all]/route.ts +0 -4
- package/packs/auth-better-auth/files/lib/auth.ts +0 -60
- package/packs/auth-better-auth/pack.toml +0 -28
- package/packs/auth-better-auth/tasks.yaml +0 -10
- package/packs/auth-better-auth-pg/files/app/api/auth/[...all]/route.ts +0 -4
- package/packs/auth-better-auth-pg/files/lib/auth.ts +0 -125
- package/packs/auth-better-auth-pg/pack.toml +0 -28
- package/packs/auth-better-auth-pg/tasks.yaml +0 -17
- package/packs/auth-supabase/files/app/(auth)/login/page.tsx +0 -64
- package/packs/auth-supabase/files/app/auth/callback/route.ts +0 -15
- package/packs/auth-supabase/files/middleware.ts +0 -41
- package/packs/auth-supabase/pack.toml +0 -34
- package/packs/auth-supabase/tasks.yaml +0 -10
- package/packs/db-postgres/files/compose/postgres.yml +0 -28
- package/packs/db-postgres/files/docker-compose.include.yml +0 -1
- package/packs/db-postgres/files/docker-compose.yml +0 -6
- package/packs/db-postgres/files/drizzle.config.ts +0 -10
- package/packs/db-postgres/files/lib/db/index.ts +0 -10
- package/packs/db-postgres/files/lib/db/schema.ts +0 -11
- package/packs/db-postgres/pack.toml +0 -53
- package/packs/db-postgres/tasks.yaml +0 -11
- package/packs/db-sqlite/files/drizzle.config.ts +0 -10
- package/packs/db-sqlite/files/lib/db.ts +0 -8
- package/packs/db-sqlite/files/lib/schema.ts +0 -13
- package/packs/db-sqlite/pack.toml +0 -34
- package/packs/db-sqlite/tasks.yaml +0 -6
- package/packs/db-supabase/files/lib/supabase/client.ts +0 -8
- package/packs/db-supabase/files/lib/supabase/server.ts +0 -27
- package/packs/db-supabase/pack.toml +0 -32
- package/packs/db-supabase/skills/supabase-patterns/SKILL.md +0 -82
- package/packs/db-supabase/tasks.yaml +0 -6
- package/packs/deploy-vercel/files/docs/deploy.md +0 -21
- package/packs/deploy-vercel/files/vercel.json +0 -4
- package/packs/deploy-vercel/pack.toml +0 -30
- package/packs/deploy-vercel/tasks.yaml +0 -14
- package/packs/docker-compose-dev/files/.env.docker.example +0 -2
- package/packs/docker-compose-dev/files/compose/redis.yml +0 -17
- package/packs/docker-compose-dev/files/docker-compose.include.yml +0 -1
- package/packs/docker-compose-dev/files/docker-compose.yml +0 -6
- package/packs/docker-compose-dev/pack.toml +0 -38
- package/packs/docker-compose-dev/tasks.yaml +0 -9
- package/packs/email-resend/files/app/api/email/test/route.ts +0 -38
- package/packs/email-resend/files/emails/welcome.tsx +0 -66
- package/packs/email-resend/files/lib/email.ts +0 -40
- package/packs/email-resend/pack.toml +0 -34
- package/packs/email-resend/tasks.yaml +0 -9
- package/packs/example/pack.toml +0 -69
- package/packs/payments-stripe/files/app/api/billing-portal/route.ts +0 -24
- package/packs/payments-stripe/files/app/api/checkout/route.ts +0 -58
- package/packs/payments-stripe/files/app/api/webhooks/stripe/route.ts +0 -84
- package/packs/payments-stripe/files/lib/stripe.ts +0 -158
- package/packs/payments-stripe/pack.toml +0 -45
- package/packs/payments-stripe/skills/stripe-patterns/SKILL.md +0 -93
- package/packs/payments-stripe/tasks.yaml +0 -16
- package/packs/sync-zero/files/components/ZeroProvider.tsx +0 -13
- package/packs/sync-zero/files/compose/zero-cache.yml +0 -26
- package/packs/sync-zero/files/docker-compose.include.yml +0 -1
- package/packs/sync-zero/files/docker-compose.yml +0 -6
- package/packs/sync-zero/files/lib/zero/client.ts +0 -18
- package/packs/sync-zero/files/lib/zero/schema.ts +0 -30
- package/packs/sync-zero/files/zero.config.ts +0 -26
- package/packs/sync-zero/pack.toml +0 -57
- package/packs/sync-zero/skills/zero-patterns/SKILL.md +0 -69
- package/packs/sync-zero/tasks.yaml +0 -16
- package/packs/testing-playwright/files/e2e/example.spec.ts +0 -7
- package/packs/testing-playwright/files/playwright.config.ts +0 -33
- package/packs/testing-playwright/pack.toml +0 -25
- package/packs/testing-playwright/tasks.yaml +0 -9
- package/packs/ui-shadcn/files/app/globals.css +0 -56
- package/packs/ui-shadcn/files/components/ui/button.tsx +0 -47
- package/packs/ui-shadcn/files/components/ui/card.tsx +0 -33
- package/packs/ui-shadcn/files/lib/utils.ts +0 -6
- package/packs/ui-shadcn/files/postcss.config.mjs +0 -7
- package/packs/ui-shadcn/files/tailwind.config.ts +0 -57
- package/packs/ui-shadcn/pack.toml +0 -44
- package/packs/ui-shadcn/skills/shadcn-dashboard-patterns/SKILL.md +0 -85
- package/packs/ui-shadcn/tasks.yaml +0 -6
- package/presets/docs-site.toml +0 -4
- package/presets/internal-tool.toml +0 -4
- package/presets/lean-saas.toml +0 -4
- package/presets/local-ai-mvp.toml +0 -4
- package/presets/saas-classic.toml +0 -4
- package/templates/README.md +0 -43
- package/templates/astro/README.md +0 -3
- package/templates/astro/template.toml +0 -4
- package/templates/astro-starlight/README.md +0 -3
- package/templates/astro-starlight/template.toml +0 -4
- package/templates/nextjs/.ai/architecture.md +0 -13
- package/templates/nextjs/.ai/board.md +0 -7
- package/templates/nextjs/.ai/product-spec.md +0 -11
- package/templates/nextjs/.claude/skills/.gitkeep +0 -0
- package/templates/nextjs/.codex/skills/.gitkeep +0 -0
- package/templates/nextjs/AGENTS.md +0 -95
- package/templates/nextjs/CLAUDE.md +0 -3
- package/templates/nextjs/README.md +0 -20
- package/templates/nextjs/app/(app)/home/page.tsx +0 -43
- package/templates/nextjs/app/(app)/home/posts-panel.tsx +0 -83
- package/templates/nextjs/app/(app)/layout.tsx +0 -12
- package/templates/nextjs/app/(auth)/login/page.tsx +0 -97
- package/templates/nextjs/app/globals.css +0 -23
- package/templates/nextjs/app/layout.tsx +0 -20
- package/templates/nextjs/app/page.tsx +0 -39
- package/templates/nextjs/lib/auth-placeholder.ts +0 -21
- package/templates/nextjs/lib/posts-placeholder.ts +0 -30
- package/templates/nextjs/next.config.ts +0 -5
- package/templates/nextjs/package.json +0 -26
- package/templates/nextjs/postcss.config.mjs +0 -7
- package/templates/nextjs/spark.config.json +0 -4
- package/templates/nextjs/template.toml +0 -4
- package/templates/nextjs/tsconfig.json +0 -27
- package/templates/nextjs/types/post.ts +0 -13
- package/templates/one/README.md +0 -5
- package/templates/one/template.toml +0 -4
- package/templates/vite-react/README.md +0 -3
- package/templates/vite-react/template.toml +0 -4
|
@@ -1,85 +0,0 @@
|
|
|
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/presets/docs-site.toml
DELETED
package/presets/lean-saas.toml
DELETED
package/templates/README.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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.
|
|
@@ -1,3 +0,0 @@
|
|
|
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.
|
|
@@ -1,3 +0,0 @@
|
|
|
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
|
|
@@ -1,95 +0,0 @@
|
|
|
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.
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useState, type FormEvent } from 'react';
|
|
4
|
-
import { usePosts } from '@/lib/posts-placeholder';
|
|
5
|
-
|
|
6
|
-
export function PostsPanel() {
|
|
7
|
-
const { posts, createPost } = usePosts();
|
|
8
|
-
const [title, setTitle] = useState('');
|
|
9
|
-
const [body, setBody] = useState('');
|
|
10
|
-
const [pending, setPending] = useState(false);
|
|
11
|
-
|
|
12
|
-
async function onSubmit(event: FormEvent<HTMLFormElement>) {
|
|
13
|
-
event.preventDefault();
|
|
14
|
-
if (!title.trim()) return;
|
|
15
|
-
setPending(true);
|
|
16
|
-
try {
|
|
17
|
-
await createPost({ title: title.trim(), body: body.trim() });
|
|
18
|
-
setTitle('');
|
|
19
|
-
setBody('');
|
|
20
|
-
} finally {
|
|
21
|
-
setPending(false);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div className="mt-3 space-y-4">
|
|
27
|
-
<form
|
|
28
|
-
onSubmit={onSubmit}
|
|
29
|
-
className="rounded-xl border border-slate-200 bg-white p-4 shadow-sm"
|
|
30
|
-
>
|
|
31
|
-
<input
|
|
32
|
-
value={title}
|
|
33
|
-
onChange={(e) => setTitle(e.target.value)}
|
|
34
|
-
placeholder="Post title"
|
|
35
|
-
className="block w-full rounded-md border border-slate-300 px-3 py-2 text-sm placeholder:text-slate-400 focus:border-slate-900 focus:outline-none focus:ring-1 focus:ring-slate-900"
|
|
36
|
-
/>
|
|
37
|
-
<textarea
|
|
38
|
-
value={body}
|
|
39
|
-
onChange={(e) => setBody(e.target.value)}
|
|
40
|
-
placeholder="Write something…"
|
|
41
|
-
rows={2}
|
|
42
|
-
className="mt-2 block w-full rounded-md border border-slate-300 px-3 py-2 text-sm placeholder:text-slate-400 focus:border-slate-900 focus:outline-none focus:ring-1 focus:ring-slate-900"
|
|
43
|
-
/>
|
|
44
|
-
<div className="mt-3 flex items-center justify-end">
|
|
45
|
-
<button
|
|
46
|
-
type="submit"
|
|
47
|
-
disabled={pending || !title.trim()}
|
|
48
|
-
className="inline-flex items-center justify-center rounded-md bg-slate-900 px-4 py-1.5 text-sm font-medium text-white shadow-sm transition hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-50"
|
|
49
|
-
>
|
|
50
|
-
{pending ? 'Posting…' : 'Post'}
|
|
51
|
-
</button>
|
|
52
|
-
</div>
|
|
53
|
-
</form>
|
|
54
|
-
|
|
55
|
-
{posts.length === 0 ? (
|
|
56
|
-
<div className="rounded-xl border border-dashed border-slate-300 bg-white/60 px-4 py-8 text-center text-sm text-slate-500">
|
|
57
|
-
No posts yet. Install the{' '}
|
|
58
|
-
<code className="rounded bg-slate-100 px-1">sync-zero</code> pack to
|
|
59
|
-
persist and sync posts in real time.
|
|
60
|
-
</div>
|
|
61
|
-
) : (
|
|
62
|
-
<ul className="space-y-2">
|
|
63
|
-
{posts.map((post) => (
|
|
64
|
-
<li
|
|
65
|
-
key={post.id}
|
|
66
|
-
className="rounded-xl border border-slate-200 bg-white p-4 shadow-sm"
|
|
67
|
-
>
|
|
68
|
-
<h3 className="text-sm font-semibold text-slate-900">
|
|
69
|
-
{post.title}
|
|
70
|
-
</h3>
|
|
71
|
-
{post.body && (
|
|
72
|
-
<p className="mt-1 text-sm text-slate-600">{post.body}</p>
|
|
73
|
-
)}
|
|
74
|
-
<p className="mt-2 text-xs text-slate-400">
|
|
75
|
-
{post.createdAt.toLocaleString()}
|
|
76
|
-
</p>
|
|
77
|
-
</li>
|
|
78
|
-
))}
|
|
79
|
-
</ul>
|
|
80
|
-
)}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
// Placeholder authed-route layout.
|
|
4
|
-
//
|
|
5
|
-
// The `auth-better-auth` pack will replace this with a server-side guard that
|
|
6
|
-
// calls `getSessionUser()` and `redirect('/login')` when there is no session.
|
|
7
|
-
// Until then this just renders children so the scaffold compiles and runs.
|
|
8
|
-
export default function AppLayout({ children }: { children: ReactNode }) {
|
|
9
|
-
return (
|
|
10
|
-
<div className="min-h-screen bg-slate-50 text-slate-900">{children}</div>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import Link from 'next/link';
|
|
2
|
-
|
|
3
|
-
// NOTE: no auth wired yet. The `action` and the GitHub button are placeholders.
|
|
4
|
-
// The `auth-better-auth` pack will:
|
|
5
|
-
// - replace `action="/api/auth/sign-in"` with the real route handler path
|
|
6
|
-
// - replace the GitHub button's form with a real OAuth start endpoint
|
|
7
|
-
// - add `app/api/auth/[...all]/route.ts` and `lib/auth.ts`
|
|
8
|
-
export default function LoginPage() {
|
|
9
|
-
return (
|
|
10
|
-
<main className="min-h-screen flex items-center justify-center bg-slate-50 px-6 py-16">
|
|
11
|
-
<div className="w-full max-w-sm">
|
|
12
|
-
<div className="mb-8 text-center">
|
|
13
|
-
<h1 className="text-2xl font-semibold tracking-tight text-slate-900">
|
|
14
|
-
Welcome back
|
|
15
|
-
</h1>
|
|
16
|
-
<p className="mt-1 text-sm text-slate-600">
|
|
17
|
-
Sign in to continue to your workspace.
|
|
18
|
-
</p>
|
|
19
|
-
</div>
|
|
20
|
-
<div className="rounded-xl border border-slate-200 bg-white p-6 shadow-sm">
|
|
21
|
-
<form action="/api/auth/sign-in" method="post" className="space-y-4">
|
|
22
|
-
<div>
|
|
23
|
-
<label
|
|
24
|
-
htmlFor="email"
|
|
25
|
-
className="block text-xs font-medium text-slate-700"
|
|
26
|
-
>
|
|
27
|
-
Email
|
|
28
|
-
</label>
|
|
29
|
-
<input
|
|
30
|
-
id="email"
|
|
31
|
-
name="email"
|
|
32
|
-
type="email"
|
|
33
|
-
autoComplete="email"
|
|
34
|
-
required
|
|
35
|
-
className="mt-1 block w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 shadow-sm placeholder:text-slate-400 focus:border-slate-900 focus:outline-none focus:ring-1 focus:ring-slate-900"
|
|
36
|
-
placeholder="you@example.com"
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
<div>
|
|
40
|
-
<label
|
|
41
|
-
htmlFor="password"
|
|
42
|
-
className="block text-xs font-medium text-slate-700"
|
|
43
|
-
>
|
|
44
|
-
Password
|
|
45
|
-
</label>
|
|
46
|
-
<input
|
|
47
|
-
id="password"
|
|
48
|
-
name="password"
|
|
49
|
-
type="password"
|
|
50
|
-
autoComplete="current-password"
|
|
51
|
-
required
|
|
52
|
-
className="mt-1 block w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 shadow-sm placeholder:text-slate-400 focus:border-slate-900 focus:outline-none focus:ring-1 focus:ring-slate-900"
|
|
53
|
-
placeholder="••••••••"
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
<button
|
|
57
|
-
type="submit"
|
|
58
|
-
className="w-full rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-slate-900 focus:ring-offset-2"
|
|
59
|
-
>
|
|
60
|
-
Sign in
|
|
61
|
-
</button>
|
|
62
|
-
</form>
|
|
63
|
-
<div className="relative my-5">
|
|
64
|
-
<div className="absolute inset-0 flex items-center">
|
|
65
|
-
<div className="w-full border-t border-slate-200" />
|
|
66
|
-
</div>
|
|
67
|
-
<div className="relative flex justify-center text-xs uppercase">
|
|
68
|
-
<span className="bg-white px-2 text-slate-500">or</span>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<form action="/api/auth/sign-in/github" method="post">
|
|
72
|
-
<button
|
|
73
|
-
type="submit"
|
|
74
|
-
className="inline-flex w-full items-center justify-center gap-2 rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-800 shadow-sm transition hover:bg-slate-50"
|
|
75
|
-
>
|
|
76
|
-
<svg
|
|
77
|
-
aria-hidden="true"
|
|
78
|
-
viewBox="0 0 24 24"
|
|
79
|
-
className="h-4 w-4"
|
|
80
|
-
fill="currentColor"
|
|
81
|
-
>
|
|
82
|
-
<path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.37-3.87-1.37-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11 11 0 015.79 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.58.23 2.75.12 3.04.74.81 1.19 1.84 1.19 3.1 0 4.43-2.69 5.41-5.25 5.69.41.36.78 1.06.78 2.14v3.17c0 .31.21.68.8.56 4.57-1.52 7.86-5.83 7.86-10.91C23.5 5.65 18.35.5 12 .5z" />
|
|
83
|
-
</svg>
|
|
84
|
-
Continue with GitHub
|
|
85
|
-
</button>
|
|
86
|
-
</form>
|
|
87
|
-
</div>
|
|
88
|
-
<p className="mt-6 text-center text-xs text-slate-500">
|
|
89
|
-
Don't have an account?{' '}
|
|
90
|
-
<Link href="/" className="font-medium text-slate-900 hover:underline">
|
|
91
|
-
Back home
|
|
92
|
-
</Link>
|
|
93
|
-
</p>
|
|
94
|
-
</div>
|
|
95
|
-
</main>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
color-scheme: light;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
html,
|
|
8
|
-
body {
|
|
9
|
-
height: 100%;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
body {
|
|
13
|
-
font-family:
|
|
14
|
-
ui-sans-serif,
|
|
15
|
-
system-ui,
|
|
16
|
-
-apple-system,
|
|
17
|
-
'Segoe UI',
|
|
18
|
-
Roboto,
|
|
19
|
-
sans-serif;
|
|
20
|
-
background-color: #f8fafc;
|
|
21
|
-
color: #0f172a;
|
|
22
|
-
line-height: 1.5;
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import './globals.css';
|
|
4
|
-
|
|
5
|
-
export const metadata: Metadata = {
|
|
6
|
-
title: 'Spark App',
|
|
7
|
-
description: 'Minimal Next.js scaffold for spark projects.',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default function RootLayout({
|
|
11
|
-
children,
|
|
12
|
-
}: Readonly<{
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
}>) {
|
|
15
|
-
return (
|
|
16
|
-
<html lang="en">
|
|
17
|
-
<body>{children}</body>
|
|
18
|
-
</html>
|
|
19
|
-
);
|
|
20
|
-
}
|