用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/Alex_Skill_Mall --skill fix-once-auto-inject命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | fix-once-auto-inject |
| description | One-time fixes get repeated manually: |
| lastReviewed | 2026-04-30T00:00:00.000Z |
One-time fixes get repeated manually:
Pair an idempotent one-time fix with a build-time auto-inject fallback.
// 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.
// 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);
}
});
#!/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
┌─────────────────────────────────────┐
│ Fix existing files (one-time) │
│ node scripts/fix-all.cjs │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Enforce on new files (ongoing) │
│ build hook / pre-commit / CI │
└─────────────────────────────────────┘
build automation enforcement hooks