claude-pro-minmax 1.3.1 → 1.4.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/.claude/CLAUDE.md CHANGED
@@ -49,7 +49,8 @@ Pro Plan constraints. Every message = quota. Optimize for Pass@1.
49
49
  | Implementation | @builder | Haiku | None → Escalate |
50
50
  | Quality Review | @reviewer | Haiku | None → Escalate |
51
51
 
52
- @dplanner tools: `sequential-thinking`, `perplexity`, `context7`
52
+ @dplanner tools: `sequential-thinking`, `perplexity`, `Read`, `Glob`, `Grep`
53
+ Current library docs can be handled by the official Context7 Claude Code integration when installed.
53
54
 
54
55
  ## DEFAULT WORKFLOW
55
56
  - Simple (1-3 files): `/do` — batch plan+build+verify in one shot
@@ -12,7 +12,7 @@
12
12
  | 에이전트 | 모델 | 역할 | 도구 | 질문 |
13
13
  |---------|------|------|------|------|
14
14
  | `planner.md` | Sonnet 4.6 | 아키텍처 및 설계 결정 | Read, Glob, Grep (읽기 전용) | ≤3 (기본값 포함) |
15
- | `dplanner.md` | Sonnet 4.6 | 연구 기반 심층 계획 | sequential-thinking, perplexity, context7, Read, Glob, Grep | 무제한 |
15
+ | `dplanner.md` | Sonnet 4.6 | 연구 기반 심층 계획 | sequential-thinking, perplexity, Read, Glob, Grep | 무제한 |
16
16
  | `builder.md` | Haiku 4.5 | 구현 (2-retry cap) | Read, Write, Edit, Bash, Glob, Grep | 없음 → 에스컬레이션 |
17
17
  | `reviewer.md` | Haiku 4.5 | 코드 검토 및 QA | Read, Glob, Grep (읽기 전용, 강제) | 없음 → 에스컬레이션 |
18
18
 
@@ -42,7 +42,7 @@
42
42
  **기능:**
43
43
  - `sequential-thinking`: 다단계 논리 검증
44
44
  - `perplexity`: 웹 연구 (블로그, 포럼, 최신 아티클)
45
- - `context7`: 라이브러리 문서 조회
45
+ - 설치된 공식 Context7 Claude Code 통합을 통한 최신 라이브러리 문서 조회
46
46
 
47
47
  **출력 예산:** 최대 60줄 (코드 블록 제외). 출처 + 출처당 1줄 인사이트만.
48
48
 
@@ -154,7 +154,7 @@ flowchart TD
154
154
  | @planner와 @dplanner에 Sonnet 4.6 사용 | 아키텍처 결정은 추론 능력 필요. Pro Plan에서 Sonnet 4.6가 Opus 4.6보다 가성비 우수 |
155
155
  | @builder 2-retry cap | Quota 소진 방지. 2회 실패 → Sonnet 4.6/Opus 4.6으로 에스컬레이션 또는 @planner로 재설계 |
156
156
  | @reviewer 읽기 전용 강제 | Hook 기반 차단(`readonly-check.sh`). 검토 중 실수로 수정하는 것 방지 |
157
- | @dplanner에 MCP 도구 제공 | 연구가 많은 작업은 MCP 오버헤드 정당화 가능. `sequential-thinking` + `perplexity` + `context7`로 실패 없는 계획 가능 |
157
+ | @dplanner에 연구 도구 + 공식 문서 통합 제공 | 연구가 많은 작업은 깊은 계획이 필요합니다. `sequential-thinking` + `perplexity`로 추론과 조사를 처리하고, 최신 라이브러리 문서는 공식 Context7이 설치된 경우 사용할 수 있습니다 |
158
158
  | 에이전트별 출력 예산 | Output은 Input의 5배 비용 (API 가격). 엄격한 예산: builder 5줄, reviewer 1줄 PASS / 30줄 FAIL, dplanner 60줄, planner 1문장/작업 |
159
159
  | @builder 원자적 롤백 | `~/.claude/scripts/snapshot.sh`가 depth guard + 라벨 확인 포함 `git stash` 처리. 무관한 사용자 stash pop 방지. 실패 시 `pop` (또는 clean tree에서 `git checkout .`) → 즉시 에스컬레이션 가능한 깨끗한 상태. 실패당 2-4 메시지 절약은 추정치이며, API 비용은 0 |
160
160
 
@@ -12,7 +12,7 @@ Contains sub-agent definitions for role-based task delegation with model optimiz
12
12
  | Agent | Model | Role | Tools | Questions |
13
13
  |-------|-------|------|-------|-----------|
14
14
  | `planner.md` | Sonnet 4.6 | Architecture & design decisions | Read, Glob, Grep (read-only) | ≤3 (with defaults) |
15
- | `dplanner.md` | Sonnet 4.6 | Deep planning with research | sequential-thinking, perplexity, context7, Read, Glob, Grep | Unlimited |
15
+ | `dplanner.md` | Sonnet 4.6 | Deep planning with research | sequential-thinking, perplexity, Read, Glob, Grep | Unlimited |
16
16
  | `builder.md` | Haiku 4.5 | Implementation (2-retry cap) | Read, Write, Edit, Bash, Glob, Grep | None → Escalate |
17
17
  | `reviewer.md` | Haiku 4.5 | Code review & QA | Read, Glob, Grep (read-only, enforced) | None → Escalate |
18
18
 
@@ -42,7 +42,7 @@ Contains sub-agent definitions for role-based task delegation with model optimiz
42
42
  **Capabilities:**
43
43
  - `sequential-thinking`: Multi-step logic verification
44
44
  - `perplexity`: Web research (blogs, forums, latest articles)
45
- - `context7`: Library documentation lookup
45
+ - Current library docs via the official Context7 Claude Code integration when installed
46
46
 
47
47
  **Output Budget:** Max 60 lines (code blocks excluded). Cite source + 1-line insight per source.
48
48
 
@@ -154,7 +154,7 @@ flowchart TD
154
154
  | Sonnet 4.6 for @planner and @dplanner | Architecture decisions need reasoning capability. Sonnet 4.6 balances cost/performance better than Opus 4.6 on Pro Plan |
155
155
  | @builder 2-retry cap | Prevents quota drain. Failed twice → Escalate to Sonnet 4.6/Opus 4.6 or @planner for re-design |
156
156
  | @reviewer read-only enforcement | Hook-based blocking (`readonly-check.sh`). Prevents accidental modifications during review |
157
- | @dplanner with MCP tools | Research-heavy tasks justify MCP overhead. `sequential-thinking` + `perplexity` + `context7` enable fail-proof planning |
157
+ | @dplanner with research tools + official docs integration | Research-heavy tasks justify deeper planning. `sequential-thinking` + `perplexity` cover reasoning and web research, while current library docs can use official Context7 when installed |
158
158
  | Output Budget per agent | Output costs 5x Input (API pricing). Strict budgets: builder 5 lines, reviewer 1 line PASS / 30 lines FAIL, dplanner 60 lines, planner 1 sentence/task |
159
159
  | @builder atomic rollback | `~/.claude/scripts/snapshot.sh` handles `git stash` with depth guard + label check before `/do` execution. Prevents popping unrelated user stashes. Failure triggers `pop` (or `git checkout .` on clean tree) → clean state for immediate escalation. Estimated savings: 2-4 messages per failure, zero API cost |
160
160
 
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: dplanner
3
- description: Deep Planner - Architecture specialist with extended thinking and research capabilities. Use for high-complexity architectural design.
3
+ description: Deep Planner - Architecture specialist with extended thinking and research capabilities. Use for high-complexity architectural design and deep research.
4
4
  model: sonnet
5
5
  permissionMode: plan
6
- tools: sequential-thinking, perplexity, context7, Read, Glob, Grep
6
+ tools: sequential-thinking, perplexity, Read, Glob, Grep
7
7
  disallowedTools: Write, Edit, Bash
8
8
  ---
9
9
 
@@ -15,7 +15,7 @@ You prioritize **Correctness** and **Completeness** over speed.
15
15
  ## Core Capabilities
16
16
  1. **Sequential Thinking**: Use `sequential-thinking` to break down complex logic into verified steps.
17
17
  2. **Web Research**: Use `perplexity` for comprehensive web research (blogs, forums, latest articles).
18
- 3. **Documentation Lookup**: Use `context7` to fetch full documentation for libraries.
18
+ 3. **Documentation Lookup**: When current library docs are needed, use the official Context7 Claude Code integration if it is installed.
19
19
 
