@codeharbor/agent-playbook 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/package.json +5 -2
  2. package/skills/api-designer/README.md +36 -0
  3. package/skills/api-designer/SKILL.md +232 -0
  4. package/skills/api-designer/references/graphql-patterns.md +12 -0
  5. package/skills/api-designer/references/rest-patterns.md +17 -0
  6. package/skills/api-designer/scripts/generate_api.py +87 -0
  7. package/skills/api-designer/scripts/validate_api.py +48 -0
  8. package/skills/api-documenter/README.md +41 -0
  9. package/skills/api-documenter/SKILL.md +209 -0
  10. package/skills/api-documenter/references/examples/README.md +3 -0
  11. package/skills/api-documenter/references/examples/openapi-example.yaml +10 -0
  12. package/skills/api-documenter/references/openapi-template.yaml +5 -0
  13. package/skills/api-documenter/scripts/generate_openapi.py +84 -0
  14. package/skills/api-documenter/scripts/validate_openapi.py +45 -0
  15. package/skills/architecting-solutions/README.md +22 -0
  16. package/skills/architecting-solutions/SKILL.md +459 -0
  17. package/skills/auto-trigger/README.md +23 -0
  18. package/skills/auto-trigger/SKILL.md +183 -0
  19. package/skills/code-reviewer/README.md +59 -0
  20. package/skills/code-reviewer/SKILL.md +220 -0
  21. package/skills/code-reviewer/references/checklist.md +80 -0
  22. package/skills/code-reviewer/references/patterns.md +226 -0
  23. package/skills/code-reviewer/references/security.md +88 -0
  24. package/skills/code-reviewer/scripts/review_checklist.py +191 -0
  25. package/skills/commit-helper/README.md +58 -0
  26. package/skills/commit-helper/SKILL.md +159 -0
  27. package/skills/commit-helper/references/conventional-commits.md +68 -0
  28. package/skills/commit-helper/references/examples.md +125 -0
  29. package/skills/commit-helper/references/scopes.md +49 -0
  30. package/skills/commit-helper/scripts/validate_commit.py +70 -0
  31. package/skills/create-pr/README.md +182 -0
  32. package/skills/create-pr/SKILL.md +340 -0
  33. package/skills/debugger/README.md +53 -0
  34. package/skills/debugger/SKILL.md +239 -0
  35. package/skills/debugger/references/checklist.md +7 -0
  36. package/skills/debugger/references/errors.md +6 -0
  37. package/skills/debugger/references/patterns.md +5 -0
  38. package/skills/debugger/scripts/debug_report.py +77 -0
  39. package/skills/deployment-engineer/README.md +40 -0
  40. package/skills/deployment-engineer/SKILL.md +242 -0
  41. package/skills/deployment-engineer/references/kubernetes.md +23 -0
  42. package/skills/deployment-engineer/references/monitoring.md +14 -0
  43. package/skills/deployment-engineer/references/pipelines.md +12 -0
  44. package/skills/deployment-engineer/scripts/generate_deploy.py +72 -0
  45. package/skills/deployment-engineer/scripts/validate_deploy.py +46 -0
  46. package/skills/documentation-engineer/README.md +41 -0
  47. package/skills/documentation-engineer/SKILL.md +164 -0
  48. package/skills/documentation-engineer/references/api-template.md +22 -0
  49. package/skills/documentation-engineer/references/readme-template.md +25 -0
  50. package/skills/documentation-engineer/references/style-guide.md +13 -0
  51. package/skills/documentation-engineer/scripts/generate_docs.py +68 -0
  52. package/skills/documentation-engineer/scripts/validate_docs.py +46 -0
  53. package/skills/figma-designer/README.md +222 -0
  54. package/skills/figma-designer/SKILL.md +407 -0
  55. package/skills/figma-designer/references/example-output.md +86 -0
  56. package/skills/performance-engineer/README.md +42 -0
  57. package/skills/performance-engineer/SKILL.md +236 -0
  58. package/skills/performance-engineer/references/checklist.md +6 -0
  59. package/skills/performance-engineer/references/monitoring.md +5 -0
  60. package/skills/performance-engineer/references/optimization.md +7 -0
  61. package/skills/performance-engineer/scripts/perf_report.py +64 -0
  62. package/skills/performance-engineer/scripts/profile.py +63 -0
  63. package/skills/planning-with-files/README.md +27 -0
  64. package/skills/planning-with-files/SKILL.md +103 -0
  65. package/skills/prd-implementation-precheck/README.md +97 -0
  66. package/skills/prd-implementation-precheck/SKILL.md +112 -0
  67. package/skills/prd-planner/README.md +102 -0
  68. package/skills/prd-planner/SKILL.md +449 -0
  69. package/skills/prd-planner/references/edge-case-analysis.md +111 -0
  70. package/skills/qa-expert/README.md +37 -0
  71. package/skills/qa-expert/SKILL.md +225 -0
  72. package/skills/qa-expert/references/gates.md +11 -0
  73. package/skills/qa-expert/references/metrics.md +6 -0
  74. package/skills/qa-expert/references/strategy.md +11 -0
  75. package/skills/qa-expert/scripts/coverage_analysis.py +61 -0
  76. package/skills/qa-expert/scripts/generate_test_plan.py +68 -0
  77. package/skills/refactoring-specialist/README.md +37 -0
  78. package/skills/refactoring-specialist/SKILL.md +283 -0
  79. package/skills/refactoring-specialist/references/checklist.md +6 -0
  80. package/skills/refactoring-specialist/references/smells.md +6 -0
  81. package/skills/refactoring-specialist/references/techniques.md +6 -0
  82. package/skills/security-auditor/README.md +48 -0
  83. package/skills/security-auditor/SKILL.md +256 -0
  84. package/skills/security-auditor/references/checklist.md +7 -0
  85. package/skills/security-auditor/references/owasp.md +12 -0
  86. package/skills/security-auditor/references/remediation.md +7 -0
  87. package/skills/security-auditor/scripts/find_secrets.py +58 -0
  88. package/skills/security-auditor/scripts/security_audit.py +64 -0
  89. package/skills/self-improving-agent/README.md +136 -0
  90. package/skills/self-improving-agent/SKILL.md +407 -0
  91. package/skills/self-improving-agent/hooks/post-bash.sh +10 -0
  92. package/skills/self-improving-agent/hooks/pre-tool.sh +10 -0
  93. package/skills/self-improving-agent/hooks/session-end.sh +4 -0
  94. package/skills/self-improving-agent/memory/semantic-patterns.json +288 -0
  95. package/skills/self-improving-agent/references/appendix.md +131 -0
  96. package/skills/self-improving-agent/templates/correction-template.md +11 -0
  97. package/skills/self-improving-agent/templates/pattern-template.md +15 -0
  98. package/skills/self-improving-agent/templates/validation-template.md +14 -0
  99. package/skills/session-logger/README.md +50 -0
  100. package/skills/session-logger/SKILL.md +156 -0
  101. package/skills/skill-router/README.md +155 -0
  102. package/skills/skill-router/SKILL.md +215 -0
  103. package/skills/test-automator/README.md +41 -0
  104. package/skills/test-automator/SKILL.md +202 -0
  105. package/skills/test-automator/references/best-practices.md +6 -0
  106. package/skills/test-automator/references/examples/README.md +3 -0
  107. package/skills/test-automator/references/examples/unit-test-example.md +8 -0
  108. package/skills/test-automator/references/mocking.md +5 -0
  109. package/skills/test-automator/scripts/coverage_report.py +59 -0
  110. package/skills/test-automator/scripts/generate_test.py +66 -0
  111. package/skills/workflow-orchestrator/README.md +20 -0
  112. package/skills/workflow-orchestrator/SKILL.md +342 -0
  113. package/src/cli.js +25 -10
