miyabi-agent-sdk
Version:
Miyabi Autonomous Agent SDK - 7 Agents based on Shikigaku Theory with 100% cost reduction mode
82 lines • 2.36 kB
TypeScript
/**
* ReviewAgent - コード品質判定Agent
*
* 識学理論適用:
* - 責任: 生成されたコードを品質チェック
* - 権限: 品質合否判定(80点以上で合格)、改善提案、セキュリティスキャン
* - 階層: Specialist Layer
*
* Phase 8-2: Real API Integration
*/
import type { GeneratedFile, QualityReport, AgentInput, AgentOutput } from "../types.js";
import { AnthropicClient } from "../clients/AnthropicClient.js";
import { ClaudeCodeClient } from "../clients/ClaudeCodeClient.js";
export interface ReviewInput extends AgentInput {
files: GeneratedFile[];
standards: {
minQualityScore: number;
requireTests: boolean;
securityScan: boolean;
};
useRealAPI?: boolean;
anthropicClient?: AnthropicClient;
claudeCodeClient?: ClaudeCodeClient;
}
export interface ReviewOutput extends AgentOutput {
data?: QualityReport & {
tokensUsed?: {
input: number;
output: number;
};
cost?: number;
};
}
/**
* ReviewAgent実装
*
* 静的解析 → セキュリティスキャン → カバレッジ確認 → スコアリング → 改善提案
*/
export declare class ReviewAgent {
private anthropicClient?;
private claudeCodeClient?;
constructor(config?: {
anthropicApiKey?: string;
useClaudeCode?: boolean;
});
/**
* メイン実行ロジック
*/
review(input: ReviewInput): Promise<ReviewOutput>;
/**
* 静的解析実行(ESLint/Clippy)
*
* TODO: 実際のLinterを統合
*/
private runStaticAnalysis;
/**
* セキュリティスキャン実行(Gitleaks)
*
* TODO: 実際のセキュリティツールを統合
*/
private runSecurityScan;
/**
* テストカバレッジ確認
*
* TODO: 実際のカバレッジツールを統合
*/
private checkCoverage;
/**
* 品質スコア計算
*
* スコアリング配分:
* - 静的解析: 40点(エラー0件で満点)
* - セキュリティ: 30点(問題なしで満点)
* - カバレッジ: 30点(80%以上で満点)
*/
private calculateQualityScore;
/**
* 改善提案生成
*/
private generateSuggestions;
}
//# sourceMappingURL=ReviewAgent.d.ts.map