Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:36:29 +08:00
commit 23ba21fabe
14 changed files with 1375 additions and 0 deletions

96
commands/sc-explore.md Normal file
View File

@@ -0,0 +1,96 @@
# sc-explore: Research and Understanding Command
**Purpose**: I need to understand something - conducts research, analysis, codebase exploration, and knowledge synthesis to build understanding
## Agent Orchestration and Deployment Strategy
**Efficiency First:** Handle tasks directly when possible. Use agents only when genuinely needed for:
- Multi-step coordination requiring handoffs
- Specialized domain expertise beyond general capability
- Parallel work streams with interdependencies
- Complex analysis requiring multiple perspectives
- Operations that produce verbose intermediate output
**Direct Agent Rules (ALWAYS delegate these):**
- **Documentation lookups** → Use `repository-documentation-expert`
- **Test execution** → Use `test-runner`
- **Web searches** → Use `web-search-researcher`
- **Deep codebase analysis** → Use `code-explorer`
- **Architecture design** → Use `code-architect`
- **Code quality review** → Use `code-reviewer`
**Available Agents:**
- `code-explorer` - Deeply analyzes existing codebase features by tracing execution paths and mapping architecture
- `code-architect` - Designs feature architectures by analyzing existing patterns and providing implementation blueprints
- `code-reviewer` - Reviews code for bugs, security vulnerabilities, and adherence to project conventions
- `repository-documentation-expert` - Finds documentation from Context7, local repos, and GitHub repositories
- `test-runner` - Executes tests and analyzes failures
- `web-search-researcher` - Searches web for current information
**Context Preservation:**
- **Keep only**: user request, actionable recommendations, code changes, summary, next steps
- **Discard**: intermediate outputs, full docs, verbose logs, exploratory reads
**Processing Pipeline**: Parse → Classify → Validate → Route → Execute → Synthesize
## Intent Recognition and Semantic Transformation
This command interprets natural language requests that express the intent: "I need to understand something" - research, analysis, exploration, learning, or investigation of codebases, technologies, concepts, or domain knowledge.
**Command Execution:**
**Empty $ARGUMENTS**: Display usage suggestions → stop
**Has content**: Parse intent → apply strategy → route execution
**Intent Processing:** Extract intent → Apply strategy matrix → Validate → Execute
**Strategy Matrix:**
| Condition | Direct Handling | Agent Required |
| --------- | ------------------- | ------------------------------ |
| Task Type | Simple, single-step | See "Direct Agent Rules" above |
| Domain | Single, familiar | Multi-tech, unknown |
| Context | Available locally | External research needed |
| Output | Concise, focused | Verbose, needs filtering |
Transforms: $ARGUMENTS into structured execution:
- Intent: [recognized-user-intent]
- Approach: [direct/agent with reasoning]
- Agents: [none OR minimal-viable-set]
### Output Template
```
## Response
[Direct answer or action taken - 1-3 sentences addressing the core request]
## Details
[Main content based on command type:
- Plan: Strategy breakdown with phases
- Work: Code changes and implementation steps
- Explore: Research findings and analysis
- Review: Issues found and quality assessment]
## Next Actions
[What to do next:
- Plan: Implementation steps to begin
- Work: Testing and validation needed
- Explore: Areas for deeper investigation
- Review: Fixes and improvements to make]
## Notes
[Optional - context, warnings, alternatives, or additional considerations]
```
---
**User Request**: $ARGUMENTS

87
commands/sc-plan.md Normal file
View File

