diff --git a/.github/skills/create-issue/SKILL.md b/.github/skills/create-issue/SKILL.md new file mode 100644 index 0000000..ab9ce09 --- /dev/null +++ b/.github/skills/create-issue/SKILL.md @@ -0,0 +1,116 @@ +--- +name: create-issue +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. +compatibility: Requires the `gh` CLI and an authenticated GitHub session. +--- + +# Create a GitHub issue + +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 ...)`. + +## Looking up IDs + +The hardcoded IDs below are correct for this repo as of 2026-03-02. If they ever change, or if you're working in a fork or a repo other than "wranglezone/datawrap", re-run these queries to get fresh values (updating owner and name if necessary). + +```bash +# Repository node ID +gh api graphql -f query='{ repository(owner: "wranglezone", name: "datawrap") { id } }' + +# Available issue type IDs +gh api graphql -f query='{ repository(owner: "wranglezone", name: "datawrap") { issueTypes(first: 20) { nodes { id name } } } }' +``` + +## Issue type + +Choose the type that best fits the issue: + +| Type | ID | Use for | +|---|---|---| +| Feature | `IT_kwDODjbzj84BwJRW` | New exported functions or capabilities | +| Bug | `IT_kwDODjbzj84BwJRV` | Something broken or incorrect | +| Documentation | `IT_kwDODjbzj84BwprI` | Docs-only changes | +| Task | `IT_kwDODjbzj84BwJRU` | Maintenance, refactoring, chores | + +## Issue title + +Titles use conventional commit prefixes: + +- `feat: my_function()` — new exported function or feature +- `fix: short description` — bug fix +- `docs: short description` — documentation +- `chore: short description` — maintenance or task + +## Issue body structure + +Which sections to include depends on the issue type: + +| Section | Feature | Bug | Documentation | Task | +|---|---|---|---|---| +| `## Summary` | ✓ | ✓ | ✓ | ✓ | +| `## Details` | optional | optional | optional | optional | +| `## Proposed signature` | ✓ | — | — | — | +| `## Behavior` | ✓ | ✓ | — | — | +| `## References` | optional | optional | optional | optional | + +### `## Summary` (all types) + +A single user story sentence (no other content in this section): + +```markdown +> As a [role], in order to [goal], I would like to [feature]. +``` + +Example: + +```markdown +## Summary + +> As a data wrangler, in order to share information about my dataset, I would like to create a simple data dictionary based on my dataset. +``` + +### `## Details` (optional, all types) + +For information that's important to capture but doesn't fit naturally into any other section. Use sparingly — if the content belongs in `## Behavior`, `## Proposed signature`, or `## References`, put it there instead. + +### `## Proposed signature` (Feature only) + +The proposed R function signature, arguments table, and return value description: + +````markdown +## Proposed signature + +```r +function_name(arg1, arg2) +``` + +**Arguments** + +- `arg1` (`TYPE`) — Description. +- `arg2` (`TYPE`) — Description. + +**Returns** a `TYPE` with description. +```` + +### `## Behavior` (Feature and Bug) + +- **Feature**: bullet points describing expected behavior, edge cases, and any internal helpers to implement as part of this issue. +- **Bug**: describe the current (broken) behavior, the expected behavior, and steps to reproduce if known. + +### `## References` (optional, all types) + +Only include when there are specific reference implementations, external URLs, or related code to link to. Omit it entirely when there are none. + +## Creating the issue + +```bash +gh api graphql \ + -f query='mutation($repoId:ID!, $title:String!, $body:String!, $typeId:ID!) { + createIssue(input:{repositoryId:$repoId, title:$title, body:$body, issueTypeId:$typeId}) { + issue { url } + } + }' \ + -f repoId="R_kgDORb_Ktg" \ + -f title="feat: my_function()" \ + -f body="$(cat /tmp/issue_body.md)" \ + -f typeId="IT_kwDODjbzj84BwJRW" +``` diff --git a/AGENTS.md b/AGENTS.md index 67c03a4..3760f6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ | `R/datawrap-package.R` | Auto-generated package-level documentation; do not edit | | `tests/testthat/` | Test suite; mirrors `R/` structure | | `man/` | Generated Rd files; do not edit manually | -| `.github/skills/` | Agent skill files (document, search-code) | +| `.github/skills/` | Agent skill files | | `DESCRIPTION` | Package metadata and dependencies | | `NAMESPACE` | Exports; auto-generated by `devtools::document()` | @@ -59,6 +59,7 @@ Skills in @.github/skills should be loaded when the user triggers them. ------------------------|------------------------------------------------| | document functions | @.github/skills/document/SKILL.md | | search / rewrite code | @.github/skills/search-code/SKILL.md | +| create github issues | @.github/skills/create-issue/SKILL.md | ## File Organization diff --git a/tests/testthat/test-placeholder.R b/tests/testthat/test-placeholder.R deleted file mode 100644 index 5c00b00..0000000 --- a/tests/testthat/test-placeholder.R +++ /dev/null @@ -1,3 +0,0 @@ -test_that("Delete this when there's a real test", { - succeed("Placeholder") -})