Skip to content

Commit 596b787

Browse files
authored
File per operation (#77)
* Deal with tags better. I started this PR quite a while ago. I'm creating this draft to make it easier to visually compare this to the existing code. * Handle user agent purely in nectar. * Clean up. * New templates (in progress). Update templates to match current slackapi package. * Push to finish this eternal PR. * Commit everything. I want to move the repo. * Tweaks to talk. * nectar::stabilize_string() no longer exists This is in a really bad state, ugh! * roxygen2 8.0 * Actions and air * Tidy DESC * api2r targets for remotes * Update workflows. Use AI. * Update templates * Don't import so much. * Update expected results per nectar updates * Get tests working. * Stub pagination. * Make tests pass for paths * Add dplyr to DESCRIPTION * Make R CMD check happy TODO: Move the `inst/talks` dir somewhere that it only counts for pkgdown (slides like in other packages). * Remove comment about `max_reqs` vs pagination in template. * Ignore Posit Assistant conversation histories * Update test fixtures to per-path * Tag for qcthat * Always `@inheritParams .shared-params` for `max_tries_per_req` (and, for now, for `max_reqs`, but that will become function-specific soon). * Remove styler Will be replaced by air soon. * Better coverage * Remove unused functions. * Generate shared params * Use whisker directly in tests * Slightly better param docs * And language and remove LazyData
1 parent 16e8151 commit 596b787

135 files changed

Lines changed: 5330 additions & 1164 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.Rbuildignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@
1111
^_beekeeper\.yml$
1212
^_beekeeper_rapid\.rds$
1313
^exploration$
14+
^_slackapi_rapid\.rds$
15+
^data-raw$
16+
^\.positai$
17+
^\.claude$
18+
^[.]?air[.]toml$
19+
^\.vscode$
20+
^AGENTS\.md$
21+
^conversation-export\.json$

‎.github/copilot-instructions.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When reviewing pull requests, do not review `man/*.Rd`.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
name: create-issue
3+
trigger: create GitHub issues
4+
description: Creates GitHub issues for the package repository. Use when asked to create, file, or open a GitHub issue, or when planning new features or functions that need to be tracked.
5+
compatibility: Requires the `gh` CLI and an authenticated GitHub session.
6+
---
7+
8+
# Create a GitHub issue
9+
10+
Use `gh api graphql` with the `createIssue` mutation to create issues. This sets the issue type in a single step. Write the body to a temp file first, then pass it via `$(cat ...)`.
11+
12+
If `gh` is not authenticated, stop and ask the user to authenticate before continuing.
13+
14+
## Looking up IDs
15+
16+
The hardcoded IDs below are correct for this repo as of 2026-05-11 21:33:53 UTC. If they ever change, or if you're working in a fork, re-run these queries to get fresh values:
17+
18+
```bash
19+
# Repository node ID
20+
gh api graphql -f query='{ repository(owner: "jonthegeek", name: "beekeeper") { id } }'
21+
22+
# Available issue type IDs
23+
gh api graphql -f query='{ repository(owner: "jonthegeek", name: "beekeeper") { issueTypes(first: 20) { nodes { id name description } } } }'
24+
```
25+
26+
## Issue type
27+
28+
Choose the type that best fits the issue:
29+
30+
| Type | ID | Use for |
31+
|---|---|---|
32+
33+
## Issue title
34+
35+
Titles use conventional commit prefixes:
36+
37+
- `feat: my_function()` — new exported function or feature
38+
- `fix: short description` — bug fix
39+
- `docs: short description` — documentation
40+
- `chore: short description` — maintenance or task
41+
42+
## Issue body structure
43+
44+
Which sections to include depends on the issue type:
45+
46+
| Section | Feature | Bug | Documentation | Task |
47+
|---|---|---|---|---|
48+
| `## Summary` | ✓ | ✓ | ✓ | ✓ |
49+
| `## Details` | optional | optional | optional | optional |
50+
| `## Proposed signature` | ✓ | — | — | — |
51+
| `## Behavior` | ✓ | ✓ | — | — |
52+
| `## References` | optional | optional | optional | optional |
53+
54+
### `## Summary` (all types)
55+
56+
A single user story sentence (no other content in this section):
57+
58+
```markdown
59+
> As a [role], in order to [goal], I would like to [feature].
60+
```
61+
62+
Example:
63+
64+
```markdown
65+
## Summary
66+
67+
> As a package developer, in order to set up agent skills quickly, I would like to generate a skill template from a single function call.
68+
```
69+
70+
### `## Details` (optional, all types)
71+
72+
For information that's important to capture but doesn't fit naturally into any other section, including implementation details such as packages to add to `Imports` in `DESCRIPTION` or files to add to `inst`. Use sparingly — if the content belongs in `## Behavior`, `## Proposed signature`, or `## References`, put it there instead.
73+
74+
### `## Proposed signature` (Feature only)
75+
76+
The proposed R function signature, arguments table, and return value description:
77+
78+
````markdown
79+
## Proposed signature
80+
81+
```r
82+
function_name(arg1, arg2)
83+
```
84+
85+
**Arguments**
86+
87+
- `arg1` (`TYPE`) — Description.
88+
- `arg2` (`TYPE`) — Description.
89+
90+
**Returns** a `TYPE` with description.
91+
````
92+
93+
### `## Behavior` (Feature and Bug)
94+
95+
- **Feature**: bullet points describing expected behavior, edge cases, and any internal helpers to implement as part of this issue.
96+
- **Bug**: describe the current (broken) behavior, the expected behavior, and steps to reproduce if known.
97+
98+
### `## References` (optional, all types)
99+
100+
Only include when there are specific reference implementations, external URLs, or related code to link to. Omit it entirely when there are none.
101+
102+
## Creating the issue
103+
104+
Use the `repoId` and the `typeId` for the chosen issue type from the table above.
105+
106+
```bash
107+
gh api graphql \
108+
-f query='mutation($repoId:ID!, $title:String!, $body:String!, $typeId:ID!) {
109+
createIssue(input:{repositoryId:$repoId, title:$title, body:$body, issueTypeId:$typeId}) {
110+
issue { url }
111+
}
112+
}' \
113+
-f repoId="R_kgDOJRLJFQ" \
114+
-f title="feat: my_function()" \
115+
-f body="$(cat /tmp/issue_body.md)" \
116+
-f typeId="{typeId}"
117+
```

‎.github/skills/document/SKILL.md‎

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
---
2+
name: document
3+
trigger: document functions
4+
description: Document package functions. Use when asked to document functions.
5+
---
6+
7+
# Document functions
8+
9+
*All* R functions in `R/` should be documented in roxygen2 `#'` style, including internal/unexported functions.
10+
11+
- Run `air format .` then `devtools::document()` after changing any roxygen2 docs.
12+
- Use sentence case for all headings.
13+
- Wrap roxygen comments at 80 characters.
14+
- Files matching `R/import-standalone-*.R` are imported from other packages and have their own conventions. Do not modify their documentation.
15+
- After documenting functions, run `devtools::document(roclets = c('rd', 'collate', 'namespace'))`.
16+
- If `_pkgdown.yml` exists and contains a `reference` section:
17+
- Whenever you add a new (non-internal) documentation topic, also add the topic to `_pkgdown.yml`.
18+
- Use `pkgdown::check_pkgdown()` to check that all topics are included in the reference index.
19+
20+
## Shared parameters
21+
22+
**Parameters used in more than one function** go in `R/aaa-shared_params.R` under `@name .shared-params`. Functions inherit them with `@inheritParams .shared-params`. See `R/aaa-shared_params.R` for current definitions (if it exists).
23+
24+
Shared params blocks: alphabetize parameters, use `@name .shared-params` (with leading dot), include `@keywords internal`, end with `NULL`.
25+
26+
Multiple shared-params groups (e.g. `.shared-params-io`, `.shared-params-parsing`) are appropriate when parameters are only shared within a file and closely related files.
27+
28+
## Parameter documentation format
29+
30+
```r
31+
#' @param param_name (`TYPE`) Brief description (usually 1-3 sentences. Can
32+
#' include [cross_references()]. Additional details on continuation lines if
33+
#' needed.
34+
```
35+
36+
Function-specific `@param` definitions always appear *before* any `@inheritParams` lines. If all parameters are defined locally, omit `@inheritParams` entirely.
37+
38+
### Type notation
39+
40+
| Notation | Meaning |
41+
|----------|---------|
42+
| ``(`character`)`` | Character vector |
43+
| ``(`character(1)`)`` | Single string |
44+
| ``(`logical(1)`)`` | Single logical |
45+
| ``(`integer`)`` | Integer vector |
46+
| ``(`integer(1)`)`` | Single integer |
47+
| ``(`double`)`` | Double vector |
48+
| ``(`vector(0)`)`` | A prototype (zero-length vector) |
49+
| ``(`vector`)`` | A vector of unspecified type |
50+
| ``(`list`)`` | List |
51+
| ``(`data.frame`)`` | Data frame or tibble |
52+
| ``(`function` or `NULL`)`` | A function or NULL |
53+
| ``(`my_class`)`` | A class-specific type (use the actual class name) |
54+
| ``(`any`)`` | Any type |
55+
56+
### Enumerated values
57+
58+
When a parameter takes one of a fixed set of values, document them with a bullet list:
59+
60+
```r
61+
#' @param method (`character(1)`) The aggregation method. Can be one of:
62+
#' * `"mean"`: Arithmetic mean.
63+
#' * `"median"`: Median value.
64+
#' * `"sum"`: Total sum.
65+
```
66+
67+
## Returns
68+
69+
Use `@returns` (not `@return`). Include a type when it's informative:
70+
71+
```r
72+
#' @returns A summary tibble.
73+
#' @returns (`logical(1)`) `TRUE` if `x` is a valid record.
74+
#' @returns Either a tibble or a list, depending on the input.
75+
#' @returns `NULL` (invisibly).
76+
```
77+
78+
**Structured returns with columns:**
79+
80+
```r
81+
#' @returns A [tibble::tibble()] with columns:
82+
#' - `name`: Record name.
83+
#' - `value`: Numeric value.
84+
#' - `status`: Status (`"active"` or `"inactive"`).
85+
```
86+
87+
## Exported functions
88+
89+
```r
90+
#' Title in sentence case
91+
#'
92+
#' Description paragraph providing context and details.
93+
#'
94+
#' @param param_name (`TYPE`) Description.
95+
#' @inheritParams .shared-params
96+
#'
97+
#' @returns Description of return value.
98+
#' @seealso [related_function()]
99+
#' @export
100+
#'
101+
#' @examples
102+
#' example_code()
103+
```
104+
105+
- Blank `#'` lines separate: title/description, description/params, and `@export`/`@examples`.
106+
- `@seealso` (optional) goes between `@returns` and `@export`.
107+
- `@details` can supplement the description when needed.
108+
109+
## Internal (unexported) functions
110+
111+
Internal helpers (identified by a dot prefix, e.g. `.parse_response()`) use abbreviated documentation. Mark them with `@keywords internal` and omit `@export`:
112+
113+
```r
114+
#' Title in sentence case
115+
#'
116+
#' @param one_off_param (`TYPE`) Description.
117+
#' @inheritParams .shared-params
118+
#' @returns (`TYPE`) What it returns.
119+
#' @keywords internal
120+
```
121+
122+
Description paragraph is optional (only include when usage isn't obvious), fewer blank `#'` lines, and no `@examples`.
123+
124+
## S3 methods and `@rdname` grouping
125+
126+
Use `@rdname` to group related functions under one help page. This applies to:
127+
- **S3 methods we own** (generic defined in this package): generic gets full docs, methods get `@rdname` + `@export`.
128+
- **Related exported functions** (e.g. multiple variants of the same operation): primary function gets full docs, variants get `@rdname` + `@export`.
129+
130+
```r
131+
#' Format a summary object
132+
#'
133+
#' @param x (`any`) The object to format.
134+
#' @param ... Additional arguments passed to methods.
135+
#' @returns A formatted character string.
136+
#' @keywords internal
137+
.format_summary <- function(x, ...) {
138+
UseMethod(".format_summary")
139+
}
140+
141+
#' @rdname .format_summary
142+
#' @export
143+
.format_summary.data_summary <- function(x, ...) {
144+
# method implementation
145+
}
146+
```
147+
148+
**S3 methods we don't own** (generic from another package) need standalone documentation:
149+
150+
```r
151+
#' Title describing the method
152+
#'
153+
#' @param x (`TYPE`) Description.
154+
#' @param ... Additional arguments (ignored).
155+
#' @returns Description.
156+
#' @exportS3Method pkg::generic
157+
method.class <- function(x, ...) { ... }
158+
```
159+
160+
## Style notes
161+
162+
**Cross-references:** Use square brackets — `[fetch_records()]` (internal), `[tibble::tibble()]` (external), `[topic_name]` (topics).
163+
164+
**Section comment headers** optionally organize code within a file, lowercase with dashes to column 80:
165+
166+
```r
167+
# helpers ----------------------------------------------------------------------
168+
```
169+
170+
Only use such headers in complex files. The need for section comment headers might indicate that the file should be split into multiple files.
171+
172+
**Examples:** Exported functions include `@examples`. Use `@examplesIf interactive()` for network-dependent or slow functions. Use section-style comments (`# Section ---`) to organize longer example blocks. Internal functions do not get examples.

‎.github/skills/github/SKILL.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: github
3+
trigger: from github
4+
description: GitHub workflows using the `gh` CLI, including viewing issues/PRs and commit message conventions. Use when interacting with GitHub in any way, such as viewing, creating, or editing issues and pull requests, making commits, or running any `gh` command.
5+
compatibility: Requires the `gh` CLI and an authenticated GitHub session.
6+
---
7+
8+
# GitHub
9+
10+
Use `gh` CLI, not web URLs: `gh issue view 123`, `gh issue list`, `gh pr view 456`, `gh pr list`.
11+
12+
## Commit messages
13+
14+
Conventional commits; backtick-quote function names; close issues in body with `- Closes #N`.
15+
16+
```
17+
feat: add `create_skill()`
18+
19+
Generates a new skill directory with a SKILL.md template.
20+
21+
- Closes #3
22+
```
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: implement-issue
3+
trigger: implement issue / work on #NNN
4+
description: Implements a GitHub issue end-to-end. Use when asked to implement, work on, or fix a specific issue number.
5+
compatibility: Requires the `gh` CLI and an authenticated GitHub session.
6+
---
7+
8+
# Implement a GitHub issue
9+
10+
This skill wraps the Standard Workflow defined in `AGENTS.md`. Run the steps below before and after that workflow.
11+
12+
## Before the standard workflow
13+
14+
**A. Read the issue in full:**
15+
16+
```bash
17+
gh issue view {number}
18+
```
19+
20+
If `gh` is not authenticated, stop and ask the user to authenticate before continuing.
21+
22+
**B. Check/create the branch:**
23+
24+
- If on `main`: `usethis::pr_init("fix-{number}-{description}")`
25+
- Branch format: `fix-{number}-{description}`
26+
- Parts separated by hyphens; `{description}` uses snake_case
27+
- Example: `fix-42-validate_input`
28+
- If a branch already exists for this issue, check it out instead
29+
30+
## Run the Standard Workflow from AGENTS.md
31+
32+
Steps 1–9 of the Standard Workflow are the core development loop.
33+
34+
## After the standard workflow
35+
36+
**C. Commit and push:**
37+
38+
1. Review commits already on this branch (not on `main`) — these are all part of the same PR and should inform the PR description:
39+
```bash
40+
git log main..HEAD --oneline
41+
```
42+
2. Stage and commit all changes:
43+
```bash
44+
git add -A
45+
git commit -m "{short imperative summary}"
46+
```
47+
3. Push and open the PR:
48+
```bash
49+
gh pr create --fill
50+
```
51+
Use `--title` and `--body` explicitly if `--fill` produces an inadequate description.
52+
53+
This step may be overridden — the user may ask you to stop before committing, handle the push themselves, or complete only part of the workflow. Always follow explicit user instructions over these defaults.

0 commit comments

Comments
 (0)