@@ -0,0 +1,87 @@
# sc-plan: Strategic Planning and Analysis
**Purpose**: I need to think through something - analyzes requirements, creates actionable roadmaps, and establishes clear direction for development work
## Agent Orchestration and Deployment Strategy
**Efficiency First:** Handle tasks directly when possible. Use agents only when genuinely needed for:
- Multi-step coordination requiring handoffs
- Specialized domain expertise beyond general capability
- Parallel work streams with interdependencies
- Complex analysis requiring multiple perspectives
- Operations that produce verbose intermediate output
**Direct Agent Rules (ALWAYS delegate these):**
- **Documentation lookups** → Use `repository-documentation-expert`
- **Test execution** → Use `test-runner`
- **Web searches** → Use `web-search-researcher`
- **Deep codebase analysis** → Use `code-explorer`
- **Architecture design** → Use `code-architect`
- **Code quality review** → Use `code-reviewer`
**Context Preservation:**
- **Keep only**: user request, actionable recommendations, code changes, summary, next steps
- **Discard**: intermediate outputs, full docs, verbose logs, exploratory reads
**Processing Pipeline**: Parse → Classify → Validate → Route → Execute → Synthesize
## Intent Recognition and Semantic Transformation
This command interprets natural language requests that express the intent: "I need to think through something" - planning, analysis, strategy, roadmap creation, or architectural decision-making.
**Command Execution:**
**Empty $ARGUMENTS**: Display usage suggestions → stop
**Has content**: Parse intent → apply strategy → route execution
**Intent Processing:** Extract intent → Apply strategy matrix → Validate → Execute
**Strategy Matrix:**
| Condition | Direct Handling | Agent Required |
| --------- | ------------------- | ------------------------------ |
| Task Type | Simple, single-step | See "Direct Agent Rules" above |
| Domain | Single, familiar | Multi-tech, unknown |
| Context | Available locally | External research needed |
| Output | Concise, focused | Verbose, needs filtering |
Transforms: $AGENTS into structured execution:
- Intent: [recognized-user-intent]
- Approach: [direct/agent with reasoning]
- Agents: [none OR minimal-viable-set]
### Output Template
```
## Response
[Direct answer or action taken - 1-3 sentences addressing the core request]
## Details
[Main content based on command type:
- Plan: Strategy breakdown with phases
- Work: Code changes and implementation steps
- Explore: Research findings and analysis
- Review: Issues found and quality assessment]
## Next Actions
[What to do next:
- Plan: Implementation steps to begin
- Work: Testing and validation needed
- Explore: Areas for deeper investigation
- Review: Fixes and improvements to make]
## Notes
[Optional - context, warnings, alternatives, or additional considerations]
```
---
**User Request**: $ARGUMENTS

96
commands/sc-review.md Normal file
View File

@@ -0,0 +1,96 @@
# sc-review: Quality Verification and Assessment
**Purpose**: I need to verify quality/security/performance - comprehensive analysis covering code quality, security scanning, performance profiling, and architecture assessment
## Agent Orchestration and Deployment Strategy
**Efficiency First:** Handle tasks directly when possible. Use agents only when genuinely needed for:
- Multi-step coordination requiring handoffs
- Specialized domain expertise beyond general capability
- Parallel work streams with interdependencies
- Complex analysis requiring multiple perspectives
- Operations that produce verbose intermediate output
**Direct Agent Rules (ALWAYS delegate these):**
- **Documentation lookups** → Use `repository-documentation-expert`
- **Test execution** → Use `test-runner`
- **Web searches** → Use `web-search-researcher`
- **Deep codebase analysis** → Use `code-explorer`
- **Architecture design** → Use `code-architect`
- **Code quality review** → Use `code-reviewer`
**Available Agents:**
- `code-explorer` - Deeply analyzes existing codebase features by tracing execution paths and mapping architecture
- `code-architect` - Designs feature architectures by analyzing existing patterns and providing implementation blueprints
- `code-reviewer` - Reviews code for bugs, security vulnerabilities, and adherence to project conventions
- `repository-documentation-expert` - Finds documentation from Context7, local repos, and GitHub repositories
- `test-runner` - Executes tests and analyzes failures
- `web-search-researcher` - Searches web for current information
**Context Preservation:**
- **Keep only**: user request, actionable recommendations, code changes, summary, next steps
- **Discard**: intermediate outputs, full docs, verbose logs, exploratory reads
**Processing Pipeline**: Parse → Classify → Validate → Route → Execute → Synthesize
## Intent Recognition and Semantic Transformation
This command interprets natural language requests that express the intent: "I need to verify quality/security/performance" - comprehensive assessment including code quality review, security scanning, performance profiling, and architecture analysis.
**Command Execution:**
**Empty $ARGUMENTS**: Display usage suggestions → stop
**Has content**: Parse intent → apply strategy → route execution
**Intent Processing:** Extract intent → Apply strategy matrix → Validate → Execute
**Strategy Matrix:**
| Condition | Direct Handling | Agent Required |
| --------- | ------------------- | ------------------------------ |
| Task Type | Simple, single-step | See "Direct Agent Rules" above |
| Domain | Single, familiar | Multi-tech, unknown |
| Context | Available locally | External research needed |
| Output | Concise, focused | Verbose, needs filtering |
Transforms: $ARGUMENTS into structured execution:
- Intent: [verification-goal-and-scope]
- Approach: [direct-review OR comprehensive-analysis]
- Agents: [none OR minimal-viable-set]
### Output Template
```
## Response
[Direct answer or action taken - 1-3 sentences addressing the core request]
## Details
[Main content based on command type:
- Plan: Strategy breakdown with phases
- Work: Code changes and implementation steps
- Explore: Research findings and analysis
- Review: Issues found and quality assessment]
## Next Actions
[What to do next:
- Plan: Implementation steps to begin
- Work: Testing and validation needed
- Explore: Areas for deeper investigation
- Review: Fixes and improvements to make]
## Notes
[Optional - context, warnings, alternatives, or additional considerations]
```
---
**User Request**: $ARGUMENTS

