leerness 1.36.25 → 1.36.27

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.36.27 — 2026-07-15 — debug 렌즈 — "근본원인 조사 없이 수정 금지"를 자기질문으로 (obra/superpowers systematic-debugging)
4
+
5
+ superpowers 검토 아크 마지막 채택분. 원문(systematic-debugging SKILL)의 규율을 **lens 카테고리 정합대로 자기질문 6문항으로 재작성** — 대문자 명령형/강제 게이트는 이식하지 않음(lens 는 advisory 표면, 강제로 포장하면 과장).
6
+
7
+ - **`LENS_CATALOG.debug`** — persona "재현 못 한 버그는 고친 적 없다고 믿는 조사관". 6문항: 재현+스택 전문 / 근본원인 한 문장 / 유사 코드와 차이 전수 / 가설 하나·변수 하나 / **실패 테스트 먼저**(수정 후 초록불은 증거 아님) / 3번째 시도면 설계 의심 → decision·lesson 승격. ko/en 락스텝(병합 규칙상 개수 일치 필수). `affects: [test, code]`.
8
+ - 정직성: 6번(3번째 시도)은 **자기보고 질문** — 도구가 시도 횟수를 세지 않는다. 파일 확장자 매핑(`_lensDomainsForFiles`)에는 넣지 않음 — debug 는 파일 표면이 없어 오탐만 생김.
9
+ - **`route bugfix` 힌트** — 결정적 트리거(사용자가 task type 명시): `💡 수정 전 자기질문: leerness lens debug`. 표면 문자열 5곳 `|debug` 동시 갱신(selftest 가드 리터럴 포함 — 미갱신 시 게이트가 깨지는 구조를 판정단이 사전 지적).
10
+ - **검증**: selftest 297/297(ko/en 패리티 + 다중절 앵커 4쌍(1.36.16 F8 교훈 — 단어 하나 앵커 금지) + affects 유효 + route 힌트 + **파일매핑 미확장 확인**), lens/route/en 실측, 게이트 e2e, 게시본 클린룸.
11
+
12
+ ## 1.36.26 — 2026-07-15 — `leerness skill lint` — SKILL 메타 품질 lint (2티어 severity · 한국어 트리거절 · CJK 본문예산) (obra/superpowers P1/P2)
13
+
14
+ 1.36.25(P0 — description 데이터)로 선행조건이 충족된 후속. 판별 증거: **P0 없이 lint 를 먼저 붙였으면 내장 9/9 가 실패**했을 것 — 지금은 내장 9종이 lint clean(순서가 맞았다는 실증, selftest 로 고정).
15
+
16
+ - **`_lintSkillMeta(meta, body)` 순수함수** (pure-utils, 의존 0) — 2티어 severity 설계(메모리 교훈: 게이트 휴리스틱은 false-PASS 편향, false-BLOCK 금지):
17
+ - **ERROR**(기계적, FP 0 — 이것만 exit 1): name 부재/문자셋 위반(`^[a-z0-9][a-z0-9-]*$`), description 부재/1024자 초과.
18
+ - **WARNING**(저FP 형태): name 반복 / 40자 미만(표시명 합성 흔적) / capabilities 나열 형태. 기본 exit 0, `--strict` 시 승격.
19
+ - **INFO**(주관적, 절대 실패 아님): 트리거절 부재, 본문 예산 초과.
20
+ - **한국어 적응**: 트리거절 ko(`~할 때 사용`)·en(`Use when`) 모두 인정, 3인칭 검사는 한국어(인칭 무표지)에 부적용이라 제외, **본문 예산 CJK 분기**(비CJK=단어수/CJK=char — 공백분리 단어수를 한국어에 쓰면 어절 카운트라 전면 오발).
21
+ - **`leerness skill lint [id] [--all] [--json] [--strict]`** — 설치 스킬(SKILL.md 우선, skill.json 폴백) + 내장 카탈로그 9종 대상. `--json` 구조화(ok/errors/warnings/results).
22
+ - **검증**: selftest 296/296(ERROR 기계판정 2종 + clean 무오발 + WARNING 분리 + CJK lang + **내장 9종 clean 고정** + CLI 배선), 실측 5종(내장 --all exit 0 / description 없음 ERROR exit 1 / WARNING 기본 0·strict 1 / ko 트리거 무 INFO / --json), 게이트 e2e, 게시본 클린룸.
23
+
3
24
  ## 1.36.25 — 2026-07-15 — 내장 스킬 9종 트리거 description + export/publish 합성 우선순위 — "언제 로드할지"를 알 수 있게 (obra/superpowers P0)
4
25
 
5
26
  superpowers 검토(1.36.22)에서 이연한 P0. **결함(도그푸딩 실측)**: BUILTIN_CATALOG 9개 스킬 전부 `description` 0/9 → (1) 설치 스킬 리더가 capabilities 나열로 폴백("feature-contracts 작성, 재사용 우선 검사…" = 에이전트가 "지금 로드할까"를 판단할 수 없는 워크플로 요약), (2) `skill export`/`skill publish` 가 description 을 displayNameKo("기능 구현 표준 스킬")로 합성 — **좋은 description 이 있어도 우선순위가 displayNameKo 1순위라 무시**되는 구조였다.
package/README.md CHANGED
@@ -121,7 +121,7 @@ MIT
121
121
  <!-- leerness:project-readme:start -->
122
122
  ## Leerness Project Harness
123
123
 
124
- 이 프로젝트는 Leerness v1.36.25 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
124
+ 이 프로젝트는 Leerness v1.36.27 하네스를 사용합니다. AI 에이전트는 작업 전 `leerness handoff`로 컨텍스트를 적재하고, 작업 후 `leerness check`/`leerness audit`/`leerness session close`를 수행해야 합니다.
125
125
 
