refactor(mode-prompts): migrate analyze prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
[analyze-mode]
|
||||||
|
ANALYSIS MODE. Gather context before diving deep:
|
||||||
|
|
||||||
|
CONTEXT GATHERING (parallel):
|
||||||
|
- 1-2 explore agents (codebase patterns, implementations)
|
||||||
|
- 1-2 librarian agents (if external library involved)
|
||||||
|
- Direct tools: Grep, AST-grep, LSP for targeted searches
|
||||||
|
|
||||||
|
IF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:
|
||||||
|
- **Oracle**: Conventional problems (architecture, debugging, complex logic)
|
||||||
|
- **Artistry**: Non-conventional problems (different approach needed)
|
||||||
|
|
||||||
|
SYNTHESIZE findings before proceeding.
|
||||||
|
---
|
||||||
|
MANDATORY delegate_task params: ALWAYS include load_skills and run_in_background when calling delegate_task. Evaluate available skills before dispatch - pass task-appropriate skills when relevant, pass [] ONLY when no skill matches the task domain.
|
||||||
|
Example: delegate_task(subagent_type="explore", prompt="...", run_in_background=true, load_skills=[])
|
||||||
@@ -9,4 +9,4 @@ export type {
|
|||||||
export { resolveVariant } from "./variant-resolver"
|
export { resolveVariant } from "./variant-resolver"
|
||||||
export type { ResolveVariantInput } from "./variant-resolver"
|
export type { ResolveVariantInput } from "./variant-resolver"
|
||||||
export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader"
|
export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader"
|
||||||
export { SEARCH_MODE_PROMPT } from "./mode-prompts"
|
export { ANALYZE_MODE_PROMPT, SEARCH_MODE_PROMPT } from "./mode-prompts"
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import analyzeModePrompt from "../prompts/mode/analyze.md" with { type: "text" }
|
||||||
import searchModePrompt from "../prompts/mode/search.md" with { type: "text" }
|
import searchModePrompt from "../prompts/mode/search.md" with { type: "text" }
|
||||||
|
|
||||||
|
export const ANALYZE_MODE_PROMPT = stripFinalLineFeed(analyzeModePrompt)
|
||||||
export const SEARCH_MODE_PROMPT = stripFinalLineFeed(searchModePrompt)
|
export const SEARCH_MODE_PROMPT = stripFinalLineFeed(searchModePrompt)
|
||||||
|
|
||||||
function stripFinalLineFeed(prompt: string): string {
|
function stripFinalLineFeed(prompt: string): string {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { ANALYZE_MODE_PROMPT } from "@oh-my-opencode/prompts-core"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analyze mode keyword detector.
|
* Analyze mode keyword detector.
|
||||||
*
|
*
|
||||||
@@ -12,19 +14,4 @@
|
|||||||
export const ANALYZE_PATTERN =
|
export const ANALYZE_PATTERN =
|
||||||
/\b(analyze|analyse|investigate|examine|research|study|deep[\s-]?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to|분석|조사|파악|연구|검토|진단|이해|설명|원인|이유|뜯어봐|따져봐|평가|해석|디버깅|디버그|어떻게|왜|살펴|分析|調査|解析|検討|研究|診断|理解|説明|検証|精査|究明|デバッグ|なぜ|どう|仕組み|调查|检查|剖析|深入|诊断|解释|调试|为什么|原理|搞清楚|弄明白|phân tích|điều tra|nghiên cứu|kiểm tra|xem xét|chẩn đoán|giải thích|tìm hiểu|gỡ lỗi|tại sao/i
|
/\b(analyze|analyse|investigate|examine|research|study|deep[\s-]?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to|분석|조사|파악|연구|검토|진단|이해|설명|원인|이유|뜯어봐|따져봐|평가|해석|디버깅|디버그|어떻게|왜|살펴|分析|調査|解析|検討|研究|診断|理解|説明|検証|精査|究明|デバッグ|なぜ|どう|仕組み|调查|检查|剖析|深入|诊断|解释|调试|为什么|原理|搞清楚|弄明白|phân tích|điều tra|nghiên cứu|kiểm tra|xem xét|chẩn đoán|giải thích|tìm hiểu|gỡ lỗi|tại sao/i
|
||||||
|
|
||||||
export const ANALYZE_MESSAGE = `[analyze-mode]
|
export const ANALYZE_MESSAGE = ANALYZE_MODE_PROMPT
|
||||||
ANALYSIS MODE. Gather context before diving deep:
|
|
||||||
|
|
||||||
CONTEXT GATHERING (parallel):
|
|
||||||
- 1-2 explore agents (codebase patterns, implementations)
|
|
||||||
- 1-2 librarian agents (if external library involved)
|
|
||||||
- Direct tools: Grep, AST-grep, LSP for targeted searches
|
|
||||||
|
|
||||||
IF COMPLEX - DO NOT STRUGGLE ALONE. Consult specialists:
|
|
||||||
- **Oracle**: Conventional problems (architecture, debugging, complex logic)
|
|
||||||
- **Artistry**: Non-conventional problems (different approach needed)
|
|
||||||
|
|
||||||
SYNTHESIZE findings before proceeding.
|
|
||||||
---
|
|
||||||
MANDATORY delegate_task params: ALWAYS include load_skills and run_in_background when calling delegate_task. Evaluate available skills before dispatch - pass task-appropriate skills when relevant, pass [] ONLY when no skill matches the task domain.
|
|
||||||
Example: delegate_task(subagent_type="explore", prompt="...", run_in_background=true, load_skills=[])`
|
|
||||||
|
|||||||
Reference in New Issue
Block a user