Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计未展示

ring%3adev-refactor环%3adev 重构

Agent Skill

ring%3adev-refactor 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

855

周安装

36

GitHub Stars

180

下载量

1
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ring%3adev-refactor(环%3adev 重构)
来源仓库:https://github.com/lerianstudio/ring
仓库路径:skills/ring%3Adev-refactor
安装命令:
npx skills add https://github.com/lerianstudio/ring --skill ring:dev-refactor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lerianstudio/ring --skill ring:dev-refactor

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 支持基于关键词、任务场景或来源线索进行信息检索与筛选。
  • 通过 GitHub 仓库获取技能定义,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • ring%3adev-refactor 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Dev Refactor Skill

Analyzes existing codebase against Ring/Lerian standards and generates refactoring tasks compatible with ring:dev-cycle.


⛔ MANDATORY GAP PRINCIPLE (NON-NEGOTIABLE)

any divergence from Ring standards = MANDATORY gap to implement.

<cannot_skip>

  • All divergences are gaps - Every difference MUST be tracked as FINDING-XXX
  • Severity affects PRIORITY, not TRACKING - Low severity = lower priority, not "optional"
  • No filtering allowed - You CANNOT decide which divergences "matter"
  • No alternative patterns accepted - Different approach = STILL A GAP
  • No cosmetic exceptions - Naming, formatting, structure differences = GAPS </cannot_skip>

Non-negotiable, not open to interpretation—a HARD RULE.

Anti-Rationalization: Mandatory Gap Principle

See shared-patterns/shared-anti-rationalization.md for:

  • Refactor Gap Tracking section (mandatory gap principle rationalizations)
  • Gate Execution section (workflow skip rationalizations)
  • TDD section (test-first rationalizations)
  • Universal section (general anti-patterns)

Verification Rule

COUNT(non-✅ items in all Standards Coverage Tables) == COUNT(FINDING-XXX entries)

If counts don't match → SKILL FAILURE. Go back and add missing findings.

Severity Calibration

SeverityCriteriaExamples
CRITICALSecurity risk, data corruption, production blockerExposed credentials, SQL injection, missing auth
HIGHMajor standards violation, architecture issueMissing hexagonal architecture, wrong library usage
MEDIUMCode quality, maintainability issuesIncomplete observability, naming conventions
LOWBest practices, documentationMissing comments, minor refactoring

MANDATORY: Track all severities. Severity affects priority of execution, not whether to track.


⛔ Architecture Pattern Applicability

Not all architecture patterns apply to all services. Before flagging gaps, verify the pattern is applicable.

Service TypeHexagonal/Clean ArchitectureDirectory Structure
CRUD API (with services, adapters)✅ APPLY✅ APPLY (Lerian pattern)
Complex business logic✅ APPLY✅ APPLY
Multiple bounded contexts✅ APPLY✅ APPLY
Event-driven systems✅ APPLY✅ APPLY
Simple scripts/utilities❌ not APPLICABLE❌ not APPLICABLE
CLI tools❌ not APPLICABLE❌ not APPLICABLE
Workers/background jobs❌ not APPLICABLE❌ not APPLICABLE
Simple lambda/functions❌ not APPLICABLE❌ not APPLICABLE

Detection Criteria

CRUD API (Hexagonal/Lerian Pattern APPLICABLE):

  • Service exposes API endpoints (REST, gRPC, GraphQL)
  • Contains business logic and models
  • Has CRUD operations (Create, Read, Update, Delete)
  • Uses repositories for data access
  • MUST follow Hexagonal Architecture and Lerian directory pattern

Simple Service (Hexagonal/Lerian not applicable):

  • CLI tools and scripts
  • Workers and background jobs
  • Simple utility functions
  • Lambda functions with single responsibility
  • No business logic layer

Agent Instruction

When dispatching specialist agents, include:

⛔ ARCHITECTURE APPLICABILITY CHECK:
1. If service is an API with CRUD operations → APPLY Hexagonal/Lerian standards
2. If service is CLI tool, script, or simple utility → Do not flag Hexagonal/Lerian gaps

CRUD APIs MUST follow Hexagonal Architecture (ports/adapters) and Lerian directory pattern.

⛔ MANDATORY: Initialize Todo List FIRST

Before any other action, create the todo list with all steps:

TodoWrite:
  todos:
    - content: "Validate PROJECT_RULES.md exists"
      status: "pending"
      activeForm: "Validating PROJECT_RULES.md exists"
    - content: "Detect project stack (Go/TypeScript backend only)"
      status: "pending"
      activeForm: "Detecting project stack"
    - content: "Read PROJECT_RULES.md for context"
      status: "pending"
      activeForm: "Reading PROJECT_RULES.md"
    - content: "Generate codebase report via ring:codebase-explorer"
      status: "pending"
      activeForm: "Generating codebase report"
    - content: "Dispatch specialist agents in parallel"
      status: "pending"
      activeForm: "Dispatching specialist agents"
    - content: "Save individual agent reports"
      status: "pending"
      activeForm: "Saving agent reports"
    - content: "Map agent findings to FINDING-XXX entries"
      status: "pending"
      activeForm: "Mapping agent findings"
    - content: "Generate findings.md"
      status: "pending"
      activeForm: "Generating findings.md"
    - content: "Map findings 1:1 to REFACTOR-XXX tasks"
      status: "pending"
      activeForm: "Mapping findings to tasks (1:1)"
    - content: "Generate tasks.md"
      status: "pending"
      activeForm: "Generating tasks.md"
    - content: "Generate visual change report"
      status: "pending"
      activeForm: "Generating visual change report"
    - content: "Get user approval"
      status: "pending"
      activeForm: "Getting user approval"
    - content: "Save all artifacts"
      status: "pending"
      activeForm: "Saving artifacts"
    - content: "Handoff to ring:dev-cycle"
      status: "pending"
      activeForm: "Handing off to ring:dev-cycle"

