| Title: | Curated Agentic Harnesses for R Professional Roles |
|---|---|
| Description: | A bootstrapper that launches a command-line coding agent of the user's choice in a terminal tab pre-configured for a professional R role. Each role is described by a curated harness: a subset of community skills, a system prompt, a folder layout, and quality gates. The package does not run an agent loop and does not call a language model; it discovers the chosen coder binary, generates its configuration, links the curated skills, and opens the terminal. Code written by the agent is run manually by the user, by design, so that every generated script passes through a human audit gate before execution. |
| Authors: | Pedro Carvalho Brom [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-1288-7695>) |
| Maintainer: | Pedro Carvalho Brom <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-06-09 19:21:39 UTC |
| Source: | https://github.com/pcbrom/harness |
List the registered adapters
adapters()adapters()
A character vector of adapter names.
adapters()adapters()
Returns the names of the harnesses bundled with the package, taken from the
inst/harness/<role>.yml catalogue.
available_roles()available_roles()
A character vector of role names, sorted alphabetically.
available_roles()available_roles()
Clones the external community-skills repository into a discoverable location
so that community_skills_path() finds it on the next call. The catalogue is
an external dependency and is never bundled with this package; this helper
only automates the checkout. It is never run when the package is loaded.
clone_community_skills( dest = file.path(path.expand("~"), ".community-skills"), url = community_skills_url(), shallow = TRUE, quiet = FALSE )clone_community_skills( dest = file.path(path.expand("~"), ".community-skills"), url = community_skills_url(), shallow = TRUE, quiet = FALSE )
dest |
Destination directory. Defaults to |
url |
The git remote to clone from. |
shallow |
When |
quiet |
Suppress git and progress messages. |
The absolute path to the checkout, invisibly.
## Not run: clone_community_skills() ## End(Not run)## Not run: clone_community_skills() ## End(Not run)
Searches, in order, the COMMUNITY_SKILLS_PATH environment variable,
~/.community-skills/ and ~/projects/community-skills/. The community
skills catalogue is an external dependency and is never bundled with this
package.
community_skills_path()community_skills_path()
The absolute path to the checkout, or NA_character_ when none is
found.
community_skills_path()community_skills_path()
Loads the harness for role, configures the chosen adapter for the
project, scaffolds the role's folder layout, and opens the coder in a
terminal tab. Inside RStudio the terminal is created with
rstudioapi::terminalCreate; otherwise an external terminal emulator is
used, and when none is available the launch command is reported for the user
to run.
launch( adapter = "claude", role, project_dir = getwd(), scaffold = TRUE, dry_run = FALSE, config_home = NULL, skills_path = NULL, binary = NULL )launch( adapter = "claude", role, project_dir = getwd(), scaffold = TRUE, dry_run = FALSE, config_home = NULL, skills_path = NULL, binary = NULL )
adapter |
The coder to launch. See |
role |
The professional role. See |
project_dir |
The project root. Defaults to the working directory. |
scaffold |
When |
dry_run |
When |
config_home |
Override the adapter configuration home (mainly for testing). |
skills_path |
Override the community-skills checkout path. |
binary |
Override the discovered coder binary path. |
The package never runs an agent loop and never executes code produced by the agent. Generated scripts are run manually by the user.
An object of class harness_launch, invisibly.
## Not run: launch("claude", role = "data-scientist") ## End(Not run)## Not run: launch("claude", role = "data-scientist") ## End(Not run)
Reads the harness for name from the catalogue, validates it against the
schema, and returns it as a harness_role object.
role(name)role(name)
name |
A role name, as returned by |
An object of class harness_role.
ds <- role("data-scientist") ds$skillsds <- role("data-scientist") ds$skills
Prints the complete harness configuration for a role: description, execution
policy, skills, folder layout, quality gates, package dependencies and the
full system prompt, followed by the path to the source YAML. Unlike the
compact print method, this includes the system prompt in full.
role_config(name)role_config(name)
name |
A role name, or a |
The harness_role object, invisibly.
role_config("data-scientist")role_config("data-scientist")
Returns a data frame with one row per curated role, summarising its version, the number of skills it declares, and the first line of its description.
role_list()role_list()
A data frame with columns role, version, skills and
description.
role_list()role_list()
Returns a long data frame with one row per role-skill pair. With
available = TRUE, each skill is checked against the community-skills
checkout and an available column reports whether its SKILL.md is present.
role_skills(role_name = NULL, available = FALSE)role_skills(role_name = NULL, available = FALSE)
role_name |
A role name, or |
available |
When |
A data frame with columns role and skill, plus available when
requested.
role_skills("data-scientist") utils::head(role_skills())role_skills("data-scientist") utils::head(role_skills())
Creates the directories declared in the harness layout under
project_dir. Existing directories are left untouched. The function never
writes code, runs a script, or removes anything; it only ensures the audit
folders exist.
scaffold_layout(role_name, project_dir = getwd(), create = FALSE)scaffold_layout(role_name, project_dir = getwd(), create = FALSE)
role_name |
A role name, as returned by |
project_dir |
The project root under which to create the layout. |
create |
When |
A data frame with one row per layout entry, invisibly.
tmp <- tempfile("proj") dir.create(tmp) scaffold_layout("data-scientist", tmp, create = TRUE)tmp <- tempfile("proj") dir.create(tmp) scaffold_layout("data-scientist", tmp, create = TRUE)
An RStudio addin. It reads the current editor selection, asks for a short
note, and sends the note with a file:line reference to the coder running in
the harness terminal that launch() opened. Bind it to a keyboard shortcut
through Tools, Modify Keyboard Shortcuts, Addins.
send_selection_to_coder()send_selection_to_coder()
The function forwards text the user wrote; it does not run an agent loop and does not call a language model. It requires RStudio and an open harness terminal.
The message sent, invisibly, or NULL when cancelled.
Checks that a community-skills checkout exists, reports which curated skills for the role are present in that checkout, and which declared CRAN packages are installed. Optionally scaffolds the role's folder layout. The function never installs packages and never runs generated code.
setup(role_name = NULL, project_dir = getwd(), scaffold = FALSE)setup(role_name = NULL, project_dir = getwd(), scaffold = FALSE)
role_name |
A role name, or |
project_dir |
The project root for optional layout scaffolding. |
scaffold |
When |
An object of class harness_setup, invisibly.
## Not run: setup("data-scientist") ## End(Not run)## Not run: setup("data-scientist") ## End(Not run)
Summarises the discoverable environment: the community-skills checkout, the bundled roles, and the registered adapters with their binary availability. The function performs no side effects.
status()status()
An object of class harness_status, invisibly printed by default.
status()status()
Runs a fast-forward git pull on an existing community-skills checkout so
that the curated skills track the upstream repository. The update is
user-initiated. It can also run when the package is attached, but only when
the user opts in through the harness.auto_update option or the
HARNESS_AUTO_UPDATE environment variable; the default does nothing on load.
update_community_skills(dest = community_skills_path(), quiet = FALSE)update_community_skills(dest = community_skills_path(), quiet = FALSE)
dest |
The checkout to update. Defaults to the discovered path from
|
quiet |
Suppress git and progress messages. |
The absolute path to the checkout, invisibly.
## Not run: update_community_skills() ## End(Not run)## Not run: update_community_skills() ## End(Not run)