Skip to content
Development
Command

/speckit.optimize

Provides task workflow optimization by analyzing dependencies, parallelization opportunities, and subagent delegation strategy for tasks.md. Use when you need to improve task execution efficiency.

From plugin
developer-kit
37135 skills44 agents35 commands2 MCP
> /plugin marketplace add giuseppe-trisciuoglio/developer-kit
> /plugin install developer-kit@developer-kit

Command definition

speckit.optimize.md
description: Provides task workflow optimization by analyzing dependencies, parallelization opportunities, and subagent delegation strategy for tasks.md. Use when you need to improve task execution efficiency.
argument-hint: "[optional-strategy]"
allowed-tools: Read, Glob, Grep, Bash

Task Workflow Optimization for tasks.md

Overview

Provides task workflow optimization by analyzing dependencies, parallelization opportunities, and subagent delegation strategy for tasks.md. Use when you need to improve task execution efficiency.

Usage

/speckit.optimize $ARGUMENTS

Arguments

| Argument | Description | |--------------|------------------------------------------| | `$ARGUMENTS` | Combined arguments passed to the command |

Execution Steps

Execution Instructions

**Agent Selection**: To execute this task, use the following approach:

  • Primary: Use `general-purpose` agent with appropriate domain expertise
  • Or use specialized agent if available for the specific task type

User Input

$ARGUMENTS

You **MUST** consider the user input before proceeding (if not empty).

Outline

**Goal**: Analyze tasks.md to optimize the implementation workflow by identifying parallelization opportunities, task dependencies, resource requirements, and generating an optimized execution plan with subagent delegation strategy. This command prepares tasks.md for efficient execution via `/speckit.implement`.

**When to run**: After `/speckit.check-integration` completes, BEFORE `/speckit.implement` executes tasks.

**Critical Principle**: This command NEVER modifies tasks.md or code files. It only analyzes and reports optimization recommendations. Output is a READ-ONLY optimization report.

1. Setup & Prerequisites

Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse JSON for:

  • FEATURE_DIR (absolute path)
  • TASKS file path
  • AVAILABLE_DOCS list

For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").

Abort if tasks.md is missing with error: "No tasks.md found. Run `/speckit.tasks` first."

2. Load Optimization Context

**Required files**:

  • tasks.md: Complete task list with phases, IDs, descriptions, and parallelization markers [P]
  • plan.md: Tech stack, architecture, team structure
  • spec.md: Feature requirements and complexity assessment

**Optional files** (load if present):

  • data-model.md: Data dependencies between tasks
  • contracts/: API contract dependencies
  • research.md: Technical constraints and decisions

**Codebase scan**:

  • Identify project structure and complexity
  • Map existing test patterns (unit, integration, e2e)
  • Assess resource requirements (memory, CPU, external services)
  • List available subagent types from available configuration

3. Parse Tasks Structure

Extract task information:

For each task in tasks.md:
- Task ID: Extract [ID] (e.g., T001, T126)
- Parallelization marker: Extract [P] if present
- Phase: Which phase/group task belongs to
- Description: Full task description
- Dependencies: Infer from description or explicit phase ordering
- Complexity: Assess as LOW/MEDIUM/HIGH/CRITICAL based on:
  * Lines of code expected
  * Test coverage required
  * External dependencies (databases, APIs)
  * Integration points

4. Dependency Analysis

**Build dependency graph**:

Task → Task Dependencies Analysis:

CRITICAL (blocking):
- Phase 1 → Phase 2 (Phase 2 blocked until Phase 1 complete)
- Phase 2 → Phase 3+ (Phase 3+ blocked until Phase 2 complete)
- Within-phase: Tasks without [P] marker may have implicit dependencies

IMPLICIT DEPENDENCIES:
- T002 (pom.xml) → T018 (configuration properties)
- Configuration tasks → Infrastructure implementation
- Domain models → Repository implementations
- Service implementations → Test infrastructure

**Output**:

DEPENDENCY ANALYSIS

Blocking Dependencies (Sequential):
- Phase 1 → Phase 2: [BLOCKING] Phase 1 must complete before Phase 2 starts
- Phase 2 → User Stories: [BLOCKING] Foundational layer required for all user story work

Critical Internal Dependencies:
- [Task A] → [Task B]: [Reason] (Must complete A before starting B)
- [Task X] → [Task Y/Z]: [Reason] (Task X blocks multiple dependents)

Independent Task Groups (Can parallelize):
- Group [N]: Tasks [ID, ID, ID] - All marked [P], no internal dependencies
  * Estimated parallel execution time: [minutes]
  * Resource requirement: [CPU/Memory profile]

5. Parallelization Opportunities

**Identify parallelizable task groups**:

PARALLELIZATION STRATEGY

Within-Phase Parallelization:
- [P] marked tasks: Can run simultaneously (different files, no dependencies)
- Grouped by agent type for efficient team allocation

Potential Parallelization:
- Tasks that could be parallelized with refactoring
- Risks: List any hidden dependencies or integration points
- Recommendation: Whether to parallelize or keep sequential

Sequential Requirements:
- Tasks that MUST run serially (blocking relationships)
- Reasons: Dependency chains, shared state, integration points

6. Subagent Assignment Strategy

**Analyze workload distribution**:

SUBAGENT DELEGATION ANALYSIS

Task Distribution by Complexity:
- CRITICAL tasks: [Count] (needs expert/experienced subagent)
- HIGH tasks: [Count] (needs intermediate subagent)
- MEDIUM tasks: [Count] (can distribute across team)
- LOW tasks: [Count] (can batch or auto-run)

Required Subagent Types:
- spring-boot-backend-development-expert: [Task IDs] - [Time estimate]
- spring-boot-test-expert: [Task IDs] - [Time estimate]
- [Other specialists]: [Task IDs] - [Time estimate]

Resource Constraints:
- Concurrent subagents available: [N]
- Time per subagent batch: [minutes]
- Memory per subagent: [MB estimate]

7. Execution Phases & Timeline

**Generate optimized execution plan**:

OPTIMIZED EXE
Read more
@giuseppe-trisciuoglio
Ships withdeveloper-kit

Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI.

371116 skills44 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
371
Star history of giuseppe-trisciuoglio/developer-kit on GitHub, a chart by star-history.com

Other commands on developer-kit.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command