gabrielmoreira/agent-skills-mirror/fix-once-auto-inject

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

One-time fixes get repeated manually:

Install

npx vskill@latest install gabrielmoreira/agent-skills-mirror/fix-once-auto-inject

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Fix-Once + Auto-Inject-Future

The Problem

One-time fixes get repeated manually:

  • "Add the missing import to every new file"
  • "Remember to set the flag when creating services"
  • Relies on human memory → fails over time

The Solution

Pair an idempotent one-time fix with a build-time auto-inject fallback.

Prong 1: One-Time Fix Script
javascript
// scripts/fix-missing-headers.cjs
const fs = require('fs');
const glob = require('glob');
const header = '// Copyright 2026 Company\n\n';
glob.sync('src/**/*.ts').forEach(file => {
const content = fs.readFileSync(file, 'utf8');
if (!content.startsWith('// Copyright')) {
fs.writeFileSync(file, header + content);
console.log(`Fixed: ${file}`);
}
});

Run once to fix existing files.

Prong 2: Auto-Inject at Build
javascript
// In build pipeline or git hook
const files = getChangedFiles();
files.filter(f => f.endsWith('.ts')).forEach(file => {
const content = fs.readFileSync(file, 'utf8');
if (!content.startsWith('// Copyright')) {
// Auto-fix or fail the build
console.error(`Missing header: ${file}`);
process.exit(1);
}
});
Git Hook Version
bash
#!/bin/bash
# .git/hooks/pre-commit
for file in $(git diff --cached --name-only | grep '\.ts$'); do
if ! head -1 "$file" | grep -q "Copyright"; then
echo "Missing copyright header: $file"
exit 1
fi
done

Pattern

┌─────────────────────────────────────┐
│ Fix existing files (one-time) │
│ node scripts/fix-all.cjs │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Enforce on new files (ongoing) │
│ build hook / pre-commit / CI │
└─────────────────────────────────────┘

Verification

  1. Running fix script on already-fixed files is idempotent
  2. Creating a new file without the fix fails the hook
  3. No manual enforcement needed after setup

When to Apply

  • License headers
  • Required imports
  • Configuration defaults
  • Any "every file must have X" rule

Tags

build automation enforcement hooks

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
19
Repository forks
2
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/gabrielmoreira/agent-skills-mirror/fix-once-auto-inject/badge)](https://verified-skill.com/skills/gabrielmoreira/agent-skills-mirror/fix-once-auto-inject)

Something wrong with this skill or its page? Tell us.