20
20
  ## When to Use
21
21
  - Designing large-scale refactoring.
@@ -25,7 +25,7 @@ You prioritize **Correctness** and **Completeness** over speed.
25
25
  ## Workflow
26
26
  1. **Analyze**: Break down the user request.
27
27
  2. **Think**: Use `sequential-thinking` to formulate a hypothesis or plan.
28
- 3. **Research**: Use `perplexity` for web research, `context7` for library docs.
28
+ 3. **Research**: Use `perplexity` for web research, and use official Context7 when current library docs are required.
29
29
  4. **Verify**: Cross-check your plan against constraints.
30
30
  5. **Output**: Deliver a comprehensive, fail-proof plan.
31
31
 
@@ -38,7 +38,7 @@ You prioritize **Correctness** and **Completeness** over speed.
38
38
  - Validated Logic: ...
39
39
 
40
40
  ### 2. Research Findings
41
- - Source: [Context7/Docs]
41
+ - Source: [Official docs via Context7 or web]
42
42
  - Key Insight: ...
43
43
 
44
44
  ### 3. Architecture Design
@@ -52,6 +52,7 @@ You prioritize **Correctness** and **Completeness** over speed.
52
52
  ## Rules
53
53
  - **DO NOT** guess. Verify everything.
54
54
  - **DO NOT** write code. That is for @builder.
55
+ - Keep official Context7 command details out of this prompt; use installed integration behavior or official docs instead.
55
56
  - Use `sequential-thinking` for any logic deeper than 2 levels.
56
57
  - Maximum 60 lines output (code blocks excluded from count)
57
58
  - Research Findings: cite source + 1-line insight per source (no long quotes)
@@ -15,7 +15,7 @@
15
15
  | `do-sonnet.md` | Sonnet으로 실행 | context: fork, model: sonnet |
16
16
  | `do-opus.md` | Opus로 실행 | context: fork, model: opus |
17
17
  | `plan.md` | 복잡한 작업 | @planner → @builder 체인 |
18
- | `dplan.md` | 심층 계획 | @dplanner (Sequential Thinking + Perplexity + Context7) |
18
+ | `dplan.md` | 심층 계획 | @dplanner (Sequential Thinking + Perplexity + 공식 Context7 설치 시) |
19
19
  | `review.md` | 코드 검토 | 읽기 전용, 카테고리 |
20
20
  | `learn.md` | 패턴 캡처 | 자동 추출 또는 명시적 지정 |
21
21
  | `session-save.md` | 상태 저장 | 비밀 정보 삭제 |
@@ -23,7 +23,7 @@
23
23
  | `load-context.md` | 컨텍스트 로드 | Read tool, 비용 경제 |
24
24
  | `compact-phase.md` | 전략적 축소 | 단계 인식 가지치기 |
25
25
  | `watch.md` | tmux 모니터링 | 메시지 비용 없음 |
26
- | `llms-txt.md` | LLM 최적화 문서 | URL에서 /llms.txt 조회 |
26
+ | `llms-txt.md` | LLM 최적화 문서 | URL에서 raw /llms.txt 조회 |
27
27
  | `analyze-failures.md` | 도구 오류 분석 | 하이브리드 학습 (로그 + 분석) |
28
28
 
29
29
  ## 명령어 카테고리
@@ -64,7 +64,7 @@
64
64
  | 명령어 | 사용 시점 | 리소스 사용량 |
65
65
  |---------|-------------|--------------|
66
66
  | `/watch` | 장기 실행 프로세스 모니터링 | 로컬 tmux (API 사용 안 함) |
67
- | `/llms-txt` | LLM 최적화 문서 조회 | 최소 (WebFetch) |
67
+ | `/llms-txt` | raw LLM 최적화 문서 조회 | 최소 (WebFetch) |
68
68
 
69
69
  ## 워크플로우 예시
70
70
 
@@ -102,7 +102,7 @@
102
102
  # 3. 연구 결과를 바탕으로 구현
103
103
  # (복잡도에 따라 /plan 또는 /do 사용)
104
104
  ```
105
- **Quota:** 높음 (Sonnet 4.6 + Sequential Thinking + Perplexity + Context7)
105
+ **Quota:** 높음 (Sonnet 4.6 + Sequential Thinking + Perplexity + 공식 Context7 설치 시)
106
106
 
107
107
  ### 디버깅 및 학습
108
108
  ```bash
@@ -144,7 +144,7 @@
144
144
  | **사용 사례** | 간단한 작업 | 복잡한 로직 | 중요한 결정 | 다중 파일 기능 | 미지의 영역 |
145
145
  | **영향받는 파일** | 1-3 | 1-3 | 제한없음 | 5+ | 제한없음 |
146
146
  | **질문** | 불가 | 불가 | 불가 | ≤3 (기본값 포함) | 무제한 |
147
- | **연구 도구** | 불가 | 불가 | 불가 | 불가 | 가능 (Perplexity, Context7) |
147
+ | **연구 도구** | 불가 | 불가 | 불가 | 불가 | 가능 (Perplexity + 공식 Context7 설치 시) |
148
148
 
149
149
  **결정 트리:**
150
150
  ```
@@ -15,7 +15,7 @@ Contains slash command definitions for common workflows.
15
15
  | `do-sonnet.md` | Execute with Sonnet | context: fork, model: sonnet |
16
16
  | `do-opus.md` | Execute with Opus | context: fork, model: opus |
17
17
  | `plan.md` | Complex tasks | @planner → @builder chain |
18
- | `dplan.md` | Deep Planning | @dplanner (Sequential Thinking + Perplexity + Context7) |
18
+ | `dplan.md` | Deep Planning | @dplanner (Sequential Thinking + Perplexity + official Context7 when installed) |
19
19
  | `review.md` | Code review | Read-only, categories |
20
20
  | `learn.md` | Capture patterns | Auto-extract or explicit |
21
21
  | `session-save.md` | Save state | Secret scrubbing |
@@ -23,7 +23,7 @@ Contains slash command definitions for common workflows.
23
23
  | `load-context.md` | Load context | Read tool, cost economy |
24
24
  | `compact-phase.md` | Strategic compact | Phase-aware pruning |
25
25
  | `watch.md` | tmux monitoring | Zero message cost |
26
- | `llms-txt.md` | LLM Documentation | Fetch /llms.txt from URLs |
26
+ | `llms-txt.md` | LLM Documentation | Fetch raw /llms.txt from URLs |
27
27
  | `analyze-failures.md` | Analyze tool errors | Hybrid learning (log + analyze) |
28
28
 
29
29
  ## Command Categories
@@ -64,7 +64,7 @@ Contains slash command definitions for common workflows.
64
64
  | Command | When to Use | Resource Usage |
65
65
  |---------|-------------|----------------|
66
66
  | `/watch` | Monitor long-running processes | Local tmux (zero API usage) |
67
- | `/llms-txt` | Fetch LLM-optimized documentation | Minimal (WebFetch) |
67
+ | `/llms-txt` | Fetch raw LLM-optimized documentation | Minimal (WebFetch) |
68
68
 
69
69
  ## Workflow Examples
70
70
 
@@ -102,7 +102,7 @@ Contains slash command definitions for common workflows.
102
102
  # 3. Implement based on research findings
103
103
  # (Use /plan or /do based on complexity)
104
104
  ```
105
- **Quota:** High (Sonnet 4.6 + Sequential Thinking + Perplexity + Context7)
105
+ **Quota:** High (Sonnet 4.6 + Sequential Thinking + Perplexity + official Context7 when installed)
106
106
 
107
107
  ### Debugging & Learning
