mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Conflict Resolution Schema",
|
||||
"description": "Schema for conflict detection, strategy generation, and resolution output",
|
||||
|
||||
"type": "object",
|
||||
"required": ["conflicts", "summary"],
|
||||
"properties": {
|
||||
"conflicts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "brief", "severity", "category", "strategies", "recommended"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^CON-\\d{3}$",
|
||||
"description": "Conflict ID (CON-001, CON-002, ...)"
|
||||
},
|
||||
"brief": {
|
||||
"type": "string",
|
||||
"description": "一句话冲突摘要(中文)"
|
||||
},
|
||||
"severity": {
|
||||
"enum": ["Critical", "High", "Medium"],
|
||||
"description": "冲突严重程度"
|
||||
},
|
||||
"category": {
|
||||
"enum": ["Architecture", "API", "Data", "Dependency", "ModuleOverlap"],
|
||||
"description": "冲突类型"
|
||||
},
|
||||
"affected_files": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "受影响的文件路径"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "详细冲突描述"
|
||||
},
|
||||
"impact": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"scope": { "type": "string", "description": "影响的模块/组件" },
|
||||
"compatibility": { "enum": ["Yes", "No", "Partial"] },
|
||||
"migration_required": { "type": "boolean" },
|
||||
"estimated_effort": { "type": "string", "description": "人天估计" }
|
||||
}
|
||||
},
|
||||
"overlap_analysis": {
|
||||
"type": "object",
|
||||
"description": "仅当 category=ModuleOverlap 时需要",
|
||||
"properties": {
|
||||
"new_module": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"scenarios": { "type": "array", "items": { "type": "string" } },
|
||||
"responsibilities": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"existing_modules": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": { "type": "string" },
|
||||
"name": { "type": "string" },
|
||||
"scenarios": { "type": "array", "items": { "type": "string" } },
|
||||
"overlap_scenarios": { "type": "array", "items": { "type": "string" } },
|
||||
"responsibilities": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"strategies": {
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"maxItems": 4,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["name", "approach", "complexity", "risk", "effort", "pros", "cons"],
|
||||
"properties": {
|
||||
"name": { "type": "string", "description": "策略名称(中文)" },
|
||||
"approach": { "type": "string", "description": "实现方法简述" },
|
||||
"complexity": { "enum": ["Low", "Medium", "High"] },
|
||||
"risk": { "enum": ["Low", "Medium", "High"] },
|
||||
"effort": { "type": "string", "description": "时间估计" },
|
||||
"pros": { "type": "array", "items": { "type": "string" }, "description": "优点" },
|
||||
"cons": { "type": "array", "items": { "type": "string" }, "description": "缺点" },
|
||||
"clarification_needed": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "需要用户澄清的问题(尤其是 ModuleOverlap)"
|
||||
},
|
||||
"modifications": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["file", "section", "change_type", "old_content", "new_content", "rationale"],
|
||||
"properties": {
|
||||
"file": { "type": "string", "description": "相对项目根目录的完整路径" },
|
||||
"section": { "type": "string", "description": "Markdown heading 用于定位" },
|
||||
"change_type": { "enum": ["update", "add", "remove"] },
|
||||
"old_content": { "type": "string", "description": "原始内容片段(20-100字符,用于唯一匹配)" },
|
||||
"new_content": { "type": "string", "description": "修改后的内容" },
|
||||
"rationale": { "type": "string", "description": "修改理由" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"recommended": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "推荐策略索引(0-based)"
|
||||
},
|
||||
"modification_suggestions": {
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"maxItems": 5,
|
||||
"items": { "type": "string" },
|
||||
"description": "自定义处理建议(2-5条,中文)"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"type": "object",
|
||||
"required": ["total", "critical", "high", "medium"],
|
||||
"properties": {
|
||||
"total": { "type": "integer" },
|
||||
"critical": { "type": "integer" },
|
||||
"high": { "type": "integer" },
|
||||
"medium": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"_quality_standards": {
|
||||
"modifications": [
|
||||
"old_content: 20-100字符,确保 Edit 工具能唯一匹配",
|
||||
"new_content: 保持 markdown 格式",
|
||||
"change_type: update(替换), add(插入), remove(删除)"
|
||||
],
|
||||
"user_facing_text": "brief, name, pros, cons, modification_suggestions 使用中文",
|
||||
"technical_fields": "severity, category, complexity, risk 使用英文"
|
||||
}
|
||||
}
|
||||
127
.ccw/workflows/cli-templates/schemas/debug-log-json-schema.json
Normal file
127
.ccw/workflows/cli-templates/schemas/debug-log-json-schema.json
Normal file
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Debug Log Entry Schema",
|
||||
"description": "NDJSON log entry for hypothesis-driven debugging workflow",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sessionId",
|
||||
"runId",
|
||||
"hypothesisId",
|
||||
"location",
|
||||
"message",
|
||||
"data",
|
||||
"timestamp"
|
||||
],
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string",
|
||||
"pattern": "^DBG-[a-z0-9-]+-\\d{4}-\\d{2}-\\d{2}$",
|
||||
"description": "Debug session identifier (e.g., 'DBG-stack-length-not-found-2025-12-18')"
|
||||
},
|
||||
"runId": {
|
||||
"type": "string",
|
||||
"pattern": "^run-\\d+$",
|
||||
"description": "Reproduction run number (e.g., 'run-1', 'run-2')"
|
||||
},
|
||||
"hypothesisId": {
|
||||
"type": "string",
|
||||
"pattern": "^H\\d+$",
|
||||
"description": "Hypothesis identifier being tested (e.g., 'H1', 'H2')"
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "Code location in format 'file:function:line' or 'file:line'"
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Human-readable description of what's being logged"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"description": "Captured values for hypothesis validation",
|
||||
"properties": {
|
||||
"keys_sample": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Sample of dictionary/object keys (first 30)"
|
||||
},
|
||||
"value": {
|
||||
"description": "Captured value (any type)"
|
||||
},
|
||||
"expected_value": {
|
||||
"description": "Expected value for comparison"
|
||||
},
|
||||
"actual_type": {
|
||||
"type": "string",
|
||||
"description": "Actual type of captured value"
|
||||
},
|
||||
"count": {
|
||||
"type": "integer",
|
||||
"description": "Count of items (for arrays/collections)"
|
||||
},
|
||||
"is_null": {
|
||||
"type": "boolean",
|
||||
"description": "Whether value is null/None"
|
||||
},
|
||||
"is_empty": {
|
||||
"type": "boolean",
|
||||
"description": "Whether collection is empty"
|
||||
},
|
||||
"comparison_result": {
|
||||
"type": "string",
|
||||
"enum": ["match", "mismatch", "partial_match"],
|
||||
"description": "Result of value comparison"
|
||||
}
|
||||
}
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "integer",
|
||||
"description": "Unix timestamp in milliseconds"
|
||||
},
|
||||
"severity": {
|
||||
"type": "string",
|
||||
"enum": ["debug", "info", "warning", "error"],
|
||||
"default": "info",
|
||||
"description": "Log severity level"
|
||||
},
|
||||
"stack_trace": {
|
||||
"type": "string",
|
||||
"description": "Stack trace if capturing exception context"
|
||||
},
|
||||
"parent_entry_id": {
|
||||
"type": "string",
|
||||
"description": "Reference to parent log entry for nested contexts"
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"sessionId": "DBG-stack-length-not-found-2025-12-18",
|
||||
"runId": "run-1",
|
||||
"hypothesisId": "H1",
|
||||
"location": "rmxprt_api/core/rmxprt_parameter.py:sync_from_machine:642",
|
||||
"message": "Inspect stator keys from machine.to_dict and compare Stack Length vs Length",
|
||||
"data": {
|
||||
"keys_sample": ["Length", "Outer Diameter", "Inner Diameter", "Slot"],
|
||||
"stack_length_value": "未找到",
|
||||
"length_value": "120mm",
|
||||
"comparison_result": "mismatch"
|
||||
},
|
||||
"timestamp": 1734523456789
|
||||
},
|
||||
{
|
||||
"sessionId": "DBG-registered-zero-2025-12-18",
|
||||
"runId": "run-1",
|
||||
"hypothesisId": "H2",
|
||||
"location": "rmxprt_api/utils/param_core.py:update_variables_from_result_model:670",
|
||||
"message": "Check result parameters count and sample keys",
|
||||
"data": {
|
||||
"count": 0,
|
||||
"is_empty": true,
|
||||
"sections_parsed": ["Stator", "Rotor", "General"],
|
||||
"expected_count": 145
|
||||
},
|
||||
"timestamp": 1734523457123
|
||||
}
|
||||
]
|
||||
}
|
||||
234
.ccw/workflows/cli-templates/schemas/diagnosis-json-schema.json
Normal file
234
.ccw/workflows/cli-templates/schemas/diagnosis-json-schema.json
Normal file
@@ -0,0 +1,234 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Diagnosis Context Schema",
|
||||
"description": "Bug diagnosis results from cli-explore-agent for root cause analysis",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"symptom",
|
||||
"root_cause",
|
||||
"affected_files",
|
||||
"reproduction_steps",
|
||||
"fix_hints",
|
||||
"dependencies",
|
||||
"constraints",
|
||||
"clarification_needs",
|
||||
"_metadata"
|
||||
],
|
||||
"properties": {
|
||||
"symptom": {
|
||||
"type": "object",
|
||||
"required": ["description", "error_message"],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Human-readable description of the bug symptoms"
|
||||
},
|
||||
"error_message": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Exact error message if available, null if no specific error"
|
||||
},
|
||||
"stack_trace": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Stack trace excerpt if available"
|
||||
},
|
||||
"frequency": {
|
||||
"type": "string",
|
||||
"enum": ["always", "intermittent", "rare", "unknown"],
|
||||
"description": "How often the bug occurs"
|
||||
},
|
||||
"user_impact": {
|
||||
"type": "string",
|
||||
"description": "How the bug affects end users"
|
||||
}
|
||||
},
|
||||
"description": "Observable symptoms and error manifestation"
|
||||
},
|
||||
"root_cause": {
|
||||
"type": "object",
|
||||
"required": ["file", "issue", "confidence"],
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "File path where the root cause is located"
|
||||
},
|
||||
"line_range": {
|
||||
"type": "string",
|
||||
"description": "Line range containing the bug (e.g., '45-60')"
|
||||
},
|
||||
"function": {
|
||||
"type": "string",
|
||||
"description": "Function or method name containing the bug"
|
||||
},
|
||||
"issue": {
|
||||
"type": "string",
|
||||
"description": "Description of what's wrong in the code"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score 0.0-1.0 (0.8+ high, 0.5-0.8 medium, <0.5 low)"
|
||||
},
|
||||
"introduced_by": {
|
||||
"type": "string",
|
||||
"description": "Commit hash or date when bug was introduced (if known)"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"enum": ["logic_error", "edge_case", "race_condition", "null_reference", "type_mismatch", "resource_leak", "validation", "integration", "configuration", "other"],
|
||||
"description": "Bug category classification"
|
||||
}
|
||||
},
|
||||
"description": "Root cause analysis with confidence score"
|
||||
},
|
||||
"affected_files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["path", "relevance"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "description": "File path relative to project root"},
|
||||
"relevance": {"type": "number", "minimum": 0, "maximum": 1, "description": "Relevance score 0.0-1.0 (0.7+ high, 0.5-0.7 medium, <0.5 low)"},
|
||||
"rationale": {"type": "string", "description": "Brief explanation of why this file is affected from this diagnosis angle"},
|
||||
"change_type": {
|
||||
"type": "string",
|
||||
"enum": ["fix_target", "needs_update", "test_coverage", "reference_only"],
|
||||
"description": "Type of change needed for this file"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "Files affected by the bug. Prefer object format with relevance scores for synthesis prioritization."
|
||||
},
|
||||
"reproduction_steps": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"minItems": 1,
|
||||
"description": "Step-by-step instructions to reproduce the bug"
|
||||
},
|
||||
"fix_hints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["description", "approach"],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "What needs to be fixed"
|
||||
},
|
||||
"approach": {
|
||||
"type": "string",
|
||||
"description": "Suggested fix approach with specific guidance"
|
||||
},
|
||||
"code_example": {
|
||||
"type": "string",
|
||||
"description": "Example code snippet showing the fix pattern"
|
||||
},
|
||||
"risk": {
|
||||
"type": "string",
|
||||
"enum": ["low", "medium", "high"],
|
||||
"description": "Risk level of implementing this fix"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Actionable fix suggestions from this diagnosis angle"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "string",
|
||||
"description": "External and internal dependencies relevant to the bug"
|
||||
},
|
||||
"constraints": {
|
||||
"type": "string",
|
||||
"description": "Technical constraints and limitations affecting the fix"
|
||||
},
|
||||
"related_issues": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["similar_bug", "regression", "related_feature", "tech_debt"],
|
||||
"description": "Relationship type"
|
||||
},
|
||||
"reference": {
|
||||
"type": "string",
|
||||
"description": "Issue ID, commit hash, or file reference"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Brief description of the relationship"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Related issues, regressions, or similar bugs found during diagnosis"
|
||||
},
|
||||
"clarification_needs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["question", "context", "options"],
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "The clarification question to ask user"
|
||||
},
|
||||
"context": {
|
||||
"type": "string",
|
||||
"description": "Background context explaining why this clarification is needed"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Available options for user to choose from (2-4 options)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Ambiguities requiring user input before fix planning"
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["timestamp", "bug_description", "source"],
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of diagnosis"
|
||||
},
|
||||
"bug_description": {
|
||||
"type": "string",
|
||||
"description": "Original bug description that triggered diagnosis"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"const": "cli-explore-agent",
|
||||
"description": "Agent that performed diagnosis"
|
||||
},
|
||||
"diagnosis_angle": {
|
||||
"type": "string",
|
||||
"description": "Diagnosis angle (e.g., 'error-handling', 'dataflow', 'state-management')"
|
||||
},
|
||||
"diagnosis_index": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 4,
|
||||
"description": "Diagnosis index (1-4) in parallel diagnosis set"
|
||||
},
|
||||
"total_diagnoses": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 4,
|
||||
"description": "Total number of parallel diagnoses"
|
||||
},
|
||||
"duration_seconds": {
|
||||
"type": "integer",
|
||||
"description": "Diagnosis duration in seconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "discovery-finding-schema",
|
||||
"title": "Discovery Finding Schema",
|
||||
"description": "Schema for perspective-based issue discovery results",
|
||||
"type": "object",
|
||||
"required": ["perspective", "discovery_id", "analysis_timestamp", "cli_tool_used", "summary", "findings"],
|
||||
"properties": {
|
||||
"perspective": {
|
||||
"type": "string",
|
||||
"enum": ["bug", "ux", "test", "quality", "security", "performance", "maintainability", "best-practices"],
|
||||
"description": "Discovery perspective"
|
||||
},
|
||||
"discovery_id": {
|
||||
"type": "string",
|
||||
"pattern": "^DSC-\\d{8}-\\d{6}$",
|
||||
"description": "Parent discovery session ID"
|
||||
},
|
||||
"analysis_timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of analysis"
|
||||
},
|
||||
"cli_tool_used": {
|
||||
"type": "string",
|
||||
"enum": ["gemini", "qwen", "codex"],
|
||||
"description": "CLI tool that performed the analysis"
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
"description": "Specific model version used",
|
||||
"examples": ["gemini-2.5-pro", "qwen-max"]
|
||||
},
|
||||
"analysis_duration_ms": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Analysis duration in milliseconds"
|
||||
},
|
||||
"summary": {
|
||||
"type": "object",
|
||||
"required": ["total_findings"],
|
||||
"properties": {
|
||||
"total_findings": { "type": "integer", "minimum": 0 },
|
||||
"critical": { "type": "integer", "minimum": 0 },
|
||||
"high": { "type": "integer", "minimum": 0 },
|
||||
"medium": { "type": "integer", "minimum": 0 },
|
||||
"low": { "type": "integer", "minimum": 0 },
|
||||
"files_analyzed": { "type": "integer", "minimum": 0 }
|
||||
},
|
||||
"description": "Summary statistics (FLAT structure, NOT nested)"
|
||||
},
|
||||
"findings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "perspective", "priority", "category", "description", "file", "line"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^dsc-[a-z]+-\\d{3}-[a-f0-9]{8}$",
|
||||
"description": "Unique finding ID: dsc-{perspective}-{seq}-{uuid8}",
|
||||
"examples": ["dsc-bug-001-a1b2c3d4"]
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"minLength": 10,
|
||||
"maxLength": 200,
|
||||
"description": "Concise finding title"
|
||||
},
|
||||
"perspective": {
|
||||
"type": "string",
|
||||
"enum": ["bug", "ux", "test", "quality", "security", "performance", "maintainability", "best-practices"]
|
||||
},
|
||||
"priority": {
|
||||
"type": "string",
|
||||
"enum": ["critical", "high", "medium", "low"],
|
||||
"description": "Priority level (lowercase only)"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"description": "Perspective-specific category",
|
||||
"examples": ["null-check", "edge-case", "missing-test", "complexity", "injection"]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"minLength": 20,
|
||||
"description": "Detailed description of the finding"
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "File path relative to project root"
|
||||
},
|
||||
"line": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "Line number of the finding"
|
||||
},
|
||||
"snippet": {
|
||||
"type": "string",
|
||||
"description": "Relevant code snippet"
|
||||
},
|
||||
"suggested_issue": {
|
||||
"type": "object",
|
||||
"required": ["title", "type", "priority"],
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Suggested issue title for export"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["bug", "feature", "enhancement", "refactor", "test", "docs"],
|
||||
"description": "Issue type"
|
||||
},
|
||||
"priority": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 5,
|
||||
"description": "Priority 1-5 (1=critical, 5=low)"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Suggested tags for the issue"
|
||||
}
|
||||
},
|
||||
"description": "Pre-filled issue suggestion for export"
|
||||
},
|
||||
"external_reference": {
|
||||
"type": ["object", "null"],
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"url": { "type": "string", "format": "uri" },
|
||||
"relevance": { "type": "string" }
|
||||
},
|
||||
"description": "External reference from Exa research (if applicable)"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score 0.0-1.0"
|
||||
},
|
||||
"impact": {
|
||||
"type": "string",
|
||||
"description": "Description of potential impact"
|
||||
},
|
||||
"recommendation": {
|
||||
"type": "string",
|
||||
"description": "Specific recommendation to address the finding"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"description": "Additional metadata (CWE ID, OWASP category, etc.)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Array of discovered findings"
|
||||
},
|
||||
"cross_references": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"finding_id": { "type": "string" },
|
||||
"related_perspectives": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"reason": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"description": "Cross-references to findings in other perspectives"
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"perspective": "bug",
|
||||
"discovery_id": "DSC-20250128-143022",
|
||||
"analysis_timestamp": "2025-01-28T14:35:00Z",
|
||||
"cli_tool_used": "gemini",
|
||||
"model": "gemini-2.5-pro",
|
||||
"analysis_duration_ms": 45000,
|
||||
"summary": {
|
||||
"total_findings": 8,
|
||||
"critical": 1,
|
||||
"high": 2,
|
||||
"medium": 3,
|
||||
"low": 2,
|
||||
"files_analyzed": 5
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"id": "dsc-bug-001-a1b2c3d4",
|
||||
"title": "Missing null check in user validation",
|
||||
"perspective": "bug",
|
||||
"priority": "high",
|
||||
"category": "null-check",
|
||||
"description": "User object is accessed without null check after database query, which may fail if user doesn't exist",
|
||||
"file": "src/auth/validator.ts",
|
||||
"line": 45,
|
||||
"snippet": "const user = await db.findUser(id);\nreturn user.email; // user may be null",
|
||||
"suggested_issue": {
|
||||
"title": "Add null check in user validation",
|
||||
"type": "bug",
|
||||
"priority": 2,
|
||||
"tags": ["bug", "auth"]
|
||||
},
|
||||
"external_reference": null,
|
||||
"confidence": 0.85,
|
||||
"impact": "Runtime error when user not found",
|
||||
"recommendation": "Add null check: if (!user) throw new NotFoundError('User not found');"
|
||||
}
|
||||
],
|
||||
"cross_references": []
|
||||
}
|
||||
]
|
||||
}
|
||||
125
.ccw/workflows/cli-templates/schemas/discovery-state-schema.json
Normal file
125
.ccw/workflows/cli-templates/schemas/discovery-state-schema.json
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "discovery-state-schema",
|
||||
"title": "Discovery State Schema (Merged)",
|
||||
"description": "Unified schema for issue discovery session (state + progress merged)",
|
||||
"type": "object",
|
||||
"required": ["discovery_id", "target_pattern", "phase", "created_at"],
|
||||
"properties": {
|
||||
"discovery_id": {
|
||||
"type": "string",
|
||||
"description": "Unique discovery session ID",
|
||||
"pattern": "^DSC-\\d{8}-\\d{6}$",
|
||||
"examples": ["DSC-20250128-143022"]
|
||||
},
|
||||
"target_pattern": {
|
||||
"type": "string",
|
||||
"description": "File/directory pattern being analyzed",
|
||||
"examples": ["src/auth/**", "codex-lens/**/*.py"]
|
||||
},
|
||||
"phase": {
|
||||
"type": "string",
|
||||
"enum": ["initialization", "parallel", "aggregation", "complete"],
|
||||
"description": "Current execution phase"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"target": {
|
||||
"type": "object",
|
||||
"description": "Target module information",
|
||||
"properties": {
|
||||
"files_count": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": { "type": "integer" },
|
||||
"tests": { "type": "integer" },
|
||||
"total": { "type": "integer" }
|
||||
}
|
||||
},
|
||||
"project": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"version": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"perspectives": {
|
||||
"type": "array",
|
||||
"description": "Perspective analysis status (merged from progress)",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["name", "status"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["bug", "ux", "test", "quality", "security", "performance", "maintainability", "best-practices"]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["pending", "in_progress", "completed", "failed"]
|
||||
},
|
||||
"findings": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"external_research": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": { "type": "boolean", "default": false },
|
||||
"completed": { "type": "boolean", "default": false }
|
||||
}
|
||||
},
|
||||
"results": {
|
||||
"type": "object",
|
||||
"description": "Aggregated results (final phase)",
|
||||
"properties": {
|
||||
"total_findings": { "type": "integer", "minimum": 0 },
|
||||
"issues_generated": { "type": "integer", "minimum": 0 },
|
||||
"priority_distribution": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"critical": { "type": "integer" },
|
||||
"high": { "type": "integer" },
|
||||
"medium": { "type": "integer" },
|
||||
"low": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"discovery_id": "DSC-20251228-182237",
|
||||
"target_pattern": "codex-lens/**/*.py",
|
||||
"phase": "complete",
|
||||
"created_at": "2025-12-28T18:22:37+08:00",
|
||||
"updated_at": "2025-12-28T18:35:00+08:00",
|
||||
"target": {
|
||||
"files_count": { "source": 48, "tests": 44, "total": 93 },
|
||||
"project": { "name": "codex-lens", "version": "0.1.0" }
|
||||
},
|
||||
"perspectives": [
|
||||
{ "name": "bug", "status": "completed", "findings": 15 },
|
||||
{ "name": "test", "status": "completed", "findings": 11 },
|
||||
{ "name": "quality", "status": "completed", "findings": 12 }
|
||||
],
|
||||
"external_research": { "enabled": false, "completed": false },
|
||||
"results": {
|
||||
"total_findings": 37,
|
||||
"issues_generated": 15,
|
||||
"priority_distribution": { "critical": 4, "high": 13, "medium": 16, "low": 6 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
124
.ccw/workflows/cli-templates/schemas/explore-json-schema.json
Normal file
124
.ccw/workflows/cli-templates/schemas/explore-json-schema.json
Normal file
@@ -0,0 +1,124 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Exploration Context Schema",
|
||||
"description": "Code exploration results from cli-explore-agent for task context gathering",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"project_structure",
|
||||
"relevant_files",
|
||||
"patterns",
|
||||
"dependencies",
|
||||
"integration_points",
|
||||
"constraints",
|
||||
"clarification_needs",
|
||||
"_metadata"
|
||||
],
|
||||
"properties": {
|
||||
"project_structure": {
|
||||
"type": "string",
|
||||
"description": "Overall architecture description: module organization, layer structure, component relationships"
|
||||
},
|
||||
"relevant_files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["path", "relevance"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "description": "File path relative to project root"},
|
||||
"relevance": {"type": "number", "minimum": 0, "maximum": 1, "description": "Relevance score 0.0-1.0 (0.7+ high, 0.5-0.7 medium, <0.5 low)"},
|
||||
"rationale": {"type": "string", "description": "Brief explanation of why this file is relevant from this exploration angle"}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "File paths to be modified or referenced for the task. Prefer object format with relevance scores for synthesis prioritization."
|
||||
},
|
||||
"patterns": {
|
||||
"type": "string",
|
||||
"description": "Existing code patterns, conventions, and styles found in the codebase"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "string",
|
||||
"description": "External and internal module dependencies relevant to the task"
|
||||
},
|
||||
"integration_points": {
|
||||
"type": "string",
|
||||
"description": "Where this task connects with existing code: APIs, hooks, events, shared state"
|
||||
},
|
||||
"constraints": {
|
||||
"type": "string",
|
||||
"description": "Technical constraints and limitations affecting implementation"
|
||||
},
|
||||
"clarification_needs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["question", "context", "options"],
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "The clarification question to ask user"
|
||||
},
|
||||
"context": {
|
||||
"type": "string",
|
||||
"description": "Background context explaining why this clarification is needed"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Available options for user to choose from (2-4 options)"
|
||||
},
|
||||
"recommended": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "Zero-based index of recommended option in the options array. Based on codebase patterns and best practices analysis."
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Ambiguities requiring user input before planning"
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["timestamp", "task_description", "source"],
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of exploration"
|
||||
},
|
||||
"task_description": {
|
||||
"type": "string",
|
||||
"description": "Original task description that triggered exploration"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"const": "cli-explore-agent",
|
||||
"description": "Agent that performed exploration"
|
||||
},
|
||||
"exploration_angle": {
|
||||
"type": "string",
|
||||
"description": "Agent-chosen exploration angle (e.g., 'architecture', 'security', 'dataflow')"
|
||||
},
|
||||
"exploration_index": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 4,
|
||||
"description": "Exploration index (1-4) in parallel exploration set"
|
||||
},
|
||||
"total_explorations": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 4,
|
||||
"description": "Total number of parallel explorations"
|
||||
},
|
||||
"duration_seconds": {
|
||||
"type": "integer",
|
||||
"description": "Exploration duration in seconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
298
.ccw/workflows/cli-templates/schemas/fix-plan-json-schema.json
Normal file
298
.ccw/workflows/cli-templates/schemas/fix-plan-json-schema.json
Normal file
@@ -0,0 +1,298 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Fix Plan Schema",
|
||||
"description": "Bug fix plan from cli-lite-planning-agent or direct planning",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"summary",
|
||||
"root_cause",
|
||||
"strategy",
|
||||
"tasks",
|
||||
"estimated_time",
|
||||
"recommended_execution",
|
||||
"severity",
|
||||
"risk_level",
|
||||
"_metadata"
|
||||
],
|
||||
"properties": {
|
||||
"summary": {
|
||||
"type": "string",
|
||||
"description": "2-3 sentence overview of the fix plan"
|
||||
},
|
||||
"root_cause": {
|
||||
"type": "string",
|
||||
"description": "Consolidated root cause statement from all diagnoses"
|
||||
},
|
||||
"strategy": {
|
||||
"type": "string",
|
||||
"enum": ["immediate_patch", "comprehensive_fix", "refactor"],
|
||||
"description": "Fix strategy: immediate_patch (minimal change), comprehensive_fix (proper solution), refactor (structural improvement)"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 5,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "scope", "action", "description", "implementation", "verification"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^FIX[0-9]+$",
|
||||
"description": "Task identifier (FIX1, FIX2, FIX3...)"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Task title (action verb + target, e.g., 'Fix token validation edge case')"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"description": "Task scope: module path (src/auth/), feature name, or single file. Prefer module level."
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "Primary file (deprecated, use scope + modification_points instead)"
|
||||
},
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": ["Fix", "Update", "Refactor", "Add", "Delete", "Configure"],
|
||||
"description": "Primary action type"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "What to fix (1-2 sentences)"
|
||||
},
|
||||
"modification_points": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["file", "target", "change"],
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "File path within scope"
|
||||
},
|
||||
"target": {
|
||||
"type": "string",
|
||||
"description": "Function/class/line range (e.g., 'validateToken:45-60')"
|
||||
},
|
||||
"change": {
|
||||
"type": "string",
|
||||
"description": "Brief description of change"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "All modification points for this fix task. Group related changes into one task."
|
||||
},
|
||||
"implementation": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"minItems": 2,
|
||||
"maxItems": 5,
|
||||
"description": "Step-by-step fix implementation guide"
|
||||
},
|
||||
"verification": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"minItems": 1,
|
||||
"maxItems": 3,
|
||||
"description": "Verification/test criteria to confirm fix works"
|
||||
},
|
||||
"reference": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"description": "Pattern name to follow"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Reference file paths to study"
|
||||
},
|
||||
"examples": {
|
||||
"type": "string",
|
||||
"description": "Specific guidance or example references"
|
||||
}
|
||||
},
|
||||
"description": "Reference materials for fix implementation (optional)"
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^FIX[0-9]+$"
|
||||
},
|
||||
"description": "Task IDs this task depends on (e.g., ['FIX1'])"
|
||||
},
|
||||
"risk": {
|
||||
"type": "string",
|
||||
"enum": ["low", "medium", "high"],
|
||||
"description": "Risk level of this specific fix task"
|
||||
},
|
||||
"cli_execution_id": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z0-9_-]+$",
|
||||
"description": "Fixed CLI execution ID for this fix task (e.g., 'session-FIX1', 'bugfix-001-diagnosis')"
|
||||
},
|
||||
"cli_execution": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"strategy": {
|
||||
"type": "string",
|
||||
"enum": ["new", "resume", "fork", "merge_fork"],
|
||||
"description": "CLI execution strategy: new (no deps), resume (1 dep, continue), fork (1 dep, branch), merge_fork (N deps, combine)"
|
||||
},
|
||||
"resume_from": {
|
||||
"type": "string",
|
||||
"description": "Parent task's cli_execution_id (for resume/fork strategies)"
|
||||
},
|
||||
"merge_from": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Multiple parents' cli_execution_ids (for merge_fork strategy)"
|
||||
}
|
||||
},
|
||||
"description": "CLI execution strategy based on task dependencies"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Structured fix task breakdown (1-5 tasks)"
|
||||
},
|
||||
"flow_control": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"execution_order": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"phase": {
|
||||
"type": "string",
|
||||
"description": "Phase name (e.g., 'parallel-1', 'sequential-1')"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Task IDs in this phase"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["parallel", "sequential"],
|
||||
"description": "Execution type"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Ordered execution phases"
|
||||
},
|
||||
"exit_conditions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "string",
|
||||
"description": "Condition for successful fix completion"
|
||||
},
|
||||
"failure": {
|
||||
"type": "string",
|
||||
"description": "Condition that indicates fix failure"
|
||||
}
|
||||
},
|
||||
"description": "Conditions for fix workflow termination"
|
||||
}
|
||||
},
|
||||
"description": "Execution flow control (optional, auto-inferred from depends_on if not provided)"
|
||||
},
|
||||
"focus_paths": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Key file paths affected by this fix (aggregated from tasks)"
|
||||
},
|
||||
"test_strategy": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"enum": ["unit", "integration", "e2e", "smoke", "full"],
|
||||
"description": "Test scope to run after fix"
|
||||
},
|
||||
"specific_tests": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Specific test files or patterns to run"
|
||||
},
|
||||
"manual_verification": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Manual verification steps if automated tests not available"
|
||||
}
|
||||
},
|
||||
"description": "Testing strategy for fix verification"
|
||||
},
|
||||
"rollback_plan": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"strategy": {
|
||||
"type": "string",
|
||||
"enum": ["git_revert", "feature_flag", "manual"],
|
||||
"description": "Rollback strategy if fix fails"
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Rollback steps"
|
||||
}
|
||||
},
|
||||
"description": "Rollback plan if fix causes issues (optional, recommended for high severity)"
|
||||
},
|
||||
"estimated_time": {
|
||||
"type": "string",
|
||||
"description": "Total estimated fix time (e.g., '30 minutes', '2 hours')"
|
||||
},
|
||||
"recommended_execution": {
|
||||
"type": "string",
|
||||
"enum": ["Agent", "Codex"],
|
||||
"description": "Recommended execution method based on complexity"
|
||||
},
|
||||
"severity": {
|
||||
"type": "string",
|
||||
"enum": ["Low", "Medium", "High", "Critical"],
|
||||
"description": "Bug severity level"
|
||||
},
|
||||
"risk_level": {
|
||||
"type": "string",
|
||||
"enum": ["low", "medium", "high"],
|
||||
"description": "Risk level of implementing the fix"
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["timestamp", "source"],
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of planning"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"enum": ["cli-lite-planning-agent", "direct-planning"],
|
||||
"description": "Planning source"
|
||||
},
|
||||
"planning_mode": {
|
||||
"type": "string",
|
||||
"enum": ["direct", "agent-based"],
|
||||
"description": "Planning execution mode"
|
||||
},
|
||||
"diagnosis_angles": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Diagnosis angles used for context"
|
||||
},
|
||||
"duration_seconds": {
|
||||
"type": "integer",
|
||||
"description": "Planning duration in seconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
170
.ccw/workflows/cli-templates/schemas/issues-jsonl-schema.json
Normal file
170
.ccw/workflows/cli-templates/schemas/issues-jsonl-schema.json
Normal file
@@ -0,0 +1,170 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Issues JSONL Schema",
|
||||
"description": "Schema for each line in issues.jsonl (flat storage)",
|
||||
"type": "object",
|
||||
"required": ["id", "title", "status", "created_at"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Issue ID (GH-123, ISS-xxx, DSC-001)"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["registered", "planning", "planned", "queued", "executing", "completed", "failed", "paused"],
|
||||
"default": "registered"
|
||||
},
|
||||
"priority": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 5,
|
||||
"default": 3,
|
||||
"description": "1=critical, 2=high, 3=medium, 4=low, 5=trivial"
|
||||
},
|
||||
"context": {
|
||||
"type": "string",
|
||||
"description": "Issue context/description (markdown)"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"enum": ["github", "text", "discovery"],
|
||||
"description": "Source of the issue"
|
||||
},
|
||||
"source_url": {
|
||||
"type": "string",
|
||||
"description": "Original source URL (for GitHub issues)"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Issue tags"
|
||||
},
|
||||
"extended_context": {
|
||||
"type": "object",
|
||||
"description": "Minimal extended context for planning hints",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "file:line format (e.g., 'src/auth.ts:42')"
|
||||
},
|
||||
"suggested_fix": {
|
||||
"type": "string",
|
||||
"description": "Suggested remediation"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Additional notes (user clarifications or discovery hints)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"affected_components": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Files/modules affected"
|
||||
},
|
||||
"feedback": {
|
||||
"type": "array",
|
||||
"description": "Execution feedback history (failures, clarifications, rejections) for planning phase reference",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["type", "stage", "content", "created_at"],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["failure", "clarification", "rejection"],
|
||||
"description": "Type of feedback"
|
||||
},
|
||||
"stage": {
|
||||
"type": "string",
|
||||
"enum": ["new", "plan", "execute"],
|
||||
"description": "Which stage the feedback occurred (new=creation, plan=planning, execute=execution)"
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "JSON string for failures (with solution_id, task_id, error_type, message, stack_trace) or plain text for clarifications/rejections"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Timestamp when feedback was created"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"lifecycle_requirements": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"test_strategy": {
|
||||
"type": "string",
|
||||
"enum": ["unit", "integration", "e2e", "manual", "auto"]
|
||||
},
|
||||
"regression_scope": {
|
||||
"type": "string",
|
||||
"enum": ["affected", "related", "full"]
|
||||
},
|
||||
"acceptance_type": {
|
||||
"type": "string",
|
||||
"enum": ["automated", "manual", "both"]
|
||||
},
|
||||
"commit_strategy": {
|
||||
"type": "string",
|
||||
"enum": ["per-task", "squash", "atomic"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"bound_solution_id": {
|
||||
"type": "string",
|
||||
"description": "ID of the bound solution (null if none bound)"
|
||||
},
|
||||
"solution_count": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Number of candidate solutions"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planned_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"id": "DSC-001",
|
||||
"title": "Fix: SQLite connection pool memory leak",
|
||||
"status": "registered",
|
||||
"priority": 1,
|
||||
"context": "Connection pool cleanup only happens when MAX_POOL_SIZE is reached...",
|
||||
"source": "discovery",
|
||||
"tags": ["bug", "resource-leak", "critical"],
|
||||
"extended_context": {
|
||||
"location": "storage/sqlite_store.py:59",
|
||||
"suggested_fix": "Implement periodic cleanup or weak references",
|
||||
"notes": null
|
||||
},
|
||||
"affected_components": ["storage/sqlite_store.py"],
|
||||
"lifecycle_requirements": {
|
||||
"test_strategy": "unit",
|
||||
"regression_scope": "affected",
|
||||
"acceptance_type": "automated",
|
||||
"commit_strategy": "per-task"
|
||||
},
|
||||
"bound_solution_id": null,
|
||||
"solution_count": 0,
|
||||
"created_at": "2025-12-28T18:22:37Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Multi-CLI Discussion Artifact Schema",
|
||||
"description": "Visualization-friendly output for multi-CLI collaborative discussion agent",
|
||||
"type": "object",
|
||||
"required": ["metadata", "discussionTopic", "relatedFiles", "planning", "decision", "decisionRecords"],
|
||||
"properties": {
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"required": ["artifactId", "roundId", "timestamp", "contributingAgents"],
|
||||
"properties": {
|
||||
"artifactId": {
|
||||
"type": "string",
|
||||
"description": "Unique ID for this artifact (e.g., 'MCP-auth-refactor-2026-01-13-round-1')"
|
||||
},
|
||||
"roundId": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "Discussion round number"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp"
|
||||
},
|
||||
"contributingAgents": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/AgentIdentifier"
|
||||
},
|
||||
"description": "Agents that contributed to this artifact"
|
||||
},
|
||||
"durationSeconds": {
|
||||
"type": "integer",
|
||||
"description": "Total duration in seconds"
|
||||
},
|
||||
"exportFormats": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": ["markdown", "html"]
|
||||
},
|
||||
"description": "Supported export formats"
|
||||
}
|
||||
}
|
||||
},
|
||||
"discussionTopic": {
|
||||
"type": "object",
|
||||
"required": ["title", "description", "status"],
|
||||
"properties": {
|
||||
"title": {
|
||||
"$ref": "#/definitions/I18nLabel"
|
||||
},
|
||||
"description": {
|
||||
"$ref": "#/definitions/I18nLabel"
|
||||
},
|
||||
"scope": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"included": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/I18nLabel" },
|
||||
"description": "What's in scope"
|
||||
},
|
||||
"excluded": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/I18nLabel" },
|
||||
"description": "What's explicitly out of scope"
|
||||
}
|
||||
}
|
||||
},
|
||||
"keyQuestions": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/I18nLabel" },
|
||||
"description": "Questions being explored"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["exploring", "analyzing", "debating", "decided", "blocked"],
|
||||
"description": "Discussion status"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Tags for filtering (e.g., ['auth', 'security', 'api'])"
|
||||
}
|
||||
}
|
||||
},
|
||||
"relatedFiles": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fileTree": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/FileNode" },
|
||||
"description": "File tree structure"
|
||||
},
|
||||
"dependencyGraph": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/DependencyEdge" },
|
||||
"description": "Dependency relationships"
|
||||
},
|
||||
"impactSummary": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/FileImpact" },
|
||||
"description": "File impact summary"
|
||||
}
|
||||
}
|
||||
},
|
||||
"planning": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"functional": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/Requirement" },
|
||||
"description": "Functional requirements"
|
||||
},
|
||||
"nonFunctional": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/Requirement" },
|
||||
"description": "Non-functional requirements"
|
||||
},
|
||||
"acceptanceCriteria": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/AcceptanceCriterion" },
|
||||
"description": "Acceptance criteria"
|
||||
}
|
||||
}
|
||||
},
|
||||
"decision": {
|
||||
"type": "object",
|
||||
"required": ["status", "confidenceScore"],
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["pending", "decided", "conflict"],
|
||||
"description": "Decision status"
|
||||
},
|
||||
"summary": {
|
||||
"$ref": "#/definitions/I18nLabel"
|
||||
},
|
||||
"selectedSolution": {
|
||||
"$ref": "#/definitions/Solution"
|
||||
},
|
||||
"rejectedAlternatives": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/RejectedSolution" }
|
||||
},
|
||||
"confidenceScore": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score (0.0 to 1.0)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"decisionRecords": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timeline": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/DecisionEvent" },
|
||||
"description": "Timeline of decision events"
|
||||
}
|
||||
}
|
||||
},
|
||||
"_internal": {
|
||||
"type": "object",
|
||||
"description": "Internal analysis data (for debugging)",
|
||||
"properties": {
|
||||
"cli_analyses": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/CLIAnalysis" }
|
||||
},
|
||||
"cross_verification": {
|
||||
"$ref": "#/definitions/CrossVerification"
|
||||
},
|
||||
"convergence": {
|
||||
"$ref": "#/definitions/ConvergenceMetrics"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"I18nLabel": {
|
||||
"type": "object",
|
||||
"required": ["en", "zh"],
|
||||
"properties": {
|
||||
"en": { "type": "string" },
|
||||
"zh": { "type": "string" }
|
||||
},
|
||||
"description": "Multi-language label for UI display"
|
||||
},
|
||||
"AgentIdentifier": {
|
||||
"type": "object",
|
||||
"required": ["name", "id"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Gemini", "Codex", "Qwen", "Human", "System"]
|
||||
},
|
||||
"id": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"FileNode": {
|
||||
"type": "object",
|
||||
"required": ["path", "type"],
|
||||
"properties": {
|
||||
"path": { "type": "string" },
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["file", "directory"]
|
||||
},
|
||||
"modificationStatus": {
|
||||
"type": "string",
|
||||
"enum": ["added", "modified", "deleted", "unchanged"]
|
||||
},
|
||||
"impactScore": {
|
||||
"type": "string",
|
||||
"enum": ["critical", "high", "medium", "low"]
|
||||
},
|
||||
"children": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/FileNode" }
|
||||
},
|
||||
"codeSnippet": { "$ref": "#/definitions/CodeSnippet" }
|
||||
}
|
||||
},
|
||||
"DependencyEdge": {
|
||||
"type": "object",
|
||||
"required": ["source", "target", "relationship"],
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"target": { "type": "string" },
|
||||
"relationship": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"FileImpact": {
|
||||
"type": "object",
|
||||
"required": ["filePath", "score", "reasoning"],
|
||||
"properties": {
|
||||
"filePath": { "type": "string" },
|
||||
"line": { "type": "integer" },
|
||||
"score": {
|
||||
"type": "string",
|
||||
"enum": ["critical", "high", "medium", "low"]
|
||||
},
|
||||
"reasoning": { "$ref": "#/definitions/I18nLabel" }
|
||||
}
|
||||
},
|
||||
"CodeSnippet": {
|
||||
"type": "object",
|
||||
"required": ["startLine", "endLine", "code"],
|
||||
"properties": {
|
||||
"startLine": { "type": "integer" },
|
||||
"endLine": { "type": "integer" },
|
||||
"code": { "type": "string" },
|
||||
"language": { "type": "string" },
|
||||
"comment": { "$ref": "#/definitions/I18nLabel" }
|
||||
}
|
||||
},
|
||||
"Requirement": {
|
||||
"type": "object",
|
||||
"required": ["id", "description", "priority"],
|
||||
"properties": {
|
||||
"id": { "type": "string" },
|
||||
"description": { "$ref": "#/definitions/I18nLabel" },
|
||||
"priority": {
|
||||
"type": "string",
|
||||
"enum": ["critical", "high", "medium", "low"]
|
||||
},
|
||||
"source": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"AcceptanceCriterion": {
|
||||
"type": "object",
|
||||
"required": ["id", "description", "isMet"],
|
||||
"properties": {
|
||||
"id": { "type": "string" },
|
||||
"description": { "$ref": "#/definitions/I18nLabel" },
|
||||
"isMet": { "type": "boolean" }
|
||||
}
|
||||
},
|
||||
"Solution": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "description"],
|
||||
"properties": {
|
||||
"id": { "type": "string" },
|
||||
"title": { "$ref": "#/definitions/I18nLabel" },
|
||||
"description": { "$ref": "#/definitions/I18nLabel" },
|
||||
"pros": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/I18nLabel" }
|
||||
},
|
||||
"cons": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/I18nLabel" }
|
||||
},
|
||||
"estimatedEffort": { "$ref": "#/definitions/I18nLabel" },
|
||||
"risk": {
|
||||
"type": "string",
|
||||
"enum": ["critical", "high", "medium", "low"]
|
||||
},
|
||||
"affectedFiles": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/FileImpact" }
|
||||
},
|
||||
"sourceCLIs": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"RejectedSolution": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/Solution" },
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["rejectionReason"],
|
||||
"properties": {
|
||||
"rejectionReason": { "$ref": "#/definitions/I18nLabel" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"DecisionEvent": {
|
||||
"type": "object",
|
||||
"required": ["eventId", "timestamp", "type", "contributor", "summary"],
|
||||
"properties": {
|
||||
"eventId": { "type": "string" },
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["proposal", "argument", "agreement", "disagreement", "decision", "reversal"]
|
||||
},
|
||||
"contributor": { "$ref": "#/definitions/AgentIdentifier" },
|
||||
"summary": { "$ref": "#/definitions/I18nLabel" },
|
||||
"evidence": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/Evidence" }
|
||||
},
|
||||
"reversibility": {
|
||||
"type": "string",
|
||||
"enum": ["easily_reversible", "requires_refactoring", "irreversible"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Evidence": {
|
||||
"type": "object",
|
||||
"required": ["type", "content", "description"],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["link", "code_snippet", "log_output", "benchmark", "reference"]
|
||||
},
|
||||
"content": {},
|
||||
"description": { "$ref": "#/definitions/I18nLabel" }
|
||||
}
|
||||
},
|
||||
"CLIAnalysis": {
|
||||
"type": "object",
|
||||
"required": ["tool", "perspective", "feasibility_score"],
|
||||
"properties": {
|
||||
"tool": {
|
||||
"type": "string",
|
||||
"enum": ["gemini", "codex", "qwen"]
|
||||
},
|
||||
"perspective": { "type": "string" },
|
||||
"feasibility_score": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
},
|
||||
"findings": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"implementation_approaches": { "type": "array" },
|
||||
"technical_concerns": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"code_locations": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/FileImpact" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"CrossVerification": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"agreements": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"disagreements": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"resolution": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"ConvergenceMetrics": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"score": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1
|
||||
},
|
||||
"new_insights": { "type": "boolean" },
|
||||
"recommendation": {
|
||||
"type": "string",
|
||||
"enum": ["continue", "converged", "user_input_needed"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
444
.ccw/workflows/cli-templates/schemas/plan-json-schema.json
Normal file
444
.ccw/workflows/cli-templates/schemas/plan-json-schema.json
Normal file
@@ -0,0 +1,444 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Plan Object Schema",
|
||||
"description": "Implementation plan from cli-lite-planning-agent or direct planning",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"summary",
|
||||
"approach",
|
||||
"tasks",
|
||||
"estimated_time",
|
||||
"recommended_execution",
|
||||
"complexity",
|
||||
"_metadata"
|
||||
],
|
||||
"properties": {
|
||||
"summary": {
|
||||
"type": "string",
|
||||
"description": "2-3 sentence overview of the implementation plan"
|
||||
},
|
||||
"approach": {
|
||||
"type": "string",
|
||||
"description": "High-level implementation strategy and methodology"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 10,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "scope", "action", "description", "implementation", "acceptance"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^T[0-9]+$",
|
||||
"description": "Task identifier (T1, T2, T3...)"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Task title (action verb + target module/feature)"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"description": "Task scope: module path (src/auth/), feature name, or single file. Prefer module/feature level over single file."
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "Primary file (deprecated, use scope + modification_points instead)"
|
||||
},
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": ["Create", "Update", "Implement", "Refactor", "Add", "Delete", "Configure", "Test", "Fix"],
|
||||
"description": "Primary action type"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "What to implement (1-2 sentences)"
|
||||
},
|
||||
"modification_points": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["file", "target", "change"],
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "File path within scope"
|
||||
},
|
||||
"target": {
|
||||
"type": "string",
|
||||
"description": "Function/class/line range (e.g., 'validateToken:45-60')"
|
||||
},
|
||||
"change": {
|
||||
"type": "string",
|
||||
"description": "Brief description of change"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "All modification points for this task. Group related changes (same feature/module) into one task with multiple modification_points."
|
||||
},
|
||||
"implementation": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"minItems": 2,
|
||||
"maxItems": 7,
|
||||
"description": "Step-by-step implementation guide"
|
||||
},
|
||||
"reference": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"description": "Pattern name to follow"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Reference file paths to study"
|
||||
},
|
||||
"examples": {
|
||||
"type": "string",
|
||||
"description": "Specific guidance or example references"
|
||||
}
|
||||
},
|
||||
"description": "Reference materials for implementation (optional)"
|
||||
},
|
||||
"acceptance": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"minItems": 1,
|
||||
"maxItems": 4,
|
||||
"description": "Verification criteria (quantified, testable)"
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^T[0-9]+$"
|
||||
},
|
||||
"description": "Task IDs this task depends on (e.g., ['T1', 'T2'])"
|
||||
},
|
||||
"cli_execution_id": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-zA-Z0-9_-]+$",
|
||||
"description": "Fixed CLI execution ID for this task (e.g., 'session-T1', 'IMPL-001-analysis')"
|
||||
},
|
||||
"cli_execution": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"strategy": {
|
||||
"type": "string",
|
||||
"enum": ["new", "resume", "fork", "merge_fork"],
|
||||
"description": "CLI execution strategy: new (no deps), resume (1 dep, continue), fork (1 dep, branch), merge_fork (N deps, combine)"
|
||||
},
|
||||
"resume_from": {
|
||||
"type": "string",
|
||||
"description": "Parent task's cli_execution_id (for resume/fork strategies)"
|
||||
},
|
||||
"merge_from": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Multiple parents' cli_execution_ids (for merge_fork strategy)"
|
||||
}
|
||||
},
|
||||
"description": "CLI execution strategy based on task dependencies"
|
||||
},
|
||||
"rationale": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"chosen_approach": {
|
||||
"type": "string",
|
||||
"description": "The selected implementation approach and why it was chosen"
|
||||
},
|
||||
"alternatives_considered": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Alternative approaches that were considered but not chosen"
|
||||
},
|
||||
"decision_factors": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Key factors that influenced the decision (performance, maintainability, cost, etc.)"
|
||||
},
|
||||
"tradeoffs": {
|
||||
"type": "string",
|
||||
"description": "Known tradeoffs of the chosen approach"
|
||||
}
|
||||
},
|
||||
"description": "Design rationale explaining WHY this approach was chosen (required for Medium/High complexity)"
|
||||
},
|
||||
"verification": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"unit_tests": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "List of unit test names/descriptions to create"
|
||||
},
|
||||
"integration_tests": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "List of integration test names/descriptions to create"
|
||||
},
|
||||
"manual_checks": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Manual verification steps with specific actions"
|
||||
},
|
||||
"success_metrics": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Quantified metrics for success (e.g., 'Response time <200ms', 'Coverage >80%')"
|
||||
}
|
||||
},
|
||||
"description": "Detailed verification steps beyond acceptance criteria (required for Medium/High complexity)"
|
||||
},
|
||||
"risks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["description", "probability", "impact", "mitigation"],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Description of the risk"
|
||||
},
|
||||
"probability": {
|
||||
"type": "string",
|
||||
"enum": ["Low", "Medium", "High"],
|
||||
"description": "Likelihood of the risk occurring"
|
||||
},
|
||||
"impact": {
|
||||
"type": "string",
|
||||
"enum": ["Low", "Medium", "High"],
|
||||
"description": "Impact severity if the risk occurs"
|
||||
},
|
||||
"mitigation": {
|
||||
"type": "string",
|
||||
"description": "Strategy to mitigate or prevent the risk"
|
||||
},
|
||||
"fallback": {
|
||||
"type": "string",
|
||||
"description": "Alternative approach if mitigation fails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Risk assessment and mitigation strategies (required for High complexity)"
|
||||
},
|
||||
"code_skeleton": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"interfaces": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"definition": {"type": "string"},
|
||||
"purpose": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"description": "Key interface/type definitions"
|
||||
},
|
||||
"key_functions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"signature": {"type": "string"},
|
||||
"purpose": {"type": "string"},
|
||||
"returns": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"description": "Critical function signatures"
|
||||
},
|
||||
"classes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"purpose": {"type": "string"},
|
||||
"methods": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Key class structures"
|
||||
}
|
||||
},
|
||||
"description": "Code skeleton with interface/function signatures (required for High complexity)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Structured task breakdown (1-10 tasks)"
|
||||
},
|
||||
"data_flow": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"diagram": {
|
||||
"type": "string",
|
||||
"description": "ASCII/text representation of data flow (e.g., 'A → B → C')"
|
||||
},
|
||||
"stages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["stage", "input", "output", "component"],
|
||||
"properties": {
|
||||
"stage": {
|
||||
"type": "string",
|
||||
"description": "Stage name (e.g., 'Extraction', 'Processing', 'Storage')"
|
||||
},
|
||||
"input": {
|
||||
"type": "string",
|
||||
"description": "Input data format/type"
|
||||
},
|
||||
"output": {
|
||||
"type": "string",
|
||||
"description": "Output data format/type"
|
||||
},
|
||||
"component": {
|
||||
"type": "string",
|
||||
"description": "Component/module handling this stage"
|
||||
},
|
||||
"transformations": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Data transformations applied in this stage"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Detailed data flow stages"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "External dependencies or data sources"
|
||||
}
|
||||
},
|
||||
"description": "Global data flow design showing how data moves through the system (required for High complexity)"
|
||||
},
|
||||
"design_decisions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["decision", "rationale"],
|
||||
"properties": {
|
||||
"decision": {
|
||||
"type": "string",
|
||||
"description": "The design decision made"
|
||||
},
|
||||
"rationale": {
|
||||
"type": "string",
|
||||
"description": "Why this decision was made"
|
||||
},
|
||||
"tradeoff": {
|
||||
"type": "string",
|
||||
"description": "What was traded off for this decision"
|
||||
},
|
||||
"alternatives": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Alternatives that were considered"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Global design decisions that affect the entire plan"
|
||||
},
|
||||
"flow_control": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"execution_order": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"phase": {
|
||||
"type": "string",
|
||||
"description": "Phase name (e.g., 'parallel-1', 'sequential-1')"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Task IDs in this phase"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["parallel", "sequential"],
|
||||
"description": "Execution type"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Ordered execution phases"
|
||||
},
|
||||
"exit_conditions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "string",
|
||||
"description": "Condition for successful completion"
|
||||
},
|
||||
"failure": {
|
||||
"type": "string",
|
||||
"description": "Condition that indicates failure"
|
||||
}
|
||||
},
|
||||
"description": "Conditions for workflow termination"
|
||||
}
|
||||
},
|
||||
"description": "Execution flow control (optional, auto-inferred from depends_on if not provided)"
|
||||
},
|
||||
"focus_paths": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Key file paths affected by this plan (aggregated from tasks)"
|
||||
},
|
||||
"estimated_time": {
|
||||
"type": "string",
|
||||
"description": "Total estimated implementation time (e.g., '30 minutes', '2 hours')"
|
||||
},
|
||||
"recommended_execution": {
|
||||
"type": "string",
|
||||
"enum": ["Agent", "Codex"],
|
||||
"description": "Recommended execution method based on complexity"
|
||||
},
|
||||
"complexity": {
|
||||
"type": "string",
|
||||
"enum": ["Low", "Medium", "High"],
|
||||
"description": "Task complexity level"
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["timestamp", "source"],
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of planning"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"enum": ["cli-lite-planning-agent", "direct-planning"],
|
||||
"description": "Planning source"
|
||||
},
|
||||
"planning_mode": {
|
||||
"type": "string",
|
||||
"enum": ["direct", "agent-based"],
|
||||
"description": "Planning execution mode"
|
||||
},
|
||||
"exploration_angles": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Exploration angles used for context"
|
||||
},
|
||||
"duration_seconds": {
|
||||
"type": "integer",
|
||||
"description": "Planning duration in seconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Plan Verification Agent Schema",
|
||||
"description": "Defines dimensions, severity rules, and CLI templates for plan verification agent",
|
||||
|
||||
"dimensions": {
|
||||
"A": { "name": "User Intent Alignment", "tier": 1, "severity": "CRITICAL",
|
||||
"checks": ["Goal Alignment", "Scope Drift", "Success Criteria Match", "Intent Conflicts"] },
|
||||
"B": { "name": "Requirements Coverage", "tier": 1, "severity": "CRITICAL",
|
||||
"checks": ["Orphaned Requirements", "Unmapped Tasks", "NFR Coverage Gaps"] },
|
||||
"C": { "name": "Consistency Validation", "tier": 1, "severity": "CRITICAL",
|
||||
"checks": ["Requirement Conflicts", "Architecture Drift", "Terminology Drift", "Data Model Inconsistency"] },
|
||||
"D": { "name": "Dependency Integrity", "tier": 2, "severity": "HIGH",
|
||||
"checks": ["Circular Dependencies", "Missing Dependencies", "Broken Dependencies", "Logical Ordering"] },
|
||||
"E": { "name": "Synthesis Alignment", "tier": 2, "severity": "HIGH",
|
||||
"checks": ["Priority Conflicts", "Success Criteria Mismatch", "Risk Mitigation Gaps"] },
|
||||
"F": { "name": "Task Specification Quality", "tier": 3, "severity": "MEDIUM",
|
||||
"checks": ["Ambiguous Focus Paths", "Underspecified Acceptance", "Missing Artifacts", "Weak Flow Control"] },
|
||||
"G": { "name": "Duplication Detection", "tier": 4, "severity": "LOW",
|
||||
"checks": ["Overlapping Task Scope", "Redundant Coverage"] },
|
||||
"H": { "name": "Feasibility Assessment", "tier": 4, "severity": "LOW",
|
||||
"checks": ["Complexity Misalignment", "Resource Conflicts", "Skill Gap Risks"] },
|
||||
"I": { "name": "Constraints Compliance", "tier": 1, "severity": "CRITICAL",
|
||||
"checks": ["Consolidated Constraints Violation", "Phase Constraint Ignored", "User Constraint Override"] },
|
||||
"J": { "name": "N+1 Context Validation", "tier": 2, "severity": "HIGH",
|
||||
"checks": ["Deferred Item Included", "Decision Contradiction", "Revisit Flag Ignored"] }
|
||||
},
|
||||
|
||||
"tiers": {
|
||||
"1": { "dimensions": ["A", "B", "C", "I"], "priority": "CRITICAL", "limit": null, "rule": "analysis-review-architecture" },
|
||||
"2": { "dimensions": ["D", "E", "J"], "priority": "HIGH", "limit": 15, "rule": "analysis-diagnose-bug-root-cause" },
|
||||
"3": { "dimensions": ["F"], "priority": "MEDIUM", "limit": 20, "rule": "analysis-analyze-code-patterns" },
|
||||
"4": { "dimensions": ["G", "H"], "priority": "LOW", "limit": 15, "rule": "analysis-analyze-code-patterns" }
|
||||
},
|
||||
|
||||
"severity_rules": {
|
||||
"CRITICAL": ["User intent violation", "Synthesis authority violation", "Zero coverage", "Circular/broken deps", "Constraint violation"],
|
||||
"HIGH": ["NFR gaps", "Priority conflicts", "Missing risk mitigation", "Deferred item included", "Decision contradiction"],
|
||||
"MEDIUM": ["Terminology drift", "Missing refs", "Weak flow control"],
|
||||
"LOW": ["Style improvements", "Minor redundancy"]
|
||||
},
|
||||
|
||||
"quality_gate": {
|
||||
"BLOCK_EXECUTION": { "condition": "critical > 0", "emoji": "🛑" },
|
||||
"PROCEED_WITH_FIXES": { "condition": "critical == 0 && high > 0", "emoji": "⚠️" },
|
||||
"PROCEED_WITH_CAUTION": { "condition": "critical == 0 && high == 0 && medium > 0", "emoji": "✅" },
|
||||
"PROCEED": { "condition": "only low or none", "emoji": "✅" }
|
||||
},
|
||||
|
||||
"token_budget": { "total_findings": 50, "early_exit": "CRITICAL > 0 in Tier 1 → skip Tier 3-4" }
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Project Guidelines Schema",
|
||||
"description": "Schema for project-guidelines.json - user-maintained rules and constraints",
|
||||
"type": "object",
|
||||
"required": ["conventions", "constraints", "_metadata"],
|
||||
"properties": {
|
||||
"conventions": {
|
||||
"type": "object",
|
||||
"description": "Coding conventions and standards",
|
||||
"required": ["coding_style", "naming_patterns", "file_structure", "documentation"],
|
||||
"properties": {
|
||||
"coding_style": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Coding style rules (e.g., 'Use strict TypeScript mode', 'Prefer const over let')"
|
||||
},
|
||||
"naming_patterns": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Naming conventions (e.g., 'Use camelCase for variables', 'Use PascalCase for components')"
|
||||
},
|
||||
"file_structure": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "File organization rules (e.g., 'One component per file', 'Tests alongside source files')"
|
||||
},
|
||||
"documentation": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Documentation requirements (e.g., 'JSDoc for public APIs', 'README for each module')"
|
||||
}
|
||||
}
|
||||
},
|
||||
"constraints": {
|
||||
"type": "object",
|
||||
"description": "Technical constraints and boundaries",
|
||||
"required": ["architecture", "tech_stack", "performance", "security"],
|
||||
"properties": {
|
||||
"architecture": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Architecture constraints (e.g., 'No circular dependencies', 'Services must be stateless')"
|
||||
},
|
||||
"tech_stack": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Technology constraints (e.g., 'No new dependencies without review', 'Use native fetch over axios')"
|
||||
},
|
||||
"performance": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Performance requirements (e.g., 'API response < 200ms', 'Bundle size < 500KB')"
|
||||
},
|
||||
"security": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Security requirements (e.g., 'Sanitize all user input', 'No secrets in code')"
|
||||
}
|
||||
}
|
||||
},
|
||||
"quality_rules": {
|
||||
"type": "array",
|
||||
"description": "Enforceable quality rules",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["rule", "scope"],
|
||||
"properties": {
|
||||
"rule": {
|
||||
"type": "string",
|
||||
"description": "The quality rule statement"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"description": "Where the rule applies (e.g., 'all', 'src/**', 'tests/**')"
|
||||
},
|
||||
"enforced_by": {
|
||||
"type": "string",
|
||||
"description": "How the rule is enforced (e.g., 'eslint', 'pre-commit', 'code-review')"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"learnings": {
|
||||
"type": "array",
|
||||
"description": "Project learnings captured from workflow sessions",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["date", "insight"],
|
||||
"properties": {
|
||||
"date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Date the learning was captured (YYYY-MM-DD)"
|
||||
},
|
||||
"session_id": {
|
||||
"type": "string",
|
||||
"description": "WFS session ID where the learning originated"
|
||||
},
|
||||
"insight": {
|
||||
"type": "string",
|
||||
"description": "The learning or insight captured"
|
||||
},
|
||||
"context": {
|
||||
"type": "string",
|
||||
"description": "Additional context about when/why this learning applies"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"enum": ["architecture", "performance", "security", "testing", "workflow", "other"],
|
||||
"description": "Category of the learning"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["created_at", "version"],
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of creation"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Schema version (e.g., '1.0.0')"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of last update"
|
||||
},
|
||||
"updated_by": {
|
||||
"type": "string",
|
||||
"description": "Who/what last updated the file (e.g., 'user', 'workflow:session:solidify')"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
221
.ccw/workflows/cli-templates/schemas/project-tech-schema.json
Normal file
221
.ccw/workflows/cli-templates/schemas/project-tech-schema.json
Normal file
@@ -0,0 +1,221 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Project Tech Schema",
|
||||
"description": "Schema for project-tech.json - auto-generated technical analysis (stack, architecture, components)",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"project_name",
|
||||
"initialized_at",
|
||||
"overview",
|
||||
"features",
|
||||
"statistics",
|
||||
"_metadata"
|
||||
],
|
||||
"properties": {
|
||||
"project_name": {
|
||||
"type": "string",
|
||||
"description": "Project name extracted from git repo or directory"
|
||||
},
|
||||
"initialized_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of initialization"
|
||||
},
|
||||
"overview": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"description",
|
||||
"technology_stack",
|
||||
"architecture",
|
||||
"key_components"
|
||||
],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Brief project description (e.g., 'TypeScript web application with React frontend')"
|
||||
},
|
||||
"technology_stack": {
|
||||
"type": "object",
|
||||
"required": ["languages", "frameworks", "build_tools", "test_frameworks"],
|
||||
"properties": {
|
||||
"languages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["name", "file_count", "primary"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Language name (e.g., TypeScript, Python)"
|
||||
},
|
||||
"file_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of source files in this language"
|
||||
},
|
||||
"primary": {
|
||||
"type": "boolean",
|
||||
"description": "True if this is the primary language"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Detected frameworks (React, Express, Django, etc.)"
|
||||
},
|
||||
"build_tools": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Build tools and package managers (npm, cargo, maven, etc.)"
|
||||
},
|
||||
"test_frameworks": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Testing frameworks (jest, pytest, go test, etc.)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"architecture": {
|
||||
"type": "object",
|
||||
"required": ["style", "layers", "patterns"],
|
||||
"properties": {
|
||||
"style": {
|
||||
"type": "string",
|
||||
"description": "Architecture style (MVC, microservices, layered, etc.)"
|
||||
},
|
||||
"layers": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Architectural layers (presentation, business-logic, data-access)"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Design patterns (Repository, Factory, Singleton, etc.)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"key_components": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["name", "path", "description", "importance"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Component name"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Relative path to component directory"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "Brief description of component functionality"
|
||||
},
|
||||
"importance": {
|
||||
"type": "string",
|
||||
"enum": ["high", "medium", "low"],
|
||||
"description": "Component importance level"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "5-10 core modules/components"
|
||||
}
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["session_id", "title", "completed_at", "tags"],
|
||||
"properties": {
|
||||
"session_id": {
|
||||
"type": "string",
|
||||
"description": "WFS session identifier"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Feature title/description"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of completion"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Feature tags for categorization"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Completed workflow features (populated by /workflow:session:complete)"
|
||||
},
|
||||
"development_index": {
|
||||
"type": "object",
|
||||
"description": "Categorized development history (lite-plan/lite-execute)",
|
||||
"properties": {
|
||||
"feature": { "type": "array", "items": { "$ref": "#/$defs/devIndexEntry" } },
|
||||
"enhancement": { "type": "array", "items": { "$ref": "#/$defs/devIndexEntry" } },
|
||||
"bugfix": { "type": "array", "items": { "$ref": "#/$defs/devIndexEntry" } },
|
||||
"refactor": { "type": "array", "items": { "$ref": "#/$defs/devIndexEntry" } },
|
||||
"docs": { "type": "array", "items": { "$ref": "#/$defs/devIndexEntry" } }
|
||||
}
|
||||
},
|
||||
"statistics": {
|
||||
"type": "object",
|
||||
"required": ["total_features", "total_sessions", "last_updated"],
|
||||
"properties": {
|
||||
"total_features": {
|
||||
"type": "integer",
|
||||
"description": "Count of completed features"
|
||||
},
|
||||
"total_sessions": {
|
||||
"type": "integer",
|
||||
"description": "Count of workflow sessions"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of last update"
|
||||
}
|
||||
}
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"required": ["initialized_by", "analysis_timestamp", "analysis_mode"],
|
||||
"properties": {
|
||||
"initialized_by": {
|
||||
"type": "string",
|
||||
"description": "Agent or tool that performed initialization"
|
||||
},
|
||||
"analysis_timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of analysis"
|
||||
},
|
||||
"analysis_mode": {
|
||||
"type": "string",
|
||||
"enum": ["deep-scan", "quick-scan", "bash-fallback"],
|
||||
"description": "Analysis mode used"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"devIndexEntry": {
|
||||
"type": "object",
|
||||
"required": ["title", "sub_feature", "date", "description", "status"],
|
||||
"properties": {
|
||||
"title": { "type": "string", "maxLength": 60 },
|
||||
"sub_feature": { "type": "string", "description": "Module/component area" },
|
||||
"date": { "type": "string", "format": "date" },
|
||||
"description": { "type": "string", "maxLength": 100 },
|
||||
"status": { "type": "string", "enum": ["completed", "partial"] },
|
||||
"session_id": { "type": "string", "description": "lite-plan session ID" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
248
.ccw/workflows/cli-templates/schemas/queue-schema.json
Normal file
248
.ccw/workflows/cli-templates/schemas/queue-schema.json
Normal file
@@ -0,0 +1,248 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Issue Execution Queue Schema",
|
||||
"description": "Execution queue supporting both task-level (T-N) and solution-level (S-N) granularity",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^QUE-[0-9]{8}-[0-9]{6}$",
|
||||
"description": "Queue ID in format QUE-YYYYMMDD-HHMMSS"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["active", "paused", "completed", "archived"],
|
||||
"default": "active"
|
||||
},
|
||||
"issue_ids": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Issues included in this queue"
|
||||
},
|
||||
"solutions": {
|
||||
"type": "array",
|
||||
"description": "Solution-level queue items (preferred for new queues)",
|
||||
"items": {
|
||||
"$ref": "#/definitions/solutionItem"
|
||||
}
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"description": "Task-level queue items (legacy format)",
|
||||
"items": {
|
||||
"$ref": "#/definitions/taskItem"
|
||||
}
|
||||
},
|
||||
"conflicts": {
|
||||
"type": "array",
|
||||
"description": "Detected conflicts between items",
|
||||
"items": {
|
||||
"$ref": "#/definitions/conflict"
|
||||
}
|
||||
},
|
||||
"execution_groups": {
|
||||
"type": "array",
|
||||
"description": "Parallel/Sequential execution groups",
|
||||
"items": {
|
||||
"$ref": "#/definitions/executionGroup"
|
||||
}
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": { "type": "string", "default": "2.0" },
|
||||
"queue_type": {
|
||||
"type": "string",
|
||||
"enum": ["solution", "task"],
|
||||
"description": "Queue granularity level"
|
||||
},
|
||||
"total_solutions": { "type": "integer" },
|
||||
"total_tasks": { "type": "integer" },
|
||||
"pending_count": { "type": "integer" },
|
||||
"ready_count": { "type": "integer" },
|
||||
"executing_count": { "type": "integer" },
|
||||
"completed_count": { "type": "integer" },
|
||||
"failed_count": { "type": "integer" },
|
||||
"last_queue_formation": { "type": "string", "format": "date-time" },
|
||||
"last_updated": { "type": "string", "format": "date-time" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"solutionItem": {
|
||||
"type": "object",
|
||||
"required": ["item_id", "issue_id", "solution_id", "status", "task_count", "files_touched"],
|
||||
"properties": {
|
||||
"item_id": {
|
||||
"type": "string",
|
||||
"pattern": "^S-[0-9]+$",
|
||||
"description": "Solution-level queue item ID (S-1, S-2, ...)"
|
||||
},
|
||||
"issue_id": {
|
||||
"type": "string",
|
||||
"description": "Source issue ID"
|
||||
},
|
||||
"solution_id": {
|
||||
"type": "string",
|
||||
"description": "Bound solution ID"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["pending", "ready", "executing", "completed", "failed", "blocked"],
|
||||
"default": "pending"
|
||||
},
|
||||
"task_count": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "Number of tasks in this solution"
|
||||
},
|
||||
"files_touched": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "All files modified by this solution"
|
||||
},
|
||||
"execution_order": {
|
||||
"type": "integer",
|
||||
"description": "Order in execution sequence"
|
||||
},
|
||||
"execution_group": {
|
||||
"type": "string",
|
||||
"description": "Parallel (P*) or Sequential (S*) group ID"
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Solution IDs this item depends on"
|
||||
},
|
||||
"semantic_priority": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Semantic importance score (0.0-1.0)"
|
||||
},
|
||||
"queued_at": { "type": "string", "format": "date-time" },
|
||||
"started_at": { "type": "string", "format": "date-time" },
|
||||
"completed_at": { "type": "string", "format": "date-time" },
|
||||
"result": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"summary": { "type": "string" },
|
||||
"files_modified": { "type": "array", "items": { "type": "string" } },
|
||||
"tasks_completed": { "type": "integer" },
|
||||
"commit_hashes": { "type": "array", "items": { "type": "string" } }
|
||||
}
|
||||
},
|
||||
"failure_reason": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"taskItem": {
|
||||
"type": "object",
|
||||
"required": ["item_id", "issue_id", "solution_id", "task_id", "status"],
|
||||
"properties": {
|
||||
"item_id": {
|
||||
"type": "string",
|
||||
"pattern": "^T-[0-9]+$",
|
||||
"description": "Task-level queue item ID (T-1, T-2, ...)"
|
||||
},
|
||||
"issue_id": { "type": "string" },
|
||||
"solution_id": { "type": "string" },
|
||||
"task_id": { "type": "string" },
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["pending", "ready", "executing", "completed", "failed", "blocked"],
|
||||
"default": "pending"
|
||||
},
|
||||
"execution_order": { "type": "integer" },
|
||||
"execution_group": { "type": "string" },
|
||||
"depends_on": { "type": "array", "items": { "type": "string" } },
|
||||
"semantic_priority": { "type": "number", "minimum": 0, "maximum": 1 },
|
||||
"queued_at": { "type": "string", "format": "date-time" },
|
||||
"started_at": { "type": "string", "format": "date-time" },
|
||||
"completed_at": { "type": "string", "format": "date-time" },
|
||||
"result": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"files_modified": { "type": "array", "items": { "type": "string" } },
|
||||
"files_created": { "type": "array", "items": { "type": "string" } },
|
||||
"summary": { "type": "string" },
|
||||
"commit_hash": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"failure_reason": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["file_conflict", "dependency_conflict", "resource_conflict"]
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "Conflicting file path"
|
||||
},
|
||||
"solutions": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Solution IDs involved (for solution-level queues)"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Task IDs involved (for task-level queues)"
|
||||
},
|
||||
"resolution": {
|
||||
"type": "string",
|
||||
"enum": ["sequential", "merge", "manual"]
|
||||
},
|
||||
"resolution_order": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Execution order to resolve conflict"
|
||||
},
|
||||
"rationale": {
|
||||
"type": "string",
|
||||
"description": "Explanation of resolution decision"
|
||||
},
|
||||
"resolved": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"executionGroup": {
|
||||
"type": "object",
|
||||
"required": ["id", "type"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^[PS][0-9]+$",
|
||||
"description": "Group ID (P1, P2 for parallel, S1, S2 for sequential)"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["parallel", "sequential"]
|
||||
},
|
||||
"solutions": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Solution IDs in this group"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Task IDs in this group (legacy)"
|
||||
},
|
||||
"solution_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of solutions in group"
|
||||
},
|
||||
"task_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of tasks in group (legacy)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
94
.ccw/workflows/cli-templates/schemas/registry-schema.json
Normal file
94
.ccw/workflows/cli-templates/schemas/registry-schema.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Issue Registry Schema",
|
||||
"description": "Global registry of all issues and their solutions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"issues": {
|
||||
"type": "array",
|
||||
"description": "List of registered issues",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "status", "created_at"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Issue ID (e.g., GH-123, TEXT-xxx)"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["registered", "planning", "planned", "queued", "executing", "completed", "failed", "paused"],
|
||||
"default": "registered"
|
||||
},
|
||||
"priority": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 5,
|
||||
"default": 3
|
||||
},
|
||||
"solution_count": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"description": "Number of candidate solutions"
|
||||
},
|
||||
"bound_solution_id": {
|
||||
"type": "string",
|
||||
"description": "ID of the bound solution (null if none bound)"
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"enum": ["github", "text", "file"],
|
||||
"description": "Source of the issue"
|
||||
},
|
||||
"source_url": {
|
||||
"type": "string",
|
||||
"description": "Original source URL (for GitHub issues)"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planned_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"queued_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"completed_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_metadata": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": { "type": "string", "default": "1.0" },
|
||||
"total_issues": { "type": "integer" },
|
||||
"by_status": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"registered": { "type": "integer" },
|
||||
"planning": { "type": "integer" },
|
||||
"planned": { "type": "integer" },
|
||||
"queued": { "type": "integer" },
|
||||
"executing": { "type": "integer" },
|
||||
"completed": { "type": "integer" },
|
||||
"failed": { "type": "integer" }
|
||||
}
|
||||
},
|
||||
"last_updated": { "type": "string", "format": "date-time" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
[
|
||||
{
|
||||
"finding_id": "sec-001-a1b2c3d4",
|
||||
"original_dimension": "security",
|
||||
"iteration": 1,
|
||||
"analysis_timestamp": "2025-01-25T14:40:15Z",
|
||||
"cli_tool_used": "gemini",
|
||||
"root_cause": {
|
||||
"summary": "Legacy code from v1 migration, pre-ORM implementation",
|
||||
"details": "Query builder was ported from old codebase without security review. Team unaware of injection risks in string concatenation pattern. Code review at migration time focused on functionality, not security.",
|
||||
"affected_scope": "All query-builder.ts methods using string template literals (15 methods total)",
|
||||
"similar_patterns": [
|
||||
"src/database/user-queries.ts:buildEmailQuery",
|
||||
"src/database/order-queries.ts:buildOrderSearch"
|
||||
]
|
||||
},
|
||||
"remediation_plan": {
|
||||
"approach": "Migrate to ORM prepared statements with input validation layer",
|
||||
"priority": "P0 - Critical (security vulnerability)",
|
||||
"estimated_effort": "4 hours development + 2 hours testing",
|
||||
"risk_level": "low",
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"action": "Replace direct string concatenation with ORM query builder",
|
||||
"files": ["src/database/query-builder.ts:buildUserQuery:140-150"],
|
||||
"commands": [
|
||||
"Replace: const query = `SELECT * FROM users WHERE id = ${userId}`;",
|
||||
"With: return db('users').where('id', userId).first();"
|
||||
],
|
||||
"rationale": "ORM automatically parameterizes queries, eliminating injection risk",
|
||||
"validation": "Run: npm test -- src/database/query-builder.test.ts"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"action": "Add input validation layer before ORM",
|
||||
"files": ["src/database/validators.ts:validateUserId:NEW"],
|
||||
"commands": [
|
||||
"Create validator: export function validateUserId(id: unknown): number { ... }",
|
||||
"Add schema: z.number().positive().int()"
|
||||
],
|
||||
"rationale": "Defense in depth - validate types and ranges before database layer",
|
||||
"validation": "Run: npm test -- src/database/validators.test.ts"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"action": "Apply pattern to all 15 similar methods",
|
||||
"files": ["src/database/query-builder.ts:ALL_METHODS"],
|
||||
"commands": ["Bulk replace string templates with ORM syntax"],
|
||||
"rationale": "Prevent similar vulnerabilities in other query methods",
|
||||
"validation": "Run: npm test -- src/database/"
|
||||
}
|
||||
],
|
||||
"rollback_strategy": "Git commit before each step, revert if tests fail. Staged rollout: dev → staging → production with monitoring."
|
||||
},
|
||||
"impact_assessment": {
|
||||
"files_affected": [
|
||||
"src/database/query-builder.ts (modify)",
|
||||
"src/database/validators.ts (new)",
|
||||
"src/database/user-queries.ts (modify)",
|
||||
"src/database/order-queries.ts (modify)"
|
||||
],
|
||||
"tests_required": [
|
||||
"src/database/query-builder.test.ts (update existing)",
|
||||
"src/database/validators.test.ts (new)",
|
||||
"integration/security/sql-injection.test.ts (new)"
|
||||
],
|
||||
"breaking_changes": false,
|
||||
"dependencies_updated": ["knex@2.5.1 (ORM library)"],
|
||||
"deployment_notes": "No downtime required. Database migrations not needed."
|
||||
},
|
||||
"reassessed_severity": "high",
|
||||
"severity_change_reason": "Found existing WAF rules partially mitigate risk in production. Input validation at API gateway layer provides additional defense. Downgrade from critical to high, but still requires immediate fix.",
|
||||
"confidence_score": 0.95,
|
||||
"references": [
|
||||
"Project ORM migration guide: docs/architecture/orm-guide.md",
|
||||
"Knex.js parameterization: https://knexjs.org/guide/query-builder.html#where",
|
||||
"Similar incident: TICKET-1234 (previous SQL injection fix)"
|
||||
],
|
||||
"status": "remediation_plan_ready"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,51 @@
|
||||
[
|
||||
{
|
||||
"dimension": "security",
|
||||
"review_id": "review-20250125-143022",
|
||||
"analysis_timestamp": "2025-01-25T14:30:22Z",
|
||||
"cli_tool_used": "gemini",
|
||||
"model": "gemini-2.5-pro",
|
||||
"analysis_duration_ms": 2145000,
|
||||
"summary": {
|
||||
"total_findings": 15,
|
||||
"critical": 2,
|
||||
"high": 4,
|
||||
"medium": 6,
|
||||
"low": 3,
|
||||
"files_analyzed": 47,
|
||||
"lines_reviewed": 8932
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"id": "sec-001-a1b2c3d4",
|
||||
"title": "SQL Injection vulnerability in user query",
|
||||
"severity": "critical",
|
||||
"category": "injection",
|
||||
"description": "Direct string concatenation in SQL query allows injection attacks. User input is not sanitized before query execution.",
|
||||
"file": "src/database/query-builder.ts",
|
||||
"line": 145,
|
||||
"snippet": "const query = `SELECT * FROM users WHERE id = ${userId}`;",
|
||||
"recommendation": "Use parameterized queries: db.query('SELECT * FROM users WHERE id = ?', [userId])",
|
||||
"references": [
|
||||
"OWASP Top 10 - A03:2021 Injection",
|
||||
"https://owasp.org/www-community/attacks/SQL_Injection"
|
||||
],
|
||||
"impact": "Potential data breach, unauthorized access to user records, data manipulation",
|
||||
"metadata": {
|
||||
"cwe_id": "CWE-89",
|
||||
"owasp_category": "A03:2021-Injection"
|
||||
},
|
||||
"iteration": 0,
|
||||
"status": "pending_remediation",
|
||||
"cross_references": []
|
||||
}
|
||||
],
|
||||
"cross_references": [
|
||||
{
|
||||
"finding_id": "sec-001-a1b2c3d4",
|
||||
"related_dimensions": ["quality", "architecture"],
|
||||
"reason": "Same file flagged in multiple dimensions"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
166
.ccw/workflows/cli-templates/schemas/solution-schema.json
Normal file
166
.ccw/workflows/cli-templates/schemas/solution-schema.json
Normal file
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Issue Solution Schema",
|
||||
"description": "Schema for solution registered to an issue",
|
||||
"type": "object",
|
||||
"required": ["id", "tasks", "is_bound", "created_at"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Unique solution identifier: SOL-{issue-id}-{4-char-uid} where uid is 4 alphanumeric chars",
|
||||
"pattern": "^SOL-.+-[a-z0-9]{4}$",
|
||||
"examples": ["SOL-GH-123-a7x9", "SOL-ISS-20251229-001-b2k4"]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "High-level summary of the solution"
|
||||
},
|
||||
"approach": {
|
||||
"type": "string",
|
||||
"description": "Technical approach or strategy"
|
||||
},
|
||||
"tasks": {
|
||||
"type": "array",
|
||||
"description": "Task breakdown for this solution",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "title", "scope", "action", "implementation", "acceptance"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^T[0-9]+$"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Action verb + target"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"description": "Module path or feature area"
|
||||
},
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": ["Create", "Update", "Implement", "Refactor", "Add", "Delete", "Configure", "Test", "Fix"]
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "1-2 sentences describing what to implement"
|
||||
},
|
||||
"modification_points": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": { "type": "string" },
|
||||
"target": { "type": "string" },
|
||||
"change": { "type": "string" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"implementation": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Step-by-step implementation guide"
|
||||
},
|
||||
"test": {
|
||||
"type": "object",
|
||||
"description": "Test requirements",
|
||||
"properties": {
|
||||
"unit": { "type": "array", "items": { "type": "string" } },
|
||||
"integration": { "type": "array", "items": { "type": "string" } },
|
||||
"commands": { "type": "array", "items": { "type": "string" } },
|
||||
"coverage_target": { "type": "number" }
|
||||
}
|
||||
},
|
||||
"regression": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Regression check points"
|
||||
},
|
||||
"acceptance": {
|
||||
"type": "object",
|
||||
"description": "Acceptance criteria & verification",
|
||||
"required": ["criteria", "verification"],
|
||||
"properties": {
|
||||
"criteria": { "type": "array", "items": { "type": "string" } },
|
||||
"verification": { "type": "array", "items": { "type": "string" } },
|
||||
"manual_checks": { "type": "array", "items": { "type": "string" } }
|
||||
}
|
||||
},
|
||||
"commit": {
|
||||
"type": "object",
|
||||
"description": "Commit specification",
|
||||
"properties": {
|
||||
"type": { "type": "string", "enum": ["feat", "fix", "refactor", "test", "docs", "chore"] },
|
||||
"scope": { "type": "string" },
|
||||
"message_template": { "type": "string" },
|
||||
"breaking": { "type": "boolean" }
|
||||
}
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"default": [],
|
||||
"description": "Task IDs this task depends on"
|
||||
},
|
||||
"estimated_minutes": {
|
||||
"type": "integer",
|
||||
"description": "Estimated time to complete"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": "Task status (optional, for tracking)"
|
||||
},
|
||||
"priority": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 5,
|
||||
"default": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"exploration_context": {
|
||||
"type": "object",
|
||||
"description": "ACE exploration results",
|
||||
"properties": {
|
||||
"project_structure": { "type": "string" },
|
||||
"relevant_files": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"patterns": { "type": "string" },
|
||||
"integration_points": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"analysis": {
|
||||
"type": "object",
|
||||
"description": "Solution risk assessment",
|
||||
"properties": {
|
||||
"risk": { "type": "string", "enum": ["low", "medium", "high"] },
|
||||
"impact": { "type": "string", "enum": ["low", "medium", "high"] },
|
||||
"complexity": { "type": "string", "enum": ["low", "medium", "high"] }
|
||||
}
|
||||
},
|
||||
"score": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Solution quality score (0.0-1.0)"
|
||||
},
|
||||
"is_bound": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Whether this solution is bound to the issue"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"bound_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "When this solution was bound to the issue"
|
||||
}
|
||||
}
|
||||
}
|
||||
158
.ccw/workflows/cli-templates/schemas/verify-json-schema.json
Normal file
158
.ccw/workflows/cli-templates/schemas/verify-json-schema.json
Normal file
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Plan Verification Findings Schema",
|
||||
"description": "Schema for plan verification findings output from cli-explore-agent",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"session_id",
|
||||
"timestamp",
|
||||
"verification_tiers_completed",
|
||||
"findings",
|
||||
"summary"
|
||||
],
|
||||
"properties": {
|
||||
"session_id": {
|
||||
"type": "string",
|
||||
"description": "Workflow session ID (e.g., WFS-20250127-143000)",
|
||||
"pattern": "^WFS-[0-9]{8}-[0-9]{6}$"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"description": "ISO 8601 timestamp when verification was completed",
|
||||
"format": "date-time"
|
||||
},
|
||||
"verification_tiers_completed": {
|
||||
"type": "array",
|
||||
"description": "List of verification tiers completed (e.g., ['Tier 1', 'Tier 2'])",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": ["Tier 1", "Tier 2", "Tier 3", "Tier 4"]
|
||||
},
|
||||
"minItems": 1,
|
||||
"maxItems": 4
|
||||
},
|
||||
"findings": {
|
||||
"type": "array",
|
||||
"description": "Array of all findings across all dimensions",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"dimension",
|
||||
"dimension_name",
|
||||
"severity",
|
||||
"location",
|
||||
"summary",
|
||||
"recommendation"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Unique finding ID prefixed by severity (C1, H1, M1, L1)",
|
||||
"pattern": "^[CHML][0-9]+$"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Verification dimension identifier",
|
||||
"enum": ["A", "B", "C", "D", "E", "F", "G", "H"]
|
||||
},
|
||||
"dimension_name": {
|
||||
"type": "string",
|
||||
"description": "Human-readable dimension name",
|
||||
"enum": [
|
||||
"User Intent Alignment",
|
||||
"Requirements Coverage Analysis",
|
||||
"Consistency Validation",
|
||||
"Dependency Integrity",
|
||||
"Synthesis Alignment",
|
||||
"Task Specification Quality",
|
||||
"Duplication Detection",
|
||||
"Feasibility Assessment"
|
||||
]
|
||||
},
|
||||
"severity": {
|
||||
"type": "string",
|
||||
"description": "Severity level of the finding",
|
||||
"enum": ["CRITICAL", "HIGH", "MEDIUM", "LOW"]
|
||||
},
|
||||
"location": {
|
||||
"type": "array",
|
||||
"description": "Array of locations where issue was found (e.g., 'IMPL_PLAN.md:L45', 'task:IMPL-1.2', 'synthesis:FR-03')",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"summary": {
|
||||
"type": "string",
|
||||
"description": "Concise summary of the issue (1-2 sentences)",
|
||||
"minLength": 10,
|
||||
"maxLength": 500
|
||||
},
|
||||
"recommendation": {
|
||||
"type": "string",
|
||||
"description": "Actionable recommendation to resolve the issue",
|
||||
"minLength": 10,
|
||||
"maxLength": 500
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"type": "object",
|
||||
"description": "Aggregate summary of verification results",
|
||||
"required": [
|
||||
"critical_count",
|
||||
"high_count",
|
||||
"medium_count",
|
||||
"low_count",
|
||||
"total_findings",
|
||||
"coverage_percentage",
|
||||
"recommendation"
|
||||
],
|
||||
"properties": {
|
||||
"critical_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of critical severity findings",
|
||||
"minimum": 0
|
||||
},
|
||||
"high_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of high severity findings",
|
||||
"minimum": 0
|
||||
},
|
||||
"medium_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of medium severity findings",
|
||||
"minimum": 0
|
||||
},
|
||||
"low_count": {
|
||||
"type": "integer",
|
||||
"description": "Number of low severity findings",
|
||||
"minimum": 0
|
||||
},
|
||||
"total_findings": {
|
||||
"type": "integer",
|
||||
"description": "Total number of findings",
|
||||
"minimum": 0
|
||||
},
|
||||
"coverage_percentage": {
|
||||
"type": "number",
|
||||
"description": "Percentage of synthesis requirements covered by tasks (0-100)",
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
},
|
||||
"recommendation": {
|
||||
"type": "string",
|
||||
"description": "Quality gate recommendation",
|
||||
"enum": [
|
||||
"BLOCK_EXECUTION",
|
||||
"PROCEED_WITH_FIXES",
|
||||
"PROCEED_WITH_CAUTION",
|
||||
"PROCEED"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user