@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,68 @@
1
+ # Conventional Commits Specification
2
+
3
+ ## Summary
4
+
5
+ The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history.
6
+
7
+ ## Structure
8
+
9
+ ```
10
+ <type>[optional scope]: <description>
11
+
12
+ [optional body]
13
+
14
+ [optional footer(s)]
15
+ ```
16
+
17
+ ## Type
18
+
19
+ Must be one of the following:
20
+
21
+ - **feat**: A new feature
22
+ - **fix**: A bug fix
23
+ - **docs**: Documentation only changes
24
+ - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
25
+ - **refactor**: A code change that neither fixes a bug nor adds a feature
26
+ - **perf**: A code change that improves performance
27
+ - **test**: Adding missing tests or correcting existing tests
28
+ - **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
29
+ - **ci**: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
30
+ - **chore**: Other changes that don't modify src or test files
31
+ - **revert**: Reverts a previous commit
32
+
33
+ ## Scope
34
+
35
+ The scope should be the name of the npm package or module affected.
36
+
37
+ ## Description
38
+
39
+ The description contains a short description of the change:
40
+
41
+ - Use imperative, present tense: "change" not "changed" nor "changes"
42
+ - Don't capitalize the first letter
43
+ - No period (.) at the end
44
+
45
+ ## Body
46
+
47
+ Just as in the subject, use the imperative, present tense: "fix" not "fixed" nor "fixes".
48
+
49
+ Explain **what** and **why** instead of **how**.
50
+
51
+ ## Footer
52
+
53
+ The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
54
+
55
+ ## Breaking Changes
56
+
57
+ A BREAKING CHANGE must be indicated in the footer. A BREAKING CHANGE must be a part of the type/scope or the description.
58
+
59
+ ```
60
+ feat(api): remove deprecated endpoints
61
+
62
+ BREAKING CHANGE: The /api/v1/users endpoint has been removed.
63
+ ```
64
+
65
+ ## References
66
+
67
+ - https://www.conventionalcommits.org/
68
+ - https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format
@@ -0,0 +1,125 @@
1
+ # Commit Message Examples
2
+
3
+ ## Features
4
+
5
+ ```
6
+ feat(auth): add OAuth2 login support
7
+
8
+ Implement OAuth2 authentication flow supporting Google and GitHub
9
+ providers. Users can now link multiple social accounts to their profile.
10
+
11
+ Closes #123
12
+ ```
13
+
14
+ ```
15
+ feat(components): add data table component
16
+
17
+ New reusable table component with built-in sorting, filtering, and
18
+ pagination. Uses TanStack Table for performance.
19
+ ```
20
+
21
+ ## Bug Fixes
22
+
23
+ ```
24
+ fix(api): resolve race condition in user creation
25
+
26
+ Concurrent requests could create duplicate users. Added unique constraint
27
+ on email field with proper error handling.
28
+
29
+ Fixes #456
30
+ ```
31
+
32
+ ```
33
+ fix(auth): prevent session token leakage
34
+
35
+ Session tokens were being logged in debug output. Removed sensitive
36
+ data from debug logs.
37
+ ```
38
+
39
+ ## Refactoring
40
+
41
+ ```
42
+ refactor(user): extract validation logic
43
+
44
+ Moved user validation logic into a dedicated validator module to
45
+ enable reuse across different parts of the application.
46
+ ```
47
+
48
+ ```
49
+ refactor(api): simplify error handling middleware
50
+
51
+ Unified error response format across all API endpoints.
52
+ ```
53
+
54
+ ## Documentation
55
+
56
+ ```
57
+ docs: update installation guide with new requirements
58
+
59
+ Added Python 3.12 and Node.js 20 to the supported versions list.
60
+ Updated docker-compose examples.
61
+ ```
62
+
63
+ ```
64
+ docs(api): add OpenAPI specification for v2 endpoints
65
+
66
+ Complete API documentation including request/response schemas and
67
+ authentication requirements.
68
+ ```
69
+
70
+ ## Performance
71
+
72
+ ```
73
+ perf(api): add database query caching
74
+
75
+ Implemented Redis caching for frequently accessed data. Reduced
76
+ average response time from 200ms to 50ms.
77
+ ```
78
+
79
+ ```
80
+ perf(frontend): lazy load images below fold
81
+
82
+ Implemented Intersection Observer for lazy loading. Reduced initial
83
+ page load by 40%.
84
+ ```
85
+
86
+ ## Breaking Changes
87
+
88
+ ```
89
+ feat(api): migrate to REST v2
90
+
91
+ API endpoints have been restructured for better consistency.
92
+ Old v1 endpoints are deprecated.
93
+
94
+ BREAKING CHANGE: All `/api/v1/*` endpoints moved to `/api/v2/*`.
95
+ Migration guide: docs/api-migration-v1-to-v2.md
96
+
97
+ Closes #789
98
+ ```
99
+
100
+ ## Complex Example
101
+
102
+ ```
103
+ feat(payment): integrate Stripe payment processing
104
+
105
+ Add comprehensive Stripe integration for subscription and one-time payments.
106
+ Includes webhook handling for payment events and automatic invoice generation.
107
+
108
+ Key features:
109
+ - Support for multiple payment methods (card, Apple Pay, Google Pay)
110
+ - Subscription lifecycle management
111
+ - Payment failure retry logic
112
+ - PCI-compliant card handling via Stripe Elements
113
+
114
+ Security considerations:
115
+ - All card data is handled directly by Stripe
116
+ - Webhook signatures are verified
117
+ - Sensitive payment data is never stored locally
118
+
119
+ Migration notes:
120
+ - Existing users need to add payment method
121
+ - Trial period extended by 14 days for existing users
122
+
123
+ Related tickets: FEAT-123, FEAT-124
124
+ Breaking Change: Old PayPal integration removed
125
+ ```
@@ -0,0 +1,49 @@
1
+ # Recommended Scopes
2
+
3
+ ## Frontend
4
+
5
+ | Scope | Usage |
6
+ |-------|-------|
7
+ | `components` | UI component changes |
8
+ | `hooks` | Custom React hooks |
9
+ | `store` | State management (Redux, Zustand, etc.) |
10
+ | `styles` | CSS, styled-components, theme |
11
+ | `utils` | Utility functions |
12
+ | `forms` | Form-related changes |
13
+ | `routing` | Route configuration |
14
+
15
+ ## Backend
16
+
17
+ | Scope | Usage |
18
+ |-------|-------|
19
+ | `api` | API endpoints, controllers |
20
+ | `models` | Data models, schemas |
21
+ | `services` | Business logic services |
22
+ | `database` | Database queries, migrations |
23
+ | `auth` | Authentication, authorization |
24
+ | `middleware` | Express/HTTP middleware |
25
+ | `validators` | Input validation |
26
+
27
+ ## DevOps
28
+
29
+ | Scope | Usage |
30
+ |-------|-------|
31
+ | `ci` | Continuous Integration (GitHub Actions, Jenkins) |
32
+ | `cd` | Continuous Deployment |
33
+ | `docker` | Dockerfile, docker-compose |
34
+ | `k8s` | Kubernetes manifests |
35
+ | `terraform` | Infrastructure as Code |
36
+
37
+ ## General
38
+
39
+ | Scope | Usage |
40
+ |-------|-------|
41
+ | `config` | Configuration changes |
42
+ | `deps` | Dependency updates |
43
+ | `tests` | Test files (use `test` type for test code changes) |
44
+ | `types` | TypeScript type definitions |
45
+ | `assets` | Images, fonts, static files |
46
+
47
+ ## Project-Specific
48
+
49
+ Projects should define their own scopes based on their module structure. Document project-specific scopes in the project's CONTRIBUTING.md.
@@ -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