@stillrivercode/information-dense-keywords
Version:
Information Dense Keywords Dictionary - A curated vocabulary for instructing AI assistants
273 lines (177 loc) • 8.48 kB
Markdown
# Command Chaining Examples
This document provides comprehensive examples of how to chain commands from the Information Dense Keywords Dictionary to create powerful workflows.
## Command Chaining Syntax
Commands can be chained using connecting words:
- **"then"** - Sequential operations (one after another)
- **"and"** - Parallel operations (can be done simultaneously)
- **"while"** - Conditional operations
- **"if"** - Conditional branching
## Basic Chaining Patterns
### Sequential Chain (then)
Operations that must happen in order, where each step depends on the previous one.
```bash
research this OAuth2 implementation patterns then spec this authentication system then plan this implementation
```bash
### Parallel Chain (and)
Operations that can happen simultaneously or are independent.
```bash
test this user service and document this API endpoints and review this security implementation
```bash
### Conditional Chain (if/while)
Operations with logical conditions.
```bash
analyze this performance issue then optimize this query if bottleneck is identified
```bash
## Real-World Workflow Examples
### 1. New Feature Development
**Scenario**: Building a user notification system
```bash
research this real-time notification patterns then spec this notification service then CREATE notification API endpoints then test this notification system then document this notification service
```bash
**Breakdown**:
1. **Research** → Investigate patterns and best practices
2. **Spec** → Create detailed technical specification
3. **Create** → Implement the API endpoints
4. **Test** → Generate comprehensive test suite
5. **Document** → Create user and developer documentation
### 2. Bug Investigation and Resolution
**Scenario**: Fixing a production performance issue
```bash
analyze this slow database queries then debug this performance bottleneck then optimize this query performance then test this optimization and review this solution
```bash
**Breakdown**:
1. **Analyze** → Identify performance patterns and issues
2. **Debug** → Investigate root cause of bottleneck
3. **Optimize** → Apply performance improvements
4. **Test** → Validate the optimization works
5. **Review** → Quality check the overall solution
### 3. Security Audit and Hardening
**Scenario**: Securing an authentication system
```bash
analyze this authentication flow for security vulnerabilities then research this latest security best practices then spec this security improvements then plan this security hardening implementation
```bash
**Breakdown**:
1. **Analyze** → Identify current security issues
2. **Research** → Learn current best practices
3. **Spec** → Define security improvement requirements
4. **Plan** → Create implementation strategy
### 4. Legacy Code Modernization
**Scenario**: Updating an old API system
```bash
analyze this legacy API architecture then research this modern API patterns then spec this API modernization then plan this migration strategy then CREATE migration scripts
```bash
**Breakdown**:
1. **Analyze** → Understand current system
2. **Research** → Explore modern alternatives
3. **Spec** → Define modernization requirements
4. **Plan** → Create migration strategy
5. **Create** → Build migration tools
## Advanced Chaining Scenarios
### 5. Full-Stack Feature with Testing
**Scenario**: Building a complete user dashboard
```bash
research this dashboard design patterns then spec this user dashboard then CREATE frontend components and CREATE backend APIs then test this frontend functionality and test this API endpoints then document this dashboard system and review this implementation
```bash
**Mixed Operations**:
- Sequential research → spec → create phase
- Parallel testing of frontend and backend
- Parallel documentation and review
### 6. Performance Optimization Pipeline
**Scenario**: Optimizing application performance
```bash
analyze this application performance then debug this slowest endpoints then optimize this database queries and optimize this frontend rendering then test this performance improvements then document this optimization guide
```bash
**Complex Flow**:
- Sequential analysis → debugging → optimization
- Parallel optimization of backend and frontend
- Sequential testing and documentation
### 7. Security Incident Response
**Scenario**: Responding to a security vulnerability
```bash
analyze this security incident then debug this vulnerability then research this security patches then FIX this security issue then test this security fix then document this incident response and review this security measures
```bash
**Critical Path**:
- Immediate analysis and debugging
- Research for proper fixes
- Apply fixes and validate
- Document and review for future prevention
## Conditional Chaining Examples
### 8. Smart Error Handling
```bash
debug this test failures then FIX this issues if errors are found then test this solution if fixes were applied then document this troubleshooting if new patterns emerge
```bash
### 9. Adaptive Development
```bash
analyze this user requirements then spec this solution then CREATE prototype then test this prototype and review this design then optimize this implementation if performance issues exist
```bash
### 10. Quality Gate Workflow
```bash
CREATE new feature implementation then test this functionality then review this code quality then FIX this issues if problems found then document this feature if quality gates pass
```bash
## Category-Specific Workflows
### Development-Focused Chain
```bash
SELECT existing authentication code then analyze this current implementation then debug this authentication issues then optimize this performance then test this improvements
```bash
### Documentation-Focused Chain
```bash
research this API design patterns then explain this chosen architecture then document this API specification then CREATE usage examples
```bash
### Quality Assurance Chain
```bash
test this new features then review this code changes then analyze this test coverage then CREATE additional test cases if coverage is low
```bash
## Best Practices for Command Chaining
### 1. Logical Sequencing
- Ensure each command builds on the previous one
- Use "then" when order matters, "and" when it doesn't
### 2. Context Preservation
- Maintain context across the chain
- Reference specific files, components, or systems consistently
### 3. Conditional Logic
- Use "if" statements for decision points
- Include fallback options for different scenarios
### 4. Parallel Efficiency
- Identify operations that can run in parallel
- Use "and" to improve overall workflow efficiency
### 5. Output Coordination
- Ensure outputs from one command feed into the next
- Follow Expected Output Formats for consistency
## Common Anti-Patterns to Avoid
❌ **Circular Dependencies**
```bash
analyze this code then debug this issues then analyze this same code
```bash
❌ **Conflicting Operations**
```bash
CREATE new authentication then DELETE authentication system
```bash
❌ **Missing Dependencies**
```bash
test this feature then CREATE the feature implementation
```bash
❌ **Overly Complex Chains**
```bash
research this then spec this then analyze this then debug this then optimize this then CREATE this then test this then review this then document this then explain this
```bash
## Tips for Effective Chaining
1. **Start Simple**: Begin with 2-3 command chains
2. **Be Specific**: Include clear context for each command
3. **Plan the Flow**: Think through the logical sequence
4. **Use Parallelism**: Identify independent operations
5. **Include Quality Gates**: Add review and testing steps
6. **Document Intent**: Make the workflow purpose clear
## Integration with Team Workflows
### Code Review Process
```bash
SELECT changed files then review this pull request then test this changes if issues found then document this review feedback
```bash
### Release Preparation
```bash
analyze this release readiness then test this release candidate and review this changelog then document this release notes
```bash
### Incident Response
```bash
debug this production issue then FIX this critical problem then test this hotfix then document this incident resolution
```bash
Command chaining transforms individual commands into powerful, repeatable workflows that can significantly improve development productivity and consistency.