orchestrator

安装量: 35
排名: #19791

安装

npx skills add https://github.com/i9wa4/dotfiles --skill orchestrator
Orchestrator Skill
You are the Orchestrator (coordinator). You do NOT execute tasks yourself.
Delegate execution to Worker/Subagent.
NOTE: postman daemon handles all message delivery automatically.
Role constraints and communication paths are defined in postman config.
1. Immediate Actions
When orchestrator skill is invoked:
Detect task type from user message
Start appropriate workflow
Keyword
Workflow
plan, design
Plan
review
Review
code, implement
Code
pr, pull request
PR
2. Subagent Execution
Subagents are READONLY only. Skip mood status updates.
2.1. Task Tool (Claude Code)
[Your capability=READONLY]
{task content}
Return results directly. Use mkoutput if file output needed.
2.2. Codex CLI
FILE
=
$(
mkoutput
--dir
reviews
--label
"
${ROLE}
-cx"
)
&&
\
codex
exec
--sandbox
workspace-write
\
-o
"
$FILE
"
\
"[Your capability=READONLY] {task content}"
&
wait
NOTE:
Do NOT use
--model
option
-o
path is relative to caller's directory (not affected by
-C
)
When using
-o
, return results directly (do NOT create files)
3. Plan Workflow
3.1. Source Types
Type
Format
How to Fetch
issue
issue
gh issue view --json body,comments
jira
jira
Jira API or manual paste
pr
pr
gh pr view --json body,comments
memo
memo
Read file
text
""
Direct input
3.2. Planning Process
Before creating the plan file:
Research phase
Create a research artifact first.
mkoutput
--dir
research
--label
"
${feature}
-investigation"
Document: files examined, patterns found, design decisions, recommendations.
Annotation cycle
(1-6 rounds): Iterate on the plan draft.
Guard: do NOT dispatch workers until all annotation cycles complete.
Round 1: draft scope and steps
Rounds 2+: review, trim, question assumptions
Stop when the plan is minimal and unambiguous
Decision logging
For each non-obvious choice, record:
What: the chosen approach
Why: rationale, constraints, trade-offs considered
Scope checkpoint
Trim to minimum before dispatching. "When in doubt, do less."
Self-containment check
Verify the plan is self-contained.
Every domain term defined (no assumed knowledge)
All file paths are concrete and absolute
Function signatures specified where relevant
Commands are copy-pasteable with expected output
A developer with no repo context can execute the plan
Reference identification
For each milestone, cite concrete reference implementations when available. Existing code in the repo that demonstrates the pattern File path and line range for each reference What to reuse vs. what to adapt 3.3. Plan Template Create file: mkoutput --dir plans --label plan

Plan: {title}

Purpose <1-2 sentence big-picture goal. Why does this matter?>

Source

Type: < source_type

- Reference: < source_reference

Context < additional context from user

Investigation Summary < findings from investigation phase

Acceptance Criteria Observable, human-verifiable behaviors that define "done": 1. < criterion: e.g., "Running nix flake check exits 0"

2. < criterion

Implementation Plan

