@uzysjung/agent-harness 26.146.0 → 26.147.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.
Files changed (34) hide show
  1. package/dist/{chunk-OEIGA5IL.js → chunk-GPH5AWLX.js} +450 -53
  2. package/dist/chunk-GPH5AWLX.js.map +1 -0
  3. package/dist/index.js +607 -530
  4. package/dist/index.js.map +1 -1
  5. package/dist/trust-tier-drift.js +1 -1
  6. package/package.json +4 -2
  7. package/templates/CLAUDE.md +14 -5
  8. package/templates/agents/implementer.md +1 -1
  9. package/templates/codex/AGENTS.md.template +11 -0
  10. package/templates/opencode/AGENTS.md.template +8 -1
  11. package/templates/opencode/opencode.json.template +0 -1
  12. package/templates/rules/cli-development.md +2 -2
  13. package/templates/rules/doc-governance.md +3 -1
  14. package/templates/rules/test-policy.md +5 -6
  15. package/templates/scripts/check-absence.sh +205 -0
  16. package/templates/settings.json +0 -9
  17. package/templates/skills/gh-issue-workflow/ISSUE.template.md +111 -35
  18. package/templates/skills/gh-issue-workflow/SKILL.md +268 -138
  19. package/templates/skills/gh-issue-workflow/references/hierarchy.md +261 -0
  20. package/templates/skills/gh-issue-workflow/references/operating-model.md +132 -0
  21. package/templates/skills/gh-issue-workflow/references/readiness.md +121 -0
  22. package/templates/skills/ui-visual-review/SKILL.md +17 -3
  23. package/dist/chunk-OEIGA5IL.js.map +0 -1
  24. package/templates/commands/ecc/checkpoint.md +0 -32
  25. package/templates/commands/ecc/e2e.md +0 -105
  26. package/templates/commands/ecc/eval.md +0 -88
  27. package/templates/commands/ecc/evolve.md +0 -7
  28. package/templates/commands/ecc/harness-audit.md +0 -73
  29. package/templates/commands/ecc/instinct-status.md +0 -8
  30. package/templates/commands/ecc/promote.md +0 -10
  31. package/templates/commands/ecc/security-scan.md +0 -10
  32. package/templates/hooks/mcp-pre-exec.sh +0 -122
  33. package/templates/mcp-allowlist.example +0 -24
  34. package/templates/rules/playwright-launch.md +0 -16
