com um clique
refactor-plan
// Generate a structured refactoring plan for a Cacti package or module. Analyzes current code structure, identifies improvement opportunities, and produces a phased plan with risk assessment.
// Generate a structured refactoring plan for a Cacti package or module. Analyzes current code structure, identifies improvement opportunities, and produces a phased plan with risk assessment.
Triage Cacti CI failures on a PR or main branch, fetch failing job logs via gh CLI, categorize root causes, and produce a structured markdown report at docs/ci-reports/. Use when the user asks why CI is failing, asks for a CI failure report, references a failing PR or run, mentions GitHub Actions failures, or asks to analyze/diagnose pipeline issues in the Hyperledger Cacti monorepo.
Analyze code for common vulnerability patterns using CodeQL-style queries. Identify injection flaws, unsafe deserialization, prototype pollution, path traversal, and other security issues in TypeScript/JavaScript code.
Cross-verify assertions, assumptions, and logic in code or explanations. Use as a quality gate before committing changes. Re-reads relevant code and confirms correctness.
<One sentence describing what knowledge this skill provides.>
| name | refactor-plan |
| description | Generate a structured refactoring plan for a Cacti package or module. Analyzes current code structure, identifies improvement opportunities, and produces a phased plan with risk assessment. |
Generate a structured, risk-assessed refactoring plan for a package or module.
Read the target code and evaluate:
any, unknown, and proper type narrowing.Common refactoring targets in Cacti:
I-prefixed interfaces for dependency
injection and testing.I prefix,
isI type guards).public-api.ts exports are accurate
and minimal.For each proposed change, evaluate:
Break the refactoring into phases that:
# Refactoring Plan: [Package/Module]
## Current State
- **Files**: [count] | **Functions**: [count] | **Lines**: [total]
- **Key concerns**: [summary of issues found]
## Proposed Changes
### Phase 1: [Safe, Non-Breaking Changes]
| # | Change | Files | Risk | Tests |
|---|--------|-------|------|-------|
| 1 | [description] | [files] | Low | [existing/needed] |
### Phase 2: [Structural Improvements]
| # | Change | Files | Risk | Tests |
|---|--------|-------|------|-------|
| 1 | [description] | [files] | Medium | [existing/needed] |
### Phase 3: [Higher-Risk Changes]
| # | Change | Files | Risk | Tests |
|---|--------|-------|------|-------|
| 1 | [description] | [files] | High | [existing/needed] |
## Dependency Map
[which packages are affected by each phase]
## Rollback Strategy
[how to revert each phase independently]