@samahlstrom/forge-cli 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.
Files changed (100) hide show
  1. package/README.md +175 -0
  2. package/bin/forge.js +2 -0
  3. package/dist/addons/index.d.ts +25 -0
  4. package/dist/addons/index.js +139 -0
  5. package/dist/addons/index.js.map +1 -0
  6. package/dist/commands/add.d.ts +1 -0
  7. package/dist/commands/add.js +61 -0
  8. package/dist/commands/add.js.map +1 -0
  9. package/dist/commands/doctor.d.ts +1 -0
  10. package/dist/commands/doctor.js +177 -0
  11. package/dist/commands/doctor.js.map +1 -0
  12. package/dist/commands/ingest.d.ts +24 -0
  13. package/dist/commands/ingest.js +316 -0
  14. package/dist/commands/ingest.js.map +1 -0
  15. package/dist/commands/init.d.ts +8 -0
  16. package/dist/commands/init.js +557 -0
  17. package/dist/commands/init.js.map +1 -0
  18. package/dist/commands/remove.d.ts +1 -0
  19. package/dist/commands/remove.js +42 -0
  20. package/dist/commands/remove.js.map +1 -0
  21. package/dist/commands/status.d.ts +1 -0
  22. package/dist/commands/status.js +48 -0
  23. package/dist/commands/status.js.map +1 -0
  24. package/dist/commands/upgrade.d.ts +5 -0
  25. package/dist/commands/upgrade.js +190 -0
  26. package/dist/commands/upgrade.js.map +1 -0
  27. package/dist/detect/features.d.ts +10 -0
  28. package/dist/detect/features.js +33 -0
  29. package/dist/detect/features.js.map +1 -0
  30. package/dist/detect/go.d.ts +3 -0
  31. package/dist/detect/go.js +38 -0
  32. package/dist/detect/go.js.map +1 -0
  33. package/dist/detect/index.d.ts +25 -0
  34. package/dist/detect/index.js +32 -0
  35. package/dist/detect/index.js.map +1 -0
  36. package/dist/detect/node.d.ts +3 -0
  37. package/dist/detect/node.js +99 -0
  38. package/dist/detect/node.js.map +1 -0
  39. package/dist/detect/python.d.ts +3 -0
  40. package/dist/detect/python.js +86 -0
  41. package/dist/detect/python.js.map +1 -0
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +51 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/render/engine.d.ts +8 -0
  46. package/dist/render/engine.js +71 -0
  47. package/dist/render/engine.js.map +1 -0
  48. package/dist/render/merge.d.ts +5 -0
  49. package/dist/render/merge.js +33 -0
  50. package/dist/render/merge.js.map +1 -0
  51. package/dist/utils/fs.d.ts +8 -0
  52. package/dist/utils/fs.js +42 -0
  53. package/dist/utils/fs.js.map +1 -0
  54. package/dist/utils/git.d.ts +3 -0
  55. package/dist/utils/git.js +31 -0
  56. package/dist/utils/git.js.map +1 -0
  57. package/dist/utils/hash.d.ts +8 -0
  58. package/dist/utils/hash.js +22 -0
  59. package/dist/utils/hash.js.map +1 -0
  60. package/dist/utils/yaml.d.ts +3 -0
  61. package/dist/utils/yaml.js +12 -0
  62. package/dist/utils/yaml.js.map +1 -0
  63. package/package.json +53 -0
  64. package/templates/addons/beads-dolt-backend/files/dolt-setup.sh +267 -0
  65. package/templates/addons/beads-dolt-backend/manifest.yaml +13 -0
  66. package/templates/addons/browser-testing/files/browser-smoke.sh +196 -0
  67. package/templates/addons/browser-testing/files/visual-qa.md +103 -0
  68. package/templates/addons/browser-testing/manifest.yaml +20 -0
  69. package/templates/addons/compliance-hipaa/files/hipaa-checks.sh +184 -0
  70. package/templates/addons/compliance-hipaa/files/hipaa-context.md +91 -0
  71. package/templates/addons/compliance-hipaa/manifest.yaml +15 -0
  72. package/templates/addons/compliance-soc2/files/soc2-checks.sh +232 -0
  73. package/templates/addons/compliance-soc2/files/soc2-context.md +147 -0
  74. package/templates/addons/compliance-soc2/manifest.yaml +15 -0
  75. package/templates/core/CLAUDE.md.hbs +70 -0
  76. package/templates/core/agents/architect.md.hbs +68 -0
  77. package/templates/core/agents/backend.md.hbs +27 -0
  78. package/templates/core/agents/frontend.md.hbs +25 -0
  79. package/templates/core/agents/quality.md.hbs +40 -0
  80. package/templates/core/agents/security.md.hbs +53 -0
  81. package/templates/core/context/project.md.hbs +60 -0
  82. package/templates/core/forge.yaml.hbs +69 -0
  83. package/templates/core/hooks/post-edit.sh.hbs +8 -0
  84. package/templates/core/hooks/pre-edit.sh.hbs +41 -0
  85. package/templates/core/hooks/session-start.sh.hbs +34 -0
  86. package/templates/core/pipeline/classify.sh.hbs +159 -0
  87. package/templates/core/pipeline/decompose.md.hbs +100 -0
  88. package/templates/core/pipeline/deliver.sh.hbs +171 -0
  89. package/templates/core/pipeline/execute.md.hbs +138 -0
  90. package/templates/core/pipeline/intake.sh.hbs +152 -0
  91. package/templates/core/pipeline/orchestrator.sh.hbs +361 -0
  92. package/templates/core/pipeline/verify.sh.hbs +160 -0
  93. package/templates/core/settings.json.hbs +55 -0
  94. package/templates/core/skill-creator.md.hbs +151 -0
  95. package/templates/core/skill-deliver.md.hbs +46 -0
  96. package/templates/core/skill-ingest.md.hbs +245 -0
  97. package/templates/presets/go/stack.md.hbs +133 -0
  98. package/templates/presets/python-fastapi/stack.md.hbs +101 -0
  99. package/templates/presets/react-next-ts/stack.md.hbs +77 -0
  100. package/templates/presets/sveltekit-ts/stack.md.hbs +116 -0
