Migrate os-orchestration plugin from cc-plugins into cc-os
Renamed orchestration -> os-orchestration per naming convention, kept the plugin's permissive delegation rule as the canonical global default, and dropped cc-os's stricter local override so this repo behaves like every other project (ADR-019). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
f138c8d98b
commit
cebcc1b649
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"name": "os-orchestration",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Session orchestration rules (delegation threshold, explicit model routing on Agent spawns) injected at session start and after compaction."
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Session orchestration
|
||||||
|
|
||||||
|
- Do single-file, ≤2-tool-call ops directly. Don't delegate them. Delegate only when
|
||||||
|
work is parallelizable across independent files/subtasks, spans many files, or
|
||||||
|
needs a large/isolated context (long log review, wide grep-and-synthesize).
|
||||||
|
- Every `Agent` spawn passes `model` explicitly. Default `haiku` for mechanical
|
||||||
|
file-edit/shell work; `sonnet` for anything requiring judgment; `opus` only for
|
||||||
|
genuinely hard reasoning.
|
||||||
|
- A short orienting Read before delegating is fine when the target file/path is
|
||||||
|
uncertain. Don't delegate the orienting step itself.
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"SessionStart": [
|
||||||
|
{
|
||||||
|
"matcher": "startup|resume|clear|compact",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/inject.py",
|
||||||
|
"timeout": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""SessionStart hook: inject ORCHESTRATION.md as additionalContext.
|
||||||
|
|
||||||
|
Fires on startup/resume/clear, and on 'compact' (matcher includes it) so the
|
||||||
|
rules survive a context-compaction pass, not just the first turn.
|
||||||
|
"""
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
PLUGIN_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
ORCHESTRATION_FILE = os.path.join(PLUGIN_ROOT, "ORCHESTRATION.md")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
with open(ORCHESTRATION_FILE) as f:
|
||||||
|
context = f.read()
|
||||||
|
except OSError:
|
||||||
|
return
|
||||||
|
|
||||||
|
print(json.dumps({
|
||||||
|
"hookSpecificOutput": {
|
||||||
|
"hookEventName": "SessionStart",
|
||||||
|
"additionalContext": context,
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
Loading…
Reference in New Issue