Skip to content

Commit 75dd10e

Browse files
committed
Add basic claude infrastructure
1 parent 71adf63 commit 75dd10e

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.claude/CLAUDE.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## R package development
2+
3+
### Key commands
4+
5+
```
6+
# To run code
7+
Rscript -e "devtools::load_all(); code"
8+
9+
# To run all tests
10+
Rscript -e "devtools::test()"
11+
12+
# To run tests for R/{name.R}
13+
Rscript -e "devtools::test(filter = '{name}', reporter = 'llm')"
14+
15+
# To document the package
16+
Rscript -e "devtools::document()"
17+
18+
# To check pkgdown documentation
19+
Rscript -e "pkgdown::check_pkgdown()"
20+
21+
# To format code
22+
air format .
23+
```
24+
25+
### Coding
26+
27+
* Always run `air format .` after generating code
28+
* Use the base pipe operator (`|>`) not the magrittr pipe (`%>%`)
29+
* Don't use `_$x` or `_$[["x"]]` since dbplyr must work on R 4.1.
30+
* Use `\() ...` for single-line anonymous functions. For all other cases, use `function() {...}`
31+
32+
### Testing
33+
34+
- Tests for `R/{name}.R` go in `tests/testthat/test-{name}.R`.
35+
- All new code should have an accompanying test.
36+
- If there are existing tests, place new tests next to similar existing tests.
37+
- Strive to keep your tests minimal with few comments.
38+
39+
### Documentation
40+
41+
- Every user-facing function should be exported and have roxygen2 documentation.
42+
- Wrap roxygen comments at 80 characters.
43+
- Internal functions should not have roxygen documentation.
44+
- Whenever you add a new documentation topic, also add the topic to `_pkgdown.yml`.
45+
- Use `pkgdown::check_pkgdown()` to check that all topics are included in the reference index.
46+
47+
### Writing
48+
49+
- Use sentence case for headings.
50+
51+
### Proofreading
52+
53+
If the user asks you to proofread a file, act as an expert proofreader and editor with a deep understanding of clear, engaging, and well-structured writing.
54+
55+
Work paragraph by paragraph, always starting by making a TODO list that includes individual items for each top-level heading.
56+
57+
Fix spelling, grammar, and other minor problems without asking the user. Label any unclear, confusing, or ambiguous sentences with a FIXME comment.
58+
59+
Only report what you have changed.

.claude/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
3+
"permissions": {
4+
"allow": [
5+
"Bash(find:*)",
6+
"Bash(Rscript:*)",
7+
"Bash(rm:*)",
8+
"Bash(air format:*)",
9+
"Edit(R/**)",
10+
"Edit(tests/**)",
11+
"Edit(vignettes/**)",
12+
],
13+
"deny": []
14+
}
15+
}

0 commit comments

Comments
 (0)