claude-code-orchestrator-kit 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/agents/database/workers/api-builder.md +155 -0
- package/.claude/agents/database/workers/database-architect.md +193 -0
- package/.claude/agents/database/workers/supabase-auditor.md +1070 -0
- package/.claude/agents/development/workers/code-reviewer.md +968 -0
- package/.claude/agents/development/workers/cost-calculator-specialist.md +683 -0
- package/.claude/agents/development/workers/llm-service-specialist.md +999 -0
- package/.claude/agents/development/workers/skill-builder-v2.md +480 -0
- package/.claude/agents/development/workers/typescript-types-specialist.md +649 -0
- package/.claude/agents/development/workers/utility-builder.md +582 -0
- package/.claude/agents/documentation/workers/technical-writer.md +152 -0
- package/.claude/agents/frontend/workers/fullstack-nextjs-specialist.md +206 -0
- package/.claude/agents/frontend/workers/visual-effects-creator.md +159 -0
- package/.claude/agents/health/orchestrators/bug-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dead-code-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dependency-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/security-orchestrator.md +1045 -0
- package/.claude/agents/health/workers/bug-fixer.md +525 -0
- package/.claude/agents/health/workers/bug-hunter.md +649 -0
- package/.claude/agents/health/workers/dead-code-hunter.md +446 -0
- package/.claude/agents/health/workers/dead-code-remover.md +437 -0
- package/.claude/agents/health/workers/dependency-auditor.md +379 -0
- package/.claude/agents/health/workers/dependency-updater.md +436 -0
- package/.claude/agents/health/workers/security-scanner.md +700 -0
- package/.claude/agents/health/workers/vulnerability-fixer.md +524 -0
- package/.claude/agents/infrastructure/workers/infrastructure-specialist.md +156 -0
- package/.claude/agents/infrastructure/workers/orchestration-logic-specialist.md +1260 -0
- package/.claude/agents/infrastructure/workers/qdrant-specialist.md +503 -0
- package/.claude/agents/infrastructure/workers/quality-validator-specialist.md +984 -0
- package/.claude/agents/meta/workers/meta-agent-v3.md +503 -0
- package/.claude/agents/research/workers/problem-investigator.md +507 -0
- package/.claude/agents/research/workers/research-specialist.md +423 -0
- package/.claude/agents/testing/workers/accessibility-tester.md +813 -0
- package/.claude/agents/testing/workers/integration-tester.md +188 -0
- package/.claude/agents/testing/workers/mobile-fixes-implementer.md +252 -0
- package/.claude/agents/testing/workers/mobile-responsiveness-tester.md +180 -0
- package/.claude/agents/testing/workers/performance-optimizer.md +262 -0
- package/.claude/agents/testing/workers/test-writer.md +800 -0
- package/.claude/commands/health-bugs.md +297 -0
- package/.claude/commands/health-cleanup.md +297 -0
- package/.claude/commands/health-deps.md +297 -0
- package/.claude/commands/health-metrics.md +747 -0
- package/.claude/commands/health-security.md +297 -0
- package/.claude/commands/push.md +21 -0
- package/.claude/commands/speckit.analyze.md +184 -0
- package/.claude/commands/speckit.checklist.md +294 -0
- package/.claude/commands/speckit.clarify.md +178 -0
- package/.claude/commands/speckit.constitution.md +78 -0
- package/.claude/commands/speckit.implement.md +182 -0
- package/.claude/commands/speckit.plan.md +87 -0
- package/.claude/commands/speckit.specify.md +250 -0
- package/.claude/commands/speckit.tasks.md +137 -0
- package/.claude/commands/translate-doc.md +95 -0
- package/.claude/commands/worktree-cleanup.md +382 -0
- package/.claude/commands/worktree-create.md +287 -0
- package/.claude/commands/worktree-list.md +239 -0
- package/.claude/commands/worktree-remove.md +339 -0
- package/.claude/schemas/base-plan.schema.json +82 -0
- package/.claude/schemas/bug-plan.schema.json +71 -0
- package/.claude/schemas/dead-code-plan.schema.json +71 -0
- package/.claude/schemas/dependency-plan.schema.json +74 -0
- package/.claude/schemas/security-plan.schema.json +71 -0
- package/.claude/scripts/gates/check-bundle-size.sh +47 -0
- package/.claude/scripts/gates/check-coverage.sh +67 -0
- package/.claude/scripts/gates/check-security.sh +46 -0
- package/.claude/scripts/release.sh +740 -0
- package/.claude/settings.local.json +21 -0
- package/.claude/settings.local.json.example +20 -0
- package/.claude/skills/calculate-priority-score/SKILL.md +229 -0
- package/.claude/skills/calculate-priority-score/scoring-matrix.json +83 -0
- package/.claude/skills/extract-version/SKILL.md +228 -0
- package/.claude/skills/format-commit-message/SKILL.md +189 -0
- package/.claude/skills/format-commit-message/template.md +64 -0
- package/.claude/skills/format-markdown-table/SKILL.md +202 -0
- package/.claude/skills/format-markdown-table/examples.md +84 -0
- package/.claude/skills/format-todo-list/SKILL.md +222 -0
- package/.claude/skills/format-todo-list/template.json +30 -0
- package/.claude/skills/generate-changelog/SKILL.md +258 -0
- package/.claude/skills/generate-changelog/commit-mapping.json +47 -0
- package/.claude/skills/generate-report-header/SKILL.md +228 -0
- package/.claude/skills/generate-report-header/template.md +66 -0
- package/.claude/skills/parse-error-logs/SKILL.md +286 -0
- package/.claude/skills/parse-error-logs/patterns.json +26 -0
- package/.claude/skills/parse-git-status/SKILL.md +164 -0
- package/.claude/skills/parse-package-json/SKILL.md +151 -0
- package/.claude/skills/parse-package-json/schema.json +43 -0
- package/.claude/skills/render-template/SKILL.md +245 -0
- package/.claude/skills/rollback-changes/SKILL.md +582 -0
- package/.claude/skills/rollback-changes/changes-log-schema.json +101 -0
- package/.claude/skills/run-quality-gate/SKILL.md +404 -0
- package/.claude/skills/run-quality-gate/gate-mappings.json +97 -0
- package/.claude/skills/validate-plan-file/SKILL.md +327 -0
- package/.claude/skills/validate-plan-file/schema.json +35 -0
- package/.claude/skills/validate-report-file/SKILL.md +256 -0
- package/.claude/skills/validate-report-file/schema.json +67 -0
- package/.env.example +49 -0
- package/.github/BRANCH_PROTECTION.md +137 -0
- package/.github/workflows/build.yml +70 -0
- package/.github/workflows/claude-code-review.yml +255 -0
- package/.github/workflows/claude.yml +79 -0
- package/.github/workflows/deploy-staging.yml +90 -0
- package/.github/workflows/test.yml +104 -0
- package/.gitignore +116 -0
- package/CLAUDE.md +137 -0
- package/LICENSE +72 -0
- package/README.md +1098 -0
- package/docs/ARCHITECTURE.md +746 -0
- package/docs/Agents Ecosystem/AGENT-ORCHESTRATION.md +568 -0
- package/docs/Agents Ecosystem/AI-AGENT-ECOSYSTEM-README.md +658 -0
- package/docs/Agents Ecosystem/ARCHITECTURE.md +606 -0
- package/docs/Agents Ecosystem/QUALITY-GATES-SPECIFICATION.md +1315 -0
- package/docs/Agents Ecosystem/REPORT-TEMPLATE-STANDARD.md +1324 -0
- package/docs/Agents Ecosystem/spec-kit-comprehensive-updates.md +478 -0
- package/docs/FAQ.md +572 -0
- package/docs/MIGRATION-GUIDE.md +542 -0
- package/docs/PERFORMANCE-OPTIMIZATION.md +494 -0
- package/docs/ROADMAP.md +439 -0
- package/docs/TUTORIAL-CUSTOM-AGENTS.md +2041 -0
- package/docs/USE-CASES.md +706 -0
- package/index.js +96 -0
- package/mcp/.mcp.base.json +21 -0
- package/mcp/.mcp.frontend.json +29 -0
- package/mcp/.mcp.full.json +67 -0
- package/mcp/.mcp.local.example.json +7 -0
- package/mcp/.mcp.local.json +7 -0
- package/mcp/.mcp.n8n.json +45 -0
- package/mcp/.mcp.supabase-full.json +35 -0
- package/mcp/.mcp.supabase-only.json +28 -0
- package/package.json +78 -0
- package/postinstall.js +71 -0
- package/switch-mcp.sh +101 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"enableAllProjectMcpServers": true,
|
|
3
|
+
"enabledMcpjsonServers": [
|
|
4
|
+
"context7",
|
|
5
|
+
"server-sequential-thinking",
|
|
6
|
+
"supabase"
|
|
7
|
+
],
|
|
8
|
+
"hooks": {
|
|
9
|
+
"Stop": [
|
|
10
|
+
{
|
|
11
|
+
"matcher": "",
|
|
12
|
+
"hooks": [
|
|
13
|
+
{
|
|
14
|
+
"type": "command",
|
|
15
|
+
"command": "echo -e '\\n\\033[1;32m✅ ЗАДАЧА ЗАВЕРШЕНА (Stop)!\\033[0m\\n' && date '+%Y-%m-%d %H:%M:%S - Task completed (Stop)' >> ~/claude-code-log.txt && powershell.exe -Command \"[System.Media.SystemSounds]::Asterisk.Play(); Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('Задача завершена (Stop)!', 'Claude Code', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information, [System.Windows.Forms.MessageBoxDefaultButton]::Button1, [System.Windows.Forms.MessageBoxOptions]::DefaultDesktopOnly)\""
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"enableAllProjectMcpServers": true,
|
|
3
|
+
"enabledMcpjsonServers": [
|
|
4
|
+
"context7",
|
|
5
|
+
"server-sequential-thinking"
|
|
6
|
+
],
|
|
7
|
+
"hooks": {
|
|
8
|
+
"Stop": [
|
|
9
|
+
{
|
|
10
|
+
"matcher": "",
|
|
11
|
+
"hooks": [
|
|
12
|
+
{
|
|
13
|
+
"type": "command",
|
|
14
|
+
"command": "echo '✅ Task completed!' && date '+%Y-%m-%d %H:%M:%S - Task completed' >> ~/claude-code-log.txt"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: calculate-priority-score
|
|
3
|
+
description: Calculate priority score for bugs, issues, or tasks based on severity, impact, and likelihood. Use for bug prioritization, task ordering, or risk assessment.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Calculate Priority Score
|
|
7
|
+
|
|
8
|
+
Calculate numeric priority score and category for issues based on multiple factors.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Bug prioritization
|
|
13
|
+
- Security vulnerability risk assessment
|
|
14
|
+
- Task ordering
|
|
15
|
+
- Resource allocation decisions
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
### Step 1: Receive Issue Attributes
|
|
20
|
+
|
|
21
|
+
Accept issue attributes as input.
|
|
22
|
+
|
|
23
|
+
**Expected Input**:
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"severity": "critical|high|medium|low",
|
|
27
|
+
"impact": "breaking|major|minor|none",
|
|
28
|
+
"likelihood": "certain|likely|possible|unlikely"
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 2: Load Scoring Matrix
|
|
33
|
+
|
|
34
|
+
Use scoring matrix to assign points.
|
|
35
|
+
|
|
36
|
+
**Severity Scores**:
|
|
37
|
+
- critical: 10
|
|
38
|
+
- high: 7
|
|
39
|
+
- medium: 5
|
|
40
|
+
- low: 2
|
|
41
|
+
|
|
42
|
+
**Impact Scores**:
|
|
43
|
+
- breaking: 10
|
|
44
|
+
- major: 7
|
|
45
|
+
- minor: 3
|
|
46
|
+
- none: 0
|
|
47
|
+
|
|
48
|
+
**Likelihood Scores**:
|
|
49
|
+
- certain: 10
|
|
50
|
+
- likely: 7
|
|
51
|
+
- possible: 5
|
|
52
|
+
- unlikely: 2
|
|
53
|
+
|
|
54
|
+
### Step 3: Calculate Total Score
|
|
55
|
+
|
|
56
|
+
Sum all factor scores.
|
|
57
|
+
|
|
58
|
+
**Formula**: `score = severity + impact + likelihood`
|
|
59
|
+
|
|
60
|
+
**Range**: 0-30
|
|
61
|
+
|
|
62
|
+
### Step 4: Determine Priority Category
|
|
63
|
+
|
|
64
|
+
Map score to priority category.
|
|
65
|
+
|
|
66
|
+
**Priority Categories**:
|
|
67
|
+
- **P0 (Critical)**: 25-30
|
|
68
|
+
- Label: "Critical - Immediate Action Required"
|
|
69
|
+
- Action: Drop everything, fix now
|
|
70
|
+
|
|
71
|
+
- **P1 (High)**: 19-24
|
|
72
|
+
- Label: "High - Fix This Sprint"
|
|
73
|
+
- Action: Prioritize in current sprint
|
|
74
|
+
|
|
75
|
+
- **P2 (Medium)**: 12-18
|
|
76
|
+
- Label: "Medium - Schedule for Next Sprint"
|
|
77
|
+
- Action: Include in backlog, address soon
|
|
78
|
+
|
|
79
|
+
- **P3 (Low)**: 5-11
|
|
80
|
+
- Label: "Low - Schedule When Convenient"
|
|
81
|
+
- Action: Nice to have, low priority
|
|
82
|
+
|
|
83
|
+
- **P4 (Minimal)**: 0-4
|
|
84
|
+
- Label: "Minimal - Consider Closing"
|
|
85
|
+
- Action: May not be worth fixing
|
|
86
|
+
|
|
87
|
+
### Step 5: Return Scored Result
|
|
88
|
+
|
|
89
|
+
Return complete priority assessment.
|
|
90
|
+
|
|
91
|
+
**Expected Output**:
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"score": 27,
|
|
95
|
+
"category": "P0",
|
|
96
|
+
"label": "Critical - Immediate Action Required",
|
|
97
|
+
"factors": {
|
|
98
|
+
"severity": 10,
|
|
99
|
+
"impact": 10,
|
|
100
|
+
"likelihood": 7
|
|
101
|
+
},
|
|
102
|
+
"recommendation": "Drop everything, fix now"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Error Handling
|
|
107
|
+
|
|
108
|
+
- **Invalid Severity**: Return error listing valid values
|
|
109
|
+
- **Invalid Impact**: Return error listing valid values
|
|
110
|
+
- **Invalid Likelihood**: Return error listing valid values
|
|
111
|
+
- **Missing Factor**: Return error requesting all factors
|
|
112
|
+
|
|
113
|
+
## Examples
|
|
114
|
+
|
|
115
|
+
### Example 1: Critical Bug
|
|
116
|
+
|
|
117
|
+
**Input**:
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"severity": "critical",
|
|
121
|
+
"impact": "breaking",
|
|
122
|
+
"likelihood": "certain"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Output**:
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"score": 30,
|
|
130
|
+
"category": "P0",
|
|
131
|
+
"label": "Critical - Immediate Action Required",
|
|
132
|
+
"factors": {
|
|
133
|
+
"severity": 10,
|
|
134
|
+
"impact": 10,
|
|
135
|
+
"likelihood": 10
|
|
136
|
+
},
|
|
137
|
+
"recommendation": "Drop everything, fix now"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Example 2: Medium Priority Issue
|
|
142
|
+
|
|
143
|
+
**Input**:
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"severity": "medium",
|
|
147
|
+
"impact": "minor",
|
|
148
|
+
"likelihood": "likely"
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Output**:
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"score": 15,
|
|
156
|
+
"category": "P2",
|
|
157
|
+
"label": "Medium - Schedule for Next Sprint",
|
|
158
|
+
"factors": {
|
|
159
|
+
"severity": 5,
|
|
160
|
+
"impact": 3,
|
|
161
|
+
"likelihood": 7
|
|
162
|
+
},
|
|
163
|
+
"recommendation": "Include in backlog, address soon"
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Example 3: Low Priority Enhancement
|
|
168
|
+
|
|
169
|
+
**Input**:
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"severity": "low",
|
|
173
|
+
"impact": "minor",
|
|
174
|
+
"likelihood": "unlikely"
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Output**:
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"score": 7,
|
|
182
|
+
"category": "P3",
|
|
183
|
+
"label": "Low - Schedule When Convenient",
|
|
184
|
+
"factors": {
|
|
185
|
+
"severity": 2,
|
|
186
|
+
"impact": 3,
|
|
187
|
+
"likelihood": 2
|
|
188
|
+
},
|
|
189
|
+
"recommendation": "Nice to have, low priority"
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Example 4: High-Impact but Unlikely
|
|
194
|
+
|
|
195
|
+
**Input**:
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"severity": "high",
|
|
199
|
+
"impact": "breaking",
|
|
200
|
+
"likelihood": "unlikely"
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Output**:
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"score": 19,
|
|
208
|
+
"category": "P1",
|
|
209
|
+
"label": "High - Fix This Sprint",
|
|
210
|
+
"factors": {
|
|
211
|
+
"severity": 7,
|
|
212
|
+
"impact": 10,
|
|
213
|
+
"likelihood": 2
|
|
214
|
+
},
|
|
215
|
+
"recommendation": "Prioritize in current sprint"
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Validation
|
|
220
|
+
|
|
221
|
+
- [ ] Calculates score correctly
|
|
222
|
+
- [ ] Maps to correct priority category
|
|
223
|
+
- [ ] Handles all valid factor values
|
|
224
|
+
- [ ] Returns clear recommendations
|
|
225
|
+
- [ ] Validates input factors
|
|
226
|
+
|
|
227
|
+
## Supporting Files
|
|
228
|
+
|
|
229
|
+
- `scoring-matrix.json`: Factor scoring rules (see Supporting Files section)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"severity": {
|
|
3
|
+
"critical": {
|
|
4
|
+
"score": 10,
|
|
5
|
+
"description": "System crash, data loss, security breach"
|
|
6
|
+
},
|
|
7
|
+
"high": {
|
|
8
|
+
"score": 7,
|
|
9
|
+
"description": "Major functionality broken, significant UX impact"
|
|
10
|
+
},
|
|
11
|
+
"medium": {
|
|
12
|
+
"score": 5,
|
|
13
|
+
"description": "Minor functionality affected, workaround exists"
|
|
14
|
+
},
|
|
15
|
+
"low": {
|
|
16
|
+
"score": 2,
|
|
17
|
+
"description": "Cosmetic issue, minimal impact"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"impact": {
|
|
21
|
+
"breaking": {
|
|
22
|
+
"score": 10,
|
|
23
|
+
"description": "Breaking change, API incompatibility, data corruption"
|
|
24
|
+
},
|
|
25
|
+
"major": {
|
|
26
|
+
"score": 7,
|
|
27
|
+
"description": "Major feature affected, multiple users impacted"
|
|
28
|
+
},
|
|
29
|
+
"minor": {
|
|
30
|
+
"score": 3,
|
|
31
|
+
"description": "Small feature affected, few users impacted"
|
|
32
|
+
},
|
|
33
|
+
"none": {
|
|
34
|
+
"score": 0,
|
|
35
|
+
"description": "No functional impact"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"likelihood": {
|
|
39
|
+
"certain": {
|
|
40
|
+
"score": 10,
|
|
41
|
+
"description": "Happens every time, 100% reproducible"
|
|
42
|
+
},
|
|
43
|
+
"likely": {
|
|
44
|
+
"score": 7,
|
|
45
|
+
"description": "Happens frequently, >50% of cases"
|
|
46
|
+
},
|
|
47
|
+
"possible": {
|
|
48
|
+
"score": 5,
|
|
49
|
+
"description": "Happens occasionally, 10-50% of cases"
|
|
50
|
+
},
|
|
51
|
+
"unlikely": {
|
|
52
|
+
"score": 2,
|
|
53
|
+
"description": "Rare occurrence, <10% of cases"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"priorities": {
|
|
57
|
+
"P0": {
|
|
58
|
+
"range": [25, 30],
|
|
59
|
+
"label": "Critical - Immediate Action Required",
|
|
60
|
+
"action": "Drop everything, fix now"
|
|
61
|
+
},
|
|
62
|
+
"P1": {
|
|
63
|
+
"range": [19, 24],
|
|
64
|
+
"label": "High - Fix This Sprint",
|
|
65
|
+
"action": "Prioritize in current sprint"
|
|
66
|
+
},
|
|
67
|
+
"P2": {
|
|
68
|
+
"range": [12, 18],
|
|
69
|
+
"label": "Medium - Schedule for Next Sprint",
|
|
70
|
+
"action": "Include in backlog, address soon"
|
|
71
|
+
},
|
|
72
|
+
"P3": {
|
|
73
|
+
"range": [5, 11],
|
|
74
|
+
"label": "Low - Schedule When Convenient",
|
|
75
|
+
"action": "Nice to have, low priority"
|
|
76
|
+
},
|
|
77
|
+
"P4": {
|
|
78
|
+
"range": [0, 4],
|
|
79
|
+
"label": "Minimal - Consider Closing",
|
|
80
|
+
"action": "May not be worth fixing"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: extract-version
|
|
3
|
+
description: Parse and validate semantic version strings from various formats. Use for extracting versions from text, validating semver compliance, or comparing version numbers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Extract Version
|
|
7
|
+
|
|
8
|
+
Parse semantic version strings and validate semver compliance.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Extract version from mixed text
|
|
13
|
+
- Validate version format
|
|
14
|
+
- Parse version components
|
|
15
|
+
- Compare version numbers
|
|
16
|
+
- Normalize version strings
|
|
17
|
+
|
|
18
|
+
## Instructions
|
|
19
|
+
|
|
20
|
+
### Step 1: Receive Version Input
|
|
21
|
+
|
|
22
|
+
Accept version string in various formats.
|
|
23
|
+
|
|
24
|
+
**Expected Input**:
|
|
25
|
+
- `versionString`: String (e.g., "v0.7.0", "0.7.0", "version: 0.7.0", "Ver. 1.2.3-beta.1")
|
|
26
|
+
|
|
27
|
+
### Step 2: Extract Version Pattern
|
|
28
|
+
|
|
29
|
+
Use regex to extract semver pattern.
|
|
30
|
+
|
|
31
|
+
**Patterns to Match**:
|
|
32
|
+
- `X.Y.Z`: Basic semver
|
|
33
|
+
- `vX.Y.Z`: With 'v' prefix
|
|
34
|
+
- `X.Y.Z-prerelease`: With prerelease tag
|
|
35
|
+
- `X.Y.Z+build`: With build metadata
|
|
36
|
+
- Full semver: `X.Y.Z-prerelease+build`
|
|
37
|
+
|
|
38
|
+
**Regex**:
|
|
39
|
+
```
|
|
40
|
+
(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 3: Parse Components
|
|
44
|
+
|
|
45
|
+
Extract major, minor, patch, and optional components.
|
|
46
|
+
|
|
47
|
+
**Components**:
|
|
48
|
+
- `major`: First number
|
|
49
|
+
- `minor`: Second number
|
|
50
|
+
- `patch`: Third number
|
|
51
|
+
- `prerelease`: Optional prerelease tag (after -)
|
|
52
|
+
- `build`: Optional build metadata (after +)
|
|
53
|
+
|
|
54
|
+
### Step 4: Validate Semver
|
|
55
|
+
|
|
56
|
+
Check if version follows semantic versioning 2.0.0 spec.
|
|
57
|
+
|
|
58
|
+
**Validation Rules**:
|
|
59
|
+
- Major, minor, patch must be non-negative integers
|
|
60
|
+
- Prerelease and build must match allowed characters
|
|
61
|
+
- No leading zeros in numeric identifiers (except 0 itself)
|
|
62
|
+
|
|
63
|
+
### Step 5: Return Parsed Data
|
|
64
|
+
|
|
65
|
+
Return structured version object.
|
|
66
|
+
|
|
67
|
+
**Expected Output**:
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"major": 0,
|
|
71
|
+
"minor": 7,
|
|
72
|
+
"patch": 0,
|
|
73
|
+
"prerelease": null,
|
|
74
|
+
"build": null,
|
|
75
|
+
"original": "v0.7.0",
|
|
76
|
+
"normalized": "0.7.0",
|
|
77
|
+
"valid": true,
|
|
78
|
+
"semver": "0.7.0"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Error Handling
|
|
83
|
+
|
|
84
|
+
- **No Version Found**: Return error indicating no version pattern matched
|
|
85
|
+
- **Invalid Format**: Return error with invalid version string
|
|
86
|
+
- **Invalid Component**: Describe which component is invalid
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
### Example 1: Basic Version
|
|
91
|
+
|
|
92
|
+
**Input**:
|
|
93
|
+
```
|
|
94
|
+
versionString: "0.7.0"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Output**:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"major": 0,
|
|
101
|
+
"minor": 7,
|
|
102
|
+
"patch": 0,
|
|
103
|
+
"prerelease": null,
|
|
104
|
+
"build": null,
|
|
105
|
+
"original": "0.7.0",
|
|
106
|
+
"normalized": "0.7.0",
|
|
107
|
+
"valid": true,
|
|
108
|
+
"semver": "0.7.0"
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Example 2: Version with Prefix
|
|
113
|
+
|
|
114
|
+
**Input**:
|
|
115
|
+
```
|
|
116
|
+
versionString: "v1.2.3"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Output**:
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"major": 1,
|
|
123
|
+
"minor": 2,
|
|
124
|
+
"patch": 3,
|
|
125
|
+
"prerelease": null,
|
|
126
|
+
"build": null,
|
|
127
|
+
"original": "v1.2.3",
|
|
128
|
+
"normalized": "1.2.3",
|
|
129
|
+
"valid": true,
|
|
130
|
+
"semver": "1.2.3"
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Example 3: Prerelease Version
|
|
135
|
+
|
|
136
|
+
**Input**:
|
|
137
|
+
```
|
|
138
|
+
versionString: "2.0.0-beta.1"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Output**:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"major": 2,
|
|
145
|
+
"minor": 0,
|
|
146
|
+
"patch": 0,
|
|
147
|
+
"prerelease": "beta.1",
|
|
148
|
+
"build": null,
|
|
149
|
+
"original": "2.0.0-beta.1",
|
|
150
|
+
"normalized": "2.0.0-beta.1",
|
|
151
|
+
"valid": true,
|
|
152
|
+
"semver": "2.0.0-beta.1"
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Example 4: Full Semver with Build
|
|
157
|
+
|
|
158
|
+
**Input**:
|
|
159
|
+
```
|
|
160
|
+
versionString: "1.0.0-alpha.1+001"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Output**:
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"major": 1,
|
|
167
|
+
"minor": 0,
|
|
168
|
+
"patch": 0,
|
|
169
|
+
"prerelease": "alpha.1",
|
|
170
|
+
"build": "001",
|
|
171
|
+
"original": "1.0.0-alpha.1+001",
|
|
172
|
+
"normalized": "1.0.0-alpha.1+001",
|
|
173
|
+
"valid": true,
|
|
174
|
+
"semver": "1.0.0-alpha.1+001"
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Example 5: Extract from Text
|
|
179
|
+
|
|
180
|
+
**Input**:
|
|
181
|
+
```
|
|
182
|
+
versionString: "Version: 0.8.0 released on 2025-10-17"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Output**:
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"major": 0,
|
|
189
|
+
"minor": 8,
|
|
190
|
+
"patch": 0,
|
|
191
|
+
"prerelease": null,
|
|
192
|
+
"build": null,
|
|
193
|
+
"original": "Version: 0.8.0 released on 2025-10-17",
|
|
194
|
+
"normalized": "0.8.0",
|
|
195
|
+
"valid": true,
|
|
196
|
+
"semver": "0.8.0"
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Example 6: Invalid Version
|
|
201
|
+
|
|
202
|
+
**Input**:
|
|
203
|
+
```
|
|
204
|
+
versionString: "1.2.a"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Output**:
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"valid": false,
|
|
211
|
+
"error": "Invalid version format: patch must be numeric",
|
|
212
|
+
"original": "1.2.a"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Validation
|
|
217
|
+
|
|
218
|
+
- [ ] Parses basic semver (X.Y.Z)
|
|
219
|
+
- [ ] Handles 'v' prefix correctly
|
|
220
|
+
- [ ] Extracts prerelease tags
|
|
221
|
+
- [ ] Extracts build metadata
|
|
222
|
+
- [ ] Validates semver compliance
|
|
223
|
+
- [ ] Extracts version from mixed text
|
|
224
|
+
- [ ] Returns normalized version
|
|
225
|
+
|
|
226
|
+
## Supporting Files
|
|
227
|
+
|
|
228
|
+
None required - pure parsing logic with regex.
|