@@ -0,0 +1,111 @@
1
+ # Edge Case Analysis Reference
2
+
3
+ This document provides detailed guidance for Step 2.5: Context-Aware Edge Case Analysis.
4
+
5
+ ## Codebase Pattern Scanning Commands
6
+
7
+ Run these searches to understand how the project handles common scenarios:
8
+
9
+ ```bash
10
+ # Delete strategy (soft delete vs hard delete)
11
+ grep -r "softDelete\|isDeleted\|deletedAt\|removed" src/ --include="*.ts" --include="*.tsx"
12
+
13
+ # Error handling patterns
14
+ grep -r "toast\|notification\|alert\|snackbar\|message\." src/ --include="*.tsx"
15
+
16
+ # Empty state handling
17
+ grep -r "empty\|noData\|EmptyState\|placeholder" src/ --include="*.tsx"
18
+
19
+ # Pagination patterns
20
+ grep -r "pageSize\|limit\|offset\|pagination\|perPage" src/ --include="*.ts"
21
+
22
+ # Loading state patterns
23
+ grep -r "loading\|isLoading\|pending\|Skeleton" src/ --include="*.tsx"
24
+
25
+ # Validation patterns
26
+ grep -r "validate\|validator\|yup\|zod\|schema" src/ --include="*.ts"
27
+ ```
28
+
29
+ ## Requirement Type Classification
30
+
31
+ | Requirement Type | Keywords | Key Edge Cases |
32
+ |-----------------|----------|----------------|
33
+ | CRUD Operations | create, edit, delete, list | Concurrent edits, cascade delete, validation |
34
+ | State Workflow | status, approval, flow | Invalid transitions, rollback, concurrent state |
35
+ | Async Operations | submit, load, sync | Timeout, retry, race conditions |
36
+ | Data Display | list, report, dashboard | Empty data, pagination, sorting, filtering |
37
+ | Form Input | form, input, submit | Validation, required fields, format |
38
+ | File Operations | upload, download, export | Size limits, format validation, progress |
39
+
40
+ ## Smart Assumptions Output Format
41
+
42
+ Record inferred patterns in `{scope}-prd-notes.md`:
43
+
44
+ ```markdown
45
+ ## Inferred Patterns (from codebase)
46
+
47
+ | Edge Case | Source | Pattern Applied |
48
+ |-----------|--------|-----------------|
49
+ | Delete strategy | `src/models/User.ts:45` uses `deletedAt` | Soft delete |
50
+ | Error display | `src/utils/toast.ts` global Toast | Toast notification |
51
+ | Empty state | `src/components/EmptyState.tsx` exists | Reuse EmptyState component |
52
+ | Pagination | `src/hooks/usePagination.ts:12` default 20 | 20 items per page |
53
+ | Loading | `src/components/Skeleton.tsx` exists | Use Skeleton component |
54
+ ```
55
+
56
+ ## When to Ask Users
57
+
58
+ Only ask about edge cases when:
59
+
60
+ 1. **No precedent in codebase** - First time the project encounters this scenario
61
+ 2. **Multiple patterns exist** - Codebase has inconsistent approaches
62
+ 3. **Business decision required** - Technical analysis cannot determine the answer
63
+
64
+ ### Question Categories
65
+
66
+ | Category | Example Question | When to Ask |
67
+ |----------|-----------------|-------------|
68
+ | Data lifecycle | "Should deleted items be recoverable?" | No existing delete pattern found |
69
+ | Conflict resolution | "When two users edit simultaneously, who wins?" | Feature involves concurrent access |
70
+ | Failure handling | "If partial data saves, show error or partial success?" | Complex multi-step operation |
71
+ | Business rules | "Can users edit after submission?" | State machine not defined |
72
+
73
+ ## User Confirmation Format
74
+
75
+ ```markdown
76
+ ## Edge Cases Requiring Confirmation
77
+
78
+ Based on the feature requirements, these edge cases need your input:
79
+
80
+ ### 1. Concurrent Edit Handling
81
+ When two users edit the same record simultaneously:
82
+ - [ ] A: Last write wins (simpler, may lose data)
83
+ - [ ] B: Show conflict dialog (better UX, more complex)
84
+ - [ ] C: Lock record during edit (prevents conflicts, may block users)
85
+
86
+ ### 2. Cascade Delete Behavior
87
+ When deleting a parent record with children:
88
+ - [ ] A: Block deletion, show warning
89
+ - [ ] B: Cascade delete all children
90
+ - [ ] C: Orphan children (set parent_id to null)
91
+
92
+ **Note**: Questions not listed above will follow existing codebase patterns.
93
+ ```
94
+
95
+ ## Edge Cases Section in Notes File
96
+
97
+ ```markdown
98
+ ## Edge Cases
99
+
100
+ ### Auto-handled (following codebase patterns)
101
+ - Empty list → Use existing `EmptyState` component
102
+ - Network error → Retry 3 times (from `src/utils/api.ts:23`)
103
+ - Form validation → Real-time with inline errors (from `src/hooks/useForm.ts`)
104
+
105
+ ### Confirmed by User
106
+ - Concurrent edit: Last write wins (confirmed {date})
107
+ - Cascade delete: Block and warn (confirmed {date})
108
+
109
+ ### Open Questions
110
+ - (List any remaining questions)
111
+ ```
@@ -0,0 +1,37 @@
1
+ # QA Expert
2
+
3
+ > A Claude Code skill for quality assurance strategy and quality gates.
4
+
5
+ ## Installation
6
+
7
+ This skill is part of the [agent-playbook](https://github.com/Charon-Fan/agent-playbook) collection.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ You: Create a QA plan
13
+ You: Set up quality gates
14
+ You: What tests should I write?
15
+ ```
16
+
17
+ ## Quality Gates
18
+
19
+ | Gate | Purpose |
20
+ |------|---------|
21
+ | **Lint** | Code style and formatting |
22
+ | **Type Check** | Type safety |
23
+ | **Unit Tests** | Functionality correctness |
24
+ | **Integration Tests** | Component interaction |
25
+ | **E2E Tests** | User workflows |
26
+
27
+ ## Scripts
28
+
29
+ Generate test plan:
30
+ ```bash
31
+ python scripts/generate_test_plan.py <feature>
32
+ ```
33
+
34
+ ## Resources
35
+
36
+ - [Google Testing Blog](https://testing.google.com/)
37
+ - [Ministry of Testing](https://www.ministryoftesting.com/)
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: qa-expert
3
+ description: Quality assurance expert for testing strategies and quality gates. Use when planning test coverage, setting up QA processes, or improving quality standards.
4
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebFetch, WebSearch
5
+ ---
6
+
7
+ # QA Expert
8
+
9
+ Quality assurance specialist for developing comprehensive testing strategies and quality gates.
10
+
11
+ ## When This Skill Activates
12
+
13
+ Activates when you:
14
+ - Ask for QA strategy
15
+ - Need quality gates
16
+ - Want to improve test coverage
17
+ - Plan testing approach
18
+
19
+ ## Quality Assurance Strategy
20
+
21
+ ### 1. Risk-Based Testing
22
+
23
+ Prioritize testing based on risk:
24
+
25
+ | Risk Level | Testing Approach |
26
+ |------------|------------------|
27
+ | **Critical** (Money, Security, Data) | 100% automation, chaos testing |
28
+ | **High** (Core features) | Full E2E, integration, unit |
29
+ | **Medium** (Secondary features) | Integration, unit |
30
+ | **Low** (Edge features) | Unit tests only |
31
+
32
+ ### 2. Testing Pyramid Allocation
33
+
34
+ | Level | % of Tests | Focus |
35
+ |-------|------------|-------|
36
+ | E2E | 10% | Critical user journeys |
37
+ | Integration | 30% | API interactions |
38
+ | Unit | 60% | Business logic, utilities |
39
+
40
+ ### 3. Quality Gates
41
+
42
+ #### Pre-Commit
43
+ ```bash
44
+ - Lint: npm run lint
45
+ - Format check: npm run format:check
46
+ - Type check: npm run type-check
47
+ - Unit tests: npm run test:unit
48
+ ```
49
+
50
+ #### Pre-Merge
51
+ ```bash
52
+ - All tests: npm test
53
+ - Coverage threshold: > 80%
54
+ - Security scan: npm audit
55
+ - License check: npm run check:licenses
56
+ ```
57
+
58
+ #### Pre-Production
59
+ ```bash
60
+ - Full test suite: npm run test:all
61
+ - E2E tests: npm run test:e2e
62
+ - Performance tests: npm run test:perf
63
+ - Security audit: npm audit --audit-level high
64
+ ```
65
+
66
+ ## Test Categories
67
+
68
+ ### Functional Testing
69
+
70
+ **Purpose**: Verify features work as specified
71
+
72
+ - Happy path testing
73
+ - Edge case testing
74
+ - Boundary value analysis
75
+ - Error handling
76
+
77
+ ### Non-Functional Testing
78
+
79
+ **Performance**
80
+ - Response time < 200ms (p95)
81
+ - Throughput > 1000 req/s
82
+ - Memory usage stable
83
+ - No memory leaks
84
+
85
+ **Security**
86
+ - OWASP Top 10 coverage
87
+ - Penetration testing
88
+ - Dependency vulnerability scan
89
+ - Secrets detection
90
+
91
+ **Compatibility**
92
+ - Browser testing (Chrome, Firefox, Safari, Edge)
93
+ - Device testing (Mobile, Desktop, Tablet)
94
+ - OS testing (Windows, macOS, Linux)
95
+ - Version testing (N-1 browser versions)
96
+
97
+ ### Regression Testing
98
+
99
+ - Previous bugs don't reappear
100
+ - New features don't break existing features
101
+ - Performance doesn't degrade
102
+
103
+ ### Exploratory Testing
104
+
105
+ - Find unexpected issues
106
+ - Test edge cases
107
+ - User experience issues
108
+
109
+ ## Test Planning
110
+
111
+ ### Test Plan Template
112
+
113
+ ```markdown
114
+ # Test Plan: [Feature Name]
115
+
116
+ ## Overview
117
+ [Feature description]
118
+
119
+ ## Scope
120
+ [In scope / Out of scope]
121
+
122
+ ## Test Cases
123
+
124
+ ### Functional
125
+ - [ ] TC001: [Description]
126
+ - [ ] TC002: [Description]
127
+
128
+ ### Integration
129
+ - [ ] TC101: [Description]
130
+
131
+ ### E2E
132
+ - [ ] TC201: [Description]
133
+
134
+ ## Test Data
135
+ [Required test data]
136
+
137
+ ## Environment
138
+ [Test environment setup]
139
+
140
+ ## Schedule
141
+ [Testing timeline]
142
+
143
+ ## Exit Criteria
144
+ [Definition of done]
145
+ ```
146
+
147
+ ## Quality Metrics
148
+
149
+ ### Code Quality
150
+ - **Test Coverage**: > 80%
151
+ - **Cyclomatic Complexity**: < 10 per function
152
+ - **Code Duplication**: < 5%
153
+ - **Technical Debt Ratio**: < 5%
154
+
155
+ ### Defect Metrics
156
+ - **Defect Density**: < 1 defect per 1000 LOC
157
+ - **Critical Defects**: 0
158
+ - **High Defects**: 0
159
+ - **Medium Defects**: < 3
160
+
161
+ ### Test Metrics
162
+ - **Test Pass Rate**: > 95%
163
+ - **Flaky Tests**: 0
164
+ - **Test Execution Time**: < 10 minutes
165
+
166
+ ## Automation Strategy
167
+
168
+ ### Automate When
169
+ - Test is run frequently
170
+ - Test has deterministic results
171
+ - Test is stable
172
+ - ROI justifies automation cost
173
+
174
+ ### Don't Automate When
175
+ - Test requires human judgment
176
+ - Test is exploratory
177
+ - Test is one-time only
178
+ - Test changes frequently
179
+
180
+ ## Bug Report Template
181
+
182
+ ```markdown
183
+ ## Bug Summary
184
+ [One-line summary]
185
+
186
+ ## Severity
187
+ Critical / High / Medium / Low
188
+
189
+ ## Steps to Reproduce
190
+ 1.
191
+ 2.
192
+ 3.
193
+
194
+ ## Expected Behavior
195
+ [What should happen]
196
+
197
+ ## Actual Behavior
198
+ [What actually happens]
199
+
200
+ ## Environment
201
+ - OS:
202
+ - Browser:
203
+ - Version:
204
+
205
+ ## Attachments
206
+ [Screenshots, logs, etc.]
207
+ ```
208
+
209
+ ## Scripts
210
+
211
+ Generate test plan:
212
+ ```bash
213
+ python scripts/generate_test_plan.py <feature>
214
+ ```
215
+
216
+ Analyze test coverage:
217
+ ```bash
218
+ python scripts/coverage_analysis.py
219
+ ```
220
+
221
+ ## References
222
+
223
+ - `references/strategy.md` - Testing strategies
224
+ - `references/gates.md` - Quality gate definitions
225
+ - `references/metrics.md` - QA metrics and KPIs
@@ -0,0 +1,11 @@
1
+ # Quality Gates
2
+
3
+ ## Required Checks
4
+ - Lint passes
5
+ - Unit tests pass
6
+ - Coverage threshold met
7
+ - Security scan clean
8
+
9
+ ## Release Criteria
10
+ - No high severity defects
11
+ - Performance within target thresholds
@@ -0,0 +1,6 @@
1
+ # QA Metrics
2
+
3
+ - Defect escape rate
4
+ - Test coverage by module
5
+ - Mean time to detect (MTTD)
6
+ - Mean time to resolve (MTTR)
@@ -0,0 +1,11 @@
1
+ # QA Strategy
2
+
3
+ ## Objectives
4
+ - Validate critical user flows
5
+ - Detect regressions early
6
+ - Ensure performance and security baselines
7
+
8
+ ## Scope
9
+ - Unit tests
10
+ - Integration tests
11
+ - End-to-end tests
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python3
2
+ # Template generator for coverage analysis.
3
+
4
+ from pathlib import Path
5
+ import argparse
6
+ import textwrap
7
+
8
+
9
+ def write_output(path: Path, content: str, force: bool) -> bool:
10
+ if path.exists() and not force:
11
+ print(f"{path} already exists (use --force to overwrite)")
12
+ return False
13
+ path.parent.mkdir(parents=True, exist_ok=True)
14
+ path.write_text(content, encoding="utf-8")
15
+ return True
16
+
17
+
18
+ def main() -> int:
19
+ parser = argparse.ArgumentParser(description="Generate a coverage analysis.")
20
+ parser.add_argument("--output", default="coverage-analysis.md", help="Output file path")
21
+ parser.add_argument("--name", default="example", help="Component or repo name")
22
+ parser.add_argument("--owner", default="team", help="Owning team")
23
+ parser.add_argument("--force", action="store_true", help="Overwrite existing file")
24
+ args = parser.parse_args()
25
+
26
+ content = textwrap.dedent(
27
+ f"""\
28
+ # Coverage Analysis
29
+
30
+ ## Summary
31
+ Coverage summary for {args.name}.
32
+
33
+ ## Ownership
34
+ - Owner: {args.owner}
35
+
36
+ ## Coverage Gaps
37
+ - Missing unit tests
38
+ - Missing integration tests
39
+
40
+ ## Risk Areas
41
+ - Critical paths with low coverage
42
+ - Recently changed modules
43
+
44
+ ## Recommendations
45
+ - Add tests for gaps
46
+ - Improve data-driven coverage
47
+
48
+ ## Next Steps
49
+ - Owners and deadlines
50
+ """
51
+ ).strip() + "\n"
52
+
53
+ output = Path(args.output)
54
+ if not write_output(output, content, args.force):
55
+ return 1
56
+ print(f"Wrote {output}")
57
+ return 0
58
+
59
+
60
+ if __name__ == "__main__":
61
+ raise SystemExit(main())
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env python3
2
+ # Template generator for QA test plan.
3
+
4
+ from pathlib import Path
5
+ import argparse
6
+ import textwrap
7
+
8
+
9
+ def write_output(path: Path, content: str, force: bool) -> bool:
10
+ if path.exists() and not force:
11
+ print(f"{path} already exists (use --force to overwrite)")
12
+ return False
13
+ path.parent.mkdir(parents=True, exist_ok=True)
14
+ path.write_text(content, encoding="utf-8")
15
+ return True
16
+
17
+
18
+ def main() -> int:
19
+ parser = argparse.ArgumentParser(description="Generate a QA test plan.")
20
+ parser.add_argument("--output", default="docs/test-plan.md", help="Output file path")
21
+ parser.add_argument("--name", default="example", help="Feature or release name")
22
+ parser.add_argument("--owner", default="team", help="Owning team")
23
+ parser.add_argument("--force", action="store_true", help="Overwrite existing file")
24
+ args = parser.parse_args()
25
+
26
+ content = textwrap.dedent(
27
+ f"""\
28
+ # QA Test Plan
29
+
30
+ ## Scope
31
+ {args.name}
32
+
33
+ ## Ownership
34
+ - Owner: {args.owner}
35
+ - QA lead: TBD
36
+
37
+ ## Risks
38
+ - High impact areas
39
+ - Known regressions
40
+
41
+ ## Test Matrix
42
+ - Platforms
43
+ - Browsers
44
+ - Locales
45
+
46
+ ## Environments
47
+ - Staging
48
+ - Production
49
+
50
+ ## Test Data
51
+ - Seed data requirements
52
+ - Edge-case fixtures
53
+
54
+ ## Exit Criteria
55
+ - Critical tests passing
56
+ - No unresolved P0/P1 issues
57
+ """
58
+ ).strip() + "\n"
59
+
60
+ output = Path(args.output)
61
+ if not write_output(output, content, args.force):
62
+ return 1
63
+ print(f"Wrote {output}")
64
+ return 0
65
+
66
+
67
+ if __name__ == "__main__":
68
+ raise SystemExit(main())
@@ -0,0 +1,37 @@
1
+ # Refactoring Specialist
2
+
3
+ > A Claude Code skill for code refactoring and technical debt reduction.
4
+
5
+ ## Installation
6
+
7
+ This skill is part of the [agent-playbook](https://github.com/Charon-Fan/agent-playbook) collection.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ You: Refactor this code
13
+ You: Clean up this function
14
+ You: This code is messy, help me improve it
15
+ ```
16
+
17
+ ## Common Refactorings
18
+
19
+ | Code Smell | Refactoring |
20
+ |------------|-------------|
21
+ | Long Method | Extract Method |
22
+ | Duplicate Code | Extract Method |
23
+ | Large Class | Extract Class |
24
+ | Long Parameter List | Introduce Parameter Object |
25
+ | Switch Statement | Replace with Polymorphism |
26
+
27
+ ## Principles
28
+
29
+ 1. **Behavior Preservation**: Refactoring must not change external behavior
30
+ 2. **Small Steps**: Make incremental changes
31
+ 3. **Test Coverage**: Ensure tests pass before and after
32
+ 4. **Commit Often**: Commit after each successful refactoring
33
+
34
+ ## Resources
35
+
36
+ - [Refactoring.com](https://refactoring.com/)
37
+ - [Clean Code](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)