@wipcomputer/wip-ai-devops-toolbox 1.9.58 → 1.9.59
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/.worktrees/toolbox--guard-plan/.license-guard.json +7 -0
- package/.worktrees/toolbox--guard-plan/.publish-skill.json +4 -0
- package/.worktrees/toolbox--guard-plan/CHANGELOG.md +1965 -0
- package/.worktrees/toolbox--guard-plan/CLA.md +19 -0
- package/.worktrees/toolbox--guard-plan/DEV-GUIDE-GENERAL-PUBLIC.md +949 -0
- package/.worktrees/toolbox--guard-plan/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/README.md +238 -0
- package/.worktrees/toolbox--guard-plan/RELEASE-NOTES-v1-9-59.md +28 -0
- package/.worktrees/toolbox--guard-plan/SKILL.md +821 -0
- package/.worktrees/toolbox--guard-plan/TECHNICAL.md +416 -0
- package/.worktrees/toolbox--guard-plan/UNIVERSAL-INTERFACE.md +180 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-8-0.md +29 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-8-1.md +7 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-8-2.md +7 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-0.md +37 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-1.md +38 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-10.md +40 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-2.md +40 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-31.md +26 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-32.md +18 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-41.md +28 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-45.md +25 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-46.md +38 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-47.md +42 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-48.md +22 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-49.md +31 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-50.md +24 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-51.md +11 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-52.md +25 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-53.md +22 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-54.md +13 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-55.md +11 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-56.md +42 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-57.md +18 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-58.md +21 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-6.md +72 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-7.md +23 -0
- package/.worktrees/toolbox--guard-plan/_trash/RELEASE-NOTES-v1-9-9.md +75 -0
- package/.worktrees/toolbox--guard-plan/_trash/guide 2/DEV-GUIDE.md +487 -0
- package/.worktrees/toolbox--guard-plan/_trash/guide 2/scripts/deploy-public.sh +152 -0
- package/.worktrees/toolbox--guard-plan/package.json +27 -0
- package/.worktrees/toolbox--guard-plan/scripts/SKILL-deploy-public.md +61 -0
- package/.worktrees/toolbox--guard-plan/scripts/SKILL-post-merge-rename.md +47 -0
- package/.worktrees/toolbox--guard-plan/scripts/deploy-public.sh +350 -0
- package/.worktrees/toolbox--guard-plan/scripts/post-merge-rename.sh +210 -0
- package/.worktrees/toolbox--guard-plan/scripts/publish-skill.sh +134 -0
- package/.worktrees/toolbox--guard-plan/templates/global-claude-md.md +73 -0
- package/.worktrees/toolbox--guard-plan/templates/repo-claude-md.template +24 -0
- package/.worktrees/toolbox--guard-plan/tools/deploy-public/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/deploy-public/README.md +31 -0
- package/.worktrees/toolbox--guard-plan/tools/deploy-public/SKILL.md +71 -0
- package/.worktrees/toolbox--guard-plan/tools/deploy-public/deploy-public.sh +264 -0
- package/.worktrees/toolbox--guard-plan/tools/deploy-public/package.json +9 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/README.md +46 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/backup.sh +16 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/branch-protect.sh +39 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/crystal-capture.sh +19 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/setup-shell.sh +27 -0
- package/.worktrees/toolbox--guard-plan/tools/ldm-jobs/visibility-audit.sh +27 -0
- package/.worktrees/toolbox--guard-plan/tools/post-merge-rename/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/post-merge-rename/README.md +29 -0
- package/.worktrees/toolbox--guard-plan/tools/post-merge-rename/SKILL.md +57 -0
- package/.worktrees/toolbox--guard-plan/tools/post-merge-rename/package.json +9 -0
- package/.worktrees/toolbox--guard-plan/tools/post-merge-rename/post-merge-rename.sh +122 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-branch-guard/INSTALL.md +41 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-branch-guard/guard.mjs +477 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-branch-guard/package.json +18 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/CHANGELOG.md +6 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/README.md +113 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/REFERENCE.md +86 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/SKILL.md +105 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/guard.mjs +161 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/openclaw.plugin.json +8 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/package.json +27 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-file-guard/test.sh +119 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/README.md +69 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/SKILL.md +65 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/cli.mjs +472 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/core.mjs +310 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/guard.mjs +146 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-guard/package.json +22 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/CHANGELOG.md +17 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/README.md +200 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/SKILL.md +111 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/cli/index.d.ts +15 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/cli/index.js +170 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/cli/index.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/detector.d.ts +12 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/detector.js +104 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/detector.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/index.d.ts +4 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/index.js +5 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/index.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/ledger.d.ts +49 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/ledger.js +72 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/ledger.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/reporter.d.ts +14 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/reporter.js +227 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/reporter.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/scanner.d.ts +39 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/scanner.js +325 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/dist/core/scanner.js.map +1 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/hooks/pre-pull.sh +55 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/hooks/pre-push.sh +51 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/mcp-server.mjs +119 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/package-lock.json +54 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/package.json +43 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/cli/index.ts +189 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/core/detector.ts +130 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/core/index.ts +4 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/core/ledger.ts +116 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/core/reporter.ts +255 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/src/core/scanner.ts +367 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-license-hook/tsconfig.json +16 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-readme-format/README.md +49 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-readme-format/SKILL.md +84 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-readme-format/format.mjs +597 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-readme-format/package.json +15 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/CHANGELOG.md +42 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/README.md +45 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/REFERENCE.md +100 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/SKILL.md +139 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/cli.js +175 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/core.mjs +1664 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/mcp-server.mjs +113 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-release/package.json +36 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/README.md +38 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/SKILL.md +77 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/init.mjs +148 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/package.json +11 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/_sort/README.md +15 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/_trash/README.md +16 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/dev-updates/README.md +50 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/product/notes/README.md +26 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/product/plans-prds/roadmap.md +77 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/product/plans-prds/todos/README.md +63 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/product/product-ideas/README.md +24 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/product/readme-first-product.md +128 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-init/templates/read-me-first.md +80 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/README.md +86 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/SKILL.md +73 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/cli.js +93 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/core.mjs +122 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/guard.mjs +64 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/mcp-server.mjs +92 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/openclaw.plugin.json +8 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repo-permissions-hook/package.json +31 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/README.md +77 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/SKILL.md +80 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/claude.mjs +248 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/cli.mjs +191 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/core.mjs +290 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/mcp-server.mjs +157 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-repos/package.json +34 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/CHANGELOG.md +57 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/LICENSE +52 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/README.md +81 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/REFERENCE.md +122 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/SKILL.md +87 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/SPEC.md +206 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/detect.mjs +130 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/README.md +20 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/SKILL.md +28 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/cli.mjs +4 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/core.mjs +8 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/mcp-server.mjs +27 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/examples/minimal/package.json +12 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/install.js +930 -0
- package/.worktrees/toolbox--guard-plan/tools/wip-universal-installer/package.json +32 -0
- package/CHANGELOG.md +31 -0
- package/SKILL.md +1 -1
- package/_trash/RELEASE-NOTES-v1-9-59.md +28 -0
- package/package.json +1 -1
- package/tools/deploy-public/package.json +1 -1
- package/tools/post-merge-rename/package.json +1 -1
- package/tools/wip-branch-guard/guard.mjs +57 -39
- package/tools/wip-branch-guard/package.json +1 -1
- package/tools/wip-file-guard/package.json +1 -1
- package/tools/wip-license-guard/package.json +1 -1
- package/tools/wip-license-hook/package.json +1 -1
- package/tools/wip-readme-format/package.json +1 -1
- package/tools/wip-release/package.json +1 -1
- package/tools/wip-repo-init/package.json +1 -1
- package/tools/wip-repo-permissions-hook/package.json +1 -1
- package/tools/wip-repos/package.json +1 -1
- package/tools/wip-universal-installer/package.json +1 -1
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// wip-readme-format: reformat a repo's README to follow the WIP Computer standard.
|
|
3
|
+
//
|
|
4
|
+
// Usage:
|
|
5
|
+
// wip-readme-format /path/to/repo # generate README-init-*.md section files
|
|
6
|
+
// wip-readme-format /path/to/repo --deploy # assemble sections into README.md + TECHNICAL.md
|
|
7
|
+
// wip-readme-format /path/to/repo --dry-run # preview without writing
|
|
8
|
+
// wip-readme-format /path/to/repo --check # validate existing README, exit 0/1
|
|
9
|
+
//
|
|
10
|
+
// Generated files:
|
|
11
|
+
// README-init-badges.md Org header + interface badges
|
|
12
|
+
// README-init-title.md Title + tagline
|
|
13
|
+
// README-init-teach.md "Teach Your AI" onboarding block
|
|
14
|
+
// README-init-features.md Features list
|
|
15
|
+
// README-init-coverage.md Interface coverage table (toolbox only)
|
|
16
|
+
// README-init-more-info.md Links to docs
|
|
17
|
+
// README-init-license.md License block
|
|
18
|
+
// README-init-technical.md Technical content extracted from old README
|
|
19
|
+
//
|
|
20
|
+
// Workflow (same pattern as release notes):
|
|
21
|
+
// 1. wip-readme-format /path/to/repo ... generates section files
|
|
22
|
+
// 2. Edit any section you want (e.g. README-init-license.md)
|
|
23
|
+
// 3. wip-readme-format /path/to/repo --deploy ... assembles + moves into place
|
|
24
|
+
|
|
25
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync, readdirSync } from 'node:fs';
|
|
26
|
+
import { join, resolve, basename, dirname } from 'node:path';
|
|
27
|
+
import { fileURLToPath } from 'node:url';
|
|
28
|
+
import { detectInterfaces, detectToolbox } from '../wip-universal-installer/detect.mjs';
|
|
29
|
+
|
|
30
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
31
|
+
|
|
32
|
+
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
33
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
|
|
34
|
+
console.log(pkg.version);
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const args = process.argv.slice(2);
|
|
39
|
+
const DRY_RUN = args.includes('--dry-run');
|
|
40
|
+
const CHECK = args.includes('--check');
|
|
41
|
+
const DEPLOY = args.includes('--deploy');
|
|
42
|
+
const target = args.find(a => !a.startsWith('--'));
|
|
43
|
+
|
|
44
|
+
function log(msg) { console.log(` ${msg}`); }
|
|
45
|
+
function ok(msg) { console.log(` \u2713 ${msg}`); }
|
|
46
|
+
function fail(msg) { console.error(` \u2717 ${msg}`); }
|
|
47
|
+
function warn(msg) { console.log(` ! ${msg}`); }
|
|
48
|
+
|
|
49
|
+
function readJSON(path) {
|
|
50
|
+
try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return null; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function readFile(path) {
|
|
54
|
+
try { return readFileSync(path, 'utf8'); } catch { return null; }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Section order for assembly. "coverage" is optional (toolbox only).
|
|
58
|
+
// "technical" is separate (becomes TECHNICAL.md, not part of README).
|
|
59
|
+
const SECTION_ORDER = ['badges', 'title', 'teach', 'features', 'coverage', 'more-info', 'license'];
|
|
60
|
+
|
|
61
|
+
function initPath(repoPath, section) {
|
|
62
|
+
return join(repoPath, `README-init-${section}.md`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ── Badge generation ──
|
|
66
|
+
|
|
67
|
+
const BADGE_MAP = {
|
|
68
|
+
cli: { label: 'CLI', file: null },
|
|
69
|
+
module: { label: 'Module', file: null },
|
|
70
|
+
mcp: { label: 'MCP Server', file: 'mcp-server.mjs' },
|
|
71
|
+
openclaw: { label: 'OpenClaw Plugin', file: 'openclaw.plugin.json' },
|
|
72
|
+
skill: { label: 'Skill', file: 'SKILL.md' },
|
|
73
|
+
claudeCodeHook: { label: 'Claude Code Hook', file: 'guard.mjs' },
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
function generateBadges(interfaces, repoUrl) {
|
|
77
|
+
const badges = [];
|
|
78
|
+
for (const [key, info] of Object.entries(interfaces)) {
|
|
79
|
+
const meta = BADGE_MAP[key];
|
|
80
|
+
if (!meta) continue;
|
|
81
|
+
const label = meta.label.replace(/ /g, '_');
|
|
82
|
+
const badge = `https://img.shields.io/badge/interface-${label}-black`;
|
|
83
|
+
const link = meta.file && repoUrl
|
|
84
|
+
? `${repoUrl}/blob/main/${meta.file}`
|
|
85
|
+
: repoUrl || '#';
|
|
86
|
+
badges.push(`[](${link})`);
|
|
87
|
+
}
|
|
88
|
+
return badges.join(' ');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── Teach Your AI block ──
|
|
92
|
+
|
|
93
|
+
function generateTeachBlock(toolName, repoUrl, skillPath) {
|
|
94
|
+
const skillUrl = repoUrl
|
|
95
|
+
? `${repoUrl}/blob/main/${skillPath || 'SKILL.md'}`
|
|
96
|
+
: 'SKILL.md';
|
|
97
|
+
const installCmd = repoUrl
|
|
98
|
+
? `wip-install ${repoUrl.replace('https://github.com/', '')} --dry-run`
|
|
99
|
+
: `wip-install /path/to/repo --dry-run`;
|
|
100
|
+
|
|
101
|
+
return `## Teach Your AI to Use ${toolName}
|
|
102
|
+
|
|
103
|
+
Open your AI and say:
|
|
104
|
+
|
|
105
|
+
\`\`\`
|
|
106
|
+
Read the SKILL.md at ${skillUrl.replace('https://', '')}.
|
|
107
|
+
|
|
108
|
+
Then explain to me:
|
|
109
|
+
1. What are these tools?
|
|
110
|
+
2. What do they do?
|
|
111
|
+
3. What would they change about how we work together?
|
|
112
|
+
|
|
113
|
+
Then ask me:
|
|
114
|
+
- Do you have more questions?
|
|
115
|
+
- Do you want to install them?
|
|
116
|
+
|
|
117
|
+
If I say yes, run: ${installCmd}
|
|
118
|
+
|
|
119
|
+
Show me exactly what will change on my system. When I'm ready, I'll tell you
|
|
120
|
+
to install for real.
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
Your agent will read the repo, explain everything, and do a dry-run install first so you can see exactly what changes before anything is written to your system.`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ── Interface coverage table (toolbox mode) ──
|
|
127
|
+
|
|
128
|
+
function extractSkillName(toolPath) {
|
|
129
|
+
const skillContent = readFile(join(toolPath, 'SKILL.md'));
|
|
130
|
+
if (!skillContent) return null;
|
|
131
|
+
const match = skillContent.match(/^---\s*\n[\s\S]*?^name:\s*(.+)/m);
|
|
132
|
+
return match ? match[1].trim() : null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function generateInterfaceTable(repoPath, subTools) {
|
|
136
|
+
const rows = [];
|
|
137
|
+
let num = 0;
|
|
138
|
+
for (const tool of subTools) {
|
|
139
|
+
num++;
|
|
140
|
+
const { interfaces, pkg: toolPkg } = detectInterfaces(tool.path);
|
|
141
|
+
const skillName = extractSkillName(tool.path);
|
|
142
|
+
const name = skillName || (() => {
|
|
143
|
+
const rawName = toolPkg?.name?.replace(/^@\w+\//, '').replace(/^wip-/, '') || tool.name;
|
|
144
|
+
return rawName.split('-').map(w => {
|
|
145
|
+
const lower = w.toLowerCase();
|
|
146
|
+
if (['ai', 'api', 'cli', 'mcp', 'os', 'devops'].includes(lower)) return lower === 'devops' ? 'DevOps' : lower.toUpperCase();
|
|
147
|
+
return w.charAt(0).toUpperCase() + w.slice(1);
|
|
148
|
+
}).join(' ');
|
|
149
|
+
})();
|
|
150
|
+
const cli = interfaces.cli ? 'Y' : '';
|
|
151
|
+
const mod = interfaces.module ? 'Y' : '';
|
|
152
|
+
const mcp = interfaces.mcp ? 'Y' : '';
|
|
153
|
+
const oc = interfaces.openclaw ? 'Y' : '';
|
|
154
|
+
const skill = interfaces.skill ? 'Y' : '';
|
|
155
|
+
const hook = interfaces.claudeCodeHook ? 'Y' : '';
|
|
156
|
+
rows.push(`| ${num} | ${name} | ${cli} | ${mod} | ${mcp} | ${oc} | ${skill} | ${hook} |`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return `## Interface Coverage
|
|
160
|
+
|
|
161
|
+
| # | Tool | CLI | Module | MCP | OC Plugin | Skill | CC Hook |
|
|
162
|
+
|---|------|-----|--------|-----|-----------|-------|---------|
|
|
163
|
+
${rows.join('\n')}`;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ── Features extraction ──
|
|
167
|
+
|
|
168
|
+
function extractToolboxFeatures(subTools) {
|
|
169
|
+
const features = [];
|
|
170
|
+
for (const tool of subTools) {
|
|
171
|
+
const pkg = readJSON(join(tool.path, 'package.json'));
|
|
172
|
+
const name = pkg?.name?.replace(/^@\w+\//, '').replace(/^wip-/, '') || tool.name;
|
|
173
|
+
const displayName = name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');
|
|
174
|
+
const desc = pkg?.description || '_No description_';
|
|
175
|
+
features.push({ name: displayName, description: desc });
|
|
176
|
+
}
|
|
177
|
+
return features;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ── License block ──
|
|
181
|
+
|
|
182
|
+
function generateLicenseBlock(repoPath) {
|
|
183
|
+
const licenseGuard = readJSON(join(repoPath, '.license-guard.json'));
|
|
184
|
+
if (licenseGuard) {
|
|
185
|
+
return `## License
|
|
186
|
+
|
|
187
|
+
\`\`\`
|
|
188
|
+
MIT All CLI tools, MCP servers, skills, and hooks (use anywhere, no restrictions).
|
|
189
|
+
AGPLv3 Commercial redistribution, marketplace listings, or bundling into paid services.
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
AGPLv3 for personal use is free. Commercial licenses available.`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const license = readFile(join(repoPath, 'LICENSE'));
|
|
196
|
+
if (license) {
|
|
197
|
+
const pkg = readJSON(join(repoPath, 'package.json'));
|
|
198
|
+
return `## License
|
|
199
|
+
|
|
200
|
+
${pkg?.license || 'See LICENSE file.'}`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return `## License
|
|
204
|
+
|
|
205
|
+
_No license information found. Run \`wip-license-guard init\` to set up licensing._`;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// ── More Info section ──
|
|
209
|
+
|
|
210
|
+
function generateMoreInfo(repoPath, repoUrl) {
|
|
211
|
+
const links = [];
|
|
212
|
+
|
|
213
|
+
if (existsSync(join(repoPath, 'TECHNICAL.md')) || existsSync(initPath(repoPath, 'technical'))) {
|
|
214
|
+
const techLink = repoUrl ? `${repoUrl}/blob/main/TECHNICAL.md` : 'TECHNICAL.md';
|
|
215
|
+
links.push(`- [Technical Documentation](${repoUrl ? techLink : 'TECHNICAL.md'}) ... Source code locations, build steps, development setup, architecture details`);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
links.push(`- [Universal Interface Spec](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-universal-installer/SPEC.md) ... The six interfaces every agent-native tool can ship`);
|
|
219
|
+
|
|
220
|
+
if (existsSync(join(repoPath, 'DEV-GUIDE-GENERAL-PUBLIC.md'))) {
|
|
221
|
+
links.push(`- [Dev Guide](DEV-GUIDE-GENERAL-PUBLIC.md) ... Best practices for AI-assisted development`);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return `## More Info
|
|
225
|
+
|
|
226
|
+
${links.join('\n')}`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ── Existing README content extraction ──
|
|
230
|
+
|
|
231
|
+
function extractExistingContent(readmePath) {
|
|
232
|
+
const content = readFile(readmePath);
|
|
233
|
+
if (!content) return {};
|
|
234
|
+
|
|
235
|
+
const sections = {};
|
|
236
|
+
let currentSection = '_preamble';
|
|
237
|
+
let currentContent = [];
|
|
238
|
+
|
|
239
|
+
for (const line of content.split('\n')) {
|
|
240
|
+
const headingMatch = line.match(/^##\s+(.+)/);
|
|
241
|
+
if (headingMatch) {
|
|
242
|
+
sections[currentSection] = currentContent.join('\n').trim();
|
|
243
|
+
currentSection = headingMatch[1].trim().toLowerCase();
|
|
244
|
+
currentContent = [];
|
|
245
|
+
} else {
|
|
246
|
+
currentContent.push(line);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
sections[currentSection] = currentContent.join('\n').trim();
|
|
250
|
+
|
|
251
|
+
return sections;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ── Technical content detection ──
|
|
255
|
+
|
|
256
|
+
function isTechnicalContent(section) {
|
|
257
|
+
const techKeywords = [
|
|
258
|
+
'architecture', 'api', 'endpoint', 'build', 'development setup',
|
|
259
|
+
'configuration', 'schema', 'database', 'migration', 'deployment',
|
|
260
|
+
'docker', 'environment variable', 'debugging',
|
|
261
|
+
];
|
|
262
|
+
const lower = section.toLowerCase();
|
|
263
|
+
return techKeywords.some(k => lower.includes(k));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// ── Main ──
|
|
267
|
+
|
|
268
|
+
if (!target || target === '--help' || target === '-h') {
|
|
269
|
+
console.log('');
|
|
270
|
+
console.log(' wip-readme-format ... reformat a README to follow the WIP Computer standard');
|
|
271
|
+
console.log('');
|
|
272
|
+
console.log(' Usage:');
|
|
273
|
+
console.log(' wip-readme-format /path/to/repo generate README-init-*.md section files');
|
|
274
|
+
console.log(' wip-readme-format /path/to/repo --deploy assemble sections, back up old, move into place');
|
|
275
|
+
console.log(' wip-readme-format /path/to/repo --dry-run preview without writing');
|
|
276
|
+
console.log(' wip-readme-format /path/to/repo --check validate existing README');
|
|
277
|
+
console.log('');
|
|
278
|
+
console.log(' Workflow:');
|
|
279
|
+
console.log(' 1. wip-readme-format /path/to/repo ... generates section files');
|
|
280
|
+
console.log(' 2. Edit any section (e.g. README-init-license.md)');
|
|
281
|
+
console.log(' 3. wip-readme-format /path/to/repo --deploy ... assembles into README.md');
|
|
282
|
+
console.log('');
|
|
283
|
+
console.log(' Section files (in assembly order):');
|
|
284
|
+
console.log(' README-init-badges.md Org header + interface badges');
|
|
285
|
+
console.log(' README-init-title.md Title + tagline');
|
|
286
|
+
console.log(' README-init-teach.md "Teach Your AI" onboarding block');
|
|
287
|
+
console.log(' README-init-features.md Features list');
|
|
288
|
+
console.log(' README-init-coverage.md Interface coverage table (toolbox only)');
|
|
289
|
+
console.log(' README-init-more-info.md Links to docs');
|
|
290
|
+
console.log(' README-init-license.md License block + built-by line');
|
|
291
|
+
console.log(' README-init-technical.md Technical content (becomes TECHNICAL.md)');
|
|
292
|
+
console.log('');
|
|
293
|
+
process.exit(0);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const repoPath = resolve(target);
|
|
297
|
+
if (!existsSync(repoPath)) {
|
|
298
|
+
fail(`Path not found: ${repoPath}`);
|
|
299
|
+
process.exit(1);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const pkg = readJSON(join(repoPath, 'package.json'));
|
|
303
|
+
const { interfaces } = detectInterfaces(repoPath);
|
|
304
|
+
const subTools = detectToolbox(repoPath);
|
|
305
|
+
const isToolbox = subTools.length > 0;
|
|
306
|
+
|
|
307
|
+
// Determine repo URL from package.json
|
|
308
|
+
let repoUrl = null;
|
|
309
|
+
if (pkg?.repository?.url) {
|
|
310
|
+
repoUrl = pkg.repository.url
|
|
311
|
+
.replace('git+', '')
|
|
312
|
+
.replace('.git', '');
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Tool name: human-readable
|
|
316
|
+
const toolName = pkg?.name?.replace(/^@\w+\//, '').replace(/^wip-/, '') || basename(repoPath);
|
|
317
|
+
const ACRONYMS = ['ai', 'api', 'cli', 'mcp', 'os', 'pr', 'ui', 'url', 'devops'];
|
|
318
|
+
const displayName = toolName
|
|
319
|
+
.split('-')
|
|
320
|
+
.map(w => {
|
|
321
|
+
const lower = w.toLowerCase();
|
|
322
|
+
if (ACRONYMS.includes(lower)) return lower === 'devops' ? 'DevOps' : lower.toUpperCase();
|
|
323
|
+
return w.charAt(0).toUpperCase() + w.slice(1);
|
|
324
|
+
})
|
|
325
|
+
.join(' ');
|
|
326
|
+
|
|
327
|
+
const tagline = pkg?.description || '_What it solves in human words. Not what it is technically._';
|
|
328
|
+
|
|
329
|
+
const readmePath = join(repoPath, 'README.md');
|
|
330
|
+
const technicalPath = join(repoPath, 'TECHNICAL.md');
|
|
331
|
+
const existing = extractExistingContent(readmePath);
|
|
332
|
+
|
|
333
|
+
// ── Deploy mode ──
|
|
334
|
+
|
|
335
|
+
if (DEPLOY) {
|
|
336
|
+
console.log('');
|
|
337
|
+
console.log(' wip-readme-format --deploy');
|
|
338
|
+
console.log(` Target: ${repoPath}`);
|
|
339
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
340
|
+
|
|
341
|
+
// Check that at least the badges section exists
|
|
342
|
+
if (!existsSync(initPath(repoPath, 'badges'))) {
|
|
343
|
+
fail('No README-init-*.md files found. Run wip-readme-format first to generate them.');
|
|
344
|
+
process.exit(1);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Safety: init files must be reviewed (committed or modified) before deploy.
|
|
348
|
+
// If all init files are untracked (just generated, never reviewed), block.
|
|
349
|
+
try {
|
|
350
|
+
const { execSync } = await import('node:child_process');
|
|
351
|
+
const initFiles = readdirSync(repoPath).filter(f => f.startsWith('README-init-'));
|
|
352
|
+
const allUntracked = initFiles.every(f => {
|
|
353
|
+
try {
|
|
354
|
+
const status = execSync(`git status --porcelain "${f}"`, { cwd: repoPath, encoding: 'utf8' }).trim();
|
|
355
|
+
return status.startsWith('??');
|
|
356
|
+
} catch { return false; }
|
|
357
|
+
});
|
|
358
|
+
if (allUntracked && initFiles.length > 0) {
|
|
359
|
+
fail('Init files have not been reviewed. They are all untracked (just generated).');
|
|
360
|
+
console.log(' Review the README-init-*.md files, edit as needed, then git add them before deploying.');
|
|
361
|
+
console.log(' Or commit them first so there is a review trail.');
|
|
362
|
+
process.exit(1);
|
|
363
|
+
}
|
|
364
|
+
} catch {}
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
const date = new Date().toISOString().slice(0, 10);
|
|
368
|
+
const aiTrash = join(repoPath, 'ai', '_trash');
|
|
369
|
+
|
|
370
|
+
// Back up existing README.md
|
|
371
|
+
const oldReadme = readFile(readmePath);
|
|
372
|
+
if (oldReadme) {
|
|
373
|
+
if (!existsSync(aiTrash)) mkdirSync(aiTrash, { recursive: true });
|
|
374
|
+
writeFileSync(join(aiTrash, `README--before-format--${date}.md`), oldReadme);
|
|
375
|
+
ok('Backed up README.md to ai/_trash/');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Back up existing TECHNICAL.md
|
|
379
|
+
const oldTech = readFile(technicalPath);
|
|
380
|
+
if (oldTech) {
|
|
381
|
+
if (!existsSync(aiTrash)) mkdirSync(aiTrash, { recursive: true });
|
|
382
|
+
writeFileSync(join(aiTrash, `TECHNICAL--before-format--${date}.md`), oldTech);
|
|
383
|
+
ok('Backed up TECHNICAL.md to ai/_trash/');
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Assemble README from sections in order
|
|
387
|
+
const readmeParts = [];
|
|
388
|
+
for (const section of SECTION_ORDER) {
|
|
389
|
+
const sectionPath = initPath(repoPath, section);
|
|
390
|
+
const content = readFile(sectionPath);
|
|
391
|
+
if (content) {
|
|
392
|
+
readmeParts.push(content.trimEnd());
|
|
393
|
+
unlinkSync(sectionPath);
|
|
394
|
+
ok(` ${section} -> README.md`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (readmeParts.length === 0) {
|
|
399
|
+
fail('No section files found to assemble.');
|
|
400
|
+
process.exit(1);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
writeFileSync(readmePath, readmeParts.join('\n\n') + '\n');
|
|
404
|
+
ok('Assembled README.md');
|
|
405
|
+
|
|
406
|
+
// Move technical -> TECHNICAL.md
|
|
407
|
+
const techPath = initPath(repoPath, 'technical');
|
|
408
|
+
if (existsSync(techPath)) {
|
|
409
|
+
const techContent = readFileSync(techPath, 'utf8');
|
|
410
|
+
writeFileSync(technicalPath, techContent);
|
|
411
|
+
unlinkSync(techPath);
|
|
412
|
+
ok('README-init-technical.md -> TECHNICAL.md');
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
416
|
+
ok('Deployed. Old files in ai/_trash/.\n');
|
|
417
|
+
process.exit(0);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// ── Check mode ──
|
|
421
|
+
|
|
422
|
+
if (CHECK) {
|
|
423
|
+
console.log('');
|
|
424
|
+
console.log(' wip-readme-format --check');
|
|
425
|
+
console.log(` Target: ${repoPath}`);
|
|
426
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
427
|
+
|
|
428
|
+
const content = readFile(readmePath);
|
|
429
|
+
if (!content) {
|
|
430
|
+
fail('No README.md found');
|
|
431
|
+
process.exit(1);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
let passed = true;
|
|
435
|
+
const required = ['teach your ai', 'features', 'more info', 'license'];
|
|
436
|
+
const sectionNames = Object.keys(existing).filter(k => k !== '_preamble');
|
|
437
|
+
|
|
438
|
+
for (const section of required) {
|
|
439
|
+
const found = sectionNames.some(s => s.includes(section));
|
|
440
|
+
if (found) {
|
|
441
|
+
ok(`Has "${section}" section`);
|
|
442
|
+
} else {
|
|
443
|
+
fail(`Missing "${section}" section`);
|
|
444
|
+
passed = false;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (content.includes('img.shields.io/badge/interface')) {
|
|
449
|
+
ok('Has interface badges');
|
|
450
|
+
} else {
|
|
451
|
+
fail('Missing interface badges');
|
|
452
|
+
passed = false;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (isToolbox) {
|
|
456
|
+
if (content.includes('Interface Coverage') || content.includes('interface coverage')) {
|
|
457
|
+
ok('Has interface coverage table');
|
|
458
|
+
} else {
|
|
459
|
+
fail('Missing interface coverage table (toolbox repo)');
|
|
460
|
+
passed = false;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Check for stale staging files
|
|
465
|
+
const stale = SECTION_ORDER.concat(['technical']).filter(s => existsSync(initPath(repoPath, s)));
|
|
466
|
+
if (stale.length > 0) {
|
|
467
|
+
warn(`${stale.length} README-init-*.md file(s) found. Run --deploy to assemble.`);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
471
|
+
if (passed) {
|
|
472
|
+
ok('README follows the standard');
|
|
473
|
+
process.exit(0);
|
|
474
|
+
} else {
|
|
475
|
+
fail('README does not follow the standard');
|
|
476
|
+
process.exit(1);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ── Generate mode (default) ──
|
|
481
|
+
|
|
482
|
+
console.log('');
|
|
483
|
+
console.log(` wip-readme-format${DRY_RUN ? ' (dry run)' : ''}`);
|
|
484
|
+
console.log(` Target: ${repoPath}`);
|
|
485
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
486
|
+
log(`Package: ${pkg?.name || 'unknown'}`);
|
|
487
|
+
log(`Interfaces: ${Object.keys(interfaces).join(', ') || 'none'}`);
|
|
488
|
+
if (isToolbox) log(`Toolbox: ${subTools.length} sub-tools`);
|
|
489
|
+
console.log('');
|
|
490
|
+
|
|
491
|
+
// ── Build each section ──
|
|
492
|
+
|
|
493
|
+
const sections = {};
|
|
494
|
+
|
|
495
|
+
// 1. Badges
|
|
496
|
+
let allInterfaces = { ...interfaces };
|
|
497
|
+
if (isToolbox) {
|
|
498
|
+
for (const tool of subTools) {
|
|
499
|
+
const { interfaces: subIfaces } = detectInterfaces(tool.path);
|
|
500
|
+
for (const key of Object.keys(subIfaces)) {
|
|
501
|
+
if (!allInterfaces[key]) allInterfaces[key] = subIfaces[key];
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
const badges = generateBadges(allInterfaces, repoUrl);
|
|
506
|
+
const specBadge = `[](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-universal-installer/SPEC.md)`;
|
|
507
|
+
const badgeLines = ['###### WIP Computer', ''];
|
|
508
|
+
if (badges) badgeLines.push(badges + ' ' + specBadge);
|
|
509
|
+
else badgeLines.push(specBadge);
|
|
510
|
+
sections.badges = badgeLines.join('\n');
|
|
511
|
+
|
|
512
|
+
// 2. Title + tagline
|
|
513
|
+
sections.title = `# ${displayName}\n\n${tagline}`;
|
|
514
|
+
|
|
515
|
+
// 3. Teach Your AI
|
|
516
|
+
const skillPath = interfaces.skill ? 'SKILL.md' : null;
|
|
517
|
+
if (skillPath || isToolbox) {
|
|
518
|
+
sections.teach = generateTeachBlock(displayName, repoUrl, skillPath);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// 4. Features
|
|
522
|
+
const featureKeys = Object.keys(existing).filter(k =>
|
|
523
|
+
k.includes('features') || k.includes('feature')
|
|
524
|
+
);
|
|
525
|
+
const existingFeatures = featureKeys.length > 0 ? existing[featureKeys[0]] : null;
|
|
526
|
+
|
|
527
|
+
if (existingFeatures) {
|
|
528
|
+
sections.features = `## Features\n\n${existingFeatures}`;
|
|
529
|
+
} else if (isToolbox) {
|
|
530
|
+
const toolFeatures = extractToolboxFeatures(subTools);
|
|
531
|
+
const lines = ['## Features', ''];
|
|
532
|
+
for (const f of toolFeatures) {
|
|
533
|
+
lines.push(`**${f.name}**`);
|
|
534
|
+
lines.push(`- ${f.description}`, '');
|
|
535
|
+
}
|
|
536
|
+
sections.features = lines.join('\n').trimEnd();
|
|
537
|
+
} else {
|
|
538
|
+
sections.features = `## Features\n\n_Describe what this tool does for the user. Human-readable. Name, description, stability tag._`;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// 5. Interface Coverage (toolbox only)
|
|
542
|
+
if (isToolbox) {
|
|
543
|
+
sections.coverage = generateInterfaceTable(repoPath, subTools);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// 6. More Info
|
|
547
|
+
sections['more-info'] = generateMoreInfo(repoPath, repoUrl);
|
|
548
|
+
|
|
549
|
+
// 7. License + built-by
|
|
550
|
+
sections.license = generateLicenseBlock(repoPath) +
|
|
551
|
+
'\n\nBuilt by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code (Claude Opus 4.6).';
|
|
552
|
+
|
|
553
|
+
// 8. Technical (separate file, becomes TECHNICAL.md)
|
|
554
|
+
const techSections = [];
|
|
555
|
+
for (const [name, content] of Object.entries(existing)) {
|
|
556
|
+
if (name === '_preamble') continue;
|
|
557
|
+
if (isTechnicalContent(content)) {
|
|
558
|
+
techSections.push(`## ${name.charAt(0).toUpperCase() + name.slice(1)}\n\n${content}`);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (techSections.length > 0) {
|
|
562
|
+
const existingTech = readFile(technicalPath) || `# ${displayName} ... Technical Documentation\n\n`;
|
|
563
|
+
sections.technical = existingTech.trimEnd() + '\n\n' + techSections.join('\n\n');
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// ── Output ──
|
|
567
|
+
|
|
568
|
+
if (DRY_RUN) {
|
|
569
|
+
for (const section of SECTION_ORDER) {
|
|
570
|
+
if (!sections[section]) continue;
|
|
571
|
+
console.log(` ── README-init-${section}.md ──\n`);
|
|
572
|
+
console.log(sections[section]);
|
|
573
|
+
console.log('');
|
|
574
|
+
}
|
|
575
|
+
if (sections.technical) {
|
|
576
|
+
console.log(` ── README-init-technical.md ──\n`);
|
|
577
|
+
console.log(` (${techSections.length} section(s) extracted from old README)`);
|
|
578
|
+
}
|
|
579
|
+
console.log(`\n ${'─'.repeat(40)}`);
|
|
580
|
+
console.log(' Dry run complete. No files written.\n');
|
|
581
|
+
} else {
|
|
582
|
+
let count = 0;
|
|
583
|
+
for (const section of SECTION_ORDER) {
|
|
584
|
+
if (!sections[section]) continue;
|
|
585
|
+
writeFileSync(initPath(repoPath, section), sections[section] + '\n');
|
|
586
|
+
ok(`README-init-${section}.md`);
|
|
587
|
+
count++;
|
|
588
|
+
}
|
|
589
|
+
if (sections.technical) {
|
|
590
|
+
writeFileSync(initPath(repoPath, 'technical'), sections.technical + '\n');
|
|
591
|
+
ok('README-init-technical.md');
|
|
592
|
+
count++;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
console.log(` ${'─'.repeat(40)}`);
|
|
596
|
+
ok(`${count} section files written. Edit any, then run with --deploy.\n`);
|
|
597
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wipcomputer/wip-readme-format",
|
|
3
|
+
"version": "1.9.15",
|
|
4
|
+
"description": "Reformat any repo's README to follow the WIP Computer standard. Agent-first, human-readable.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"wip-readme-format": "./format.mjs"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT AND AGPL-3.0-or-later",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/wipcomputer/wip-ai-devops-toolbox.git",
|
|
13
|
+
"directory": "tools/wip-readme-format"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 1.2.4 (2026-02-21)
|
|
7
|
+
|
|
8
|
+
Align description across all sources
|
|
9
|
+
|
|
10
|
+
## 1.2.3 (2026-02-21)
|
|
11
|
+
|
|
12
|
+
Fix npm bin entry: remove ./ prefix so npx wip-release works globally
|
|
13
|
+
|
|
14
|
+
## 1.2.2 (2026-02-21)
|
|
15
|
+
|
|
16
|
+
Fix ClawHub display name and slug detection. Harden command injection fix.
|
|
17
|
+
|
|
18
|
+
## 1.2.0 (2026-02-21)
|
|
19
|
+
|
|
20
|
+
Add ClawHub publish as step 9 in release pipeline. Fix command injection by replacing execSync with execFileSync argument arrays. Declare required binaries and secrets in SKILL.md metadata.
|
|
21
|
+
|
|
22
|
+
## 1.1.1 (2026-02-21)
|
|
23
|
+
|
|
24
|
+
Fix npm bin entry: rename cli.mjs to cli.js
|
|
25
|
+
|
|
26
|
+
## 1.1.0 (2026-02-21)
|
|
27
|
+
|
|
28
|
+
Rich release notes, agent-driven install prompt, REFERENCE.md
|
|
29
|
+
|
|
30
|
+
## 1.0.0 (2026-02-21)
|
|
31
|
+
|
|
32
|
+
Initial release. Local release pipeline tool.
|
|
33
|
+
|
|
34
|
+
- `release()` ... full pipeline: bump, changelog, skill sync, commit, tag, publish
|
|
35
|
+
- `detectCurrentVersion()` ... read version from package.json
|
|
36
|
+
- `syncSkillVersion()` ... update SKILL.md frontmatter
|
|
37
|
+
- `updateChangelog()` ... prepend version entry
|
|
38
|
+
- `publishNpm()` ... npm publish via 1Password
|
|
39
|
+
- `publishGitHubPackages()` ... GitHub Packages publish
|
|
40
|
+
- `createGitHubRelease()` ... gh release create
|
|
41
|
+
|
|
42
|
+
CLI: `wip-release patch|minor|major [--notes --dry-run --no-publish]`
|