108
108
  ```bash
@@ -144,7 +144,7 @@ Contains slash command definitions for common workflows.
144
144
  | **Use Case** | Simple tasks | Complex logic | Critical decisions | Multi-file features | Unknown unknowns |
145
145
  | **Files Affected** | 1-3 | 1-3 | Any | 5+ | Any |
146
146
  | **Questions** | No | No | No | ≤3 (with defaults) | Unlimited |
147
- | **Research Tools** | No | No | No | No | Yes (Perplexity, Context7) |
147
+ | **Research Tools** | No | No | No | No | Yes (Perplexity + official Context7 when installed) |
148
148
 
149
149
  **Decision Tree:**
150
150
  ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dplan
3
- description: Deep planning with @dplanner. Use for extremely complex tasks requiring Sequential Thinking, Perplexity research, and Context7 documentation.
3
+ description: Deep planning with @dplanner. Use for extremely complex tasks requiring Sequential Thinking, Perplexity research, and current official library docs lookup when Context7 is installed.
4
4
  argument-hint: [complex feature description]
5
5
  context: fork
6
6
  agent: dplanner
@@ -12,7 +12,7 @@ agent: dplanner
12
12
 
13
13
  ## Purpose
14
14
  Invokes the **Deep Planner** for high-complexity architectural design and research.
15
- Unlike `/plan`, this command utilizes `sequential-thinking`, `perplexity`, and `context7` for maximum depth.
15
+ Unlike `/plan`, this command utilizes `sequential-thinking`, `perplexity`, and official Context7 for current library docs when it is installed.
16
16
 
17
17
  ## Arguments
18
18
  $ARGUMENTS
@@ -23,7 +23,7 @@ $ARGUMENTS
23
23
  - Analyzes request.
24
24
  - Uses Sequential Thinking for logic verification.
25
25
  - Uses Perplexity for web research.
26
- - Uses Context7 for library documentation.
26
+ - Uses official Context7 when current library documentation is needed.
27
27
  - Produces a comprehensive "Deep Plan".
28
28
  3. Returns plan to main conversation.
29
29
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: llms-txt
3
- description: Fetch llms.txt documentation for a library. Use when Context7 doesn't cover a library.
3
+ description: Fetch raw llms.txt documentation for a library or direct URL. Use when you explicitly want raw /llms.txt content or when official Context7 is unavailable.
4
4
  argument-hint: nextjs | prisma | supabase | [custom-url]
5
5
  allowed-tools: Bash(curl:*)
6
6
  ---
@@ -38,9 +38,9 @@ curl -s https://nextjs.org/llms.txt | head -200
38
38
  ```
39
39
 
40
40
  ## When to Use
41
- - Context7 MCP가 해당 라이브러리를 찾지 못할
42
- - 빠른 원샷 문법 확인이 필요할
43
- - 최신 API 문서가 필요할
41
+ - You explicitly want the raw `/llms.txt` file
42
+ - You want a direct URL-based docs fetch
43
+ - You need a quick one-shot raw-doc pull instead of official Context7
44
44
 
45
45
  ## Examples
46
46
  ```
@@ -28,7 +28,7 @@ skills/
28
28
 
29
29
  | 스킬 | 용도 | 주요 이점 |
30
30
  | :--- | :--- | :--- |
31
- | `cli-wrappers` | 무거운 MCP 서버를 가벼운 CLI 패턴으로 대체 | 출력을 상당히 줄임 |
31
+ | `cli-patterns` | 무거운 MCP 서버를 가벼운 CLI 패턴으로 대체 | 출력을 상당히 줄임 |
32
32
  | `learned` | `/learn` 명령어를 통해 학습된 패턴 저장 | 재작업 및 반복 질문 방지 |
33
33
 
34
34
  ## 커스텀 스킬 추가 방법
@@ -57,4 +57,4 @@ Claude는 아래 조건이 충족될 때만 `read_file` 도구를 사용하여
57
57
  ## 권장 사항
58
58
  1. **50줄 규칙**: `SKILL.md`가 50줄을 넘어가면 세부 내용을 `references/`로 옮기세요.
59
59
  2. **명시적 트리거**: **"Claude는 반드시 ...을 로드해야 합니다"**와 같은 강조 문구를 사용하여 모델이 패턴을 따르게 하세요.
60
- 3. **상대 경로**: 도구 실행 실패를 방지하기 위해 항상 프로젝트 루트부터의 전체 경로(`.claude/skills/...`)를 제공하세요.
60
+ 3. **상대 경로**: 도구 실행 실패를 방지하기 위해 항상 프로젝트 루트부터의 전체 경로(`.claude/skills/...`)를 제공하세요.
@@ -28,7 +28,7 @@ Instead of loading extensive documentation every time, Claude starts with only t
28
28
 
29
29
  | Skill | Purpose | Key Benefit |
30
30
  | :--- | :--- | :--- |
31
- | `cli-wrappers` | Replaces heavy MCP servers with slim CLI patterns. | Significantly reduces output tokens. |
31
+ | `cli-patterns` | Replaces heavy MCP servers with slim CLI patterns. | Significantly reduces output tokens. |
32
32
  | `learned` | Stores project-specific patterns via `/learn`. | Prevents rework & repeat questions. |
33
33
 
34
34
  ## Adding a Custom Skill
@@ -57,4 +57,4 @@ Contains the heavy stuff: Full API docs, long code examples, error message table
57
57
  ## Best Practices
58
58
  1. **The 50-Line Rule**: If `SKILL.md` exceeds 50 lines, move details to `references/`.
59
59
  2. **Explicit Triggers**: Use bold text like **"Claude MUST load..."** to ensure the model follows the pattern.
60
- 3. **Relative Paths**: Always provide the full path from the project root (e.g., `.claude/skills/...`) to avoid tool failures.
60
+ 3. **Relative Paths**: Always provide the full path from the project root (e.g., `.claude/skills/...`) to avoid tool failures.
@@ -1,12 +1,13 @@
1
1
  ---
2
- name: cli-wrappers
3
- description: Use CLI tools instead of MCP to reduce cost. Provides JSON output patterns for gh, mgrep, psql, etc.
2
+ name: cli-patterns
3
+ description: Use token-efficient CLI patterns instead of verbose MCP output when direct shell tools are enough. Provides JSON or compact-output conventions for gh, mgrep, psql, and similar tools.
4
4
  ---
5
5
 
6
- # CLI Wrappers Skill
6
+ # CLI Patterns Skill
7
7
 
8
8
  ## Purpose
9
- Replace MCPs with CLI. ALWAYS use JSON output + jq.
9
+ Prefer compact, stable CLI output over verbose MCP output when direct shell tools are enough.
10
+ Use JSON + jq when a tool supports it, and otherwise use the smallest practical text or CSV output mode.
10
11
 
11
12
  ## GitHub (gh)
12
13
  ```bash
package/.claude.json CHANGED
@@ -7,13 +7,6 @@
7
7
  "@modelcontextprotocol/server-sequential-thinking"
8
8
  ]
9
9
  },
10
- "context7": {
11
- "command": "npx",
12
- "args": [
13
- "-y",
14
- "@upstash/context7-mcp"
15
- ]
16
- },
17
10
  "_perplexity_disabled_by_default": {
18
11
  "command": "npx",
19
12
  "args": [
@@ -25,4 +18,4 @@
25
18
  }
26
19
  }
27
20
  }
28
- }
21
+ }
package/README.ko.md CHANGED
@@ -16,7 +16,7 @@ CPMM은 모델 라우팅, 출력 제어, 로컬 안전장치로 리셋 전까지
16
16
 
17
17
  > **설치 완료했다면 여기서 시작하세요: [사용자 가이드](docs/USER-MANUAL.ko.md)**
18
18
  >
19
- > **New in v1.3.1:** RTK를 이미 켜둔 사용자에 대해 `cpmm setup`이 관리된 hook 순서와 timeout을 자동 복원합니다.
19
+ > **New in v1.4.0:** `cpmm setup`에서 `ctx7` 전역 설치 공식 Context7 Claude Code 설정까지 opt-in으로 실행할 수 있고, `/llms-txt`는 explicit raw-doc fallback으로 유지됩니다.
20
20
 
21
21
  ---
22
22
 
@@ -52,22 +52,38 @@ cpmm setup
52
52
  cpmm doctor
