Skip to content

Add autonomy levels (L0-L4), claude-lessons tool, and MCP server guide - #29

Merged
BcKmini merged 5 commits into
mainfrom
feat/autonomy-lessons-mcp
Aug 10, 2026
Merged

Add autonomy levels (L0-L4), claude-lessons tool, and MCP server guide#29
BcKmini merged 5 commits into
mainfrom
feat/autonomy-lessons-mcp

Conversation

@BcKmini

@BcKmini BcKmini commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Three features inspired by "AI Agent 시대, 나는 AI를 어떻게 써야 할까?", closing #26, #27, #28:

  • Autonomy levels (L0-L4) — a new axis, separate from harness type (tight/loose/adaptive), for how much human checking a task needs. All 11 agents now declare an autonomy: field; claude-harness validates it and gained an autonomy subcommand; documented in docs/HARNESS-GUIDE.md(.ko).
  • claude-lessons — an 8th tool that records why something failed and how it was fixed (vs. claude-handoff's session-scoped state), searchable by tag/keyword, meant to accumulate indefinitely.
  • MCP server guide (docs/MCP-GUIDE.md(.ko) + examples/mcp-lessons-server.py) — when to convert a CLI tool into an MCP server Claude calls mid-conversation vs. keeping it a slash command/manual pipe, with a working example wrapping claude-lessons.

Also fixes two pre-existing bugs found while verifying this branch (unrelated to the above, see the first commit for detail):

  • scripts/validate-agents.sh used declare -A, which crashes on bash 3.2 (stock macOS /bin/bash) — the script never actually ran on macOS.
  • tools/claude-pipeline.py's list command had a nested f-string with a backslash-escaped quote that's a SyntaxError on every Python version — claude-pipeline was completely broken (even --help failed at import).

And syncs README.ko.md, which had fallen out of date (missing the Tool 6/7 detail sections and the full 11-agent repo layout that README.md already had) — left as-is it would have only gotten worse with this PR's additions.

Test plan

All run locally (Python 3.14.6; no Rust toolchain available in this environment, no rust/ files touched):

  • python3 -m py_compile on every changed/added Python file
  • make test-python (sandboxed HOME) — all 6 tools pass, including the previously-broken claude-pipeline
  • claude-harness check-all — all 11 agents pass the new autonomy check (2 unrelated pre-existing failures on 06/07 confirmed via git diff origin/main to predate this branch)
  • bash scripts/validate-agents.sh --strict — now runs at all on bash 3.2; non-strict passes
  • claude-lessons exercised end-to-end (add/list/search/show/context), including a same-second ID-collision fix found during testing
  • examples/mcp-lessons-server.py exercised end-to-end against a real mcp==1.29.0 install (all 3 tools registered and callable) — also how the mcp>=1.2,<2 pin was discovered (pip install mcp alone now installs a 2.x rewrite with a different API)
  • Scripted relative-link + anchor check across all touched Markdown files — no broken links

Summary by CodeRabbit

  • 새 기능

    • 실패 원인과 해결 방법을 저장·조회·검색·태그 필터링할 수 있는 claude-lessons 도구와 /lessons 명령을 추가했습니다.
    • 세션에 관련 교훈을 불러오는 컨텍스트 기능을 제공합니다.
    • MCP를 통해 교훈 관리 기능을 사용할 수 있는 예제와 가이드를 추가했습니다.
    • 하네스 자율성 수준(L0~L4) 표시 및 검증 기능을 추가했습니다.
  • 문서

    • 설치 방법, 에이전트 자율성, 세션 워크플로와 MCP 활용 안내를 업데이트했습니다.
  • 개선

    • 설치·상태 확인·테스트 과정에서 새 도구를 지원합니다.

- scripts/validate-agents.sh used `declare -A`, which crashes on bash 3.2
  (the default /bin/bash on every stock macOS install, despite the repo's
  own "Platform: macOS" badge). Replaced with a portable space-delimited
  set so the script actually runs on macOS.
- tools/claude-pipeline.py `list` used a backslash-escaped quote inside an
  f-string nested in another f-string — a SyntaxError on every Python
  version, so `claude-pipeline list`/`--help` never worked at all. Hoisted
  the value into a local variable instead.
- Added __pycache__/*.pyc to .gitignore (generated while testing tools/).

Found while verifying the autonomy/lessons/MCP-guide changes in this branch.
Harness type (tight/loose/adaptive) controls output constraint; autonomy
level is a separate axis for how much human checking a task needs before
or after the AI acts. Adds the 5-level model (L0 human-only .. L4 fully
autonomous, L2 draft+review as the common default) from the AI Agent
autonomy article this branch is based on.

- autonomy: field added to all 11 agent frontmatters, assigned per role
- claude-harness.py: new required check (autonomy declared), `autonomy`
  subcommand printing the L0-L4 table, templates updated
- harness-designer (09): new design step + Autonomy Level output field
- docs/HARNESS-GUIDE.md(.ko): new Autonomy Levels section
- README Agent Roster table: new Autonomy column
- /harness command + cheatsheets: autonomy validate check + prompts

Closes #26
claude-handoff captures session state; nothing in this project recorded
WHY something failed and HOW it was fixed, so the next session (or agent)
had no way to avoid repeating a past mistake. Unlike handoffs, lessons
accumulate indefinitely and are searchable by tag/keyword rather than
pruned by age.

  claude-lessons add       # symptom / root cause / fix / tags
  claude-lessons list       # recent, optionally filtered by tag
  claude-lessons search Q   # keyword search
  claude-lessons context    # pipeable into claude for session-start context

Stdlib-only, mirrors tools/claude-handoff.py conventions. Wired into
Makefile install-tools/status/test-python and install.sh's TOOLS array.

Closes #27
Documents when to convert a CLI tool into an MCP server (Claude calls it
mid-conversation) vs. keeping it a slash command or manual pipe (human
stays in control of when it runs) — including a guideline against wrapping
mutating/write actions as auto-callable MCP tools, tied to the autonomy
levels added earlier in this branch.

examples/mcp-lessons-server.py wraps tools/claude-lessons.py (add_lesson,
search_lessons, recent_lessons) via the `mcp` Python SDK's FastMCP API.
Lives under examples/, not tools/, since tools/ must stay dependency-free
per docs/CONTRIBUTING.md — documented there as the one exception.

Verified end-to-end against a real `mcp` install: `pip install mcp` now
pulls a 2.x release that reworked/moved FastMCP, so the guide and example
both pin `mcp>=1.2,<2`, confirmed working with 1.29.0.

Closes #28
…guide

- Agent Roster: new Autonomy column + explanation
- Tools: 7 -> 8, new Tool 8 (claude-lessons) section, /lessons row,
  repo layout tree, context-cost-tips row
- Nav bars + repo layout: MCP-GUIDE.md(.ko) link
- README.ko.md also gets the harness/pipeline Tool 6/7 detail sections and
  full 11-agent repo layout it was missing — it had fallen out of sync
  with README.md (only the slash-command table and top badges had been
  updated when those tools were added), which this branch's changes would
  otherwise have made worse
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 939eef55-3265-4f8b-8b60-8c6f1cbae981

📥 Commits

Reviewing files that changed from the base of the PR and between 5261819 and f614a3a.

📒 Files selected for processing (33)
  • .claude/commands/harness.md
  • .claude/commands/lessons.md
  • .gitignore
  • Makefile
  • README.ko.md
  • README.md
  • agents/00-orchestrator.md
  • agents/01-planner.md
  • agents/02-implementer.md
  • agents/03-reviewer.md
  • agents/04-tester.md
  • agents/05-security-auditor.md
  • agents/06-performance-optimizer.md
  • agents/07-database-expert.md
  • agents/08-documenter.md
  • agents/09-harness-designer.md
  • agents/10-pipeline-orchestrator.md
  • docs/AGENT-CHEATSHEET.ko.md
  • docs/AGENT-CHEATSHEET.md
  • docs/CONTRIBUTING.ko.md
  • docs/CONTRIBUTING.md
  • docs/HARNESS-GUIDE.ko.md
  • docs/HARNESS-GUIDE.md
  • docs/INTEGRATION.ko.md
  • docs/INTEGRATION.md
  • docs/MCP-GUIDE.ko.md
  • docs/MCP-GUIDE.md
  • examples/mcp-lessons-server.py
  • install.sh
  • scripts/validate-agents.sh
  • tools/claude-harness.py
  • tools/claude-lessons.py
  • tools/claude-pipeline.py

📝 Walkthrough

Walkthrough

자율성 L0-L4 선언과 검증 기능이 하네스와 에이전트 설정에 추가되었습니다. claude-lessons CLI가 교훈 저장·검색·컨텍스트 출력을 지원합니다. Lessons MCP 서버 예제와 설치, 문서, 저장소 안내가 갱신되었습니다.

Changes

자율성 검증과 설계

Layer / File(s) Summary
자율성 검증과 에이전트 메타데이터
.claude/commands/harness.md, tools/claude-harness.py, agents/*.md, scripts/validate-agents.sh
에이전트에 autonomy: L0-L4 선언을 추가했습니다. 하네스 CLI가 자율성 표를 출력하고 선언을 검증합니다.
자율성 설계 지침과 문서
agents/09-harness-designer.md, docs/HARNESS-GUIDE*, docs/AGENT-CHEATSHEET*, README*
L0-L4 기준, 선택 절차, 에이전트별 수준, 검증 명령을 문서화했습니다.

Lessons 기능

Layer / File(s) Summary
Lessons CLI와 세션 컨텍스트
tools/claude-lessons.py, .claude/commands/lessons.md, docs/AGENT-CHEATSHEET*, README*
교훈을 Markdown으로 저장하고 목록, 상세 조회, 검색, 태그 필터, 세션 컨텍스트 출력을 제공합니다.
Lessons MCP 서버
examples/mcp-lessons-server.py, docs/MCP-GUIDE*, docs/INTEGRATION*, docs/CONTRIBUTING*
add_lesson, search_lessons, recent_lessons MCP 도구와 실행·등록 지침을 추가했습니다.

설치와 저장소 문서

Layer / File(s) Summary
설치와 저장소 문서 갱신
Makefile, install.sh, .gitignore, README*, tools/claude-pipeline.py
claude-lessons 설치와 도움말 검사를 추가했습니다. 도구 수, 저장소 구조, 관련 명령 문서를 갱신했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

Poem

당근처럼 교훈을 차곡차곡,
L0부터 L4까지 줄을 맞춰요.
하네스는 이제 기준을 알고,
MCP는 lessons를 실어 나르고,
토끼도 다음 실패를 기록해요. 🐇

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/autonomy-lessons-mcp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BcKmini
BcKmini merged commit c04b867 into main Aug 10, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant