@pazmo/ai-workflow-kit 3.0.2 → 3.0.3
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/README.md +17 -2
- package/bin/ai-workflow-kit.mjs +18 -0
- package/package.json +1 -1
- package/src/git-visibility.mjs +59 -0
package/README.md
CHANGED
|
@@ -185,6 +185,21 @@ AGENTS.md · CLAUDE.md 정해진 표시 사이에 짧은 규칙 블록 (바
|
|
|
185
185
|
templates/ai-workflow/ 합의서 · 작업 조각 서식
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
### 설치 후 한 번 확인하세요
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
npx @pazmo/ai-workflow-kit doctor
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
자바 계열 저장소에는 `.gitignore`에 `bin/` 규칙이 흔히 들어 있습니다. 이게 **검사기(`.ai-workflow/bin/check.mjs`)를 통째로 삼킵니다.** 파일은 디스크에 멀쩡히 있는데 `git add`가 말없이 건너뛰어서, 저장소를 받는 사람에게는 검사기가 없습니다.
|
|
195
|
+
|
|
196
|
+
`init`과 `doctor`가 이걸 잡아내고 고칠 줄을 알려줍니다:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
MISS Checker reaches git: .gitignore:21:bin/
|
|
200
|
+
Fix: add "!.ai-workflow/bin/" to .gitignore, below the rule above.
|
|
201
|
+
```
|
|
202
|
+
|
|
188
203
|
한쪽 도구만 쓴다면:
|
|
189
204
|
|
|
190
205
|
```bash
|
|
@@ -243,14 +258,14 @@ ai-workflow-kit remove # 제거
|
|
|
243
258
|
## 개발
|
|
244
259
|
|
|
245
260
|
```bash
|
|
246
|
-
npm test #
|
|
261
|
+
npm test # 39 checks
|
|
247
262
|
npm pack # 로컬 tarball
|
|
248
263
|
```
|
|
249
264
|
|
|
250
265
|
로컬 tarball로 시험 설치:
|
|
251
266
|
|
|
252
267
|
```bash
|
|
253
|
-
npx --package ./pazmo-ai-workflow-kit-3.0.
|
|
268
|
+
npx --package ./pazmo-ai-workflow-kit-3.0.3.tgz ai-workflow-kit init
|
|
254
269
|
```
|
|
255
270
|
|
|
256
271
|
배포는 scope 소유자 인증 후:
|
package/bin/ai-workflow-kit.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { checkArtifact, checkGate } from '../assets/check.mjs';
|
|
6
6
|
import { installWorkflow, removeWorkflow } from '../src/install.mjs';
|
|
7
|
+
import { checkerVisibility, ignoredCheckerAdvice } from '../src/git-visibility.mjs';
|
|
7
8
|
import { END_MARKER, START_MARKER } from '../src/managed-block.mjs';
|
|
8
9
|
import { HOSTS } from '../src/paths.mjs';
|
|
9
10
|
|
|
@@ -90,6 +91,16 @@ async function doctor(root) {
|
|
|
90
91
|
console.log(`${present ? 'PASS' : 'MISS'} ${label}: ${relative}`);
|
|
91
92
|
ok &&= present;
|
|
92
93
|
}
|
|
94
|
+
|
|
95
|
+
const visibility = await checkerVisibility(root);
|
|
96
|
+
if (visibility.status === 'ignored') {
|
|
97
|
+
console.log(`MISS Checker reaches git: ${visibility.source}`);
|
|
98
|
+
for (const line of ignoredCheckerAdvice(visibility)) console.log(` ${line}`);
|
|
99
|
+
ok = false;
|
|
100
|
+
} else if (visibility.status !== 'no-git') {
|
|
101
|
+
console.log('PASS Checker reaches git: .ai-workflow/bin/check.mjs');
|
|
102
|
+
}
|
|
103
|
+
|
|
93
104
|
return ok;
|
|
94
105
|
}
|
|
95
106
|
|
|
@@ -112,6 +123,13 @@ async function main(argv) {
|
|
|
112
123
|
console.log(result.changed ? 'Installed/updated AI Workflow Kit.' : 'AI Workflow Kit is already up to date.');
|
|
113
124
|
console.log(`Hosts: ${result.hosts.join(', ')}`);
|
|
114
125
|
if (result.preserved.length) console.log(`Preserved modified files: ${result.preserved.join(', ')}`);
|
|
126
|
+
const visibility = await checkerVisibility(root);
|
|
127
|
+
if (visibility.status === 'ignored') {
|
|
128
|
+
console.log('');
|
|
129
|
+
console.log('WARNING');
|
|
130
|
+
for (const line of ignoredCheckerAdvice(visibility)) console.log(` ${line}`);
|
|
131
|
+
console.log('');
|
|
132
|
+
}
|
|
115
133
|
if (result.hosts.includes('claude')) console.log('Next (Claude Code): /workflow <request>');
|
|
116
134
|
if (result.hosts.includes('codex')) console.log('Next (Codex): $workflow <request>');
|
|
117
135
|
return 0;
|
package/package.json
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
export const CHECKER_PATH = '.ai-workflow/bin/check.mjs';
|
|
4
|
+
export const GITIGNORE_EXCEPTION = '!.ai-workflow/bin/';
|
|
5
|
+
|
|
6
|
+
function git(args, cwd) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
let child;
|
|
9
|
+
try {
|
|
10
|
+
child = spawn('git', args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
11
|
+
} catch {
|
|
12
|
+
resolve({ code: null, stdout: '' });
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
let stdout = '';
|
|
16
|
+
child.stdout.on('data', (chunk) => { stdout += chunk; });
|
|
17
|
+
child.stderr.on('data', () => {});
|
|
18
|
+
child.on('error', () => resolve({ code: null, stdout: '' }));
|
|
19
|
+
child.on('close', (code) => resolve({ code, stdout }));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Whether the gate checker can actually reach the repository.
|
|
25
|
+
*
|
|
26
|
+
* A checker sitting on disk that `git add` silently skips is the worst kind of
|
|
27
|
+
* install: every file-existence check passes and the gates still cannot be
|
|
28
|
+
* enforced for anyone who clones. Common Java and build .gitignore templates
|
|
29
|
+
* carry a bare `bin/` rule, which swallows `.ai-workflow/bin/` along with it.
|
|
30
|
+
*
|
|
31
|
+
* Returns one of:
|
|
32
|
+
* { status: 'tracked' } already committed, so no rule can hide it
|
|
33
|
+
* { status: 'visible' } not ignored
|
|
34
|
+
* { status: 'ignored', source } source is "<file>:<line>:<pattern>"
|
|
35
|
+
* { status: 'no-git' } no git, or not a work tree — nothing to say
|
|
36
|
+
*/
|
|
37
|
+
export async function checkerVisibility(root) {
|
|
38
|
+
const inside = await git(['rev-parse', '--is-inside-work-tree'], root);
|
|
39
|
+
if (inside.code !== 0 || inside.stdout.trim() !== 'true') return { status: 'no-git' };
|
|
40
|
+
|
|
41
|
+
const tracked = await git(['ls-files', '--error-unmatch', '--', CHECKER_PATH], root);
|
|
42
|
+
if (tracked.code === 0) return { status: 'tracked' };
|
|
43
|
+
|
|
44
|
+
const ignored = await git(['check-ignore', '-v', '--', CHECKER_PATH], root);
|
|
45
|
+
if (ignored.code !== 0) return { status: 'visible' };
|
|
46
|
+
|
|
47
|
+
const first = ignored.stdout.split('\n')[0] ?? '';
|
|
48
|
+
const source = first.split('\t')[0].trim();
|
|
49
|
+
return { status: 'ignored', source: source || 'a .gitignore rule' };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function ignoredCheckerAdvice({ source }) {
|
|
53
|
+
return [
|
|
54
|
+
`${source} hides ${CHECKER_PATH} from git.`,
|
|
55
|
+
`The file is on disk, but \`git add\` skips it without a word, so the gate`,
|
|
56
|
+
`checker never reaches anyone who clones this repository.`,
|
|
57
|
+
`Fix: add "${GITIGNORE_EXCEPTION}" to .gitignore, below the rule above.`,
|
|
58
|
+
];
|
|
59
|
+
}
|