create-reactor 0.1.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.
@@ -0,0 +1,80 @@
1
+ // AI-native development: AGENTS.md + CLAUDE.md so AI coding assistants
2
+ // (Claude Code, Cursor, Copilot, Windsurf, ...) understand the project instantly.
3
+ import { stackList } from "./app.mjs";
4
+
5
+ /** AGENTS.md — the emerging cross-tool standard for AI assistant instructions. */
6
+ export function agentsMd(c) {
7
+ const stack = stackList(c);
8
+
9
+ const commands = [
10
+ [`${c.pmRunLabel("dev")}`, c.backend === "convex" ? "start Vite + Convex together" : c.backend === "hono" ? "start Vite + the tRPC server together" : "start the dev server"],
11
+ [`${c.pmRunLabel("build")}`, "production build + full typecheck (run this to verify changes)"],
12
+ [`${c.pmRunLabel("lint")}`, "lint the codebase"],
13
+ ];
14
+ if (c.extras.includes("testing")) commands.push([`${c.pmRunLabel("test")}`, "run unit/component tests (Vitest)"]);
15
+ if (c.extras.includes("e2e")) commands.push([`${c.pmRunLabel("test:e2e")}`, "run Playwright E2E tests (needs browsers installed)"]);
16
+ if (c.extras.includes("fallow"))
17
+ commands.push([`${c.pmRunLabel("quality:audit")}`, "Fallow changed-code audit: dead code, duplication, complexity (run before finishing a task; use --format json for structured findings)"]);
18
+ if (c.orm !== "none") commands.push([`${c.pmRunLabel("db:push")}`, "push schema changes to the database"]);
19
+
20
+ const conventions = [
21
+ "- TypeScript strict mode is on; fix type errors, don't suppress them.",
22
+ "- UI components come from shadcn/ui (`src/components/ui/`) — add new ones with `" + c.pmDlxLabel("shadcn@latest") + " add <component>`, don't hand-write them.",
23
+ "- Styling is Tailwind CSS v4 utility classes; theme tokens are CSS variables defined in `src/index.css`.",
24
+ "- Path alias: `@/` maps to `src/`.",
25
+ ];
26
+ if (c.router === "tanstack") {
27
+ conventions.push("- Routes are file-based in `src/routes/`; `src/routeTree.gen.ts` is generated — never edit it.");
28
+ }
29
+ if (c.backend === "convex") {
30
+ conventions.push("- Backend functions live in `convex/`; `convex/_generated/` is generated by `convex dev` — never edit it.");
31
+ }
32
+ if (c.backend === "hono") {
33
+ conventions.push("- The API lives in `server/router.ts` (tRPC); the frontend gets full type-safety via `src/lib/trpc.ts`.");
34
+ }
35
+ if (c.orm === "drizzle") {
36
+ conventions.push("- Database schema is in `db/schema.ts` (Drizzle); db code is server-side only, never import it in `src/`.");
37
+ }
38
+ if (c.extras.includes("fallow")) {
39
+ conventions.push(
40
+ "- Don't leave dead code behind: after refactors, run `" +
41
+ c.pmRunLabel("quality") +
42
+ "` (Fallow) and clean up unused exports/files/dependencies it reports.",
43
+ );
44
+ }
45
+ if (c.secure) {
46
+ conventions.push(
47
+ "- Supply-chain protection is on: packages must be at least 7 days old to install. If an install fails on a brand-new version, add the package to the exclusion list instead of disabling the protection.",
48
+ );
49
+ }
50
+
51
+ return `# ${c.name} — agent instructions
52
+
53
+ ## Stack
54
+
55
+ ${stack.map((s) => `- ${s}`).join("\n")}
56
+
57
+ ## Commands
58
+
59
+ | Command | Purpose |
60
+ | ------- | ------- |
61
+ ${commands.map(([cmd, why]) => `| \`${cmd}\` | ${why} |`).join("\n")}
62
+
63
+ Always run the build (and tests, if present) after making changes to verify they work.
64
+
65
+ ## Conventions
66
+
67
+ ${conventions.join("\n")}
68
+
69
+ ## Environment
70
+
71
+ Secrets live in \`.env.local\` (client-side, VITE_-prefixed) and \`.env\` (server-side).
72
+ Never commit either file; \`.env.example\` documents what is needed.
73
+ `;
74
+ }
75
+
76
+ /** CLAUDE.md — imports AGENTS.md (Claude Code @-import syntax). */
77
+ export function claudeMd() {
78
+ return `@AGENTS.md
79
+ `;
80
+ }