The `/ring:review` command is renamed to `/ring:codereview` to more accurately reflect its function. The name "review" was too generic and could be misinterpreted. "codereview" is explicit, clarifying that the command triggers a parallel code review by specialized agents. This enhances command discoverability and reduces ambiguity. All documentation, skill files, and examples across the repository are updated to reflect this new command name. The command's definition is also expanded to provide a more comprehensive guide on the parallel review workflow, detailing the process and expected output format. Finally, a new `AGENTS.md` symlink is added for easier navigation.
24 KiB
Ring Architecture Documentation
Table of Contents
- Overview
- Marketplace Structure
- Component Hierarchy
- Core Components
- Data & Control Flow
- Integration with Claude Code
- Execution Patterns
- Component Relationships
Overview
Ring is a Claude Code plugin marketplace that provides a comprehensive skills library and workflow system with 7 active plugins. It extends Claude Code's capabilities through structured, reusable patterns that enforce proven software engineering practices.
Architecture Philosophy
Ring operates on three core principles:
- Mandatory Workflows - Critical skills (like using-ring) enforce specific behaviors
- Parallel Execution - Review systems run concurrently for speed
- Session Context - Skills load automatically at session start
- Modular Plugins - Specialized plugins for different domains and teams
System Boundaries
┌─────────────────────────────────────────────────────────────────────────────────┐
│ Claude Code │
│ ┌───────────────────────────────────────────────────────────────────────────┐ │
│ │ Ring Marketplace │ │
│ │ ┌──────────────────────┐ ┌──────────────────────┐ │ │
│ │ │ ring-default │ │ ring-dev-team │ │ │
│ │ │ Skills(20) Agents(5) │ │ Skills(2) Agents(10) │ │ │
│ │ │ Cmds(6) Hooks/Lib │ │ │ │ │
│ │ └──────────────────────┘ └──────────────────────┘ │ │
│ │ ┌──────────────────────┐ ┌──────────────────────┐ │ │
│ │ │ ring-finops-team │ │ ring-pm-team │ │ │
│ │ │ Skills(6) Agents(2) │ │ Skills(9) Cmds(2) │ │ │
│ │ └──────────────────────┘ └──────────────────────┘ │ │
│ │ ┌──────────────────────┐ ┌──────────────────────┐ │ │
│ │ │ ralph-wiggum │ │ ring-tw-team │ │ │
│ │ │ Skills(1) Cmds(3) │ │ Skills(7) Agents(3) │ │ │
│ │ └──────────────────────┘ │ Cmds(3) │ │ │
│ │ ┌──────────────────────┐ └──────────────────────┘ │ │
│ │ │ beads │ │ │
│ │ │ Skills(1) Hooks │ │ │
│ │ └──────────────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────────┘ │
│ │
│ Native Tools: Skill, Task, TodoWrite, SlashCommand │
└─────────────────────────────────────────────────────────────────────────────────┘
Marketplace Structure
Ring is organized as a monorepo marketplace with multiple plugin collections:
ring/ # Monorepo root
├── .claude-plugin/
│ └── marketplace.json # Multi-plugin registry (7 active plugins)
├── default/ # Core plugin: ring-default
├── dev-team/ # Developer agents: ring-dev-team
├── finops-team/ # FinOps & regulatory: ring-finops-team
├── pm-team/ # Product planning: ring-pm-team
├── ralph-wiggum/ # Iterative AI loops: ralph-wiggum
├── tw-team/ # Technical writing: ring-tw-team
└── beads/ # Issue tracking: beads
Active Plugins
Versions managed in .claude-plugin/marketplace.json
| Plugin | Description | Components |
|---|---|---|
| ring-default | Core skills library | 20 skills, 5 agents, 6 commands |
| ring-dev-team | Developer agents | 2 skills, 10 specialized developer agents |
| ring-finops-team | FinOps & regulatory compliance | 6 skills, 2 agents |
| ring-pm-team | Product planning workflows | 9 skills, 2 commands |
| ralph-wiggum | Iterative AI development loops | 1 skill, 3 commands, Stop hook |
| ring-tw-team | Technical writing specialists | 7 skills, 3 agents, 3 commands |
| beads | Issue tracking integration | 1 skill, hooks |
Component Hierarchy
1. Skills (skills/)
Purpose: Core instruction sets that define workflows and best practices
Structure:
skills/
├── {skill-name}/
│ └── SKILL.md # Skill definition with frontmatter
├── shared-patterns/ # Reusable patterns across skills
│ ├── state-tracking.md
│ ├── failure-recovery.md
│ ├── exit-criteria.md
│ └── todowrite-integration.md
Key Characteristics:
- Self-contained directories with
SKILL.mdfiles - YAML frontmatter:
name,description,when_to_use - Invoked via Claude's
Skilltool - Can reference shared patterns for common behaviors
2. Agents (agents/)
Purpose: Specialized agents that analyze code/designs or provide domain expertise using AI models
Structure (ring-default plugin):
default/agents/
├── code-reviewer.md # Foundation review (architecture, patterns)
├── business-logic-reviewer.md # Correctness review (requirements, edge cases)
├── security-reviewer.md # Safety review (OWASP, auth, validation)
├── write-plan.md # Implementation planning
└── codebase-explorer.md # Deep architecture analysis (Opus)
Structure (ring-dev-team plugin):
dev-team/agents/
├── backend-engineer.md # Language-agnostic backend specialist
├── backend-engineer-golang.md # Go backend specialist for financial systems
├── backend-engineer-typescript.md # TypeScript/Node.js backend specialist
├── backend-engineer-python.md # Python backend specialist
├── devops-engineer.md # DevOps infrastructure specialist
├── frontend-engineer.md # Language-agnostic frontend specialist
├── frontend-engineer-typescript.md # TypeScript/React/Next.js frontend specialist
├── frontend-designer.md # Visual design specialist
├── qa-analyst.md # Quality assurance specialist
└── sre.md # Site reliability engineer
Key Characteristics:
- Invoked via Claude's
Tasktool withsubagent_type - Must specify model (typically "opus" for comprehensive analysis)
- Review agents run in parallel (3 reviewers dispatch simultaneously via
/ring:codereviewcommand) - Developer agents provide specialized domain expertise
- Return structured reports with severity-based findings
Note: Parallel review orchestration is handled by the /ring:codereview command
3. Commands (commands/)
Purpose: Slash commands that provide shortcuts to skills/workflows
Structure:
default/commands/
├── brainstorm.md # /ring-default:brainstorm - Socratic design refinement
├── write-plan.md # /ring-default:write-plan - Implementation planning
├── execute-plan.md # /ring-default:execute-plan - Batch execution
├── codereview.md # /ring-default:codereview - Parallel 3-reviewer dispatch
└── worktree.md # /ring-default:worktree - Git worktree creation
pm-team/commands/
├── pre-dev-feature.md # /ring-pm-team:pre-dev-feature - 3-gate workflow
└── pre-dev-full.md # /ring-pm-team:pre-dev-full - 8-gate workflow
Key Characteristics:
- Simple
.mdfiles with YAML frontmatter - Invoked via
/ring-{plugin}:{command}syntax - Typically reference a corresponding skill
- Expand into full skill/agent invocation
4. Hooks (hooks/)
Purpose: Session lifecycle management and automatic initialization
Structure:
default/hooks/
├── hooks.json # Hook configuration (SessionStart, UserPromptSubmit)
├── session-start.sh # Main initialization script
├── generate-skills-ref.py # Dynamic skill reference generator
└── claude-md-reminder.sh # CLAUDE.md reminder on prompt submit
Key Characteristics:
- Triggers on SessionStart events (startup|resume, clear|compact)
- Triggers on UserPromptSubmit for reminders
- Injects skills context into Claude's memory
- Auto-generates skills quick reference from frontmatter
- Ensures mandatory workflows are loaded
5. Plugin Configuration (.claude-plugin/)
Purpose: Integration metadata for Claude Code marketplace
Structure:
.claude-plugin/
└── marketplace.json # Multi-plugin registry
├── ring-default # Core skills library
├── ring-dev-team # Developer agents
├── ring-pm-team # Product planning
├── ring-finops-team # FinOps & regulatory
└── ralph-wiggum # Iterative loops
marketplace.json Schema:
{
"name": "ring",
"description": "...",
"owner": { "name": "...", "email": "..." },
"plugins": [
{
"name": "ring-default",
"version": "...",
"source": "./default",
"keywords": ["skills", "tdd", "debugging", ...]
},
{
"name": "ring-dev-team",
"version": "...",
"source": "./dev-team",
"keywords": ["developer", "agents"]
},
{
"name": "ring-pm-team",
"version": "...",
"source": "./pm-team",
"keywords": ["product", "planning"]
},
{
"name": "ring-finops-team",
"version": "...",
"source": "./finops-team",
"keywords": ["finops", "regulatory"]
},
{
"name": "ralph-wiggum",
"version": "...",
"source": "./ralph-wiggum",
"keywords": ["loops", "iteration"]
}
]
}
Data & Control Flow
Session Initialization Flow
sequenceDiagram
participant User
participant Claude Code
participant hooks.json
participant session-start.sh
participant generate-skills-ref.py
participant Claude Context
User->>Claude Code: Start new session
Claude Code->>hooks.json: Check SessionStart hooks
hooks.json->>session-start.sh: Execute initialization
session-start.sh->>generate-skills-ref.py: Generate skills overview
generate-skills-ref.py-->>session-start.sh: Return formatted reference
session-start.sh->>Claude Context: Inject skills + using-ring content
Claude Context-->>User: Session ready with skills loaded
Skill Invocation Flow
sequenceDiagram
participant User
participant Claude
participant Skill Tool
participant SKILL.md
participant TodoWrite
User->>Claude: Request task
Claude->>Claude: Check using-ring mandatory workflow
Claude->>Skill Tool: Invoke relevant skill
Skill Tool->>SKILL.md: Load skill instructions
SKILL.md-->>Claude: Return structured workflow
Claude->>TodoWrite: Create task tracking (if multi-step)
Claude->>User: Execute skill with progress updates
Parallel Review Flow
sequenceDiagram
participant User
participant Claude
participant Task Tool
participant code-reviewer
participant business-reviewer
participant security-reviewer
User->>Claude: /ring:codereview
Note over Claude: Command provides<br/>parallel review workflow
Claude->>Task Tool: Dispatch 3 parallel tasks
par Parallel Execution
Task Tool->>code-reviewer: Review architecture
and
Task Tool->>business-reviewer: Review correctness
and
Task Tool->>security-reviewer: Review vulnerabilities
end
code-reviewer-->>Claude: Return findings
business-reviewer-->>Claude: Return findings
security-reviewer-->>Claude: Return findings
Note over Claude: Aggregate & prioritize by severity
Claude->>User: Consolidated report
Integration with Claude Code
Native Tool Integration
Ring leverages four primary Claude Code tools:
-
Skill Tool
- Invokes skills by name:
skill: "ring:test-driven-development" - Skills expand into full instructions within conversation
- Skill content becomes part of Claude's working context
- Invokes skills by name:
-
Task Tool
- Dispatches agents to subagent instances:
Task(agent="ring:code-reviewer", model="opus") - Enables parallel execution (multiple Tasks in one message)
- Returns structured reports from independent analysis
- Dispatches agents to subagent instances:
-
TodoWrite Tool
- Tracks multi-step workflows:
TodoWrite(todos=[...]) - Integrates with skills via shared patterns
- Provides progress visibility to users
- Tracks multi-step workflows:
-
SlashCommand Tool
- Executes commands:
SlashCommand(command="/ring:brainstorm") - Commands expand to skill/agent invocations
- Provides user-friendly shortcuts
- Executes commands:
Session Context Injection
At session start, Ring injects two critical pieces of context:
- Skills Quick Reference - Auto-generated overview of all available skills
- using-ring Skill - Mandatory workflow that enforces skill checking
This context becomes part of Claude's memory for the entire session, ensuring:
- Claude knows which skills are available
- Mandatory workflows are enforced
- Skills are checked before any task
Execution Patterns
Pattern 1: Mandatory Skill Checking
User Request → using-ring check → Relevant skill?
├─ Yes → Invoke skill → Follow workflow
└─ No → Proceed with task
Implementation: The using-ring skill is loaded at session start and contains strict instructions to check for relevant skills before ANY task.
Pattern 2: Parallel Review Execution
Review Request → full-reviewer → Dispatch 3 Tasks (parallel)
├─ code-reviewer ─┐
├─ business-reviewer ─┼─→ Aggregate findings → Handle by severity
└─ security-reviewer ─┘
Implementation: Single message with 3 Task tool calls ensures parallel execution. All reviewers work independently and return simultaneously.
Pattern 3: Skill-to-Command Mapping
User: /ring:brainstorm
↓
SlashCommand Tool
↓
commands/brainstorm.md
↓
"Use and follow the brainstorming skill"
↓
Skill Tool: ring:brainstorming
↓
skills/brainstorming/SKILL.md
Implementation: Commands are thin wrappers that immediately invoke corresponding skills.
Pattern 4: Progressive Skill Execution
Complex Skill → TodoWrite tracking
├─ Phase 1: Understanding [in_progress]
├─ Phase 2: Exploration [pending]
├─ Phase 3: Design [pending]
└─ Phase 4: Documentation [pending]
Implementation: Multi-phase skills use TodoWrite to track progress through structured workflows.
Component Relationships
Skills ↔ Agents
Difference:
- Skills: Instructions executed by current Claude instance
- Agents: Specialized reviewers executed by separate Claude instances
Interaction:
- Skills can invoke agents (e.g., requesting-code-review skill dispatches review agents)
- Agents don't typically invoke skills (they're independent analyzers)
Skills ↔ Commands
Relationship: One-to-one or one-to-many mapping
- Most commands map directly to a single skill
- Some commands (like review) orchestrate multiple components
Example Mappings:
/ring:brainstorm→brainstormingskill/ring:write-plan→writing-plansskill/ring:codereview→full-revieweragent → 3 parallel review agents
Skills ↔ Shared Patterns
Relationship: Inheritance/composition
- Skills reference shared patterns for common behaviors
- Patterns provide reusable workflows (state tracking, failure recovery)
Example:
# In a skill:
See `skills/shared-patterns/todowrite-integration.md` for tracking setup
Hooks ↔ Skills
Relationship: Initialization and context loading
- Hooks load skill metadata at session start
- generate-skills-ref.py scans all SKILL.md frontmatter
- session-start.sh injects using-ring skill content
Data Flow:
SKILL.md frontmatter → generate-skills-ref.py → formatted overview → session context
Agents ↔ Models
Relationship: Model requirement specification
- Agents specify required AI model in frontmatter
- Review agents typically require "opus" for comprehensive analysis
- Model choice affects depth and quality of analysis
TodoWrite ↔ Skills
Relationship: Progress tracking integration
- Multi-step skills create TodoWrite items
- Each phase updates todo status (pending → in_progress → completed)
- Provides user visibility into workflow progress
Key Architectural Decisions
1. Parallel vs Sequential Reviews
Decision: Reviews run in parallel, not sequentially Rationale: 3x faster feedback, comprehensive coverage, easier prioritization Implementation: Single message with multiple Task calls
2. Session Context Injection
Decision: Load all skills metadata at session start Rationale: Ensures Claude always knows available capabilities Trade-off: Larger initial context vs. consistent skill awareness
3. Mandatory Workflows
Decision: Some skills (using-ring) are non-negotiable Rationale: Prevents common failures, enforces best practices Enforcement: Loaded automatically, contains strict instructions
4. Skill vs Agent Separation
Decision: Skills for workflows, agents for analysis Rationale: Different execution models (local vs. subagent) Benefit: Clear separation of concerns
5. Frontmatter-Driven Discovery
Decision: All metadata in YAML frontmatter Rationale: Single source of truth, easy parsing, consistent structure Usage: Auto-generation of documentation, skill matching
Extension Points
Adding New Skills
- Create
skills/{name}/SKILL.mdwith frontmatter - Skills auto-discovered by generate-skills-ref.py
- Available immediately after session restart
Adding New Agents
- Create
{plugin}/agents/{name}.mdwith model specification - Include YAML frontmatter:
name,description,model,version - Invoke via Task tool with
subagent_type="ring:{name}" - Review agents can run in parallel via
/ring:codereview - Developer agents provide domain expertise via direct Task invocation
Adding New Commands
- Create
commands/{name}.md - Reference skill or agent to invoke
- Available via
/ring:{name}
Adding Shared Patterns
- Create
skills/shared-patterns/{pattern}.md - Reference from skills that need the pattern
- Maintains consistency across skills
Adding New Plugins
- Create plugin directory:
mkdir -p {plugin-name}/{skills,agents,commands,hooks,lib} - Register in
.claude-plugin/marketplace.json:
(Note: Initial version is 0.1.0, then managed via version bumps){ "name": "ring-{plugin-name}", "version": "0.1.0", "source": "./{plugin-name}", "keywords": [...] } - Create
{plugin-name}/hooks/hooks.jsonfor initialization - Add skills/agents following same structure as
default/
Performance Considerations
Parallel Execution Benefits
- 3x faster reviews - All reviewers run simultaneously
- No blocking - Independent agents don't wait for each other
- Better resource utilization - Multiple Claude instances work concurrently
Context Management
- Session start overhead - One-time loading of skills context
- Skill invocation - Skills expand inline, no additional calls
- Agent invocation - Separate instances, clean context per agent
Optimization Strategies
- Selective agent usage - Only invoke relevant reviewers
- Skill caching - Skills loaded once per session
- Parallel by default - Never chain reviewers sequentially
- Early validation - Preflight checks prevent wasted work
Common Patterns and Anti-Patterns
Patterns to Follow
✅ Check for relevant skills before any task ✅ Run reviewers in parallel for speed ✅ Use TodoWrite for multi-step workflows ✅ Reference shared patterns for consistency ✅ Specify models explicitly for agents
Anti-Patterns to Avoid
❌ Skipping skill checks (violates using-ring) ❌ Running reviewers sequentially (3x slower) ❌ Implementing without tests (violates TDD) ❌ Claiming completion without verification ❌ Hardcoding workflows instead of using skills
Troubleshooting Guide
Skills Not Loading
- Check hooks/hooks.json configuration
- Verify session-start.sh is executable
- Ensure SKILL.md has valid frontmatter
Parallel Reviews Not Working
- Ensure all Task calls in single message
- Verify model specification (opus required)
- Check agent names match exactly
Commands Not Recognized
- Verify command file exists in commands/
- Check command name matches file name
- Ensure proper frontmatter in command file
Context Overflow
- Consider selective skill loading
- Use focused agent invocations
- Clear completed todos regularly
Summary
Ring's architecture is designed for:
- Modularity - Independent, composable components across multiple plugins
- Performance - Parallel execution wherever possible (3x faster reviews)
- Reliability - Mandatory workflows prevent failures
- Extensibility - Easy to add new skills/agents/commands/plugins
- Scalability - Marketplace structure supports product and team-specific plugins
- Integration - Seamless with Claude Code's native tools
Current State
Component counts reflect current state; plugin versions managed in .claude-plugin/marketplace.json
| Component | Count | Location |
|---|---|---|
| Active Plugins | 7 | default/, dev-team/, finops-team/, pm-team/, ralph-wiggum/, tw-team/, beads/ |
| Skills (ring-default) | 20 | default/skills/ |
| Skills (ring-dev-team) | 2 | dev-team/skills/ |
| Skills (ring-finops-team) | 6 | finops-team/skills/ |
| Skills (ring-pm-team) | 9 | pm-team/skills/ |
| Skills (ralph-wiggum) | 1 | ralph-wiggum/skills/ |
| Skills (ring-tw-team) | 7 | tw-team/skills/ |
| Skills (beads) | 1 | beads/skills/ |
| Total Skills | 46 | All plugins |
| Agents (ring-default) | 5 | default/agents/ |
| Agents (ring-dev-team) | 10 | dev-team/agents/ |
| Agents (ring-finops-team) | 2 | finops-team/agents/ |
| Agents (ring-tw-team) | 3 | tw-team/agents/ |
| Total Agents | 20 | All plugins |
| Commands (ring-default) | 6 | default/commands/ |
| Commands (ring-pm-team) | 2 | pm-team/commands/ |
| Commands (ralph-wiggum) | 3 | ralph-wiggum/commands/ |
| Commands (ring-tw-team) | 3 | tw-team/commands/ |
| Total Commands | 14 | All plugins |
| Hooks | Per plugin | {plugin}/hooks/ |
| Lib utilities | 9 | default/lib/ |
The system achieves these goals through clear component separation, structured workflows, automatic context management, and a modular marketplace architecture, creating a robust foundation for AI-assisted software development.