rnd-plugin-architecturelisted
Install: claude install-skill oleksify/rnd-framework
# Plugin Architecture
## Overview
rnd-framework is a Claude Code plugin. The abstraction layer lives in `plugin-dir-base.sh` (config dir detection) and `hooks.json` (tool name matchers). Understanding these layers is required before modifying any platform-sensitive code.
## Plugin Manifest
The plugin manifest lives at `.claude-plugin/plugin.json` and contains `name`, `description`, `version` (strict semver `X.Y.Z`). The root-level `.claude-plugin/marketplace.json` is a registry file that references the plugin path.
## Config Directory Detection
`plugin-dir-base.sh` resolves the config directory using this precedence:
```
1. CLAUDE_PLUGIN_ROOT (strip /plugins/cache/* suffix)
2. CLAUDE_CONFIG_DIR
3. Default → ~/.claude/
```
The resolved `CONFIG_DIR` is the base for artifact storage: `$CONFIG_DIR/.rnd/<project-slug>/`.
## Project Slug Computation
```
<basename>-<8-char-sha256-hash>
```
- `basename`: derived from `git rev-parse --git-common-dir` parent directory name
- `hash`: first 8 chars of sha256 of the canonicalized git-common-dir path
- Non-git fallback: uses `pwd` basename and hash
## Environment Variables
| Variable | Purpose |
|---|---|
| `CLAUDE_PLUGIN_ROOT` | Points to cached plugin copy |
| `CLAUDE_CONFIG_DIR` | Config directory (~/.claude) |
## Path Matching Regex
Used in `lib.sh`, `bash-gate.sh`, and other hooks to detect plugin artifact paths:
```regex
\.claude[^/]*/
```
This matches:
- `~/.claude/.rnd/` (Claude Code)
- `~/.claude-code/.rnd/` (Clau