126
126
  ### 정체성 — AI 에이전트 운영 레이어 (UR-0030)
127
127
 
@@ -175,7 +175,7 @@ leerness memory restore decision <date|title>
175
175
 
176
176
  ### MCP server (외부 AI 통합)
177
177
 
178
- Leerness v1.36.25는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **86개 도구**를 노출:
178
+ Leerness v1.36.27는 stdio JSON-RPC MCP server를 내장합니다 — Claude Code · Cursor · Codex CLI 등 외부 AI에 **86개 도구**를 노출:
179
179
 
180
180
  ```jsonc
181
181
  // 카테고리별
@@ -196,7 +196,7 @@ Leerness v1.36.25는 stdio JSON-RPC MCP server를 내장합니다 — Claude Cod
196
196
  `<<autonomous-loop-dynamic>>` 신호만 보내면 AI가:
197
197
  1) 다음 라운드 후보 선정 → 2) 코드 변경 → 3) stress-v* 신규 작성 + 누적 회귀 → 4) e2e 219/219 → 5) npm pack + git tag + GitHub release → 6) main 자동 push → 7) session close → 8) 다음 라운드 예약.
198
198
 
199
- 현재 누적: **70 라운드 (1.9.40 → 1.36.25)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
199
+ 현재 누적: **70 라운드 (1.9.40 → 1.36.27)** · 매 라운드 GitHub release/태그 생성 · _reports/는 비공개 보존.
200
200
 
201
201
  ### 성능 가이드
202
202
 
@@ -234,6 +234,6 @@ leerness release pack --close --auto-main-push
234
234
  - `.harness/session-handoff.md`: 다음 세션 인수인계 (자동 작성)
235
235
  - `.harness/lessons.md` / `decisions.md` / `rules.md`: 영구 메모리 (5 surface)
236
236
 
237
- Last synced by Leerness v1.36.25: 2026-07-15
237
+ Last synced by Leerness v1.36.27: 2026-07-15
238
238
  <!-- leerness:project-readme:end -->
239
239
 
package/bin/leerness.js CHANGED
@@ -22,7 +22,7 @@ const { _isSecretKey, _isPlaceholderSecret, _looksSecretLike, _mergeLines, _merg
22
22
  _detectOptimism: _puDetectOptimism, _computeConfidence: _puComputeConfidence,
23
23
  _personaSummaries, _translate,
24
24
  _decisionsFromMd, _renderDecisionsMd, _renderLessonsMd,
25
- _withBuiltinSource, _esc, _roadmapTokenStyles, _parseSkillMd,
25
+ _withBuiltinSource, _esc, _roadmapTokenStyles, _parseSkillMd, _lintSkillMeta,
26
26
  _migrationGuideText, _parseContractSpec, _gitignoreMatch,
27
27
  _featureGraphTemplate, _parseFeatureGraph, _nextFeatureId, _featureBlock, _featureImpactBfs,
28
28
  _parseChangelogBetween, _cellSafe, _cellUnescape, _lineSafe, _parseLimit, _parseAddTitle, _parseImplExports, _taskPositionalPath, _completionClaimAllowed, _minorKey, _shouldPublishNpm,
@@ -34,7 +34,7 @@ const { CAPABILITY_SURFACE, POWERFUL_COMMANDS, ADAPTERS, REUSE_CATEGORIES, REUSE
34
34
  const { tokenizeForRank: _tokenizeForRank, expandQuery: _expandQuery, scoreHits: _scoreHits, suggestTerms: _suggestTerms } = require('../lib/search-core'); // 1.36.23: memory search 랭킹 코어(순수·0-deps)
35
35
  const { findCorruptedStateJson: _findCorruptedStateJson } = require('../lib/state-integrity'); // 1.36.1 (클린룸 리뷰 FN): .harness/*.json 상태 무결성 (audit/health/check 공유)
36
36
 
37
- const VERSION = '1.36.25';
37
+ const VERSION = '1.36.27';
38
38
 
39
39
  // 1.9.290 (UR-0037, Codex gpt-5.5 #4 수렴): CLI 전용 부작용은 require 시 실행하지 않는다.
40
40
  // 이전: warning listener 제거 / NODE_OPTIONS 변경 / chcp IIFE 가 top-level 즉시 실행 → require('harness') 시 호스트 프로세스 오염.
@@ -1188,6 +1188,50 @@ function addSkill(root, name, silent = false) {
1188
1188
 
1189
1189
  // ===== Skill registry (catalog + user-defined merged) =====
1190
1190
  function userSkillsDir(root) { return path.join(absRoot(root), '.harness/skills'); }
1191
+
1192
+ // 1.36.26 (obra/superpowers P2): skill 메타 품질 lint — `leerness skill lint [id] [--all] [--json] [--strict]`.
1193
+ // 대상: 설치 스킬(.harness/skills/<id>/SKILL.md 우선, 없으면 skill.json) + 내장 카탈로그 9종(skill.json 형태로 lint).
1194
+ // 기본 exit 0, ERROR 있을 때만 exit 1. --strict 는 WARNING 도 승격. INFO 는 절대 실패 아님(false-BLOCK 방지 설계).
1195
+ function skillLintCmd(root, id) {
1196
+ root = absRoot(root);
1197
+ const jsonMode = has('--json');
1198
+ const strict = has('--strict');
1199
+ const targets = []; // { id, source, meta, body }
1200
+ const seen = new Set();
1201
+ const dir = userSkillsDir(root);
1202
+ const wantAll = !id || has('--all');
1203
+ const pushInstalled = (sid) => {
1204
+ const md = path.join(dir, sid, 'SKILL.md');
1205
+ const sj = path.join(dir, sid, 'skill.json');
1206
+ if (exists(md)) { const p = _parseSkillMd(read(md)); targets.push({ id: sid, source: 'SKILL.md', meta: p.meta, body: p.body }); seen.add(sid); return true; }
1207
+ if (exists(sj)) { try { const j = JSON.parse(read(sj)); targets.push({ id: sid, source: 'skill.json', meta: { name: j.name || sid, description: j.description || '' }, body: '' }); seen.add(sid); return true; } catch {} }
1208
+ return false;
1209
+ };
1210
+ if (wantAll) {
1211
+ if (exists(dir)) for (const e of fs.readdirSync(dir, { withFileTypes: true })) if (e.isDirectory()) pushInstalled(e.name);
1212
+ for (const bid of Object.keys(BUILTIN_CATALOG)) if (!seen.has(bid)) { const d = BUILTIN_CATALOG[bid]; targets.push({ id: bid, source: 'builtin', meta: { name: bid, description: d.description || '' }, body: '' }); }
1213
+ } else {
1214
+ if (!pushInstalled(id)) {
1215
+ if (BUILTIN_CATALOG[id]) { const d = BUILTIN_CATALOG[id]; targets.push({ id, source: 'builtin', meta: { name: id, description: d.description || '' }, body: '' }); }
1216
+ else { failJson(jsonMode, 'skill_not_found', `스킬 없음: ${id} (설치 스킬 또는 내장 카탈로그에 없음)`); return; }
1217
+ }
1218
+ }
1219
+ const results = targets.map(t => ({ id: t.id, source: t.source, ...(_lintSkillMeta(t.meta, t.body)) }));
1220
+ const errN = results.reduce((s, r) => s + r.errors.length, 0);
1221
+ const warnN = results.reduce((s, r) => s + r.warnings.length, 0);
1222
+ const failed = errN > 0 || (strict && warnN > 0);
1223
+ if (failed) process.exitCode = 1;
1224
+ if (jsonMode) { log(JSON.stringify({ version: VERSION, total: results.length, errors: errN, warnings: warnN, strict, ok: !failed, results }, null, 2)); return; }
1225
+ log(`# leerness skill lint — ${results.length}개 (ERROR ${errN} · WARNING ${warnN}${strict ? ' · --strict' : ''})`);
1226
+ for (const r of results) {
1227
+ const flat = [...r.errors.map(x => ['E', x]), ...r.warnings.map(x => ['W', x]), ...r.infos.map(x => ['i', x])];
1228
+ if (!flat.length) { ok(`${r.id} (${r.source}) — clean`); continue; }
1229
+ log(`\n## ${r.id} (${r.source})`);
1230
+ for (const [lv, x] of flat) log(` ${lv === 'E' ? '✗' : lv === 'W' ? '⚠' : 'ⓘ'} [${x.code}] ${x.msg}`);
1231
+ }
1232
+ log('');
1233
+ log(failed ? `✗ lint 실패 (ERROR ${errN}${strict ? ` + strict WARNING ${warnN}` : ''})` : `✓ lint 통과 (ERROR 0${warnN ? ` · WARNING ${warnN}건은 exit 에 미반영 — --strict 로 승격` : ''})`);
1234
+ }
1191
1235
  function userSkillFile(root, id) { return path.join(userSkillsDir(root), id, 'skill.json'); }