This is NON-NEGOTIABLE. Do not skip creating the todo list.


⛔ CRITICAL: Specialized Agents Perform All Tasks

See shared-patterns/shared-orchestrator-principle.md for full ORCHESTRATOR principle, role separation, forbidden/required actions, step-to-agent mapping, and anti-rationalization table.

Summary: You orchestrate. Agents execute. If using Bash/Grep/Read to analyze code → STOP. Dispatch agent.


Step 1: Validate PROJECT_RULES.md

TodoWrite: Mark "Validate PROJECT_RULES.md exists" as in_progress

<block_condition>

  • docs/PROJECT_RULES.md does not exist </block_condition>

If condition is true, output blocker and TERMINATE. Otherwise continue to Step 1.

Check: Does docs/PROJECT_RULES.md exist?

  • YES → Mark todo as completed, continue to Step 1
  • no → Output blocker and TERMINATE:
## BLOCKED: PROJECT_RULES.md Not Found

Cannot proceed without project standards baseline.

**Required Action:** Create `docs/PROJECT_RULES.md` with:
- Architecture patterns
- Code conventions
- Testing requirements
- Technology stack decisions

Re-run after file exists.

Step 1: Detect Project Stack

TodoWrite: Mark "Detect project stack (Go/TypeScript)" as in_progress

⛔ SCOPE: BACKEND CODE ONLY. This skill analyzes backend code exclusively. MUST use ring:dev-refactor-frontend for frontend code (React, Next.js, Vue, Angular).

Check for backend manifest files:

File/PatternStackAgent
go.modGo Backendring:backend-engineer-golang
package.json + Express/Fastify/NestJS (no React/Next.js)TypeScript Backendring:backend-engineer-typescript

Detection Logic:

  • go.mod exists → Add Go backend agent
  • package.json exists + Express/Fastify/NestJS in dependencies (NO React/Next.js) → Add TypeScript backend agent
  • package.json exists + React/Next.js in dependencies → STOP: This is a frontend project. Use ring:dev-refactor-frontend instead.

⛔ FORBIDDEN: Dispatching ring:frontend-engineer, ring:frontend-designer, ring:ui-engineer, ring:qa-analyst-frontend, or ring:frontend-bff-engineer-typescript from this skill. These are frontend agents and belong to ring:dev-refactor-frontend.

TodoWrite: Mark "Detect project stack (Go/TypeScript)" as completed


Step 2: Read PROJECT_RULES.md

TodoWrite: Mark "Read PROJECT_RULES.md for context" as in_progress

Read tool: docs/PROJECT_RULES.md

Extract project-specific conventions for agent context.

TodoWrite: Mark "Read PROJECT_RULES.md for context" as completed


Step 3: Generate Codebase Report

TodoWrite: Mark "Generate codebase report via ring:codebase-explorer" as in_progress

⛔ MANDATORY: Use Task Tool with ring:codebase-explorer

<dispatch_required agent="ring:codebase-explorer"> Generate a comprehensive codebase report describing WHAT EXISTS.

Include:

  • Project structure and directory layout
  • Architecture pattern (hexagonal, clean, etc.)
  • Technology stack from manifests
  • Code patterns: config, database, handlers, errors, telemetry, testing
  • Key files inventory with file:line references
  • Code snippets showing current implementation patterns </dispatch_required>

<output_required>

EXPLORATION SUMMARY

[Your summary here]

KEY FINDINGS

[Your findings here]

ARCHITECTURE INSIGHTS

[Your insights here]

RELEVANT FILES

[Your file inventory here]

RECOMMENDATIONS

[Your recommendations here] </output_required>

Do not complete without outputting full report in the format above.

Anti-Rationalization Table for Step 3

See shared-patterns/anti-rationalization-codebase-explorer.md for the ring:codebase-explorer dispatch anti-rationalization table.

FORBIDDEN Actions for Step 3

Any of these = IMMEDIATE SKILL FAILURE.

REQUIRED Action for Step 3

✅ Task(subagent_type="ring:codebase-explorer", ...)

Timestamp format: {timestamp} = YYYY-MM-DDTHH:MM:SS (e.g., 2026-02-07T22:30:45). Generate once at start, reuse for all artifacts.

After Task completes, save with Write tool:

Write tool:
  file_path: "docs/ring:dev-refactor/{timestamp}/codebase-report.md"
  content: [Task output]

TodoWrite: Mark "Generate codebase report via ring:codebase-explorer" as completed


Step 4: Dispatch Specialist Agents

TodoWrite: Mark "Dispatch specialist agents in parallel" as in_progress

⛔ File Size Enforcement (MANDATORY)

See shared-patterns/file-size-enforcement.md for thresholds, cohesion judgment, and agent instructions.

All analysis agents MUST flag files exceeding 1000 lines as ISSUE-XXX (converted to FINDING-XXX during Step 4.1 mapping, like all other agent issues). Files 1001-1500 lines = HIGH severity (subject to cohesion override — document reasoning if kept). Files > 1500 lines = CRITICAL with mandatory decomposition plan unless cohesion justification is documented. Each oversized file = one ISSUE-XXX (not grouped). Test files are included — large test files are equally hard to maintain.