92
commands/sc-work.md Normal file
View File

@@ -0,0 +1,92 @@
# sc-work: Universal Implementation Command
**Purpose**: I need to build/fix/modify something - handles all implementation tasks from creating new features to fixing bugs to refactoring code
## Agent Orchestration and Deployment Strategy
**Efficiency First:** Handle tasks directly when possible. Use agents only when genuinely needed for:
- Multi-step coordination requiring handoffs
- Specialized domain expertise beyond general capability
- Parallel work streams with interdependencies
- Complex analysis requiring multiple perspectives
- Operations that produce verbose intermediate output
**Direct Agent Rules (ALWAYS delegate these):**
- **Documentation lookups** → Use `repository-documentation-expert`
- **Test execution** → Use `test-runner`
- **Web searches** → Use `web-search-researcher`
- **Deep codebase analysis** → Use `code-explorer`
- **Architecture design** → Use `code-architect`
- **Code quality review** → Use `code-reviewer`
**Available Agents:**
- `code-explorer` - Deeply analyzes existing codebase features by tracing execution paths and mapping architecture
- `code-architect` - Designs feature architectures by analyzing existing patterns and providing implementation blueprints
- `code-reviewer` - Reviews code for bugs, security vulnerabilities, and adherence to project conventions
- `repository-documentation-expert` - Finds documentation from Context7, local repos, and GitHub repositories
- `test-runner` - Executes tests and analyzes failures
- `web-search-researcher` - Searches web for current information
**Context Preservation:**
- **Keep only**: user request, actionable recommendations, code changes, summary, next steps
- **Discard**: intermediate outputs, full docs, verbose logs, exploratory reads
**Processing Pipeline**: Parse → Classify → Validate → Route → Execute → Synthesize
## Intent Recognition and Semantic Transformation
This command interprets natural language requests that express the intent: "I need to build/fix/modify something" - implementation work including creating, modifying, fixing, refactoring, optimizing, or enhancing code.
**Command Execution:**
**Empty $ARGUMENTS**: Display usage suggestions → stop
**Has content**: Parse intent → apply strategy → route execution
**Intent Processing:** Extract intent → Apply strategy matrix → Validate → Execute
**Strategy Matrix:**
| Condition | Direct Handling | Agent Required |
| --------- | ------------------- | ------------------------------ |
| Task Type | Simple, single-step | See "Direct Agent Rules" above |
| Domain | Single, familiar | Multi-tech, unknown |
| Context | Available locally | External research needed |
| Output | Concise, focused | Verbose, needs filtering |
Transforms: $ARGUMENTS into structured execution:
- Intent: [implementation-goal-and-scope]
- Approach: [direct-implementation OR research-then-implement]
- Agents: [none OR minimal-viable-set]
### Output Template
```
## Response
[Direct answer or action taken - 1-3 sentences addressing the core request]
## Details
[Main content based on command type:
- Plan: Strategy breakdown with phases
- Work: Code changes and implementation steps
- Explore: Research findings and analysis
- Review: Issues found and quality assessment]
## Next Actions
[What to do next:
- Plan: Implementation steps to begin
- Work: Testing and validation needed
- Explore: Areas for deeper investigation
- Review: Fixes and improvements to make]
## Notes
[Optional - context, warnings, alternatives, or additional considerations]
```
---
**User Request**: $ARGUMENTS

157
commands/sc-workflow.md Normal file
View File

