cmd-check
Runs R CMD check to verify package structure, documentation, and code quality, ensuring CRAN-like standards.
Install
mkdir -p .claude/skills/cmd-check && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10451" && unzip -o skill.zip -d .claude/skills/cmd-check && rm skill.zipInstalls to .claude/skills/cmd-check
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
GitHub Copilot Chat AssistantKey capabilities
- →Execute R package validation checks
- →Identify syntax errors and broken NAMESPACE files
- →Detect missing package dependencies
- →Generate CRAN-style quality reports
- →Provide actionable feedback for documentation mismatches
How it works
The tool runs R CMD check to verify package structure and documentation against quality standards. It utilizes devtools for standard development loops or rcmdcheck for programmatic control.
Inputs & outputs
When to use cmd-check
- →Validate R package before merging to main
- →Run CRAN-style package checks locally
- →Fix documentation mismatches in NAMESPACE
About this skill
GitHub Copilot Chat Assistant
name: cmd-check trigger: run R CMD check / check package / validate package description: Enforce and explain R CMD check for R packages. Use when verifying code quality before merging or completing a task.
R CMD check
Run R CMD check to ensure the package structure, documentation, and code meet CRAN-like quality standards. Per the standard workflow in AGENTS.md, this should be run after tests pass.
Running checks
Use devtools::check() for the standard development loop. Use rcmdcheck for more detailed programmatic control or CI-like local runs.
# Standard check (as defined in AGENTS.md)
devtools::check(error_on = "warning")
# Comprehensive CRAN-style check
rcmdcheck::rcmdcheck(args = "--as-cran")
Interpreting results
| Level | Action | Description |
|---|---|---|
| ERROR | Blocker | Must be fixed immediately. Includes failing tests, broken NAMESPACE, or invalid syntax. |
| WARNING | High Priority | Should be fixed before merging. Includes missing imports, documentation mismatches, or invalid cross-references. |
| NOTE | Review | Non-blocking but should be minimized. Includes large file sizes, missing Title/Description fields, or global variable issues. |
Common fixes
Missing dependencies
Add missing packages to the Imports (runtime) or Suggests (test/doc only) section of DESCRIPTION. Ensure all external functions are called using package::function().
Documentation out of sync
If Rd files or NAMESPACE are flagged, run:
devtools::document()
Then re-run the check.
Global variable NOTES
If check warns about "no visible binding for global variable", add the variables to R/HockeyModel-package.R or use utils::globalVariables() to quiet the note, especially when using dplyr or data.table.
Examples failing
If examples take too long or require internet access, wrap them in \dontrun{} or \donttest{} in the roxygen comments. Use @examplesIf interactive() for network-dependent functions.
Best practices
- Check locally before PR: Always run
devtools::check()before pushing to ensure CI passes. - Clean environment: Run checks in a fresh R session to avoid contamination from the global environment.
- Namespace hygiene: Ensure
NAMESPACEonly exports intended functions. Use@keywords internalto hide helpers from the documentation index while keeping them exported if necessary. - News update: If fixing a check issue that affects users, add a note to
NEWS.md.
References
- rcmdcheck documentation
- CRAN Repository Policy
- r-lib GitHub Actions
When not to use it
- →When tests have not yet passed
- →When the environment is not clean
Limitations
- →Examples requiring internet access may fail unless wrapped in specific tags
- →Global variable notes require manual suppression via R/HockeyModel-package.R or utils::globalVariables
How it compares
Unlike manual inspection, this tool automates the detection of global variable issues and documentation sync errors through standardized R session execution.
Compared to similar skills
cmd-check side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| cmd-check (this skill) | 0 | 3mo | No flags | Intermediate |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| pr-review | 6 | 2mo | Review | Intermediate |
| pytest | 8 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
pr-review
pytorch
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".
pytest
prowler-cloud
Pytest testing patterns for Python. Trigger: When writing or refactoring pytest tests (fixtures, mocking, parametrize, markers). For Prowler-specific API/SDK testing conventions, also use prowler-test-api or prowler-test-sdk.
code-change-verification
openai
Run the mandatory verification stack when changes affect runtime code, tests, or build/test behavior in the OpenAI Agents Python repository.
django-verification
affaan-m
Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
python
alinaqi
Python development with ruff, mypy, pytest - TDD and type safety