⛔ HARD GATE: Verify codebase-report.md Exists

BEFORE dispatching any specialist agent, verify:

Check 1: Does docs/ring:dev-refactor/{timestamp}/codebase-report.md exist?
  - YES → Continue to dispatch agents
  - no  → STOP. Go back to Step 3.

Check 2: Was codebase-report.md created by ring:codebase-explorer?
  - YES → Continue
  - no (created by Bash output) → DELETE IT. Go back to Step 3. Use correct agent.

If you skipped Step 3 or used Bash instead of Task tool → You MUST go back and redo Step 3 correctly.

Dispatch all applicable agents in ONE message (parallel):

⛔ MANDATORY: Reference Standards Coverage Table

All agents MUST follow shared-patterns/standards-coverage-table.md which defines:

  • all sections to check per agent (including DDD)
  • Required output format (Standards Coverage Table)
  • Anti-rationalization rules
  • Completeness verification

Section indexes are pre-defined in shared-patterns. Agents MUST check all sections listed.


For Go projects:

<parallel_dispatch agents="ring:backend-engineer-golang, ring:qa-analyst, ring:qa-analyst[goroutine-leak], ring:devops-engineer, ring:sre"> MUST dispatch all five agents in parallel via Task tool. Input: codebase-report.md, PROJECT_RULES.md </parallel_dispatch>

Task tool 1:
  subagent_type: "ring:backend-engineer-golang"
  description: "Go standards analysis"
  prompt: |
    **MODE: ANALYSIS only**

    ⛔ MANDATORY: Check all sections in golang.md per shared-patterns/standards-coverage-table.md

    ⛔ FRAMEWORKS & LIBRARIES DETECTION (MANDATORY):
    1. Read go.mod to extract all dependencies used in codebase
    2. Load golang.md standards via WebFetch → extract all listed frameworks/libraries
    3. For each category in standards (HTTP, Database, Validation, Testing, etc.):
       - Compare codebase dependency vs standards requirement
       - If codebase uses DIFFERENT library than standards → ISSUE-XXX
       - If codebase is MISSING required library → ISSUE-XXX
    4. any library not in standards that serves same purpose = ISSUE-XXX

    ⛔ FILE SIZE ENFORCEMENT (MANDATORY):
    - Any source file > 1000 lines (including test files, excluding auto-generated: *.pb.go, */generated/*, */mocks*) MUST be flagged as ISSUE-XXX
    - 1001-1500 lines: severity HIGH (subject to cohesion override — document reasoning if kept)
    - > 1500 lines: severity CRITICAL with explicit decomposition plan unless cohesion justification is documented
    - Apply cohesion judgment: state machines, parsers, schemas, table-driven tests, tightly-coupled domain logic may remain whole if splitting creates artificial boundaries or import gymnastics
    - Include current line count and proposed split strategy (or cohesion rationale to keep) in each finding
    - See shared-patterns/file-size-enforcement.md for split patterns and cohesion judgment
    - Reference: golang/domain.md → File Organization (MANDATORY)

    Input:
    - Ring Standards: Load via WebFetch (golang.md)
    - Section Index: See shared-patterns/standards-coverage-table.md → "ring:backend-engineer-golang"
    - Codebase Report: docs/ring:dev-refactor/{timestamp}/codebase-report.md
    - Project Rules: docs/PROJECT_RULES.md

    ⛔ MULTI-TENANT ANALYSIS (MANDATORY):
    See [shared-patterns/multi-tenant-analysis.md](../shared-patterns/multi-tenant-analysis.md) for the full checklist.

    Output:
    1. Standards Coverage Table (per shared-patterns format)
    2. ISSUE-XXX for each ⚠️/❌ finding with: Pattern name, Severity, file:line, Current Code, Expected Code

Task tool 2:
  subagent_type: "ring:qa-analyst"
  description: "Test coverage analysis"
  prompt: |
    **MODE: ANALYSIS only**
    Check all testing sections per shared-patterns/standards-coverage-table.md → "ring:qa-analyst"
    Input: codebase-report.md, PROJECT_RULES.md
    Output: Standards Coverage Table + ISSUE-XXX for gaps

Task tool 3:
  subagent_type: "ring:devops-engineer"
  description: "DevOps analysis"
  prompt: |
    **MODE: ANALYSIS only**
    Check all 8 sections per shared-patterns/standards-coverage-table.md → "ring:devops-engineer"
    ⛔ "Containers" means BOTH Dockerfile and Docker Compose
    ⛔ "Makefile Standards" means all required commands: build, lint, test, cover, up, down, etc.
    Input: codebase-report.md, PROJECT_RULES.md
    Output: Standards Coverage Table + ISSUE-XXX for gaps

Task tool 4:
  subagent_type: "ring:sre"
  description: "Observability analysis"
  prompt: |
    **MODE: ANALYSIS only**
    Check all 6 sections per shared-patterns/standards-coverage-table.md → "ring:sre"
    Input: codebase-report.md, PROJECT_RULES.md
    Output: Standards Coverage Table + ISSUE-XXX for gaps

