Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
90
90%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
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.
/speckit.optimize $ARGUMENTS| Argument | Description |
|---|---|
$ARGUMENTS | Combined arguments passed to the command |
Agent Selection: To execute this task, use the following approach:
general-purpose agent with appropriate domain expertise$ARGUMENTSYou MUST consider the user input before proceeding (if not empty).
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.
Run .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks from repo root and parse JSON
for:
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."
Required files:
Optional files (load if present):
Codebase scan:
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 pointsBuild 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 infrastructureOutput:
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]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 pointsAnalyze 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]Generate optimized execution plan:
OPTIMIZED EXECUTION PLAN
Phase 1: Setup (Shared Infrastructure)
├─ Batch 1.1 [PARALLEL] (5-10 min):
│ ├─ Agent: spring-boot-backend-development-expert
│ │ └─ T001: Create DDD aggregate structure
│ │ • Resource: MEDIUM
│ │ • Depends on: None
│ │ • Blocks: T002, T003, T126
│ │
│ ├─ Agent: spring-boot-test-expert
│ │ └─ T004: Setup Testcontainers
│ │ • Resource: MEDIUM
│ │ • Depends on: None
│ │ • Blocks: All test tasks
│
├─ Batch 1.2 [PARALLEL] (10-15 min):
│ ├─ Agent: spring-boot-backend-development-expert
│ │ ├─ T002: Add dependencies to pom.xml
│ │ │ • Resource: MEDIUM
│ │ │ • Depends on: T001
│ │ │ • Blocks: T003, Configuration
│ │ ├─ T003: Configure application.yml
│ │ │ • Resource: MEDIUM
│ │ │ • Depends on: T001, T002
│ │ │ • Blocks: Runtime configuration tasks
│ │ └─ T126: Create CodeContextProperties
│ │ • Resource: MEDIUM
│ │ • Depends on: T001, T003
│ │ • Blocks: T127, T128
│ │
│ └─ Agent: spring-boot-backend-development-expert
│ ├─ T127: ThreadPoolConfiguration service
│ │ • Resource: HIGH
│ │ • Depends on: T126
│ │ • Blocks: T128
│ ├─ T128: Async task execution config
│ │ • Resource: HIGH
│ │ • Depends on: T127
│ │ • Blocks: Async operations
│ ├─ T156: BatchEmbeddingConfiguration
│ │ • Resource: HIGH
│ │ • Depends on: T003
│ │ • Blocks: T157, T158, T159
│ ├─ T157: Adaptive batch sizing service
│ │ • Resource: HIGH
│ │ • Depends on: T156
│ │ • Blocks: T159
│ ├─ T158: Batch monitoring & metrics
│ │ • Resource: MEDIUM
│ │ • Depends on: T156
│ │ • Blocks: None
│ └─ T159: Batch optimization tests
│ • Resource: HIGH
│ • Depends on: T156, T157, T158
│ • Blocks: None
Phase 1 Validation Checkpoint:
├─ Execute: mvn clean compile
├─ Execute: mvn clean test-compile
├─ Execute: mvn test
└─ Status: [READY/BLOCKED]
Estimated Total Duration Phase 1:
- Sequential path (critical path): [X] minutes
- With optimal parallelization: [Y] minutes (Z% reduction)
- Wall-clock time (assuming N concurrent subagents): [W] minutesCalculate resource requirements:
RESOURCE REQUIREMENTS ANALYSIS
Memory Usage Profile:
- Setup Phase: [MB]
- Per parallel subagent: [MB]
- Testing infrastructure: [MB]
- Total peak: [MB]
CPU Requirements:
- Compilation tasks: MEDIUM (can share)
- Test execution: HIGH (parallel benefit significant)
- Code generation: MEDIUM
External Dependencies:
- Docker/Testcontainers: [Yes/No] → Startup time [minutes]
- Database services: [Services listed] → Availability window [minutes]
- API mock servers: [Services listed] → Setup time [minutes]
Network Bandwidth:
- Dependency download: [MB]
- Docker image pulls: [MB]
- Artifact uploads: [MB]Identify optimization risks:
RISK ASSESSMENT
High-Risk Dependencies:
- [Risk]: Task A depends on Task B completing and compiling
* Mitigation: Run immediate validation after B completes
* Impact if fails: Cascading failure to all dependent tasks
Integration Points:
- [Point]: Configuration tasks must synchronize state
* Mitigation: Validate configuration after each phase batch
* Impact if fails: Runtime errors in downstream phases
Parallelization Risks:
- [Risk]: Tasks T002 and T003 both modify configuration
* Mitigation: Enforce sequential ordering (already done with [P] marker)
* Impact if fails: Configuration conflicts, merge issuesGenerate specific recommendations:
OPTIMIZATION RECOMMENDATIONS
Priority 1: Critical Path Optimization
1. **Parallelize Setup Phase Batches**
- Current: [X] minutes (assuming sequential)
- Optimized: [Y] minutes (batches: B1.1 → B1.2)
- Savings: [Z]% with [N] concurrent subagents
- Implementation: Assign T002/T003/T126 to Batch 1.2 (after T001)
2. **Pre-compile Dependency Resolution**
- Recommendation: Run `mvn dependency:resolve` once
- Benefit: Avoid repeated downloads in parallel builds
- Timing: Before starting any compilation tasks
Priority 2: Subagent Utilization
1. **Dedicate Specialists by Phase**
- Phase 1.1: 1x backend-expert (T001), 1x test-expert (T004)
- Phase 1.2: 1x backend-expert (T002-T159 cohort)
- Benefit: Specialized focus, reduced context-switching
2. **Batch Similar Tasks**
- Group T126/T127/T128: Configuration & threading (coherent scope)
- Group T156/T157/T158/T159: Batch optimization (coherent scope)
- Benefit: Reduced cognitive load, better error handling
Priority 3: Checkpoint Strategy
1. **Insert Compilation Checkpoints**
- After T001: Run `mvn clean compile` (validate structure)
- After T002/T003: Run `mvn clean compile` (validate config)
- After T004: Run `mvn test-compile` (validate test setup)
- Benefit: Catch errors early before downstream tasks start
2. **Test Validation Sequence**
- Phase 1 complete → Run `mvn test` immediately
- Blocks: All user story work until Phase 1 tests pass
- Benefit: Prevent cascading test failures
Priority 4: Error Recovery
1. **Graceful Failure Handling**
- If Phase 1.1 fails: Halt all Phase 1.2+ tasks
- If Phase 1 compilation fails: Stop parallel execution, investigate sequentially
- Recovery: Re-run failed task batch after fix
2. **Subagent Reassignment**
- If subagent crashes: Reassign task to backup subagent
- Track completion: Mark task [X] only after validation passes
- Retry policy: 2 attempts per task before manual escalationGenerate an aggregated phase view (no time column) that groups tasks by phase, highlights the responsible subagent, and captures the validation check for each phase:
PHASE EXECUTION MATRIX
══════════════════════════════════════════════════════════════════════════════
Phase │ Execution Mode │ Subagent │ Tasks (Grouped) │ Check Action
───────┼────────────────┼─────────────────────┼──────────────────────────────────────┼──────────────────────────────
1.1 │ Parallel │ Backend Expert │ [T001] DDD Structure │ mvn clean compile
│ │ │ [T004] Testcontainers Setup │
───────┼────────────────┼─────────────────────┼──────────────────────────────────────┼──────────────────────────────
1.2A │ Parallel │ Backend Expert │ [T002] Dependencies │ mvn clean compile
│ │ │ [T003] app.yml │
│ │ │ [T126] Properties │
───────┼────────────────┼─────────────────────┼──────────────────────────────────────┼──────────────────────────────
1.2B │ Parallel │ Backend Expert │ [T127] ThreadPool Config │ mvn clean test-compile
│ │ │ [T128] Async Execution │
│ │ │ [T158] Batch Monitoring │
│ │ │ [T159] Optimization Tests │
───────┼────────────────┼─────────────────────┼──────────────────────────────────────┼──────────────────────────────
1.3 │ Sequential │ Test Expert │ [T160] Contract Validation │ mvn test
│ │ │ [T161] Performance Smoke │
───────┼────────────────┼─────────────────────┼──────────────────────────────────────┼──────────────────────────────
Done │ — │ Lead Agent │ Phase 1 sign-off │ ✅ READY
LEGEND:
[Tnnn] = Task ID
Parallel = may run alongside other phases; Sequential = must run one after another
Every phase includes an explicit validation command
Check Action uses mvn/gradle/cli commands or equivalent verification stepProduce a concise optimization report that leads with the phase table:
Ensure the report keeps the table front-and-center and avoids reintroducing time-based columns.
RECOMMENDED NEXT STEPS
1. ✅ VALIDATE THIS PLAN
- Review the phase matrix above for feasibility
- Confirm subagent availability: [N] concurrent agents
- Confirm resource availability: [MB] peak memory
- Estimate actual duration: [minutes] (add 20% buffer)
2. 📋 PREPARE EXECUTION
- Ensure tasks.md is up-to-date with all task IDs, [P] markers
- Verify pom.xml, application.yml, test configuration exist
- Have CI/CD integration ready for compilation checkpoints
3. ⚡ EXECUTE WITH OPTIMIZATION
- Use `/speckit.implement` with --optimize flag to follow this plan
- Monitor Phase 1.1 completion before starting Phase 1.2
- Watch compilation checkpoints - halt if any fail
- Validate tests pass at end of Phase 1
4. 📊 TRACK PROGRESS
- Record actual vs estimated effort for each phase
- Document any blockers or task failures
- Use data for refining future optimizations
5. 🚀 PROCEED TO NEXT PHASE
- After Phase 1 validation passes: Proceed to Phase 2
- Use same optimization strategy for subsequent phases
- Adjust subagent assignments based on Phase 1 learnings✅ DOES:
❌ DOES NOT:
Evidence-Based:
Actionable:
Risk-Calibrated:
Progressive analysis:
Compact reporting:
Before outputting report, verify:
$ARGUMENTS
/speckit.optimize example-inputdocs
plugins
developer-kit-ai
developer-kit-aws
agents
docs
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
aws-cloudformation-bedrock
aws-cloudformation-cloudfront
aws-cloudformation-cloudwatch
aws-cloudformation-dynamodb
aws-cloudformation-ec2
aws-cloudformation-ecs
aws-cloudformation-elasticache
references
aws-cloudformation-iam
references
aws-cloudformation-lambda
aws-cloudformation-rds
aws-cloudformation-s3
aws-cloudformation-security
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
references
developer-kit-core
agents
commands
skills
developer-kit-devops
developer-kit-java
agents
commands
docs
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
clean-architecture
graalvm-native-image
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
references
unit-test-controller-layer
unit-test-exception-handler
references
unit-test-json-serialization
unit-test-mapper-converter
references
unit-test-parameterized
unit-test-scheduled-async
references
unit-test-service-layer
references
unit-test-utility-methods
unit-test-wiremock-rest-api
references
developer-kit-php
developer-kit-project-management
developer-kit-python
developer-kit-specs
commands
docs
hooks
test-templates
tests
skills
developer-kit-tools
developer-kit-typescript
agents
docs
hooks
rules
skills
aws-cdk
aws-lambda-typescript-integration
better-auth
clean-architecture
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
shadcn-ui
tailwind-css-patterns
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities
references
github-spec-kit