@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,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-documenter
|
|
3
|
+
description: API documentation specialist for OpenAPI/Swagger specifications. Use when documenting REST or GraphQL APIs.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# API Documenter
|
|
8
|
+
|
|
9
|
+
Specialist in creating comprehensive API documentation using OpenAPI/Swagger specifications.
|
|
10
|
+
|
|
11
|
+
## When This Skill Activates
|
|
12
|
+
|
|
13
|
+
Activates when you:
|
|
14
|
+
- Ask to document an API
|
|
15
|
+
- Create OpenAPI/Swagger specs
|
|
16
|
+
- Need API reference documentation
|
|
17
|
+
- Mention "API docs"
|
|
18
|
+
|
|
19
|
+
## OpenAPI Specification Structure
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
openapi: 3.0.3
|
|
23
|
+
info:
|
|
24
|
+
title: API Title
|
|
25
|
+
version: 1.0.0
|
|
26
|
+
description: API description
|
|
27
|
+
servers:
|
|
28
|
+
- url: https://example.com/api/v1
|
|
29
|
+
paths:
|
|
30
|
+
/users:
|
|
31
|
+
get:
|
|
32
|
+
summary: List users
|
|
33
|
+
operationId: listUsers
|
|
34
|
+
tags:
|
|
35
|
+
- users
|
|
36
|
+
parameters: []
|
|
37
|
+
responses:
|
|
38
|
+
'200':
|
|
39
|
+
description: Successful response
|
|
40
|
+
content:
|
|
41
|
+
application/json:
|
|
42
|
+
schema:
|
|
43
|
+
type: array
|
|
44
|
+
items:
|
|
45
|
+
$ref: '#/components/schemas/User'
|
|
46
|
+
components:
|
|
47
|
+
schemas:
|
|
48
|
+
User:
|
|
49
|
+
type: object
|
|
50
|
+
properties:
|
|
51
|
+
id:
|
|
52
|
+
type: string
|
|
53
|
+
name:
|
|
54
|
+
type: string
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Endpoint Documentation
|
|
58
|
+
|
|
59
|
+
For each endpoint, document:
|
|
60
|
+
|
|
61
|
+
### Required Fields
|
|
62
|
+
- **summary**: Brief description
|
|
63
|
+
- **operationId**: Unique identifier
|
|
64
|
+
- **description**: Detailed explanation
|
|
65
|
+
- **tags**: For grouping
|
|
66
|
+
- **responses**: All possible responses
|
|
67
|
+
|
|
68
|
+
### Recommended Fields
|
|
69
|
+
- **parameters**: All parameters with details
|
|
70
|
+
- **requestBody**: For POST/PUT/PATCH
|
|
71
|
+
- **security**: Authentication requirements
|
|
72
|
+
- **deprecated**: If applicable
|
|
73
|
+
|
|
74
|
+
### Example
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
/users/{id}:
|
|
78
|
+
get:
|
|
79
|
+
summary: Get a user by ID
|
|
80
|
+
operationId: getUserById
|
|
81
|
+
description: Retrieves a single user by their unique identifier
|
|
82
|
+
tags:
|
|
83
|
+
- users
|
|
84
|
+
parameters:
|
|
85
|
+
- name: id
|
|
86
|
+
in: path
|
|
87
|
+
required: true
|
|
88
|
+
schema:
|
|
89
|
+
type: string
|
|
90
|
+
description: The user ID
|
|
91
|
+
responses:
|
|
92
|
+
'200':
|
|
93
|
+
description: User found
|
|
94
|
+
content:
|
|
95
|
+
application/json:
|
|
96
|
+
schema:
|
|
97
|
+
$ref: '#/components/schemas/User'
|
|
98
|
+
'404':
|
|
99
|
+
description: User not found
|
|
100
|
+
content:
|
|
101
|
+
application/json:
|
|
102
|
+
schema:
|
|
103
|
+
$ref: '#/components/schemas/Error'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Schema Documentation
|
|
107
|
+
|
|
108
|
+
### Best Practices
|
|
109
|
+
|
|
110
|
+
1. **Use references** for shared schemas
|
|
111
|
+
2. **Add descriptions** to all properties
|
|
112
|
+
3. **Specify format** for strings (email, uuid, date-time)
|
|
113
|
+
4. **Add examples** for complex schemas
|
|
114
|
+
5. **Mark required fields**
|
|
115
|
+
|
|
116
|
+
### Example
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
components:
|
|
120
|
+
schemas:
|
|
121
|
+
User:
|
|
122
|
+
type: object
|
|
123
|
+
required:
|
|
124
|
+
- id
|
|
125
|
+
- email
|
|
126
|
+
properties:
|
|
127
|
+
id:
|
|
128
|
+
type: string
|
|
129
|
+
format: uuid
|
|
130
|
+
description: Unique user identifier
|
|
131
|
+
example: "550e8400-e29b-41d4-a716-446655440000"
|
|
132
|
+
email:
|
|
133
|
+
type: string
|
|
134
|
+
format: email
|
|
135
|
+
description: User's email address
|
|
136
|
+
example: "user@example.com"
|
|
137
|
+
createdAt:
|
|
138
|
+
type: string
|
|
139
|
+
format: date-time
|
|
140
|
+
description: Account creation timestamp
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Authentication Documentation
|
|
144
|
+
|
|
145
|
+
Document auth requirements:
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
security:
|
|
149
|
+
- bearerAuth: []
|
|
150
|
+
|
|
151
|
+
components:
|
|
152
|
+
securitySchemes:
|
|
153
|
+
bearerAuth:
|
|
154
|
+
type: http
|
|
155
|
+
scheme: bearer
|
|
156
|
+
bearerFormat: JWT
|
|
157
|
+
description: Use your JWT token from /auth/login
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Error Responses
|
|
161
|
+
|
|
162
|
+
Standard error format:
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
components:
|
|
166
|
+
schemas:
|
|
167
|
+
Error:
|
|
168
|
+
type: object
|
|
169
|
+
properties:
|
|
170
|
+
error:
|
|
171
|
+
type: string
|
|
172
|
+
description: Error message
|
|
173
|
+
code:
|
|
174
|
+
type: string
|
|
175
|
+
description: Application-specific error code
|
|
176
|
+
details:
|
|
177
|
+
type: object
|
|
178
|
+
description: Additional error details
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Common HTTP status codes:
|
|
182
|
+
- **200**: Success
|
|
183
|
+
- **201**: Created
|
|
184
|
+
- **204**: No Content
|
|
185
|
+
- **400**: Bad Request
|
|
186
|
+
- **401**: Unauthorized
|
|
187
|
+
- **403**: Forbidden
|
|
188
|
+
- **404**: Not Found
|
|
189
|
+
- **409**: Conflict
|
|
190
|
+
- **422**: Unprocessable Entity
|
|
191
|
+
- **500**: Internal Server Error
|
|
192
|
+
|
|
193
|
+
## Scripts
|
|
194
|
+
|
|
195
|
+
Generate OpenAPI spec from code:
|
|
196
|
+
```bash
|
|
197
|
+
python scripts/generate_openapi.py
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Validate OpenAPI spec:
|
|
201
|
+
```bash
|
|
202
|
+
python scripts/validate_openapi.py openapi.yaml
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## References
|
|
206
|
+
|
|
207
|
+
- `references/openapi-template.yaml` - OpenAPI template
|
|
208
|
+
- `references/examples/` - API documentation examples
|
|
209
|
+
- [OpenAPI Specification](https://swagger.io/specification/)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Template generator for OpenAPI schema.
|
|
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 starter OpenAPI schema.")
|
|
20
|
+
parser.add_argument("--output", default="openapi.yaml", help="Output file path")
|
|
21
|
+
parser.add_argument("--name", default="example", help="Resource name")
|
|
22
|
+
parser.add_argument("--version", default="1.0.0", help="API version")
|
|
23
|
+
parser.add_argument(
|
|
24
|
+
"--base-url", default="https://example.com", help="Server base URL"
|
|
25
|
+
)
|
|
26
|
+
parser.add_argument("--force", action="store_true", help="Overwrite existing file")
|
|
27
|
+
args = parser.parse_args()
|
|
28
|
+
|
|
29
|
+
schema_name = "".join(part.capitalize() for part in args.name.split("-"))
|
|
30
|
+
if not schema_name:
|
|
31
|
+
schema_name = "Example"
|
|
32
|
+
|
|
33
|
+
content = textwrap.dedent(
|
|
34
|
+
f"""\
|
|
35
|
+
openapi: 3.0.3
|
|
36
|
+
info:
|
|
37
|
+
title: {args.name} API
|
|
38
|
+
version: {args.version}
|
|
39
|
+
description: API description for {args.name}
|
|
40
|
+
servers:
|
|
41
|
+
- url: {args.base_url}
|
|
42
|
+
paths:
|
|
43
|
+
/{args.name}:
|
|
44
|
+
get:
|
|
45
|
+
summary: List {args.name}
|
|
46
|
+
responses:
|
|
47
|
+
"200":
|
|
48
|
+
description: OK
|
|
49
|
+
content:
|
|
50
|
+
application/json:
|
|
51
|
+
schema:
|
|
52
|
+
type: object
|
|
53
|
+
properties:
|
|
54
|
+
items:
|
|
55
|
+
type: array
|
|
56
|
+
items:
|
|
57
|
+
$ref: "#/components/schemas/{schema_name}"
|
|
58
|
+
components:
|
|
59
|
+
schemas:
|
|
60
|
+
{schema_name}:
|
|
61
|
+
type: object
|
|
62
|
+
properties:
|
|
63
|
+
id:
|
|
64
|
+
type: string
|
|
65
|
+
name:
|
|
66
|
+
type: string
|
|
67
|
+
securitySchemes:
|
|
68
|
+
bearerAuth:
|
|
69
|
+
type: http
|
|
70
|
+
scheme: bearer
|
|
71
|
+
security:
|
|
72
|
+
- bearerAuth: []
|
|
73
|
+
"""
|
|
74
|
+
).strip() + "\n"
|
|
75
|
+
|
|
76
|
+
output = Path(args.output)
|
|
77
|
+
if not write_output(output, content, args.force):
|
|
78
|
+
return 1
|
|
79
|
+
print(f"Wrote {output}")
|
|
80
|
+
return 0
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Template validator for OpenAPI schema.
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
DEFAULT_REQUIRED = [
|
|
8
|
+
"openapi:",
|
|
9
|
+
"info:",
|
|
10
|
+
"servers:",
|
|
11
|
+
"paths:",
|
|
12
|
+
"components:",
|
|
13
|
+
"securitySchemes:",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main() -> int:
|
|
18
|
+
parser = argparse.ArgumentParser(description="Validate a generated artifact.")
|
|
19
|
+
parser.add_argument("--input", default="openapi.yaml", help="Input file path")
|
|
20
|
+
parser.add_argument(
|
|
21
|
+
"--require",
|
|
22
|
+
action="append",
|
|
23
|
+
default=[],
|
|
24
|
+
help="Additional required section heading",
|
|
25
|
+
)
|
|
26
|
+
args = parser.parse_args()
|
|
27
|
+
|
|
28
|
+
path = Path(args.input)
|
|
29
|
+
if not path.exists():
|
|
30
|
+
print(f"Missing file: {path}")
|
|
31
|
+
return 1
|
|
32
|
+
|
|
33
|
+
text = path.read_text(encoding="utf-8", errors="ignore")
|
|
34
|
+
required = DEFAULT_REQUIRED + args.require
|
|
35
|
+
missing = [token for token in required if token not in text]
|
|
36
|
+
if missing:
|
|
37
|
+
print("Missing required sections: " + ", ".join(missing))
|
|
38
|
+
return 1
|
|
39
|
+
|
|
40
|
+
print(f"Validated {path}")
|
|
41
|
+
return 0
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if __name__ == "__main__":
|
|
45
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Architecting Solutions
|
|
2
|
+
|
|
3
|
+
> A Claude Code skill for technical solution and architecture design.
|
|
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: Design solution for a new billing system
|
|
13
|
+
You: Provide an architecture design for multi-tenant analytics
|
|
14
|
+
You: Technical design for a data migration plan
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Focus Areas
|
|
18
|
+
|
|
19
|
+
1. **Clarify requirements** and success criteria
|
|
20
|
+
2. **Analyze constraints** and existing patterns
|
|
21
|
+
3. **Propose options** with trade-offs
|
|
22
|
+
4. **Document the decision** in a PRD-style output in `docs/`
|