@codeharbor/agent-playbook 0.1.0 → 0.1.2
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.
- package/README.md +4 -2
- package/package.json +5 -2
- package/skills/api-designer/README.md +36 -0
- package/skills/api-designer/SKILL.md +232 -0
- package/skills/api-designer/references/graphql-patterns.md +12 -0
- package/skills/api-designer/references/rest-patterns.md +17 -0
- package/skills/api-designer/scripts/generate_api.py +87 -0
- package/skills/api-designer/scripts/validate_api.py +48 -0
- package/skills/api-documenter/README.md +41 -0
- package/skills/api-documenter/SKILL.md +209 -0
- package/skills/api-documenter/references/examples/README.md +3 -0
- package/skills/api-documenter/references/examples/openapi-example.yaml +10 -0
- package/skills/api-documenter/references/openapi-template.yaml +5 -0
- package/skills/api-documenter/scripts/generate_openapi.py +84 -0
- package/skills/api-documenter/scripts/validate_openapi.py +45 -0
- package/skills/architecting-solutions/README.md +22 -0
- package/skills/architecting-solutions/SKILL.md +459 -0
- package/skills/auto-trigger/README.md +23 -0
- package/skills/auto-trigger/SKILL.md +183 -0
- package/skills/code-reviewer/README.md +59 -0
- package/skills/code-reviewer/SKILL.md +220 -0
- package/skills/code-reviewer/references/checklist.md +80 -0
- package/skills/code-reviewer/references/patterns.md +226 -0
- package/skills/code-reviewer/references/security.md +88 -0
- package/skills/code-reviewer/scripts/review_checklist.py +191 -0
- package/skills/commit-helper/README.md +58 -0
- package/skills/commit-helper/SKILL.md +159 -0
- package/skills/commit-helper/references/conventional-commits.md +68 -0
- package/skills/commit-helper/references/examples.md +125 -0
- package/skills/commit-helper/references/scopes.md +49 -0
- package/skills/commit-helper/scripts/validate_commit.py +70 -0
- package/skills/create-pr/README.md +182 -0
- package/skills/create-pr/SKILL.md +340 -0
- package/skills/debugger/README.md +53 -0
- package/skills/debugger/SKILL.md +239 -0
- package/skills/debugger/references/checklist.md +7 -0
- package/skills/debugger/references/errors.md +6 -0
- package/skills/debugger/references/patterns.md +5 -0
- package/skills/debugger/scripts/debug_report.py +77 -0
- package/skills/deployment-engineer/README.md +40 -0
- package/skills/deployment-engineer/SKILL.md +242 -0
- package/skills/deployment-engineer/references/kubernetes.md +23 -0
- package/skills/deployment-engineer/references/monitoring.md +14 -0
- package/skills/deployment-engineer/references/pipelines.md +12 -0
- package/skills/deployment-engineer/scripts/generate_deploy.py +72 -0
- package/skills/deployment-engineer/scripts/validate_deploy.py +46 -0
- package/skills/documentation-engineer/README.md +41 -0
- package/skills/documentation-engineer/SKILL.md +164 -0
- package/skills/documentation-engineer/references/api-template.md +22 -0
- package/skills/documentation-engineer/references/readme-template.md +25 -0
- package/skills/documentation-engineer/references/style-guide.md +13 -0
- package/skills/documentation-engineer/scripts/generate_docs.py +68 -0
- package/skills/documentation-engineer/scripts/validate_docs.py +46 -0
- package/skills/figma-designer/README.md +222 -0
- package/skills/figma-designer/SKILL.md +407 -0
- package/skills/figma-designer/references/example-output.md +86 -0
- package/skills/performance-engineer/README.md +42 -0
- package/skills/performance-engineer/SKILL.md +236 -0
- package/skills/performance-engineer/references/checklist.md +6 -0
- package/skills/performance-engineer/references/monitoring.md +5 -0
- package/skills/performance-engineer/references/optimization.md +7 -0
- package/skills/performance-engineer/scripts/perf_report.py +64 -0
- package/skills/performance-engineer/scripts/profile.py +63 -0
- package/skills/planning-with-files/README.md +27 -0
- package/skills/planning-with-files/SKILL.md +103 -0
- package/skills/prd-implementation-precheck/README.md +97 -0
- package/skills/prd-implementation-precheck/SKILL.md +112 -0
- package/skills/prd-planner/README.md +102 -0
- package/skills/prd-planner/SKILL.md +449 -0
- package/skills/prd-planner/references/edge-case-analysis.md +111 -0
- package/skills/qa-expert/README.md +37 -0
- package/skills/qa-expert/SKILL.md +225 -0
- package/skills/qa-expert/references/gates.md +11 -0
- package/skills/qa-expert/references/metrics.md +6 -0
- package/skills/qa-expert/references/strategy.md +11 -0
- package/skills/qa-expert/scripts/coverage_analysis.py +61 -0
- package/skills/qa-expert/scripts/generate_test_plan.py +68 -0
- package/skills/refactoring-specialist/README.md +37 -0
- package/skills/refactoring-specialist/SKILL.md +283 -0
- package/skills/refactoring-specialist/references/checklist.md +6 -0
- package/skills/refactoring-specialist/references/smells.md +6 -0
- package/skills/refactoring-specialist/references/techniques.md +6 -0
- package/skills/security-auditor/README.md +48 -0
- package/skills/security-auditor/SKILL.md +256 -0
- package/skills/security-auditor/references/checklist.md +7 -0
- package/skills/security-auditor/references/owasp.md +12 -0
- package/skills/security-auditor/references/remediation.md +7 -0
- package/skills/security-auditor/scripts/find_secrets.py +58 -0
- package/skills/security-auditor/scripts/security_audit.py +64 -0
- package/skills/self-improving-agent/README.md +136 -0
- package/skills/self-improving-agent/SKILL.md +407 -0
- package/skills/self-improving-agent/hooks/post-bash.sh +10 -0
- package/skills/self-improving-agent/hooks/pre-tool.sh +10 -0
- package/skills/self-improving-agent/hooks/session-end.sh +4 -0
- package/skills/self-improving-agent/memory/semantic-patterns.json +288 -0
- package/skills/self-improving-agent/references/appendix.md +131 -0
- package/skills/self-improving-agent/templates/correction-template.md +11 -0
- package/skills/self-improving-agent/templates/pattern-template.md +15 -0
- package/skills/self-improving-agent/templates/validation-template.md +14 -0
- package/skills/session-logger/README.md +50 -0
- package/skills/session-logger/SKILL.md +156 -0
- package/skills/skill-router/README.md +155 -0
- package/skills/skill-router/SKILL.md +215 -0
- package/skills/test-automator/README.md +41 -0
- package/skills/test-automator/SKILL.md +202 -0
- package/skills/test-automator/references/best-practices.md +6 -0
- package/skills/test-automator/references/examples/README.md +3 -0
- package/skills/test-automator/references/examples/unit-test-example.md +8 -0
- package/skills/test-automator/references/mocking.md +5 -0
- package/skills/test-automator/scripts/coverage_report.py +59 -0
- package/skills/test-automator/scripts/generate_test.py +66 -0
- package/skills/workflow-orchestrator/README.md +20 -0
- package/skills/workflow-orchestrator/SKILL.md +342 -0
- package/src/cli.js +107 -20
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Validate commit message format against Conventional Commits specification.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import re
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def validate_commit_message(message: str) -> tuple[bool, str]:
|
|
11
|
+
"""
|
|
12
|
+
Validate a commit message against Conventional Commits format.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
message: The commit message to validate
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
(is_valid, error_message)
|
|
19
|
+
"""
|
|
20
|
+
if not message:
|
|
21
|
+
return False, "Commit message is empty"
|
|
22
|
+
|
|
23
|
+
lines = message.split('\n')
|
|
24
|
+
subject = lines[0]
|
|
25
|
+
|
|
26
|
+
# Validate subject line format: type(scope): subject
|
|
27
|
+
pattern = r'^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\(.+\))?: .{1,50}$'
|
|
28
|
+
if not re.match(pattern, subject):
|
|
29
|
+
return False, (
|
|
30
|
+
"Invalid format. Expected: type(scope): subject\n"
|
|
31
|
+
"- Type must be one of: feat, fix, docs, style, refactor, perf, test, chore, ci, build\n"
|
|
32
|
+
"- Subject must be 1-50 characters\n"
|
|
33
|
+
"- Use imperative mood (e.g., 'add feature' not 'added feature')"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Check for period at end of subject
|
|
37
|
+
if subject.endswith('.'):
|
|
38
|
+
return False, "Subject line should not end with a period"
|
|
39
|
+
|
|
40
|
+
# Check subject uses imperative mood (basic check)
|
|
41
|
+
words = subject.split(': ', 1)[1].split() if ': ' in subject else []
|
|
42
|
+
if words:
|
|
43
|
+
first_word = words[0].lower()
|
|
44
|
+
# Common past tense indicators
|
|
45
|
+
if first_word.endswith(('ed', 'ing')) and first_word not in ['added', 'building']:
|
|
46
|
+
return False, f"Subject should use imperative mood ('{first_word}' → '{first_word.rstrip('ed')}')"
|
|
47
|
+
|
|
48
|
+
# Validate body format (if present)
|
|
49
|
+
if len(lines) > 1:
|
|
50
|
+
if lines[1].strip(): # No blank line after subject
|
|
51
|
+
return False, "Separate subject from body with a blank line"
|
|
52
|
+
|
|
53
|
+
body = '\n'.join(lines[2:])
|
|
54
|
+
for line in body.split('\n'):
|
|
55
|
+
if len(line) > 72:
|
|
56
|
+
return False, f"Body lines should wrap at 72 characters (found {len(line)})"
|
|
57
|
+
|
|
58
|
+
return True, "Valid commit message format"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if __name__ == "__main__":
|
|
62
|
+
if len(sys.argv) < 2:
|
|
63
|
+
print("Usage: python validate_commit.py \"commit message\"")
|
|
64
|
+
sys.exit(1)
|
|
65
|
+
|
|
66
|
+
message = sys.argv[1]
|
|
67
|
+
is_valid, result = validate_commit_message(message)
|
|
68
|
+
|
|
69
|
+
print(result)
|
|
70
|
+
sys.exit(0 if is_valid else 1)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Create PR
|
|
2
|
+
|
|
3
|
+
A Claude Code skill for creating pull requests with automatic bilingual documentation updates.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This skill streamlines the PR creation process for the agent-playbook repository. It ensures that both English and Chinese documentation remain synchronized whenever code changes are submitted.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Automatic Change Analysis**: Examines git diff to understand what changed
|
|
12
|
+
- **Documentation Sync**: Updates both README.md and README.zh-CN.md
|
|
13
|
+
- **Bilingual Support**: Maintains parity between English and Chinese docs
|
|
14
|
+
- **PR Template**: Provides consistent PR description format
|
|
15
|
+
- **Verification Checklist**: Ensures nothing is missed before submission
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Create symbolic link to global skills directory
|
|
21
|
+
ln -s ~/Documents/code/GitHub/agent-playbook/skills/create-pr/SKILL.md ~/.claude/skills/create-pr.md
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
28
|
+
│ Analyze │ -> │ Determine │ -> │ Update Docs │
|
|
29
|
+
│ Changes │ │ Updates │ │ (Both EN/CN) │
|
|
30
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
31
|
+
│
|
|
32
|
+
v
|
|
33
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
34
|
+
│ Create PR │ <- │ Commit & │ <- │ Verify │
|
|
35
|
+
│ │ │ Push │ │ Checklist │
|
|
36
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Basic Usage
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Simply ask Claude to create a PR
|
|
45
|
+
"Please create a PR for my changes"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The skill will:
|
|
49
|
+
1. Analyze all changes
|
|
50
|
+
2. Determine if documentation updates are needed
|
|
51
|
+
3. Update both README files
|
|
52
|
+
4. Commit and push
|
|
53
|
+
5. Create the PR
|
|
54
|
+
|
|
55
|
+
### With Specific Focus
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
"Create a PR for the new skill router"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The skill will focus on the skill-router changes and update documentation accordingly.
|
|
62
|
+
|
|
63
|
+
## Documentation Update Rules
|
|
64
|
+
|
|
65
|
+
| Change Type | Update Required |
|
|
66
|
+
|-------------|-----------------|
|
|
67
|
+
| New skill added | ✅ Yes - Add to both READMEs |
|
|
68
|
+
| Skill removed | ✅ Yes - Remove from both READMEs |
|
|
69
|
+
| Skill description changed | ✅ Yes - Update both READMEs |
|
|
70
|
+
| Bug fix | ❌ No - Unless user-facing |
|
|
71
|
+
| Internal refactor | ❌ No - Documentation unchanged |
|
|
72
|
+
|
|
73
|
+
## PR Description Template
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
## Summary
|
|
77
|
+
|
|
78
|
+
<Brief description of the changes>
|
|
79
|
+
|
|
80
|
+
## Changes
|
|
81
|
+
|
|
82
|
+
- [ ] New skill added
|
|
83
|
+
- [ ] Existing skill modified
|
|
84
|
+
- [ ] Documentation updated
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
- [x] README.md updated
|
|
89
|
+
- [x] README.zh-CN.md updated
|
|
90
|
+
|
|
91
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Bilingual Documentation
|
|
95
|
+
|
|
96
|
+
### Adding a New Skill
|
|
97
|
+
|
|
98
|
+
**README.md (English):**
|
|
99
|
+
```markdown
|
|
100
|
+
| **[skill-name](./skills/skill-name/)** | Skill description |
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**README.zh-CN.md (Chinese):**
|
|
104
|
+
```markdown
|
|
105
|
+
| **[skill-name](./skills/skill-name/)** | 技能描述 |
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Language Switch Links
|
|
109
|
+
|
|
110
|
+
Both files must have the switch link at the top:
|
|
111
|
+
|
|
112
|
+
**README.md:**
|
|
113
|
+
```markdown
|
|
114
|
+
English | [简体中文](./README.zh-CN.md)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**README.zh-CN.md:**
|
|
118
|
+
```markdown
|
|
119
|
+
[English](./README.md) | 简体中文
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Examples
|
|
123
|
+
|
|
124
|
+
### Example 1: Adding a New Skill
|
|
125
|
+
|
|
126
|
+
**Input:**
|
|
127
|
+
```
|
|
128
|
+
"I've created a new skill called skill-router. Please create a PR."
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Skill Actions:**
|
|
132
|
+
1. Analyzes the skill-router directory
|
|
133
|
+
2. Adds skill-router to Meta Skills table in README.md
|
|
134
|
+
3. Adds skill-router to 元技能 table in README.zh-CN.md
|
|
135
|
+
4. Commits all changes
|
|
136
|
+
5. Pushes to remote branch
|
|
137
|
+
6. Creates PR with description
|
|
138
|
+
|
|
139
|
+
### Example 2: Bug Fix
|
|
140
|
+
|
|
141
|
+
**Input:**
|
|
142
|
+
```
|
|
143
|
+
"I fixed a typo in debugger skill. Create a PR."
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Skill Actions:**
|
|
147
|
+
1. Analyzes the change (typo fix only)
|
|
148
|
+
2. Determines no documentation update needed
|
|
149
|
+
3. Commits and pushes
|
|
150
|
+
4. Creates PR with simple description
|
|
151
|
+
|
|
152
|
+
## Verification Checklist
|
|
153
|
+
|
|
154
|
+
Before creating PR, the skill verifies:
|
|
155
|
+
|
|
156
|
+
- [ ] All changes are committed
|
|
157
|
+
- [ ] Branch is pushed to remote
|
|
158
|
+
- [ ] Commit messages follow Conventional Commits
|
|
159
|
+
- [ ] README.md updated (if needed)
|
|
160
|
+
- [ ] README.zh-CN.md updated (if needed)
|
|
161
|
+
- [ ] Language switch links present
|
|
162
|
+
- [ ] New skills have symlinks created
|
|
163
|
+
- [ ] PR title is clear and descriptive
|
|
164
|
+
|
|
165
|
+
## File Structure
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
skills/create-pr/
|
|
169
|
+
├── SKILL.md # Main skill file
|
|
170
|
+
└── README.md # This file
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Contributing
|
|
174
|
+
|
|
175
|
+
When contributing to this skill:
|
|
176
|
+
1. Update both SKILL.md and README.md
|
|
177
|
+
2. Test with real PR creation scenarios
|
|
178
|
+
3. Ensure bilingual documentation stays in sync
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-pr
|
|
3
|
+
description: Creates pull requests with bilingual documentation updates. Use when user asks to create PR, make a pull request, or submit changes for review. Automatically updates both English and Chinese README files.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Grep, AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create PR
|
|
8
|
+
|
|
9
|
+
A skill for creating pull requests with automatic bilingual documentation updates. This skill ensures that both English and Chinese documentation stay in sync when code changes are submitted.
|
|
10
|
+
|
|
11
|
+
## When This Skill Activates
|
|
12
|
+
|
|
13
|
+
This skill activates when you:
|
|
14
|
+
- Ask to create a pull request or PR
|
|
15
|
+
- Say "submit my changes" or "push and create PR"
|
|
16
|
+
- Mention "make a PR" or "open a pull request"
|
|
17
|
+
- Want to submit code for review
|
|
18
|
+
|
|
19
|
+
## PR Creation Workflow
|
|
20
|
+
|
|
21
|
+
### Step 1: Analyze Changes
|
|
22
|
+
|
|
23
|
+
Examine all changes in the current branch:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git status
|
|
27
|
+
git diff
|
|
28
|
+
git log --oneline main..HEAD
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Identify:
|
|
32
|
+
- **Modified files**: What was changed?
|
|
33
|
+
- **New files**: What was added?
|
|
34
|
+
- **Deleted files**: What was removed?
|
|
35
|
+
- **Impact area**: Which skills or features are affected?
|
|
36
|
+
|
|
37
|
+
### Step 2: Determine Documentation Updates
|
|
38
|
+
|
|
39
|
+
### Check for Skill Changes
|
|
40
|
+
|
|
41
|
+
First, detect if any skills were changed:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Check if skills/ directory has changes
|
|
45
|
+
git diff --name-only main..HEAD | grep "^skills/"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Decision Matrix
|
|
49
|
+
|
|
50
|
+
| Change Type | Documentation Action |
|
|
51
|
+
|-------------|---------------------|
|
|
52
|
+
| New skill added | Add to skills table in both EN and CN README |
|
|
53
|
+
| Skill description changed | Update description in skills table |
|
|
54
|
+
| Skill removed | Remove from skills table |
|
|
55
|
+
| Skill hooks changed | Update Auto-Trigger column in skills table |
|
|
56
|
+
| Internal skill logic only | Skip README update |
|
|
57
|
+
| Bug fix with no user impact | Skip README update |
|
|
58
|
+
|
|
59
|
+
### Auto-Trigger Changes Require Update
|
|
60
|
+
|
|
61
|
+
If a skill's `hooks:` front matter was modified, the **Auto-Trigger** column in the Skills Catalog must be updated:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Check if hooks were modified
|
|
65
|
+
git diff main..HEAD -- skills/*/SKILL.md | grep -E "^\+.*hooks:|^\+.*trigger:"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If hooks changed → Update README.md and README.zh-CN.md Auto-Trigger column.
|
|
69
|
+
|
|
70
|
+
### Step 3: Draft Commit Message
|
|
71
|
+
|
|
72
|
+
Use the `commit-helper` format:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
<type>(<scope>): <subject>
|
|
76
|
+
|
|
77
|
+
<body>
|
|
78
|
+
|
|
79
|
+
<footer>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Types:
|
|
83
|
+
- `feat`: New skill or feature
|
|
84
|
+
- `fix`: Bug fix or correction
|
|
85
|
+
- `docs`: Documentation only changes
|
|
86
|
+
- `refactor`: Code refactoring
|
|
87
|
+
- `chore`: Maintenance tasks
|
|
88
|
+
|
|
89
|
+
### Step 4: Create the Pull Request
|
|
90
|
+
|
|
91
|
+
Run the following sequence:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# 1. Stage and commit changes
|
|
95
|
+
git add .
|
|
96
|
+
git commit -m "commit message"
|
|
97
|
+
|
|
98
|
+
# 2. Push to remote
|
|
99
|
+
git push -u origin <branch-name>
|
|
100
|
+
|
|
101
|
+
# 3: Create PR using gh CLI
|
|
102
|
+
gh pr create \
|
|
103
|
+
--title "PR title" \
|
|
104
|
+
--body "PR description"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 5: Update Documentation (If Required)
|
|
108
|
+
|
|
109
|
+
After creating the PR, update both README files:
|
|
110
|
+
|
|
111
|
+
**README.md** (English):
|
|
112
|
+
- Add new skills to appropriate category table
|
|
113
|
+
- Update project structure if needed
|
|
114
|
+
- Keep language switch link at top
|
|
115
|
+
|
|
116
|
+
**README.zh-CN.md** (Chinese):
|
|
117
|
+
- Mirror all English changes
|
|
118
|
+
- Translate skill descriptions
|
|
119
|
+
- Maintain same structure and formatting
|
|
120
|
+
|
|
121
|
+
### Step 6: Update Changelog (Optional)
|
|
122
|
+
|
|
123
|
+
For significant changes, add to CHANGELOG.md:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
## [Version] - YYYY-MM-DD
|
|
127
|
+
|
|
128
|
+
### Added
|
|
129
|
+
- New skill: skill-name
|
|
130
|
+
|
|
131
|
+
### Fixed
|
|
132
|
+
- Fixed issue in skill-name
|
|
133
|
+
|
|
134
|
+
### Changed
|
|
135
|
+
- Updated skill-name with new features
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Documentation Update Guidelines
|
|
139
|
+
|
|
140
|
+
### Skills Catalog Update Template
|
|
141
|
+
|
|
142
|
+
When adding or modifying skills, use this format for the Skills Catalog:
|
|
143
|
+
|
|
144
|
+
**English (README.md):**
|
|
145
|
+
```markdown
|
|
146
|
+
### Category Name
|
|
147
|
+
|
|
148
|
+
| Skill | Description | Auto-Trigger |
|
|
149
|
+
|-------|-------------|--------------|
|
|
150
|
+
| **[skill-name](./skills/skill-name/)** | Brief description | Manual / Auto / Background / (keyword: "...") |
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Chinese (README.zh-CN.md):**
|
|
154
|
+
```markdown
|
|
155
|
+
### 类别名称
|
|
156
|
+
|
|
157
|
+
| 技能 | 描述 | 自动触发 |
|
|
158
|
+
|------|------|----------|
|
|
159
|
+
| **[skill-name](./skills/skill-name/)** | 简短描述 | 手动 / 自动 / 后台 / (关键词:"...") |
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Auto-Trigger Column Values
|
|
163
|
+
|
|
164
|
+
| Value | Meaning | Example |
|
|
165
|
+
|-------|---------|---------|
|
|
166
|
+
| `Manual` | User must invoke | Most development skills |
|
|
167
|
+
| `Auto` | Triggers automatically after any skill | session-logger |
|
|
168
|
+
| `Background` | Runs non-blocking after related skill | self-improving-agent |
|
|
169
|
+
| `After skill updates` | Only triggers when skills are modified | create-pr |
|
|
170
|
+
| `(keyword: "...")` | Activates on specific keyword | prd-planner (keyword: "PRD") |
|
|
171
|
+
|
|
172
|
+
### When to Update README
|
|
173
|
+
|
|
174
|
+
**Always update when:**
|
|
175
|
+
- Adding a new skill
|
|
176
|
+
- Removing a skill
|
|
177
|
+
- Changing skill names or descriptions
|
|
178
|
+
- Restructuring the skills directory
|
|
179
|
+
|
|
180
|
+
**Consider updating when:**
|
|
181
|
+
- Adding significant features to existing skills
|
|
182
|
+
- Changing installation instructions
|
|
183
|
+
- Modifying project structure
|
|
184
|
+
|
|
185
|
+
**Skip updating when:**
|
|
186
|
+
- Internal code refactoring with no user impact
|
|
187
|
+
- Minor typo fixes
|
|
188
|
+
- Test file changes
|
|
189
|
+
|
|
190
|
+
### Bilingual Update Format
|
|
191
|
+
|
|
192
|
+
When adding a new skill to the skills table:
|
|
193
|
+
|
|
194
|
+
**English (README.md):**
|
|
195
|
+
```markdown
|
|
196
|
+
| **[skill-name](./skills/skill-name/)** | Brief skill description |
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Chinese (README.zh-CN.md):**
|
|
200
|
+
```markdown
|
|
201
|
+
| **[skill-name](./skills/skill-name/)** | 技能简短描述 |
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Language Switch Link
|
|
205
|
+
|
|
206
|
+
Both README files must have the language switch at the top:
|
|
207
|
+
|
|
208
|
+
**README.md:**
|
|
209
|
+
```markdown
|
|
210
|
+
English | [简体中文](./README.zh-CN.md)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**README.zh-CN.md:**
|
|
214
|
+
```markdown
|
|
215
|
+
[English](./README.md) | 简体中文
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## PR Description Template
|
|
219
|
+
|
|
220
|
+
When creating a PR, use this template:
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
## Summary
|
|
224
|
+
|
|
225
|
+
<Brief description of what this PR does>
|
|
226
|
+
|
|
227
|
+
## Changes
|
|
228
|
+
|
|
229
|
+
- [ ] New skill added
|
|
230
|
+
- [ ] Existing skill modified
|
|
231
|
+
- [ ] Documentation updated
|
|
232
|
+
- [ ] Tests added/updated
|
|
233
|
+
|
|
234
|
+
## Skills Affected
|
|
235
|
+
|
|
236
|
+
- `skill-name`: Description of change
|
|
237
|
+
|
|
238
|
+
## Documentation
|
|
239
|
+
|
|
240
|
+
- [x] README.md updated
|
|
241
|
+
- [x] README.zh-CN.md updated
|
|
242
|
+
- [ ] CHANGELOG.md updated (if applicable)
|
|
243
|
+
|
|
244
|
+
## Test Plan
|
|
245
|
+
|
|
246
|
+
- [ ] Skill tested in Claude Code
|
|
247
|
+
- [ ] Documentation links verified
|
|
248
|
+
- [ ] Bilingual translations checked
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Common Scenarios
|
|
256
|
+
|
|
257
|
+
### Scenario 1: Adding a New Skill
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# 1. Create skill files
|
|
261
|
+
mkdir -p skills/new-skill
|
|
262
|
+
touch skills/new-skill/SKILL.md
|
|
263
|
+
touch skills/new-skill/README.md
|
|
264
|
+
|
|
265
|
+
# 2. Create symlink
|
|
266
|
+
ln -s ~/path/to/agent-playbook/skills/new-skill/SKILL.md ~/.claude/skills/new-skill.md
|
|
267
|
+
|
|
268
|
+
# 3. Update README.md (add to skills table)
|
|
269
|
+
# 4. Update README.zh-CN.md (add to skills table with translation)
|
|
270
|
+
|
|
271
|
+
# 5. Commit and push
|
|
272
|
+
git add skills/new-skill/ README.md README.zh-CN.md
|
|
273
|
+
git commit -m "feat: add new-skill for ..."
|
|
274
|
+
git push -u origin feature/add-new-skill
|
|
275
|
+
|
|
276
|
+
# 6. Create PR
|
|
277
|
+
gh pr create --title "feat: add new-skill" --body "..."
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Scenario 2: Modifying an Existing Skill
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# 1. Make changes to skill
|
|
284
|
+
vim skills/existing-skill/SKILL.md
|
|
285
|
+
|
|
286
|
+
# 2. Check if description changed
|
|
287
|
+
git diff skills/existing-skill/SKILL.md
|
|
288
|
+
|
|
289
|
+
# 3. If description changed, update README files
|
|
290
|
+
# 4. Commit, push, create PR
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Scenario 3: Bug Fix Only
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# 1. Fix the bug
|
|
297
|
+
vim skills/some-skill/SKILL.md
|
|
298
|
+
|
|
299
|
+
# 2. Commit and push (no README update needed)
|
|
300
|
+
git add skills/some-skill/SKILL.md
|
|
301
|
+
git commit -m "fix: correct typo in some-skill"
|
|
302
|
+
git push
|
|
303
|
+
|
|
304
|
+
# 3. Create PR
|
|
305
|
+
gh pr create --title "fix: correct typo in some-skill"
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Verification Checklist
|
|
309
|
+
|
|
310
|
+
Before creating the PR, verify:
|
|
311
|
+
|
|
312
|
+
- [ ] All changes are committed
|
|
313
|
+
- [ ] Branch is pushed to remote
|
|
314
|
+
- [ ] Commit messages follow Conventional Commits
|
|
315
|
+
- [ ] README.md is updated if needed
|
|
316
|
+
- [ ] README.zh-CN.md is updated if needed
|
|
317
|
+
- [ ] Language switch links are present in both READMEs
|
|
318
|
+
- [ ] New skills have symlinks created
|
|
319
|
+
- [ ] PR title is clear and descriptive
|
|
320
|
+
- [ ] PR description includes summary and changes
|
|
321
|
+
|
|
322
|
+
## Quick Reference
|
|
323
|
+
|
|
324
|
+
| Command | Purpose |
|
|
325
|
+
|---------|---------|
|
|
326
|
+
| `git status` | Check current state |
|
|
327
|
+
| `git diff` | See unstaged changes |
|
|
328
|
+
| `git log main..HEAD` | See branch commits |
|
|
329
|
+
| `git add .` | Stage all changes |
|
|
330
|
+
| `git commit -m "msg"` | Commit with message |
|
|
331
|
+
| `git push -u origin branch` | Push to remote |
|
|
332
|
+
| `gh pr create` | Create pull request |
|
|
333
|
+
|
|
334
|
+
## Tips
|
|
335
|
+
|
|
336
|
+
1. **Commit first, PR later**: Always commit changes before creating PR
|
|
337
|
+
2. **Small PRs**: Keep PRs focused on a single change
|
|
338
|
+
3. **Clear titles**: Use Conventional Commits in PR titles
|
|
339
|
+
4. **Bilingual sync**: Always update both README files together
|
|
340
|
+
5. **Test skills**: Verify skills work before submitting PR
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Debugger
|
|
2
|
+
|
|
3
|
+
> A Claude Code skill for systematic debugging and issue resolution.
|
|
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
|
+
When encountering an error or bug:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
You: This function is throwing an error
|
|
15
|
+
You: Debug this code
|
|
16
|
+
You: Why isn't this working?
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The skill will:
|
|
20
|
+
1. Analyze the error message
|
|
21
|
+
2. Trace the root cause
|
|
22
|
+
3. Provide debugging steps
|
|
23
|
+
4. Suggest fixes
|
|
24
|
+
|
|
25
|
+
## Debugging Process
|
|
26
|
+
|
|
27
|
+
| Phase | Description |
|
|
28
|
+
|-------|-------------|
|
|
29
|
+
| **Understand** | Reproduce and understand the problem |
|
|
30
|
+
| **Isolate** | Narrow down the source of the issue |
|
|
31
|
+
| **Analyze** | Determine root cause |
|
|
32
|
+
| **Fix** | Implement and verify the solution |
|
|
33
|
+
|
|
34
|
+
## Common Error Types
|
|
35
|
+
|
|
36
|
+
| Error | Cause | Solution |
|
|
37
|
+
|-------|-------|----------|
|
|
38
|
+
| TypeError | Wrong type, null reference | Add null check, verify type |
|
|
39
|
+
| ReferenceError | Variable not defined | Check imports, scope |
|
|
40
|
+
| NetworkError | Connection issues | Check endpoint, CORS |
|
|
41
|
+
| TimeoutError | Request too slow | Optimize query, increase timeout |
|
|
42
|
+
|
|
43
|
+
## Scripts
|
|
44
|
+
|
|
45
|
+
Generate debug report:
|
|
46
|
+
```bash
|
|
47
|
+
python scripts/debug_report.py "<error-message>"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Resources
|
|
51
|
+
|
|
52
|
+
- [Debugging Best Practices](https://google.github.io/eng-practices/debugging/)
|
|
53
|
+
- [Systematic Debugging](https://www.amazon.com/Debugging-Software-Technical-Charles-Schooleary/dp/0132519560)
|