@kybird/llm-wiki 0.2.0
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 +21 -0
- package/README.md +168 -0
- package/TROUBLESHOOTING.md +103 -0
- package/bin/llm-wiki.js +102 -0
- package/lib/find-doc-root.js +93 -0
- package/lib/find-qmd.js +52 -0
- package/lib/init.js +236 -0
- package/lib/kanban-cmd.js +828 -0
- package/lib/kanban.js +363 -0
- package/lib/wiki-compile.js +362 -0
- package/lib/wiki-lint.js +272 -0
- package/lib/wiki-search.js +186 -0
- package/package.json +40 -0
- package/skills/kanban-plan/SKILL.md +71 -0
- package/skills/wiki-compile/SKILL.md +115 -0
- package/skills/wiki-lint/SKILL.md +57 -0
- package/skills/wiki-log/SKILL.md +157 -0
- package/skills/wiki-search/SKILL.md +39 -0
- package/skills/work-loop/SKILL.md +88 -0
- package/templates/doc/raw/.gitkeep +2 -0
- package/templates/doc/wiki/index.md +36 -0
- package/templates/githooks/pre-commit +77 -0
- package/templates/scripts/sync_agent_docs.bat +33 -0
- package/templates/scripts/sync_agent_docs.sh +25 -0
- package/templates/scripts/sync_skills.bat +26 -0
- package/templates/scripts/sync_skills.sh +40 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: work-loop
|
|
3
|
+
description: Unattended kanban loop — pick a card, resolve it with objective evidence, park judgment calls and move on. Board is the only task list; converge, don't diverge.
|
|
4
|
+
skill-version: 4
|
|
5
|
+
---
|
|
6
|
+
# When to use
|
|
7
|
+
|
|
8
|
+
- A **dedicated unattended session** — user said "루프 돌려" (run the loop) before sleep,
|
|
9
|
+
or a host scheduler started this session at off-peak. The board is the task list; there
|
|
10
|
+
is no competing native todo here.
|
|
11
|
+
- Not for ordinary interactive sessions — those should just use `llm-wiki search` and the
|
|
12
|
+
wiki skills.
|
|
13
|
+
|
|
14
|
+
# Trigger (no daemon — plan.md 4.4)
|
|
15
|
+
|
|
16
|
+
1. Primary: a human asks, the session runs this skill until the stop rule fires.
|
|
17
|
+
2. Secondary: a host-level scheduler (e.g. ZCode 예약) starts the session at midnight.
|
|
18
|
+
3. Never build or assume a process supervisor. The loop lives in the session; the board
|
|
19
|
+
lives in files.
|
|
20
|
+
|
|
21
|
+
# Loop graph
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
pick → work → 판정 ─ done / handoff / abandon / supersede
|
|
25
|
+
↑ │
|
|
26
|
+
└────── next card ←───┘
|
|
27
|
+
집을 카드 없음 → review(대기) 큐 점검 → 전부 대기면 질문을 모아 정지 (반스래시)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
# Rules (all six are load-bearing)
|
|
31
|
+
|
|
32
|
+
0. **Condition-gated cards.** Some cards must not start yet:
|
|
33
|
+
- `not_before: YYYY-MM-DD` in frontmatter (future date) — `pick` skips them
|
|
34
|
+
automatically; you never see them. Don't try to work around the gate.
|
|
35
|
+
- A card parked in `review` whose Handoff states an **activation condition**
|
|
36
|
+
(e.g. "수렴 데이터 7일 축적 후") — while walking the review queue, you may
|
|
37
|
+
evaluate the condition yourself, but only with objective evidence (`board report`
|
|
38
|
+
numbers, activity.jsonl, repo state). If it holds, `llm-wiki resume <제목>
|
|
39
|
+
--note "조건 충족: <근거>"` sends it back to todo. If not, leave it parked.
|
|
40
|
+
Never resume on vibes. The gate exists so divergence waits its turn.
|
|
41
|
+
|
|
42
|
+
1. **Judgment = closed list.** Only these four go to `handoff`: ① spec decisions
|
|
43
|
+
② credentials or outward-facing actions ③ judgment-call merge conflicts
|
|
44
|
+
④ repeatedly failing tests you cannot diagnose. Everything else — naming, structure,
|
|
45
|
+
implementation details, test approach — you decide yourself. Opening the list wider
|
|
46
|
+
produces chronic park-avoidance in the other direction: an empty done/ pile.
|
|
47
|
+
|
|
48
|
+
2. **Blocked ≠ stopped.** When a card hits the judgment list, `llm-wiki handoff <제목>
|
|
49
|
+
--question "…"` and immediately pick the next card. Never wait for session approval —
|
|
50
|
+
this session runs unattended (plan.md 2.1: 승인 대기 = 오프피크 낭비). The question is
|
|
51
|
+
a record made at the wall, not a pre-work approval request — 무인 세션에는 시작 전에
|
|
52
|
+
물어볼 상대가 없고, 질문은 밤새 대기 큐에 모여 아침에 일괄 답한다.
|
|
53
|
+
|
|
54
|
+
3. **AC by objective evidence only.** Check an AC (`card edit --check-ac N`) because you
|
|
55
|
+
ran something that proves it — command output, passing test, diff — never because the
|
|
56
|
+
code "looks right". `done --result` answers exactly two things: 무엇을 바꿨고, 무엇으로
|
|
57
|
+
검증했는가. The QA pass (below) reverts fake dones.
|
|
58
|
+
|
|
59
|
+
4. **Stop rule.** `pick` returns "No pickable card": check the board's review queue.
|
|
60
|
+
If everything is parked, run `llm-wiki board report` **and** `llm-wiki board video`
|
|
61
|
+
(보고서와 함께 세션 타임랩스 영상을 남긴다 — 아침의 사람이 40초로 밤을 본다),
|
|
62
|
+
leave the questions in one place, and STOP. Do not invent new cards to look
|
|
63
|
+
productive. 밤새 카드가 300장이 되는 것이 이 시스템이 죽는 방식이다 (plan.md 2.3).
|
|
64
|
+
|
|
65
|
+
5. **Search before work.** `llm-wiki search "<keywords>"` before starting a card. If the
|
|
66
|
+
wall you are about to hit already has an abandoned card or an anti-pattern page, skip
|
|
67
|
+
or supersede — same wall twice in one night is the failure the wiki exists to prevent.
|
|
68
|
+
|
|
69
|
+
6. **Renew the claim.** A claim expires (board.yml `claim_timeout_minutes`, default 1h).
|
|
70
|
+
On a long card, `llm-wiki card edit <제목> --renew-claim` before the timeout, or
|
|
71
|
+
another loop instance will reclaim the card under you.
|
|
72
|
+
|
|
73
|
+
# Splitting (supersede) — divergence guard
|
|
74
|
+
|
|
75
|
+
Supersede only when each child is **strictly smaller** than the parent in context needed.
|
|
76
|
+
Guideline while the convergence data is still being collected: card depth ≤ 3, one card =
|
|
77
|
+
one context = one commit. `llm-wiki supersede <부모> --by 자식1,자식2` — the parent
|
|
78
|
+
dissolves; its history stays in `superseded/`.
|
|
79
|
+
|
|
80
|
+
# QA pass (개선계획 4.3)
|
|
81
|
+
|
|
82
|
+
Run at the end of the night, or in a separate morning session:
|
|
83
|
+
|
|
84
|
+
- Walk recent `doc/kanban/done/` cards newest-first. For each: does `Result` state a real
|
|
85
|
+
verification, and are checked ACs backed by evidence in Notes or the diff?
|
|
86
|
+
- Evidence-thin → `llm-wiki reopen <제목> --why "…"` (reverts to doing). A temporary
|
|
87
|
+
increase in card count is the price of a real convergence curve (plan.md 2.4).
|
|
88
|
+
- `llm-wiki board report` shows the revert count — reverts are signal, not shame.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [index]
|
|
3
|
+
|
|
4
|
+
# Wiki Index
|
|
5
|
+
|
|
6
|
+
이 프로젝트의 구조화된 지식 베이스입니다. `doc/raw/` 로그에서 추출한 핵심 개념과 패턴을 정리했습니다.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Concepts
|
|
11
|
+
|
|
12
|
+
| 개념 | 설명 |
|
|
13
|
+
|------|------|
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Patterns
|
|
18
|
+
|
|
19
|
+
| 패턴 | 설명 |
|
|
20
|
+
|------|------|
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Anti-Patterns
|
|
25
|
+
|
|
26
|
+
| 안티패턴 | 설명 |
|
|
27
|
+
|------|------|
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Statistics
|
|
32
|
+
|
|
33
|
+
- Total concepts: 0
|
|
34
|
+
- Total patterns: 0
|
|
35
|
+
- Total anti-patterns: 0
|
|
36
|
+
- Last updated: never
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# llm-wiki-template-version: 1 — 이 줄이 살아있으면 `llm-wiki init`이 정본(templates/)으로 갱신하고,
|
|
3
|
+
# 지워져 있으면 사용자 수정본으로 보고 건너뛴다 (plan.md 6.1).
|
|
4
|
+
# Drift 가드: CLAUDE.md(정본)와 복사본(agents.md, GEMINI.md ...)이 항상 같은지 확인.
|
|
5
|
+
# - CLAUDE.md가 스테이징된 채 바뀌었다면 → 모든 복사본으로 자동 동기화 + 재스테이징.
|
|
6
|
+
# - 복사본만 직접 편집했다면 → 커밋 거부 (정본 CLAUDE.md를 고치고 동기화할 것).
|
|
7
|
+
set -uo pipefail
|
|
8
|
+
|
|
9
|
+
canon="CLAUDE.md"
|
|
10
|
+
mirrors=("agents.md" "GEMINI.md")
|
|
11
|
+
|
|
12
|
+
staged_canon=$(git diff --cached --name-only -- "$canon" | wc -l)
|
|
13
|
+
|
|
14
|
+
# 정본 또는 어떤 복사본이라도 스테이징됐는지 조사.
|
|
15
|
+
any_staged=0
|
|
16
|
+
for m in "${mirrors[@]}"; do
|
|
17
|
+
c=$(git diff --cached --name-only -- "$m" | wc -l)
|
|
18
|
+
[ "$c" -gt 0 ] && any_staged=1
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# 각 복사본에 대해 drift 검사 (정본/복사본 둘 다 미스테이징이면 건너뜀).
|
|
22
|
+
if [ "$staged_canon" -gt 0 ] || [ "$any_staged" -gt 0 ]; then
|
|
23
|
+
for m in "${mirrors[@]}"; do
|
|
24
|
+
if ! cmp -s "$canon" "$m"; then
|
|
25
|
+
if [ "$staged_canon" -gt 0 ]; then
|
|
26
|
+
# 정본이 바뀜 → 이 복사본으로 동기화.
|
|
27
|
+
cp -f "$canon" "$m"
|
|
28
|
+
git add "$m"
|
|
29
|
+
echo "[pre-commit] $canon(정본) 변경 감지 → $m 동기화 및 재스테이징." >&2
|
|
30
|
+
else
|
|
31
|
+
# 복사본만 직접 편집됨 → 거부.
|
|
32
|
+
echo "[pre-commit] $m 를 직접 편집함. 정본은 $canon 입니다." >&2
|
|
33
|
+
echo "[pre-commit] 변경사항을 $canon 에 적용 후 'scripts/sync_agent_docs.sh' 를 실행하거나," >&2
|
|
34
|
+
echo "[pre-commit] 이 커밋에서 $m 변경분을 빼세요 (git restore --staged $m)." >&2
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
done
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# ── 미컴파일 raw 로그 넛지 ────────────────────────────────────
|
|
42
|
+
# doc/raw/*.md가 커밋에 포함되면 compile list로 미컴파일 로그를 보여준다.
|
|
43
|
+
# 경고만 하고 커밋은 막지 않는다. 무거운 QMD embed은 훅에서 돌리지 않는다 —
|
|
44
|
+
# index 갱신(compile index)은 사람/세션이 직접 호출하는 것을 남긴다.
|
|
45
|
+
if git diff --cached --name-only -- 'doc/raw/*.md' | grep -q .; then
|
|
46
|
+
if command -v llm-wiki >/dev/null 2>&1; then
|
|
47
|
+
echo "[pre-commit] doc/raw/ 로그가 커밋에 포함됨 — 미컴파일 항목 점검:" >&2
|
|
48
|
+
llm-wiki compile list >&2 || echo "[pre-commit] llm-wiki compile list 실행 실패 (무시하고 계속)." >&2
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# ── 스킬 동기화 가드 ──────────────────────────────────────────
|
|
53
|
+
# .agents/skills/(정본) ↔ .claude/skills/(복사본) 디렉토리 미러.
|
|
54
|
+
skill_canon=".agents/skills"
|
|
55
|
+
skill_mirror=".claude/skills"
|
|
56
|
+
|
|
57
|
+
staged_skill_canon=$(git diff --cached --name-only -- "$skill_canon/" | wc -l)
|
|
58
|
+
staged_skill_mirror=$(git diff --cached --name-only -- "$skill_mirror/" | wc -l)
|
|
59
|
+
|
|
60
|
+
if [ "$staged_skill_canon" -gt 0 ] || [ "$staged_skill_mirror" -gt 0 ]; then
|
|
61
|
+
if ! diff -rq "$skill_canon" "$skill_mirror" >/dev/null 2>&1; then
|
|
62
|
+
if [ "$staged_skill_canon" -gt 0 ]; then
|
|
63
|
+
# 정본이 바뀜 → 복사본으로 미러 동기화.
|
|
64
|
+
bash "$(git rev-parse --show-toplevel)/scripts/sync_skills.sh" >&2
|
|
65
|
+
git add "$skill_mirror/"
|
|
66
|
+
echo "[pre-commit] $skill_canon/(정본) 변경 감지 → $skill_mirror/ 동기화 및 재스테이징." >&2
|
|
67
|
+
else
|
|
68
|
+
# 복사본만 직접 편집됨 → 거부.
|
|
69
|
+
echo "[pre-commit] $skill_mirror/ 를 직접 편집함. 정본은 $skill_canon/ 입니다." >&2
|
|
70
|
+
echo "[pre-commit] 변경사항을 $skill_canon/ 에 적용 후 'scripts/sync_skills.sh' 를 실행하거나," >&2
|
|
71
|
+
echo "[pre-commit] 이 커밋에서 $skill_mirror/ 변경분을 빼세요 (git restore --staged $skill_mirror/)." >&2
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
fi
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
exit 0
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM llm-wiki-template-version: 1 — 이 줄이 살아있으면 llm-wiki init이 갱신하고, 지워져 있으면 사용자 수정본으로 건너뛴다 (plan.md 6.1).
|
|
3
|
+
REM CLAUDE.md(정본) -> 복사본 동기화.
|
|
4
|
+
REM 복사본 목록에 새 에이전트 파일을 추가하면 자동으로 동기화된다.
|
|
5
|
+
REM 항상 CLAUDE.md만 편집하고 이 스크립트를 실행할 것.
|
|
6
|
+
setlocal
|
|
7
|
+
cd /d "%~dp0.."
|
|
8
|
+
|
|
9
|
+
set "CANON=CLAUDE.md"
|
|
10
|
+
REM 복사본 목록 — 새 에이전트 파일은 여기에 추가.
|
|
11
|
+
call :sync_one agents.md
|
|
12
|
+
if errorlevel 1 exit /b 1
|
|
13
|
+
call :sync_one GEMINI.md
|
|
14
|
+
if errorlevel 1 exit /b 1
|
|
15
|
+
|
|
16
|
+
echo [sync] 모든 복사본 동기화 OK.
|
|
17
|
+
endlocal
|
|
18
|
+
exit /b 0
|
|
19
|
+
|
|
20
|
+
REM --- 서브루틴: sync_one <mirror> ---
|
|
21
|
+
:sync_one
|
|
22
|
+
copy /y "%CANON%" "%~1" >nul
|
|
23
|
+
if errorlevel 1 (
|
|
24
|
+
echo [sync] ERROR: %~1 복사 실패
|
|
25
|
+
exit /b 1
|
|
26
|
+
)
|
|
27
|
+
fc "%CANON%" "%~1" >nul
|
|
28
|
+
if errorlevel 1 (
|
|
29
|
+
echo [sync] ERROR: %~1 동기화 후에도 불일치
|
|
30
|
+
exit /b 1
|
|
31
|
+
)
|
|
32
|
+
echo [sync] %CANON% -^> %~1 OK
|
|
33
|
+
exit /b 0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# llm-wiki-template-version: 1 — 이 줄이 살아있으면 llm-wiki init이 갱신하고, 지워져 있으면 사용자 수정본으로 건너뛴다 (plan.md 6.1).
|
|
3
|
+
# CLAUDE.md(정본) → 복사본 동기화.
|
|
4
|
+
# 복사본 목록(mirrors)에 새 에이전트 파일을 추가하면 자동으로 동기화된다.
|
|
5
|
+
# 항상 CLAUDE.md만 편집하고 이 스크립트를 실행할 것.
|
|
6
|
+
# (pre-commit 가드가 커밋 시 자동으로 같은 일을 하므로, 보통은 수동 실행 불필요.)
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
cd "$(git rev-parse --show-toplevel)"
|
|
9
|
+
|
|
10
|
+
canon="CLAUDE.md"
|
|
11
|
+
mirrors=("agents.md" "GEMINI.md")
|
|
12
|
+
|
|
13
|
+
for m in "${mirrors[@]}"; do
|
|
14
|
+
cp -f "$canon" "$m"
|
|
15
|
+
echo "[sync] $canon -> $m"
|
|
16
|
+
|
|
17
|
+
if cmp -s "$canon" "$m"; then
|
|
18
|
+
: # OK
|
|
19
|
+
else
|
|
20
|
+
echo "[sync] ERROR: $m 와 $canon 이(가) 불일치. 확인 필요." >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
echo "[sync] OK: 모든 복사본이 $canon 과(과) 동일합니다."
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM llm-wiki-template-version: 1 — 이 줄이 살아있으면 llm-wiki init이 갱신하고, 지워져 있으면 사용자 수정본으로 건너뛴다 (plan.md 6.1).
|
|
3
|
+
REM .agents/skills/ (canon) -> .claude/skills/ (mirror) directory mirror.
|
|
4
|
+
REM robocopy /MIR = full mirror based on canon (removes items absent from canon).
|
|
5
|
+
REM Always edit .agents/skills/ only, then run this script.
|
|
6
|
+
setlocal
|
|
7
|
+
cd /d "%~dp0.."
|
|
8
|
+
|
|
9
|
+
set "CANON=.agents\skills"
|
|
10
|
+
set "MIRROR=.claude\skills"
|
|
11
|
+
|
|
12
|
+
if not exist "%CANON%\" (
|
|
13
|
+
echo [sync-skills] ERROR: canon %CANON% not found
|
|
14
|
+
exit /b 1
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
REM robocopy exit codes: 0-7 = OK (copied/identical), 8+ = error.
|
|
18
|
+
robocopy "%CANON%" "%MIRROR%" /MIR /NFL /NDL /NJH /NJS /NC /NS >nul
|
|
19
|
+
if errorlevel 8 (
|
|
20
|
+
echo [sync-skills] ERROR: robocopy failed ^(exit %errorlevel%^)
|
|
21
|
+
exit /b 1
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
echo [sync-skills] %CANON% -^> %MIRROR% mirror OK.
|
|
25
|
+
endlocal
|
|
26
|
+
exit /b 0
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# llm-wiki-template-version: 1 — 이 줄이 살아있으면 llm-wiki init이 갱신하고, 지워져 있으면 사용자 수정본으로 건너뛴다 (plan.md 6.1).
|
|
3
|
+
# .agents/skills/(정본) → .claude/skills/(복사본) 디렉토리 미러링.
|
|
4
|
+
# 정본에 없는 스킬/파일은 복사본에서 제거(완전 미러).
|
|
5
|
+
# 항상 .agents/skills/만 편집하고 이 스크립트를 실행할 것.
|
|
6
|
+
# (pre-commit 가드가 커밋 시 자동으로 같은 일을 하므로, 보통은 수동 실행 불필요.)
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
cd "$(git rev-parse --show-toplevel)"
|
|
9
|
+
|
|
10
|
+
canon=".agents/skills"
|
|
11
|
+
mirror=".claude/skills"
|
|
12
|
+
|
|
13
|
+
if [ ! -d "$canon" ]; then
|
|
14
|
+
echo "[sync-skills] ERROR: 정본 $canon 이(가) 없습니다." >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# 1) 정본 → 복사본 전체 복사 (cp -rf, 기존 파일 덮어쓰기).
|
|
19
|
+
mkdir -p "$mirror"
|
|
20
|
+
cp -rf "$canon"/. "$mirror"/
|
|
21
|
+
|
|
22
|
+
# 2) 미러링: 복사본에만 있는 항목(정본에 없는 스킬) 제거.
|
|
23
|
+
if [ -d "$mirror" ]; then
|
|
24
|
+
while IFS= read -r item; do
|
|
25
|
+
name=$(basename "$item")
|
|
26
|
+
if [ ! -e "$canon/$name" ]; then
|
|
27
|
+
rm -rf "$mirror/$name"
|
|
28
|
+
echo "[sync-skills] 정본에 없음 → 제거: $mirror/$name"
|
|
29
|
+
fi
|
|
30
|
+
done < <(find "$mirror" -mindepth 1 -maxdepth 1)
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# 3) 검증: diff -rq 가 빈 출력이면 완전 미러.
|
|
34
|
+
if diff -rq "$canon" "$mirror" >/dev/null 2>&1; then
|
|
35
|
+
echo "[sync-skills] OK: $canon → $mirror 완전 미러."
|
|
36
|
+
else
|
|
37
|
+
echo "[sync-skills] ERROR: 동기화 후에도 불일치. diff 확인 필요." >&2
|
|
38
|
+
diff -rq "$canon" "$mirror" >&2 || true
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|