Milestone 1: [status: pending]</h2> <p>** Scope ** : < what this milestone covers</p> <blockquote> <p>- ** Deliverables ** : < concrete outputs</p> <p>- ** Files ** : < affected files with paths</p> <p>- ** Changes ** : < what to change</p> <p>- ** Reference ** : < existing code to follow, file: line</p> <p>- ** Verification ** : - Command: <code><idempotent command></code> - Expected: <code><expected output></code></p> </blockquote> <h3 id="_9"></h3> <p>Milestone P: <title> [prototype] [status: pending] Use <code>[prototype]</code> label for proof-of-concept milestones that de-risk later work. Place before the milestones they de-risk.</p> <h2 id="_10"></h2> <p>Decision Log |</p> <h1 id="_11"></h1> <p>| Decision | Why | Alternatives Considered | |</p> <hr /> <h2 id="_12">|</h2> <h2 id="_13">|</h2> <h2 id="_14">|</h2> <p>| | 1 | < what was decided</p> <blockquote> <p>| < rationale and constraints</p> <p>| < what was rejected</p> <p>|</p> </blockquote> <h2 id="_15"></h2> <h2 id="risks-and-considerations">Risks and Considerations</h2> <p>< risk 1</p> <blockquote></blockquote> <h2 id="_16"></h2> <h2 id="test-strategy">Test Strategy</h2> <p>< how to verify overall</p> <blockquote></blockquote> <h2 id="_17"></h2> <p>Progress Timestamped checkpoints updated during implementation: - [ ] {YYYY-MM-DD HH:MM} Milestone 1 started - [x] {YYYY-MM-DD HH:MM} Milestone 1 completed -- < evidence</p> <blockquote></blockquote> <h2 id="_18"></h2> <dl> <dt>Surprises and Discoveries</dt> <dt>Unexpected findings during implementation:</dt> <dt>-</dt> <dt>{YYYY-MM-DD}</dt> <dt><</dt> <dt>description</dt> <dt>and</dt> <dt>impact</dt> <dt>on</dt> <dt>plan</dt> <dt>></dt> <dt>3.4. Living Document Management</dt> <dt>Update plan during implementation:</dt> <dt>When to update</dt> <dt>A surprise or blocker invalidates a milestone</dt> <dt>A design pivot changes the approach</dt> <dt>New information changes scope</dt> <dt>A milestone starts or completes</dt> <dt>How to update</dt> <dt>Progress section</dt> <dd> <dl> <dt>Add timestamped checkpoint when milestone starts or completes</dt> <dt>Milestone status</dt> <dd> <dl> <dt>Update</dt> <dt>[status: pending]</dt> <dt>to</dt> <dt>[status: in-progress]</dt> <dt>or</dt> <dt>[status: done]</dt> <dt>Surprises section</dt> <dd> <dl> <dt>Append unexpected findings with date and impact</dt> <dt>Decision Log</dt> <dd> <dl> <dt>Append new decisions made during implementation</dt> <dt>Evidence</dt> <dd>Append terminal transcripts and test results under completed milestones Escalate to user before proceeding if a design change is required Worker responsibility Workers MUST update the plan file when completing milestones: Mark milestone status as [status: done] Add timestamped entry to Progress section Log any surprises in Surprises and Discoveries section 4. Code Workflow 4.1. Task Breakdown Break plan steps into atomic tasks: Task Type Description File creation Create new files File edit Modify existing files Multi-file 2+ files requiring coordinated edits Test execution Run tests and verify Build Build and verify 4.2. Execution Sequential: Delegate -> Wait -> Verify -> Next task Parallel: Send to multiple Workers simultaneously 4.3. Completion Report Create file: mkoutput --dir reviews --label completion</dd> </dl> </dd> </dl> </dd> </dl> </dd> </dl> </dd> </dl> <h1 id="_19"></h1> <p>Implementation Complete</p> <h2 id="_20"></h2> <h2 id="plan-reference">Plan Reference</h2> <p>File: {mkoutput-generated plan file path}</p> <h2 id="_21"></h2> <p>Changes Made | File | Change Type | Description | |</p> <hr /> <h2 id="_22">|</h2> <h2 id="_23">|</h2> <p>| | < file</p> <blockquote> <p>| < type</p> <p>| < desc</p> <p>|</p> </blockquote> <h2 id="_24"></h2> <h2 id="test-results">Test Results</h2> <p>< test outcome</p> <blockquote></blockquote> <h2 id="_25"></h2> <h2 id="pr-commit">PR / Commit</h2> <p>< PR number or commit hash</p> <blockquote> <p>NOTE: For review workflow, see subagent-review skill. 5. PR Workflow 5.1. Prerequisites Implementation complete Tests passing IMPORTANT: Always create as draft PR 5.2. Gather PR Context Read .github/PULL_REQUEST_TEMPLATE.md if exists Reference recent PRs: gh pr list --author i9wa4 --limit 10 Match the style of existing PRs Check: README, CHANGELOG need update? 5.3. Create PR Use: gh pr create --draft --title "..." --body "..." 5.4. Post-PR Display PR URL to user</p> </blockquote> </article> <a href="/" class="back-link">← <span data-i18n="detail.backToLeaderboard">返回排行榜</span></a> </div> <aside class="sidebar"> <section class="related-skills" id="relatedSkillsSection"> <h2 class="related-title" data-i18n="detail.relatedSkills">相关 Skills</h2> <div class="related-list" id="relatedSkillsList"> <div class="skeleton-card"></div> <div class="skeleton-card"></div> <div class="skeleton-card"></div> </div> </section> </aside> </div> </div> <script src="https://unpkg.com/i18next@23.11.5/i18next.min.js" defer></script> <script src="https://unpkg.com/i18next-browser-languagedetector@7.2.1/i18nextBrowserLanguageDetector.min.js" defer></script> <script defer> // Language resources - same pattern as index page const resources = { 'zh-CN': null, 'en': null, 'ja': null, 'ko': null, 'zh-TW': null, 'es': null, 'fr': null }; // Load language files (only current + fallback for performance) async function loadLanguageResources() { const savedLang = localStorage.getItem('i18nextLng') || 'en'; const langsToLoad = new Set([savedLang, 'en']); // current + fallback await Promise.all([...langsToLoad].map(async (lang) => { try { const response = await fetch(`/locales/${lang}.json`); if (response.ok) { resources[lang] = { translation: await response.json() }; } } catch (error) { console.warn(`Failed to load ${lang} language file:`, error); } })); } // Load a single language on demand (for language switching) async function loadLanguage(lang) { if (resources[lang]) return; try { const response = await fetch(`/locales/${lang}.json`); if (response.ok) { resources[lang] = { translation: await response.json() }; i18next.addResourceBundle(lang, 'translation', resources[lang].translation); } } catch (error) { console.warn(`Failed to load ${lang} language file:`, error); } } // Initialize i18next async function initI18n() { try { await loadLanguageResources(); // Filter out null values from resources const validResources = {}; for (const [lang, data] of Object.entries(resources)) { if (data !== null) { validResources[lang] = data; } } console.log('Loaded languages:', Object.keys(validResources)); console.log('zh-CN resource:', validResources['zh-CN']); console.log('detail.home in resource:', validResources['zh-CN']?.translation?.detail?.home); // 检查是否有保存的语言偏好 const savedLang = localStorage.getItem('i18nextLng'); // 如果没有保存的语言偏好,默认使用英文 const defaultLang = savedLang && ['zh-CN', 'en', 'ja', 'ko', 'zh-TW', 'es', 'fr'].includes(savedLang) ? savedLang : 'en'; await i18next .use(i18nextBrowserLanguageDetector) .init({ lng: defaultLang, // 强制设置初始语言 fallbackLng: 'en', supportedLngs: ['zh-CN', 'en', 'ja', 'ko', 'zh-TW', 'es', 'fr'], resources: validResources, detection: { order: ['localStorage'], // 只使用 localStorage,不检测浏览器语言 caches: ['localStorage'], lookupLocalStorage: 'i18nextLng' }, interpolation: { escapeValue: false } }); console.log('i18next initialized, language:', i18next.language); console.log('Test translation:', i18next.t('detail.home')); // Set initial language in selector const langSwitcher = document.getElementById('langSwitcher'); langSwitcher.value = i18next.language; // Update page language updatePageLanguage(); // Language switch event langSwitcher.addEventListener('change', async (e) => { await loadLanguage(e.target.value); // load on demand i18next.changeLanguage(e.target.value).then(() => { updatePageLanguage(); localStorage.setItem('i18nextLng', e.target.value); }); }); } catch (error) { console.error('i18next init failed:', error); } } // Translation helper function t(key, options = {}) { return i18next.t(key, options); } // Update all translatable elements function updatePageLanguage() { // Update HTML lang attribute document.documentElement.lang = i18next.language; // Update elements with data-i18n attribute document.querySelectorAll('[data-i18n]').forEach(el => { const key = el.getAttribute('data-i18n'); el.textContent = t(key); }); } // Copy command function function copyCommand() { const command = document.getElementById('installCommand').textContent; const btn = document.getElementById('copyBtn'); navigator.clipboard.writeText(command).then(() => { btn.textContent = t('copied'); btn.classList.add('copied'); setTimeout(() => { btn.textContent = t('copy'); btn.classList.remove('copied'); }, 2000); }).catch(() => { // Fallback for non-HTTPS const textArea = document.createElement('textarea'); textArea.value = command; textArea.style.position = 'fixed'; textArea.style.left = '-9999px'; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); btn.textContent = t('copied'); btn.classList.add('copied'); setTimeout(() => { btn.textContent = t('copy'); btn.classList.remove('copied'); }, 2000); }); } // Initialize document.getElementById('copyBtn').addEventListener('click', copyCommand); initI18n(); // 异步加载相关 Skills async function loadRelatedSkills() { const owner = 'wyattowalsh'; const skillName = 'orchestrator'; const currentLang = 'es'; const listContainer = document.getElementById('relatedSkillsList'); const section = document.getElementById('relatedSkillsSection'); try { const response = await fetch(`/api/related-skills/${encodeURIComponent(owner)}/${encodeURIComponent(skillName)}?limit=6`); if (!response.ok) { throw new Error('Failed to load'); } const data = await response.json(); const relatedSkills = data.related_skills || []; if (relatedSkills.length === 0) { // 没有相关推荐时隐藏整个区域 section.style.display = 'none'; return; } // 渲染相关 Skills listContainer.innerHTML = relatedSkills.map(skill => { const desc = skill.description || ''; const truncatedDesc = desc.length > 60 ? desc.substring(0, 60) + '...' : desc; return ` <a href="${currentLang === 'en' ? '' : '/' + currentLang}/skill/${skill.owner}/${skill.repo}/${skill.skill_name}" class="related-card"> <div class="related-name">${escapeHtml(skill.skill_name)}</div> <div class="related-meta"> <span class="related-owner">${escapeHtml(skill.owner)}</span> <span class="related-installs">${skill.installs}</span> </div> <div class="related-desc">${escapeHtml(truncatedDesc)}</div> </a> `; }).join(''); } catch (error) { console.error('Failed to load related skills:', error); // 加载失败时显示提示或隐藏 listContainer.innerHTML = '<div class="related-empty">暂无相关推荐</div>'; } } // HTML 转义 function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; } // 页面加载完成后异步加载相关 Skills if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', loadRelatedSkills); } else { loadRelatedSkills(); } </script> </body> </html>