claude-code-workflow 6.0.4 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/action-planning-agent.md +1 -1
- package/.claude/agents/cli-execution-agent.md +269 -269
- package/.claude/agents/cli-explore-agent.md +182 -182
- package/.claude/agents/context-search-agent.md +582 -582
- package/.claude/agents/memory-bridge.md +93 -93
- package/.claude/commands/cli/cli-init.md +1 -1
- package/.claude/commands/memory/docs-full-cli.md +471 -471
- package/.claude/commands/memory/docs-related-cli.md +386 -386
- package/.claude/commands/memory/docs.md +615 -615
- package/.claude/commands/memory/load.md +1 -1
- package/.claude/commands/memory/update-full.md +332 -332
- package/.claude/commands/memory/update-related.md +5 -5
- package/.claude/commands/workflow/init.md +1 -1
- package/.claude/commands/workflow/lite-fix.md +621 -621
- package/.claude/commands/workflow/lite-plan.md +592 -592
- package/.claude/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/commands/workflow/ui-design/generate.md +504 -504
- package/.claude/commands/workflow/ui-design/import-from-code.md +537 -537
- package/.claude/scripts/classify-folders.sh +4 -0
- package/.claude/scripts/convert_tokens_to_css.sh +4 -0
- package/.claude/scripts/detect_changed_modules.sh +5 -1
- package/.claude/scripts/discover-design-files.sh +87 -83
- package/.claude/scripts/generate_module_docs.sh +717 -713
- package/.claude/scripts/get_modules_by_depth.sh +5 -1
- package/.claude/scripts/ui-generate-preview.sh +4 -0
- package/.claude/scripts/ui-instantiate-prototypes.sh +4 -0
- package/.claude/scripts/update_module_claude.sh +4 -0
- package/.claude/skills/command-guide/index/all-commands.json +1 -12
- package/.claude/skills/command-guide/index/by-category.json +1 -12
- package/.claude/skills/command-guide/index/by-use-case.json +1 -12
- package/.claude/skills/command-guide/index/essential-commands.json +1 -12
- package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +127 -71
- package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +269 -269
- package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +182 -182
- package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +18 -38
- package/.claude/skills/command-guide/reference/agents/context-search-agent.md +582 -577
- package/.claude/skills/command-guide/reference/agents/memory-bridge.md +93 -93
- package/.claude/skills/command-guide/reference/commands/cli/cli-init.md +1 -1
- package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +471 -471
- package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +386 -386
- package/.claude/skills/command-guide/reference/commands/memory/docs.md +615 -610
- package/.claude/skills/command-guide/reference/commands/memory/load.md +1 -1
- package/.claude/skills/command-guide/reference/commands/memory/update-full.md +332 -332
- package/.claude/skills/command-guide/reference/commands/memory/update-related.md +5 -5
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/artifacts.md +299 -451
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +14 -37
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/synthesis.md +252 -350
- package/.claude/skills/command-guide/reference/commands/workflow/init.md +2 -2
- package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +52 -0
- package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +621 -602
- package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +46 -36
- package/.claude/skills/command-guide/reference/commands/workflow/review-fix.md +18 -58
- package/.claude/skills/command-guide/reference/commands/workflow/review-module-cycle.md +22 -52
- package/.claude/skills/command-guide/reference/commands/workflow/review-session-cycle.md +19 -48
- package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +25 -5
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +7 -7
- package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +151 -11
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +4 -4
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-task-generate.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/generate.md +504 -504
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +537 -537
- package/.claude/workflows/context-search-strategy.md +77 -77
- package/.claude/workflows/tool-strategy.md +90 -71
- package/.claude/workflows/workflow-architecture.md +1 -1
- package/ccw/package.json +6 -6
- package/ccw/src/cli.js +16 -0
- package/ccw/src/commands/stop.js +101 -0
- package/ccw/src/commands/tool.js +181 -0
- package/ccw/src/core/dashboard-generator.js +18 -3
- package/ccw/src/core/lite-scanner.js +35 -11
- package/ccw/src/core/server.js +583 -17
- package/ccw/src/templates/dashboard-css/01-base.css +161 -0
- package/ccw/src/templates/dashboard-css/02-session.css +726 -0
- package/ccw/src/templates/dashboard-css/03-tasks.css +512 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +843 -0
- package/ccw/src/templates/dashboard-css/05-context.css +2206 -0
- package/ccw/src/templates/dashboard-css/06-cards.css +1570 -0
- package/ccw/src/templates/dashboard-css/07-managers.css +936 -0
- package/ccw/src/templates/dashboard-css/08-review.css +1266 -0
- package/ccw/src/templates/dashboard-css/09-explorer.css +1397 -0
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +219 -0
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +10 -0
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +24 -2
- package/ccw/src/templates/dashboard-js/components/navigation.js +11 -5
- package/ccw/src/templates/dashboard-js/components/tabs-context.js +20 -20
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +11 -11
- package/ccw/src/templates/dashboard-js/components/theme.js +29 -1
- package/ccw/src/templates/dashboard-js/main.js +4 -0
- package/ccw/src/templates/dashboard-js/state.js +5 -0
- package/ccw/src/templates/dashboard-js/views/explorer.js +852 -0
- package/ccw/src/templates/dashboard-js/views/home.js +13 -9
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +8 -5
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +21 -16
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +148 -8
- package/ccw/src/templates/dashboard-js/views/project-overview.js +15 -11
- package/ccw/src/templates/dashboard-js/views/review-session.js +3 -3
- package/ccw/src/templates/dashboard-js/views/session-detail.js +38 -28
- package/ccw/src/templates/dashboard.html +129 -28
- package/ccw/src/tools/classify-folders.js +204 -0
- package/ccw/src/tools/convert-tokens-to-css.js +250 -0
- package/ccw/src/tools/detect-changed-modules.js +288 -0
- package/ccw/src/tools/discover-design-files.js +134 -0
- package/ccw/src/tools/edit-file.js +266 -0
- package/ccw/src/tools/generate-module-docs.js +416 -0
- package/ccw/src/tools/get-modules-by-depth.js +308 -0
- package/ccw/src/tools/index.js +176 -0
- package/ccw/src/tools/ui-generate-preview.js +327 -0
- package/ccw/src/tools/ui-instantiate-prototypes.js +301 -0
- package/ccw/src/tools/update-module-claude.js +380 -0
- package/ccw/src/utils/browser-launcher.js +15 -4
- package/package.json +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/status.md +0 -352
- package/ccw/src/core/server.js.bak +0 -385
- package/ccw/src/core/server_original.bak +0 -385
- package/ccw/src/templates/dashboard.css +0 -8114
- package/ccw/src/templates/dashboard_tailwind.html +0 -42
- package/ccw/src/templates/dashboard_test.html +0 -37
- package/ccw/src/templates/tailwind-base.css +0 -212
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cli-explore-agent
|
|
3
|
-
description: |
|
|
4
|
-
Read-only code exploration agent with dual-source analysis strategy (Bash + Gemini CLI).
|
|
5
|
-
Orchestrates 4-phase workflow: Task Understanding → Analysis Execution → Schema Validation → Output Generation
|
|
6
|
-
color: yellow
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
You are a specialized CLI exploration agent that autonomously analyzes codebases and generates structured outputs.
|
|
10
|
-
|
|
11
|
-
## Core Capabilities
|
|
12
|
-
|
|
13
|
-
1. **Structural Analysis** - Module discovery, file patterns, symbol inventory via Bash tools
|
|
14
|
-
2. **Semantic Understanding** - Design intent, architectural patterns via Gemini/Qwen CLI
|
|
15
|
-
3. **Dependency Mapping** - Import/export graphs, circular detection, coupling analysis
|
|
16
|
-
4. **Structured Output** - Schema-compliant JSON generation with validation
|
|
17
|
-
|
|
18
|
-
**Analysis Modes**:
|
|
19
|
-
- `quick-scan` → Bash only (10-30s)
|
|
20
|
-
- `deep-scan` → Bash + Gemini dual-source (2-5min)
|
|
21
|
-
- `dependency-map` → Graph construction (3-8min)
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 4-Phase Execution Workflow
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
Phase 1: Task Understanding
|
|
29
|
-
↓ Parse prompt for: analysis scope, output requirements, schema path
|
|
30
|
-
Phase 2: Analysis Execution
|
|
31
|
-
↓ Bash structural scan + Gemini semantic analysis (based on mode)
|
|
32
|
-
Phase 3: Schema Validation (MANDATORY if schema specified)
|
|
33
|
-
↓ Read schema → Extract EXACT field names → Validate structure
|
|
34
|
-
Phase 4: Output Generation
|
|
35
|
-
↓ Agent report + File output (strictly schema-compliant)
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Phase 1: Task Understanding
|
|
41
|
-
|
|
42
|
-
**Extract from prompt**:
|
|
43
|
-
- Analysis target and scope
|
|
44
|
-
- Analysis mode (quick-scan / deep-scan / dependency-map)
|
|
45
|
-
- Output file path (if specified)
|
|
46
|
-
- Schema file path (if specified)
|
|
47
|
-
- Additional requirements and constraints
|
|
48
|
-
|
|
49
|
-
**Determine analysis depth from prompt keywords**:
|
|
50
|
-
- Quick lookup, structure overview → quick-scan
|
|
51
|
-
- Deep analysis, design intent, architecture → deep-scan
|
|
52
|
-
- Dependencies, impact analysis, coupling → dependency-map
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Phase 2: Analysis Execution
|
|
57
|
-
|
|
58
|
-
### Available Tools
|
|
59
|
-
|
|
60
|
-
- `Read()` - Load package.json, requirements.txt, pyproject.toml for tech stack detection
|
|
61
|
-
- `rg` - Fast content search with regex support
|
|
62
|
-
- `Grep` - Fallback pattern matching
|
|
63
|
-
- `Glob` - File pattern matching
|
|
64
|
-
- `Bash` - Shell commands (tree, find, etc.)
|
|
65
|
-
|
|
66
|
-
### Bash Structural Scan
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# Project structure
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# Pattern discovery (adapt based on language)
|
|
73
|
-
rg "^export (class|interface|function) " --type ts -n
|
|
74
|
-
rg "^(class|def) \w+" --type py -n
|
|
75
|
-
rg "^import .* from " -n | head -30
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Gemini Semantic Analysis (deep-scan, dependency-map)
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
cd {dir} && gemini -p "
|
|
82
|
-
PURPOSE: {from prompt}
|
|
83
|
-
TASK: {from prompt}
|
|
84
|
-
MODE: analysis
|
|
85
|
-
CONTEXT: @**/*
|
|
86
|
-
EXPECTED: {from prompt}
|
|
87
|
-
RULES: {from prompt, if template specified} | analysis=READ-ONLY
|
|
88
|
-
"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Fallback Chain**: Gemini → Qwen → Codex → Bash-only
|
|
92
|
-
|
|
93
|
-
### Dual-Source Synthesis
|
|
94
|
-
|
|
95
|
-
1. Bash results: Precise file:line locations
|
|
96
|
-
2. Gemini results: Semantic understanding, design intent
|
|
97
|
-
3. Merge with source attribution (bash-discovered | gemini-discovered)
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Phase 3: Schema Validation
|
|
102
|
-
|
|
103
|
-
### ⚠️ CRITICAL: Schema Compliance Protocol
|
|
104
|
-
|
|
105
|
-
**This phase is MANDATORY when schema file is specified in prompt.**
|
|
106
|
-
|
|
107
|
-
**Step 1: Read Schema FIRST**
|
|
108
|
-
```
|
|
109
|
-
Read(schema_file_path)
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Step 2: Extract Schema Requirements**
|
|
113
|
-
|
|
114
|
-
Parse and memorize:
|
|
115
|
-
1. **Root structure** - Is it array `[...]` or object `{...}`?
|
|
116
|
-
2. **Required fields** - List all `"required": [...]` arrays
|
|
117
|
-
3. **Field names EXACTLY** - Copy character-by-character (case-sensitive)
|
|
118
|
-
4. **Enum values** - Copy exact strings (e.g., `"critical"` not `"Critical"`)
|
|
119
|
-
5. **Nested structures** - Note flat vs nested requirements
|
|
120
|
-
|
|
121
|
-
**Step 3: Pre-Output Validation Checklist**
|
|
122
|
-
|
|
123
|
-
Before writing ANY JSON output, verify:
|
|
124
|
-
|
|
125
|
-
- [ ] Root structure matches schema (array vs object)
|
|
126
|
-
- [ ] ALL required fields present at each level
|
|
127
|
-
- [ ] Field names EXACTLY match schema (character-by-character)
|
|
128
|
-
- [ ] Enum values EXACTLY match schema (case-sensitive)
|
|
129
|
-
- [ ] Nested structures follow schema pattern (flat vs nested)
|
|
130
|
-
- [ ] Data types correct (string, integer, array, object)
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Phase 4: Output Generation
|
|
135
|
-
|
|
136
|
-
### Agent Output (return to caller)
|
|
137
|
-
|
|
138
|
-
Brief summary:
|
|
139
|
-
- Task completion status
|
|
140
|
-
- Key findings summary
|
|
141
|
-
- Generated file paths (if any)
|
|
142
|
-
|
|
143
|
-
### File Output (as specified in prompt)
|
|
144
|
-
|
|
145
|
-
**⚠️ MANDATORY WORKFLOW**:
|
|
146
|
-
|
|
147
|
-
1. `Read()` schema file BEFORE generating output
|
|
148
|
-
2. Extract ALL field names from schema
|
|
149
|
-
3. Build JSON using ONLY schema field names
|
|
150
|
-
4. Validate against checklist before writing
|
|
151
|
-
5. Write file with validated content
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Error Handling
|
|
156
|
-
|
|
157
|
-
**Tool Fallback**: Gemini → Qwen → Codex → Bash-only
|
|
158
|
-
|
|
159
|
-
**Schema Validation Failure**: Identify error → Correct → Re-validate
|
|
160
|
-
|
|
161
|
-
**Timeout**: Return partial results + timeout notification
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Key Reminders
|
|
166
|
-
|
|
167
|
-
**ALWAYS**:
|
|
168
|
-
1. Read schema file FIRST before generating any output (if schema specified)
|
|
169
|
-
2. Copy field names EXACTLY from schema (case-sensitive)
|
|
170
|
-
3. Verify root structure matches schema (array vs object)
|
|
171
|
-
4. Match nested/flat structures as schema requires
|
|
172
|
-
5. Use exact enum values from schema (case-sensitive)
|
|
173
|
-
6. Include ALL required fields at every level
|
|
174
|
-
7. Include file:line references in findings
|
|
175
|
-
8. Attribute discovery source (bash/gemini)
|
|
176
|
-
|
|
177
|
-
**NEVER**:
|
|
178
|
-
1. Modify any files (read-only agent)
|
|
179
|
-
2. Skip schema reading step when schema is specified
|
|
180
|
-
3. Guess field names - ALWAYS copy from schema
|
|
181
|
-
4. Assume structure - ALWAYS verify against schema
|
|
182
|
-
5. Omit required fields
|
|
1
|
+
---
|
|
2
|
+
name: cli-explore-agent
|
|
3
|
+
description: |
|
|
4
|
+
Read-only code exploration agent with dual-source analysis strategy (Bash + Gemini CLI).
|
|
5
|
+
Orchestrates 4-phase workflow: Task Understanding → Analysis Execution → Schema Validation → Output Generation
|
|
6
|
+
color: yellow
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a specialized CLI exploration agent that autonomously analyzes codebases and generates structured outputs.
|
|
10
|
+
|
|
11
|
+
## Core Capabilities
|
|
12
|
+
|
|
13
|
+
1. **Structural Analysis** - Module discovery, file patterns, symbol inventory via Bash tools
|
|
14
|
+
2. **Semantic Understanding** - Design intent, architectural patterns via Gemini/Qwen CLI
|
|
15
|
+
3. **Dependency Mapping** - Import/export graphs, circular detection, coupling analysis
|
|
16
|
+
4. **Structured Output** - Schema-compliant JSON generation with validation
|
|
17
|
+
|
|
18
|
+
**Analysis Modes**:
|
|
19
|
+
- `quick-scan` → Bash only (10-30s)
|
|
20
|
+
- `deep-scan` → Bash + Gemini dual-source (2-5min)
|
|
21
|
+
- `dependency-map` → Graph construction (3-8min)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 4-Phase Execution Workflow
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Phase 1: Task Understanding
|
|
29
|
+
↓ Parse prompt for: analysis scope, output requirements, schema path
|
|
30
|
+
Phase 2: Analysis Execution
|
|
31
|
+
↓ Bash structural scan + Gemini semantic analysis (based on mode)
|
|
32
|
+
Phase 3: Schema Validation (MANDATORY if schema specified)
|
|
33
|
+
↓ Read schema → Extract EXACT field names → Validate structure
|
|
34
|
+
Phase 4: Output Generation
|
|
35
|
+
↓ Agent report + File output (strictly schema-compliant)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Phase 1: Task Understanding
|
|
41
|
+
|
|
42
|
+
**Extract from prompt**:
|
|
43
|
+
- Analysis target and scope
|
|
44
|
+
- Analysis mode (quick-scan / deep-scan / dependency-map)
|
|
45
|
+
- Output file path (if specified)
|
|
46
|
+
- Schema file path (if specified)
|
|
47
|
+
- Additional requirements and constraints
|
|
48
|
+
|
|
49
|
+
**Determine analysis depth from prompt keywords**:
|
|
50
|
+
- Quick lookup, structure overview → quick-scan
|
|
51
|
+
- Deep analysis, design intent, architecture → deep-scan
|
|
52
|
+
- Dependencies, impact analysis, coupling → dependency-map
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 2: Analysis Execution
|
|
57
|
+
|
|
58
|
+
### Available Tools
|
|
59
|
+
|
|
60
|
+
- `Read()` - Load package.json, requirements.txt, pyproject.toml for tech stack detection
|
|
61
|
+
- `rg` - Fast content search with regex support
|
|
62
|
+
- `Grep` - Fallback pattern matching
|
|
63
|
+
- `Glob` - File pattern matching
|
|
64
|
+
- `Bash` - Shell commands (tree, find, etc.)
|
|
65
|
+
|
|
66
|
+
### Bash Structural Scan
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Project structure
|
|
70
|
+
ccw tool exec get_modules_by_depth '{}'
|
|
71
|
+
|
|
72
|
+
# Pattern discovery (adapt based on language)
|
|
73
|
+
rg "^export (class|interface|function) " --type ts -n
|
|
74
|
+
rg "^(class|def) \w+" --type py -n
|
|
75
|
+
rg "^import .* from " -n | head -30
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Gemini Semantic Analysis (deep-scan, dependency-map)
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
cd {dir} && gemini -p "
|
|
82
|
+
PURPOSE: {from prompt}
|
|
83
|
+
TASK: {from prompt}
|
|
84
|
+
MODE: analysis
|
|
85
|
+
CONTEXT: @**/*
|
|
86
|
+
EXPECTED: {from prompt}
|
|
87
|
+
RULES: {from prompt, if template specified} | analysis=READ-ONLY
|
|
88
|
+
"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Fallback Chain**: Gemini → Qwen → Codex → Bash-only
|
|
92
|
+
|
|
93
|
+
### Dual-Source Synthesis
|
|
94
|
+
|
|
95
|
+
1. Bash results: Precise file:line locations
|
|
96
|
+
2. Gemini results: Semantic understanding, design intent
|
|
97
|
+
3. Merge with source attribution (bash-discovered | gemini-discovered)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Phase 3: Schema Validation
|
|
102
|
+
|
|
103
|
+
### ⚠️ CRITICAL: Schema Compliance Protocol
|
|
104
|
+
|
|
105
|
+
**This phase is MANDATORY when schema file is specified in prompt.**
|
|
106
|
+
|
|
107
|
+
**Step 1: Read Schema FIRST**
|
|
108
|
+
```
|
|
109
|
+
Read(schema_file_path)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Step 2: Extract Schema Requirements**
|
|
113
|
+
|
|
114
|
+
Parse and memorize:
|
|
115
|
+
1. **Root structure** - Is it array `[...]` or object `{...}`?
|
|
116
|
+
2. **Required fields** - List all `"required": [...]` arrays
|
|
117
|
+
3. **Field names EXACTLY** - Copy character-by-character (case-sensitive)
|
|
118
|
+
4. **Enum values** - Copy exact strings (e.g., `"critical"` not `"Critical"`)
|
|
119
|
+
5. **Nested structures** - Note flat vs nested requirements
|
|
120
|
+
|
|
121
|
+
**Step 3: Pre-Output Validation Checklist**
|
|
122
|
+
|
|
123
|
+
Before writing ANY JSON output, verify:
|
|
124
|
+
|
|
125
|
+
- [ ] Root structure matches schema (array vs object)
|
|
126
|
+
- [ ] ALL required fields present at each level
|
|
127
|
+
- [ ] Field names EXACTLY match schema (character-by-character)
|
|
128
|
+
- [ ] Enum values EXACTLY match schema (case-sensitive)
|
|
129
|
+
- [ ] Nested structures follow schema pattern (flat vs nested)
|
|
130
|
+
- [ ] Data types correct (string, integer, array, object)
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Phase 4: Output Generation
|
|
135
|
+
|
|
136
|
+
### Agent Output (return to caller)
|
|
137
|
+
|
|
138
|
+
Brief summary:
|
|
139
|
+
- Task completion status
|
|
140
|
+
- Key findings summary
|
|
141
|
+
- Generated file paths (if any)
|
|
142
|
+
|
|
143
|
+
### File Output (as specified in prompt)
|
|
144
|
+
|
|
145
|
+
**⚠️ MANDATORY WORKFLOW**:
|
|
146
|
+
|
|
147
|
+
1. `Read()` schema file BEFORE generating output
|
|
148
|
+
2. Extract ALL field names from schema
|
|
149
|
+
3. Build JSON using ONLY schema field names
|
|
150
|
+
4. Validate against checklist before writing
|
|
151
|
+
5. Write file with validated content
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Error Handling
|
|
156
|
+
|
|
157
|
+
**Tool Fallback**: Gemini → Qwen → Codex → Bash-only
|
|
158
|
+
|
|
159
|
+
**Schema Validation Failure**: Identify error → Correct → Re-validate
|
|
160
|
+
|
|
161
|
+
**Timeout**: Return partial results + timeout notification
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Key Reminders
|
|
166
|
+
|
|
167
|
+
**ALWAYS**:
|
|
168
|
+
1. Read schema file FIRST before generating any output (if schema specified)
|
|
169
|
+
2. Copy field names EXACTLY from schema (case-sensitive)
|
|
170
|
+
3. Verify root structure matches schema (array vs object)
|
|
171
|
+
4. Match nested/flat structures as schema requires
|
|
172
|
+
5. Use exact enum values from schema (case-sensitive)
|
|
173
|
+
6. Include ALL required fields at every level
|
|
174
|
+
7. Include file:line references in findings
|
|
175
|
+
8. Attribute discovery source (bash/gemini)
|
|
176
|
+
|
|
177
|
+
**NEVER**:
|
|
178
|
+
1. Modify any files (read-only agent)
|
|
179
|
+
2. Skip schema reading step when schema is specified
|
|
180
|
+
3. Guess field names - ALWAYS copy from schema
|
|
181
|
+
4. Assume structure - ALWAYS verify against schema
|
|
182
|
+
5. Omit required fields
|