1192
1236
 
1193
1237
  function loadUserSkill(root, id) {
@@ -2983,6 +3027,44 @@ function _selfTestCases() {
2983
3027
  const encOk = s.includes("(result.applied || []).some(a => a.action === 'failed')) process.exitCode = 1"); // encoding: 실패 exit1
2984
3028
  return reuseOk && releaseOk && encOk;
2985
3029
  } },
3030
+ { name: 'debug 렌즈 (1.36.27, obra/superpowers systematic-debugging): 자기질문 6문항 ko/en 락스텝 + affects 유효 + route bugfix 힌트 + 파일매핑 미확장 — 행위검사', run: () => {
3031
+ const d = LENS_CATALOG.debug;
3032
+ if (!d) return false;
3033
+ const parity = Array.isArray(d.questions) && Array.isArray(d.questionsEn) && d.questions.length === d.questionsEn.length && d.questions.length >= 5;
3034
+ // 다중절 앵커(단어 하나 앵커는 실질 삭제를 못 잡음 — 1.36.16 F8 교훈)
3035
+ const anyKo = (...ws) => d.questions.some(q => ws.every(w => q.includes(w)));
3036
+ const anyEn = (...ws) => d.questionsEn.some(q => ws.every(w => q.toLowerCase().includes(w.toLowerCase())));
3037
+ const koOk = anyKo('근본원인', '한 문장') && anyKo('가설', '변수 하나') && anyKo('실패', '테스트') && anyKo('3번째', '자기보고');
3038
+ const enOk = anyEn('root cause', 'one sentence') && anyEn('one variable') && anyEn('failing test');
3039
+ const affectsOk = Array.isArray(d.affects) && d.affects.length && d.affects.every(a => !!LENS_CATALOG[a]);
3040
+ const s = read(__filename);
3041
+ const routeHint = s.includes("if (name === 'bugfix') log(") && s.includes('leerness lens debug');
3042
+ const surface = s.includes('lens [code|design|docs|test|security|database|debug]');
3043
+ // 파일 확장자 매핑 미확장(오탐 방지): _lensDomainsForFiles 가 debug 를 반환하지 않는다
3044
+ const noFileMap = !JSON.stringify(_lensDomainsForFiles(['a.sql', 'b.js', 'c.md'])).includes('debug');
3045
+ return parity && koOk && enOk && affectsOk && routeHint && surface && noFileMap;
3046
+ } },
3047
+ { name: 'skill lint (1.36.26, obra/superpowers P1/P2): 2티어 severity(ERROR 만 exit1) + 한국어 트리거절 + CJK 본문예산 분기 — 순수 행위검사', run: () => {
3048
+ const p = require('../lib/pure-utils');
3049
+ if (typeof p._lintSkillMeta !== 'function') return false;
3050
+ // ERROR: name/description 기계 판정
3051
+ const e1 = p._lintSkillMeta({ name: 'bad-one' }, 'b');
3052
+ const errMissing = e1.errors.some(x => x.code === 'description_missing');
3053
+ const errCharset = p._lintSkillMeta({ name: 'Bad_Name!', description: 'x'.repeat(50) }, 'b').errors.some(x => x.code === 'name_charset');
3054
+ // clean 케이스: 트리거 서술(ko) → ERROR/WARNING/no_trigger 전부 0 (false-BLOCK 방지 핵심)
3055
+ const clean = p._lintSkillMeta({ name: 'ok-skill', description: '문서 산출물이 필요할 때 사용 — Word 파일을 만들거나 편집할 때 로드하는 스킬. Use when producing documents.' }, '본문');
3056
+ const cleanOk = clean.errors.length === 0 && clean.warnings.length === 0 && !clean.infos.some(i => i.code === 'no_trigger_clause');
3057
+ // WARNING 은 exit 판정과 분리(짧은 설명) + CJK lang 분기
3058
+ const w1 = p._lintSkillMeta({ name: 'w', description: '짧은 설명' }, 'b');
3059
+ const warnShort = w1.errors.length === 0 && w1.warnings.some(x => x.code === 'description_too_short');
3060
+ const cjkLang = p._lintSkillMeta({ name: 'a', description: 'x'.repeat(50) }, '한글본문 '.repeat(50)).lang === 'cjk';
3061
+ // 내장 카탈로그 9종이 lint clean(1.36.25 데이터 선행 조건 검증 — P0 없이 lint 먼저면 9/9 실패였음)
3062
+ const c = require('../lib/catalogs');
3063
+ const builtinClean = Object.keys(c.BUILTIN_CATALOG).every(k => p._lintSkillMeta({ name: k, description: c.BUILTIN_CATALOG[k].description || '' }, '').errors.length === 0);
3064
+ // CLI 배선
3065
+ const wired = typeof skillLintCmd === 'function' && read(__filename).includes("args[1] === 'lint'");
3066
+ return errMissing && errCharset && cleanOk && warnShort && cjkLang && builtinClean && wired;
3067
+ } },
2986
3068
  { name: 'skill 트리거 description (1.36.25, obra/superpowers P0): BUILTIN_CATALOG 9/9 description(트리거 서술) + export/publish 합성 우선순위 description 우선 — 행위검사', run: () => {
2987
3069
  const c = require('../lib/catalogs');
2988
3070
  const ids = Object.keys(c.BUILTIN_CATALOG);
@@ -3998,7 +4080,7 @@ function _selfTestCases() {
3998
4080
  } },
3999
4081
  { name: '품질 렌즈 (1.18.3): lens 명령 표면 등재 + REPL 설치문항 제거 (소스 가드)', run: () => {
4000
4082
  const src = read(__filename);
4001
- const surface = src.includes("if (cmd === 'lens')") && src.includes("cmd: 'lens [code|design|docs|test|security|database]") && src.includes('leerness lens [code|design|docs|test|security|database]');
4083
+ const surface = src.includes("if (cmd === 'lens')") && src.includes("cmd: 'lens [code|design|docs|test|security|database|debug]") && src.includes('leerness lens [code|design|docs|test|security|database|debug]');
4002
4084
  const replGone = !src.includes('설치 완료 후 REPL agent ' + '모드를 즉시 시작할까요') && src.includes('REPL agent 모드 진입 ' + '문항 제거');
4003
4085
  return surface && replGone;
4004
4086
  } },
@@ -5117,6 +5199,32 @@ const LENS_CATALOG = {
5117
5199
  ],
5118
5200
  affects: ['code', 'test'], affectsNote: '동시성 방어엔 인터리빙/부하/재시도/멀티인스턴스 실패를 재현하는 테스트가 따라와야 함(단일 인스턴스 초록불은 증거가 아님)',
5119
5201
  affectsNoteEn: 'a concurrency defense needs an interleaving/load/retry/multi-instance reproduction test'
5202
+ },
5203
+ // 1.36.27 (obra/superpowers systematic-debugging → 자기질문化): "근본원인 조사 없이 수정 금지" 계열.
5204
+ // 원문의 대문자 명령형/강제 게이트는 이식하지 않음 — lens 는 advisory 자기질문 표면(과장 금지).
5205
+ // 6번(3번째 시도)은 자기보고 질문 — 도구가 실패 횟수를 카운트하지 않는다(구현했다고 쓰지 말 것).
5206
+ // 파일 확장자 매핑(_lensDomainsForFiles)에는 넣지 않음 — debug 는 파일 표면이 없어 오탐만 생김. 트리거는 route bugfix 힌트.
5207
+ debug: {
5208
+ title: '디버깅', persona: '재현 못 한 버그는 고친 적 없다고 믿는 조사관',
5209
+ titleEn: 'debugging', personaEn: 'an investigator who believes an unreproduced bug was never fixed',
5210
+ questions: [
5211
+ "이 버그를 직접 재현했는가? 에러 전문과 스택을 끝까지 읽었는가 — 첫 줄만 보고 고치고 있지 않은가?",
5212
+ "근본원인을 한 문장으로 글로 쓸 수 있는가? 못 쓰면 아직 조사 단계다 — 조사 전에 해법부터 제시하고 있지 않은가?",
5213
+ "동작하는 유사 코드와의 차이를 전수 나열했는가? 최근 변경(diff) 중 이 경계를 건드린 것은 무엇인가?",
5214
+ "가설을 하나만 세우고 변수 하나만 바꿔 검증했는가 — 여러 곳을 동시에 고쳐서 무엇이 통했는지 모르게 되고 있지 않은가?",
5215
+ "그 버그를 재현하는 실패 테스트를 먼저 썼고, 수정 전엔 실제로 실패함을 확인했는가? — 수정 후 초록불만으론 그 테스트가 버그를 잡는지 알 수 없다.",
5216
+ "같은 버그에 3번째 수정 시도인가? 그렇다면 증상이 아니라 설계를 의심할 때다 — `leerness decision add`/`lesson save` 로 승격해 기록하라. (자기보고 — 도구가 시도 횟수를 세지 않는다)",
5217
+ ],
5218
+ questionsEn: [
5219
+ "Did you reproduce the bug yourself, and read the full error and stack to the end — or are you fixing off the first line?",
5220
+ "Can you write the root cause in one sentence? If not, you are still investigating — are you proposing fixes before the investigation?",
5221
+ "Did you enumerate every difference from similar working code? Which recent change (diff) touched this boundary?",
5222
+ "One hypothesis, one variable changed per experiment — or are you changing several things at once so you can't tell what worked?",
5223
+ "Did you write a failing test that reproduces the bug first, and confirm it actually fails before the fix? A green light after the fix alone proves nothing.",
5224
+ "Is this your third attempt at the same bug? Then suspect the design, not the symptom — promote it via decision add / lesson save. (self-reported — the tool does not count attempts)",
5225
+ ],
5226
+ affects: ['test', 'code'], affectsNote: '근본원인을 한 문장으로 못 쓰겠으면 코드가 복잡하다는 신호 — code 질문으로. 수정엔 그 버그를 재현하는 회귀 테스트가 따라와야 함(수정 후 초록불은 증거가 아님)',
5227
+ affectsNoteEn: 'if you cannot state the root cause in one sentence, the code is too complex — revisit the code lens; every fix needs a regression test that reproduces the bug'
5120
5228
  }
