Skip to content
Back to skills

Version Stamp Automation

ASecurity

Version numbers in 5+ files WILL drift with manual edits:

  • 6 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 3, 2026
ai-agentsjavascriptjavabashnodedevopsdocumentation

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill version-stamp-automation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Version Stamp Automation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Version Stamp Automation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fabioc-aloha-version-stamp-automation/badge)](https://www.skillsdirectory.com/skills/fabioc-aloha-version-stamp-automation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: version-stamp-automation
description: "Version numbers in 5+ files WILL drift with manual edits:"
lastReviewed: 2026-04-30
---

# Version Stamp Automation

## The Problem

Version numbers in 5+ files WILL drift with manual edits:

- `package.json` says 2.1.0
- README badge says 2.0.0
- CHANGELOG header says 2.1.0-beta
- Extension manifest says 2.0.1

## The Solution

### 1. Single Source of Truth

```json
// package.json is the ONE source
{
  "version": "2.1.0"
}
```

### 2. Bump Script That Derives All Locations

```javascript
// scripts/bump-version.cjs
const fs = require('fs');
const path = require('path');

const newVersion = process.argv[2];
if (!newVersion) {
  console.error('Usage: node bump-version.cjs <version>');
  process.exit(1);
}

// Define all version locations
const locations = [
  {
    file: 'package.json',
    pattern: /"version":\s*"[^"]+"/,
    replace: `"version": "${newVersion}"`
  },
  {
    file: 'README.md',
    pattern: /version-v[\d.]+/g,
    replace: `version-v${newVersion}`
  },
  {
    file: 'src/extension.ts',
    pattern: /VERSION\s*=\s*['"][^'"]+['"]/,
    replace: `VERSION = '${newVersion}'`
  }
];

locations.forEach(({ file, pattern, replace }) => {
  const filePath = path.resolve(file);
  if (!fs.existsSync(filePath)) return;
  
  let content = fs.readFileSync(filePath, 'utf8');
  content = content.replace(pattern, replace);
  fs.writeFileSync(filePath, content);
  console.log(`Updated: ${file}`);
});
```

### 3. Classify Each Reference

| Type | Action | Example |
|------|--------|---------|
| **Auto-derivable** | Script updates | README badge, package.json |
| **Manually dated** | Leave alone | CHANGELOG entries, planning docs |
| **Build-time** | Inject at build | Extension about page |

## Verification

```bash
# After running bump script
grep -rn "2.1.0" . --include="*.json" --include="*.md" --include="*.ts"

# Should see consistent version everywhere (except historical docs)
```

## When to Apply

- Any project with version in 3+ files
- Before any release process
- When you notice drift

## Tags

`versioning` `automation` `documentation` `devops`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.