@@ -1,73 +0,0 @@
1
- # Harness Audit Command
2
-
3
- Run a deterministic repository harness audit and return a prioritized scorecard.
4
-
5
- ## Usage
6
-
7
- `/harness-audit [scope] [--format text|json] [--root path]`
8
-
9
- - `scope` (optional): `repo` (default), `hooks`, `skills`, `commands`, `agents`
10
- - `--format`: output style (`text` default, `json` for automation)
11
- - `--root`: audit a specific path instead of the current working directory
12
-
13
- ## Deterministic Engine
14
-
15
- Always run:
16
-
17
- ```bash
18
- node scripts/harness-audit.js <scope> --format <text|json> [--root <path>]
19
- ```
20
-
21
- This script is the source of truth for scoring and checks. Do not invent additional dimensions or ad-hoc points.
22
-
23
- Rubric version: `2026-03-30`.
24
-
25
- The script computes 7 fixed categories (`0-10` normalized each):
26
-
27
- 1. Tool Coverage
28
- 2. Context Efficiency
29
- 3. Quality Gates
30
- 4. Memory Persistence
31
- 5. Eval Coverage
32
- 6. Security Guardrails
33
- 7. Cost Efficiency
34
-
35
- Scores are derived from explicit file/rule checks and are reproducible for the same commit.
36
- The script audits the current working directory by default and auto-detects whether the target is the ECC repo itself or a consumer project using ECC.
37
-
38
- ## Output Contract
39
-
40
- Return:
41
-
42
- 1. `overall_score` out of `max_score` (70 for `repo`; smaller for scoped audits)
43
- 2. Category scores and concrete findings
44
- 3. Failed checks with exact file paths
45
- 4. Top 3 actions from the deterministic output (`top_actions`)
46
- 5. Suggested ECC skills to apply next
47
-
48
- ## Checklist
49
-
50
- - Use script output directly; do not rescore manually.
51
- - If `--format json` is requested, return the script JSON unchanged.
52
- - If text is requested, summarize failing checks and top actions.
53
- - Include exact file paths from `checks[]` and `top_actions[]`.
54
-
55
- ## Example Result
56
-
57
- ```text
58
- Harness Audit (repo): 66/70
59
- - Tool Coverage: 10/10 (10/10 pts)
60
- - Context Efficiency: 9/10 (9/10 pts)
61
- - Quality Gates: 10/10 (10/10 pts)
62
-
63
- Top 3 Actions:
64
- 1) [Security Guardrails] Add prompt/tool preflight security guards in hooks/hooks.json. (hooks/hooks.json)
65
- 2) [Tool Coverage] Sync commands/harness-audit.md and .opencode/commands/harness-audit.md. (.opencode/commands/harness-audit.md)
66
- 3) [Eval Coverage] Increase automated test coverage across scripts/hooks/lib. (tests/)
67
- ```
68
-
69
- ## Arguments
70
-
71
- $ARGUMENTS:
72
- - `repo|hooks|skills|commands|agents` (optional scope)
73
- - `--format text|json` (optional output format)
@@ -1,8 +0,0 @@
1
- CL-v2에서 학습된 모든 instinct를 표시한다 (프로젝트 스코프 + 글로벌).
2
-
3
- ```bash
4
- python3 .claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
5
- ```
6
-
7
- 각 instinct는 신뢰도 점수(0.3-0.9)와 함께 표시. 도메인별로 그룹화.
8
- high-confidence instinct(≥0.8)는 Rule 승격 후보로 표시된다.
@@ -1,10 +0,0 @@
1
- 프로젝트 스코프 instinct를 글로벌 스코프로 승격시킨다.
2
-
3
- ```bash
4
- python3 .claude/skills/continuous-learning-v2/scripts/instinct-cli.py promote [id]
5
- ```
6
-
7
- id 없이 실행하면 승격 후보(confidence ≥ 0.8, 2개+ 프로젝트에서 확인)를 목록 표시.
8
- id를 지정하면 해당 instinct를 글로벌로 승격.
9
-
10
- 글로벌 instinct는 모든 프로젝트에서 활성화된다.
@@ -1,10 +0,0 @@
1
- Claude Code 설정(.claude/ 디렉토리)에 대한 AgentShield 보안 스캔을 실행한다.
2
-
3
- `npx ecc-agentshield scan` 을 실행하여 CLAUDE.md, settings.json, MCP 서버, hooks, agent 정의에서 보안 취약점, 설정 오류, 인젝션 위험을 검사한다.
4
-
5
- 옵션:
6
- - `--fix`: 자동 수정 가능한 항목 수정 (하드코딩 시크릿 → 환경변수 참조 등)
7
- - `--min-severity medium`: 최소 심각도 필터
8
- - `--format json|markdown|html`: 출력 형식
9
-
10
- 결과는 A-F 등급으로 표시. CRITICAL/HIGH 발견 시 즉시 조치 필요.
@@ -1,122 +0,0 @@
1
- #!/bin/bash
2
- # ============================================================
3
- # mcp-pre-exec.sh — PreToolUse hook (mcp__.* matcher)
4
- #
5
- # 목적: MCP tool 호출을 화이트리스트 + 위험 패턴으로 차단.
6
- # CVE-2025-59536, CVE-2026-21852 (hooks/MCP RCE) 대응.
7
- #
8
- # 호출: templates/settings.json의 PreToolUse 매처 "mcp__.*" 에서 실행.
9
- # 입력: stdin JSON (tool_name, tool_input, cwd, session_id, ...)
10
- # 출력: stderr 경고 + exit 2 차단 또는 exit 0 통과
11
- #
12
- # 화이트리스트: $CLAUDE_PROJECT_DIR/.mcp-allowlist
13
- # - 한 줄에 하나의 서버 이름 (예: context7, github, chrome-devtools)
14
- # - '#' 주석, 빈 줄 허용
15
- # - 파일 없으면 모든 MCP 호출 통과 (opt-in 구조 — 사용자가 의도적으로 활성)
16
- #
17
- # 위험 파라미터 패턴: stdin의 tool_input에 다음 패턴 감지 시 차단
18
- # - rm -rf, curl | sh, wget | bash, eval, base64 decode + exec
19
- #
20
- # Exit codes:
21
- # 0: 통과 (MCP 아님, 화이트리스트 매칭, 또는 allowlist 없음)
22
- # 2: 차단 (서버 비매칭 또는 위험 패턴 감지)
23
- #
24
- # 차단 로그: $CLAUDE_PROJECT_DIR/.uzys-agent-harness/hook-blocks.log — 차단 시에만 1줄.
25
- # ============================================================
26
- set -u
27
-
28
- PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
29
- ALLOWLIST="$PROJECT_DIR/.mcp-allowlist"
30
-
31
- # 차단 계측 — 차단 경로에서만 1줄 append. 통과를 기록하면 로그가 차단 계측으로 못 쓰인다.
32
- # 실패 허용은 이 함수 안에서만 선언한다 (cli-development.md §set 플래그): 로그를 못 쓰는
33
- # 상태여도 차단 판정은 그대로여야 한다 — 계측이 방어를 깨면 안 된다. stderr 를 버리는 것은
34
- # 이 훅의 stderr 가 사용자에게 보이는 차단 사유이기 때문이다.
35
- log_block() {
36
- local dir="$PROJECT_DIR/.uzys-agent-harness"
37
- {
38
- mkdir -p "$dir" &&
39
- printf '%s\tmcp-pre-exec\t%s\n' \
40
- "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$(printf '%s' "$1" | tr '\n\r' ' ')" \
41
- >>"$dir/hook-blocks.log"
42
- } 2>/dev/null || return 0
43
- }
44
-
45
- # stdin JSON 파싱
46
- INPUT=$(cat 2>/dev/null || echo "{}")
47
-
48
- TOOL_NAME=""
49
- if command -v jq &>/dev/null; then
50
- TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null || echo "")
51
- else
52
- # jq 없을 때 bash 폴백
53
- TOOL_NAME=$(echo "$INPUT" | grep -oE '"tool_name"[[:space:]]*:[[:space:]]*"[^"]*"' | sed -E 's/.*"([^"]*)"$/\1/')
54
- fi
55
-
56
- # MCP tool 이 아니면 즉시 통과
57
- case "$TOOL_NAME" in
58
- mcp__*__*) ;;
59
- *) exit 0 ;;
60
- esac
61
-
62
- # 서버 이름 추출: mcp__<server>__<tool> → <server>
63
- SERVER_NAME=$(echo "$TOOL_NAME" | awk -F'__' '{print $2}')
64
-
65
- if [ -z "$SERVER_NAME" ]; then
66
- echo "[mcp-pre-exec] WARN: cannot extract server name from '$TOOL_NAME'" >&2
67
- exit 0
68
- fi
69
-
70
- # 화이트리스트 대조 (파일 없으면 opt-in 미활성 — 통과)
71
- if [ ! -f "$ALLOWLIST" ]; then
72
- exit 0
73
- fi
74
-
75
- # 화이트리스트에 서버 있는지 확인 (주석/빈 줄 제외)
76
- MATCHED=false
77
- while IFS= read -r line; do
78
- # 주석과 빈 줄 skip
79
- case "$line" in
80
- ""|"#"*) continue ;;
81
- esac
82
- # trim whitespace
83
- clean=$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
84
- if [ "$clean" = "$SERVER_NAME" ]; then
85
- MATCHED=true
86
- break
87
- fi
88
- done < "$ALLOWLIST"
89
-
90
- if [ "$MATCHED" = false ]; then
91
- log_block "$TOOL_NAME (server not in allowlist)"
92
- echo "[mcp-pre-exec] BLOCKED: MCP server '$SERVER_NAME' not in allowlist" >&2
93
- echo "" >&2
94
- echo "Tool: $TOOL_NAME" >&2
95
- echo "Allowlist: $ALLOWLIST" >&2
96
- echo "" >&2
97
- echo "이 서버를 허용하려면 '$SERVER_NAME'을 $ALLOWLIST 에 한 줄로 추가." >&2
98
- exit 2
99
- fi
100
-
101
- # 위험 파라미터 패턴 검사 (tool_input 전체를 문자열로)
102
- TOOL_INPUT_JSON=""
103
- if command -v jq &>/dev/null; then
104
- TOOL_INPUT_JSON=$(echo "$INPUT" | jq -r '.tool_input // empty' 2>/dev/null || echo "")
105
- else
106
- TOOL_INPUT_JSON=$(echo "$INPUT" | grep -oE '"tool_input"[[:space:]]*:[[:space:]]*\{[^}]*\}')
107
- fi
108
-
109
- if [ -n "$TOOL_INPUT_JSON" ]; then
110
- if echo "$TOOL_INPUT_JSON" | grep -qE "rm -rf|curl[^|]*\| *sh|wget[^|]*\| *bash|\beval\b.*\\\$|base64[[:space:]]+-d.*\| *sh"; then
111
- log_block "$TOOL_NAME (suspicious tool_input pattern)"
112
- echo "[mcp-pre-exec] BLOCKED: suspicious parameter pattern in tool_input" >&2
113
- echo "" >&2
114
- echo "Tool: $TOOL_NAME" >&2
115
- echo "위험 패턴 감지: rm -rf / curl|sh / wget|bash / eval \$... / base64-d|sh" >&2
116
- echo "" >&2
117
- echo "의도된 사용이면 .mcp-allowlist 대신 이 서버의 다른 호출 경로 검토 필요." >&2
118
- exit 2
119
- fi
120
- fi
121
-
122
- exit 0
@@ -1,24 +0,0 @@
1
- # MCP Server Allowlist — opt-in security gate
2
- #
3
- # mcp-pre-exec.sh hook이 이 파일을 참조해 MCP 서버 호출을 화이트리스트
4
- # 방식으로 차단한다. 파일이 없으면 opt-in 미활성 (모든 MCP 호출 통과).
5
- #
6
- # 사용법:
7
- # 1. 이 파일을 프로젝트 루트에 `.mcp-allowlist` 이름으로 복사
8
- # 2. 허용할 MCP 서버 이름을 한 줄에 하나씩 작성
9
- # 3. '#' 주석과 빈 줄 허용
10
- #
11
- # 서버 이름 확인 방법:
12
- # - .mcp.json의 `mcpServers` 필드 키 이름
13
- # - 또는 PreToolUse에서 tool_name `mcp__<server>__<tool>` 의 <server>
14
- #
15
- # 기본 프로젝트 서버 (templates/mcp.json):
16
- context7
17
- github
18
- chrome-devtools
19
-
20
- # Track별 추가 서버 예시 (주석 해제 후 사용):
21
- # supabase # csr-supabase Track
22
- # railway # 배포 Track
23
- # notion # executive Track
24
- # playwright # UI Track
@@ -1,16 +0,0 @@
1
- # Playwright Launch
2
-
3
- 브라우저를 띄워 **사용자가 직접 쓰는** 모든 상황(E2E 수동 확인, UX 비교, fidelity audit, OAuth 로그인)에 적용. 여기 남긴 것은 **위반을 막는 금지문뿐**이다 — 절차·스크립트 골격·사용 패턴은 `ui-visual-review` 스킬이 SSOT. 금지문만 상주하는 이유는 위반이 **작업을 시작한 뒤에** 일어나서, 스킬 발화를 기다리면 이미 늦기 때문이다.
4
-
5
- ## 절대 금지
6
-
7
- - **사용자 활성 Chrome 에 attach** (`mcp__chrome-devtools__*`) — 입력 latency.
8
- - **일회성 browser context** (Playwright MCP, `browser.newContext()`) — 영속 profile dir 이 없어 cookie/IndexedDB/SW 가 휘발한다. 매 launch 재로그인 + 버벅임.
9
- - **사용자가 키를 입력하는 동안 자동화 process 동시 실행** (CDP latency).
10
- - **reference SaaS(Linear/Notion/Jira 등) 측 `page.goto()`·`page.reload()`** — sidebar click only.
11
-
12
- ## 필수 · 위반 시
13
-
14
- 영속 profile dir + Chrome for Testing 별도 binary. 사용자 입력 구간에는 자동화 layer 0 — capture 는 입력이 끝난 뒤 별도 process 에서. 구현 형태는 `ui-visual-review` 스킬 참조.
15
-
16
- 일회성 context 나 devtools attach 를 발견하면 즉시 닫고 영속 profile launcher 로 재기동한다. 사용자가 "버벅인다"고 하면 본 rule 위반 확인이 1순위다.