Task tool 5 (Go only):
  subagent_type: "ring:qa-analyst"
  description: "Goroutine leak analysis"
  prompt: |
    **MODE: ANALYSIS only**
    **test_mode: goroutine-leak**

    ⛔ GOROUTINE LEAK DETECTION MODE

    ## Standards Reference
    https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/golang/architecture.md
    Focus on: Goroutine Leak Detection (MANDATORY) section

    ## Analysis Steps

    ### 1. Detect Goroutine Usage
    Scan all Go files for:
    - `go func()` patterns (anonymous goroutines)
    - `go methodCall()` patterns (direct calls)
    - Channel consumers (`for range channel`)
    - Worker pools and background services

    ### 2. Verify goleak Coverage
    For each package with goroutines:
    - Check for `goleak.VerifyTestMain(m)` in TestMain
    - Check for `defer goleak.VerifyNone(t)` in relevant tests
    - Verify go.uber.org/goleak is in go.mod

    ### 3. Identify Gaps
    Create ISSUE-XXX for:
    - Packages with goroutines but no goleak tests
    - Missing goleak.VerifyTestMain in packages with workers
    - Missing goleak.VerifyNone in specific tests

    Input:
    - Codebase Report: docs/ring:dev-refactor/{timestamp}/codebase-report.md
    - Project Rules: docs/PROJECT_RULES.md

    Output:
    ## Goroutine Detection Summary
    | File | Line | Pattern | Package |
    |------|------|---------|---------|

    ## goleak Coverage
    | Package | Goroutine Files | goleak Present | Status |
    |---------|-----------------|----------------|--------|

    ## Issues Found
    ISSUE-XXX for each gap (missing goleak, missing TestMain, etc.)

For TypeScript Backend projects:

<parallel_dispatch agents="ring:backend-engineer-typescript, ring:qa-analyst, ring:devops-engineer, ring:sre"> All four agents MUST be dispatched in parallel via Task tool. Input: codebase-report.md, PROJECT_RULES.md </parallel_dispatch>