5121
5229
  };
5122
5230
  // 1.19.3 (UR-0003 렌즈 완전판 v3): 프로젝트별 커스텀 렌즈 — .harness/quality-lenses.json 읽기-병합(쓰기 명령 없음, AI/사용자가 편집).
@@ -5286,7 +5394,7 @@ function commandsCmd(root) {
5286
5394
  { cmd: 'encoding check [path]', desc: '인코딩 검증' },
5287
5395
  { cmd: 'lazy detect [path] [--json]', desc: '게으른 작업 감지 (1.9.101)' },
5288
5396
  { cmd: 'verify-claim <T-ID|--all> [--run-tests] [--test-cmd "<명령>"] [--strict-claims] [--require-evidence]', desc: '주장 검증 (1.9.18~26) — --all: 모든 done 주장 일괄 검증(CI·스케일, 1.33.2) · --require-evidence: done 주장에 파일+테스트 근거 강제 (1.9.287) · --test-cmd: 비-JS 테스트 명령 (1.17.2)' },
5289
- { cmd: 'lens [code|design|docs|test|security|database] [--json]', desc: '분야별 자기질문 품질 렌즈 + 분야간 인과관계 (1.18.3, database: 동시성/트랜잭션)' },
5397
+ { cmd: 'lens [code|design|docs|test|security|database|debug] [--json]', desc: '분야별 자기질문 품질 렌즈 + 분야간 인과관계 (1.18.3, database: 동시성/트랜잭션)' },
5290
5398
  { cmd: 'optimism-check <T-ID>', desc: '낙관적 API 감지 (1.9.26)' },
5291
5399
  { cmd: 'requests audit|list|complete|drop|auto-complete', desc: '사용자 요청 추적 (1.9.207/223)' },
5292
5400
  { cmd: 'pre-wake-audit [path] [--last]', desc: 'sleep 전 점검 (1.9.209)' },
@@ -8640,6 +8748,8 @@ function route(name) {
8640
8748
  log(`# Route: ${name}\n`);
8641
8749
  log('Read before work:'); r.read.forEach(x => log('- ' + x));
8642
8750
  log('\nUpdate after work:'); r.update.forEach(x => log('- ' + x));
8751
+ // 1.36.27: bugfix 진입 시 debug 렌즈 힌트 — 결정적 트리거(사용자가 task type 명시)라 키워드 추론 아님. advisory 한 줄.
8752
+ if (name === 'bugfix') log('\n💡 수정 전 자기질문: leerness lens debug # 근본원인 조사 없이 수정 금지 (재현→원인 한 문장→가설 하나→실패 테스트 먼저)');
8643
8753
  }
8644
8754
 
8645
8755
  function status(root) {
@@ -21052,7 +21162,7 @@ VERIFICATION (evidence-gated "done")
21052
21162
  contract verify <spec.md> <impl.js> [--json] Spec <-> implementation match
21053
21163
  verify-code [path] [--build] [--bench] Run tests/lint/typecheck, record evidence
21054
21164
  gate [path] One-call CI gate: verify + audit + scan + encoding + lazy
21055
- lens [code|design|docs|test|security|database] [--json] Quality self-question lenses
21165
+ lens [code|design|docs|test|security|database|debug] [--json] Quality self-question lenses
21056
21166
 
21057
21167
  SECURITY & HYGIENE
21058
21168
  scan secrets [path] Committed-secret detection
@@ -21114,7 +21224,7 @@ function help() {
21114
21224
  // 1.23.1 (UR-0010 Phase 6): 영어 opt-in 시 큐레이트 영어판. 기본(ko) 은 아래 한국어 help 그대로.
21115
21225
  if (_uiLang(arg('--path', process.cwd())) === 'en') { _helpEn(); return; }
21116
21226
  log(`Leerness v${VERSION}\n\nUsage:\n leerness init [path] [--language auto|ko|en] [--skills recommended|all|a,b]\n leerness migrate [path] [--dry-run] [--force]\n leerness update [path] [--check|--yes|--force|--from <tarball>]\n leerness auto-update install [path]\n leerness status [path]\n leerness verify [path]\n leerness debug [path]\n leerness audit [path]\n leerness check [path]\n leerness scan secrets [path]\n leerness encoding check [path]\n leerness lazy detect [path]\n leerness memory search "query" [--limit 5]\n leerness handoff [path] [--all-apps] [--include p1,p2] [--since 24h|3d] [--compact] [--json] # 1.9.17-22 워크스페이스 (--compact: LLM 시스템 프롬프트용 1줄 요약)\n leerness orchestrate "<목표>" [--agents N] [--model qwen2.5:7b-instruct] [--retry-on-fail K] # 1.9.22 Ollama opt-in (LEERNESS_OLLAMA_BASE_URL 필요)\n leerness llm-bench record --score N --model X [--label L] [--tokens T] # 1.9.22 LLM 벤치 히스토리 누적\n leerness deps <capability> [--run-tests] [--json] # 1.9.24 depends-on 역방향 추적 + 자동 회귀 sweep\n leerness memory search "키" [--include-code] # 1.9.25 소스 코드 본문도 검색 (모순 감지 핵심)\n leerness brainstorm "주제" [--include-code] # 1.9.25 코드 본문 hits 포함\n leerness register-pending "<요청>" [--agent X] [--note Y] # 1.9.25 다중 세션 in-progress 즉시 등록\n leerness optimism-check <T-ID> [--json] # 1.9.26/27 낙관적 표시 감지 (1.9.27: 10 카테고리 + URL/메서드 매핑 + 신뢰도 점수)\n leerness persona list|show <id>|add <id> # 1.9.29 페르소나 카탈로그 (보안/성능/UX/testing/docs 5종 내장)\n leerness review <file> --persona <id1,id2,...> # 1.9.29 도메인 페르소나 리뷰 프롬프트 자동 생성\n leerness agents list|check|quota # 1.9.30/31 외부 AI CLI 가용성 + quota 추정 (claude/codex/agy/copilot)\n leerness agents dispatch "<task>" --to <id> # 1.9.30 활성 CLI 대상 실행 명령 생성 (실 호출 X, 사용자 실행)\n leerness agents multi "<task>" [--only c1,c2] [--write] [--execute] [--timeout 60] # 1.9.152/156 활성 N개 일괄 dispatch (--execute: 실 spawn + consensus)\n leerness provider list|add|remove [args] # 1.9.157 Provider Registry — 사용자 정의 CLI provider 동적 추가 (OpenRouter/Bedrock 흡수)\n leerness agents dispatch "<task>" --multi # 1.9.152 multi 모드 alias (또는 --to all)\n leerness setup-agents [path] [--yes|--no-setup-agents] # 1.9.32 sub-agent CLI 인터랙티브 설정 (.env + 미설치 자동 설치)\n leerness init [path] [--no-stale-check] # 1.9.33 npx 캐시 함정 — 옛 버전 자동 경고 (끄려면 --no-stale-check)\n leerness which [--json] # 1.9.164 진단: 현재 실행 경로/버전 + npm 캐시 + PATH 후보 (구버전 충돌 해결)\n leerness selftest [--json] # 1.9.258 코어 함수 무결성 자가 검증 (설치 손상/부분설치 감지, CI 친화 exit 1)\n leerness shell-guard "<command>" [--json] # 1.9.260 터미널 명령 셸 호환성 린터 (PowerShell 5.1 && 미지원 등 실행 전 감지, UR-0020)\n leerness shell-guard --record --cmd "..." --exit N # 1.9.260 실패한 터미널 명령 기록 → 다음 분석 시 회수\n leerness path-setup [--apply] [--json] # 1.9.254 leerness CLI PATH 자동 등록 (npm global bin 미등록 시)\n leerness web check|screenshot|extract <url> [--out file.png] [--selector "css"] # 1.9.165 playwright bridge (opt-in: npm i -g playwright + permissions.browser)\n leerness pc check|click|type|screenshot [--x N --y N] [--text "s"] [--out f.png] # 1.9.166 robotjs/nut-tree bridge (opt-in: npm i -g robotjs + permissions.mouse/keyboard, ⚠ full 모드 권장)\n leerness lsp check|symbols|references <file/name> [--in dir] [--json] # 1.9.167 LSP 어댑터 MVP (typescript opt-in + regex fallback, 코드 인텔리전스)\n leerness review-request "<request>" [--json] # 1.9.176 사용자 요청 사전 검토 (충돌/재사용/효율/권장 단계 — 사용자 명시)\n leerness contract verify <spec.md> <impl.js> [--json] # 1.9.35 명세 ↔ 구현 일치 검사 (함수/필드)\n leerness reuse autodetect [path] [--apply] [--json] # 1.9.35 src/*.js의 module.exports → reuse-map 후보 등록\n leerness audit [path] [--fix] # 1.9.35 --fix: session-handoff/current-state 자동 갱신\n leerness verify-claim <T-ID> ... [--strict-claims] # 1.9.26 verify-claim에 낙관적 표시 자동 검사 통합
21117
- leerness lens [code|design|docs|test|security|database] [--json] # 1.18.3 분야별 자기질문 품질 렌즈 (database: 동시성/트랜잭션 — 완료 선언 전 자가 점검)\n leerness reuse-map [path] [--all-apps] [--include p1,p2] [--strict-elements] [--json] # 1.9.18 중복/잠재중복/depends-on\n leerness verify-claim <T-ID> [--path .] [--run-tests] [--json] # 1.9.18-20 evidence 자동 검증 (1.9.20: scenes/scripts 등 도메인 폴더 + jest/mocha 파싱)\n leerness verify-code [path] [--build] [--bench] # 1.9.20 --bench: scripts.bench 추가 실행 + evidence 누적\n leerness session close [path]\n leerness route <task-type>\n leerness self check [path]\n leerness readme sync [path]\n leerness consistency check [path]\n leerness consistency merge-design-guide [path]\n leerness plan show|init|add|drop|progress|sync [args]\n leerness task list|add|update|drop|fix-evidence|relink [args]\n leerness skill list|info <name>\n leerness skill learn <id> --doc <url> --command "..." --capability "..." [--note ...]\n leerness skill use <id> [--note ...]\n leerness skill optimize <id> --before "..." --after "..." [--note ...]\n leerness skill remove <id>\n leerness skill consolidate [--threshold 0.3]\n leerness gate [path] # verify+audit+scan+encoding+lazy
21227
+ leerness lens [code|design|docs|test|security|database|debug] [--json] # 1.18.3 분야별 자기질문 품질 렌즈 (database: 동시성/트랜잭션 — 완료 선언 전 자가 점검)\n leerness reuse-map [path] [--all-apps] [--include p1,p2] [--strict-elements] [--json] # 1.9.18 중복/잠재중복/depends-on\n leerness verify-claim <T-ID> [--path .] [--run-tests] [--json] # 1.9.18-20 evidence 자동 검증 (1.9.20: scenes/scripts 등 도메인 폴더 + jest/mocha 파싱)\n leerness verify-code [path] [--build] [--bench] # 1.9.20 --bench: scripts.bench 추가 실행 + evidence 누적\n leerness session close [path]\n leerness route <task-type>\n leerness self check [path]\n leerness readme sync [path]\n leerness consistency check [path]\n leerness consistency merge-design-guide [path]\n leerness plan show|init|add|drop|progress|sync [args]\n leerness task list|add|update|drop|fix-evidence|relink [args]\n leerness skill list|info <name>\n leerness skill learn <id> --doc <url> --command "..." --capability "..." [--note ...]\n leerness skill use <id> [--note ...]\n leerness skill optimize <id> --before "..." --after "..." [--note ...]\n leerness skill remove <id>\n leerness skill consolidate [--threshold 0.3]\n leerness gate [path] # verify+audit+scan+encoding+lazy
21118
21228
  leerness retro [path] [--days 7] [--all-apps] [--include p1,p2] [--json] # 회고 (1.9.13~1.9.16)
21119
21229
  leerness insights [path] [--all-apps] [--include p1,p2] [--json] # 누적 통계 (1.9.13~1.9.16)
21120
21230
  leerness brainstorm "<주제>" [--all-apps] [--include p1,p2] [--json] # 브레인스토밍 (1.9.13~1.9.16)
@@ -21308,6 +21418,7 @@ async function main() {
21308
21418
  if (cmd === 'readme' && args[1] === 'sync') return readmeCmd(arg('--path', args[2] || process.cwd()));
21309
21419
  if (cmd === 'consistency' && args[1] === 'check') return consistencyCheck(arg('--path', args[2] || process.cwd()));
21310
21420
  if (cmd === 'consistency' && args[1] === 'merge-design-guide') return mergeDesign(arg('--path', args[2] || process.cwd()));
21421
+ if (cmd === 'skill' && args[1] === 'lint') return skillLintCmd(arg('--path', args[2] && !args[2].startsWith('-') && /^([A-Za-z]:[\\/]|\/|\.\.?[\\/])/.test(args[2]) ? args[2] : process.cwd()), args[2] && !args[2].startsWith('-') && !/^([A-Za-z]:[\\/]|\/|\.\.?[\\/])/.test(args[2]) ? args[2] : null); // 1.36.26: 메타 품질 lint
21311
21422
  if (cmd === 'skill' && args[1] === 'list') return skillList(args[2] || arg('--path', process.cwd()));
21312
21423
  if (cmd === 'skill' && args[1] === 'info') return skillInfo(args[2], absRoot(arg('--path', process.cwd())));
21313
21424
  if (cmd === 'skill' && args[1] === 'add') return addSkill(absRoot(arg('--path', process.cwd())), args[2]);
package/lib/pure-utils.js CHANGED
@@ -461,6 +461,42 @@ function _parseSkillMd(text) {
461
461
  return { meta, body: m[2] };
462
462
  }
463
463
 
464
+ // 1.36.26 (obra/superpowers P1): SKILL 메타 품질 lint — 순수함수(의존 0), _parseSkillMd 산출(meta, body) 을 받는다.
465
+ // 설계 원칙(메모리 교훈 — 게이트 휴리스틱은 false-PASS 로 편향, false-BLOCK 금지):
466
+ // · ERROR = 기계적 판정만(FP 0 이 확실한 것) — 이것만 exit 1 대상.
467
+ // · WARNING = 형태 검사(저FP — displayNameKo 합성 흔적 등). 기본 exit 0, --strict 시에만 승격.
468
+ // · INFO = 주관적 권고(트리거절 부재 등) — 절대 실패 아님.
469
+ // 한국어 적응: 트리거절은 ko("~할 때 사용"/"언제 사용")·en("Use when/for") 모두 인정. 3인칭 검사는 한국어(인칭 무표지)에
470
+ // 부적용이라 제외. 본문 예산은 CJK 분기 — 공백분리 단어수를 한국어에 쓰면 어절 카운트라 전면 오발(비CJK=단어수, CJK=char).
471
+ function _lintSkillMeta(meta, body, opts = {}) {
472
+ const errors = [], warnings = [], infos = [];
473
+ const m = meta || {};
474
+ const b = String(body || '');
475
+ const name = String(m.name || '').trim();
476
+ const desc = String(m.description || '').trim();
477
+ // ERROR — 기계적
478
+ if (!name) errors.push({ code: 'name_missing', msg: 'frontmatter name 필수' });
479
+ else if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) errors.push({ code: 'name_charset', msg: `name 은 소문자/숫자/하이픈만: "${name}"` });
480
+ if (!desc) errors.push({ code: 'description_missing', msg: 'frontmatter description 필수 — 에이전트가 "지금 로드할까"를 판단하는 유일한 신호' });
481
+ else if (desc.length > 1024) errors.push({ code: 'description_too_long', msg: `description ${desc.length}자 > 1024 (트리거 조건만 담을 것)` });
482
+ // WARNING — 저FP 형태
483
+ if (desc && name && desc.toLowerCase() === name.toLowerCase()) warnings.push({ code: 'description_repeats_name', msg: 'description 이 name 반복 — 트리거 조건이 없음' });
484
+ if (desc && desc.length < 40) warnings.push({ code: 'description_too_short', msg: `description ${desc.length}자 < 40 — 표시명 합성 흔적("~스킬" 류)일 가능성` });
485
+ if (desc && /^[^,]+(, [^,]+){2,}$/.test(desc) && !/(사용|때|Use when|use this)/i.test(desc)) warnings.push({ code: 'description_capability_list', msg: 'description 이 capabilities 나열 형태 — 트리거 조건으로 재작성 권장' });
486
+ // INFO — 주관적(절대 실패 아님)
487
+ const hasTrigger = /Use (when|this when|for)\b/i.test(desc) || /(할|일|하는|이런)\s*(때|경우)에?\s*사용|언제\s*사용|때\s*사용/.test(desc);
488
+ if (desc && !hasTrigger) infos.push({ code: 'no_trigger_clause', msg: '트리거절 없음 — "~할 때 사용" / "Use when …" 형태 권장' });
489
+ // 본문 예산 — CJK 분기 (Hangul/한자/가나 비율 30%+ 면 CJK 로 판단; 문자 기반)
490
+ const cjkChars = (b.match(/[ㄱ-힝一-鿿぀-ヿ]/g) || []).length;
491
+ const totalChars = b.replace(/\s/g, '').length;
492
+ const isCjk = totalChars > 0 && cjkChars / totalChars >= 0.3;
493
+ const wordCount = b.split(/\s+/).filter(Boolean).length;
494
+ const charCount = b.length;
495
+ if (isCjk) { if (charCount > 12000) infos.push({ code: 'body_budget', msg: `본문 ${charCount}자 (CJK 기준 12000자 초과) — 자주 로드되는 스킬이면 분할 권장` }); }
496
+ else if (wordCount > 5000) infos.push({ code: 'body_budget', msg: `본문 ${wordCount}단어 (5000 초과) — 분할 권장` });
497
+ return { errors, warnings, infos, wordCount, charCount, lang: isCjk ? 'cjk' : 'latin' };
498
+ }
499
+
464
500
  // 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭 — catalog + 텍스트 → 매칭 플랫폼/제약/제안 (fs 의존 0, catalog 주입).
465
501
  // 1.31.2 (UR-0010): optional lang ('en') → 영어 suggestion. 기본 'ko' (무회귀, selftest 2-arg 호출 보존).
466
502
  function _matchConstraints(catalog, text, lang) {
@@ -1105,7 +1141,7 @@ module.exports = {
1105
1141
  // 1.9.346 (UR-0025 심층): roadmap CSS 변수 빌더
1106
1142
  _roadmapTokenStyles,
1107
1143
  // 1.9.347 (UR-0025 심층): SKILL.md frontmatter 파서 (BOM-aware)
1108
- _parseSkillMd,
1144
+ _parseSkillMd, _lintSkillMeta,
1109
1145
  // 1.9.333 (UR-0025 심층): 순수 플랫폼 제약 매칭
1110
1146
  _matchConstraints,
1111
1147
  // 1.9.333 패턴 적용: 순수 도메인 매칭
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leerness",
3
- "version": "1.36.25",
3
+ "version": "1.36.27",
4
4
  "description": "The AI-coding operations layer that makes \"done\" require evidence — persistent memory, evidence-gated completion checks, and clean handoffs for any AI agent (Claude Code, Codex, Cursor). State lives as plain files in your repo. CLI + MCP, 0 runtime dependencies.",
5
5
  "keywords": [
6
6
  "leerness",