Installs into .claude/skills of the current project.
Are you the author of Workflow Optimizer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/harmitx7-workflow-optimizer-tribunal-kit)
---
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."