Agent skill
moonshot-orchestrator-lite
PM workflow orchestrator (Lite). Lightweight version that runs all agents directly without fork.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/moonshot-orchestrator-lite
SKILL.md
PM Orchestrator (Lite)
Note: This version does not use fork subagents. All agents run directly in the current session.
Role
Orchestrator that sequentially executes PM analysis skills and constructs the final agent chain.
Input
Automatically collects the following:
userMessage: User requestgitBranch: Current branchgitStatus: Git status (clean/dirty)recentCommits: Recent commit listopenFiles: Open file list
Workflow
1. Initialize analysisContext
schemaVersion: "1.0"
request:
userMessage: "{userMessage}"
taskType: unknown
keywords: []
repo:
gitBranch: "{gitBranch}"
gitStatus: "{gitStatus}"
openFiles: []
changedFiles: []
signals:
hasContextMd: false
hasPendingQuestions: false
requirementsClear: false
implementationReady: false
implementationComplete: false
hasMockImplementation: false
apiSpecConfirmed: false
reactProject: false
estimates:
estimatedFiles: 0
estimatedLines: 0
estimatedTime: unknown
phase: unknown
complexity: unknown
missingInfo: []
decisions:
recommendedAgents: []
skillChain: []
parallelGroups: []
artifacts:
tasksRoot: "{PROJECT.md:documentPaths.tasksRoot}"
contextDocPath: "{tasksRoot}/{feature-name}/context.md"
verificationScript: .claude/agents/verification/verify-changes.sh
tokenBudget:
specSummaryTrigger: 2000
splitTrigger: 5
contextMaxTokens: 8000
warningThreshold: 0.8
projectMemory:
projectId: null
loaded: false
boundaries: null
relevantRules: []
notes: []
2. Sequential PM Skill Execution
2.0 Large Specification Handling
2.0.1 Check Specification Size
- Count words in
userMessage - Trigger summarization if >
tokenBudget.specSummaryTrigger(2000 words) - Trigger task splitting if independent features >
tokenBudget.splitTrigger(5)
2.0.2 Summarize Specification
- Save original to
{tasksRoot}/{feature-name}/archives/specification-full.md - Extract core elements only
- Write summary to
{tasksRoot}/{feature-name}/specification.md
2.0.3 Split into Subtasks
If single spec covers multiple independent areas, split into subtasks/ directory.
2.0.4 Load Project Memory (Direct Execution)
Determine Project ID: package.json name → directory name → git remote
Direct Execution (no fork):
Task tool: project-memory-agent (subagent_type: general-purpose)
Input: { projectId, changedFiles, taskType, userRequest }
Agent searches project memory ([ProjectID]::*) and returns context:
projectMemoryContext:
projectId: "my-app"
loaded: true
boundaries:
alwaysDo: [...]
askFirst: [...]
neverDo: [...]
relevantRules: [...]
Error Handling:
- No memory:
loaded: false, continue - MCP unavailable: continue with warning
2.1 Task Classification
Run /moonshot-classify-task using Skill tool
2.2 Complexity Evaluation
Run /moonshot-evaluate-complexity using Skill tool
2.3 Uncertainty Detection
Run /moonshot-detect-uncertainty using Skill tool
2.4 Handle Uncertainties
If missingInfo is not empty, generate questions using AskUserQuestion tool.
2.5 Sequence Decision
Run /moonshot-decide-sequence using Skill tool
3. Execute Agent Chain
Execute decisions.skillChain in order:
Allowed Steps:
pre-flight-check: Pre-flight check skillproject-memory-agent: Project memory load agent (Task tool, direct execution)requirements-analyzer: Requirements analysis agent (Task tool)context-builder: Context building agent (Task tool)codex-validate-plan: Codex plan validation skillimplementation-runner: Implementation agent (Task tool)completion-verifier: Test-based completion verification skillcodex-review-code: Codex code review skillproject-memory-reviewer: Project memory rule/spec violation verification agent (Task tool, direct execution)vercel-react-best-practices: React/Next.js performance optimization review skillsecurity-reviewer: Security vulnerability review skillbuild-error-resolver: Build/compile error resolution skillverify-changes.sh: Verification script (Bash tool)efficiency-tracker: Efficiency tracking skillsession-logger: Session logging skill
Execution Rules:
- Execute each step sequentially
- Use
Skilltool for skill steps - Use
Tasktool for agent steps (subagent_type mapping) - Use
Bashtool for script steps - Parallel execution only within parallel groups
- Request user confirmation for undefined steps
- All agents/skills must follow
.claude/docs/guidelines/document-memory-policy.md
Agent Mapping:
project-memory-agent→subagent_type: "general-purpose"+ prompt (direct execution)requirements-analyzer→subagent_type: "general-purpose"+ promptcontext-builder→subagent_type: "context-builder"implementation-runner→subagent_type: "implementation-agent"project-memory-reviewer→subagent_type: "general-purpose"+ prompt (direct execution)
3.1 Dynamic Skill Injection
Inject skills dynamically when signals are detected during skillChain execution:
| Signal | Condition | Inserted Skill | Insertion Point |
|---|---|---|---|
buildFailed |
Bash exit code ≠ 0 | build-error-resolver | Before retry |
securityConcern |
Changed files contain .env, auth, password, token |
security-reviewer | After codex-review-code |
reactProject |
.tsx/.jsx files or React keywords |
vercel-react-best-practices | After codex-review-code |
3.2 Project Memory Review (Direct Execution)
After codex-review-code, directly execute project-memory-reviewer:
Task tool: project-memory-reviewer (subagent_type: general-purpose)
Input: { projectId, changedFiles, projectMemoryContext, diff }
Receive Violation Report:
memoryReviewResult:
status: "passed" | "failed" | "needs_approval"
violations: [...] # NeverDo violations
needsApproval: [...] # AskFirst items
warnings: [...] # Convention/spec warnings
reminders: [...] # AlwaysDo reminders
Result Handling:
status: "failed": Stop execution, report violations to userstatus: "needs_approval": Request user approval before proceedingstatus: "passed": Proceed to next step
3.3 Completion Verification Loop
After implementation-runner completes, call completion-verifier.
Retry up to retryCount < 2 if allPassed: false.
4. Record Results
Save final analysisContext to .claude/docs/moonshot-analysis.yaml.
Output Format
Summary for User (Markdown)
## PM Analysis Results
**Task Type**: {taskType}
**Complexity**: {complexity}
**Phase**: {phase}
### Execution Chain
1. {step1}
2. {step2}
...
### Estimates
- Files: {estimatedFiles}
- Lines: {estimatedLines}
- Estimated Time: {estimatedTime}
Error Handling
- Skill execution failure: Log error to notes and report to user
- Undefined step: Request user confirmation
- Question infinite loop: Max 3 questions limit
- Token limit warning: Archive and summarize before continuing
Contract
- This skill only orchestrates other PM skills, does not analyze directly
- All analysis logic delegated to individual PM skills
- Does not use fork - all agents run directly in current session
- Document memory policy: Follow
.claude/docs/guidelines/document-memory-policy.md
References
.claude/docs/guidelines/document-memory-policy.md
Didn't find tool you were looking for?