extract-version
Parse and validate semantic version strings from various formats. Use for extracting versions from text, validating semver compliance, or comparing version numbers.
Best use case
extract-version is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Parse and validate semantic version strings from various formats. Use for extracting versions from text, validating semver compliance, or comparing version numbers.
Teams using extract-version should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/extract-version/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How extract-version Compares
| Feature / Agent | extract-version | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Parse and validate semantic version strings from various formats. Use for extracting versions from text, validating semver compliance, or comparing version numbers.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Extract Version
Parse semantic version strings and validate semver compliance.
## When to Use
- Extract version from mixed text
- Validate version format
- Parse version components
- Compare version numbers
- Normalize version strings
## Instructions
### Step 1: Receive Version Input
Accept version string in various formats.
**Expected Input**:
- `versionString`: String (e.g., "v0.7.0", "0.7.0", "version: 0.7.0", "Ver. 1.2.3-beta.1")
### Step 2: Extract Version Pattern
Use regex to extract semver pattern.
**Patterns to Match**:
- `X.Y.Z`: Basic semver
- `vX.Y.Z`: With 'v' prefix
- `X.Y.Z-prerelease`: With prerelease tag
- `X.Y.Z+build`: With build metadata
- Full semver: `X.Y.Z-prerelease+build`
**Regex**:
```
(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?
```
### Step 3: Parse Components
Extract major, minor, patch, and optional components.
**Components**:
- `major`: First number
- `minor`: Second number
- `patch`: Third number
- `prerelease`: Optional prerelease tag (after -)
- `build`: Optional build metadata (after +)
### Step 4: Validate Semver
Check if version follows semantic versioning 2.0.0 spec.
**Validation Rules**:
- Major, minor, patch must be non-negative integers
- Prerelease and build must match allowed characters
- No leading zeros in numeric identifiers (except 0 itself)
### Step 5: Return Parsed Data
Return structured version object.
**Expected Output**:
```json
{
"major": 0,
"minor": 7,
"patch": 0,
"prerelease": null,
"build": null,
"original": "v0.7.0",
"normalized": "0.7.0",
"valid": true,
"semver": "0.7.0"
}
```
## Error Handling
- **No Version Found**: Return error indicating no version pattern matched
- **Invalid Format**: Return error with invalid version string
- **Invalid Component**: Describe which component is invalid
## Examples
### Example 1: Basic Version
**Input**:
```
versionString: "0.7.0"
```
**Output**:
```json
{
"major": 0,
"minor": 7,
"patch": 0,
"prerelease": null,
"build": null,
"original": "0.7.0",
"normalized": "0.7.0",
"valid": true,
"semver": "0.7.0"
}
```
### Example 2: Version with Prefix
**Input**:
```
versionString: "v1.2.3"
```
**Output**:
```json
{
"major": 1,
"minor": 2,
"patch": 3,
"prerelease": null,
"build": null,
"original": "v1.2.3",
"normalized": "1.2.3",
"valid": true,
"semver": "1.2.3"
}
```
### Example 3: Prerelease Version
**Input**:
```
versionString: "2.0.0-beta.1"
```
**Output**:
```json
{
"major": 2,
"minor": 0,
"patch": 0,
"prerelease": "beta.1",
"build": null,
"original": "2.0.0-beta.1",
"normalized": "2.0.0-beta.1",
"valid": true,
"semver": "2.0.0-beta.1"
}
```
### Example 4: Full Semver with Build
**Input**:
```
versionString: "1.0.0-alpha.1+001"
```
**Output**:
```json
{
"major": 1,
"minor": 0,
"patch": 0,
"prerelease": "alpha.1",
"build": "001",
"original": "1.0.0-alpha.1+001",
"normalized": "1.0.0-alpha.1+001",
"valid": true,
"semver": "1.0.0-alpha.1+001"
}
```
### Example 5: Extract from Text
**Input**:
```
versionString: "Version: 0.8.0 released on 2025-10-17"
```
**Output**:
```json
{
"major": 0,
"minor": 8,
"patch": 0,
"prerelease": null,
"build": null,
"original": "Version: 0.8.0 released on 2025-10-17",
"normalized": "0.8.0",
"valid": true,
"semver": "0.8.0"
}
```
### Example 6: Invalid Version
**Input**:
```
versionString: "1.2.a"
```
**Output**:
```json
{
"valid": false,
"error": "Invalid version format: patch must be numeric",
"original": "1.2.a"
}
```
## Validation
- [ ] Parses basic semver (X.Y.Z)
- [ ] Handles 'v' prefix correctly
- [ ] Extracts prerelease tags
- [ ] Extracts build metadata
- [ ] Validates semver compliance
- [ ] Extracts version from mixed text
- [ ] Returns normalized version
## Supporting Files
None required - pure parsing logic with regex.Related Skills
Beads Issue Tracking Skill
> **Attribution**: [Beads](https://github.com/steveyegge/beads) by [Steve Yegge](https://github.com/steveyegge)
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
validate-report-file
Validate that worker-generated reports have all required sections and proper formatting. Use in quality gates, for report completeness checking, or when debugging missing report sections.
validate-plan-file
Validate that orchestrator plan files conform to expected JSON schema. Use before workers read plan files or after orchestrators create them to ensure proper structure and required fields.
ux-researcher-designer
UX research and design toolkit for Senior UX Designer/Researcher including data-driven persona generation, journey mapping, usability testing frameworks, and research synthesis. Use for user research, persona creation, journey mapping, and design validation.
ui-design-system
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
setup-knip
Install and configure Knip for dead code detection. Use before running dead-code-hunter or dependency-auditor to ensure Knip is available. Handles installation, configuration creation, and validation.
senior-prompt-engineer
World-class prompt engineering skill for LLM optimization, prompt patterns, structured outputs, and AI product development. Expertise in Claude, GPT-4, prompt design patterns, few-shot learning, chain-of-thought, and AI evaluation. Includes RAG optimization, agent design, and LLM system architecture. Use when building AI products, optimizing LLM performance, designing agentic systems, or implementing advanced prompting techniques.
senior-devops
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.
senior-architect
Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, Flutter, Postgres, GraphQL, Go, Python. Includes architecture diagram generation, system design patterns, tech stack decision frameworks, and dependency analysis. Use when designing system architecture, making technical decisions, creating architecture diagrams, evaluating trade-offs, or defining integration patterns.