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
Copy file name to clipboardExpand all lines: .claude/rules/r_targets.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,20 @@ If the general targets scaffolding (`_targets.R`, etc.) does not exist, create
8
8
9
9
## Development workflow
10
10
11
-
Re-run the targets pipeline after any changes: `Rscript -e 'targets::tar_make()'`.
11
+
### After any edit to pipeline code
12
+
13
+
An edit to `_targets.R`, `packages.R`, or any function in `R/` is **not complete** until you have run `Rscript -e 'targets::tar_make()'` and observed it finish without error. This applies regardless of how small the change appears, including:
14
+
15
+
- Renaming a variable or argument
16
+
- Changing a default value
17
+
- Reformatting or moving code between files
18
+
- Edits you believe are "obviously correct"
19
+
20
+
If a full `tar_make()` is too expensive (e.g. hits external APIs), scope it with `tar_make(names = c(...))` to the affected targets, but still run it. Never substitute reasoning ("the change is trivial") for execution.
21
+
22
+
If you didn't run it, say so explicitly in your summary: *"I did not run `tar_make()` because …"* — don't let the omission go unmentioned.
23
+
24
+
### Inspecting targets
12
25
13
26
To inspect targets interactively or in ad hoc scripts, first call `targets::tar_load_globals()` to load all packages and functions, then use `tar_load()` or `tar_read()` to access built targets.
0 commit comments