forge-workflow 1.0.0
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/.claude/commands/check.md +145 -0
- package/.claude/commands/dev.md +184 -0
- package/.claude/commands/merge.md +170 -0
- package/.claude/commands/plan.md +141 -0
- package/.claude/commands/research.md +125 -0
- package/.claude/commands/review.md +393 -0
- package/.claude/commands/ship.md +120 -0
- package/.claude/commands/sonarcloud.md +156 -0
- package/.claude/commands/status.md +76 -0
- package/.claude/commands/verify.md +185 -0
- package/.claude/rules/workflow.md +98 -0
- package/.claude/scripts/load-env.sh +32 -0
- package/.claude/skills/parallel-ai/README.md +135 -0
- package/.claude/skills/parallel-ai/SKILL.md +94 -0
- package/.claude/skills/parallel-ai/api-reference.md +141 -0
- package/.claude/skills/parallel-ai/quick-reference.md +100 -0
- package/.claude/skills/parallel-ai/research-workflows.md +77 -0
- package/.claude/skills/sonarcloud/SKILL.md +154 -0
- package/.claude/skills/sonarcloud/reference.md +466 -0
- package/README.md +205 -0
- package/bin/forge.js +140 -0
- package/docs/WORKFLOW.md +251 -0
- package/docs/research/TEMPLATE.md +292 -0
- package/install.sh +88 -0
- package/package.json +36 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: SonarCloud Query
|
|
3
|
+
description: Pull issues, metrics, quality gates, and analysis data from SonarCloud
|
|
4
|
+
category: Code Quality
|
|
5
|
+
tags: [sonarcloud, issues, metrics, quality]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# SonarCloud Query Command
|
|
9
|
+
|
|
10
|
+
Pull code quality data from SonarCloud. Requires `SONARCLOUD_TOKEN` environment variable.
|
|
11
|
+
|
|
12
|
+
## Arguments
|
|
13
|
+
|
|
14
|
+
- `$ARGUMENTS` - Query type and parameters
|
|
15
|
+
|
|
16
|
+
## Query Types
|
|
17
|
+
|
|
18
|
+
| Query | Description | Example |
|
|
19
|
+
|-------|-------------|---------|
|
|
20
|
+
| `issues <project>` | Get open issues | `/sonarcloud issues my-project` |
|
|
21
|
+
| `metrics <project>` | Get code metrics | `/sonarcloud metrics my-project` |
|
|
22
|
+
| `gate <project>` | Quality gate status | `/sonarcloud gate my-project` |
|
|
23
|
+
| `health <project>` | Full health report | `/sonarcloud health my-project` |
|
|
24
|
+
| `pr <project> <pr#>` | PR analysis | `/sonarcloud pr my-project 123` |
|
|
25
|
+
| `hotspots <project>` | Security hotspots | `/sonarcloud hotspots my-project` |
|
|
26
|
+
| `history <project>` | Analysis history | `/sonarcloud history my-project` |
|
|
27
|
+
|
|
28
|
+
## Filters (append to query)
|
|
29
|
+
|
|
30
|
+
| Filter | Description | Example |
|
|
31
|
+
|--------|-------------|---------|
|
|
32
|
+
| `--branch <name>` | Filter by branch | `--branch develop` |
|
|
33
|
+
| `--severity <levels>` | Filter severity | `--severity BLOCKER,CRITICAL` |
|
|
34
|
+
| `--type <types>` | Filter issue type | `--type BUG,VULNERABILITY` |
|
|
35
|
+
| `--new-code` | Only new code issues | `--new-code` |
|
|
36
|
+
|
|
37
|
+
## Instructions
|
|
38
|
+
|
|
39
|
+
<steps>
|
|
40
|
+
|
|
41
|
+
1. Parse the query from `$ARGUMENTS` to determine:
|
|
42
|
+
- Query type (issues, metrics, gate, health, pr, hotspots, history)
|
|
43
|
+
- Project key
|
|
44
|
+
- Optional filters (branch, severity, type, new-code, etc.)
|
|
45
|
+
2. Check for `SONARCLOUD_TOKEN` environment variable. If not set, inform user.
|
|
46
|
+
3. Check for `SONARCLOUD_ORG` environment variable or ask user for organization key.
|
|
47
|
+
4. Execute the appropriate API call using curl or the TypeScript client at `next-app/src/lib/integrations/sonarcloud.ts`
|
|
48
|
+
5. Format and present results clearly:
|
|
49
|
+
- For issues: Group by severity/type, show file, line, message
|
|
50
|
+
- For metrics: Show as table with metric name and value
|
|
51
|
+
- For quality gate: Show pass/fail with failed conditions
|
|
52
|
+
- For health: Comprehensive summary with all data
|
|
53
|
+
6. Offer follow-up actions:
|
|
54
|
+
- "Show issues in specific file?"
|
|
55
|
+
- "Get more details on a specific issue?"
|
|
56
|
+
- "Compare with another branch?"
|
|
57
|
+
|
|
58
|
+
</steps>
|
|
59
|
+
|
|
60
|
+
## Example Outputs
|
|
61
|
+
|
|
62
|
+
### Issues Query
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
📋 Open Issues for my-project (branch: main)
|
|
66
|
+
|
|
67
|
+
Total: 45 issues
|
|
68
|
+
|
|
69
|
+
By Severity:
|
|
70
|
+
🔴 BLOCKER: 2
|
|
71
|
+
🟠 CRITICAL: 5
|
|
72
|
+
🟡 MAJOR: 18
|
|
73
|
+
⚪ MINOR: 15
|
|
74
|
+
⚫ INFO: 5
|
|
75
|
+
|
|
76
|
+
By Type:
|
|
77
|
+
🐛 BUG: 8
|
|
78
|
+
🔓 VULNERABILITY: 3
|
|
79
|
+
💩 CODE_SMELL: 34
|
|
80
|
+
|
|
81
|
+
Top Issues:
|
|
82
|
+
1. [CRITICAL] src/auth/login.ts:42 - SQL injection vulnerability
|
|
83
|
+
2. [BLOCKER] src/api/users.ts:156 - Null pointer dereference
|
|
84
|
+
...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Metrics Query
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
📊 Metrics for my-project
|
|
91
|
+
|
|
92
|
+
| Metric | Value |
|
|
93
|
+
|--------|-------|
|
|
94
|
+
| Lines of Code | 51,234 |
|
|
95
|
+
| Coverage | 78.5% |
|
|
96
|
+
| Duplications | 3.2% |
|
|
97
|
+
| Bugs | 8 |
|
|
98
|
+
| Vulnerabilities | 3 |
|
|
99
|
+
| Code Smells | 34 |
|
|
100
|
+
| Technical Debt | 4d 2h |
|
|
101
|
+
| Maintainability | A |
|
|
102
|
+
| Reliability | B |
|
|
103
|
+
| Security | A |
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Quality Gate Query
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
🚦 Quality Gate: ❌ FAILED
|
|
110
|
+
|
|
111
|
+
Failed Conditions:
|
|
112
|
+
| Metric | Threshold | Actual |
|
|
113
|
+
|--------|-----------|--------|
|
|
114
|
+
| Coverage on New Code | ≥ 80% | 65.3% |
|
|
115
|
+
| New Bugs | = 0 | 2 |
|
|
116
|
+
|
|
117
|
+
Passed Conditions:
|
|
118
|
+
| Metric | Threshold | Actual |
|
|
119
|
+
|--------|-----------|--------|
|
|
120
|
+
| New Vulnerabilities | = 0 | 0 |
|
|
121
|
+
| Duplicated Lines | ≤ 3% | 1.2% |
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## API Reference
|
|
125
|
+
|
|
126
|
+
Base URL: `https://sonarcloud.io/api`
|
|
127
|
+
|
|
128
|
+
### Key Endpoints
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Issues
|
|
132
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
133
|
+
"https://sonarcloud.io/api/issues/search?organization=$ORG&componentKeys=$PROJECT&resolved=false"
|
|
134
|
+
|
|
135
|
+
# Metrics
|
|
136
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
137
|
+
"https://sonarcloud.io/api/measures/component?component=$PROJECT&metricKeys=bugs,vulnerabilities,coverage"
|
|
138
|
+
|
|
139
|
+
# Quality Gate
|
|
140
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
141
|
+
"https://sonarcloud.io/api/qualitygates/project_status?projectKey=$PROJECT"
|
|
142
|
+
|
|
143
|
+
# Hotspots
|
|
144
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
145
|
+
"https://sonarcloud.io/api/hotspots/search?projectKey=$PROJECT&status=TO_REVIEW"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Full Skill Reference
|
|
149
|
+
|
|
150
|
+
See `.claude/skills/sonarcloud/SKILL.md` for complete API documentation including:
|
|
151
|
+
|
|
152
|
+
- All endpoints and parameters
|
|
153
|
+
- Response structures
|
|
154
|
+
- Pagination handling
|
|
155
|
+
- Advanced filtering
|
|
156
|
+
- Integration patterns
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check current stage and context
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Check where you are in the project and what work is in progress.
|
|
6
|
+
|
|
7
|
+
# Status Check
|
|
8
|
+
|
|
9
|
+
This command helps you understand the current state of the project before starting new work.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/status
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Read Current Progress
|
|
20
|
+
```bash
|
|
21
|
+
cat docs/planning/PROGRESS.md
|
|
22
|
+
```
|
|
23
|
+
- What's completed?
|
|
24
|
+
- What's the next priority?
|
|
25
|
+
- Which week/milestone are we in?
|
|
26
|
+
|
|
27
|
+
### Step 2: Check Active Work
|
|
28
|
+
```bash
|
|
29
|
+
# Active Beads issues
|
|
30
|
+
bd list --status in_progress
|
|
31
|
+
|
|
32
|
+
# Active OpenSpec proposals
|
|
33
|
+
openspec list --active
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 3: Review Recent Work
|
|
37
|
+
```bash
|
|
38
|
+
# Recent commits
|
|
39
|
+
git log --oneline -10
|
|
40
|
+
|
|
41
|
+
# Recently completed Beads
|
|
42
|
+
bd list --status done --limit 5
|
|
43
|
+
|
|
44
|
+
# Archived OpenSpec proposals
|
|
45
|
+
openspec list --archived --limit 3
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 4: Determine Context
|
|
49
|
+
- **New feature**: No active work, ready to start fresh
|
|
50
|
+
- **Continuing work**: In-progress issues found, resume where left off
|
|
51
|
+
- **Review needed**: Work marked complete, needs review/merge
|
|
52
|
+
|
|
53
|
+
## Example Output
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
✓ Current Stage: Week 7, AI Integration 100% complete
|
|
57
|
+
✓ Next Priority: Week 8 - Billing & Testing
|
|
58
|
+
|
|
59
|
+
Active Work:
|
|
60
|
+
- No in-progress Beads issues
|
|
61
|
+
- No active OpenSpec proposals
|
|
62
|
+
|
|
63
|
+
Recent Completions:
|
|
64
|
+
- bd-a3f8: BlockSuite simplification (merged 2 days ago)
|
|
65
|
+
- bd-k2m5: Auth RLS policies (merged 5 days ago)
|
|
66
|
+
|
|
67
|
+
Context: Ready for new feature
|
|
68
|
+
|
|
69
|
+
Next: /research <feature-name>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Next Steps
|
|
73
|
+
|
|
74
|
+
- **If starting new work**: Run `/research <feature-name>`
|
|
75
|
+
- **If continuing work**: Resume with appropriate phase command
|
|
76
|
+
- **If reviewing**: Run `/review <pr-number>` or `/merge <pr-number>`
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cross-check all documentation, update if needed
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Final verification that all documentation is properly updated across the entire workflow.
|
|
6
|
+
|
|
7
|
+
# Verify
|
|
8
|
+
|
|
9
|
+
This command performs a final documentation verification after merge.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/verify
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Read Feature Details
|
|
20
|
+
```bash
|
|
21
|
+
# Get feature name, Beads ID, PR number from git log
|
|
22
|
+
git log --oneline -1
|
|
23
|
+
|
|
24
|
+
# Get research doc if exists
|
|
25
|
+
git show HEAD:docs/research/<feature-slug>.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Step 2: Cross-Check All Documentation Files
|
|
29
|
+
|
|
30
|
+
**A. docs/planning/PROGRESS.md**:
|
|
31
|
+
- ✓ Feature listed in completed section?
|
|
32
|
+
- ✓ Completion date accurate?
|
|
33
|
+
- ✓ Beads issue ID referenced?
|
|
34
|
+
- ✓ PR number linked?
|
|
35
|
+
- ✓ Research doc path included?
|
|
36
|
+
- **If missing/incomplete**: Update now
|
|
37
|
+
|
|
38
|
+
**B. docs/reference/API_REFERENCE.md** (if API changes):
|
|
39
|
+
- ✓ New endpoints documented?
|
|
40
|
+
- ✓ Request/response schemas complete?
|
|
41
|
+
- ✓ Authentication requirements listed?
|
|
42
|
+
- ✓ Example requests included?
|
|
43
|
+
- ✓ Error responses documented?
|
|
44
|
+
- **If missing/incomplete**: Update now
|
|
45
|
+
|
|
46
|
+
**C. docs/architecture/** (if strategic):
|
|
47
|
+
- ✓ Architecture diagrams updated?
|
|
48
|
+
- ✓ New patterns documented?
|
|
49
|
+
- ✓ System overview reflects changes?
|
|
50
|
+
- ✓ Decision records (ADRs) added if applicable?
|
|
51
|
+
- ✓ Component relationships accurate?
|
|
52
|
+
- **If missing/incomplete**: Update now
|
|
53
|
+
|
|
54
|
+
**D. README.md** (if user-facing):
|
|
55
|
+
- ✓ Features list updated?
|
|
56
|
+
- ✓ Configuration options documented?
|
|
57
|
+
- ✓ Installation/setup steps current?
|
|
58
|
+
- ✓ Usage examples included?
|
|
59
|
+
- ✓ Screenshots/demos updated (if visual)?
|
|
60
|
+
- **If missing/incomplete**: Update now
|
|
61
|
+
|
|
62
|
+
**E. docs/testing/** (if new patterns):
|
|
63
|
+
- ✓ New test utilities documented?
|
|
64
|
+
- ✓ Testing strategy updated?
|
|
65
|
+
- ✓ Example tests included?
|
|
66
|
+
- ✓ Coverage requirements noted?
|
|
67
|
+
- **If missing/incomplete**: Update now
|
|
68
|
+
|
|
69
|
+
**F. docs/research/<feature-slug>.md** (if exists):
|
|
70
|
+
- ✓ Research document exists?
|
|
71
|
+
- ✓ All sections complete?
|
|
72
|
+
- ✓ Key decisions documented with reasoning?
|
|
73
|
+
- ✓ TDD scenarios identified?
|
|
74
|
+
- ✓ OWASP Top 10 checklist completed?
|
|
75
|
+
- **If missing/incomplete**: Update now
|
|
76
|
+
|
|
77
|
+
### Step 3: Cross-Reference Consistency
|
|
78
|
+
|
|
79
|
+
- ✓ PROGRESS.md links to research doc?
|
|
80
|
+
- ✓ Research doc referenced in merged PR?
|
|
81
|
+
- ✓ API changes in API_REFERENCE.md match code?
|
|
82
|
+
- ✓ Architecture docs consistent with implementation?
|
|
83
|
+
- ✓ README.md examples actually work?
|
|
84
|
+
|
|
85
|
+
### Step 4: Fix Missing/Incomplete Documentation
|
|
86
|
+
|
|
87
|
+
If any documentation is missing or incomplete:
|
|
88
|
+
```bash
|
|
89
|
+
# Make updates to relevant files
|
|
90
|
+
|
|
91
|
+
# Commit documentation fixes
|
|
92
|
+
git add docs/ README.md
|
|
93
|
+
git commit -m "docs: post-merge documentation verification
|
|
94
|
+
|
|
95
|
+
Cross-checked and updated all documentation after <feature-name> merge:
|
|
96
|
+
- Updated: [list of files updated]
|
|
97
|
+
- Fixed: [what was missing/incomplete]
|
|
98
|
+
- Verified: All cross-references consistent"
|
|
99
|
+
|
|
100
|
+
git push
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 5: Final Verification Checklist
|
|
104
|
+
|
|
105
|
+
- [ ] PROGRESS.md: Feature completion documented
|
|
106
|
+
- [ ] API_REFERENCE.md: API changes documented (if applicable)
|
|
107
|
+
- [ ] Architecture docs: System changes reflected (if applicable)
|
|
108
|
+
- [ ] README.md: User-facing updates complete (if applicable)
|
|
109
|
+
- [ ] Testing docs: New patterns documented (if applicable)
|
|
110
|
+
- [ ] Research doc: Complete and linked (if exists)
|
|
111
|
+
- [ ] Cross-references: All links working and consistent
|
|
112
|
+
|
|
113
|
+
## Example Output (All Complete)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
✓ Documentation Verification Complete
|
|
117
|
+
|
|
118
|
+
Checked Files:
|
|
119
|
+
✓ docs/planning/PROGRESS.md: Complete and accurate
|
|
120
|
+
✓ docs/reference/API_REFERENCE.md: 3 endpoints fully documented
|
|
121
|
+
✓ docs/architecture/: Diagrams updated, consistent with code
|
|
122
|
+
✓ README.md: Features list and examples updated
|
|
123
|
+
✓ docs/testing/: New test patterns documented
|
|
124
|
+
✓ docs/research/stripe-billing.md: Complete with all sections
|
|
125
|
+
|
|
126
|
+
Cross-References:
|
|
127
|
+
✓ PROGRESS.md → research doc: Valid link
|
|
128
|
+
✓ PR #123 → research doc: Referenced
|
|
129
|
+
✓ API_REFERENCE.md ↔ Code: Consistent
|
|
130
|
+
✓ Architecture docs ↔ Implementation: Aligned
|
|
131
|
+
✓ README.md examples: Tested and working
|
|
132
|
+
|
|
133
|
+
No documentation issues found!
|
|
134
|
+
|
|
135
|
+
Workflow complete! 🎉
|
|
136
|
+
Ready for next task: /status
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Example Output (Issues Found & Fixed)
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
✓ Documentation Verification Complete
|
|
143
|
+
|
|
144
|
+
Found Issues:
|
|
145
|
+
✗ docs/planning/PROGRESS.md: Missing completion date
|
|
146
|
+
✗ docs/reference/API_REFERENCE.md: Error responses not documented
|
|
147
|
+
✗ README.md: Missing configuration example
|
|
148
|
+
|
|
149
|
+
Fixed All Issues:
|
|
150
|
+
✓ Updated PROGRESS.md: Added completion date (2026-01-28)
|
|
151
|
+
✓ Updated API_REFERENCE.md: Added error response schemas
|
|
152
|
+
✓ Updated README.md: Added .env configuration example
|
|
153
|
+
✓ Committed: docs: post-merge documentation verification
|
|
154
|
+
|
|
155
|
+
Final Verification:
|
|
156
|
+
✓ All documentation complete
|
|
157
|
+
✓ All cross-references valid
|
|
158
|
+
✓ All examples tested
|
|
159
|
+
|
|
160
|
+
Workflow complete! 🎉
|
|
161
|
+
Ready for next task: /status
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Integration with Workflow
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
1. /status → Understand current context
|
|
168
|
+
2. /research <name> → Research and document
|
|
169
|
+
3. /plan <feature-slug> → Create plan and tracking
|
|
170
|
+
4. /dev → Implement with TDD
|
|
171
|
+
5. /check → Validate
|
|
172
|
+
6. /ship → Create PR
|
|
173
|
+
7. /review → Address comments
|
|
174
|
+
8. /merge → Merge and cleanup
|
|
175
|
+
9. /verify → Final documentation check (you are here) ✓
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Tips
|
|
179
|
+
|
|
180
|
+
- **Run after every merge**: Catch documentation gaps immediately
|
|
181
|
+
- **Fix immediately**: Don't accumulate documentation debt
|
|
182
|
+
- **Cross-check everything**: Verify consistency across all docs
|
|
183
|
+
- **Test examples**: Ensure README examples actually work
|
|
184
|
+
- **Complete checklist**: All items must be verified
|
|
185
|
+
- **Ready for next feature**: After /verify, run /status for next task
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Forge Workflow Rules
|
|
2
|
+
|
|
3
|
+
9-stage TDD-first development workflow for any project.
|
|
4
|
+
|
|
5
|
+
## Workflow Commands
|
|
6
|
+
|
|
7
|
+
| Phase | Command | Purpose |
|
|
8
|
+
|-------|---------|---------|
|
|
9
|
+
| 1 | `/status` | Check current stage, active work, recent completions |
|
|
10
|
+
| 2 | `/research` | Deep research with parallel-ai, save to docs/research/ |
|
|
11
|
+
| 3 | `/plan` | Create formal plan, branch, OpenSpec proposal (if strategic) |
|
|
12
|
+
| 4 | `/dev` | Implement with TDD, parallel if needed |
|
|
13
|
+
| 5 | `/check` | Type check, lint, code review, security, tests |
|
|
14
|
+
| 6 | `/ship` | Push and create PR with full documentation |
|
|
15
|
+
| 7 | `/review` | Handle ALL PR issues (GitHub Actions, reviewers, CI/CD) |
|
|
16
|
+
| 8 | `/merge` | Update docs, merge PR, archive, cleanup |
|
|
17
|
+
| 9 | `/verify` | Final documentation verification, update if needed |
|
|
18
|
+
|
|
19
|
+
## Core Principles
|
|
20
|
+
|
|
21
|
+
### TDD-First Development
|
|
22
|
+
- Tests written UPFRONT in RED-GREEN-REFACTOR cycles
|
|
23
|
+
- No implementation without failing test first
|
|
24
|
+
- Commit after each GREEN cycle
|
|
25
|
+
|
|
26
|
+
### Research-First Approach
|
|
27
|
+
- All features start with comprehensive research
|
|
28
|
+
- Use parallel-ai for web research (MANDATORY)
|
|
29
|
+
- Document findings in `docs/research/<feature-slug>.md`
|
|
30
|
+
|
|
31
|
+
### Security Built-In
|
|
32
|
+
- OWASP Top 10 analysis for every feature
|
|
33
|
+
- Security test scenarios identified upfront
|
|
34
|
+
- Automated scans + manual review
|
|
35
|
+
|
|
36
|
+
### Documentation Progressive
|
|
37
|
+
- Updated at relevant stages
|
|
38
|
+
- Cross-checked at end with `/verify`
|
|
39
|
+
- Never accumulate documentation debt
|
|
40
|
+
|
|
41
|
+
## Issue Tracking
|
|
42
|
+
|
|
43
|
+
Use Beads for persistent tracking across sessions:
|
|
44
|
+
```bash
|
|
45
|
+
bd create "Feature name" # Create issue
|
|
46
|
+
bd update <id> --status in_progress # Claim work
|
|
47
|
+
bd update <id> --comment "Progress" # Add notes
|
|
48
|
+
bd close <id> # Complete
|
|
49
|
+
bd sync # Sync with git
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Git Workflow
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Branch naming
|
|
56
|
+
feat/<feature-slug>
|
|
57
|
+
fix/<bug-slug>
|
|
58
|
+
docs/<doc-slug>
|
|
59
|
+
|
|
60
|
+
# Commit pattern
|
|
61
|
+
git commit -m "test: add validation tests" # RED
|
|
62
|
+
git commit -m "feat: implement validation" # GREEN
|
|
63
|
+
git commit -m "refactor: extract helpers" # REFACTOR
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
Customize these commands for your stack:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# In your project's CLAUDE.md or .claude/rules/
|
|
72
|
+
TYPE_CHECK_COMMAND="npm run typecheck" # or: bun run typecheck, tsc, etc.
|
|
73
|
+
LINT_COMMAND="npm run lint" # or: bun run lint, eslint, etc.
|
|
74
|
+
TEST_COMMAND="npm run test" # or: bun run test:e2e, jest, etc.
|
|
75
|
+
SECURITY_SCAN="npm audit" # or: bun audit, snyk test, etc.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Skills Integration
|
|
79
|
+
|
|
80
|
+
### parallel-ai (MANDATORY for web research)
|
|
81
|
+
```bash
|
|
82
|
+
# Use Skill tool for web research
|
|
83
|
+
Skill("parallel-ai")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### sonarcloud (Code quality)
|
|
87
|
+
```bash
|
|
88
|
+
/sonarcloud # Query PR-specific issues
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Flow Visualization
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
/status → /research → /plan → /dev → /check → /ship → /review → /merge → /verify
|
|
95
|
+
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
96
|
+
Check Research OpenSpec TDD Validate PR Address Merge Verify
|
|
97
|
+
context + docs + Beads cycles + scan create feedback + docs docs
|
|
98
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Load environment variables from .env.local files
|
|
3
|
+
# Works on Windows Git Bash and Unix systems
|
|
4
|
+
|
|
5
|
+
# Function to load env file
|
|
6
|
+
load_env_file() {
|
|
7
|
+
local env_file="$1"
|
|
8
|
+
if [ -f "$env_file" ]; then
|
|
9
|
+
# Export each line that matches KEY=VALUE pattern (skip comments and empty lines)
|
|
10
|
+
while IFS='=' read -r key value; do
|
|
11
|
+
# Skip comments and empty lines
|
|
12
|
+
[[ "$key" =~ ^#.*$ ]] && continue
|
|
13
|
+
[[ -z "$key" ]] && continue
|
|
14
|
+
# Remove quotes from value
|
|
15
|
+
value="${value%\"}"
|
|
16
|
+
value="${value#\"}"
|
|
17
|
+
value="${value%\'}"
|
|
18
|
+
value="${value#\'}"
|
|
19
|
+
# Export the variable
|
|
20
|
+
export "$key=$value"
|
|
21
|
+
done < "$env_file"
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Load from project root .env.local
|
|
26
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
27
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
28
|
+
|
|
29
|
+
load_env_file "$PROJECT_ROOT/.env.local"
|
|
30
|
+
load_env_file "$PROJECT_ROOT/next-app/.env.local"
|
|
31
|
+
|
|
32
|
+
echo "Environment loaded. PARALLEL_API_KEY length: ${#PARALLEL_API_KEY}"
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Parallel AI Tool Skill - Setup Instructions
|
|
2
|
+
|
|
3
|
+
## What You Have
|
|
4
|
+
|
|
5
|
+
A complete Claude Skill for using Parallel AI as a research tool with:
|
|
6
|
+
- Web search
|
|
7
|
+
- URL data extraction
|
|
8
|
+
- Structured data enrichment
|
|
9
|
+
- Market analysis and reports
|
|
10
|
+
|
|
11
|
+
## Folder Structure
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
parallel-ai-sdk/
|
|
15
|
+
├── SKILL.md ← Main skill file
|
|
16
|
+
└── references/
|
|
17
|
+
├── api-reference.md ← Complete API docs
|
|
18
|
+
├── quick-reference.md ← Cheat sheet & troubleshooting
|
|
19
|
+
└── research-workflows.md ← 3 key use case examples
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## How to Use
|
|
23
|
+
|
|
24
|
+
### Option 1: Claude.ai Skills Directory (Recommended)
|
|
25
|
+
|
|
26
|
+
1. Locate your Claude Skills folder:
|
|
27
|
+
- **Mac**: `~/.claude/skills/`
|
|
28
|
+
- **Windows**: `%APPDATA%\Claude\skills\`
|
|
29
|
+
- **Linux**: `~/.config/claude/skills/`
|
|
30
|
+
|
|
31
|
+
2. Copy the entire `parallel-ai-sdk` folder there
|
|
32
|
+
|
|
33
|
+
3. Restart Claude
|
|
34
|
+
|
|
35
|
+
4. Ask Claude: "Research OpenAI for me" or "Search for AI news"
|
|
36
|
+
|
|
37
|
+
### Option 2: Reference in Chat
|
|
38
|
+
|
|
39
|
+
If you don't have a skills directory:
|
|
40
|
+
|
|
41
|
+
1. Keep this folder anywhere in your project
|
|
42
|
+
2. When chatting with Claude, say: "I have a Parallel AI skill in /path/to/parallel-ai-sdk"
|
|
43
|
+
3. Claude will reference it automatically
|
|
44
|
+
|
|
45
|
+
## Getting Started
|
|
46
|
+
|
|
47
|
+
### Step 1: Get API Key
|
|
48
|
+
1. Visit https://platform.parallel.ai
|
|
49
|
+
2. Sign up and generate an API key
|
|
50
|
+
3. Save it securely
|
|
51
|
+
|
|
52
|
+
### Step 2: Set Environment Variable
|
|
53
|
+
```bash
|
|
54
|
+
export PARALLEL_API_KEY="your-api-key-here"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 3: Ask Claude
|
|
58
|
+
|
|
59
|
+
Try these prompts:
|
|
60
|
+
- "Research OpenAI"
|
|
61
|
+
- "Find the latest AI news"
|
|
62
|
+
- "What's the current Bitcoin price?"
|
|
63
|
+
- "Analyze the SaaS market"
|
|
64
|
+
|
|
65
|
+
## File Descriptions
|
|
66
|
+
|
|
67
|
+
| File | Purpose | Size |
|
|
68
|
+
|------|---------|------|
|
|
69
|
+
| SKILL.md | Main skill - Claude loads first | 2.4 KB |
|
|
70
|
+
| api-reference.md | API endpoints & parameters | 2.3 KB |
|
|
71
|
+
| quick-reference.md | Quick lookup & troubleshooting | 2.2 KB |
|
|
72
|
+
| research-workflows.md | 3 example use cases | 1.6 KB |
|
|
73
|
+
|
|
74
|
+
**Total: 8.5 KB** (very lightweight, won't bloat context)
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
✅ **Search API** - Web search with source filtering
|
|
79
|
+
✅ **Extract API** - Scrape data from URLs
|
|
80
|
+
✅ **Task API** - Structured data enrichment (company research, etc)
|
|
81
|
+
✅ **Deep Research API** - Multi-source analysis & reports
|
|
82
|
+
|
|
83
|
+
✅ **5 Processors** - From lite (fast, cheap) to ultra (slow, powerful)
|
|
84
|
+
|
|
85
|
+
✅ **Rate Limits** - 2,000 requests/minute
|
|
86
|
+
|
|
87
|
+
✅ **Error Handling** - Built-in troubleshooting guide
|
|
88
|
+
|
|
89
|
+
## Quick Example
|
|
90
|
+
|
|
91
|
+
When you ask Claude: "Research Anthropic"
|
|
92
|
+
|
|
93
|
+
Claude will:
|
|
94
|
+
1. Use the Task API with the `core` processor
|
|
95
|
+
2. Submit your query to Parallel AI
|
|
96
|
+
3. Poll for results (typically 1-5 minutes)
|
|
97
|
+
4. Return structured data: founding year, employees, products, etc.
|
|
98
|
+
|
|
99
|
+
Cost: ~$0.025
|
|
100
|
+
Time: 1-5 minutes
|
|
101
|
+
|
|
102
|
+
## Links
|
|
103
|
+
|
|
104
|
+
- **Parallel AI Docs**: https://docs.parallel.ai
|
|
105
|
+
- **Get API Key**: https://platform.parallel.ai
|
|
106
|
+
- **Status**: https://status.parallel.ai
|
|
107
|
+
|
|
108
|
+
## Troubleshooting
|
|
109
|
+
|
|
110
|
+
**"API key not found"**
|
|
111
|
+
- Make sure `PARALLEL_API_KEY` environment variable is set
|
|
112
|
+
- `echo $PARALLEL_API_KEY` to verify
|
|
113
|
+
|
|
114
|
+
**"Rate limited (429)"**
|
|
115
|
+
- You hit 2,000 requests/minute limit
|
|
116
|
+
- Wait 60 seconds before retrying
|
|
117
|
+
|
|
118
|
+
**"Empty results"**
|
|
119
|
+
- Try broader search terms
|
|
120
|
+
- Remove domain filters (source_policy)
|
|
121
|
+
|
|
122
|
+
**"Task stuck in running"**
|
|
123
|
+
- Normal for complex queries (can take up to 25 minutes)
|
|
124
|
+
- Keep polling, don't give up
|
|
125
|
+
|
|
126
|
+
## Support
|
|
127
|
+
|
|
128
|
+
For issues, check:
|
|
129
|
+
1. `quick-reference.md` - Troubleshooting section
|
|
130
|
+
2. `api-reference.md` - API details
|
|
131
|
+
3. https://docs.parallel.ai - Official documentation
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
**Ready to go!** Just copy this folder and start using it with Claude. 🚀
|