@@ -0,0 +1,77 @@
1
+ # Stack Context: Next.js + React + TypeScript
2
+
3
+ ## Tech Stack
4
+
5
+ - **Framework**: Next.js 14+ (App Router)
6
+ - **Language**: TypeScript (strict mode)
7
+ - **UI**: React 19
8
+ - **Styling**: Tailwind CSS
9
+ - **Testing**: Vitest or Jest
10
+ - **Linting**: ESLint (next/core-web-vitals)
11
+
12
+ ## Project Structure
13
+
14
+ ```
15
+ app/
16
+ layout.tsx # Root layout
17
+ page.tsx # Home page
18
+ (routes)/ # Route groups
19
+ dashboard/
20
+ page.tsx # Dashboard page
21
+ loading.tsx # Loading UI
22
+ error.tsx # Error boundary
23
+ api/ # API routes (Route Handlers)
24
+ endpoint/
25
+ route.ts
26
+ src/
27
+ components/ # Reusable UI components
28
+ lib/ # Utilities and shared code
29
+ hooks/ # Custom React hooks
30
+ types/ # TypeScript types
31
+ services/ # Business logic / data access
32
+ ```
33
+
34
+ ## Key Patterns
35
+
36
+ ### Server vs Client Components
37
+ - **Default is Server Component** — no "use client" directive
38
+ - Add `"use client"` only when you need: useState, useEffect, event handlers, browser APIs
39
+ - Keep client components as small as possible — push state to leaves
40
+ - Never pass functions as props from server to client components
41
+
42
+ ### Data Fetching
43
+ - Fetch data in Server Components using `async/await`
44
+ - Use `fetch()` with Next.js caching: `fetch(url, { next: { revalidate: 60 } })`
45
+ - For mutations, use Server Actions (`"use server"`)
46
+ - Never fetch in client components if a Server Component can do it
47
+
48
+ ### API Routes (Route Handlers)
49
+ - File: `app/api/<path>/route.ts`
50
+ - Export named functions: `GET`, `POST`, `PUT`, `DELETE`
51
+ - Always validate input with Zod or similar
52
+ - Return `NextResponse.json()` with proper status codes
53
+
54
+ ### Server Actions
55
+ - Define with `"use server"` directive
56
+ - Use for form submissions and mutations
57
+ - Always validate input — they're public endpoints
58
+ - Return typed results, not just void
59
+
60
+ ### Metadata
61
+ - Export `metadata` object or `generateMetadata` function
62
+ - Include title, description, OpenGraph for all pages
63
+
64
+ ## Anti-Patterns
65
+
66
+ - Never use `any` type
67
+ - Never use `getServerSideProps` / `getStaticProps` (Pages Router patterns)
68
+ - Never mutate state directly — use `setState` or Server Actions
69
+ - Never use `dangerouslySetInnerHTML` without sanitization
70
+ - Never hardcode secrets — use `process.env`
71
+ - Never import server-only code in client components
72
+
73
+ ## Quality Gates
74
+
75
+ - `npx tsc --noEmit` — TypeScript checking
76
+ - `npx next lint` — Next.js ESLint rules
77
+ - `npx vitest run` — Unit tests
@@ -0,0 +1,116 @@
1
+ # Stack Context: SvelteKit + TypeScript
2
+
3
+ ## Tech Stack
4
+
5
+ - **Framework**: SvelteKit 2 with Svelte 5
6
+ - **Language**: TypeScript (strict mode)
7
+ - **Styling**: Tailwind CSS 4
8
+ - **Testing**: Vitest (unit) + Playwright (e2e)
9
+ - **Linting**: ESLint + Prettier
10
+
11
+ ## Code Style
12
+
13
+ - Tabs for indentation
14
+ - Single quotes
15
+ - 100 character line width
16
+ - No semicolons (Prettier default)
17
+
18
+ ## Svelte 5 Rules (CRITICAL)
19
+
20
+ Use Svelte 5 runes exclusively. Never use Svelte 4 reactive syntax.
21
+
22
+ ```svelte
23
+ <!-- CORRECT: Svelte 5 runes -->
24
+ <script lang="ts">
25
+ let count = $state(0);
26
+ let doubled = $derived(count * 2);
27
+ let { data, onSubmit }: Props = $props();
28
+
29
+ $effect(() => {
30
+ console.log('count changed:', count);
31
+ });
32
+ </script>
33
+ ```
34
+
35
+ **Never use**: `export let`, `$:`, `$$props`, `$$restProps`, `createEventDispatcher`
36
+
37
+ ## Project Structure
38
+
39
+ ```
40
+ src/
41
+ routes/ # SvelteKit routes (pages + API)
42
+ +page.svelte # Page component
43
+ +page.server.ts # Server load function
44
+ +page.ts # Universal load function
45
+ +server.ts # API endpoint
46
+ +layout.svelte # Layout component
47
+ lib/
48
+ components/ # Reusable UI components
49
+ server/ # Server-only code (NEVER import on client)
50
+ services/ # Business logic
51
+ state/ # State management (*.svelte.ts files with runes)
52
+ types/ # TypeScript type definitions
53
+ hooks.server.ts # Server hooks (auth, middleware)
54
+ app.css # Global styles
55
+ ```
56
+
57
+ ## Key Patterns
58
+
59
+ ### Server-Only Code
60
+ - All server-only code lives in `src/lib/server/`
61
+ - NEVER import from `$lib/server/` in client components
62
+ - Use `+page.server.ts` for data that requires server access
63
+
64
+ ### Load Functions
65
+ - `+page.server.ts` — server-side only, has access to secrets and DB
66
+ - `+page.ts` — universal, runs on both server and client
67
+ - Return only serializable data from load functions
68
+
69
+ ### API Routes
70
+ - File: `+server.ts` with `RequestHandler` typing
71
+ - Always validate input
72
+ - Always check authentication via `event.locals`
73
+ - Return proper HTTP status codes
74
+
75
+ ### State Management
76
+ - Use `*.svelte.ts` files with `$state()` runes
77
+ - Store files in `src/lib/state/`
78
+ - No global mutable stores — prefer passing state via props
79
+
80
+ ### Component Patterns
81
+
82
+ **Atomic Design Hierarchy:**
83
+ - Atoms → Molecules → Organisms → Templates → Pages
84
+ - Lower levels NEVER fetch data
85
+ - Lower levels NEVER import from higher levels
86
+
87
+ **Required on interactive elements:**
88
+ - `data-testid` attribute for testing
89
+ - Proper semantic HTML (`<button>`, not `<div onclick>`)
90
+ - Accessibility: `aria-label`, keyboard support
91
+
92
+ ### Styling
93
+ - Tailwind CSS 4 classes only — no inline styles, no CSS modules
94
+ - Design tokens: define in `app.css`, use as Tailwind classes
95
+
96
+ ### Z-Index Hierarchy
97
+ - Drawer: z-60
98
+ - Modal: z-52
99
+ - Modal header: z-40
100
+ - Dropdown: z-20
101
+
102
+ ## Anti-Patterns
103
+
104
+ - Never use Svelte 4 reactive syntax (`$:`, `export let`)
105
+ - Never use `<div>` or `<span>` as clickable elements — use `<button>` or `<a>`
106
+ - Never use `any` type
107
+ - Never use `node` type for scripts
108
+ - Never fetch data in atoms, molecules, or organisms
109
+ - Never import higher-level components (organism importing a template)
110
+ - Never import `$lib/server/` code in client files
111
+
112
+ ## Quality Gates
113
+
114
+ - `npm run check` — TypeScript + Svelte type checking
115
+ - `npx vitest run` — Unit tests
116
+ - `npm run lint` — ESLint + Prettier