Loading...
Loading...
Compare original and translation side by side
┌─────────────────────────────────────────────────────┐
│ Phase 0: Read Specs (mandatory) │
│ → problem-taxonomy.md, tuning-strategies.md │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Orchestrator (state-driven) │
│ Read state → Select action → Execute → Update → ✓ │
└─────────────────────────────────────────────────────┘
↓ ↓
┌──────────────────────┐ ┌──────────────────┐
│ Diagnosis Phase │ │ Gemini CLI │
│ • Context │ │ Deep analysis │
│ • Memory │ │ (on-demand) │
│ • DataFlow │ │ │
│ • Agent │ │ Complex issues │
│ • Docs │ │ Architecture │
│ • Token Usage │ │ Performance │
└──────────────────────┘ └──────────────────┘
↓
┌───────────────────┐
│ Fix & Verify │
│ Apply → Re-test │
└───────────────────┘┌─────────────────────────────────────────────────────┐
│ 阶段0:读取规范(必填) │
│ → problem-taxonomy.md, tuning-strategies.md │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ 编排器(状态驱动) │
│ 读取状态 → 选择操作 → 执行 → 更新 → ✓ │
└─────────────────────────────────────────────────────┘
↓ ↓
┌──────────────────────┐ ┌──────────────────┐
│ 诊断阶段 │ │ Gemini CLI │
│ • 上下文 │ │ 深度分析(按需) │
│ • 内存 │ │ │
│ • 数据流 │ │ 复杂问题 │
│ • Agent │ │ 架构 │
│ • 文档 │ │ 性能 │
│ • Token使用 │ │ │
└──────────────────────┘ └──────────────────┘
↓
┌───────────────────┐
│ 修复与验证 │
│ 应用 → 重新测试 │
└───────────────────┘| Priority | Problem | Root Cause | Fix Strategy |
|---|---|---|---|
| P0 | Authoring Violation | Intermediate files, state bloat, file relay | eliminate_intermediate, minimize_state |
| P1 | Data Flow Disruption | Scattered state, inconsistent formats | state_centralization, schema_enforcement |
| P2 | Agent Coordination | Fragile chains, no error handling | error_wrapping, result_validation |
| P3 | Context Explosion | Unbounded history, full content passing | sliding_window, path_reference |
| P4 | Long-tail Forgetting | Early constraint loss | constraint_injection, checkpoint_restore |
| P5 | Token Consumption | Verbose prompts, state bloat | prompt_compression, lazy_loading |
| 优先级 | 问题 | 根本原因 | 修复策略 |
|---|---|---|---|
| P0 | 编写违规 | 中间文件、状态膨胀、文件传递 | 移除中间文件、最小化状态 |
| P1 | 数据流中断 | 状态分散、格式不一致 | 状态集中化、模式强制 |
| P2 | Agent协调问题 | 脆弱的调用链、无错误处理 | 错误包装、结果验证 |
| P3 | 上下文膨胀 | 无限制历史记录、完整内容传递 | 滑动窗口、路径引用 |
| P4 | 长尾遗忘 | 早期约束丢失 | 约束注入、检查点恢复 |
| P5 | Token消耗过高 | 冗长提示词、状态膨胀 | 提示词压缩、懒加载 |
| Step | Action | Orchestrator Decision | Output |
|---|---|---|---|
| 1 | | status='pending' | Backup, session created |
| 2 | | After init | Required dimensions + coverage |
| 3 | Diagnosis (6 types) | Focus areas | state.diagnosis.{type} |
| 4 | | Critical issues OR user request | Deep findings |
| 5 | | All diagnosis complete | state.final_report |
| 6 | | Issues found | state.proposed_fixes[] |
| 7 | | Pending fixes | Applied + verified |
| 8 | | Quality gates pass | session.status='completed' |
| 步骤 | 操作 | 编排器决策 | 输出 |
|---|---|---|---|
| 1 | | 状态='待处理' | 备份文件、会话已创建 |
| 2 | | 初始化完成后 | 所需分析维度 + 覆盖范围 |
| 3 | 诊断(6种类型) | 聚焦重点领域 | state.diagnosis.{type} |
| 4 | | 存在关键问题 或 用户请求 | 深度分析结果 |
| 5 | | 所有诊断完成后 | state.final_report |
| 6 | | 检测到问题时 | state.proposed_fixes[] |
| 7 | | 存在待修复问题时 | 修复已应用 + 验证通过 |
| 8 | | 通过质量门 | session.status='已完成' |
| Category | Actions | Purpose |
|---|---|---|
| Setup | action-init | Initialize backup, session state |
| Analysis | action-analyze-requirements | Decompose user request via Gemini CLI |
| Diagnosis | action-diagnose-{context,memory,dataflow,agent,docs,token_consumption} | Detect category-specific issues |
| Deep Analysis | action-gemini-analysis | Gemini CLI: complex/critical issues |
| Reporting | action-generate-report | Consolidate findings → final_report |
| Fixing | action-propose-fixes, action-apply-fix | Generate + apply fixes |
| Verify | action-verify | Re-run diagnosis, check gates |
| Exit | action-complete, action-abort | Finalize or rollback |
| 分类 | 操作 | 用途 |
|---|---|---|
| 设置 | action-init | 初始化备份、会话状态 |
| 分析 | action-analyze-requirements | 通过Gemini CLI分解用户请求 |
| 诊断 | action-diagnose-{context,memory,dataflow,agent,docs,token_consumption} | 检测特定分类的问题 |
| 深度分析 | action-gemini-analysis | Gemini CLI:处理复杂/关键问题 |
| 报告 | action-generate-report | 整合分析结果 → final_report |
| 修复 | action-propose-fixes, action-apply-fix | 生成并应用修复方案 |
| 验证 | action-verify | 重新运行诊断、检查质量门 |
| 退出 | action-complete, action-abort | 完成或回滚操作 |
.workflow/.scratchpad/skill-tuning-{ts}/state.json{
"status": "pending|running|completed|failed",
"target_skill": { "name": "...", "path": "..." },
"diagnosis": {
"context": {...},
"memory": {...},
"dataflow": {...},
"agent": {...},
"docs": {...},
"token_consumption": {...}
},
"issues": [{"id":"...", "severity":"...", "category":"...", "strategy":"..."}],
"proposed_fixes": [...],
"applied_fixes": [...],
"quality_gate": "pass|fail",
"final_report": "..."
}.workflow/.scratchpad/skill-tuning-{ts}/state.json{
"status": "pending|running|completed|failed",
"target_skill": { "name": "...", "path": "..." },
"diagnosis": {
"context": {...},
"memory": {...},
"dataflow": {...},
"agent": {...},
"docs": {...},
"token_consumption": {...}
},
"issues": [{"id":"...", "severity":"...", "category":"...", "strategy":"..."}],
"proposed_fixes": [...],
"applied_fixes": [...],
"quality_gate": "pass|fail",
"final_report": "..."
}undefinedundefinedundefinedundefined.workflow/.scratchpad/skill-tuning-{ts}/state.jsonstate.final_reportstate.applied_fixes.workflow/.scratchpad/skill-tuning-{ts}/state.jsonstate.final_reportstate.applied_fixes| 文档 | 用途 |
|---|---|
| specs/problem-taxonomy.md | 问题分类 + 检测模式 |
| specs/tuning-strategies.md | 修复方案实施指南 |
| specs/dimension-mapping.md | 分析维度 ↔ 规范映射 |
| specs/quality-gates.md | 质量验证标准 |
| phases/orchestrator.md | 工作流编排逻辑 |
| phases/state-schema.md | 状态结构定义 |
| phases/actions/ | 单个操作的具体实现 |
| Document | Purpose |
|---|---|
| specs/problem-taxonomy.md | Classification + detection patterns |
| specs/tuning-strategies.md | Fix implementation guide |
| specs/dimension-mapping.md | Dimension ↔ Spec mapping |
| specs/quality-gates.md | Quality verification criteria |
| phases/orchestrator.md | Workflow orchestration |
| phases/state-schema.md | State structure definition |
| phases/actions/ | Individual action implementations |