Files
Claude-Code-Workflow/.claude/workflows/cli-templates/prompts/workflow/task-json-agent-mode.txt
catlog22 692a68da6f Refactor workflow tools and user interaction methods
- Updated synthesis tool to enhance user interaction with multi-select options and improved question presentation in Chinese.
- Revised conflict resolution tool to allow batch processing of conflicts, increasing the limit from 4 to 10 per round and changing user interaction from AskUserQuestion to text output.
- Added context_package_path to task generation tools for better context management.
- Improved task generation schema to include context_package_path for enhanced context delivery.
- Updated CLI templates to reflect changes in task JSON schema, ensuring context_package_path is included.
2025-10-25 14:43:55 +08:00

124 lines
4.5 KiB
Plaintext

Task JSON Schema - Agent Mode (No Command Field)
## Schema Structure
```json
{
"id": "IMPL-N[.M]",
"title": "Descriptive task name",
"status": "pending",
"context_package_path": "{context_package_path}",
"meta": {
"type": "feature|bugfix|refactor|test|docs",
"agent": "@code-developer|@test-fix-agent|@universal-executor"
},
"context": {
"requirements": ["extracted from analysis"],
"focus_paths": ["src/paths"],
"acceptance": ["measurable criteria"],
"depends_on": ["IMPL-N"],
"artifacts": [
{
"type": "synthesis_specification",
"path": "{synthesis_spec_path}",
"priority": "highest",
"usage": "Primary requirement source - use for consolidated requirements and cross-role alignment"
},
{
"type": "role_analysis",
"path": "{role_analysis_path}",
"priority": "high",
"usage": "Technical/design/business details from specific roles. Common roles: system-architect (ADRs, APIs, caching), ui-designer (design tokens, layouts), product-manager (user stories, metrics)"
}
]
},
"flow_control": {
"pre_analysis": [
{
"step": "load_role_analyses_specification",
"action": "Load consolidated role analyses",
"commands": [
"Read({synthesis_spec_path})"
],
"output_to": "synthesis_specification",
"on_error": "fail"
},
{
"step": "load_context_package",
"action": "Load context package for project structure",
"commands": [
"Read({context_package_path})"
],
"output_to": "context_pkg",
"on_error": "fail"
},
{
"step": "local_codebase_exploration",
"action": "Explore codebase using local search",
"commands": [
"bash(rg '^(function|class|interface).*{keyword}' --type ts -n --max-count 15)",
"bash(find . -name '*{keyword}*' -type f | grep -v node_modules | head -10)"
],
"output_to": "codebase_structure",
"on_error": "skip_optional"
}
],
"implementation_approach": [
{
"step": 1,
"title": "Implement task following role analyses",
"description": "Implement '{title}' following [synthesis_specification] requirements and [context_pkg] patterns. Use role analyses as primary source, consult artifacts for technical details.",
"modification_points": [
"Apply consolidated requirements from role analyses",
"Follow technical guidelines from synthesis",
"Consult artifacts for implementation details when needed",
"Integrate with existing patterns"
],
"logic_flow": [
"Load role analyses and context package",
"Analyze existing patterns from [codebase_structure]",
"Implement following specification",
"Consult artifacts for technical details when needed",
"Validate against acceptance criteria"
],
"depends_on": [],
"output": "implementation"
}
],
"target_files": ["file:function:lines", "path/to/NewFile.ts"]
}
}
```
## Key Features - Agent Mode
**Execution Model**: Agent interprets `modification_points` and `logic_flow` to execute autonomously
**No Command Field**: Steps in `implementation_approach` do NOT include `command` field
**Context Loading**: Context loaded via `pre_analysis` steps, available as variables (e.g., [synthesis_specification], [context_pkg])
**Agent Execution**:
- Agent reads modification_points and logic_flow
- Agent performs implementation autonomously
- Agent validates against acceptance criteria
## Field Descriptions
**implementation_approach**: Array of step objects (NO command field)
- **step**: Sequential step number
- **title**: Step description
- **description**: Detailed instructions with variable references
- **modification_points**: Specific code modifications to apply
- **logic_flow**: Business logic execution sequence
- **depends_on**: Step dependencies (empty array for independent steps)
- **output**: Expected deliverable variable name
## Usage Guidelines
1. **Load Context**: Use pre_analysis to load synthesis, context package, and explore codebase
2. **Reference Variables**: Use [variable_name] to reference outputs from pre_analysis steps
3. **Clear Instructions**: Provide detailed modification_points and logic_flow for agent
4. **No Commands**: Never add command field to implementation_approach steps
5. **Agent Autonomy**: Let agent interpret and execute based on provided instructions