@wipcomputer/wip-ai-devops-toolbox 1.9.20
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/.license-guard.json +7 -0
- package/.publish-skill.json +4 -0
- package/CHANGELOG.md +1120 -0
- package/CLA.md +19 -0
- package/DEV-GUIDE-GENERAL-PUBLIC.md +882 -0
- package/LICENSE +52 -0
- package/README.md +238 -0
- package/SKILL.md +728 -0
- package/TECHNICAL.md +282 -0
- package/UNIVERSAL-INTERFACE.md +180 -0
- package/_trash/RELEASE-NOTES-v1-8-0.md +29 -0
- package/_trash/RELEASE-NOTES-v1-8-1.md +7 -0
- package/_trash/RELEASE-NOTES-v1-8-2.md +7 -0
- package/_trash/RELEASE-NOTES-v1-9-0.md +37 -0
- package/_trash/RELEASE-NOTES-v1-9-1.md +38 -0
- package/_trash/RELEASE-NOTES-v1-9-10.md +40 -0
- package/_trash/RELEASE-NOTES-v1-9-2.md +40 -0
- package/_trash/RELEASE-NOTES-v1-9-6.md +72 -0
- package/_trash/RELEASE-NOTES-v1-9-7.md +23 -0
- package/_trash/RELEASE-NOTES-v1-9-9.md +75 -0
- package/_trash/guide 2/DEV-GUIDE.md +487 -0
- package/_trash/guide 2/scripts/deploy-public.sh +152 -0
- package/package.json +27 -0
- package/scripts/SKILL-deploy-public.md +61 -0
- package/scripts/SKILL-post-merge-rename.md +47 -0
- package/scripts/deploy-public.sh +264 -0
- package/scripts/post-merge-rename.sh +205 -0
- package/scripts/publish-skill.sh +134 -0
- package/tools/deploy-public/LICENSE +52 -0
- package/tools/deploy-public/README.md +31 -0
- package/tools/deploy-public/SKILL.md +71 -0
- package/tools/deploy-public/deploy-public.sh +264 -0
- package/tools/deploy-public/package.json +9 -0
- package/tools/ldm-jobs/LICENSE +52 -0
- package/tools/ldm-jobs/README.md +46 -0
- package/tools/ldm-jobs/backup.sh +16 -0
- package/tools/ldm-jobs/branch-protect.sh +39 -0
- package/tools/ldm-jobs/crystal-capture.sh +19 -0
- package/tools/ldm-jobs/setup-shell.sh +27 -0
- package/tools/ldm-jobs/visibility-audit.sh +27 -0
- package/tools/post-merge-rename/LICENSE +52 -0
- package/tools/post-merge-rename/README.md +29 -0
- package/tools/post-merge-rename/SKILL.md +57 -0
- package/tools/post-merge-rename/package.json +9 -0
- package/tools/post-merge-rename/post-merge-rename.sh +122 -0
- package/tools/wip-branch-guard/INSTALL.md +41 -0
- package/tools/wip-branch-guard/guard.mjs +259 -0
- package/tools/wip-branch-guard/package.json +11 -0
- package/tools/wip-file-guard/CHANGELOG.md +6 -0
- package/tools/wip-file-guard/LICENSE +52 -0
- package/tools/wip-file-guard/README.md +113 -0
- package/tools/wip-file-guard/REFERENCE.md +86 -0
- package/tools/wip-file-guard/SKILL.md +105 -0
- package/tools/wip-file-guard/guard.mjs +128 -0
- package/tools/wip-file-guard/openclaw.plugin.json +8 -0
- package/tools/wip-file-guard/package.json +27 -0
- package/tools/wip-file-guard/test.sh +119 -0
- package/tools/wip-license-guard/LICENSE +52 -0
- package/tools/wip-license-guard/README.md +32 -0
- package/tools/wip-license-guard/SKILL.md +65 -0
- package/tools/wip-license-guard/cli.mjs +464 -0
- package/tools/wip-license-guard/core.mjs +310 -0
- package/tools/wip-license-guard/hook.mjs +146 -0
- package/tools/wip-license-guard/package.json +15 -0
- package/tools/wip-license-hook/CHANGELOG.md +17 -0
- package/tools/wip-license-hook/LICENSE +52 -0
- package/tools/wip-license-hook/README.md +200 -0
- package/tools/wip-license-hook/SKILL.md +111 -0
- package/tools/wip-license-hook/dist/cli/index.d.ts +15 -0
- package/tools/wip-license-hook/dist/cli/index.js +170 -0
- package/tools/wip-license-hook/dist/cli/index.js.map +1 -0
- package/tools/wip-license-hook/dist/core/detector.d.ts +12 -0
- package/tools/wip-license-hook/dist/core/detector.js +104 -0
- package/tools/wip-license-hook/dist/core/detector.js.map +1 -0
- package/tools/wip-license-hook/dist/core/index.d.ts +4 -0
- package/tools/wip-license-hook/dist/core/index.js +5 -0
- package/tools/wip-license-hook/dist/core/index.js.map +1 -0
- package/tools/wip-license-hook/dist/core/ledger.d.ts +49 -0
- package/tools/wip-license-hook/dist/core/ledger.js +72 -0
- package/tools/wip-license-hook/dist/core/ledger.js.map +1 -0
- package/tools/wip-license-hook/dist/core/reporter.d.ts +14 -0
- package/tools/wip-license-hook/dist/core/reporter.js +227 -0
- package/tools/wip-license-hook/dist/core/reporter.js.map +1 -0
- package/tools/wip-license-hook/dist/core/scanner.d.ts +39 -0
- package/tools/wip-license-hook/dist/core/scanner.js +325 -0
- package/tools/wip-license-hook/dist/core/scanner.js.map +1 -0
- package/tools/wip-license-hook/hooks/pre-pull.sh +55 -0
- package/tools/wip-license-hook/hooks/pre-push.sh +51 -0
- package/tools/wip-license-hook/mcp-server.mjs +119 -0
- package/tools/wip-license-hook/package-lock.json +54 -0
- package/tools/wip-license-hook/package.json +43 -0
- package/tools/wip-license-hook/src/cli/index.ts +189 -0
- package/tools/wip-license-hook/src/core/detector.ts +130 -0
- package/tools/wip-license-hook/src/core/index.ts +4 -0
- package/tools/wip-license-hook/src/core/ledger.ts +116 -0
- package/tools/wip-license-hook/src/core/reporter.ts +255 -0
- package/tools/wip-license-hook/src/core/scanner.ts +367 -0
- package/tools/wip-license-hook/tsconfig.json +16 -0
- package/tools/wip-readme-format/README.md +49 -0
- package/tools/wip-readme-format/SKILL.md +84 -0
- package/tools/wip-readme-format/format.mjs +570 -0
- package/tools/wip-readme-format/package.json +15 -0
- package/tools/wip-release/CHANGELOG.md +42 -0
- package/tools/wip-release/LICENSE +52 -0
- package/tools/wip-release/README.md +45 -0
- package/tools/wip-release/REFERENCE.md +100 -0
- package/tools/wip-release/SKILL.md +139 -0
- package/tools/wip-release/cli.js +161 -0
- package/tools/wip-release/core.mjs +1174 -0
- package/tools/wip-release/mcp-server.mjs +109 -0
- package/tools/wip-release/package.json +36 -0
- package/tools/wip-repo-init/README.md +38 -0
- package/tools/wip-repo-init/SKILL.md +77 -0
- package/tools/wip-repo-init/init.mjs +142 -0
- package/tools/wip-repo-init/package.json +11 -0
- package/tools/wip-repo-permissions-hook/LICENSE +52 -0
- package/tools/wip-repo-permissions-hook/README.md +86 -0
- package/tools/wip-repo-permissions-hook/SKILL.md +73 -0
- package/tools/wip-repo-permissions-hook/cli.js +83 -0
- package/tools/wip-repo-permissions-hook/core.mjs +122 -0
- package/tools/wip-repo-permissions-hook/guard.mjs +64 -0
- package/tools/wip-repo-permissions-hook/mcp-server.mjs +92 -0
- package/tools/wip-repo-permissions-hook/openclaw.plugin.json +8 -0
- package/tools/wip-repo-permissions-hook/package.json +31 -0
- package/tools/wip-repos/LICENSE +52 -0
- package/tools/wip-repos/README.md +77 -0
- package/tools/wip-repos/SKILL.md +80 -0
- package/tools/wip-repos/cli.mjs +176 -0
- package/tools/wip-repos/core.mjs +290 -0
- package/tools/wip-repos/mcp-server.mjs +157 -0
- package/tools/wip-repos/package.json +34 -0
- package/tools/wip-universal-installer/CHANGELOG.md +57 -0
- package/tools/wip-universal-installer/LICENSE +52 -0
- package/tools/wip-universal-installer/README.md +81 -0
- package/tools/wip-universal-installer/REFERENCE.md +122 -0
- package/tools/wip-universal-installer/SKILL.md +87 -0
- package/tools/wip-universal-installer/SPEC.md +180 -0
- package/tools/wip-universal-installer/detect.mjs +130 -0
- package/tools/wip-universal-installer/examples/minimal/README.md +20 -0
- package/tools/wip-universal-installer/examples/minimal/SKILL.md +28 -0
- package/tools/wip-universal-installer/examples/minimal/cli.mjs +4 -0
- package/tools/wip-universal-installer/examples/minimal/core.mjs +8 -0
- package/tools/wip-universal-installer/examples/minimal/mcp-server.mjs +27 -0
- package/tools/wip-universal-installer/examples/minimal/package.json +12 -0
- package/tools/wip-universal-installer/install.js +930 -0
- package/tools/wip-universal-installer/package.json +36 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* wip-repo-permissions-hook/cli.js
|
|
4
|
+
* CLI for repo visibility permissions.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* wip-repo-permissions check <org/repo> Check if repo can be public
|
|
8
|
+
* wip-repo-permissions audit <org> Audit all public repos
|
|
9
|
+
* wip-repo-permissions can-publish <org/repo> Alias for check
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { checkPrivateCounterpart, auditOrg } from './core.mjs';
|
|
13
|
+
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
const command = args[0];
|
|
16
|
+
const target = args[1];
|
|
17
|
+
|
|
18
|
+
function usage() {
|
|
19
|
+
console.log('wip-repo-permissions ... repo visibility guard\n');
|
|
20
|
+
console.log('Usage:');
|
|
21
|
+
console.log(' wip-repo-permissions check <org/repo> Check if repo can be made public');
|
|
22
|
+
console.log(' wip-repo-permissions audit <org> Audit all public repos in org');
|
|
23
|
+
console.log(' wip-repo-permissions can-publish <org/repo> Alias for check');
|
|
24
|
+
console.log('\nExamples:');
|
|
25
|
+
console.log(' wip-repo-permissions check wipcomputer/wip-bridge');
|
|
26
|
+
console.log(' wip-repo-permissions audit wipcomputer');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!command || !target) usage();
|
|
31
|
+
|
|
32
|
+
switch (command) {
|
|
33
|
+
case 'check':
|
|
34
|
+
case 'can-publish': {
|
|
35
|
+
const parts = target.split('/');
|
|
36
|
+
if (parts.length !== 2) {
|
|
37
|
+
console.error('Error: target must be org/repo (e.g. wipcomputer/memory-crystal)');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const [org, repo] = parts;
|
|
41
|
+
const result = checkPrivateCounterpart(org, repo);
|
|
42
|
+
|
|
43
|
+
if (result.allowed) {
|
|
44
|
+
console.log(` OK: ${result.reason}`);
|
|
45
|
+
process.exit(0);
|
|
46
|
+
} else {
|
|
47
|
+
console.error(` ${result.reason}`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
case 'audit': {
|
|
54
|
+
const org = target;
|
|
55
|
+
console.log(`\nAuditing public repos in ${org}...\n`);
|
|
56
|
+
|
|
57
|
+
const { violations, ok } = auditOrg(org);
|
|
58
|
+
|
|
59
|
+
if (ok.length > 0) {
|
|
60
|
+
console.log(` Compliant (${ok.length}):`);
|
|
61
|
+
for (const r of ok) {
|
|
62
|
+
console.log(` OK ${r.name}`);
|
|
63
|
+
}
|
|
64
|
+
console.log('');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (violations.length > 0) {
|
|
68
|
+
console.log(` VIOLATIONS (${violations.length}):`);
|
|
69
|
+
for (const v of violations) {
|
|
70
|
+
console.log(` !! ${v.name} ... no -private counterpart`);
|
|
71
|
+
}
|
|
72
|
+
console.log('');
|
|
73
|
+
console.error(` ${violations.length} repo(s) are public without a -private counterpart.`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
} else {
|
|
76
|
+
console.log(' All public repos have -private counterparts (or are exempt forks).');
|
|
77
|
+
process.exit(0);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
default:
|
|
82
|
+
usage();
|
|
83
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wip-repo-permissions-hook/core.mjs
|
|
3
|
+
* Pure logic for repo visibility permissions.
|
|
4
|
+
* Blocks repos from going public without a -private counterpart.
|
|
5
|
+
* Zero dependencies. Uses gh CLI for GitHub API calls.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { execFileSync } from 'node:child_process';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Check if a repo has a -private counterpart on GitHub.
|
|
12
|
+
* @param {string} org - GitHub org (e.g. "wipcomputer")
|
|
13
|
+
* @param {string} repoName - Repo name (e.g. "memory-crystal")
|
|
14
|
+
* @returns {{ allowed: boolean, reason: string }}
|
|
15
|
+
*/
|
|
16
|
+
export function checkPrivateCounterpart(org, repoName) {
|
|
17
|
+
// If the repo itself IS the private repo, allow
|
|
18
|
+
if (repoName.endsWith('-private')) {
|
|
19
|
+
return { allowed: true, reason: `${repoName} is already a private repo.` };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Check if it's a fork (forks of external projects are exempt)
|
|
23
|
+
const forkStatus = isThirdPartyFork(org, repoName);
|
|
24
|
+
if (forkStatus.isFork) {
|
|
25
|
+
return { allowed: true, reason: `${repoName} is a fork of ${forkStatus.parent}. Forks are exempt.` };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check if -private counterpart exists
|
|
29
|
+
const privateName = `${repoName}-private`;
|
|
30
|
+
try {
|
|
31
|
+
execFileSync('gh', ['api', `repos/${org}/${privateName}`, '--jq', '.name'], {
|
|
32
|
+
encoding: 'utf8',
|
|
33
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
34
|
+
timeout: 10000,
|
|
35
|
+
});
|
|
36
|
+
return { allowed: true, reason: `${privateName} exists. ${repoName} can be public.` };
|
|
37
|
+
} catch {
|
|
38
|
+
return {
|
|
39
|
+
allowed: false,
|
|
40
|
+
reason: `BLOCKED: ${org}/${repoName} cannot be made public. No -private counterpart found (expected ${org}/${privateName}). Create the -private repo first, move all ai/ content there, then make this repo public.`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Check if a repo is a fork of an external project.
|
|
47
|
+
* @param {string} org
|
|
48
|
+
* @param {string} repoName
|
|
49
|
+
* @returns {{ isFork: boolean, parent: string }}
|
|
50
|
+
*/
|
|
51
|
+
export function isThirdPartyFork(org, repoName) {
|
|
52
|
+
try {
|
|
53
|
+
const json = execFileSync('gh', ['api', `repos/${org}/${repoName}`, '--jq', '{fork: .fork, parent: .parent.full_name}'], {
|
|
54
|
+
encoding: 'utf8',
|
|
55
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
56
|
+
timeout: 10000,
|
|
57
|
+
});
|
|
58
|
+
const data = JSON.parse(json);
|
|
59
|
+
if (data.fork && data.parent && !data.parent.startsWith(`${org}/`)) {
|
|
60
|
+
return { isFork: true, parent: data.parent };
|
|
61
|
+
}
|
|
62
|
+
return { isFork: false, parent: '' };
|
|
63
|
+
} catch {
|
|
64
|
+
return { isFork: false, parent: '' };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Audit all public repos in an org for missing -private counterparts.
|
|
70
|
+
* @param {string} org
|
|
71
|
+
* @returns {{ violations: Array<{name: string, reason: string}>, ok: Array<{name: string, reason: string}> }}
|
|
72
|
+
*/
|
|
73
|
+
export function auditOrg(org) {
|
|
74
|
+
// Get all public repos
|
|
75
|
+
let repos;
|
|
76
|
+
try {
|
|
77
|
+
const json = execFileSync('gh', [
|
|
78
|
+
'repo', 'list', org,
|
|
79
|
+
'--visibility', 'public',
|
|
80
|
+
'--json', 'name',
|
|
81
|
+
'--limit', '200',
|
|
82
|
+
], { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30000 });
|
|
83
|
+
repos = JSON.parse(json);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
throw new Error(`Failed to list repos for ${org}: ${e.message}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const violations = [];
|
|
89
|
+
const ok = [];
|
|
90
|
+
|
|
91
|
+
for (const repo of repos) {
|
|
92
|
+
const result = checkPrivateCounterpart(org, repo.name);
|
|
93
|
+
if (result.allowed) {
|
|
94
|
+
ok.push({ name: repo.name, reason: result.reason });
|
|
95
|
+
} else {
|
|
96
|
+
violations.push({ name: repo.name, reason: result.reason });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return { violations, ok };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Extract repo org/name from a gh command string.
|
|
105
|
+
* Looks for patterns like: gh repo edit wipcomputer/repo-name --visibility public
|
|
106
|
+
* @param {string} command
|
|
107
|
+
* @returns {{ org: string, repo: string, isVisibilityChange: boolean } | null}
|
|
108
|
+
*/
|
|
109
|
+
export function parseVisibilityCommand(command) {
|
|
110
|
+
// Match: gh repo edit <org/repo> ... --visibility public
|
|
111
|
+
const editMatch = command.match(/gh\s+repo\s+edit\s+([^\s]+)/);
|
|
112
|
+
if (!editMatch) return null;
|
|
113
|
+
|
|
114
|
+
const visibilityMatch = command.match(/--visibility\s+(public|private|internal)/);
|
|
115
|
+
if (!visibilityMatch || visibilityMatch[1] !== 'public') return null;
|
|
116
|
+
|
|
117
|
+
const slug = editMatch[1];
|
|
118
|
+
const parts = slug.split('/');
|
|
119
|
+
if (parts.length !== 2) return null;
|
|
120
|
+
|
|
121
|
+
return { org: parts[0], repo: parts[1], isVisibilityChange: true };
|
|
122
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* wip-repo-permissions-hook/guard.mjs
|
|
4
|
+
* PreToolUse:Bash hook for Claude Code.
|
|
5
|
+
* Blocks `gh repo edit --visibility public` unless -private counterpart exists.
|
|
6
|
+
* Same pattern as wip-file-guard/guard.mjs.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { parseVisibilityCommand, checkPrivateCounterpart } from './core.mjs';
|
|
10
|
+
|
|
11
|
+
function deny(reason) {
|
|
12
|
+
const output = {
|
|
13
|
+
hookSpecificOutput: {
|
|
14
|
+
hookEventName: 'PreToolUse',
|
|
15
|
+
permissionDecision: 'deny',
|
|
16
|
+
permissionDecisionReason: reason,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
process.stdout.write(JSON.stringify(output));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function main() {
|
|
23
|
+
let raw = '';
|
|
24
|
+
for await (const chunk of process.stdin) {
|
|
25
|
+
raw += chunk;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let input;
|
|
29
|
+
try {
|
|
30
|
+
input = JSON.parse(raw);
|
|
31
|
+
} catch {
|
|
32
|
+
// Can't parse input, allow by default
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const toolName = input.tool_name || '';
|
|
37
|
+
const toolInput = input.tool_input || {};
|
|
38
|
+
|
|
39
|
+
// Only check Bash commands
|
|
40
|
+
if (toolName !== 'Bash') {
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const command = toolInput.command || '';
|
|
45
|
+
|
|
46
|
+
// Only check commands that look like visibility changes
|
|
47
|
+
const parsed = parseVisibilityCommand(command);
|
|
48
|
+
if (!parsed) {
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Check if the repo can be made public
|
|
53
|
+
const result = checkPrivateCounterpart(parsed.org, parsed.repo);
|
|
54
|
+
|
|
55
|
+
if (!result.allowed) {
|
|
56
|
+
deny(result.reason);
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Allowed
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
main().catch(() => process.exit(0));
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// wip-repo-permissions-hook/mcp-server.mjs
|
|
3
|
+
// MCP server exposing repo visibility guard as tools.
|
|
4
|
+
// Wraps core.mjs. Registered via .mcp.json.
|
|
5
|
+
|
|
6
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import {
|
|
10
|
+
checkPrivateCounterpart, auditOrg,
|
|
11
|
+
} from './core.mjs';
|
|
12
|
+
|
|
13
|
+
const server = new Server(
|
|
14
|
+
{ name: 'wip-repo-permissions', version: '1.0.0' },
|
|
15
|
+
{ capabilities: { tools: {} } }
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
// ── Tool Definitions ──
|
|
19
|
+
|
|
20
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
21
|
+
tools: [
|
|
22
|
+
{
|
|
23
|
+
name: 'repo_permissions_check',
|
|
24
|
+
description: 'Check if a repo has a -private counterpart on GitHub. Required before making any repo public.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
org: { type: 'string', description: 'GitHub org (e.g. wipcomputer)' },
|
|
29
|
+
repo: { type: 'string', description: 'Repo name (e.g. memory-crystal)' },
|
|
30
|
+
},
|
|
31
|
+
required: ['org', 'repo'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'repo_permissions_audit',
|
|
36
|
+
description: 'Audit all public repos in a GitHub org for missing -private counterparts. Returns violations and passing repos.',
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
org: { type: 'string', description: 'GitHub org (e.g. wipcomputer)' },
|
|
41
|
+
},
|
|
42
|
+
required: ['org'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
// ── Tool Handlers ──
|
|
49
|
+
|
|
50
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
51
|
+
const { name, arguments: args } = req.params;
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
if (name === 'repo_permissions_check') {
|
|
55
|
+
const result = checkPrivateCounterpart(args.org, args.repo);
|
|
56
|
+
return {
|
|
57
|
+
content: [{
|
|
58
|
+
type: 'text',
|
|
59
|
+
text: `${result.allowed ? 'ALLOWED' : 'BLOCKED'}: ${result.reason}`,
|
|
60
|
+
}],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (name === 'repo_permissions_audit') {
|
|
65
|
+
const result = auditOrg(args.org);
|
|
66
|
+
const lines = [];
|
|
67
|
+
if (result.violations.length > 0) {
|
|
68
|
+
lines.push(`${result.violations.length} violation(s):`);
|
|
69
|
+
for (const v of result.violations) {
|
|
70
|
+
lines.push(` BLOCKED: ${v.name} - ${v.reason}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
lines.push(`${result.ok.length} repo(s) OK.`);
|
|
74
|
+
return {
|
|
75
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
81
|
+
isError: true,
|
|
82
|
+
};
|
|
83
|
+
} catch (err) {
|
|
84
|
+
return {
|
|
85
|
+
content: [{ type: 'text', text: `Error: ${err.message}` }],
|
|
86
|
+
isError: true,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const transport = new StdioServerTransport();
|
|
92
|
+
await server.connect(transport);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wip-repo-permissions-hook",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Blocks repos from going public without a -private counterpart. Protects internal plans, todos, and dev context from exposure.",
|
|
5
|
+
"lifecycle": {
|
|
6
|
+
"before_tool_use": "./guard.mjs"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wipcomputer/wip-repo-permissions-hook",
|
|
3
|
+
"version": "1.9.20",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Repo visibility guard. Blocks repos from going public without a -private counterpart.",
|
|
6
|
+
"main": "core.mjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"wip-repo-permissions": "./cli.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "bash test.sh"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"claude-code",
|
|
15
|
+
"openclaw",
|
|
16
|
+
"hook",
|
|
17
|
+
"repo-guard",
|
|
18
|
+
"visibility",
|
|
19
|
+
"ai-safety",
|
|
20
|
+
"pretooluse"
|
|
21
|
+
],
|
|
22
|
+
"author": "Parker Todd Brooks",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/wipcomputer/wip-ai-devops-toolbox.git"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Dual License: MIT + AGPLv3
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WIP Computer, Inc.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
1. MIT License (local and personal use)
|
|
7
|
+
---------------------------------------
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
2. GNU Affero General Public License v3.0 (commercial and cloud use)
|
|
29
|
+
--------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
If you run this software as part of a hosted service, cloud platform,
|
|
32
|
+
marketplace listing, or any network-accessible offering for commercial
|
|
33
|
+
purposes, the AGPLv3 terms apply. You must either:
|
|
34
|
+
|
|
35
|
+
a) Release your complete source code under AGPLv3, or
|
|
36
|
+
b) Obtain a commercial license.
|
|
37
|
+
|
|
38
|
+
This program is free software: you can redistribute it and/or modify
|
|
39
|
+
it under the terms of the GNU Affero General Public License as published
|
|
40
|
+
by the Free Software Foundation, either version 3 of the License, or
|
|
41
|
+
(at your option) any later version.
|
|
42
|
+
|
|
43
|
+
This program is distributed in the hope that it will be useful,
|
|
44
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
45
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
46
|
+
GNU Affero General Public License for more details.
|
|
47
|
+
|
|
48
|
+
You should have received a copy of the GNU Affero General Public License
|
|
49
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
AGPLv3 for personal use is free. Commercial licenses available.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
###### WIP Computer
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@wipcomputer/wip-repos) [](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-repos/cli.mjs) [](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-repos/mcp-server.mjs) [](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-repos/SKILL.md) [](https://github.com/wipcomputer/wip-ai-devops-toolbox/blob/main/tools/wip-universal-installer/SPEC.md)
|
|
4
|
+
|
|
5
|
+
# wip-repos
|
|
6
|
+
|
|
7
|
+
Repo manifest reconciler. Single source of truth for repo organization.
|
|
8
|
+
|
|
9
|
+
## The Problem
|
|
10
|
+
|
|
11
|
+
You have 50 repos. Someone moves a folder. The README drifts. The manifest drifts. Your AI agent references a path that doesn't exist anymore. Everyone wastes time.
|
|
12
|
+
|
|
13
|
+
## The Solution
|
|
14
|
+
|
|
15
|
+
`repos-manifest.json` is the single source of truth. The filesystem adapts to it. Like prettier for folder structure.
|
|
16
|
+
|
|
17
|
+
Move folders around all day. On sync, everything snaps back to where the manifest says it belongs. Want to change the structure? PR to the manifest. Org owner approves or rejects. Rejected? Your folders snap back on next sync.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Check for drift between filesystem and manifest
|
|
23
|
+
wip-repos check
|
|
24
|
+
|
|
25
|
+
# See what sync would do
|
|
26
|
+
wip-repos sync --dry-run
|
|
27
|
+
|
|
28
|
+
# Actually move folders to match manifest
|
|
29
|
+
wip-repos sync
|
|
30
|
+
|
|
31
|
+
# Add a new repo
|
|
32
|
+
wip-repos add ldm-os/utilities/my-tool --remote wipcomputer/my-tool
|
|
33
|
+
|
|
34
|
+
# Move a repo to a different category
|
|
35
|
+
wip-repos move ldm-os/utilities/my-tool --to ldm-os/devops/my-tool
|
|
36
|
+
|
|
37
|
+
# Generate directory tree from manifest
|
|
38
|
+
wip-repos tree
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Options
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
--manifest Path to repos-manifest.json (default: ./repos-manifest.json)
|
|
45
|
+
--root Path to repos root directory (default: directory containing manifest)
|
|
46
|
+
--dry-run Show what would happen without making changes
|
|
47
|
+
--json Output as JSON
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## How It Works
|
|
51
|
+
|
|
52
|
+
1. **check** walks the filesystem, finds all git repos, compares against the manifest. Reports what's on disk but not in manifest, and what's in manifest but not on disk. Exit code 1 if drift detected.
|
|
53
|
+
|
|
54
|
+
2. **sync** matches repos by their git remote URL. If a repo's remote matches a manifest entry but it's at the wrong path, sync moves it to the manifest path.
|
|
55
|
+
|
|
56
|
+
3. **add/move** update the manifest file. The actual folder moves happen on the next `sync`.
|
|
57
|
+
|
|
58
|
+
## Integration
|
|
59
|
+
|
|
60
|
+
- `deploy-public` and `wip-release` can call `wip-repos check` before running. Stale manifest blocks deploys.
|
|
61
|
+
- CI: run `wip-repos check` as a PR check. Drift = blocked merge.
|
|
62
|
+
- README generation: `wip-repos tree` outputs a directory tree from the manifest.
|
|
63
|
+
|
|
64
|
+
## Source
|
|
65
|
+
|
|
66
|
+
Pure JavaScript. Zero dependencies. `core.mjs` (logic), `cli.mjs` (CLI). No build step.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
CLI, MCP server, module MIT (use anywhere, no restrictions)
|
|
72
|
+
Hosted or cloud service use AGPL (network service distribution)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
AGPL for personal use is free.
|
|
76
|
+
|
|
77
|
+
Built by Parker Todd Brooks, Lēsa (OpenClaw, Claude Opus 4.6), Claude Code (Claude Opus 4.6).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wip-repos
|
|
3
|
+
description: Repo manifest reconciler. Makes repos-manifest.json the single source of truth for repo organization.
|
|
4
|
+
license: MIT
|
|
5
|
+
interface: [cli, module, mcp]
|
|
6
|
+
metadata:
|
|
7
|
+
display-name: "Repo Manifest Reconciler"
|
|
8
|
+
version: "0.1.0"
|
|
9
|
+
homepage: "https://github.com/wipcomputer/wip-ai-devops-toolbox"
|
|
10
|
+
author: "Parker Todd Brooks"
|
|
11
|
+
category: dev-tools
|
|
12
|
+
capabilities:
|
|
13
|
+
- manifest-check
|
|
14
|
+
- filesystem-sync
|
|
15
|
+
- repo-add
|
|
16
|
+
- repo-move
|
|
17
|
+
- tree-generation
|
|
18
|
+
requires:
|
|
19
|
+
bins: [node, git]
|
|
20
|
+
openclaw:
|
|
21
|
+
requires:
|
|
22
|
+
bins: [node, git]
|
|
23
|
+
install:
|
|
24
|
+
- id: node
|
|
25
|
+
kind: node
|
|
26
|
+
package: "@wipcomputer/wip-repos"
|
|
27
|
+
bins: [wip-repos]
|
|
28
|
+
label: "Install via npm"
|
|
29
|
+
emoji: "📂"
|
|
30
|
+
compatibility: Requires git, node. Node.js 18+.
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# wip-repos
|
|
34
|
+
|
|
35
|
+
Repo manifest reconciler. Like prettier for folder structure. Move folders around all day; on sync, everything snaps back to where the manifest says.
|
|
36
|
+
|
|
37
|
+
## When to Use This Skill
|
|
38
|
+
|
|
39
|
+
**Use wip-repos for:**
|
|
40
|
+
- Checking if the filesystem matches the manifest (`check`)
|
|
41
|
+
- Moving repos to match the manifest (`sync`)
|
|
42
|
+
- Adding a new repo to the manifest (`add`)
|
|
43
|
+
- Moving a repo in the manifest (`move`)
|
|
44
|
+
- Generating a directory tree from the manifest (`tree`)
|
|
45
|
+
|
|
46
|
+
**Use after:**
|
|
47
|
+
- Cloning a new repo
|
|
48
|
+
- Moving repos between categories
|
|
49
|
+
- Adding new repos to the org
|
|
50
|
+
|
|
51
|
+
### Do NOT Use For
|
|
52
|
+
|
|
53
|
+
- Git operations (use git directly)
|
|
54
|
+
- Repo creation on GitHub (use gh)
|
|
55
|
+
|
|
56
|
+
## API Reference
|
|
57
|
+
|
|
58
|
+
### CLI
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
wip-repos check # diff filesystem vs manifest
|
|
62
|
+
wip-repos sync --dry-run # preview moves
|
|
63
|
+
wip-repos sync # execute moves
|
|
64
|
+
wip-repos add ldm-os/utilities/new-tool --remote wipcomputer/new-tool
|
|
65
|
+
wip-repos move ldm-os/utilities/tool --to ldm-os/devops/tool
|
|
66
|
+
wip-repos tree # generate directory tree
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Module
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import { check, planSync, addRepo, moveRepo, generateReadmeTree } from '@wipcomputer/wip-repos';
|
|
73
|
+
|
|
74
|
+
const result = check('/path/to/manifest.json', '/path/to/repos/');
|
|
75
|
+
const moves = planSync('/path/to/manifest.json', '/path/to/repos/');
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### MCP
|
|
79
|
+
|
|
80
|
+
Tools: `repos_check`, `repos_sync_plan`, `repos_add`, `repos_move`, `repos_tree`
|