Skip to content
Agentmart
Submit a tool

s7-development

Use when implementing or changing R S7 classes, properties, methods, or package integration.

Skill by sounkou-bioinfo

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sounkou-bioinfo-s7-development

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when implementing or changing R S7 classes, properties, methods, or package integration.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/s7-development

What's inside

Skill name
s7-development
Description
Use when implementing or changing R S7 classes, properties, methods, or package integration.
License
MIT
Instructions
31 lines in SKILL.md · view on GitHub

Files (8)

  • SKILL.md
  • classes-and-objects.md · references/
  • compatibility.md · references/
  • generics-and-methods.md · references/
  • issue-notes.md · references/
  • packages.md · references/
  • s7-basics.md · references/
  • consumer_opportunities.R · scripts/

SKILL.md (first lines)

# S7 development

## Class contract

Use `S7::new_class()` with explicit properties and a constructor for user-facing defaults/coercion. Properties own field types and access semantics; validators own cross-property object invariants. A consumer that needs behavior from different classes may own a small `s7contract` interface. Method availability does not establish the meaning of the behavior; test that separately. Do not turn recurring scalar checks into an interface when a property, constructor, or simple `checkmate` check owns the contract.

Prefer immutable/functional updates. Computed properties use getters; writable derived state needs an explicit setter and invariant. Avoid hidden environments unless identity/mutability is the actual abstraction.

## Dispatch

Define behavior with `S7::new_generic()` and `S7::method()`. Keep generic bodies minimal. Declare `...` behavior deliberately; do not absorb misspelled arguments accidentally. Use multiple dispatch only when behavior genuinely depends on every dispatched argument. For inheritance, call `super()` when preserving parent behavior rather than copying it.

## Compatibility

Treat S3/S4 interop as an explicit adapter. Register methods in `.onLoad()` when package loading order requires it. Export classes/generics intentionally, maintain `Collate` order where needed, and document constructor/property/method contracts rather than object internals.

## Package-wide consumer opportunities

When several package functions appear to need the same behavior, run the optional read-only [consumer opportunity report](scripts/consumer_opportunities.R) on the package directory. Resolve the script relative to this skill's directory:

```sh
Rscript /path/to/s7-development/scripts/consumer_opportunities.R --max-groups=8 /path/to/package
```

It reports pairs of package-defined S7 generics called on the same formal argument by at least two top-level functions, and repeated scalar-check syntax (namespaced `checkmate` calls or simple `stop()` guards) across functions, with bounded file/line evidence. `--format=json` provides the same bounded groups for tooling. It uses the anti-slop Tree-sitter parser, scans package `R/` files, and fails on parse errors. It intentionally omits single-operation interfaces, indirect/dynamic calls, nested-function checks, and semantics outside this syntax. A hit is a place to read the consumers and relevant implementations, not a requirement to introduce `s7contract` or consolidate checks. Ask what each consumer requires, whether an alternative implementation could satisfy it, and which behavior a method-presence check cannot prove. Compare ordinary dispatch, S7 properties/constructors, and a simple argument check; use an interface only when the consumer actually needs shared behavior from multiple implementations. Do not reshape code to produce or avoid a hit.

## Proof

Test construction, invalid objects, property access/setters, dispatch specificity, inheritance, missing/dots behavior, serialization if supported, and package load with dependencies in different orders. For a consumer-owned interface, test implementations and the behavior the consumer depends on, not just method presence. Use the focused files under `references/` only for the active S7 mechanism.

From sounkou-bioinfo/pi-skills, MIT.

More from sounkou-bioinfo/pi-skills

Signals

Stars
2
Forks
1
Open issues
2
Last commit (this folder)
Sep 24, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from sounkou-bioinfo

Cite this page

s7-development skill. Agent Mart. https://agentmart.dev/skills/sounkou-bioinfo-s7-development (last updated 2026-10-24)