agestra 4.3.4 → 4.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.
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Agestra UserPromptSubmit hook
4
+ // Detects user intent and injects Agestra tool suggestions as additionalContext.
5
+
6
+ let input = "";
7
+ process.stdin.on("data", (chunk) => { input += chunk; });
8
+ process.stdin.on("end", () => {
9
+ try {
10
+ const data = JSON.parse(input);
11
+ const prompt = (data.prompt || "").toLowerCase();
12
+
13
+ const reviewKeywords = [
14
+ "리뷰", "review", "점검", "검사", "보안", "security", "버그", "bug",
15
+ "하드코딩", "중복 코드", "레거시", "스파게티", "품질", "quality",
16
+ "문제 있", "what's wrong", "check for", "audit", "코드 확인",
17
+ "テスト", "レビュー", "审查", "检查",
18
+ ];
19
+ const ideaKeywords = [
20
+ "아이디어", "idea", "개선", "뭐 추가", "뭐가 부족", "비슷한",
21
+ "improve", "feature", "what should", "what's missing", "유사",
22
+ "경쟁", "competitor", "다음에 뭘", "만들 가치",
23
+ "改善", "アイデア", "改进", "想法",
24
+ ];
25
+ const designKeywords = [
26
+ "설계", "design", "아키텍처", "architect", "구조", "어떻게 만들",
27
+ "방향", "approach", "trade-off", "트레이드오프",
28
+ "設計", "アーキテクチャ", "架构",
29
+ ];
30
+
31
+ const matched = [];
32
+ if (reviewKeywords.some((k) => prompt.includes(k))) matched.push("review");
33
+ if (ideaKeywords.some((k) => prompt.includes(k))) matched.push("idea");
34
+ if (designKeywords.some((k) => prompt.includes(k))) matched.push("design");
35
+
36
+ if (matched.length > 0) {
37
+ const lines = [
38
+ "[Agestra] 외부 AI(Ollama, Gemini, Codex)와 팀을 구성하여 작업할 수 있습니다.",
39
+ "사용자에게 팀 모드 사용 여부를 제안하세요.",
40
+ "",
41
+ ];
42
+
43
+ if (matched.includes("review")) {
44
+ lines.push("• 코드 리뷰 → `environment_check` 실행 후 모드 선택 제공:");
45
+ lines.push(" - Claude only: agestra-reviewer 단독 실행");
46
+ lines.push(" - 각자 독립: 팀(moderator + reviewer + 외부 AI) 각자 리뷰 → 취합 문서");
47
+ lines.push(" - 끝장토론: 각자 독립 + 합의까지 반복 리뷰");
48
+ }
49
+ if (matched.includes("idea")) {
50
+ lines.push("• 아이디어 탐색 → `environment_check` 실행 후 모드 선택 제공:");
51
+ lines.push(" - Claude only: agestra-ideator 단독 탐색");
52
+ lines.push(" - 각자 독립: 팀(moderator + ideator + 외부 AI) 각자 탐색 → 취합 문서");
53
+ lines.push(" - 끝장토론: 각자 독립 + 합의까지 반복 토론");
54
+ }
55
+ if (matched.includes("design")) {
56
+ lines.push("• 설계 탐색 → `environment_check` 실행 후 모드 선택 제공:");
57
+ lines.push(" - Claude only: agestra-designer 단독 설계");
58
+ lines.push(" - 각자 독립: 팀(moderator + designer + 외부 AI) 각자 설계 → 취합 문서");
59
+ lines.push(" - 끝장토론: 각자 독립 + 합의까지 반복 토론");
60
+ }
61
+
62
+ lines.push("");
63
+ lines.push("반드시 `environment_check`를 먼저 호출하여 사용 가능한 프로바이더를 확인한 후, 모드 선택지를 사용자에게 보여주세요.");
64
+
65
+ console.log(JSON.stringify({ additionalContext: lines.join("\n") }));
66
+ }
67
+ } catch (e) {
68
+ // silent — do not block user prompt on error
69
+ }
70
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agestra",
3
- "version": "4.3.4",
3
+ "version": "4.4.0",
4
4
  "description": "Claude Code plugin — orchestrate Ollama, Gemini, and Codex for multi-AI debates, cross-validation, and GraphRAG memory",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.11.0",
@@ -21,15 +21,18 @@
21
21
  "hooks/",
22
22
  "skills/"
23
23
  ],
24
- "scripts": {
25
- "build": "turbo build",
26
- "test": "turbo test",
27
- "dev": "turbo dev",
28
- "lint": "turbo lint",
29
- "clean": "turbo clean",
30
- "bundle": "node scripts/bundle.mjs",
31
- "prepublishOnly": "npm run build && npm run bundle"
32
- },
24
+ "scripts": {
25
+ "sync:metadata": "node scripts/sync-metadata.mjs",
26
+ "prebuild": "npm run sync:metadata",
27
+ "build": "turbo build",
28
+ "test": "turbo test",
29
+ "dev": "turbo dev",
30
+ "lint": "turbo lint",
31
+ "clean": "turbo clean",
32
+ "prebundle": "npm run sync:metadata",
33
+ "bundle": "node scripts/bundle.mjs",
34
+ "prepublishOnly": "npm run build && npm run bundle"
35
+ },
33
36
  "keywords": [
34
37
  "claude-code-plugin",
35
38
  "mcp",
package/skills/design.md CHANGED
@@ -63,16 +63,87 @@ Brownfield: modifying or extending existing code.
63
63
  - Round 10: soft warning — "We're at 10 rounds. Current ambiguity: {score}%. Continue or proceed?"
64
64
  - Round 20: hard cap — proceed with current clarity, note the risk
65
65
 
66
- ### Phase 2: Explore
66
+ ### Phase 2: Check environment and select mode
67
67
 
68
+ Call `environment_check` to determine available providers.
69
+
70
+ Present mode selection (in the user's language):
71
+
72
+ | Option | Condition | Description |
73
+ |--------|-----------|-------------|
74
+ | **Claude only** | Always | 플러그인 전문 에이전트가 소크라테스식 질문으로 아키텍처 탐색 |
75
+ | **각자 독립** | 1+ provider available | 에이전트 팀(moderator + designer + 외부 AI)이 각자 독립 설계 후 취합 문서 작성 |
76
+ | **끝장토론** | 1+ provider available | 각자 독립 설계 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
77
+
78
+ Only show options whose conditions are met. If no providers are available, run Claude only.
79
+
80
+ ### Phase 3: Execute
81
+
82
+ #### If "Claude only":
83
+ Proceed to Phase 4 (Explore → Propose → Refine → Document) directly using `agestra-designer` agent.
84
+
85
+ #### If "각자 독립":
86
+
87
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-designer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
88
+
89
+ 1. In parallel:
90
+ - Spawn the `agestra-designer` agent for Claude's independent architecture exploration.
91
+ After the agent completes, save Claude's result as a document via `workspace_create_document`:
92
+ - **title:** `Architecture Design — claude/designer`
93
+ - **metadata:** `{ "Provider": "claude/designer", "Task": "{subject}", "Mode": "Independent" }`
94
+ - **content:** The designer agent's full output.
95
+ - For each available provider, call `ai_chat` with `save_as_document`:
96
+ - **save_as_document.title:** `Architecture Design — {provider}`
97
+ - **save_as_document.metadata:** `{ "Task": "{subject}", "Mode": "Independent" }`
98
+ - **prompt:** Propose an architecture approach for [subject]. Consider existing patterns in the codebase, trade-offs (complexity, performance, maintainability), and implementation steps. Present 2-3 distinct approaches with pros/cons for each.
99
+
100
+ 2. Collect all document IDs.
101
+
102
+ 3. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
103
+ - Pass the document ID list.
104
+ - Moderator reads each document, classifies consensus/unique/disputed approaches.
105
+ - Moderator creates an aggregated document via `workspace_create_document`.
106
+
107
+ 4. Present summary report to the user:
108
+ - Key consensus approaches (1-3 lines).
109
+ - Notable unique design ideas (if any).
110
+ - Trade-off disagreements (if any).
111
+ - Individual + aggregated document IDs.
112
+
113
+ #### If "끝장토론":
114
+
115
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-designer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
116
+
117
+ 1. Execute "각자 독립" steps 1-3 above (independent work + initial aggregation).
118
+ - The moderator's integrated document becomes the starting document.
119
+
120
+ 2. Document review rounds (no max — until all agree):
121
+ a. Moderator sends the current document to each AI for review:
122
+ - Claude: spawn `agestra-designer` → analyze document → section-by-section feedback
123
+ - Other providers: `agent_debate_turn` with the document as prompt, requesting agree/disagree per section
124
+ b. Moderator collects all feedback.
125
+ c. Classify: agree/disagree per section per provider.
126
+ d. Revise document incorporating disagreement feedback.
127
+ e. If all providers agree on all sections → consensus reached.
128
+ f. If not → next round with revised document.
129
+ g. **Every 10 rounds:** Ask the user whether to continue or stop with current state.
130
+
131
+ 3. Present the final document:
132
+ - Consensus sections: marked as agreed
133
+ - Disputed sections: show split positions with each provider's rationale
134
+
135
+ ### Phase 4: Design process (Claude only mode)
136
+
137
+ If running Claude only, execute the following design phases:
138
+
139
+ #### 4a: Explore
68
140
  Search the codebase for relevant existing patterns:
69
141
  - Use Glob to find related files by name
70
142
  - Use Grep to find similar implementations
71
143
  - Use Read to understand existing architecture
72
144
  - Note conventions: naming, file organization, patterns used
73
145
 
74
- ### Phase 3: Propose
75
-
146
+ #### 4b: Propose
76
147
  Present 2-3 distinct approaches. For each:
77
148
  - **Approach name** — one-line summary
78
149
  - **How it works** — architecture overview
@@ -80,16 +151,14 @@ Present 2-3 distinct approaches. For each:
80
151
  - **Trade-offs** — pros and cons
81
152
  - **Effort** — relative complexity (low/medium/high)
82
153
 
83
- ### Phase 4: Refine
84
-
154
+ #### 4c: Refine
85
155
  Based on user feedback:
86
156
  - Deep-dive into the selected approach
87
157
  - Address concerns raised
88
158
  - Detail component boundaries and data flow
89
159
  - Identify risks and mitigation
90
160
 
91
- ### Phase 5: Document
92
-
161
+ #### 4d: Document
93
162
  Write a design document to `docs/plans/` with this structure:
94
163
 
95
164
  ```markdown
package/skills/idea.md CHANGED
@@ -68,29 +68,98 @@ After gathering context:
68
68
 
69
69
  **Early exit:** If the user provides enough context upfront (specific competitors, clear scope, concrete goals), skip remaining questions and proceed to Phase 2. Do not force unnecessary rounds.
70
70
 
71
- ### Phase 2: Research Similar Projects
71
+ ### Phase 2: Check environment and select mode
72
72
 
73
+ Call `environment_check` to determine available providers.
74
+
75
+ Present mode selection (in the user's language):
76
+
77
+ | Option | Condition | Description |
78
+ |--------|-----------|-------------|
79
+ | **Claude only** | Always | 플러그인 전문 에이전트가 단독으로 개선점 탐색 |
80
+ | **각자 독립** | 1+ provider available | 에이전트 팀(moderator + ideator + 외부 AI)이 각자 독립 탐색 후 취합 문서 작성 |
81
+ | **끝장토론** | 1+ provider available | 각자 독립 탐색 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
82
+
83
+ Only show options whose conditions are met. If no providers are available, run Claude only.
84
+
85
+ ### Phase 3: Execute
86
+
87
+ #### If "Claude only":
88
+ Proceed to Phase 4 (Research) directly using `agestra-ideator` agent.
89
+
90
+ #### If "각자 독립":
91
+
92
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-ideator` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
93
+
94
+ 1. In parallel:
95
+ - Spawn the `agestra-ideator` agent for Claude's independent improvement research.
96
+ After the agent completes, save Claude's result as a document via `workspace_create_document`:
97
+ - **title:** `Idea Exploration — claude/ideator`
98
+ - **metadata:** `{ "Provider": "claude/ideator", "Task": "{topic}", "Mode": "Independent" }`
99
+ - **content:** The ideator agent's full output.
100
+ - For each available provider, call `ai_chat` with `save_as_document`:
101
+ - **save_as_document.title:** `Idea Exploration — {provider}`
102
+ - **save_as_document.metadata:** `{ "Task": "{topic}", "Mode": "Independent" }`
103
+ - **prompt:** Research improvements for [topic]. Look at similar projects, common user complaints, missing features, and opportunities. For each suggestion, provide: title, category (UX/Performance/Feature/Integration/DX), source of the idea, priority (HIGH/MEDIUM/LOW), and a brief description.
104
+
105
+ 2. Collect all document IDs.
106
+
107
+ 3. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
108
+ - Pass the document ID list.
109
+ - Moderator reads each document, classifies consensus/unique/disputed suggestions.
110
+ - Moderator creates an aggregated document via `workspace_create_document`.
111
+
112
+ 4. Present summary report to the user:
113
+ - Key consensus suggestions (1-3 lines).
114
+ - Notable unique ideas (if any).
115
+ - Priority disagreements (if any).
116
+ - Individual + aggregated document IDs.
117
+
118
+ #### If "끝장토론":
119
+
120
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-ideator` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
121
+
122
+ 1. Execute "각자 독립" steps 1-3 above (independent work + initial aggregation).
123
+ - The moderator's integrated document becomes the starting document.
124
+
125
+ 2. Document review rounds (no max — until all agree):
126
+ a. Moderator sends the current document to each AI for review:
127
+ - Claude: spawn `agestra-ideator` → analyze document → section-by-section feedback
128
+ - Other providers: `agent_debate_turn` with the document as prompt, requesting agree/disagree per section
129
+ b. Moderator collects all feedback.
130
+ c. Classify: agree/disagree per section per provider.
131
+ d. Revise document incorporating disagreement feedback.
132
+ e. If all providers agree on all sections → consensus reached.
133
+ f. If not → next round with revised document.
134
+ g. **Every 10 rounds:** Ask the user whether to continue or stop with current state.
135
+
136
+ 3. Present the final document:
137
+ - Consensus sections: marked as agreed
138
+ - Disputed sections: show split positions with each provider's rationale
139
+
140
+ ### Phase 4: Research (Claude only mode)
141
+
142
+ If running Claude only, execute the following research phases:
143
+
144
+ #### 4a: Research Similar Projects
73
145
  - Use WebSearch to find similar tools, libraries, and projects
74
146
  - Look for: direct competitors, adjacent tools, inspirational projects
75
147
  - Collect names, URLs, and key differentiators
76
148
 
77
- ### Phase 3: Collect Pain Points
78
-
149
+ #### 4b: Collect Pain Points
79
150
  - WebSearch for complaints about similar tools (GitHub issues, forums, discussions)
80
151
  - WebFetch relevant issue pages and discussion threads
81
152
  - Identify recurring themes in user feedback
82
153
  - Note what users wish existed but doesn't
83
154
 
84
- ### Phase 4: Feature Comparison
85
-
155
+ #### 4c: Feature Comparison
86
156
  Build a comparison table:
87
157
 
88
158
  | Feature | This Project | Competitor A | Competitor B |
89
159
  |---------|-------------|-------------|-------------|
90
160
  | Feature 1 | Yes/No | Yes/No | Yes/No |
91
161
 
92
- ### Phase 5: Generate Suggestions
93
-
162
+ #### 4d: Generate Suggestions
94
163
  For each suggestion:
95
164
  - **Title** — clear, actionable name
96
165
  - **Category** — UX, Performance, Feature, Integration, DX
@@ -99,8 +168,7 @@ For each suggestion:
99
168
  - **Effort** — estimated complexity
100
169
  - **Description** — what it does and why it matters
101
170
 
102
- ### Phase 6: Prioritized Recommendations
103
-
171
+ #### 4e: Prioritized Recommendations
104
172
  Present a ranked list:
105
173
  1. **Quick wins** — high impact, low effort
106
174
  2. **Strategic investments** — high impact, high effort
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: agestra-review
3
+ description: >
4
+ Use when reviewing code quality, finding bugs, checking security, auditing hardcoding,
5
+ detecting duplicate or dead code, or verifying test coverage. Triggers on:
6
+ "review code", "check security", "find bugs", "code quality", "audit this",
7
+ "any issues?", "what's wrong with this code", "check for problems",
8
+ "코드 리뷰", "품질 검증", "보안 확인", "버그 찾아", "점검해줘", "문제 있어?",
9
+ "하드코딩 확인", "중복 코드", "레거시 코드", "스파게티 코드",
10
+ "コードレビュー", "品質チェック", "代码审查", "代码检查"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Post-implementation code quality verification. Find problems — security vulnerabilities, orphan systems, hardcoding, duplicate code, legacy code, spaghetti code, missing tests, and spec drift.
16
+
17
+ ## Workflow
18
+
19
+ ### Phase 1: Determine Scope
20
+
21
+ Ask the user what to review:
22
+
23
+ | Option | Description |
24
+ |--------|-------------|
25
+ | **전체 프로젝트** | 프로젝트 전체를 리뷰 |
26
+ | **일부 지정** | 특정 파일, 디렉토리, 또는 영역을 지정하여 리뷰 |
27
+
28
+ ### Phase 2: Choose Focus Areas
29
+
30
+ Ask what to focus on (multiSelect):
31
+
32
+ | Option | Description |
33
+ |--------|-------------|
34
+ | **전체 점검** | 아래 모든 항목을 점검 |
35
+ | **보안 취약점** | OWASP top 10 (인젝션, 인증, XSS 등) |
36
+ | **하드코딩** | 매직넘버, 하드코딩된 URL, 임베디드 자격증명 |
37
+ | **중복 코드** | 반복되는 로직, 복사-붙여넣기 코드 |
38
+ | **레거시 코드** | 더 이상 사용되지 않는 코드, 고아 시스템, 데드 코드 |
39
+ | **스파게티 코드** | 과도한 복잡성, 긴 함수, 깊은 중첩, 얽힌 의존성 |
40
+ | **테스트 커버리지** | 테스트 없는 공개 함수, 엣지케이스 미커버 |
41
+ | **i18n** | 번역 함수 없이 하드코딩된 UI 문자열 |
42
+ | **스펙 불일치** | 설계 문서와 실제 구현의 차이 |
43
+
44
+ ### Phase 3: Check environment and select mode
45
+
46
+ Call `environment_check` to determine available providers.
47
+
48
+ Present mode selection (in the user's language):
49
+
50
+ | Option | Condition | Description |
51
+ |--------|-----------|-------------|
52
+ | **Claude only** | Always | 플러그인 전문 에이전트가 단독 리뷰 |
53
+ | **각자 독립** | 1+ provider available | 에이전트 팀(moderator + reviewer + 외부 AI)이 각자 독립 리뷰 후 취합 문서 작성 |
54
+ | **끝장토론** | 1+ provider available | 각자 독립 리뷰 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
55
+
56
+ Only show options whose conditions are met. If no providers are available, run Claude only.
57
+
58
+ ### Phase 4: Execute
59
+
60
+ #### If "Claude only":
61
+ Spawn the `agestra-reviewer` agent with the target and selected focus areas as context.
62
+
63
+ #### If "각자 독립":
64
+
65
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-reviewer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
66
+
67
+ 1. In parallel:
68
+ - Spawn the `agestra-reviewer` agent for Claude's independent analysis.
69
+ After the agent completes, save Claude's result as a document via `workspace_create_document`:
70
+ - **title:** `Code Review — claude/reviewer`
71
+ - **metadata:** `{ "Provider": "claude/reviewer", "Task": "{review target}", "Focus": "{selected focus areas}", "Mode": "Independent" }`
72
+ - **content:** The reviewer agent's full output.
73
+ - For each available provider, call `ai_chat` with `save_as_document`:
74
+ - **save_as_document.title:** `Code Review — {provider}`
75
+ - **save_as_document.metadata:** `{ "Task": "{review target}", "Focus": "{selected focus areas}", "Mode": "Independent" }`
76
+ - **prompt:** Review the following code. Focus on: [selected focus areas]. For each finding, provide severity (CRITICAL/HIGH/MEDIUM/LOW), file:line location, and evidence. Target: [the review target]
77
+
78
+ 2. Collect all document IDs.
79
+
80
+ 3. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
81
+ - Pass the document ID list.
82
+ - Moderator reads each document, classifies consensus/unique/disputed findings.
83
+ - Moderator creates an aggregated document via `workspace_create_document`.
84
+
85
+ 4. Present summary report to the user:
86
+ - Key consensus findings (1-3 lines).
87
+ - Notable unique findings (if any).
88
+ - Disputed points (if any).
89
+ - Individual + aggregated document IDs.
90
+
91
+ #### If "끝장토론":
92
+
93
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-reviewer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
94
+
95
+ 1. Execute "각자 독립" steps 1-3 above (independent work + initial aggregation).
96
+ - The moderator's integrated document becomes the starting document.
97
+
98
+ 2. Document review rounds (no max — until all agree):
99
+ a. Moderator sends the current document to each AI for review:
100
+ - Claude: spawn `agestra-reviewer` → analyze document → section-by-section feedback
101
+ - Other providers: `agent_debate_turn` with the document as prompt, requesting agree/disagree per section
102
+ b. Moderator collects all feedback.
103
+ c. Classify: agree/disagree per section per provider.
104
+ d. Revise document incorporating disagreement feedback.
105
+ e. If all providers agree on all sections → consensus reached.
106
+ f. If not → next round with revised document.
107
+ g. **Every 10 rounds:** Ask the user whether to continue or stop with current state.
108
+
109
+ 3. Present the final document:
110
+ - Consensus sections: marked as agreed
111
+ - Disputed sections: show split positions with each provider's rationale
112
+
113
+ ### Phase 5: TRUST 5 Quality Gate
114
+
115
+ After review (any mode), evaluate TRUST 5:
116
+
117
+ | Gate | Criteria |
118
+ |------|----------|
119
+ | **Tested** | Changed public functions: 85%+ covered |
120
+ | **Readable** | No magic numbers, functions <= 50 lines |
121
+ | **Unified** | Follows project conventions |
122
+ | **Secured** | OWASP top 10 clean |
123
+ | **Trackable** | Changes traceable to design docs |
124
+
125
+ Verdict: 5/5 PASS → Quality Gate passed / 4/5 → CONDITIONAL / Secured FAIL or 3+ → BLOCK
126
+
127
+ ## Constraints
128
+
129
+ - READ-ONLY. Do not modify any files.
130
+ - Every finding must cite a specific file and line number.
131
+ - Do not speculate. If you cannot verify, do not report.
132
+ - Do not praise code quality. Silence means approval.
133
+ - Communicate in the user's language.
@@ -1,11 +0,0 @@
1
- ---
2
- event: UserPromptSubmit
3
- ---
4
-
5
- If the user's message involves code review, design discussion, idea exploration, comparing options, validation, or parallel work — output exactly:
6
-
7
- ```
8
- AGESTRA_SUGGESTION
9
- ```
10
-
11
- Otherwise output nothing.