Use when Analyzes agent tool-calling patterns and task execution efficiency to suggest process improvements.
Scanned 9/27/2026
npx -y skills add Harmitx7/tribunal-kit --skill workflow-optimizer --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Workflow Optimizer?
Add the live security badge to your README ā it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/harmitx7-workflow-optimizer-tribunal-kit)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
name: workflow-optimizer
description: "Use when Analyzes agent tool-calling patterns and task execution efficiency to suggest process improvements."
version: 5.0.0
last-updated: 2026-09-13
skills:
- parallel-agents
- plan-writing
- fabel-protocol
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
- .agent/scripts/verify_all.js
- .agent/scripts/checklist.js
- .agent/scripts/lint_runner.js
---
# Workflow Optimizer Skill
---
## š ļø Technical Architecture & Reference Recipes
---
## When to Activate
- When a task takes significantly more tool calls than expected.
- When the user asks to "optimize workflow", "reduce steps", or "speed up the agent".
- During retrospective analysis of completed multi-step tasks.
- After a complex `/orchestrate` or `/swarm` dispatch to review efficiency.
- When context window pressure is detected (truncated responses, missed context).
## Analysis Framework
### 1. Tool Call Pattern Analysis
Examine a sequence of tool calls and classify each into:
| Pattern | Description | Waste Level | Fix |
| ----------------------- | --------------------------------------------------- | ----------- | ----------------------------------------- |
| **Redundant Read** | File read multiple times without changes | š“ High | Cache the content; read once |
| **Blind Search** | `grep_search` or `find_by_name` when path was known | š” Medium | Use `view_file` directly |
| **Serial Bottleneck** | Independent calls made sequentially | š“ High | Parallelize with concurrent calls |
| **Ping-Pong Edit** | Multiple `replace_file_content` on same file | š” Medium | Combine into `multi_replace_file_content` |
| **Over-Read** | `view_file` full file when only one function needed | š” Medium | Use `view_code_item` or line ranges |
| **Unnecessary Outline** | `view_file_outline` on a file already fully read | š¢ Low | Skip ā content already in context |
| **Search Then Read** | `grep_search` ā `view_file` ā `view_code_item` | š” Medium | Skip directly to relevant tool |
| **Repeated Status** | Multiple `command_status` calls before completion | š¢ Low | Use `WaitDurationSeconds` parameter |
| **Task Churn** | `task_boundary` called every single tool call | š” Medium | Update every 3-5 tool calls |
| **Context Dump** | Reading entire large files into context | š“ High | Targeted reads with line ranges |
### 2. Parallelism Opportunity Detection
Identify tool calls that have no data dependencies and should run simultaneously:
```
š“ Serial (Wastes Time):
Step 1: view_file(A.ts) ā waits
Step 2: view_file(B.ts) ā waits
Step 3: view_file(C.ts) ā waits
š¢ Parallel (Optimal):
Step 1: view_file(A.ts) + view_file(B.ts) + view_file(C.ts) ā all at once
```
**Dependency Rules:**
- Reads are always parallelizable with other reads.
- Writes to different files are parallelizable.
- Writes to the same file must be sequential.
- `run_command` results needed by next step ā sequential.
- `task_boundary` should batch with the first tool call of the new phase.
### 3. Task Decomposition Review
Evaluate `task.md` and `task_boundary` usage:
| Issue | Symptom | Fix |
| ------------------- | ------------------------------------------------------ | ---------------------------------------------- |
| **Too Granular** | One `task_boundary` per tool call | Group into logical phases (3-8 calls per task) |
| **Too Broad** | One task for entire request | Break into Planning ā Execution ā Verification |
| **Stale Summary** | `TaskSummary` repeating same text | Accumulate new info each update |
| **Backward Status** | `TaskStatus` describes what was _done_ | Must describe what _will happen next_ |
| **Missing Mode** | Never switches between PLANNING/EXECUTION/VERIFICATION | Use mode transitions to signal phase changes |
### 4. Context Window Budget Analysis
| Metric | Target | Action if Exceeded |
| ------------------- | -------------------- | -------------------------------------- |
| Total lines read | < 500 per task phase | Filter to relevant sections |
| Files in context | < 10 simultaneously | Prioritize; drop stale reads |
| Search results | < 20 matches | Narrow filters (`Includes`, `Pattern`) |
| File reads per file | 1 per phase | Cache mentally; don't re-read |
| Artifact updates | < 5 per task | Batch updates |
### 5. Error Recovery Efficiency
Analyze how errors are handled:
| Pattern | Efficiency | Better Approach |
| ------------------------------------- | ----------------- | ------------------------------------ |
| Retry same command identically | š“ Wasted | Analyze error first, modify approach |
| Read error ā re-read entire file | š” Inefficient | Read only the relevant section |
| Tool error ā ask user | š” Premature | Try alternative approach first |
| Build error ā fix one issue ā rebuild | š¢ OK if targeted | Batch multiple fixes before rebuild |
## Optimization Metrics
### Efficiency Score Formula
```
Raw Score = (Optimal Tool Calls / Actual Tool Calls) Ć 100
Adjusted Score = Raw Score Ć (1 - Parallelism Penalty)
where Parallelism Penalty = (Serial Calls That Could Be Parallel / Total Calls) Ć 0.2
Grade:
90-100% ā A (Excellent ā near-optimal)
75-89% ā B (Good ā minor opportunities)
60-74% ā C (Fair ā several wasted calls)
40-59% ā D (Poor ā significant waste)
< 40% ā F (Rework workflow strategy)
```
## Report Format
```
āāā Workflow Optimization Report āāāāāāāāā
Task: [task name]
Tool Calls: [actual] / [estimated optimal]
Efficiency: [grade] ([percentage]%)
Parallelism: [parallel calls] / [parallelizable opportunities]
āāā Timeline āāāāāāāāāāāāāāāāāāāāāāāāāāāā
Phase 1: Planning (calls 1-5)
1. ā
view_file_outline(A.ts) } parallel ā
2. ā
view_file_outline(B.ts) }
3. š” view_file(A.ts) ā full file read when only function needed
4. ā
grep_search("handleAuth")
5. š“ view_file(A.ts) ā redundant re-read
Phase 2: Execution (calls 6-12)
6. ā
task_boundary(EXECUTION)
7. ā
replace_file_content(A.ts)
8. š“ replace_file_content(A.ts) ā should batch with step 7
9. ā
write_to_file(test.ts)
...
āāā Issues Found āāāāāāāāāāāāāāāāāāāāāāāā
š“ Critical (wasted >3 calls)
1. File A.ts read 3 times ā Fix: read once, reference from context
2. 4 serial reads could be 1 parallel batch ā Fix: use concurrent calls
š” Warning (wasted 1-2 calls)
1. Two edits to A.ts back-to-back ā Fix: use multi_replace_file_content
2. task_boundary called 8 times for 12 tool calls ā Fix: update every 3-5 calls
š¢ Good Patterns Detected
1. Used view_code_item instead of full file read for functions
2. Parallelized independent grep_searches
āāā Recommendations āāāāāāāāāāāāāāāāāāāāā
⢠Save 3 calls by batching file reads
⢠Save 2 calls by using multi_replace over sequential replaces
⢠Save 1 call by removing redundant re-read
⢠Estimated optimal: 9 calls instead of 14 (64% ā 100% efficiency)
```
## Quick Win Checklist
Before analyzing, check for these common quick wins:
- [ ] Are multiple `view_file` calls to different files batched in parallel?
- [ ] Is `multi_replace_file_content` used for non-contiguous edits in one file?
- [ ] Is `view_code_item` used instead of `view_file` for individual functions?
- [ ] Are `task_boundary` updates batched with the first tool call of a new phase?
- [ ] Is `command_status` using `WaitDurationSeconds` instead of polling?
- [ ] Are search results filtered with specific `Includes` and `Pattern`?
## Anti-Hallucination Guard
- **Only analyze actual tool call logs** ā never invent or assume tool calls that didn't happen.
- **Recommendations must reference real tools** ā only suggest tools available in the current environment.
- **Never fabricate efficiency scores** ā always calculate from actual vs optimal counts.
- **Acknowledge uncertainty**: "Cannot determine if calls 3-5 had data dependency ā may be correctly sequential."
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!