Task tool 1:
  subagent_type: "ring:backend-engineer-typescript"
  description: "TypeScript backend standards analysis"
  prompt: |
    **MODE: ANALYSIS only**

    ⛔ MANDATORY: Check all sections in typescript.md per shared-patterns/standards-coverage-table.md

    ⛔ FRAMEWORKS & LIBRARIES DETECTION (MANDATORY):
    1. Read package.json to extract all dependencies used in codebase
    2. Load typescript.md standards via WebFetch → extract all listed frameworks/libraries
    3. For each category in standards (Backend Framework, ORM, Validation, Testing, etc.):
       - Compare codebase dependency vs standards requirement
       - If codebase uses DIFFERENT library than standards → ISSUE-XXX
       - If codebase is MISSING required library → ISSUE-XXX
    4. any library not in standards that serves same purpose = ISSUE-XXX

    ⛔ FILE SIZE ENFORCEMENT (MANDATORY):
    - Any source file > 1000 lines (including test files, excluding auto-generated: *.d.ts, *.gen.ts, *.generated.ts, */generated/*, */__generated__/*) MUST be flagged as ISSUE-XXX
    - 1001-1500 lines: severity HIGH (subject to cohesion override — document reasoning if kept)
    - > 1500 lines: severity CRITICAL with explicit decomposition plan unless cohesion justification is documented
    - Apply cohesion judgment: state machines, parsers, schemas, table-driven tests, tightly-coupled domain logic may remain whole if splitting creates artificial boundaries or import gymnastics
    - Include current line count and proposed split strategy (or cohesion rationale to keep) in each finding
    - See shared-patterns/file-size-enforcement.md for split patterns and cohesion judgment
    - Reference: typescript.md → File Organization (MANDATORY)

    ⛔ MULTI-TENANT ANALYSIS (MANDATORY):
    See [shared-patterns/multi-tenant-analysis.md](../shared-patterns/multi-tenant-analysis.md) for the full checklist.

    Input:
    - Ring Standards: Load via WebFetch (typescript.md)
    - Section Index: See shared-patterns/standards-coverage-table.md → "ring:backend-engineer-typescript"
    - Codebase Report: docs/ring:dev-refactor/{timestamp}/codebase-report.md
    - Project Rules: docs/PROJECT_RULES.md

    Output:
    1. Standards Coverage Table (per shared-patterns format)
    2. ISSUE-XXX for each ⚠️/❌ finding with: Pattern name, Severity, file:line, Current Code, Expected Code

Agent Dispatch Summary

Stack DetectedAgents to Dispatch
Go onlyTask 1 (Go) + Task 2-4 + Task 5 (goroutine-leak)
TypeScript Backend onlyTask 1 (TS Backend) + Task 2-4

⛔ MUST use ring:dev-refactor-frontend for frontend/BFF projects. This skill does not dispatch frontend agents.

Note: Task 5 (goroutine-leak) is Go-specific. It detects goroutine usage and verifies goleak test coverage.

TodoWrite: Mark "Dispatch specialist agents in parallel" as completed


Step 4.5: Save Individual Agent Reports

TodoWrite: Mark "Save individual agent reports" as in_progress

⛔ MANDATORY: Each agent's output MUST be saved as an individual report file.

After all parallel agent tasks complete, save each agent's output to a separate file:

docs/ring:dev-refactor/{timestamp}/reports/
├── ring:backend-engineer-golang-report.md     (if Go project)
├── ring:backend-engineer-typescript-report.md (if TypeScript Backend)
├── ring:qa-analyst-report.md                  (always)
├── ring:qa-analyst-goroutine-leak-report.md   (if Go project)
├── ring:devops-engineer-report.md             (always)
└── ring:sre-report.md                         (always)

Report File Format

Use Write tool for each agent report:

# {Agent Name} Analysis Report

**Generated:** {timestamp}
**Agent:** {agent-name}
**Mode:** ANALYSIS only

## Standards Coverage Table

{Copy agent's Standards Coverage Table output here}

## Issues Found

{Copy all ISSUE-XXX entries from agent output}

## Summary

- **Total Issues:** {count}
- **Critical:** {count}
- **High:** {count}
- **Medium:** {count}
- **Low:** {count}

---
*Report generated by ring:dev-refactor skill*

Agent Report Mapping

Agent DispatchedReport File Name
ring:backend-engineer-golangring:backend-engineer-golang-report.md
ring:backend-engineer-typescriptring:backend-engineer-typescript-report.md
ring:qa-analystring:qa-analyst-report.md
ring:qa-analyst (goroutine-leak)ring:qa-analyst-goroutine-leak-report.md
ring:devops-engineerring:devops-engineer-report.md
ring:srering:sre-report.md

Anti-Rationalization Table for Step 4.5

RationalizationWhy It's WRONGRequired Action
"I'll combine all reports into one file"Individual reports enable targeted re-runs and trackingSave each agent to SEPARATE file
"Agent output is already visible in chat"Chat history is ephemeral; files are artifactsMUST persist as files
"Only saving reports with issues"Empty reports prove compliance was checkedSave all dispatched agent reports
"findings.md already captures everything"findings.md is processed; reports are raw agent outputSave BOTH raw reports and findings.md

REQUIRED Action for Step 4.5

Write tool:
  file_path: "docs/ring:dev-refactor/{timestamp}/reports/{agent-name}-report.md"
  content: [Agent Task output formatted per template above]

Repeat for each agent dispatched in Step 4.

TodoWrite: Mark "Save individual agent reports" as completed


Step 4.1: Agent Report → Findings Mapping (HARD GATE)

TodoWrite: Mark "Map agent findings to FINDING-XXX entries" as in_progress

⛔ MANDATORY: all agent-reported issues MUST become findings.

Agent ReportAction
Any difference between current code and Ring standard→ Create FINDING-XXX
Any missing pattern from Ring standards→ Create FINDING-XXX
Any deprecated pattern usage→ Create FINDING-XXX
Any observability gap→ Create FINDING-XXX

FORBIDDEN Actions for Step 4.1

❌ Ignoring agent-reported issues because they seem "minor"  → SKILL FAILURE
❌ Filtering out issues based on personal judgment           → SKILL FAILURE
❌ Summarizing multiple issues into one finding              → SKILL FAILURE
❌ Skipping issues without ISSUE-XXX format from agent       → SKILL FAILURE
❌ Creating findings only for "interesting" gaps             → SKILL FAILURE

REQUIRED Actions for Step 4.1

✅ Every line item from agent reports becomes a FINDING-XXX entry
✅ Preserve agent's severity assessment exactly as reported
✅ Include exact file:line references from agent report
✅ Every non-✅ item in Standards Coverage Table = one FINDING-XXX
✅ Count findings in Step 5 MUST equal total issues from all agent reports

Anti-Rationalization Table for Step 4.1

⛔ See also: "Anti-Rationalization: Mandatory Gap Principle" at top of this skill.

RationalizationWhy It's WRONGRequired Action
"Multiple similar issues can be one finding"Distinct file:line = distinct finding. Merging loses traceability.One issue = One FINDING-XXX
"Agent report didn't use ISSUE-XXX format"Format varies; presence matters. Every gap = one finding.Extract all gaps into findings
"I'll consolidate to reduce noise"Consolidation = data loss. Noise is signal.Preserve all individual issues
"Some findings are duplicates across agents"Different agents = different perspectives. Keep both.Create separate findings per agent
"Team has approved this deviation"Team approval ≠ standards compliance. Document the gap.Create FINDING-XXX, note team decision
"Fixing this would break existing code"Breaking risk = implementation concern, not tracking concern.Create FINDING-XXX, note risk in description

⛔ MANDATORY GAP RULE FOR STEP 4.1

Per the Mandatory Gap Principle (see top of skill): any divergence from Ring standards = FINDING-XXX.

This means:

  • ✅ items in Standards Coverage Table = No finding needed
  • ⚠️ items = MUST create FINDING-XXX (partial compliance is a gap)
  • ❌ items = MUST create FINDING-XXX (non-compliance is a gap)
  • Different pattern = MUST create FINDING-XXX (alternative is still a gap)

Verification: Use formula from "Mandatory Gap Principle → Verification Rule" section.

⛔ Gate Escape Detection (Anti-Duplication)

When mapping findings, identify which gate SHOULD have caught the issue:

Finding CategoryShould Be Caught InFlag
Missing edge case testsGate 3 (Testing)🚨 GATE 3 ESCAPE
Test isolation issuesGate 3 (Testing)🚨 GATE 3 ESCAPE
Skipped/assertion-less testsGate 3 (Testing)🚨 GATE 3 ESCAPE
Test naming conventionGate 3 (Testing)🚨 GATE 3 ESCAPE
Missing test coverageGate 3 (Testing)🚨 GATE 3 ESCAPE
TDD RED phase missingGate 3 (Testing)🚨 GATE 3 ESCAPE
Implementation pattern gapsGate 0 (Implementation)Normal finding
Standards compliance gapsGate 0 (Implementation)Normal finding
Observability gapsGate 2 (SRE)🚨 GATE 2 ESCAPE
Docker/DevOps gapsGate 1 (DevOps)🚨 GATE 1 ESCAPE

Gate Escape Output Format:

### FINDING-XXX: [Issue Title] 🚨 GATE 3 ESCAPE

**Escaped From:** Gate 3 (Testing)
**Why It Escaped:** [Quality Gate check that should have caught this]
**Prevention:** [Specific check to add to Gate 3 exit criteria]

[Rest of finding format...]

Purpose: Track which issues escape which gates. If many GATE 3 ESCAPE findings occur, the Quality Gate checks need strengthening.


Summary Table (MANDATORY at end of findings.md):

## Gate Escape Summary

| Gate | Escaped Issues | Most Common Type |
|------|----------------|------------------|
| Gate 0 (Implementation) | N | [type] |
| Gate 1 (DevOps) | N | [type] |
| Gate 2 (SRE) | N | [type] |
| Gate 3 (Testing) | N | [type] |

**Action Required:** If any gate has >2 escapes, review that gate's exit criteria.

TodoWrite: Mark "Map agent findings to FINDING-XXX entries" as completed


Step 5: Generate findings.md

TodoWrite: Mark "Generate findings.md" as in_progress

⛔ HARD GATE: Verify All Issues Are Mapped

BEFORE creating findings.md, apply the Verification Rule from "Mandatory Gap Principle" section.

If counts don't match → STOP. Go back to Step 4.1. Map missing issues.

FORBIDDEN Actions for Step 5

❌ Creating findings.md with fewer entries than agent issues  → SKILL FAILURE
❌ Omitting file:line references from findings                → SKILL FAILURE
❌ Using vague descriptions instead of specific code excerpts → SKILL FAILURE
❌ Skipping "Why This Matters" section for any finding        → SKILL FAILURE
❌ Generating findings.md without reading all agent reports   → SKILL FAILURE

REQUIRED Actions for Step 5

✅ Every FINDING-XXX includes: Severity, Category, Agent, Standard reference
✅ Every FINDING-XXX includes: Current Code with exact file:line
✅ Every FINDING-XXX includes: Ring Standard Reference with URL
✅ Every FINDING-XXX includes: Required Changes as numbered actions
✅ Every FINDING-XXX includes: Why This Matters with Problem/Standard/Impact
✅ Total finding count MUST match total issues from Step 4.1

Anti-Rationalization Table for Step 5

RationalizationWhy It's WRONGRequired Action
"I'll add details later during implementation"findings.md is the source of truth. Incomplete = useless.Complete all sections for every finding
"Code snippet is too long to include"Truncate to relevant lines, but never omit. Context is required.Include code with file:line reference
"Standard URL is obvious, skip it"Agents and humans need direct links. Nothing is obvious.Include full URL for every standard
"Why This Matters is redundant"It explains business impact. Standards alone don't convey urgency.Write Problem/Standard/Impact for all
"Some findings are self-explanatory"Self-explanatory to you ≠ clear to implementer.Complete all sections without exception
"I'll group small findings together"Each finding = one task in Step 6. findings.md = atomic issues.One finding = one FINDING-XXX entry

Use Write tool to create findings.md:

⛔ CRITICAL: Every issue reported by agents in Step 4 MUST appear here as a FINDING-XXX entry.

# Findings: {project-name}

**Generated:** {timestamp}
**Total Findings:** {count}

## ⛔ Mandatory Gap Principle Applied

**all divergences from Ring standards are tracked below. No filtering applied.**

| Metric | Count |
|--------|-------|
| Total non-✅ items from agent reports | {X} |
| Total FINDING-XXX entries below | {X} |
| **Counts match?** | ✅ YES (REQUIRED) |

**Severity does not affect tracking - all gaps are mandatory:**
| Severity | Count | Priority | Tracking |
|----------|-------|----------|----------|
| Critical | {N} | Execute first | **MANDATORY** |
| High | {N} | Execute in current sprint | **MANDATORY** |
| Medium | {N} | Execute in next sprint | **MANDATORY** |
| Low | {N} | Execute when capacity | **MANDATORY** |

---

## FINDING-001: {Pattern Name}

**Severity:** Critical | High | Medium | Low (all MANDATORY)
**Category:** {lib-commons | architecture | testing | devops}
**Agent:** {agent-name}
**Standard:** {file}.md:{section}

### Current Code

// file: {path}:{lines} {actual code}


### Ring Standard Reference

**Standard:** {standards-file}.md → Section: {section-name} **Pattern:** {pattern-name} **URL:** [https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/{file}.md](https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/%7Bfile%7D.md)

### Required Changes

1. {action item 1 - what to change}
2. {action item 2 - what to add/remove}
3. {action item 3 - pattern to follow}

### Why This Matters

- **Problem:** {what is wrong with current code}
- **Standard Violated:** {specific section from Ring standards}
- **Impact:** {business/technical impact if not fixed}

---

## FINDING-002:...

TodoWrite: Mark "Generate findings.md" as completed


Step 6: Map Findings to Tasks (Clustered by file + pattern)

TodoWrite: Mark "Map findings 1:1 to REFACTOR-XXX tasks" as in_progress

Clustering Rule (replaces former 1:1 mapping)

Findings are clustered into REFACTOR tasks by the tuple (file_path, pattern_category).

Clustering Algorithm

  1. Group all findings by their file field (from agent report).
  2. Within each file group, sub-group by pattern_category:

- pattern_category is derived from the finding's "Category" field - (e.g., "error-handling", "logging", "multi-tenant", "file-size", etc.)

  1. Each (file, pattern_category) tuple becomes ONE REFACTOR-XXX task.
  2. If a file has findings in 3 different pattern categories → 3 REFACTOR tasks for that file.
  3. If a pattern category spans multiple files → one task per (file, pattern) pair (no cross-file clustering).

Traceability Preservation (MANDATORY)

Every REFACTOR task MUST include a findings: array listing all FINDING-XXX IDs it covers:

~~~markdown

REFACTOR-005: Error Wrapping Pattern in internal/handler/user.go

Cluster Key: (internal/handler/user.go, error-handling) Findings Covered: [FINDING-012, FINDING-015, FINDING-018] Severity: HIGH (max of covered findings' severities) Effort: {sum of covered findings' effort estimates}

Findings Breakdown

FindingLineDescriptionStatus
FINDING-012user.go:45return err without wrappending
FINDING-015user.go:78return err without wrappending
FINDING-018user.go:102return err without wrappending

~~~

During dev-cycle execution, each finding's status is tracked per-line inside the REFACTOR task. A REFACTOR task completes only when all covered findings are resolved.

Mapping Verification (updated)

Before proceeding to Step 7, verify:

  • Total FINDING-XXX in findings.md: X
  • Total REFACTOR-XXX in tasks.md: Y (Y ≤ X — clustering reduces count)
  • Every FINDING-XXX appears in exactly ONE REFACTOR task's findings: array
  • NO FINDING-XXX is missing from all REFACTOR tasks
  • NO FINDING-XXX appears in multiple REFACTOR tasks

If any finding is orphan or duplicated → STOP. Fix clustering.

Anti-Rationalization Table for Step 6

RationalizationWhy It's WRONGRequired Action
"Just keep 1:1 mapping, it's simpler"1:1 mapping multiplies cycle cost ~5x for typical refactors. Clustering preserves traceability.Apply (file, pattern) clustering
"Cluster across files to reduce tasks more"Cross-file clustering hides file-specific blast radius. Only cluster within a file.Cluster only within file
"Skip the findings: array, it's redundant"Without traceability array, findings get lost inside tasks.ALWAYS populate findings: array
"One finding can be in multiple tasks"Duplicates cause double-fix attempts. One finding → one task.Each FINDING in exactly one REFACTOR

TodoWrite: Mark "Map findings 1:1 to REFACTOR-XXX tasks" as completed


Step 7: Generate tasks.md

TodoWrite: Mark "Generate tasks.md" as in_progress

Use Write tool to create tasks.md:

# Refactoring Tasks: {project-name}

**Source:** findings.md
**Total Tasks:** {count}

## ⛔ Mandatory Clustering Traceability Verification

**Findings are clustered by (file, pattern_category). Every FINDING-XXX appears in exactly one REFACTOR-XXX via its `findings:` array.**

| Metric | Count |
|--------|-------|
| Total FINDING-XXX in findings.md | {X} |
| Total REFACTOR-XXX in tasks.md | {Y} (Y ≤ X — clustering reduces count) |
| **Every finding appears in exactly one task?** | ✅ YES (REQUIRED) |
| Orphan findings (in zero tasks) | 0 (REQUIRED) |
| Duplicate findings (in 2+ tasks) | 0 (REQUIRED) |

**Priority affects execution order, not whether to include:**
- Critical/High tasks: Execute first
- Medium tasks: Execute in current cycle
- Low tasks: Execute when capacity - STILL MANDATORY TO COMPLETE

---

## REFACTOR-001: {Finding Pattern Name} in {file_path}

**Cluster Key:** ({file_path}, {pattern_category})
**Findings Covered:** [FINDING-XXX, FINDING-YYY, ...]
**Severity:** Critical | High | Medium | Low (max of covered findings' severities; all ARE MANDATORY)
**Category:** {lib-commons | architecture | testing | devops}
**Agent:** {agent-name}
**Effort:** {hours}h (sum of covered findings' effort estimates)
**Dependencies:** {other REFACTOR-XXX tasks or none}

### Findings Breakdown
| Finding | Line | Description | Status |
|---------|------|-------------|--------|
| FINDING-XXX | {file}:{line} | {short description} | pending |
| FINDING-YYY | {file}:{line} | {short description} | pending |

### Current Code

// file: {path}:{lines} {representative code from covered findings}


### Ring Standard Reference

| Standard File | Section | URL |
| --- | --- | --- |
| {file}.md | {section} | [Link](https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/%7Bfile%7D.md) |

### Required Actions

1. {action 1 - specific change to make}
2. {action 2 - pattern to implement}

### Acceptance Criteria

- Code follows {standard}.md → {section} pattern
- No {anti-pattern} usage remains
- All covered findings resolved (status: done for each row in Findings Breakdown)
- Tests pass after refactoring

TodoWrite: Mark "Generate tasks.md" as completed


Step 7.5: Visual Change Report

TodoWrite: Mark "Generate visual change report" as in_progress

MANDATORY: Invoke Skill("ring:visualize") to produce a self-contained HTML page showing all planned refactoring changes. This replaces reading raw findings.md / tasks.md markdown for approval decisions.

Read the code-diff template first: Read default/skills/visualize/templates/code-diff.html to absorb the patterns before generating.

Generate the HTML report with these sections:

1. Summary Dashboard

  • Total FINDING-XXX count with severity breakdown (Critical / High / Medium / Low)
  • Total files affected (unique file paths from all findings)
  • Horizontal severity breakdown bar

2. Per-Finding Diff Panels (one section per FINDING-XXX)

For each FINDING-XXX in findings.md:

  • Header: Finding ID, severity badge, category, agent that reported it
  • Before panel: Current Code block from findings.md (with file:line reference, syntax highlighted via Highlight.js)
  • After panel: Ring Standard pattern from Required Changes section (syntax highlighted)
  • Collapsible "Why This Matters": Problem / Standard Violated / Impact from findings.md

3. Task Mapping Table

Table showing: FINDING-XXX → REFACTOR-XXX → Severity → Category → Estimated Effort

Output: Save to docs/ring:dev-refactor/{timestamp}/change-report.html

Open in browser:

macOS: open docs/ring:dev-refactor/{timestamp}/change-report.html
Linux: xdg-open docs/ring:dev-refactor/{timestamp}/change-report.html

Tell the user the file path. The report opens before the approval question so the user can review changes visually.

See shared-patterns/anti-rationalization-visual-report.md for anti-rationalization table.

TodoWrite: Mark "Generate visual change report" as completed


Step 8: User Approval

TodoWrite: Mark "Get user approval" as in_progress

<user_decision> MUST wait for explicit user response before proceeding. Options: Approve all | Critical only | Cancel </user_decision>

AskUserQuestion:
  questions:
    - question: "Review refactoring plan. How to proceed?"
      header: "Approval"
      options:
        - label: "Approve all"
          description: "Proceed to ring:dev-cycle execution"
        - label: "Critical only"
          description: "Execute only Critical/High tasks"
        - label: "Cancel"
          description: "Keep analysis, skip execution"

CANNOT proceed without explicit user selection.

TodoWrite: Mark "Get user approval" as completed


Step 9: Save Artifacts

TodoWrite: Mark "Save all artifacts" as in_progress

docs/ring:dev-refactor/{timestamp}/
├── codebase-report.md  (Step 3)
├── reports/            (Step 4.5)
│   ├── ring:backend-engineer-golang-report.md
│   ├── ring:qa-analyst-report.md
│   ├── ring:devops-engineer-report.md
│   └── ring:sre-report.md
├── findings.md         (Step 5)
├── tasks.md           (Step 7)
└── change-report.html (Step 7.5)

TodoWrite: Mark "Save all artifacts" as completed


Step 10: Handoff to ring:dev-cycle

TodoWrite: Mark "Handoff to ring:dev-cycle" as in_progress

If user approved, use Skill tool to invoke ring:dev-cycle directly:

Skill tool:
  skill: "ring:dev-cycle"

Note: Each REFACTOR task covering N findings is treated as ONE execution unit with N internal acceptance criteria. dev-cycle does not need to know about clustering — it consumes the task as-if it were any other task.

⛔ CRITICAL: Pass tasks file path in context:

After invoking the skill, provide:

  • Tasks file: docs/ring:dev-refactor/{timestamp}/tasks.md
Context for ring:dev-cycle:
  tasks-file: "docs/ring:dev-refactor/{timestamp}/tasks.md"

Where {timestamp} format is YYYY-MM-DDTHH:MM:SS (e.g., 2026-02-07T22:30:45). Use the same timestamp across all artifacts in a single run.

Anti-Rationalization: Skill Invocation

RationalizationWhy It's WRONGRequired Action
"SlashCommand is equivalent to Skill tool"SlashCommand is a hint; Skill tool guarantees skill loadingUse Skill tool, not SlashCommand
"User can run /ring:dev-cycle manually"Manual run risks skill not being loadedInvoke Skill tool directly
"ring:dev-cycle will auto-discover tasks"Explicit path ensures correct file is usedPass explicit tasks path
"User approved, I can skip ring:dev-cycle"Approval = permission to proceed, not skip executionInvoke Skill tool
"Tasks are saved, job is done"Saved tasks without execution = incomplete workflowInvoke Skill tool

⛔ HARD GATE: You CANNOT complete ring:dev-refactor without invoking Skill tool: ring:dev-cycle.

If user approved execution, you MUST:

  1. Invoke Skill tool: ring:dev-cycle
  2. Pass tasks file path: docs/ring:dev-refactor/{timestamp}/tasks.md
  3. Wait for ring:dev-cycle to complete all 10 gates

Skipping this step = SKILL FAILURE.

ring:dev-cycle executes each REFACTOR-XXX task through 10-gate process. After all tasks complete, ring:dev-multi-tenant runs as a post-cycle step to adapt all implemented code for multi-tenant support.

TodoWrite: Mark "Handoff to ring:dev-cycle" as completed


Execution Report

Base metrics per shared-patterns/output-execution-report.md.

MetricValue
DurationXm Ys
IterationsN
ResultPASS/FAIL/PARTIAL

Refactor-Specific Metrics

MetricValue
Agents DispatchedN
Findings GeneratedN
Tasks CreatedN
Artifacts Locationdocs/ring:dev-refactor/{date}/

Output Schema

artifacts:
  - codebase-report.md (Step 3)
  - reports/{agent-name}-report.md (Step 4.5)
  - findings.md (Step 5)
  - tasks.md (Step 7)
  - change-report.html (Step 7.5)

traceability:
  Ring Standard → Agent Report → FINDING-XXX → REFACTOR-XXX → Implementation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.04%
按下载量换算0

Claude

31.08%
按下载量换算0

Cursor

16.63%
按下载量换算0

Gemini CLI

9.41%
按下载量换算0

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills