@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.
- 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 +25 -10
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-engineer
|
|
3
|
+
description: Technical documentation expert for creating clear, comprehensive documentation. Use when user asks to write docs, create README, or document code.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Grep, Glob, WebFetch, WebSearch
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Documentation Engineer
|
|
8
|
+
|
|
9
|
+
Expert in creating clear, comprehensive, and maintainable technical documentation.
|
|
10
|
+
|
|
11
|
+
## When This Skill Activates
|
|
12
|
+
|
|
13
|
+
Activates when you:
|
|
14
|
+
- Ask to write documentation
|
|
15
|
+
- Request README creation
|
|
16
|
+
- Mention "docs" or "document this"
|
|
17
|
+
- Need API documentation
|
|
18
|
+
|
|
19
|
+
## Documentation Types
|
|
20
|
+
|
|
21
|
+
### 1. README
|
|
22
|
+
Every project should have a README with:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# Project Name
|
|
26
|
+
|
|
27
|
+
Brief description (what it does, why it exists)
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
Installation and usage in 3 steps or less.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
Detailed installation instructions.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
Examples of common usage patterns.
|
|
40
|
+
|
|
41
|
+
## Configuration
|
|
42
|
+
|
|
43
|
+
Environment variables and configuration options.
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
How to run tests, build, and develop locally.
|
|
48
|
+
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
51
|
+
Guidelines for contributors.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
License information.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. API Documentation
|
|
59
|
+
|
|
60
|
+
For each endpoint/function:
|
|
61
|
+
|
|
62
|
+
- **Description**: What it does
|
|
63
|
+
- **Parameters**: Name, type, required/optional, description
|
|
64
|
+
- **Return value**: Type and structure
|
|
65
|
+
- **Errors**: Possible errors and conditions
|
|
66
|
+
- **Examples**: Usage examples
|
|
67
|
+
|
|
68
|
+
### 3. Code Comments
|
|
69
|
+
|
|
70
|
+
Comment **why**, not **what**:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// Bad: Sets the count to zero
|
|
74
|
+
count = 0;
|
|
75
|
+
|
|
76
|
+
// Good: Reset count for new measurement cycle
|
|
77
|
+
count = 0;
|
|
78
|
+
|
|
79
|
+
// Bad: Check if user is admin
|
|
80
|
+
if (user.role === 'admin') {
|
|
81
|
+
|
|
82
|
+
// Good: Only admins can bypass approval workflow
|
|
83
|
+
if (user.role === 'admin') {
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 4. Architecture Documentation
|
|
87
|
+
|
|
88
|
+
- System overview
|
|
89
|
+
- Component relationships
|
|
90
|
+
- Data flow
|
|
91
|
+
- Design decisions
|
|
92
|
+
- Trade-offs considered
|
|
93
|
+
|
|
94
|
+
## Documentation Principles
|
|
95
|
+
|
|
96
|
+
1. **Be Clear**: Use simple, direct language
|
|
97
|
+
2. **Be Concise**: Respect the reader's time
|
|
98
|
+
3. **Be Accurate**: Keep docs in sync with code
|
|
99
|
+
4. **Be Complete**: Cover all public interfaces
|
|
100
|
+
5. **Be Current**: Update docs when code changes
|
|
101
|
+
|
|
102
|
+
## Writing Guidelines
|
|
103
|
+
|
|
104
|
+
### Headings
|
|
105
|
+
- Use sentence case for headings
|
|
106
|
+
- Start with a verb or noun
|
|
107
|
+
- Be descriptive
|
|
108
|
+
|
|
109
|
+
### Code Examples
|
|
110
|
+
- Show before/after when appropriate
|
|
111
|
+
- Include import statements
|
|
112
|
+
- Show expected output
|
|
113
|
+
- Handle edge cases
|
|
114
|
+
|
|
115
|
+
### Links
|
|
116
|
+
- Use relative links for internal docs
|
|
117
|
+
- Include anchors for sections
|
|
118
|
+
- Test that links work
|
|
119
|
+
|
|
120
|
+
### Diagrams
|
|
121
|
+
- Use Mermaid for flowcharts and sequences
|
|
122
|
+
- Keep diagrams simple
|
|
123
|
+
- Add a title and legend
|
|
124
|
+
|
|
125
|
+
## Documentation Checklist
|
|
126
|
+
|
|
127
|
+
### README
|
|
128
|
+
- [ ] Project description
|
|
129
|
+
- [ ] Quick start guide
|
|
130
|
+
- [ ] Installation instructions
|
|
131
|
+
- [ ] Usage examples
|
|
132
|
+
- [ ] Configuration guide
|
|
133
|
+
- [ ] Contributing guidelines
|
|
134
|
+
|
|
135
|
+
### Code Docs
|
|
136
|
+
- [ ] All public functions documented
|
|
137
|
+
- [ ] Parameters and returns documented
|
|
138
|
+
- [ ] Examples provided for complex functions
|
|
139
|
+
- [ ] Edge cases documented
|
|
140
|
+
|
|
141
|
+
### API Docs
|
|
142
|
+
- [ ] All endpoints documented
|
|
143
|
+
- [ ] Request/response schemas
|
|
144
|
+
- [ ] Authentication requirements
|
|
145
|
+
- [ ] Error responses documented
|
|
146
|
+
- [ ] Rate limits documented
|
|
147
|
+
|
|
148
|
+
## Scripts
|
|
149
|
+
|
|
150
|
+
Generate documentation structure:
|
|
151
|
+
```bash
|
|
152
|
+
python scripts/generate_docs.py
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Validate documentation:
|
|
156
|
+
```bash
|
|
157
|
+
python scripts/validate_docs.py
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## References
|
|
161
|
+
|
|
162
|
+
- `references/readme-template.md` - README template
|
|
163
|
+
- `references/api-template.md` - API documentation template
|
|
164
|
+
- `references/style-guide.md` - Documentation style guide
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# API Documentation Template
|
|
2
|
+
|
|
3
|
+
## Endpoint: /resource
|
|
4
|
+
|
|
5
|
+
**Method:** GET | POST | PUT | DELETE
|
|
6
|
+
|
|
7
|
+
**Description:** What the endpoint does.
|
|
8
|
+
|
|
9
|
+
### Parameters
|
|
10
|
+
- `id` (string, required) - Resource identifier
|
|
11
|
+
|
|
12
|
+
### Response
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"data": {}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Errors
|
|
20
|
+
- `400` Bad Request
|
|
21
|
+
- `401` Unauthorized
|
|
22
|
+
- `404` Not Found
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# README Template
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Describe what the project does and why it exists.
|
|
5
|
+
|
|
6
|
+
## Quick Start
|
|
7
|
+
1. Install dependencies
|
|
8
|
+
2. Configure environment
|
|
9
|
+
3. Run the main command
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
- Requirements
|
|
13
|
+
- Setup steps
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
Provide common usage examples.
|
|
17
|
+
|
|
18
|
+
## Configuration
|
|
19
|
+
List environment variables and configuration options.
|
|
20
|
+
|
|
21
|
+
## Development
|
|
22
|
+
How to lint, test, and build locally.
|
|
23
|
+
|
|
24
|
+
## Contributing
|
|
25
|
+
Explain how to propose changes.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Documentation Style Guide
|
|
2
|
+
|
|
3
|
+
## Headings
|
|
4
|
+
- Use sentence case
|
|
5
|
+
- Keep headings short and specific
|
|
6
|
+
|
|
7
|
+
## Code Blocks
|
|
8
|
+
- Always specify a language
|
|
9
|
+
- Keep examples minimal and runnable
|
|
10
|
+
|
|
11
|
+
## Links
|
|
12
|
+
- Use relative links for internal docs
|
|
13
|
+
- Prefer stable URLs for external references
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Template generator for documentation scaffold.
|
|
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 documentation scaffold.")
|
|
20
|
+
parser.add_argument("--output", default="docs/README.md", help="Output file path")
|
|
21
|
+
parser.add_argument("--name", default="example", help="Product or service 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
|
+
# Documentation
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
Describe {args.name} and its purpose.
|
|
32
|
+
|
|
33
|
+
## Ownership
|
|
34
|
+
- Owner: {args.owner}
|
|
35
|
+
- Support channel: TBD
|
|
36
|
+
|
|
37
|
+
## Quickstart
|
|
38
|
+
1. Install dependencies
|
|
39
|
+
2. Configure environment
|
|
40
|
+
3. Run the service
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
- Required environment variables
|
|
44
|
+
- Feature flags
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
Examples for {args.name}.
|
|
48
|
+
|
|
49
|
+
## API Reference
|
|
50
|
+
- Endpoints or SDK methods
|
|
51
|
+
|
|
52
|
+
## Troubleshooting
|
|
53
|
+
- Common errors and fixes
|
|
54
|
+
|
|
55
|
+
## Changelog
|
|
56
|
+
- Recent updates
|
|
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,46 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Template validator for documentation scaffold.
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
DEFAULT_REQUIRED = [
|
|
8
|
+
"## Overview",
|
|
9
|
+
"## Ownership",
|
|
10
|
+
"## Quickstart",
|
|
11
|
+
"## Configuration",
|
|
12
|
+
"## Usage",
|
|
13
|
+
"## Troubleshooting",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main() -> int:
|
|
18
|
+
parser = argparse.ArgumentParser(description="Validate a generated artifact.")
|
|
19
|
+
parser.add_argument("--input", default="docs/README.md", 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
|
+
text_lower = text.lower()
|
|
35
|
+
required = DEFAULT_REQUIRED + args.require
|
|
36
|
+
missing = [section for section in required if section.lower() not in text_lower]
|
|
37
|
+
if missing:
|
|
38
|
+
print("Missing required sections: " + ", ".join(missing))
|
|
39
|
+
return 1
|
|
40
|
+
|
|
41
|
+
print(f"Validated {path}")
|
|
42
|
+
return 0
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if __name__ == "__main__":
|
|
46
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Figma Designer Skill
|
|
2
|
+
|
|
3
|
+
> "Transform Figma designs into implementation-ready specifications with pixel-perfect accuracy"
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This skill analyzes Figma designs through the Figma MCP server and generates detailed PRDs with precise visual specifications. It extracts design tokens, component specifications, and layout information that developers can implement directly.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
The skill should be symbolically linked to your Claude Code skills directory:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ln -s ~/agent-playbook/skills/figma-designer/SKILL.md ~/.claude/skills/figma-designer.md
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
### Figma MCP Server
|
|
20
|
+
|
|
21
|
+
Ensure the Figma MCP server is connected and accessible:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Check if Figma MCP is available
|
|
25
|
+
mcp-list
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If not available, install from: https://github.com/modelcontextprotocol/servers
|
|
29
|
+
|
|
30
|
+
Required Figma MCP tools:
|
|
31
|
+
- `figma_get_file` - Get file metadata
|
|
32
|
+
- `figma_get_nodes` - Get node details
|
|
33
|
+
- `figma_get_components` - Get component information
|
|
34
|
+
|
|
35
|
+
### Figma Access Token
|
|
36
|
+
|
|
37
|
+
You need a Figma access token with appropriate permissions:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Set environment variable
|
|
41
|
+
export FIGMA_ACCESS_TOKEN="your_token_here"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Basic Usage
|
|
47
|
+
|
|
48
|
+
Provide a Figma link or ask to analyze a design:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
You: Analyze this Figma design: https://www.figma.com/file/abc123/My-Design
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The skill will automatically:
|
|
55
|
+
1. Extract the file key from the URL
|
|
56
|
+
2. Fetch design data via Figma MCP
|
|
57
|
+
3. Analyze design tokens (colors, typography, spacing)
|
|
58
|
+
4. Extract component hierarchy
|
|
59
|
+
5. Generate visual specifications
|
|
60
|
+
|
|
61
|
+
### With PRD Generation
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
You: Create a PRD from this Figma design: [URL]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Generates a complete 4-file PRD in `docs/`:
|
|
68
|
+
- `{feature}-notes.md` - Design decisions
|
|
69
|
+
- `{feature}-task-plan.md` - Implementation tasks
|
|
70
|
+
- `{feature}-prd.md` - Product requirements
|
|
71
|
+
- `{feature}-tech.md` - Technical specifications
|
|
72
|
+
|
|
73
|
+
## What Gets Extracted
|
|
74
|
+
|
|
75
|
+
### Design Tokens
|
|
76
|
+
|
|
77
|
+
| Category | What's Extracted |
|
|
78
|
+
|----------|-----------------|
|
|
79
|
+
| **Colors** | Hex/RGBA values for primary, secondary, semantic colors |
|
|
80
|
+
| **Typography** | Font families, sizes, weights, line heights, letter spacing |
|
|
81
|
+
| **Spacing** | Padding, margin, gap values (typically 4/8/12/16px scale) |
|
|
82
|
+
| **Borders** | Corner radius, border widths |
|
|
83
|
+
| **Shadows** | Offset, blur, spread, color values |
|
|
84
|
+
| **Icons** | Names, sizes, colors |
|
|
85
|
+
| **Images** | URLs, dimensions, fit modes |
|
|
86
|
+
|
|
87
|
+
### Component Analysis
|
|
88
|
+
|
|
89
|
+
For each component found in the design:
|
|
90
|
+
- Props (size, variant, state)
|
|
91
|
+
- Layout (flex direction, alignment, gap, padding)
|
|
92
|
+
- Styles (fill, stroke, effects)
|
|
93
|
+
- Content (text, icons, images)
|
|
94
|
+
- Constraints (responsive behavior)
|
|
95
|
+
|
|
96
|
+
## Output Examples
|
|
97
|
+
|
|
98
|
+
### Visual Specification
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Screen: Login
|
|
102
|
+
|
|
103
|
+
### Layout Structure
|
|
104
|
+
```
|
|
105
|
+
┌─────────────────────────────────────────┐
|
|
106
|
+
│ Logo [Icon] │
|
|
107
|
+
├─────────────────────────────────────────┤
|
|
108
|
+
│ Welcome back │
|
|
109
|
+
│ Sign in to continue │
|
|
110
|
+
├─────────────────────────────────────────┤
|
|
111
|
+
│ Email [✓] │
|
|
112
|
+
│ ┌────────────────────────────────┐ │
|
|
113
|
+
│ └────────────────────────────────┘ │
|
|
114
|
+
├─────────────────────────────────────────┤
|
|
115
|
+
│ Password [👁️] │
|
|
116
|
+
│ ┌────────────────────────────────┐ │
|
|
117
|
+
│ └────────────────────────────────┘ │
|
|
118
|
+
├─────────────────────────────────────────┤
|
|
119
|
+
│ Forgot password? │
|
|
120
|
+
├─────────────────────────────────────────┤
|
|
121
|
+
│ [ Sign In ] │
|
|
122
|
+
└─────────────────────────────────────────┘
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Design Tokens
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// tokens.ts
|
|
129
|
+
export const colors = {
|
|
130
|
+
primary: '#007AFF',
|
|
131
|
+
background: '#FFFFFF',
|
|
132
|
+
surface: '#F5F5F7',
|
|
133
|
+
textPrimary: '#1C1C1E',
|
|
134
|
+
textSecondary: '#8E8E93',
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const typography = {
|
|
138
|
+
displayLarge: {
|
|
139
|
+
fontSize: 28,
|
|
140
|
+
fontWeight: '700',
|
|
141
|
+
lineHeight: 34,
|
|
142
|
+
},
|
|
143
|
+
// ...
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const spacing = {
|
|
147
|
+
xs: 4,
|
|
148
|
+
sm: 8,
|
|
149
|
+
md: 12,
|
|
150
|
+
lg: 16,
|
|
151
|
+
xl: 24,
|
|
152
|
+
2xl: 32,
|
|
153
|
+
};
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Integration with Other Skills
|
|
157
|
+
|
|
158
|
+
### Typical Workflow
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Figma URL → figma-designer → Visual Specs
|
|
162
|
+
↓
|
|
163
|
+
prd-planner → PRD
|
|
164
|
+
↓
|
|
165
|
+
implementation → Code
|
|
166
|
+
↓
|
|
167
|
+
code-reviewer → Quality Check
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Auto-Triggers
|
|
171
|
+
|
|
172
|
+
After figma-designer completes:
|
|
173
|
+
- `prd-planner` (ask first) - Further refine PRD with 4-file pattern
|
|
174
|
+
- `self-improving-agent` (background) - Learn design patterns
|
|
175
|
+
- `session-logger` (auto) - Save design analysis session
|
|
176
|
+
|
|
177
|
+
## Platform Support
|
|
178
|
+
|
|
179
|
+
The skill generates specifications for:
|
|
180
|
+
- **React Native** - Uses StyleSheet with exact pixel values
|
|
181
|
+
- **React/Web** - CSS values with proper units
|
|
182
|
+
- **SwiftUI** - Native SwiftUI values
|
|
183
|
+
|
|
184
|
+
## Examples
|
|
185
|
+
|
|
186
|
+
### Example 1: Quick Analysis
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
You: What are the colors used in this design?
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Returns a table of all colors with their usage contexts.
|
|
193
|
+
|
|
194
|
+
### Example 2: Component Spec
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
You: Extract the button component specifications
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Returns props interface, variants, and all states.
|
|
201
|
+
|
|
202
|
+
### Example 3: Full PRD
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
You: Create a complete PRD from this Figma file
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Generates 4-file PRD with all visual specifications.
|
|
209
|
+
|
|
210
|
+
## Tips
|
|
211
|
+
|
|
212
|
+
1. **Organize Figma files** with clear naming conventions for better extraction
|
|
213
|
+
2. **Use components** for reusable elements to get proper component specs
|
|
214
|
+
3. **Set up auto-layout** in Figma for accurate layout information
|
|
215
|
+
4. **Document prototypes** to include interaction states
|
|
216
|
+
5. **Provide context** about target platform for platform-specific output
|
|
217
|
+
|
|
218
|
+
## See Also
|
|
219
|
+
|
|
220
|
+
- [SKILL.md](./SKILL.md) - Full skill definition with all templates
|
|
221
|
+
- [prd-planner](../prd-planner/) - Create PRDs from design specs
|
|
222
|
+
- [architecting-solutions](../architecting-solutions/) - Technical architecture
|