@@ -0,0 +1,157 @@
---
description: Guided feature development with codebase understanding and architecture focus
argument-hint: [ Feature description ]
---
# Feature Development
You are helping a developer implement a new feature. Follow a systematic approach: understand the codebase deeply, identify and ask about all underspecified details, design elegant architectures, then implement.
## Core Principles
- **Ask clarifying questions**: Identify all ambiguities, edge cases, and underspecified behaviors. Ask specific, concrete questions rather than making assumptions. Wait for user answers before proceeding with implementation. Ask questions early (after understanding the codebase, before designing architecture).
- **Understand before acting**: Read and comprehend existing code patterns first
- **Read files identified by agents**: When launching agents, ask them to return lists of the most important files to read. After agents complete, read those files to build detailed context before proceeding.
- **Simple and elegant**: Prioritize readable, maintainable, architecturally sound code
- **Use TodoWrite**: Track all progress throughout
---
## Phase 1: Discovery
**Goal**: Understand what needs to be built
Initial request: $ARGUMENTS
**Actions**:
1. Create todo list with all phases
2. If feature unclear, ask user for:
- What problem are they solving?
- What should the feature do?
- Any constraints or requirements?
3. Summarize understanding and confirm with user
---
## Phase 2: Codebase Exploration
**Goal**: Understand relevant existing code and patterns at both high and low levels
**Actions**:
1. Launch 2-3 code-explorer agents in parallel. Each agent should:
- Trace through the code comprehensively and focus on getting a comprehensive understanding of abstractions, architecture and flow of control
- Target a different aspect of the codebase (eg. similar features, high level understanding, architectural understanding, user experience, etc)
- Include a list of 5-10 key files to read
**Example agent prompts**:
- "Find features similar to [feature] and trace through their implementation comprehensively"
- "Map the architecture and abstractions for [feature area], tracing through the code comprehensively"
- "Analyze the current implementation of [existing feature/area], tracing through the code comprehensively"
- "Identify UI patterns, testing approaches, or extension points relevant to [feature]"
2. Once the agents return, please read all files identified by agents to build deep understanding
3. Present comprehensive summary of findings and patterns discovered
---
## Phase 3: Clarifying Questions
**Goal**: Fill in gaps and resolve all ambiguities before designing
**CRITICAL**: This is one of the most important phases. DO NOT SKIP.
**Actions**:
1. Review the codebase findings and original feature request
2. Identify underspecified aspects: edge cases, error handling, integration points, scope boundaries, design preferences, backward compatibility, performance needs
3. **Present all questions to the user in a clear, organized list**
4. **Wait for answers before proceeding to architecture design**
If the user says "whatever you think is best", provide your recommendation and get explicit confirmation.
---
## Phase 4: Research & Dependency Guidance
**Goal**: Ground architecture decisions in actual API capabilities, not assumptions
**CONDITIONAL**: Skip this phase if:
- Feature uses only existing, well-understood dependencies
- No new external libraries are needed
- APIs haven't changed since codebase was written
**Actions**:
1. Identify external dependencies needed for the feature:
- New libraries required (based on clarified requirements)
- Existing dependencies that will be used differently
- APIs with potential version mismatches or deprecations
2. For each significant external dependency, launch web-search-researcher or
repo-documentation-expert agents to:
- Get current API documentation and examples
- Identify constraints, limitations, and patterns
- Flag breaking changes or deprecations vs. existing codebase usage
- Find recommended patterns and anti-patterns
3. Document findings that constrain architecture:
- API limitations that rule out certain designs
- Required patterns (e.g., initialization, error handling)
- Performance characteristics
- Version compatibility requirements
4. Present research summary to user with any concerns about API mismatches or constraints
---
## Phase 5: Architecture Design
**Goal**: Design multiple implementation approaches with different trade-offs
**Actions**:
1. Launch 2-3 code-architect agents in parallel with different focuses: minimal changes (smallest change, maximum reuse), clean architecture (maintainability, elegant abstractions), or pragmatic balance (speed + quality)
2. Review all approaches and form your opinion on which fits best for this specific task (consider: small fix vs large feature, urgency, complexity, team context)
3. Present to user: brief summary of each approach, trade-offs comparison, **your recommendation with reasoning**, concrete implementation differences
4. **Ask user which approach they prefer**
---
## Phase 6: Implementation
**Goal**: Build the feature
**DO NOT START WITHOUT USER APPROVAL**
**Actions**:
1. Wait for explicit user approval
2. Read all relevant files identified in previous phases
3. Implement following chosen architecture
4. Follow codebase conventions strictly
5. Write clean, well-documented code
6. Update todos as you progress
---
## Phase 7: Quality Review
**Goal**: Ensure code is simple, DRY, elegant, easy to read, and functionally correct
**Actions**:
1. Launch 3 code-reviewer agents in parallel with different focuses: simplicity/DRY/elegance, bugs/functional correctness, project conventions/abstractions
2. Consolidate findings and identify highest severity issues that you recommend fixing
3. **Present findings to user and ask what they want to do** (fix now, fix later, or proceed as-is)
4. Address issues based on user decision
---
## Phase 8: Summary
**Goal**: Document what was accomplished
**Actions**:
1. Mark all todos complete
2. Summarize:
- What was built
- Key decisions made
- Files modified
- Suggested next steps
---