agent-orchestrator-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: agent-orchestration
3
+ description: >
4
+ Spec-driven AI agent pipeline orchestration built on OpenSpec. Load when deciding which
5
+ role/command to use, how to handoff between phases, which model to pick, or when a session
6
+ should stop and a new one start. Commands: /opsx:explore, /opsx:propose, /opsx:review,
7
+ /opsx:apply, /opsx:archive.
8
+ disable-model-invocation: false
9
+ allowed-tools: Bash, Read
10
+ ---
11
+
12
+ # Agent Orchestration
13
+
14
+ Spec-driven 5-role pipeline. Each role runs in a separate session. Mixing roles in one chat
15
+ is the primary source of wasted tokens and failed implementations.
16
+
17
+ ## Pipeline
18
+
19
+ ```
20
+ explore → propose → review → apply → verify → archive
21
+ ```
22
+
23
+ Read `.agents/orchestrator.yaml` for project-specific config (language, flags, MCP).
24
+
25
+ ## Roles & Commands
26
+
27
+ | Role | Command | Mode | Model hint | Allowed output |
28
+ |------|---------|------|------------|----------------|
29
+ | Explorer | `/opsx:explore` | read-only | fast | chat only |
30
+ | Architect | `/opsx:propose <name>` | specs-only | strong | `openspec/changes/` |
31
+ | Spec Reviewer | `/opsx:review <name>` | read-only | medium | Approve / Request Changes |
32
+ | Implementer | `/opsx:apply <name>` | code | strong | `src/`, `tasks.md [x]` |
33
+ | Verifier | CI scripts | — | — | exit codes |
34
+
35
+ ## Handoff Protocol
36
+
37
+ ### explore → propose
38
+ Exit Explorer when:
39
+ - Problem is stated in 3–5 sentences
40
+ - 2–3 solution options surfaced with a recommendation
41
+ - kebab-case change name chosen
42
+ - Non-goals listed
43
+
44
+ Start Architect with:
45
+ ```
46
+ /opsx:propose <name>
47
+
48
+ Context from explore:
49
+ - Problem: ...
50
+ - Approach: ...
51
+ - Non-goals: ...
52
+ - Draft acceptance: ...
53
+ ```
54
+
55
+ ### propose → review
56
+ Exit Architect when:
57
+ ```bash
58
+ openspec validate <name> --strict --type change # must pass ✓
59
+ openspec status --change "<name>" # applyRequires artifacts all done
60
+ ```
61
+
62
+ ### review → apply
63
+ Exit Reviewer only when verdict is explicit **APPROVE ✓**.
64
+ If Request Changes — fix artifacts, re-run `/opsx:review`.
65
+
66
+ ### apply → verify
67
+ Exit Implementer when:
68
+ - All `tasks.md` boxes `[x]`
69
+ - `npm run build` (or project build cmd) exits 0
70
+ - `npm run lint` exits 0
71
+ - Commit ready
72
+
73
+ ### verify → archive
74
+ After PR merged + CI green:
75
+ ```
76
+ /opsx:archive <name>
77
+ ```
78
+
79
+ ## Session Rules
80
+
81
+ **Start of each session:**
82
+ 1. Announce role: "Starting Spec Reviewer session for change: <name>"
83
+ 2. Check `openspec list` — confirm max 1 active change
84
+ 3. Read `orchestrator.yaml` for project config
85
+
86
+ **During session:**
87
+ - Stay in role — do not drift into next phase
88
+ - Pause and ask if requirements are unclear
89
+ - Never edit files outside your role's allowed output
90
+
91
+ **End of each session:**
92
+ - Show progress summary
93
+ - State explicit next step and next role
94
+ - If apply: confirm build/lint status
95
+
96
+ ## Model Selection Guide
97
+
98
+ | Phase | Use case | Recommended |
99
+ |-------|----------|-------------|
100
+ | explore | Q&A, brainstorm | fast (rush/flash) |
101
+ | propose | Architecture decisions | strong (opus/sonnet) |
102
+ | review | Artifact analysis | medium or strong |
103
+ | apply complex | Multi-file refactor | strong |
104
+ | apply simple | 1–2 file change | medium or fast |
105
+ | fix lint | Mechanical | fast |
106
+
107
+ ## Memory MCP Entities
108
+
109
+ Store these between sessions (key → value):
110
+
111
+ | Key | Example value |
112
+ |-----|---------------|
113
+ | `Change:<name>` | `status: spec-approved, tasks: 3/7` |
114
+ | `Decision:<topic>` | `chosen: xlsx over csv, reason: ...` |
115
+ | `Convention:<area>` | `api errors: use ApiError class` |
116
+ | `Handoff:<name>` | `next_role: implementer, session_count: 2` |
117
+
118
+ At start of new session: read relevant entities to restore context without re-explanation.
119
+
120
+ ## Orchestration Checklist (per change)
121
+
122
+ - [ ] explore session closed before propose started
123
+ - [ ] `openspec validate --strict` passed before review
124
+ - [ ] explicit **Approve** received before apply
125
+ - [ ] all tasks `[x]` + build OK before PR
126
+ - [ ] `/opsx:archive` run after merge
127
+
128
+ ## Anti-patterns
129
+
130
+ | Anti-pattern | Impact |
131
+ |-------------|--------|
132
+ | Explore + propose in one chat | Architect has stale exploration context |
133
+ | Apply without review | ~60% chance of rework |
134
+ | All tasks in one apply session | Context overload; model drifts |
135
+ | No archive after merge | Next propose has stale domain specs |
136
+ | Strong model on lint fixes | 5–10x cost with no quality gain |
137
+ | Skip Memory MCP | Every session re-explains domain |
138
+
139
+ ## Metrics (health check per change)
140
+
141
+ - Sessions: 4–8 (not 1 marathon, not 20 micro-sessions)
142
+ - Apply iterations to PR: ≤ 2
143
+ - Spec review loops: ≤ 1
144
+ - Tasks rework: ≤ 10%
145
+
146
+ If apply iterations > 2 → problem is in Architect or Reviewer, not Implementer.
@@ -0,0 +1,81 @@
1
+ # Agent Orchestration — {{PROJECT_NAME}}
2
+
3
+ > Powered by [agent-orchestrator-kit](https://github.com/makshc2/agent-orchestrator-kit) v{{KIT_VERSION}}
4
+
5
+ This project uses a **spec-driven, role-separated AI pipeline** built on [OpenSpec](https://github.com/fission-ai/openspec).
6
+ Every feature follows the same cycle regardless of stack or IDE.
7
+
8
+ ## Pipeline
9
+
10
+ ```
11
+ explore → propose → review → apply → verify → archive
12
+ ```
13
+
14
+ Each phase runs in a **separate agent session** with a dedicated role, model hint, and permissions.
15
+ Never mix phases in one chat — this is the single most important rule.
16
+
17
+ ## Roles
18
+
19
+ | Role | Command | Mode | Model hint |
20
+ |------|---------|------|------------|
21
+ | Explorer | `/opsx:explore` | read-only | fast |
22
+ | Architect | `/opsx:propose <name>` | writes `openspec/changes/` only | strong |
23
+ | Spec Reviewer | `/opsx:review <name>` | read-only | medium/strong |
24
+ | Implementer | `/opsx:apply <name>` | writes `src/` | strong |
25
+ | Verifier | CI (automatic) | scripts only | — |
26
+
27
+ ## Hard Rules
28
+
29
+ - **One active change per developer** at a time.
30
+ - **No apply without spec-review approval** (explicit Approve in chat).
31
+ - **No code edits** during explore or spec-review sessions.
32
+ - **Archive after every merge** (`/opsx:archive`).
33
+ - **Always run local build/lint** before opening a PR.
34
+
35
+ ## Handoff Gates
36
+
37
+ | Transition | Gate |
38
+ |------------|------|
39
+ | explore → propose | Decision brief written; change name chosen |
40
+ | propose → review | `openspec validate --strict` passes ✓ |
41
+ | review → apply | Reviewer writes explicit **Approve** |
42
+ | apply → verify | All `tasks.md` checkboxes `[x]`; local build OK |
43
+ | verify → archive | CI green; PR merged |
44
+
45
+ ## Context to Pin per Role
46
+
47
+ | Role | Attach (`@`) |
48
+ |------|-------------|
49
+ | Explorer | `@openspec/specs/` + relevant `@src/` subtree |
50
+ | Architect | `@openspec/config.yaml` + explore brief |
51
+ | Reviewer | entire `@openspec/changes/<name>/` |
52
+ | Implementer | `@openspec/changes/<name>/tasks.md` |
53
+
54
+ ## Configuration
55
+
56
+ See `.agents/orchestrator.yaml` for role config, pipeline flags, and MCP baseline.
57
+
58
+ ## Skills & Commands
59
+
60
+ All skills live in `.agents/skills/` (committed to git).
61
+ Local IDE sync: run `./scripts/sync-local-agent-skills.sh`.
62
+
63
+ | Skill | When |
64
+ |-------|------|
65
+ | `agent-orchestration` | Pipeline decisions, role selection, handoff |
66
+ | `openspec-howto` | OpenSpec CLI, cycle, naming |
67
+ | `openspec-propose` | Creating change artifacts |
68
+ | `openspec-apply-change` | Implementing tasks |
69
+ | `openspec-archive-change` | Archiving after merge |
70
+
71
+ ## Metrics (track per change)
72
+
73
+ | Metric | Target |
74
+ |--------|--------|
75
+ | Sessions per change | 4–8 |
76
+ | Apply iterations to PR | ≤ 2 |
77
+ | Spec review loops | ≤ 1 |
78
+ | Tasks rework after apply | ≤ 10% |
79
+ | CI fails on PR | ≤ 1 |
80
+
81
+ If apply iterations > 2 — fix in Architect/Reviewer, not Implementer.
@@ -0,0 +1,49 @@
1
+ # {{PROJECT_NAME}} — Claude Code Context
2
+
3
+ > agent-orchestrator-kit v{{KIT_VERSION}} | Spec-driven pipeline with OpenSpec
4
+
5
+ ## Project
6
+
7
+ See `AGENTS.md` for the full orchestration pipeline, roles, and hard rules.
8
+ See `openspec/config.yaml` for stack context and agent language.
9
+
10
+ ## Skills
11
+
12
+ Project skills live in `.claude/skills/` (synced from `.agents/skills/`).
13
+ Use `/skill-name` or let Claude auto-load based on context.
14
+
15
+ | Skill | Command | When |
16
+ |-------|---------|------|
17
+ | Agent Orchestration | `/agent-orchestration` | Role selection, pipeline, handoff decisions |
18
+ | OpenSpec Howto | `/openspec-howto` | CLI, cycle, naming |
19
+ | OpenSpec Propose | `/openspec-propose` | Creating change artifacts |
20
+ | OpenSpec Apply | `/openspec-apply-change` | Implementing tasks |
21
+ | OpenSpec Archive | `/openspec-archive-change` | Archiving after merge |
22
+
23
+ ## Pipeline Commands
24
+
25
+ ```
26
+ /opsx:explore — think through ideas (read-only, no code)
27
+ /opsx:propose — create change artifacts
28
+ /opsx:review — spec review (read-only, no code)
29
+ /opsx:apply — implement tasks
30
+ /opsx:archive — archive after merge
31
+ ```
32
+
33
+ ## Key Rules for This Session
34
+
35
+ - Check `.agents/orchestrator.yaml` for project-specific pipeline config.
36
+ - One active change at a time — run `openspec list` to confirm.
37
+ - No code edits in explore or review mode.
38
+ - After completing apply: run build/lint before declaring done.
39
+ - Use `openspec validate --all --strict` to verify change artifacts.
40
+
41
+ ## File Locations
42
+
43
+ | What | Where |
44
+ |------|-------|
45
+ | Active changes | `openspec/changes/` |
46
+ | Specs (source of truth) | `openspec/specs/` |
47
+ | Project config | `openspec/config.yaml` |
48
+ | Orchestration config | `.agents/orchestrator.yaml` |
49
+ | Skills | `.claude/skills/` |
@@ -0,0 +1,57 @@
1
+ version: 1
2
+ kit_version: "{{KIT_VERSION}}"
3
+
4
+ project:
5
+ name: "{{PROJECT_NAME}}"
6
+ agent_language: "{{LANG}}"
7
+
8
+ pipeline:
9
+ require_spec_review: true
10
+ max_active_changes: 1
11
+ archive_after_merge: true
12
+
13
+ roles:
14
+ explorer:
15
+ command: /opsx:explore
16
+ mode: read-only
17
+ model_hint: fast
18
+ architect:
19
+ command: /opsx:propose
20
+ mode: specs-only
21
+ model_hint: strong
22
+ spec_reviewer:
23
+ command: /opsx:review
24
+ mode: read-only
25
+ model_hint: medium
26
+ implementer:
27
+ command: /opsx:apply
28
+ mode: code
29
+ model_hint: strong
30
+ verifier:
31
+ type: ci
32
+ gates:
33
+ - openspec-validate-strict
34
+ - lint
35
+ - build
36
+
37
+ handoff:
38
+ explore_to_propose: decision_brief
39
+ propose_to_review: validate_strict
40
+ review_to_apply: explicit_approve
41
+ apply_to_verify: all_tasks_checked
42
+
43
+ memory:
44
+ enabled: true
45
+ file: .cursor/memory.json
46
+
47
+ mcp:
48
+ baseline:
49
+ - memory
50
+ optional:
51
+ - github
52
+ - browser
53
+
54
+ verifier:
55
+ lint_command: "npm run lint"
56
+ build_command: "npm run build"
57
+ test_command: ""
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env sh
2
+ # sync-local-agent-skills.sh
3
+ # Syncs .agents/ (committed) to local IDE directories (not committed)
4
+ # Run after: init, update, adding new skills
5
+ # Works with: Cursor, Claude Code, Amp Code (via VS Code settings)
6
+
7
+ set -eu
8
+ ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)"
9
+ cd "$ROOT"
10
+
11
+ GREEN='\033[0;32m'
12
+ YELLOW='\033[1;33m'
13
+ CYAN='\033[0;36m'
14
+ RESET='\033[0m'
15
+
16
+ ok() { printf "${GREEN} ✓${RESET} %s\n" "$1"; }
17
+ info() { printf "${CYAN} →${RESET} %s\n" "$1"; }
18
+ warn() { printf "${YELLOW} !${RESET} %s\n" "$1"; }
19
+
20
+ echo ""
21
+ echo "sync-local-agent-skills"
22
+ echo "-----------------------"
23
+
24
+ # ── Cursor ─────────────────────────────────────────────────────────────
25
+ echo ""
26
+ info "Syncing → .cursor/ (Cursor)"
27
+ mkdir -p .cursor/skills .cursor/rules
28
+
29
+ rsync -a --delete .agents/skills/ .cursor/skills/
30
+ ok ".cursor/skills/"
31
+
32
+ for rule in .agents/rules/*.mdc; do
33
+ [ -f "$rule" ] && cp "$rule" .cursor/rules/ && ok ".cursor/rules/$(basename "$rule")"
34
+ done
35
+
36
+ if [ ! -f .mcp.json ] && [ -f .agents/mcp.json.example ]; then
37
+ cp .agents/mcp.json.example .mcp.json
38
+ ok ".mcp.json created from example"
39
+ elif [ ! -f .mcp.json ]; then
40
+ warn ".mcp.json missing — create it manually (see README)"
41
+ fi
42
+
43
+ # ── Claude Code ────────────────────────────────────────────────────────
44
+ echo ""
45
+ info "Syncing → .claude/ (Claude Code)"
46
+ mkdir -p .claude/skills
47
+
48
+ rsync -a --delete .agents/skills/ .claude/skills/
49
+ ok ".claude/skills/"
50
+
51
+ if [ -f CLAUDE.md ]; then
52
+ cp CLAUDE.md .claude/CLAUDE.md
53
+ ok ".claude/CLAUDE.md"
54
+ fi
55
+
56
+ # ── Amp Code ───────────────────────────────────────────────────────────
57
+ echo ""
58
+ info "Amp Code reads .agents/ directly — no sync needed"
59
+ if [ ! -f .amp/settings.json ]; then
60
+ warn ".amp/settings.json missing — add Memory MCP manually (see README)"
61
+ warn " {\"amp.mcpServers\":{\"memory\":{\"command\":\"npx\",\"args\":[\"-y\",\"@modelcontextprotocol/server-memory\"],\"env\":{\"MEMORY_FILE_PATH\":\".cursor/memory.json\"}}}}"
62
+ fi
63
+
64
+ # ── .gitignore check ───────────────────────────────────────────────────
65
+ echo ""
66
+ info "Checking .gitignore"
67
+ GITIGNORE=".gitignore"
68
+ CHANGED=0
69
+
70
+ for line in ".cursor" ".cursor/memory.json" ".amp/settings.json" ".claude"; do
71
+ if ! grep -qF "$line" "$GITIGNORE" 2>/dev/null; then
72
+ echo "$line" >> "$GITIGNORE"
73
+ ok "Added '$line' to .gitignore"
74
+ CHANGED=1
75
+ fi
76
+ done
77
+
78
+ [ "$CHANGED" -eq 0 ] && ok ".gitignore OK"
79
+
80
+ echo ""
81
+ ok "Sync complete"
82
+ echo ""
83
+ printf " Committed to git: ${CYAN}.agents/${RESET} — skills, rules, commands\n"
84
+ printf " Local only: ${YELLOW}.cursor/ .claude/ .amp/${RESET} — IDE runtime\n"
85
+ echo ""