You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scaffold:
- Add lib template (library + vitest), worker template (Effect Queue)
- TEMPLATES now basic, service, cli, http-server, lib, worker
Lifecycle harness:
- Template selection: round-robin by scenario index (even distribution)
- Skip bun run dev for http-server and when code is broken
- Run bun run test with expectFailure when code is broken
- Add soft-fail patterns for vitest/test failures
- Extract isCodeCurrentlyBroken to code-broken.ts with tests
- Output checks, list parsing, scaffold-validate, report-summary modules and tests
ep-cli:
- PatternNotFoundError for ep show when pattern not found; exit non-zero
- Login/auth docs and EP_AUTH_URL support
API server and docs updates.
Made-with: Cursor
The scaffold script creates a new TypeScript/Effect project with a chosen template and optionally installs Effect Patterns rules for AI tools (Cursor, VS Code, Windsurf, Agents). Run it from the **Effect-Patterns repository root**.
4
+
5
+
**Quick start:**
6
+
7
+
```bash
8
+
bun run scaffold my-app --template service
9
+
```
10
+
11
+
---
12
+
13
+
## Prerequisites
14
+
15
+
-**Bun** — used to run the script and to install dependencies in the new project
16
+
-**Git** — the script runs `git init` and an initial commit
17
+
-**Effect Patterns repo** — run the command from the repo root (where `package.json` and `scripts/` live)
18
+
19
+
Rule installation (`ep install add --tool <tool>`) may call the Effect Patterns API. If the API is unavailable or not configured, the script continues and reports which tools failed; you can retry later from the new project directory.
20
+
21
+
---
22
+
23
+
## How to run
24
+
25
+
**Command:**`bun run scaffold` (defined in the root `package.json`).
26
+
27
+
### Interactive mode
28
+
29
+
No arguments: the script prompts for project name, template, and tools.
30
+
31
+
```bash
32
+
bun run scaffold
33
+
```
34
+
35
+
### Non-interactive mode
36
+
37
+
Pass the project name; optionally pass `--template` and one or more `--tool` options.
38
+
39
+
```bash
40
+
bun run scaffold my-app
41
+
```
42
+
43
+
- Uses the **basic** template and installs rules for **all** tools.
44
+
45
+
```bash
46
+
bun run scaffold my-app --template service
47
+
```
48
+
49
+
- Uses the **service** template and installs rules for all tools.
50
+
51
+
```bash
52
+
bun run scaffold my-app --template cli --tool cursor --tool agents
53
+
```
54
+
55
+
- Uses the **cli** template and installs rules only for Cursor and Agents.
If you provide a project name but omit `--tool`, the script installs rules for all four tools.
67
+
68
+
---
69
+
70
+
## Templates
71
+
72
+
| Template | Description |
73
+
|----------|-------------|
74
+
|**basic**| Minimal Effect app: `Console.log` and `Effect.runPromise`. |
75
+
|**service**| Effect.Service example (Greeter) plus a Vitest test. |
76
+
|**cli**|@effect/cli app with a `hello` subcommand. |
77
+
|**http-server**|@effect/platform HTTP server with a `/health` route. |
78
+
79
+
Each template adds the right dependencies and starter files under `src/`.
80
+
81
+
---
82
+
83
+
## Output location and contents
84
+
85
+
**Directory:** Projects are created under `$HOME/Projects/TestRepos/<project-name>` (e.g. `~/Projects/TestRepos/my-app`). There is no option to change this path.
6. For each selected tool, run `ep install add --tool <tool>` (using the repo’s ep-cli)
95
+
96
+
If `ep install add` fails for a tool (e.g. API unavailable), the script prints a warning and continues. The final summary includes a retry command for failed tools.
97
+
98
+
---
99
+
100
+
## Environment variables
101
+
102
+
| Variable | Purpose |
103
+
|----------|---------|
104
+
|**HOME**| Used to build the output path `$HOME/Projects/TestRepos/<name>`. If unset, the script falls back to `/Users/paul`. |
105
+
|**EFFECT_PATTERNS_API_URL**| If set, passed to the `ep install add` subprocess (e.g. for a local or staging API). Rule installation may fail if the API is unreachable or not configured. |
106
+
107
+
---
108
+
109
+
## Troubleshooting
110
+
111
+
**"Directory already exists"** — The script will not overwrite an existing directory. Use a different project name or remove the existing directory.
112
+
113
+
**"Unknown template" / "Unknown tool"** — Use only the supported values:
**ep install failed** — The script prints a warning and a retry command, e.g. `cd <projectDir> && bun run <ep-cli-entry> install add --tool <tool>`. You may need to configure an API key or `EFFECT_PATTERNS_API_URL`; see the [ep-cli README](../../packages/ep-cli/README.md) and project [MCP_CONFIG.md](../../MCP_CONFIG.md) for API and key setup.
0 commit comments