forge-workflow 0.0.2 → 0.0.4
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/dev.md +26 -0
- package/.claude/commands/plan.md +141 -9
- package/.claude/commands/premerge.md +0 -3
- package/.claude/commands/rollback.md +4 -4
- package/.claude/commands/ship.md +71 -41
- package/.claude/commands/status.md +9 -38
- package/.claude/commands/validate.md +47 -2
- package/.cline/workflows/dev.md +337 -0
- package/.cline/workflows/plan.md +518 -0
- package/.cline/workflows/premerge.md +173 -0
- package/.cline/workflows/research.md +39 -0
- package/.cline/workflows/review.md +439 -0
- package/.cline/workflows/rollback.md +718 -0
- package/.cline/workflows/ship.md +161 -0
- package/.cline/workflows/sonarcloud.md +146 -0
- package/.cline/workflows/status.md +45 -0
- package/.cline/workflows/validate.md +279 -0
- package/.cline/workflows/verify.md +218 -0
- package/.codex/config.toml +11 -0
- package/.codex/skills/dev/SKILL.md +340 -0
- package/.codex/skills/plan/SKILL.md +521 -0
- package/.codex/skills/premerge/SKILL.md +176 -0
- package/.codex/skills/research/SKILL.md +42 -0
- package/.codex/skills/review/SKILL.md +442 -0
- package/.codex/skills/rollback/SKILL.md +721 -0
- package/.codex/skills/ship/SKILL.md +164 -0
- package/.codex/skills/sonarcloud/SKILL.md +149 -0
- package/.codex/skills/status/SKILL.md +48 -0
- package/.codex/skills/validate/SKILL.md +282 -0
- package/.codex/skills/verify/SKILL.md +221 -0
- package/.cursor/commands/dev.md +337 -0
- package/.cursor/commands/plan.md +518 -0
- package/.cursor/commands/premerge.md +173 -0
- package/.cursor/commands/research.md +39 -0
- package/.cursor/commands/review.md +439 -0
- package/.cursor/commands/rollback.md +718 -0
- package/.cursor/commands/ship.md +161 -0
- package/.cursor/commands/sonarcloud.md +146 -0
- package/.cursor/commands/status.md +45 -0
- package/.cursor/commands/validate.md +279 -0
- package/.cursor/commands/verify.md +218 -0
- package/.cursor/hooks/state/continual-learning-index.json +19 -0
- package/.cursor/hooks/state/continual-learning.json +8 -0
- package/.cursor/rules/permissions-guidance.mdc +37 -0
- package/.github/prompts/dev.prompt.md +342 -0
- package/.github/prompts/plan.prompt.md +523 -0
- package/.github/prompts/premerge.prompt.md +178 -0
- package/.github/prompts/research.prompt.md +44 -0
- package/.github/prompts/review.prompt.md +444 -0
- package/.github/prompts/rollback.prompt.md +723 -0
- package/.github/prompts/ship.prompt.md +166 -0
- package/.github/prompts/sonarcloud.prompt.md +151 -0
- package/.github/prompts/status.prompt.md +50 -0
- package/.github/prompts/validate.prompt.md +284 -0
- package/.github/prompts/verify.prompt.md +223 -0
- package/.kilocode/workflows/dev.md +341 -0
- package/.kilocode/workflows/plan.md +522 -0
- package/.kilocode/workflows/premerge.md +177 -0
- package/.kilocode/workflows/research.md +43 -0
- package/.kilocode/workflows/review.md +443 -0
- package/.kilocode/workflows/rollback.md +722 -0
- package/.kilocode/workflows/ship.md +165 -0
- package/.kilocode/workflows/sonarcloud.md +150 -0
- package/.kilocode/workflows/status.md +49 -0
- package/.kilocode/workflows/validate.md +283 -0
- package/.kilocode/workflows/verify.md +222 -0
- package/.opencode/commands/dev.md +340 -0
- package/.opencode/commands/plan.md +521 -0
- package/.opencode/commands/premerge.md +176 -0
- package/.opencode/commands/research.md +42 -0
- package/.opencode/commands/review.md +442 -0
- package/.opencode/commands/rollback.md +721 -0
- package/.opencode/commands/ship.md +164 -0
- package/.opencode/commands/sonarcloud.md +149 -0
- package/.opencode/commands/status.md +48 -0
- package/.opencode/commands/validate.md +282 -0
- package/.opencode/commands/verify.md +221 -0
- package/.roo/commands/dev.md +341 -0
- package/.roo/commands/plan.md +522 -0
- package/.roo/commands/premerge.md +177 -0
- package/.roo/commands/research.md +43 -0
- package/.roo/commands/review.md +443 -0
- package/.roo/commands/rollback.md +722 -0
- package/.roo/commands/ship.md +165 -0
- package/.roo/commands/sonarcloud.md +150 -0
- package/.roo/commands/status.md +49 -0
- package/.roo/commands/validate.md +283 -0
- package/.roo/commands/verify.md +222 -0
- package/AGENTS.md +7 -1
- package/CLAUDE.md +5 -4
- package/README.md +21 -19
- package/bin/{forge-validate.js → forge-preflight.js} +21 -15
- package/bin/forge.js +209 -138
- package/docs/AGENT_INSTALL_PROMPT.md +1 -1
- package/docs/BEADS_GITHUB_SYNC.md +251 -0
- package/docs/ENHANCED_ONBOARDING.md +8 -8
- package/docs/EXAMPLES.md +4 -4
- package/docs/GREPTILE_SETUP.md +1 -1
- package/docs/MANUAL_REVIEW_GUIDE.md +1 -1
- package/docs/ROADMAP.md +6 -6
- package/docs/SETUP.md +1 -2
- package/docs/TOOLCHAIN.md +15 -234
- package/docs/VALIDATION.md +11 -11
- package/install.sh +33 -39
- package/lib/agents-config.js +3 -3
- package/lib/commands/plan.js +11 -15
- package/lib/commands/recommend.js +2 -2
- package/lib/dep-guard/analyzer.js +294 -0
- package/lib/dep-guard/behavior-detector.js +98 -0
- package/lib/dep-guard/contract-detector.js +162 -0
- package/lib/dep-guard/import-detector.js +498 -0
- package/lib/dep-guard/path-utils.js +13 -0
- package/lib/dep-guard/rubric.js +120 -0
- package/lib/dep-guard/task-parser.js +318 -0
- package/lib/detect-agent.js +191 -0
- package/lib/detect-worktree.js +47 -0
- package/lib/file-hash.js +26 -0
- package/lib/plugin-catalog.js +18 -28
- package/lib/setup-action-log.js +139 -0
- package/lib/setup-summary-renderer.js +106 -0
- package/lib/setup.js +75 -1
- package/lib/workflow-profiles.js +5 -11
- package/package.json +17 -7
- package/skills/parallel-deep-research/SKILL.md +108 -0
- package/skills/parallel-deep-research/evals/README.md +27 -0
- package/skills/parallel-deep-research/evals/evals.json +62 -0
- package/skills/sonarcloud-analysis/SKILL.md +171 -0
- package/skills/sonarcloud-analysis/evals/README.md +27 -0
- package/skills/sonarcloud-analysis/evals/evals.json +50 -0
- package/skills/sonarcloud-analysis/references/api-reference.md +466 -0
- package/docs/WORKFLOW.md +0 -400
- package/docs/planning/PROGRESS.md +0 -396
- package/docs/plans/.gitkeep +0 -0
- package/docs/plans/2026-02-27-forge-test-suite-v2-decisions.md +0 -21
- package/docs/plans/2026-02-27-forge-test-suite-v2-design.md +0 -362
- package/docs/plans/2026-02-27-forge-test-suite-v2-tasks.md +0 -343
- package/docs/plans/2026-03-02-superpowers-gaps-decisions.md +0 -26
- package/docs/plans/2026-03-02-superpowers-gaps-design.md +0 -239
- package/docs/plans/2026-03-02-superpowers-gaps-tasks.md +0 -260
- package/docs/plans/2026-03-04-agent-command-parity-design.md +0 -163
- package/docs/plans/2026-03-04-verify-worktree-cleanup-decisions.md +0 -7
- package/docs/plans/2026-03-04-verify-worktree-cleanup-design.md +0 -165
- package/docs/plans/2026-03-05-forge-uto-decisions.md +0 -6
- package/docs/plans/2026-03-05-forge-uto-design.md +0 -116
- package/docs/plans/2026-03-05-forge-uto-tasks.md +0 -244
- package/docs/plans/2026-03-10-command-creator-and-eval-decisions.md +0 -52
- package/docs/plans/2026-03-10-command-creator-and-eval-design.md +0 -350
- package/docs/plans/2026-03-10-command-creator-and-eval-tasks.md +0 -426
- package/docs/plans/2026-03-10-stale-workflow-refs-decisions.md +0 -8
- package/docs/plans/2026-03-10-stale-workflow-refs-design.md +0 -80
- package/docs/plans/2026-03-10-stale-workflow-refs-tasks.md +0 -90
- package/docs/plans/2026-03-14-beads-plan-context-decisions.md +0 -9
- package/docs/plans/2026-03-14-beads-plan-context-design.md +0 -171
- package/docs/plans/2026-03-14-beads-plan-context-tasks.md +0 -160
- package/docs/plans/2026-03-14-skill-eval-loop-decisions.md +0 -33
- package/docs/plans/2026-03-14-skill-eval-loop-design.md +0 -118
- package/docs/plans/2026-03-14-skill-eval-loop-results.md +0 -78
- package/docs/plans/2026-03-14-skill-eval-loop-tasks.md +0 -160
- package/docs/plans/2026-03-15-agent-command-parity-v2-decisions.md +0 -11
- package/docs/plans/2026-03-15-agent-command-parity-v2-design.md +0 -145
- package/docs/plans/2026-03-15-agent-command-parity-v2-tasks.md +0 -211
- package/docs/research/TEMPLATE.md +0 -292
- package/docs/research/advanced-testing.md +0 -297
- package/docs/research/agent-permissions.md +0 -167
- package/docs/research/dependency-chain.md +0 -328
- package/docs/research/forge-workflow-v2.md +0 -550
- package/docs/research/plugin-architecture.md +0 -772
- package/docs/research/pr4-cli-automation.md +0 -326
- package/docs/research/premerge-verify-restructure.md +0 -205
- package/docs/research/skills-restructure.md +0 -508
- package/docs/research/sonarcloud-perfection-plan.md +0 -166
- package/docs/research/sonarcloud-quality-gate.md +0 -184
- package/docs/research/superpowers-integration.md +0 -403
- package/docs/research/superpowers.md +0 -319
- package/docs/research/test-environment.md +0 -519
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-deep-research
|
|
3
|
+
description: >
|
|
4
|
+
Produces comprehensive research reports that go far beyond what built-in web
|
|
5
|
+
search can achieve. Sends research tasks to Parallel AI's pro/ultra processors
|
|
6
|
+
which spend 3-25 minutes autonomously crawling, reading, and synthesizing dozens
|
|
7
|
+
of sources — returning structured reports with citations. Built-in WebSearch
|
|
8
|
+
can only run a few queries; this skill runs an entire research pipeline externally.
|
|
9
|
+
No binary install — requires PARALLEL_API_KEY in .env.local. ALWAYS use this
|
|
10
|
+
skill instead of doing multiple WebSearch calls when the user needs a comprehensive
|
|
11
|
+
report, market analysis, competitive landscape, industry deep-dive, strategic
|
|
12
|
+
recommendations, or multi-source synthesis. This is the RIGHT tool for any
|
|
13
|
+
research task that would require more than 3-4 web searches to answer properly.
|
|
14
|
+
Also trigger during /plan Phase 2 research and /research workflows.
|
|
15
|
+
compatibility: Requires PARALLEL_API_KEY in .env.local. Uses curl. Takes 3-25 minutes.
|
|
16
|
+
metadata:
|
|
17
|
+
author: harshanandak
|
|
18
|
+
version: "1.0.0"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Parallel Deep Research
|
|
22
|
+
|
|
23
|
+
Comprehensive research reports with multi-source synthesis. Use `pro` (3-9 min, $0.10) or `ultra` (5-25 min, $0.30) for deep analysis.
|
|
24
|
+
|
|
25
|
+
> **CLI alternative (recommended)**: Install `parallel-cli` for official skill:
|
|
26
|
+
> `npx skills add parallel-web/parallel-agent-skills --skill parallel-deep-research`
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
API_KEY=$(grep "^PARALLEL_API_KEY=" .env.local | cut -d= -f2)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Create Research Task
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
curl -s -X POST "https://api.parallel.ai/v1/tasks/runs" \
|
|
38
|
+
-H "x-api-key: $API_KEY" \
|
|
39
|
+
-H "Content-Type: application/json" \
|
|
40
|
+
-d '{
|
|
41
|
+
"input": "Analyze the AI chatbot market. Include: size, growth, key players, trends, competitive threats",
|
|
42
|
+
"processor": "pro"
|
|
43
|
+
}'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Response: `{"run_id": "trun_abc123...", "status": "queued"}`
|
|
47
|
+
|
|
48
|
+
## Get Result (polling)
|
|
49
|
+
|
|
50
|
+
The result endpoint returns both status and output in one call. Poll until `status` is `completed`.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
RUN_ID="trun_abc123..."
|
|
54
|
+
MAX_POLLS=180 # 30 min max (180 × 10s)
|
|
55
|
+
|
|
56
|
+
for i in $(seq 1 $MAX_POLLS); do
|
|
57
|
+
RESULT=$(curl -s "https://api.parallel.ai/v1/tasks/runs/$RUN_ID/result" \
|
|
58
|
+
-H "x-api-key: $API_KEY")
|
|
59
|
+
|
|
60
|
+
STATUS=$(echo "$RESULT" | grep -o '"status":"[^"]*"' | head -1 | cut -d'"' -f4)
|
|
61
|
+
|
|
62
|
+
if [ "$STATUS" = "completed" ]; then
|
|
63
|
+
echo "$RESULT"
|
|
64
|
+
break
|
|
65
|
+
elif [ "$STATUS" = "failed" ]; then
|
|
66
|
+
echo "Task failed: $RESULT"
|
|
67
|
+
break
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "Poll $i/$MAX_POLLS — Status: $STATUS"
|
|
71
|
+
sleep 10
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
if [ "$i" = "$MAX_POLLS" ] && [ "$STATUS" != "completed" ] && [ "$STATUS" != "failed" ]; then
|
|
75
|
+
echo "Timeout: task did not complete within 30 minutes"
|
|
76
|
+
fi
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Processors
|
|
80
|
+
|
|
81
|
+
| Processor | Speed | Cost | Use For |
|
|
82
|
+
|-----------|-------|------|---------|
|
|
83
|
+
| pro | 3-9 min | $0.10/task | Market analysis, strategic reports |
|
|
84
|
+
| ultra | 5-25 min | $0.30/task | Comprehensive deep research |
|
|
85
|
+
|
|
86
|
+
## Example: Market Analysis
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"input": "Analyze the AI chip market in 2024. Include market size, growth rate, key players (NVIDIA, AMD, Intel), emerging competitors, and 2025 outlook.",
|
|
91
|
+
"processor": "pro"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Result: Markdown report with citations.
|
|
96
|
+
|
|
97
|
+
## When to Use
|
|
98
|
+
|
|
99
|
+
- Market research and competitive analysis
|
|
100
|
+
- Strategic reports requiring multiple sources
|
|
101
|
+
- Research that needs synthesis across many documents
|
|
102
|
+
- Any task that would need more than 3-4 web searches to answer properly
|
|
103
|
+
|
|
104
|
+
For quick facts or single-source lookups, use built-in WebSearch instead.
|
|
105
|
+
|
|
106
|
+
## Timeout
|
|
107
|
+
|
|
108
|
+
Set polling timeout to 1800s (30 min) for ultra tasks. Pro tasks typically complete in 3-9 min.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Eval Sets
|
|
2
|
+
|
|
3
|
+
These eval files use a flat JSON array format targeting `scripts/eval_win.py`:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
[{"query": "...", "should_trigger": true}]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This is **not** compatible with the skill-creator plugin's `run_loop.py` which expects:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{"skill_name": "...", "evals": [{"id": "...", "prompt": "...", "should_trigger": true}]}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To convert for `run_loop.py`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python3 -c "
|
|
19
|
+
import json, pathlib, uuid
|
|
20
|
+
data = json.loads(pathlib.Path('evals.json').read_text())
|
|
21
|
+
out = {'skill_name': 'SKILL-NAME-HERE', 'evals': [
|
|
22
|
+
{'id': str(uuid.uuid4()), 'prompt': item['query'], 'should_trigger': item['should_trigger']}
|
|
23
|
+
for item in data
|
|
24
|
+
]}
|
|
25
|
+
print(json.dumps(out, indent=2))
|
|
26
|
+
" > evals_skill_creator.json
|
|
27
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "I need a comprehensive market analysis of the developer tools space — cover the top 20 players, their funding, market positioning, and where the industry is heading over the next 3-5 years. Include data from Gartner, Forrester, and any recent VC investment reports",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "Write a deep research report on the state of WebAssembly adoption in production — synthesize case studies from companies using WASM, performance benchmarks vs native code, ecosystem maturity analysis, and strategic recommendations for when to adopt it",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "Our CTO wants a competitive landscape analysis comparing Convex, Supabase, Firebase, and PlanetScale for our backend rewrite. Need comprehensive feature comparison, pricing analysis at our scale (50K DAU), community health metrics, and risk assessment for each",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "Create a strategic report on the AI code generation market — analyze GitHub Copilot, Cursor, Claude Code, and emerging competitors. Cover adoption rates, developer satisfaction surveys, enterprise pricing trends, and predictions for 2027",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "I'm doing /plan Phase 2 research — produce a comprehensive analysis of event-driven architecture patterns in microservices, covering Kafka vs RabbitMQ vs NATS, with production case studies, failure mode analysis, and recommendations for our 100K events/sec throughput requirement",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Write an industry deep-dive into the observability market — compare Datadog, Grafana Cloud, and New Relic across features, pricing, scalability, and OpenTelemetry support. Include customer migration stories and TCO analysis for a 500-node cluster",
|
|
24
|
+
"should_trigger": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "Research and synthesize the current state of edge computing for real-time AI inference — cover hardware options, cloud provider edge offerings, latency benchmarks, and case studies from autonomous vehicles and IoT deployments",
|
|
28
|
+
"should_trigger": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "Quick search: what's the current price of Bitcoin and what were Anthropic's latest announcements?",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "Find the official migration guide URL for ESLint's new flat config format",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "Search for recent blog posts about Bun 2.0 features and release date",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"query": "Go to https://stripe.com/docs/api and extract the authentication section with all the code examples",
|
|
44
|
+
"should_trigger": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"query": "Scrape https://openai.com/pricing and extract the per-token costs for each model tier",
|
|
48
|
+
"should_trigger": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"query": "Build a structured company profile for Databricks — return JSON with founding year, funding rounds, valuation, employee count, and tech stack",
|
|
52
|
+
"should_trigger": false
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"query": "Fix the TypeScript compilation error in src/services/auth.ts — it's complaining about missing type for the session token",
|
|
56
|
+
"should_trigger": false
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"query": "Add unit tests for the rate limiter middleware in src/middleware/rateLimit.ts",
|
|
60
|
+
"should_trigger": false
|
|
61
|
+
}
|
|
62
|
+
]
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sonarcloud-analysis
|
|
3
|
+
description: >
|
|
4
|
+
Pull issues, metrics, quality gates, and analysis data from SonarCloud. ALWAYS
|
|
5
|
+
use this skill when the user mentions SonarCloud, asks about code quality metrics,
|
|
6
|
+
wants to check PR quality gates, or needs to review security vulnerabilities and
|
|
7
|
+
technical debt from static analysis. Also trigger during /review workflow when
|
|
8
|
+
SonarCloud issues need addressing. Trigger on phrases like "SonarCloud",
|
|
9
|
+
"quality gate", "code quality metrics", "technical debt", "coverage report",
|
|
10
|
+
"static analysis issues", "security vulnerabilities from scan".
|
|
11
|
+
category: Code Quality
|
|
12
|
+
tags: [sonarcloud, code-quality, issues, metrics, security]
|
|
13
|
+
context: fork
|
|
14
|
+
tools: [Bash, WebFetch, Read, Grep, Glob]
|
|
15
|
+
model: sonnet
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<role>
|
|
19
|
+
You are a SonarCloud code quality analyst with expertise in static analysis, security vulnerability assessment, and technical debt management. You operate with your own isolated context to perform comprehensive code quality analysis without polluting the main conversation.
|
|
20
|
+
</role>
|
|
21
|
+
|
|
22
|
+
<capabilities>
|
|
23
|
+
- Query SonarCloud API for issues, metrics, and quality gates
|
|
24
|
+
- Analyze code quality across branches and pull requests
|
|
25
|
+
- Identify security vulnerabilities and hotspots
|
|
26
|
+
- Track coverage, duplication, and technical debt
|
|
27
|
+
- Generate health reports and trend analysis
|
|
28
|
+
- Correlate SonarCloud findings with local codebase
|
|
29
|
+
</capabilities>
|
|
30
|
+
|
|
31
|
+
<constraints>
|
|
32
|
+
- Always use environment variables: $SONARCLOUD_TOKEN, $SONARCLOUD_ORG, $SONARCLOUD_PROJECT
|
|
33
|
+
- Load credentials from .env.local if environment variables are not set
|
|
34
|
+
- Never expose tokens in output
|
|
35
|
+
- Validate API responses before processing
|
|
36
|
+
- Handle pagination for large result sets
|
|
37
|
+
</constraints>
|
|
38
|
+
|
|
39
|
+
<workflow>
|
|
40
|
+
1. Load environment variables (check .env.local if needed: `source .env.local 2>/dev/null || true`)
|
|
41
|
+
2. Verify credentials are available
|
|
42
|
+
3. Determine the analysis scope (project, branch, PR)
|
|
43
|
+
4. Query relevant endpoints
|
|
44
|
+
5. Process and correlate results
|
|
45
|
+
6. Return actionable summary to main context
|
|
46
|
+
</workflow>
|
|
47
|
+
|
|
48
|
+
# SonarCloud Integration
|
|
49
|
+
|
|
50
|
+
**Base**: `https://sonarcloud.io/api` | **Auth**: `Bearer $SONARCLOUD_TOKEN`
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
**Environment Variables**: Required for authentication
|
|
55
|
+
- `SONARCLOUD_TOKEN` - Generate at sonarcloud.io/account/security
|
|
56
|
+
- `SONARCLOUD_ORG` - Your SonarCloud organization key
|
|
57
|
+
- `SONARCLOUD_PROJECT` - Your project key
|
|
58
|
+
|
|
59
|
+
**Option 1: Use .env.local** (Recommended)
|
|
60
|
+
Add to your project's `.env.local`:
|
|
61
|
+
```bash
|
|
62
|
+
SONARCLOUD_TOKEN=your_token_here
|
|
63
|
+
SONARCLOUD_ORG=your-org
|
|
64
|
+
SONARCLOUD_PROJECT=your-project
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Before querying, load environment variables:
|
|
68
|
+
```bash
|
|
69
|
+
# Load .env.local into current environment
|
|
70
|
+
export $(grep -v '^#' .env.local | xargs)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Option 2: Export directly**
|
|
74
|
+
```bash
|
|
75
|
+
export SONARCLOUD_TOKEN="your_token"
|
|
76
|
+
export SONARCLOUD_ORG="your-org"
|
|
77
|
+
export SONARCLOUD_PROJECT="your-project"
|
|
78
|
+
|
|
79
|
+
# Common queries
|
|
80
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
81
|
+
"https://sonarcloud.io/api/issues/search?organization=$ORG&componentKeys=$PROJECT&resolved=false"
|
|
82
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
83
|
+
"https://sonarcloud.io/api/measures/component?component=$PROJECT&metricKeys=bugs,coverage"
|
|
84
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
85
|
+
"https://sonarcloud.io/api/qualitygates/project_status?projectKey=$PROJECT"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Endpoints
|
|
89
|
+
|
|
90
|
+
| Endpoint | Purpose | Key Params |
|
|
91
|
+
| ------------------------------- | ------------------------ | ---------------------------------------- |
|
|
92
|
+
| `/api/issues/search` | Bugs, vulnerabilities | `types`, `severities`, `branch`, `pullRequest` |
|
|
93
|
+
| `/api/measures/component` | Coverage, complexity | `metricKeys`, `branch`, `pullRequest` |
|
|
94
|
+
| `/api/qualitygates/project_status` | Pass/fail status | `projectKey`, `branch`, `pullRequest` |
|
|
95
|
+
| `/api/hotspots/search` | Security hotspots | `projectKey`, `status` |
|
|
96
|
+
| `/api/projects/search` | List projects | `organization`, `q` |
|
|
97
|
+
| `/api/project_analyses/search` | Analysis history | `project`, `from`, `to` |
|
|
98
|
+
| `/api/measures/search_history` | Metrics over time | `component`, `metrics`, `from` |
|
|
99
|
+
| `/api/components/tree` | Files with metrics | `qualifiers=FIL`, `metricKeys` |
|
|
100
|
+
| `/api/duplications/show` | Duplicate code blocks | `key` (file key), `branch` |
|
|
101
|
+
| `/api/sources/raw` | Raw source code | `key` (file key), `branch` |
|
|
102
|
+
| `/api/sources/scm` | SCM blame info | `key`, `from`, `to` |
|
|
103
|
+
| `/api/ce/activity` | Background tasks | `component`, `status`, `type` |
|
|
104
|
+
| `/api/qualityprofiles/search` | Quality profiles | `language`, `project` |
|
|
105
|
+
| `/api/languages/list` | Supported languages | - |
|
|
106
|
+
| `/api/project_branches/list` | Project branches | `project` |
|
|
107
|
+
| `/api/project_badges/measure` | SVG badge | `project`, `metric`, `branch` |
|
|
108
|
+
| `/api/rules/search` | Coding rules | `languages`, `severities`, `types` |
|
|
109
|
+
|
|
110
|
+
## Common Filters
|
|
111
|
+
|
|
112
|
+
**Issues**: `types=BUG,VULNERABILITY,CODE_SMELL` | `severities=BLOCKER,CRITICAL,MAJOR` | `resolved=false` | `inNewCodePeriod=true`
|
|
113
|
+
|
|
114
|
+
**Metrics**: `bugs,vulnerabilities,code_smells,coverage,duplicated_lines_density,sqale_rating,reliability_rating,security_rating`
|
|
115
|
+
|
|
116
|
+
**New Code**: `new_bugs,new_vulnerabilities,new_coverage,new_duplicated_lines_density`
|
|
117
|
+
|
|
118
|
+
## Workflows
|
|
119
|
+
|
|
120
|
+
### Health Check
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
curl ... "/api/qualitygates/project_status?projectKey=$PROJECT"
|
|
124
|
+
curl ... "/api/measures/component?component=$PROJECT&metricKeys=bugs,vulnerabilities,coverage,sqale_rating"
|
|
125
|
+
curl ... "/api/issues/search?organization=$ORG&componentKeys=$PROJECT&resolved=false&facets=severities,types&ps=1"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### PR Analysis
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
curl ... "/api/qualitygates/project_status?projectKey=$PROJECT&pullRequest=123"
|
|
132
|
+
curl ... "/api/issues/search?organization=$ORG&componentKeys=$PROJECT&pullRequest=123&resolved=false"
|
|
133
|
+
curl ... "/api/measures/component?component=$PROJECT&pullRequest=123&metricKeys=new_bugs,new_coverage"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Security Audit
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
curl ... "/api/issues/search?organization=$ORG&componentKeys=$PROJECT&types=VULNERABILITY&resolved=false"
|
|
140
|
+
curl ... "/api/hotspots/search?projectKey=$PROJECT&status=TO_REVIEW"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Duplication Analysis
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Get duplication metrics
|
|
147
|
+
curl ... "/api/measures/component?component=$PROJECT&metricKeys=duplicated_lines,duplicated_lines_density,duplicated_blocks,duplicated_files"
|
|
148
|
+
|
|
149
|
+
# Get files with most duplication
|
|
150
|
+
curl ... "/api/components/tree?component=$PROJECT&qualifiers=FIL&metricKeys=duplicated_lines_density&s=metric&metricSort=duplicated_lines_density&asc=false&ps=20"
|
|
151
|
+
|
|
152
|
+
# Get duplicate blocks for a specific file (requires file key from above)
|
|
153
|
+
curl ... "/api/duplications/show?key=my-project:src/utils/helpers.ts"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Response Processing
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Count by severity
|
|
160
|
+
curl ... | jq '.issues | group_by(.severity) | map({severity: .[0].severity, count: length})'
|
|
161
|
+
|
|
162
|
+
# Failed quality gate conditions
|
|
163
|
+
curl ... | jq '.projectStatus.conditions | map(select(.status == "ERROR"))'
|
|
164
|
+
|
|
165
|
+
# Metrics as key-value
|
|
166
|
+
curl ... | jq '.component.measures | map({(.metric): .value}) | add'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Detailed Reference
|
|
170
|
+
|
|
171
|
+
For complete API parameters and response schemas, see [references/api-reference.md](references/api-reference.md).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Eval Sets
|
|
2
|
+
|
|
3
|
+
These eval files use a flat JSON array format targeting `scripts/eval_win.py`:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
[{"query": "...", "should_trigger": true}]
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This is **not** compatible with the skill-creator plugin's `run_loop.py` which expects:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{"skill_name": "...", "evals": [{"id": "...", "prompt": "...", "should_trigger": true}]}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To convert for `run_loop.py`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python3 -c "
|
|
19
|
+
import json, pathlib, uuid
|
|
20
|
+
data = json.loads(pathlib.Path('evals.json').read_text())
|
|
21
|
+
out = {'skill_name': 'SKILL-NAME-HERE', 'evals': [
|
|
22
|
+
{'id': str(uuid.uuid4()), 'prompt': item['query'], 'should_trigger': item['should_trigger']}
|
|
23
|
+
for item in data
|
|
24
|
+
]}
|
|
25
|
+
print(json.dumps(out, indent=2))
|
|
26
|
+
" > evals_skill_creator.json
|
|
27
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "Check the SonarCloud quality gate status for our latest PR — I want to see if there are any blockers before we can merge, especially around security vulnerabilities and code coverage",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "Pull the SonarCloud analysis results for our project — show me all the critical and major security vulnerabilities found in the last scan, with file locations and remediation guidance",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "We're in /review and SonarCloud flagged some issues — get the full list of code smells, bugs, and vulnerabilities from the latest analysis so I can address them before the quality gate passes",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "What's our current technical debt ratio in SonarCloud? Show me the metrics dashboard — maintainability rating, reliability rating, security rating, and coverage percentage",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "The SonarCloud quality gate is failing on our PR — pull the specific issues that are blocking it and show me what needs to be fixed, sorted by severity",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Get the SonarCloud code coverage report for our project — I want to see which modules have low coverage and identify the files that need more tests before our next release",
|
|
24
|
+
"should_trigger": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "Implement a new REST API endpoint for user profile management with CRUD operations, input validation, and proper error handling",
|
|
28
|
+
"should_trigger": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "Search for best practices around implementing OAuth2 PKCE flow in a Node.js application",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "Write a comprehensive market analysis of the DevSecOps tools landscape covering SAST, DAST, and SCA vendors",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "Scrape https://docs.sonarcloud.io and extract the full list of supported languages and analysis rules",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"query": "Build a structured company profile for SonarSource — return JSON with founding year, funding, products, and competitive positioning",
|
|
44
|
+
"should_trigger": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"query": "Add proper citations to docs/research/security-audit-findings.md following our project's citation standards",
|
|
48
|
+
"should_trigger": false
|
|
49
|
+
}
|
|
50
|
+
]
|