53
53
  ```
54
54
 
55
- > **v1.3.1 참고:** `cpmm setup`은 지원 환경에서 RTK 설치를 계속 시도합니다. RTK 활성화는 여전히 opt-in이지만, 한 번 켠 뒤에는 CPMM이 관리된 hook 순서와 timeout을 자동 복원합니다.
55
+ ### 4. 선택: 최신 라이브러리 문서 설정
56
+
57
+ 이제 interactive `cpmm setup`에서 권장 Context7 경로 전체를 opt-in으로 실행할 수 있습니다.
58
+
59
+ 공식 수동 설정 경로:
60
+ ```bash
61
+ npm install -g ctx7
62
+ ctx7 setup --cli --claude
63
+ ```
64
+
65
+ - CPMM은 Context7를 기본 MCP 경로로 취급하지 않습니다.
66
+ - 공식 설정 후에는 Context7의 공식 문서 통합이 최신 라이브러리 문서 조회를 처리합니다.
67
+ - `/llms-txt`는 raw `/llms.txt` 내용이나 URL 기반 raw-doc 조회가 필요할 때만 사용하세요.
68
+
69
+ > **v1.4.0 참고:** `cpmm setup`은 지원 환경에서 RTK 설치를 계속 시도합니다. RTK 활성화는 여전히 opt-in이며, Context7 opt-in은 `ctx7` 전역 설치와 공식 Claude Code 설정을 함께 진행합니다.
56
70
 
57
71
  의존성 정책:
58
72
  - `required`: `jq`, `mgrep`, `tmux`
73
+ - `optional` (interactive opt-in): `ctx7` + 공식 Context7 Claude 통합
59
74
  - `optional` (자동 설치 시도): `rtk`
60
75
  - `optional` (확인만): `claude` (사전 설치 가정)
61
76
  - 도구별 자동 설치 경로:
62
77
  - `mgrep`: `npm`
78
+ - `ctx7`: `npm` + `ctx7 setup --cli --claude` (`cpmm setup`에서 interactive opt-in)
63
79
  - `rtk`: `brew` 또는 upstream `curl` installer
64
80
  - `jq`, `tmux`: `brew` (macOS) 또는 Linux 패키지 매니저 `apt-get`, `dnf`, `pacman`, `apk`
65
81
  - macOS에서 Homebrew가 없으면 설치 명령을 안내합니다
66
82
 
67
- ### 4. 커스텀 & 업데이트 정책
83
+ ### 5. 커스텀 & 업데이트 정책
68
84
 
69
- - `cpmm setup`은 누락된 의존성을 설치한 뒤, CPMM 설정(설정 파일 복사, 언어 선택, Perplexity 설정)까지 진행합니다.
70
- - `cpmm doctor`는 수정 없이 의존성 상태와 RTK hook 상태를 확인합니다.
85
+ - `cpmm setup`은 누락된 의존성을 설치한 뒤, CPMM 설정(설정 파일 복사, 언어 선택, Perplexity 설정, optional `ctx7` 설치 + 공식 Context7 설정, managed config 정리)까지 진행합니다.
86
+ - `cpmm doctor`는 수정 없이 의존성 상태, Context7 상태, RTK hook 상태를 확인합니다.
71
87
  - 재실행 시 CPMM 관리 파일은 최신 버전으로 교체되고, 사용자 데이터는 보존됩니다.
72
88
 
73
89
  ```text
@@ -76,7 +92,7 @@ cpmm doctor
76
92
  ├── commands/ 🔄 업데이트 시 교체됨
77
93
  ├── contexts/ 🔄 업데이트 시 교체됨
78
94
  ├── scripts/ 🔄 업데이트 시 교체됨
