agestra 4.7.0 → 4.8.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-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.ja.md +8 -27
- package/README.ko.md +244 -263
- package/README.md +244 -263
- package/README.zh.md +8 -27
- package/agents/agestra-designer.md +20 -4
- package/agents/agestra-ideator.md +20 -5
- package/agents/agestra-moderator.md +34 -17
- package/agents/agestra-qa.md +20 -5
- package/agents/agestra-reviewer.md +20 -3
- package/agents/agestra-team-lead.md +93 -80
- package/commands/design.md +26 -56
- package/commands/idea.md +22 -56
- package/commands/review.md +63 -93
- package/dist/bundle.js +423 -624
- package/hooks/user-prompt-submit.js +90 -25
- package/package.json +1 -1
- package/skills/design.md +29 -52
- package/skills/idea.md +307 -212
- package/skills/provider-guide.md +15 -21
- package/skills/review.md +45 -66
- package/skills/setup.md +98 -0
- package/skills/trace.md +3 -2
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// Agestra UserPromptSubmit hook
|
|
4
|
-
// Detects user intent and
|
|
4
|
+
// Detects user intent and routes to debate mode with configured providers.
|
|
5
|
+
// If no providers.config.json exists, suggests /agestra setup first.
|
|
6
|
+
|
|
7
|
+
const { existsSync } = require("fs");
|
|
8
|
+
const { join } = require("path");
|
|
5
9
|
|
|
6
10
|
let input = "";
|
|
7
11
|
process.stdin.on("data", (chunk) => { input += chunk; });
|
|
@@ -33,37 +37,98 @@ process.stdin.on("end", () => {
|
|
|
33
37
|
if (ideaKeywords.some((k) => prompt.includes(k))) matched.push("idea");
|
|
34
38
|
if (designKeywords.some((k) => prompt.includes(k))) matched.push("design");
|
|
35
39
|
|
|
36
|
-
if (matched.length
|
|
40
|
+
if (matched.length === 0) return;
|
|
41
|
+
|
|
42
|
+
// Check if providers.config.json exists
|
|
43
|
+
const cwd = data.cwd || process.cwd();
|
|
44
|
+
const configPath = join(cwd, "providers.config.json");
|
|
45
|
+
const hasConfig = existsSync(configPath);
|
|
46
|
+
|
|
47
|
+
if (!hasConfig) {
|
|
48
|
+
// No config — suggest setup first
|
|
37
49
|
const lines = [
|
|
38
|
-
"[Agestra] 외부 AI
|
|
39
|
-
"
|
|
50
|
+
"[Agestra] 외부 AI와 끝장토론을 하려면 먼저 초기 설정이 필요합니다.",
|
|
51
|
+
"`/agestra setup`을 실행하여 사용할 AI를 선택하세요.",
|
|
40
52
|
"",
|
|
53
|
+
"설정 후 자동으로 끝장토론 모드로 진행됩니다.",
|
|
41
54
|
];
|
|
55
|
+
console.log(JSON.stringify({ additionalContext: lines.join("\n") }));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
42
58
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// Config exists — check selectionPolicy
|
|
60
|
+
let config;
|
|
61
|
+
try {
|
|
62
|
+
config = JSON.parse(require("fs").readFileSync(configPath, "utf-8"));
|
|
63
|
+
} catch {
|
|
64
|
+
// Corrupted config — suggest re-setup
|
|
65
|
+
console.log(JSON.stringify({
|
|
66
|
+
additionalContext: "[Agestra] providers.config.json이 손상되었습니다. `/agestra setup`으로 재설정하세요.",
|
|
67
|
+
}));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ask-each-session: always ask user before proceeding
|
|
72
|
+
if (config.selectionPolicy === "ask-each-session") {
|
|
73
|
+
const enabledProviders = (config.providers || [])
|
|
74
|
+
.filter((p) => p.enabled)
|
|
75
|
+
.map((p) => p.id);
|
|
76
|
+
|
|
77
|
+
const lines = [
|
|
78
|
+
`[Agestra] Session policy: ask-each-session.`,
|
|
79
|
+
`Currently enabled AI: ${enabledProviders.join(", ") || "none"}.`,
|
|
80
|
+
"",
|
|
81
|
+
"MANDATORY: You MUST use AskUserQuestion to ask the user:",
|
|
82
|
+
"Present in the user's language.",
|
|
83
|
+
"Question 1: 'Run multi-AI debate with current providers?'",
|
|
84
|
+
"Options: 'Yes' / 'No' / 'Change AI selection (run /agestra setup)'",
|
|
85
|
+
"",
|
|
86
|
+
"If YES: call `environment_check` then proceed with debate.",
|
|
87
|
+
"If NO: handle directly without Agestra.",
|
|
88
|
+
"If CHANGE: run the setup skill to reconfigure providers.",
|
|
89
|
+
];
|
|
64
90
|
|
|
65
91
|
console.log(JSON.stringify({ additionalContext: lines.join("\n") }));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Fixed or ask-each-session mode
|
|
96
|
+
const enabledProviders = (config.providers || [])
|
|
97
|
+
.filter((p) => p.enabled)
|
|
98
|
+
.map((p) => p.id);
|
|
99
|
+
|
|
100
|
+
if (enabledProviders.length === 0) {
|
|
101
|
+
console.log(JSON.stringify({
|
|
102
|
+
additionalContext: "[Agestra] No AI providers are enabled. Run `/agestra setup` to select AIs.",
|
|
103
|
+
}));
|
|
104
|
+
return;
|
|
66
105
|
}
|
|
106
|
+
|
|
107
|
+
const intentMap = [];
|
|
108
|
+
if (matched.includes("review")) intentMap.push("code review");
|
|
109
|
+
if (matched.includes("idea")) intentMap.push("idea exploration");
|
|
110
|
+
if (matched.includes("design")) intentMap.push("design exploration");
|
|
111
|
+
const intentStr = intentMap.join(", ");
|
|
112
|
+
|
|
113
|
+
const lines = [
|
|
114
|
+
`[Agestra] Detected intent: ${intentStr}.`,
|
|
115
|
+
`Available AI providers: ${enabledProviders.join(", ")}.`,
|
|
116
|
+
"",
|
|
117
|
+
"MANDATORY: You MUST use AskUserQuestion to ask the user whether to proceed with Agestra multi-AI debate.",
|
|
118
|
+
"Present this question in the user's language.",
|
|
119
|
+
"Question: 'Should we run a multi-AI debate (끝장토론) with the enabled providers?'",
|
|
120
|
+
"Options: 'Yes, run debate' / 'No, I will handle it alone'",
|
|
121
|
+
"",
|
|
122
|
+
"If user selects YES:",
|
|
123
|
+
" 1. Call `environment_check` to verify provider availability",
|
|
124
|
+
" 2. Proceed with 끝장토론 using the enabled providers",
|
|
125
|
+
" 3. Follow the workflow in the relevant skill (agestra-review / agestra-idea / agestra-design)",
|
|
126
|
+
"",
|
|
127
|
+
"If user selects NO:",
|
|
128
|
+
" Proceed without Agestra. Handle the task directly.",
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
console.log(JSON.stringify({ additionalContext: lines.join("\n") }));
|
|
67
132
|
} catch (e) {
|
|
68
133
|
// silent — do not block user prompt on error
|
|
69
134
|
}
|
package/package.json
CHANGED
package/skills/design.md
CHANGED
|
@@ -67,68 +67,45 @@ Brownfield: modifying or extending existing code.
|
|
|
67
67
|
|
|
68
68
|
Call `environment_check` to determine available providers.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
- If **no providers are available**: proceed to Phase 3 (Explore → Propose → Refine → Document) directly using `agestra-designer` agent (Claude only).
|
|
71
|
+
- If **1+ providers are available**: proceed to 끝장토론 execution below.
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|--------|-----------|-------------|
|
|
74
|
-
| **Claude only** | Always | 플러그인 전문 에이전트가 소크라테스식 질문으로 아키텍처 탐색 |
|
|
75
|
-
| **각자 독립** | 1+ provider available | 에이전트 팀(moderator + designer + 외부 AI)이 각자 독립 설계 후 취합 문서 작성 |
|
|
76
|
-
| **끝장토론** | 1+ provider available | 각자 독립 설계 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
|
|
73
|
+
### Phase 3: Execute 끝장토론
|
|
77
74
|
|
|
78
|
-
|
|
75
|
+
**팀 구성:** `agestra-moderator` (리더) + `agestra-designer` (Claude) + 사용 가능한 외부 AI (gemini, codex 등)
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
1. Independent work + initial aggregation:
|
|
81
78
|
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
a. In parallel:
|
|
80
|
+
- Spawn the `agestra-designer` agent for Claude's independent architecture exploration.
|
|
81
|
+
After the agent completes, save Claude's result as a document via `workspace_create_document`:
|
|
82
|
+
- **title:** `Architecture Design — claude/designer`
|
|
83
|
+
- **metadata:** `{ "Provider": "claude/designer", "Task": "{subject}", "Mode": "Independent" }`
|
|
84
|
+
- **content:** The designer agent's full output.
|
|
85
|
+
- For each available provider, call `ai_chat` with `save_as_document`:
|
|
86
|
+
- **save_as_document.title:** `Architecture Design — {provider}`
|
|
87
|
+
- **save_as_document.metadata:** `{ "Task": "{subject}", "Mode": "Independent" }`
|
|
88
|
+
- **prompt:** Create a complete design document for [subject]. Include: 1) Problem definition — what exactly we're solving and why. 2) Constraints and requirements — technical limits, compatibility needs, performance targets. 3) 2-3 architecture approaches — each with detailed pros/cons, component diagrams, data flow, and effort estimates. 4) Recommended approach — pick one and justify the choice. 5) Implementation plan — step-by-step build sequence with dependencies. 6) Risks and mitigations. Be thorough and detailed — this document will be debated and refined.
|
|
84
89
|
|
|
85
|
-
|
|
90
|
+
b. Collect all document IDs.
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
c. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
|
|
93
|
+
- Pass the document ID list.
|
|
94
|
+
- Moderator reads each document, classifies consensus/unique/disputed approaches.
|
|
95
|
+
- Moderator creates an aggregated document. This becomes the starting document.
|
|
88
96
|
|
|
89
|
-
|
|
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.
|
|
97
|
+
2. Start a turn-based debate session with `agent_debate_create`.
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
3. Document review rounds (no max — until all agree):
|
|
100
|
+
a. Moderator sends the current document to each AI for review.
|
|
101
|
+
b. Moderator collects all feedback and updates the working document.
|
|
102
|
+
c. If all providers agree on all sections → consensus reached.
|
|
103
|
+
d. If not → next round with the revised document.
|
|
104
|
+
e. **Every 10 rounds:** Ask the user whether to continue or stop with current state.
|
|
101
105
|
|
|
102
|
-
|
|
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
|
+
4. When consensus is reached, record the final synthesis with `agent_debate_conclude`.
|
|
106
107
|
|
|
107
|
-
|
|
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:
|
|
108
|
+
5. Present the final document:
|
|
132
109
|
- Consensus sections: marked as agreed
|
|
133
110
|
- Disputed sections: show split positions with each provider's rationale
|
|
134
111
|
|