Justfile Author
Overview
Generate a justfile (and matching Makefile + tx-start helpers) following Nick's
project conventions: zsh shell, DRY parameterized helpers, svc-* tmux service
family wired through cortex tmux, and standard quality recipes
(build, lint, dev, test, typecheck, ci, clean).
When to use this skill
- A repo lacks a justfile and the user wants one.
- A justfile exists but is missing the svc-* family, the Makefile wrapper,
or the standard quality recipes.
- The user asks to add a new service window (e.g.,
svc-worker) to an
existing justfile.
- The user asks to refactor a justfile to be more DRY or to align with
the conventions captured here.
Skip this skill when:
- Editing third-party / open-source justfiles (their conventions own).
- The user has explicitly chosen
make, npm scripts, or another runner
for this project.
Reference example
/Users/nick/Developer/Facet/justfile and /Users/nick/Developer/Facet/Makefile
are the canonical reference. When in doubt, mirror their shape.
Workflow
Step 1 — Inspect the project
Before writing anything, read the project to determine:
- Project slug — derive from the repo directory basename.
- Stack and package manager — what language(s), which lockfile.
- Service catalog — what long-running processes the dev runs locally.
- Existing tooling — what build/test/lint commands the project
already uses (do not invent new ones).
- Runtime activation needs — nvm, asdf, uv, etc.
Consult references/inspection-checklist.md for the full detection table
and the exact slug-normalization rules.
Step 2 — Choose the recipe block
Pull the right language reference into context:
| Stack |
Reference |
| Node |
references/recipes-node.md |
| Rust |
references/recipes-rust.md |
| Python |
references/recipes-python.md |
| Go |
references/recipes-go.md |
For polyglot repos, read multiple references and combine. For stacks not
listed, mirror the structure of the closest listed stack and substitute
the native commands.
Step 3 — Choose the service catalog
Consult references/service-patterns.md for the full svc-* surface area
and the rules for when to add a new service window. Every detected
service gets a parallel pair of recipes (foreground + svc-) and a
tx-start-<role>.sh wrapper.
Step 4 — Emit the files
Use assets/justfile.tmpl, assets/Makefile.tmpl, and
assets/tx-start.sh.tmpl as the structural starting points. These are
not literal templates — read them, then write the project's actual files
with the inspection results substituted and the irrelevant scaffolding
deleted.
Required substitutions in justfile.tmpl:
| Placeholder |
Value |
{{PROJECT_TITLE}} |
Human-readable project name (e.g., Facet). |
{{PROJECT_SLUG}} |
Normalized slug (lowercase, underscores). |
{{INSTALL_CMD}} |
From the language recipe block. |
{{DEV_CMD}} |
From the language recipe block. |
{{BUILD_CMD}} |
From the language recipe block. |
{{TYPECHECK_CMD}} |
From the language recipe block. |
{{LINT_CMD}} |
From the language recipe block (omit if not configured). |
{{TEST_CMD}} |
From the language recipe block. |
{{TEST_FILE_CMD}} |
From the language recipe block. |
{{TEST_WATCH_CMD}} |
From the language recipe block. |
{{CLEAN_CMD}} |
Project-specific build artifacts. |
In Makefile.tmpl, also keep the .PHONY list and the passthrough
recipe block in sync with the recipes actually emitted in the justfile —
the catch-all rule pattern is intentionally NOT used; an explicit list
keeps make help honest.
For each service, copy tx-start.sh.tmpl to
scripts/tx-start-<role>.sh, uncomment the relevant runtime activation
block, and replace {{SERVICE_CMD}} with the actual launch command.
Make the script executable: chmod +x scripts/tx-start-<role>.sh.
Step 5 — Validate
After writing the files, run these checks before declaring completion:
just --list — must succeed and show every recipe.
make help — must show the passthrough list.
- For each
svc-<role> recipe: confirm a matching tx-start-<role>.sh
exists, is executable, and has the right activation block uncommented.
just ci — should be runnable end-to-end (don't actually run it
unless the user wants to; just confirm the deps resolve).
- Confirm
set shell := ["zsh", "-c"] is present and that no recipe
uses bash-specific syntax that would break under zsh.
If any check fails, fix it before reporting done.
Style rules (non-negotiable)
These rules apply to every justfile produced by this skill:
- Header: comment block with project name, install hint, usage hint.
- Settings:
set dotenv-load := false and set shell := ["zsh", "-c"].
- Project identity: a
project justfile variable holding the
normalized slug, used to derive svc_session (via env("TMUX_SESSION", project)) and every tmux_<role>_window variable. Do NOT hardcode the
session name as a string literal — go through project so renaming the
project means changing one line.
- Default recipe:
default: @just --list.
- DRY service recipes: every
svc-<role> delegates to _svc-start;
every svc-stop-<role> delegates to _svc-stop. Do not inline the
tmux logic into individual service recipes.
- Standard targets:
install, dev, build, typecheck, lint,
test, test-file, test-watch, ci, clean — emit every one that
the project's tooling supports; omit the rest with no placeholder.
ci recipe: composes the static-check recipes — at minimum
typecheck, lint, test (add fmt-check for Rust/Go projects).
- Comments: one short line per recipe explaining intent. Skip if the
recipe name is self-explanatory (e.g.,
clean:).
Style rules for the Makefile
SHELL := /bin/bash and JUST_DEST ?= $(HOME)/bin.
default: help showing every passthrough target.
- Single block listing every passthrough recipe;
read -p prompt to
install just on first use.
test-file (and any other arg-bearing recipe) gets its own block that
forwards FILE=... as a positional just arg.
install-just cascade: brew → cargo → snap → official curl script,
with JUST_DEST PATH advice if falling back to the script.
Style rules for tx-start scripts
#!/usr/bin/env bash and set -euo pipefail.
- Resolve
ROOT_DIR from ${BASH_SOURCE[0]} so the script works from
any cwd.
- Activate the runtime if the project requires a specific version
(otherwise leave the block commented and let the inherited shell win).
- Set env defaults via
${VAR:-default} so the parent shell or .env
always wins.
- End with
exec <command> (not just <command>) so the wrapper PID
becomes the service PID.
Anti-patterns to avoid
- Using
bash as the just shell. The project standard is zsh; use
set shell := ["zsh", "-c"].
- Hardcoding the tmux session name as a string. Go through
project.
- Inlining the tmux logic in every
svc-* recipe. Use the _svc-start
helper instead.
- Calling
tmux capture-pane, tmux kill-window, etc. directly. Always
go through cortex tmux.
- Putting nvm/asdf activation in the justfile. That belongs in the
tx-start-*.sh wrapper.
- Adding a
lint recipe when the project has no linter configured. Omit
the recipe entirely; do not emit one that will fail.
- Using
&& chains where dependent recipes would be clearer (e.g.,
ci: typecheck lint test, not ci: && just typecheck && just lint && just test).
- Catch-all
%: rules in the Makefile. Keep the passthrough list
explicit so make help stays an honest reference.
Resources
assets/justfile.tmpl — canonical justfile structure with svc-* family.
assets/Makefile.tmpl — passthrough wrapper with install-just cascade.
assets/tx-start.sh.tmpl — service launch script pattern.
references/inspection-checklist.md — slug rules, stack detection,
service catalog detection.
references/recipes-node.md — pnpm/npm/yarn/bun command map.
references/recipes-rust.md — cargo recipes.
references/recipes-python.md — uv/poetry/pip recipes.
references/recipes-go.md — go recipes.
references/service-patterns.md — svc-* family, cortex tmux CLI,
internal helper pattern.
1---2name: justfile-author3description: Use this skill when authoring or refactoring a justfile (and matching Makefile wrapper) for one of Nick's projects. Triggers when the user asks to "create a justfile", "add a justfile to this project", "set up just for…", "wire up tmux services", "scaffold the task runner", or when working in a repo that lacks a justfile but obviously needs one. Produces a justfile using zsh syntax with the standard svc-* tmux service family, the canonical build/lint/dev/test recipes, a thin Makefile passthrough wrapper that auto-installs just, and per-service tx-start.sh helpers. Do NOT use for editing existing third-party justfiles or non-Nick projects unless the user explicitly opts in.4---5
6# Justfile Author
7
8## Overview
9
10Generate a justfile (and matching Makefile + tx-start helpers) following Nick's
11project conventions: zsh shell, DRY parameterized helpers, svc-* tmux service
12family wired through `cortex tmux`, and standard quality recipes
13(`build`, `lint`, `dev`, `test`, `typecheck`, `ci`, `clean`).
14
15## When to use this skill
16
17- A repo lacks a justfile and the user wants one.
18- A justfile exists but is missing the svc-* family, the Makefile wrapper,
19 or the standard quality recipes.
20- The user asks to add a new service window (e.g., `svc-worker`) to an
21 existing justfile.
22- The user asks to refactor a justfile to be more DRY or to align with
23 the conventions captured here.
24
25Skip this skill when:
26
27- Editing third-party / open-source justfiles (their conventions own).
28- The user has explicitly chosen `make`, `npm scripts`, or another runner
29 for this project.
30
31## Reference example
32
33`/Users/nick/Developer/Facet/justfile` and `/Users/nick/Developer/Facet/Makefile`
34are the canonical reference. When in doubt, mirror their shape.
35
36## Workflow
37
38### Step 1 — Inspect the project
39
40Before writing anything, read the project to determine:
41
421. **Project slug** — derive from the repo directory basename.
432. **Stack and package manager** — what language(s), which lockfile.
443. **Service catalog** — what long-running processes the dev runs locally.
454. **Existing tooling** — what build/test/lint commands the project
46 already uses (do not invent new ones).
475. **Runtime activation needs** — nvm, asdf, uv, etc.
48
49Consult `references/inspection-checklist.md` for the full detection table
50and the exact slug-normalization rules.
51
52### Step 2 — Choose the recipe block
53
54Pull the right language reference into context:
55
56| Stack | Reference |
57| ------ | ----------------------------- |
58| Node | `references/recipes-node.md` |
59| Rust | `references/recipes-rust.md` |
60| Python | `references/recipes-python.md`|
61| Go | `references/recipes-go.md` |
62
63For polyglot repos, read multiple references and combine. For stacks not
64listed, mirror the structure of the closest listed stack and substitute
65the native commands.
66
67### Step 3 — Choose the service catalog
68
69Consult `references/service-patterns.md` for the full svc-* surface area
70and the rules for when to add a new service window. Every detected
71service gets a parallel pair of recipes (foreground + svc-) and a
72`tx-start-<role>.sh` wrapper.
73
74### Step 4 — Emit the files
75
76Use `assets/justfile.tmpl`, `assets/Makefile.tmpl`, and
77`assets/tx-start.sh.tmpl` as the structural starting points. These are
78not literal templates — read them, then write the project's actual files
79with the inspection results substituted and the irrelevant scaffolding
80deleted.
81
82Required substitutions in `justfile.tmpl`:
83
84| Placeholder | Value |
85| ------------------- | ------------------------------------------------------ |
86| `{{PROJECT_TITLE}}` | Human-readable project name (e.g., `Facet`). |
87| `{{PROJECT_SLUG}}` | Normalized slug (lowercase, underscores). |
88| `{{INSTALL_CMD}}` | From the language recipe block. |
89| `{{DEV_CMD}}` | From the language recipe block. |
90| `{{BUILD_CMD}}` | From the language recipe block. |
91| `{{TYPECHECK_CMD}}` | From the language recipe block. |
92| `{{LINT_CMD}}` | From the language recipe block (omit if not configured).|
93| `{{TEST_CMD}}` | From the language recipe block. |
94| `{{TEST_FILE_CMD}}` | From the language recipe block. |
95| `{{TEST_WATCH_CMD}}`| From the language recipe block. |
96| `{{CLEAN_CMD}}` | Project-specific build artifacts. |
97
98In `Makefile.tmpl`, also keep the `.PHONY` list and the passthrough
99recipe block in sync with the recipes actually emitted in the justfile —
100the catch-all rule pattern is intentionally NOT used; an explicit list
101keeps `make help` honest.
102
103For each service, copy `tx-start.sh.tmpl` to
104`scripts/tx-start-<role>.sh`, uncomment the relevant runtime activation
105block, and replace `{{SERVICE_CMD}}` with the actual launch command.
106Make the script executable: `chmod +x scripts/tx-start-<role>.sh`.
107
108### Step 5 — Validate
109
110After writing the files, run these checks before declaring completion:
111
1121. `just --list` — must succeed and show every recipe.
1132. `make help` — must show the passthrough list.
1143. For each `svc-<role>` recipe: confirm a matching `tx-start-<role>.sh`
115 exists, is executable, and has the right activation block uncommented.
1164. `just ci` — should be runnable end-to-end (don't actually run it
117 unless the user wants to; just confirm the deps resolve).
1185. Confirm `set shell := ["zsh", "-c"]` is present and that no recipe
119 uses bash-specific syntax that would break under zsh.
120
121If any check fails, fix it before reporting done.
122
123## Style rules (non-negotiable)
124
125These rules apply to every justfile produced by this skill:
126
127- **Header**: comment block with project name, install hint, usage hint.
128- **Settings**: `set dotenv-load := false` and `set shell := ["zsh", "-c"]`.
129- **Project identity**: a `project` justfile variable holding the
130 normalized slug, used to derive `svc_session` (via `env("TMUX_SESSION",
131 project)`) and every `tmux_<role>_window` variable. Do NOT hardcode the
132 session name as a string literal — go through `project` so renaming the
133 project means changing one line.
134- **Default recipe**: `default: @just --list`.
135- **DRY service recipes**: every `svc-<role>` delegates to `_svc-start`;
136 every `svc-stop-<role>` delegates to `_svc-stop`. Do not inline the
137 tmux logic into individual service recipes.
138- **Standard targets**: `install`, `dev`, `build`, `typecheck`, `lint`,
139 `test`, `test-file`, `test-watch`, `ci`, `clean` — emit every one that
140 the project's tooling supports; omit the rest with no placeholder.
141- **`ci` recipe**: composes the static-check recipes — at minimum
142 `typecheck`, `lint`, `test` (add `fmt-check` for Rust/Go projects).
143- **Comments**: one short line per recipe explaining intent. Skip if the
144 recipe name is self-explanatory (e.g., `clean:`).
145
146## Style rules for the Makefile
147
148- `SHELL := /bin/bash` and `JUST_DEST ?= $(HOME)/bin`.
149- `default: help` showing every passthrough target.
150- Single block listing every passthrough recipe; `read -p` prompt to
151 install just on first use.
152- `test-file` (and any other arg-bearing recipe) gets its own block that
153 forwards `FILE=...` as a positional just arg.
154- `install-just` cascade: brew → cargo → snap → official curl script,
155 with `JUST_DEST` PATH advice if falling back to the script.
156
157## Style rules for tx-start scripts
158
159- `#!/usr/bin/env bash` and `set -euo pipefail`.
160- Resolve `ROOT_DIR` from `${BASH_SOURCE[0]}` so the script works from
161 any cwd.
162- Activate the runtime if the project requires a specific version
163 (otherwise leave the block commented and let the inherited shell win).
164- Set env defaults via `${VAR:-default}` so the parent shell or `.env`
165 always wins.
166- End with `exec <command>` (not just `<command>`) so the wrapper PID
167 becomes the service PID.
168
169## Anti-patterns to avoid
170
171- Using `bash` as the just shell. The project standard is zsh; use
172 `set shell := ["zsh", "-c"]`.
173- Hardcoding the tmux session name as a string. Go through `project`.
174- Inlining the tmux logic in every `svc-*` recipe. Use the `_svc-start`
175 helper instead.
176- Calling `tmux capture-pane`, `tmux kill-window`, etc. directly. Always
177 go through `cortex tmux`.
178- Putting nvm/asdf activation in the justfile. That belongs in the
179 `tx-start-*.sh` wrapper.
180- Adding a `lint` recipe when the project has no linter configured. Omit
181 the recipe entirely; do not emit one that will fail.
182- Using `&&` chains where dependent recipes would be clearer (e.g.,
183 `ci: typecheck lint test`, not `ci: && just typecheck && just lint && just test`).
184- Catch-all `%:` rules in the Makefile. Keep the passthrough list
185 explicit so `make help` stays an honest reference.
186
187## Resources
188
189- `assets/justfile.tmpl` — canonical justfile structure with svc-* family.
190- `assets/Makefile.tmpl` — passthrough wrapper with install-just cascade.
191- `assets/tx-start.sh.tmpl` — service launch script pattern.
192- `references/inspection-checklist.md` — slug rules, stack detection,
193 service catalog detection.
194- `references/recipes-node.md` — pnpm/npm/yarn/bun command map.
195- `references/recipes-rust.md` — cargo recipes.
196- `references/recipes-python.md` — uv/poetry/pip recipes.
197- `references/recipes-go.md` — go recipes.
198- `references/service-patterns.md` — svc-* family, cortex tmux CLI,
199 internal helper pattern.