79
- ├── skills/cli-wrappers/ 🔄 업데이트 시 교체됨
95
+ ├── skills/cli-patterns/ 🔄 업데이트 시 교체됨
80
96
  ├── rules/*.md 🔄 업데이트 시 교체됨
81
97
  ├── settings.json 🔄 업데이트 시 교체됨
82
98
  ├── settings.local.json ✋ 사용자 소유 — 보존됨
@@ -98,10 +114,15 @@ cpmm doctor
98
114
  > 1. 글로벌 커스텀은 일반적으로 `settings.local.json`에 둡니다. `settings.json`은 CPMM 관리 대상이라 업데이트 시 덮어쓰기되므로, RTK 같은 third-party hook을 여기에 넣었다면 업데이트 후 다시 확인해야 합니다.
99
115
  > 2. 커스텀 명령어/규칙은 프로젝트 `.claude/`에 — 글로벌 `commands/`는 CPMM이 관리합니다.
100
116
 
117
+ 관리 설정 경계:
118
+ - `~/.claude.json`은 CPMM 관리 대상이며 업데이트 시 정리될 수 있습니다.
119
+ - regular file `~/.mcp.json`은 사용자 소유라 CPMM이 자동 수정하지 않습니다.
120
+ - symlink `~/.mcp.json`은 CPMM 관리 호환 경로로 취급합니다.
121
+
101
122
  프로젝트 초기화 팁:
102
123
  - `claude` 실행 전에 `project-templates/`를 참고해 프로젝트를 초기화하세요. (설치기는 `project-templates`를 `~/.claude`로 복사하지 않습니다.)
103
124
 
104
- ### 5. Bash 명령 출력 필터링 (RTK)
125
+ ### 6. Bash 명령 출력 필터링 (RTK)
105
126
 
106
127
  RTK는 CPMM이 지원하는 **선택적 Bash 명령 출력 필터링 계층**입니다. `cpmm setup`은 RTK 바이너리 설치를 시도하지만, RTK hook은 기본 활성화하지 않습니다.
107
128
 
@@ -139,13 +160,20 @@ cpmm doctor
139
160
  rtk init -g --uninstall
140
161
  ```
141
162
 
142
- ### 6. 고급 (선택)
163
+ ### 7. 고급 (선택)
143
164
  <details>
144
165
  <summary>Perplexity, 언어, 수동 설치 보기</summary>
145
166
 
146
- **Perplexity/언어 설정 (필수 아님):**
147
- - Perplexity는 `/dplan`의 웹 리서치에 사용됩니다. 설정하지 않아도 `/dplan`은 Sequential Thinking + Context7으로 동작하며, 나머지 모든 기능은 Perplexity와 무관합니다.
167
+ **Perplexity/언어/Context7 설정 (필수 아님):**
168
+ - Perplexity는 `/dplan`의 웹 리서치에 사용됩니다. 설정하지 않아도 `/dplan`은 Sequential Thinking으로 동작하고, 최신 라이브러리 문서는 공식 Context7 설치된 경우 사용할 수 있습니다. 나머지 모든 기능은 Perplexity와 무관합니다.
148
169
  - 최초 인터랙티브 설치 시 `cpmm setup`이 출력 언어와 Perplexity API 키를 묻습니다.
170
+ - `cpmm setup`은 `ctx7` 전역 설치 후 공식 Context7 Claude Code 설정까지 optional 단계로 제안할 수 있습니다.
171
+ - 수동 검증:
172
+ ```bash
173
+ command -v ctx7
174
+ ctx7 --version
175
+ cpmm doctor
176
+ ```
149
177
  - 영어(기본): 파일이 필요 없습니다. `~/.claude/rules/language.md`가 있으면 삭제하세요.
150
178
  - 비영어: `~/.claude/rules/language.md`를 만들어 원하는 언어를 지정하세요.
151
179
  - Perplexity를 수동으로 설정하려면 `~/.claude.json`의 `mcpServers`에 아래를 추가하세요:
@@ -273,7 +301,7 @@ flowchart LR
273
301
  | 명령어 | 설명 | 추천 상황 |
274
302
  | :--- | :--- | :--- |
275
303
  | **🧠 심층 실행** | | |
276
- | `/dplan [작업]` | **Sonnet 4.6** + Perplexity, Sequential Thinking, Context7 | 라이브러리 비교, 최신 기술 조사 (심층 연구) |
304
+ | `/dplan [작업]` | **Sonnet 4.6** + Perplexity, Sequential Thinking, 공식 Context7 설치 시 | 라이브러리 비교, 최신 기술 조사 (심층 연구) |
277
305
  | `/do-sonnet` | **Sonnet 4.6**로 직접 실행 | Haiku 4.5가 계속 실패할 때 수동 격상 |
278
306
  | `/do-opus` | **Opus 4.6**으로 직접 실행 | 매우 복잡한 문제 해결 (비용 주의) |
279
307
  | **💾 세션/컨텍스트** | | |
@@ -285,7 +313,7 @@ flowchart LR
285
313
  | `/learn` | 패턴 학습 및 저장 | 자주 반복되는 오류나 선호 스타일 등록 |
286
314
  | `/analyze-failures` | 오류 로그 분석 | 반복되는 에러 원인 파악 |
287
315
  | `/watch` | 프로세스 모니터링 (tmux) | 장시간 빌드/테스트 관찰 |
288
- | `/llms-txt` | 문서 가져오기 | 라이브러리 공식 문서를 LLM 포맷으로 로드 |
316
+ | `/llms-txt` | raw 문서 가져오기 | raw `/llms.txt` 내용 또는 직접 docs URL 로드 |
289
317
 
290
318
  </details>
291
319
 
@@ -324,7 +352,7 @@ flowchart LR
324
352
  | **🕹️ Commands** | /plan, /do, /review 등 14개 명령어 사용법 | [📂 **Commands 가이드**](.claude/commands/README.ko.md) |
325
353
  | **🪝 Hooks** | Pre-check, Auto-format 등 11개 자동화 스크립트 로직 | [📂 **Hooks 가이드**](scripts/hooks/README.ko.md) |
326
354
  | **📏 Rules** | 보안, 코드 스타일, 위험 명령어 차단 정책 | [📂 **Rules 가이드**](.claude/rules/README.ko.md) |
327
- | **🧠 Skills** | CLI Wrapper 도구 기술 명세 | [📂 **Skills 가이드**](.claude/skills/README.ko.md) |
355
+ | **🧠 Skills** | CLI Patterns 같은 도구 스킬 사양 | [📂 **Skills 가이드**](.claude/skills/README.ko.md) |
328
356
  | **🔧 Contexts** | Backend/Frontend 프로젝트별 컨텍스트 템플릿 | [📂 **Contexts 가이드**](.claude/contexts/README.ko.md) |
329
357
  | **💾 Sessions** | 세션 요약 저장 및 관리 구조 | [📂 **Sessions 가이드**](.claude/sessions/README.ko.md) |
330
358
  | **🛠️ Scripts** | Verify, Build, Test 범용 스크립트 모음 | [📂 **Scripts 가이드**](scripts/README.ko.md) |
@@ -341,7 +369,7 @@ flowchart LR
341
369
 
342
370
  ```text
343
371
  claude-pro-minmax
344
- ├── .claude.json # 글로벌 MCP 설정 (User Scope)
372
+ ├── .claude.json # 관리되는 글로벌 MCP 설정
345
373
  ├── .claudeignore # Claude 컨텍스트 제외 규칙
346
374
  ├── .gitignore # Git ignore 규칙
347
375
  ├── CONTRIBUTING.md # 기여 가이드
@@ -377,13 +405,13 @@ claude-pro-minmax
377
405
  │ │ ├── load-context.md # 사전 정의된 컨텍스트 템플릿 로드
378
406
  │ │ ├── learn.md # 새로운 패턴을 메모리에 저장
379
407
  │ │ ├── analyze-failures.md # 도구 실패 로그 분석
380
- │ │ └── llms-txt.md # LLM 최적화 문서 조회
408
+ │ │ └── llms-txt.md # raw /llms.txt 문서 조회
381
409
  │ ├── rules/ # 행동 규칙
382
410
  │ │ ├── critical-actions.md # 위험 명령어 차단 (rm -rf, git push -f, etc.)
383
411
  │ │ ├── code-style.md # 코딩 컨벤션 및 표준
384
412
  │ │ └── security.md # 보안 모범 사례
385
413
  │ ├── skills/ # 도구 능력
386
- │ │ ├── cli-wrappers/ # 경량 CLI 래퍼 (MCP 오버헤드 대체)
414
+ │ │ ├── cli-patterns/ # 경량 일반 CLI 패턴
387
415
  │ │ │ ├── SKILL.md # 스킬 정의 및 사용법
388
416
  │ │ │ └── references/ # CLI 참조 문서
389
417
  │ │ │ ├── github-cli.md
package/README.md CHANGED
@@ -16,7 +16,7 @@ CPMM helps Pro users complete more verified tasks before reset through model rou
16
16
 
17
17
  > **Already installed? Start here: [User Guide](docs/USER-MANUAL.md)**
18
18
  >
19
- > **New in v1.3.1:** `cpmm setup` now restores the managed RTK hook order and timeout for users who already enabled RTK.
19
+ > **New in v1.4.0:** `cpmm setup` can now install `ctx7` globally and then run the official Context7 Claude Code setup, while keeping `/llms-txt` as an explicit raw-doc fallback.
20
20
 
21
21
  ---
22
22
 
@@ -52,22 +52,38 @@ cpmm setup
52
52
  cpmm doctor
53
53
  ```
54
54
 
55
- > **v1.3.1 note:** `cpmm setup` still attempts RTK installation when supported. RTK activation remains opt-in, but once enabled CPMM now restores the managed hook order and timeout automatically.
55
+ ### 4. Optional: Current Library Docs Setup
56
+
57
+ During interactive `cpmm setup`, CPMM can now offer the full recommended Context7 path as an opt-in flow.
58
+
59
+ Official manual setup:
60
+ ```bash
61
+ npm install -g ctx7
62
+ ctx7 setup --cli --claude
63
+ ```
64
+
65
+ - CPMM does not treat Context7 as a default MCP path.
66
+ - After official setup, Context7's own docs integration handles current library doc lookups.
67
+ - Use `/llms-txt` only when you explicitly want raw `/llms.txt` content or a URL-based raw-doc fetch.
68
+
69
+ > **v1.4.0 note:** `cpmm setup` still attempts RTK installation when supported. RTK activation remains opt-in, and Context7 opt-in now installs the `ctx7` CLI plus the official Claude Code integration.
56
70
 
57
71
  Dependency policy:
58
72
  - `required`: `jq`, `mgrep`, `tmux`
73
+ - `optional` (interactive opt-in): `ctx7` + official Context7 Claude integration
59
74
  - `optional` (auto-install attempt): `rtk`
60
75
  - `optional` (check only): `claude` (assumed pre-installed)
61
76
  - auto-install paths by tool:
62
77
  - `mgrep`: `npm`
78
+ - `ctx7`: `npm` + `ctx7 setup --cli --claude` (interactive opt-in via `cpmm setup`)
63
79
  - `rtk`: `brew` or upstream `curl` installer
64
80
  - `jq`, `tmux`: `brew` (macOS) or Linux package managers `apt-get`, `dnf`, `pacman`, `apk`
65
81
  - on macOS without Homebrew, setup prints the Homebrew install command
66
82
 
67
- ### 4. Customization & Update Policy
83
+ ### 5. Customization & Update Policy
68
84
 
69
- - `cpmm setup` installs missing dependencies, then configures CPMM (copies config files, language selection, Perplexity setup).
70
- - `cpmm doctor` checks dependency status and RTK hook health without modifying anything.
85
+ - `cpmm setup` installs missing dependencies, then configures CPMM (copies config files, language selection, Perplexity setup, optional `ctx7` install + official Context7 setup, managed config cleanup).
86
+ - `cpmm doctor` checks dependency status, Context7 status, and RTK hook health without modifying anything.
71
87
  - Re-running `cpmm setup` replaces CPMM-managed files with the latest version while preserving user data.
72
88
 
73
89
  ```text
@@ -76,7 +92,7 @@ Dependency policy:
76
92
  ├── commands/ 🔄 Replaced on update
77
93
  ├── contexts/ 🔄 Replaced on update
78
94
  ├── scripts/ 🔄 Replaced on update
79
- ├── skills/cli-wrappers/ 🔄 Replaced on update
95
+ ├── skills/cli-patterns/ 🔄 Replaced on update
80
96
  ├── rules/*.md 🔄 Replaced on update
81
97
  ├── settings.json 🔄 Replaced on update
82
98
  ├── settings.local.json ✋ User-owned — preserved
@@ -98,10 +114,15 @@ Dependency policy:
98
114
  > 1. Global customization generally goes in `settings.local.json`. `settings.json` is CPMM-managed and overwritten on update; if you opt into RTK or other third-party hooks there, re-check them after updates.
99
115
  > 2. Custom commands/rules go in project `.claude/` — global `commands/` is managed by CPMM.
100
116
 
117
+ Managed config boundary:
118
+ - `~/.claude.json` is CPMM-managed and may be cleaned on update.
119
+ - Regular-file `~/.mcp.json` is user-owned and CPMM leaves it untouched.
120
+ - Symlinked `~/.mcp.json` is treated as CPMM-managed compatibility glue.
121
+
101
122
  Project initialization tip:
102
123
  - Before running `claude`, initialize your project with templates in `project-templates/` (not copied into `~/.claude`).
103
124
 
104
- ### 5. Bash Command-Output Filtering (RTK)
125
+ ### 6. Bash Command-Output Filtering (RTK)
105
126
 
106
127
  CPMM supports RTK as an **optional Bash command-output filtering layer** for Bash-heavy workflows. `cpmm setup` attempts to install the RTK binary, but CPMM does **not** enable the RTK hook by default.
107
128
 
@@ -139,13 +160,20 @@ Rollback:
139
160
  rtk init -g --uninstall
140
161
  ```
141
162
 
142
- ### 6. Advanced (Optional)
163
+ ### 7. Advanced (Optional)
143
164
  <details>
144
165
  <summary>Perplexity, language, manual install</summary>
145
166
 
146
- **Perplexity/Language setup (not required):**
147
- - Perplexity is used for web research in `/dplan`. Without it, `/dplan` still works via Sequential Thinking + Context7. All other features are unrelated to Perplexity.
167
+ **Perplexity/Language/Context7 setup (not required):**
168
+ - Perplexity is used for web research in `/dplan`. Without it, `/dplan` still works via Sequential Thinking, and current library docs can use official Context7 when installed. All other features are unrelated to Perplexity.
148
169
  - On fresh interactive installs, `cpmm setup` asks for output language and Perplexity API key.
170
+ - `cpmm setup` can also offer the recommended Context7 flow: global `ctx7` install followed by official Claude Code setup.
171
+ - For manual verification, use:
172
+ ```bash
173
+ command -v ctx7
174
+ ctx7 --version
175
+ cpmm doctor
176
+ ```
149
177
  - English (default): no file needed; remove `~/.claude/rules/language.md` if it exists.
150
178
  - Non-English: create `~/.claude/rules/language.md` with your preferred language.
151
179
  - To configure Perplexity manually, add this under `mcpServers` in `~/.claude.json`:
@@ -273,7 +301,7 @@ Full command list for more sophisticated tasks or session management.
273
301
  | Command | Description | Recommended Situation |
274
302
  | :--- | :--- | :--- |
275
303
  | **🧠 Deep Execution** | | |
276
- | `/dplan [task]` | **Sonnet 4.6** + Perplexity, Sequential Thinking, Context7 | Library comparison, latest tech research (Deep Research) |
304
+ | `/dplan [task]` | **Sonnet 4.6** + Perplexity, Sequential Thinking, official Context7 when installed | Library comparison, latest tech research (Deep Research) |
277
305
  | `/do-sonnet` | Execute directly with **Sonnet 4.6** | Manual escalation when Haiku 4.5 keeps failing |
278
306
  | `/do-opus` | Execute directly with **Opus 4.6** | Resolving extremely complex problems (Cost caution) |
279
307
  | **💾 Session/Context** | | |
@@ -285,7 +313,7 @@ Full command list for more sophisticated tasks or session management.
285
313
  | `/learn` | Learn and save patterns | Registering frequently recurring errors or preferred styles |
286
314
  | `/analyze-failures` | Analyze error logs | Identifying causes of recurring errors |
287
315
  | `/watch` | Process monitoring (tmux) | Observing long-running builds/tests |
288
- | `/llms-txt` | Fetch documentation | Loading official library docs in LLM format |
316
+ | `/llms-txt` | Fetch raw docs | Loading raw `/llms.txt` content or a direct docs URL |
289
317
 
290
318
  </details>
291
319
 
@@ -324,7 +352,7 @@ This project provides detailed documentation for each component. Refer to the li
324
352
  | **🕹️ Commands** | Usage of 14 commands including /plan, /do, /review | [📂 **Commands Guide**](.claude/commands/README.md) |
325
353
  | **🪝 Hooks** | Logic of 11 automation scripts including Pre-check, Auto-format | [📂 **Hooks Guide**](scripts/hooks/README.md) |
326
354
  | **📏 Rules** | Policies for Security, Code Style, Critical Actions | [📂 **Rules Guide**](.claude/rules/README.md) |
327
- | **🧠 Skills** | Technical specifications for tools like CLI Wrappers | [📂 **Skills Guide**](.claude/skills/README.md) |
355
+ | **🧠 Skills** | Technical specifications for tools like CLI Patterns | [📂 **Skills Guide**](.claude/skills/README.md) |
328
356
  | **🔧 Contexts** | Context templates for Backend/Frontend projects | [📂 **Contexts Guide**](.claude/contexts/README.md) |
329
357
  | **💾 Sessions** | Structure for session summary storage and management | [📂 **Sessions Guide**](.claude/sessions/README.md) |
330
358
  | **🛠️ Scripts** | Collection of general-purpose scripts for Verify, Build, Test | [📂 **Scripts Guide**](scripts/README.md) |
@@ -341,7 +369,7 @@ This project provides detailed documentation for each component. Refer to the li
341
369
 
342
370
  ```text
343
371
  claude-pro-minmax
344
- ├── .claude.json # Global MCP Settings (User Scope)
372
+ ├── .claude.json # Managed global MCP settings
345
373
  ├── .claudeignore # Files excluded from Claude's context
346
374
  ├── .gitignore # Git ignore rules
347
375
  ├── CONTRIBUTING.md # Contribution guide
@@ -377,13 +405,13 @@ claude-pro-minmax
377
405
  │ │ ├── load-context.md # Load pre-defined context templates
378
406
  │ │ ├── learn.md # Save new patterns to memory
379
407
  │ │ ├── analyze-failures.md # Analyze tool failure logs
380
- │ │ └── llms-txt.md # View LLM-optimized documentation
408
+ │ │ └── llms-txt.md # View raw /llms.txt documentation
381
409
  │ ├── rules/ # Behavioral Rules
382
410
  │ │ ├── critical-actions.md # Block dangerous commands (rm -rf, git push -f, etc.)
383
411
  │ │ ├── code-style.md # Coding conventions and standards
384
412
  │ │ └── security.md # Security best practices
385
413
  │ ├── skills/ # Tool Capabilities
386
- │ │ ├── cli-wrappers/ # Lightweight CLI wrappers (Replaces MCP overhead)
414
+ │ │ ├── cli-patterns/ # Lightweight general CLI patterns
387
415
  │ │ │ ├── SKILL.md # Skill definition and usage
388
416
  │ │ │ └── references/ # CLI reference documentation
389
417
  │ │ │ ├── github-cli.md
package/install.sh CHANGED
@@ -52,6 +52,215 @@ if [ -f "$HOME/.claude/settings.json" ] && grep -q "rtk-rewrite.sh" "$HOME/.clau
52
52
  HAS_EXISTING_RTK_HOOK=true
53
53
  fi
54
54
 
55
+ cleanup_managed_claude_json() {
56
+ local target="$1"
57
+ local status=0
58
+
59
+ [ -f "$target" ] || return 0
60
+
61
+ set +e
62
+ node - "$target" <<'NODE'
63
+ const fs = require("node:fs");
64
+
65
+ const target = process.argv[2];
66
+ const data = JSON.parse(fs.readFileSync(target, "utf8"));
67
+ const servers = data && typeof data === "object" ? data.mcpServers : null;
68
+
69
+ if (servers && Object.prototype.hasOwnProperty.call(servers, "context7")) {
70
+ delete servers.context7;
71
+ fs.writeFileSync(target, `${JSON.stringify(data, null, 4)}\n`);
72
+ process.exit(10);
73
+ }
74
+ NODE
75
+ status=$?
76
+ set -e
77
+
78
+ if [ "$status" -eq 0 ]; then
79
+ return 0
80
+ fi
81
+ if [ "$status" -eq 10 ]; then
82
+ echo "✅ Removed legacy Context7 MCP from ~/.claude.json"
83
+ return 0
84
+ fi
85
+
86
+ return "$status"
87
+ }
88
+
89
+ user_mcp_contains_legacy_context7() {
90
+ local target="$1"
91
+
92
+ [ -f "$target" ] || return 1
93
+
94
+ node - "$target" <<'NODE'
95
+ const fs = require("node:fs");
96
+
97
+ const target = process.argv[2];
98
+ const data = JSON.parse(fs.readFileSync(target, "utf8"));
99
+ const hasLegacyContext7 = Boolean(
100
+ data &&
101
+ typeof data === "object" &&
102
+ data.mcpServers &&
103
+ Object.prototype.hasOwnProperty.call(data.mcpServers, "context7")
104
+ );
105
+
106
+ process.exit(hasLegacyContext7 ? 0 : 1);
107
+ NODE
108
+ }
109
+
110
+ context7_cli_installed() {
111
+ command -v ctx7 >/dev/null 2>&1
112
+ }
113
+
114
+ context7_global_bin_path() {
115
+ if command -v ctx7 >/dev/null 2>&1; then
116
+ command -v ctx7
117
+ return 0
118
+ fi
119
+
120
+ if command -v npm >/dev/null 2>&1; then
121
+ NPM_PREFIX=$(npm prefix -g 2>/dev/null || true)
122
+ if [ -n "$NPM_PREFIX" ] && [ -x "$NPM_PREFIX/bin/ctx7" ]; then
123
+ printf '%s\n' "$NPM_PREFIX/bin/ctx7"
124
+ return 0
125
+ fi
126
+ fi
127
+
128
+ return 1
129
+ }
130
+
131
+ context7_official_skill_installed() {
132
+ [ -f "$HOME/.claude/skills/find-docs/SKILL.md" ]
133
+ }
134
+
135
+ context7_official_rule_installed() {
136
+ [ -f "$HOME/.claude/rules/context7.md" ]
137
+ }
138
+
139
+ context7_official_integration_installed() {
140
+ context7_official_skill_installed && context7_official_rule_installed
141
+ }
142
+
143
+ print_context7_manual_hints() {
144
+ echo " Re-run cpmm setup in an interactive terminal to opt in, or run the official commands directly:"
145
+ echo " npm install -g ctx7"
146
+ echo " ctx7 setup --cli --claude"
147
+ }
148
+
149
+ run_context7_global_install() {
150
+ if ! command -v npm >/dev/null 2>&1; then
151
+ echo "⚠️ Skipping Context7 global install (npm not found)."
152
+ print_context7_manual_hints
153
+ return 1
154
+ fi
155
+
156
+ echo ""
157
+ echo "📚 Context7 CLI Global Install"
158
+ echo " $ npm install -g ctx7"
159
+
160
+ if npm install -g ctx7; then
161
+ CONTEXT7_BIN=$(context7_global_bin_path || true)
162
+ if [ -n "${CONTEXT7_BIN:-}" ]; then
163
+ echo "✅ Context7 CLI installed"
164
+ CONTEXT7_VERSION=$("$CONTEXT7_BIN" --version 2>/dev/null | head -1 || true)
165
+ [ -n "$CONTEXT7_VERSION" ] && echo " Version: $CONTEXT7_VERSION"
166
+ return 0
167
+ fi
168
+
169
+ echo "⚠️ Context7 CLI installed but is not visible on PATH in this shell."
170
+ echo " A later step will use the resolved global binary path directly."
171
+ return 0
172
+ fi
173
+
174
+ echo "⚠️ Context7 global install did not complete."
175
+ print_context7_manual_hints
176
+ return 1
177
+ }
178
+
179
+ run_context7_official_setup() {
180
+ if ! command -v npm >/dev/null 2>&1; then
181
+ echo "⚠️ Skipping official Context7 setup (npm not found)."
182
+ print_context7_manual_hints
183
+ return 1
184
+ fi
185
+
186
+ if ! context7_global_bin_path >/dev/null 2>&1; then
187
+ if ! run_context7_global_install; then
188
+ return 1
189
+ fi
190
+ fi
191
+
192
+ CONTEXT7_BIN=$(context7_global_bin_path || true)
193
+ if [ -z "${CONTEXT7_BIN:-}" ]; then
194
+ echo "⚠️ Context7 CLI binary could not be resolved after install."
195
+ print_context7_manual_hints
196
+ return 1
197
+ fi
198
+
199
+ echo ""
200
+ echo "📚 Context7 Official CLI + Skills Setup"
201
+ echo " This runs the official Context7 Claude Code setup."
202
+ echo " $ $CONTEXT7_BIN setup --cli --claude"
203
+
204
+ if "$CONTEXT7_BIN" setup --cli --claude; then
205
+ echo "✅ Context7 official CLI + Skills setup complete"
206
+ return 0
207
+ fi
208
+
209
+ echo "⚠️ Official Context7 setup did not complete."
210
+ print_context7_manual_hints
211
+ return 1
212
+ }
213
+
214
+ offer_context7_setup() {
215
+ local choice="${CPMM_CONTEXT7_SETUP_CHOICE:-}"
216
+
217
+ if context7_cli_installed && context7_official_integration_installed; then
218
+ echo ""
219
+ echo "📚 Context7 Setup"
220
+ echo " Context7 CLI and official Claude integration are already installed."
221
+ return 0
222
+ fi
223
+
224
+ if [ -z "$choice" ] && [ ! -t 0 ]; then
225
+ echo ""
226
+ echo "📚 Context7 Setup (Optional)"
227
+ echo " Skipped in non-interactive mode."
228
+ print_context7_manual_hints
229
+ return 0
230
+ fi
231
+
232
+ case "$choice" in
233
+ official-setup|skip) ;;
234
+ *) choice="" ;;
235
+ esac
236
+
237
+ if [ -z "$choice" ]; then
238
+ echo ""
239
+ echo "📚 Context7 Setup (Optional)"
240
+ echo " Install ctx7 globally and run the official Context7 Claude Code setup?"
241
+ echo " 1) Yes, run npm install -g ctx7 + ctx7 setup --cli --claude (Recommended)"
242
+ echo " 2) Skip for now (default)"
243
+ echo -n " Select [1-2]: "
244
+ read -r CONTEXT7_CHOICE < /dev/tty || CONTEXT7_CHOICE="3"
245
+
246
+ case $CONTEXT7_CHOICE in
247
+ 1) choice="official-setup" ;;
248
+ *) choice="skip" ;;
249
+ esac
250
+ fi
251
+
252
+ case "$choice" in
253
+ official-setup)
254
+ run_context7_official_setup
255
+ ;;
256
+ *)
257
+ echo ""
258
+ echo "⚠️ Skipping Context7 setup for now."
259
+ print_context7_manual_hints
260
+ ;;
261
+ esac
262
+ }
263
+
55
264
  if [ "$IS_UPDATE" = false ] && [ -d "$HOME/.claude" ]; then
56
265
  if [ -d "$HOME/.claude.pre-cpmm" ]; then
57
266
  echo "⚠️ ~/.claude.pre-cpmm already exists, skipping backup."
@@ -131,11 +340,13 @@ done
131
340
 
132
341
  shopt -u nullglob
133
342
 
134
- # cli-wrappers/ and scripts/ — fully CPMM managed: rm-rf to remove stale files
135
- if [ -d "$SCRIPT_DIR/.claude/skills/cli-wrappers" ]; then
136
- rm -rf "$HOME/.claude/skills/cli-wrappers"
137
- cp -R "$SCRIPT_DIR/.claude/skills/cli-wrappers" "$HOME/.claude/skills/"
138
- fi
343
+ # managed skills/ and scripts/ — fully CPMM managed: rm-rf to remove stale files
344
+ for managed_skill in cli-patterns; do
345
+ if [ -d "$SCRIPT_DIR/.claude/skills/$managed_skill" ]; then
346
+ rm -rf "$HOME/.claude/skills/$managed_skill"
347
+ cp -R "$SCRIPT_DIR/.claude/skills/$managed_skill" "$HOME/.claude/skills/"
348
+ fi
349
+ done
139
350
  # sessions/ dir created above; example files stay in repo only (not installed)
140
351
  if [ -d "$SCRIPT_DIR/scripts" ]; then
141
352
  rm -rf "$HOME/.claude/scripts"
@@ -153,21 +364,33 @@ if [ -f "$SCRIPT_DIR/.claude.json" ]; then
153
364
  cp "$HOME/.claude.json" "$HOME/.claude.json.bak"
154
365
  fi
155
366
  cp "$SCRIPT_DIR/.claude.json" "$HOME/.claude.json"
156
- echo "✅ Installed .claude.json to ~/.claude.json (User Scope)"
367
+ echo "✅ Installed managed ~/.claude.json"
157
368
  elif [ ! -f "$HOME/.claude.json" ]; then
158
369
  cp "$SCRIPT_DIR/.claude.json" "$HOME/.claude.json"
159
370
  echo "✅ Restored missing ~/.claude.json from repository template"
160
371
  fi
161
372
 
162
- # Fresh install: enforce symlink. Update: restore only when missing (do not overwrite existing file/link).
163
- if [ "$IS_UPDATE" = false ]; then
164
- if [ ! -L "$HOME/.mcp.json" ] || [ "$(readlink "$HOME/.mcp.json" 2>/dev/null)" != "$HOME/.claude.json" ]; then
373
+ cleanup_managed_claude_json "$HOME/.claude.json"
374
+
375
+ # ~/.claude.json is CPMM-managed. Regular-file ~/.mcp.json is user-managed.
376
+ if [ -L "$HOME/.mcp.json" ]; then
377
+ if [ "$(readlink "$HOME/.mcp.json" 2>/dev/null)" != "$HOME/.claude.json" ]; then
165
378
  ln -sf "$HOME/.claude.json" "$HOME/.mcp.json"
166
- echo "✅ Ensured .mcp.json → .claude.json symlink"
379
+ echo "✅ Ensured managed .mcp.json → .claude.json symlink"
380
+ fi
381
+ elif [ -f "$HOME/.mcp.json" ]; then
382
+ echo "⚠️ Leaving regular ~/.mcp.json untouched (user-managed file)."
383
+ if user_mcp_contains_legacy_context7 "$HOME/.mcp.json"; then
384
+ echo " Detected legacy Context7 MCP in ~/.mcp.json."
385
+ echo " Remove it manually if you no longer want the legacy MCP path."
167
386
  fi
168
- elif [ ! -e "$HOME/.mcp.json" ] && [ ! -L "$HOME/.mcp.json" ]; then
387
+ else
169
388
  ln -s "$HOME/.claude.json" "$HOME/.mcp.json"
170
- echo " Restored missing .mcp.json → .claude.json symlink"
389
+ if [ "$IS_UPDATE" = true ]; then
390
+ echo "✅ Restored missing .mcp.json → .claude.json symlink"
391
+ else
392
+ echo "✅ Created .mcp.json → .claude.json symlink"
393
+ fi
171
394
  fi
172
395
  fi
173
396
 
@@ -250,6 +473,8 @@ LANGEOF
250
473
  fi
251
474
  fi
252
475
 
476
+ offer_context7_setup
477
+
253
478
  # EDGE CASE #9: guard find against missing dir (scripts/ may not exist on minimal installs)
254
479
  # Make scripts executable (Recursive)
255
480
  if [ -d "$HOME/.claude/scripts" ]; then
@@ -288,9 +513,22 @@ echo " > /dplan Analyze complex architecture"
288
513
  echo " > /do Implement the login page"
289
514
  echo ""
290
515
  echo "Dependency Check:"
291
- echo " cpmm setup # install missing deps (jq, mgrep, tmux) + attempt optional RTK install"
516
+ echo " cpmm setup # install missing deps (jq, mgrep, tmux) + offer ctx7 install + official Context7/RTK setup"
292
517
  echo " cpmm doctor # check status only"
293
518
  echo ""
519
+ echo "Context7 (Optional Official Integration):"
520
+ if context7_official_integration_installed; then
521
+ echo " Installed: official Context7 Claude integration"
522
+ else
523
+ echo " Re-run cpmm setup in an interactive terminal to opt in"
524
+ fi
525
+ if context7_cli_installed; then
526
+ echo " CLI: ctx7 ($(ctx7 --version 2>/dev/null | head -1 || echo 'installed'))"
527
+ else
528
+ echo " Manual CLI install: npm install -g ctx7"
529
+ fi
530
+ echo " Manual official setup: ctx7 setup --cli --claude"
531
+ echo ""
294
532
  if command -v rtk >/dev/null 2>&1; then
295
533
  echo "RTK (Optional Integration):"
296
534
  echo " Installed: rtk"
package/lib/cli.js CHANGED
@@ -47,6 +47,13 @@ const DEPS = [
47
47
  systemPackage: "tmux",
48
48
  description: "Terminal multiplexer for background agents",
49
49
  },
50
+ {
51
+ key: "ctx7",
52
+ command: "ctx7",
53
+ required: false,
54
+ installKind: "skip",
55
+ description: "Official Context7 CLI",
56
+ },
50
57
  ];
51
58
 
52
59
  function colorize(text, colorCode) {
@@ -161,6 +168,74 @@ function printStatus(results) {
161
168
  console.log("");
162
169
  }
163
170
 
171
+ function inspectContext7Status(homeDir) {
172
+ const skillPath = path.join(homeDir, ".claude", "skills", "find-docs", "SKILL.md");
173
+ const rulePath = path.join(homeDir, ".claude", "rules", "context7.md");
174
+ const binaryInstalled = commandExists("ctx7");
175
+
176
+ let version = null;
177
+ if (binaryInstalled) {
178
+ try {
179
+ version = execSync("ctx7 --version", { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] })
180
+ .trim()
181
+ .split("\n")[0];
182
+ } catch {
183
+ version = null;
184
+ }
185
+ }
186
+
187
+ return {
188
+ binaryInstalled,
189
+ version,
190
+ skillInstalled: fs.existsSync(skillPath),
191
+ ruleInstalled: fs.existsSync(rulePath),
192
+ };
193
+ }
194
+
195
+ function printContext7DoctorStatus(status) {
196
+ console.log("\nContext7 Integration:");
197
+ console.log(
198
+ ` ${status.binaryInstalled ? colorize("✓", "32") : colorize("○", "33")} ctx7 binary ${
199
+ status.binaryInstalled ? (status.version || "installed") : "not installed (optional)"
200
+ }`,
201
+ );
202
+ console.log(
203
+ ` ${status.skillInstalled ? colorize("✓", "32") : colorize("○", "33")} Context7 skill ${
204
+ status.skillInstalled ? "find-docs installed" : "not installed"
205
+ }`,
206
+ );
207
+ console.log(
208
+ ` ${status.ruleInstalled ? colorize("✓", "32") : colorize("○", "33")} Context7 rule ${
209
+ status.ruleInstalled ? "context7.md installed" : "not installed"
210
+ }`,
211
+ );
212
+
213
+ const fullyInstalled = status.binaryInstalled && status.skillInstalled && status.ruleInstalled;
214
+ const partiallyInstalled =
215
+ status.binaryInstalled || status.skillInstalled || status.ruleInstalled;
216
+
217
+ if (fullyInstalled) {
218
+ console.log(" Context7 CLI and Claude integration are fully installed.");
219
+ console.log("");
220
+ return { failed: false };
221
+ }
222
+
223
+ if (partiallyInstalled) {
224
+ console.log(" Context7 is partially installed.");
225
+ console.log(" Fix: run cpmm setup and opt into Context7, or run:");
226
+ console.log(" npm install -g ctx7");
227
+ console.log(" ctx7 setup --cli --claude");
228
+ console.log("");
229
+ return { failed: true };
230
+ }
231
+
232
+ console.log(" Optional. To install:");
233
+ console.log(" npm install -g ctx7");
234
+ console.log(" ctx7 setup --cli --claude");
235
+ console.log("");
236
+ return { failed: false };
237
+ }
238
+
164
239
  function printRtkSetupResult(result) {
165
240
  if (!result) return;
166
241
 
@@ -339,12 +414,14 @@ function runDoctor() {
339
414
 
340
415
  const results = checkDeps();
341
416
  printStatus(results);
417
+ const context7Status = inspectContext7Status(process.env.HOME || process.env.USERPROFILE || "");
418
+ const context7Doctor = printContext7DoctorStatus(context7Status);
342
419
 
343
420
  const rtkStatus = inspectRtkStatus(path.join(process.env.HOME || process.env.USERPROFILE || "", ".claude", "settings.json"));
344
421
  const rtkDoctor = printRtkDoctorStatus(rtkStatus);
345
422
 
346
423
  const missing = results.filter((r) => r.required && !r.installed);
347
- if (missing.length > 0 || rtkDoctor.failed) {
424
+ if (missing.length > 0 || rtkDoctor.failed || context7Doctor.failed) {
348
425
  console.log(`Fix: cpmm setup`);
349
426
  return 1;
350
427
  }
@@ -357,8 +434,8 @@ function printHelp() {
357
434
  console.log(`CPMM v${pkg.version}
358
435
 
359
436
  Usage:
360
- cpmm setup Install deps + configure CPMM (language, Perplexity, optional RTK)
361
- cpmm doctor Check dependency and RTK hook status
437
+ cpmm setup Install deps + configure CPMM (language, Perplexity, optional ctx7 + official Context7, optional RTK)
438
+ cpmm doctor Check dependency, Context7, and RTK status
362
439
  cpmm --help Show this help
363
440
  cpmm --version Show version
364
441
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-pro-minmax",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Quota-first routing and safety layer for Claude Code Pro workflows.",
5
5
  "author": "donghoon <move-hoon@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  ".claude/commands/",
21
21
  ".claude/contexts/",
22
22
  ".claude/rules/",
23
- ".claude/skills/cli-wrappers/",
23
+ ".claude/skills/cli-patterns/",
24
24
  ".claudeignore",
25
25
  "scripts/",
26
26
  "README.md",