@cleocode/skills 2.0.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.
- package/dispatch-config.json +404 -0
- package/index.d.ts +178 -0
- package/index.js +405 -0
- package/package.json +14 -0
- package/profiles/core.json +7 -0
- package/profiles/full.json +10 -0
- package/profiles/minimal.json +7 -0
- package/profiles/recommended.json +7 -0
- package/provider-skills-map.json +97 -0
- package/skills/_shared/cleo-style-guide.md +84 -0
- package/skills/_shared/manifest-operations.md +810 -0
- package/skills/_shared/placeholders.json +433 -0
- package/skills/_shared/skill-chaining-patterns.md +237 -0
- package/skills/_shared/subagent-protocol-base.md +223 -0
- package/skills/_shared/task-system-integration.md +232 -0
- package/skills/_shared/testing-framework-config.md +110 -0
- package/skills/ct-cleo/SKILL.md +490 -0
- package/skills/ct-cleo/references/anti-patterns.md +19 -0
- package/skills/ct-cleo/references/loom-lifecycle.md +136 -0
- package/skills/ct-cleo/references/orchestrator-constraints.md +55 -0
- package/skills/ct-cleo/references/session-protocol.md +162 -0
- package/skills/ct-codebase-mapper/SKILL.md +82 -0
- package/skills/ct-contribution/SKILL.md +521 -0
- package/skills/ct-contribution/templates/contribution-init.json +21 -0
- package/skills/ct-dev-workflow/SKILL.md +423 -0
- package/skills/ct-docs-lookup/SKILL.md +66 -0
- package/skills/ct-docs-review/SKILL.md +175 -0
- package/skills/ct-docs-write/SKILL.md +108 -0
- package/skills/ct-documentor/SKILL.md +231 -0
- package/skills/ct-epic-architect/SKILL.md +305 -0
- package/skills/ct-epic-architect/references/bug-epic-example.md +172 -0
- package/skills/ct-epic-architect/references/commands.md +201 -0
- package/skills/ct-epic-architect/references/feature-epic-example.md +210 -0
- package/skills/ct-epic-architect/references/migration-epic-example.md +244 -0
- package/skills/ct-epic-architect/references/output-format.md +92 -0
- package/skills/ct-epic-architect/references/patterns.md +284 -0
- package/skills/ct-epic-architect/references/refactor-epic-example.md +412 -0
- package/skills/ct-epic-architect/references/research-epic-example.md +226 -0
- package/skills/ct-epic-architect/references/shell-escaping.md +86 -0
- package/skills/ct-epic-architect/references/skill-aware-execution.md +195 -0
- package/skills/ct-grade/SKILL.md +230 -0
- package/skills/ct-grade/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade/agents/blind-comparator.md +157 -0
- package/skills/ct-grade/agents/scenario-runner.md +134 -0
- package/skills/ct-grade/eval-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade/eval-viewer/generate_grade_review.py +1138 -0
- package/skills/ct-grade/eval-viewer/generate_grade_viewer.py +544 -0
- package/skills/ct-grade/eval-viewer/generate_review.py +283 -0
- package/skills/ct-grade/eval-viewer/grade-review.html +1574 -0
- package/skills/ct-grade/eval-viewer/viewer.html +219 -0
- package/skills/ct-grade/evals/evals.json +94 -0
- package/skills/ct-grade/references/ab-test-methodology.md +150 -0
- package/skills/ct-grade/references/domains.md +137 -0
- package/skills/ct-grade/references/grade-spec.md +236 -0
- package/skills/ct-grade/references/scenario-playbook.md +234 -0
- package/skills/ct-grade/references/token-tracking.md +120 -0
- package/skills/ct-grade/scripts/__pycache__/audit_analyzer.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_ab_test.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/run_all.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/__pycache__/token_tracker.cpython-314.pyc +0 -0
- package/skills/ct-grade/scripts/audit_analyzer.py +279 -0
- package/skills/ct-grade/scripts/generate_report.py +283 -0
- package/skills/ct-grade/scripts/run_ab_test.py +504 -0
- package/skills/ct-grade/scripts/run_all.py +287 -0
- package/skills/ct-grade/scripts/setup_run.py +183 -0
- package/skills/ct-grade/scripts/token_tracker.py +630 -0
- package/skills/ct-grade-v2-1/SKILL.md +237 -0
- package/skills/ct-grade-v2-1/agents/analysis-reporter.md +203 -0
- package/skills/ct-grade-v2-1/agents/blind-comparator.md +157 -0
- package/skills/ct-grade-v2-1/agents/scenario-runner.md +179 -0
- package/skills/ct-grade-v2-1/evals/evals.json +74 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/build_op_stats.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/__pycache__/generate_grade_review.cpython-314.pyc +0 -0
- package/skills/ct-grade-v2-1/grade-viewer/build_op_stats.py +174 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-analysis.json +41 -0
- package/skills/ct-grade-v2-1/grade-viewer/eval-report.md +34 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_review.py +1023 -0
- package/skills/ct-grade-v2-1/grade-viewer/generate_grade_viewer.py +548 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review-eval.html +613 -0
- package/skills/ct-grade-v2-1/grade-viewer/grade-review.html +1532 -0
- package/skills/ct-grade-v2-1/grade-viewer/viewer.html +620 -0
- package/skills/ct-grade-v2-1/manifest-entry.json +31 -0
- package/skills/ct-grade-v2-1/references/ab-testing.md +233 -0
- package/skills/ct-grade-v2-1/references/domains-ssot.md +156 -0
- package/skills/ct-grade-v2-1/references/grade-spec-v2.md +167 -0
- package/skills/ct-grade-v2-1/references/playbook-v2.md +393 -0
- package/skills/ct-grade-v2-1/references/token-tracking.md +202 -0
- package/skills/ct-grade-v2-1/scripts/generate_report.py +419 -0
- package/skills/ct-grade-v2-1/scripts/run_ab_test.py +493 -0
- package/skills/ct-grade-v2-1/scripts/run_scenario.py +396 -0
- package/skills/ct-grade-v2-1/scripts/setup_run.py +207 -0
- package/skills/ct-grade-v2-1/scripts/token_tracker.py +175 -0
- package/skills/ct-memory/SKILL.md +84 -0
- package/skills/ct-orchestrator/INSTALL.md +61 -0
- package/skills/ct-orchestrator/README.md +69 -0
- package/skills/ct-orchestrator/SKILL.md +380 -0
- package/skills/ct-orchestrator/manifest-entry.json +19 -0
- package/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/skills/ct-orchestrator/references/SUBAGENT-PROTOCOL-BLOCK.md +66 -0
- package/skills/ct-orchestrator/references/autonomous-operation.md +167 -0
- package/skills/ct-orchestrator/references/lifecycle-gates.md +98 -0
- package/skills/ct-orchestrator/references/orchestrator-compliance.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-handoffs.md +85 -0
- package/skills/ct-orchestrator/references/orchestrator-patterns.md +164 -0
- package/skills/ct-orchestrator/references/orchestrator-recovery.md +113 -0
- package/skills/ct-orchestrator/references/orchestrator-spawning.md +271 -0
- package/skills/ct-orchestrator/references/orchestrator-tokens.md +180 -0
- package/skills/ct-research-agent/SKILL.md +226 -0
- package/skills/ct-skill-creator/.cleo/.context-state.json +13 -0
- package/skills/ct-skill-creator/.cleo/logs/cleo.2026-03-07.1.log +24 -0
- package/skills/ct-skill-creator/.cleo/tasks.db +0 -0
- package/skills/ct-skill-creator/SKILL.md +356 -0
- package/skills/ct-skill-creator/agents/analyzer.md +276 -0
- package/skills/ct-skill-creator/agents/comparator.md +204 -0
- package/skills/ct-skill-creator/agents/grader.md +225 -0
- package/skills/ct-skill-creator/assets/eval_review.html +146 -0
- package/skills/ct-skill-creator/eval-viewer/__pycache__/generate_review.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/ct-skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/ct-skill-creator/manifest-entry.json +17 -0
- package/skills/ct-skill-creator/references/dynamic-context.md +228 -0
- package/skills/ct-skill-creator/references/frontmatter.md +83 -0
- package/skills/ct-skill-creator/references/invocation-control.md +165 -0
- package/skills/ct-skill-creator/references/output-patterns.md +86 -0
- package/skills/ct-skill-creator/references/provider-deployment.md +175 -0
- package/skills/ct-skill-creator/references/schemas.md +430 -0
- package/skills/ct-skill-creator/references/workflows.md +28 -0
- package/skills/ct-skill-creator/scripts/__init__.py +1 -0
- package/skills/ct-skill-creator/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/aggregate_benchmark.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/generate_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/improve_description.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/init_skill.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_eval.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/run_loop.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/__pycache__/utils.cpython-314.pyc +0 -0
- package/skills/ct-skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/ct-skill-creator/scripts/generate_report.py +326 -0
- package/skills/ct-skill-creator/scripts/improve_description.py +247 -0
- package/skills/ct-skill-creator/scripts/init_skill.py +306 -0
- package/skills/ct-skill-creator/scripts/package_skill.py +110 -0
- package/skills/ct-skill-creator/scripts/quick_validate.py +97 -0
- package/skills/ct-skill-creator/scripts/run_eval.py +310 -0
- package/skills/ct-skill-creator/scripts/run_loop.py +328 -0
- package/skills/ct-skill-creator/scripts/utils.py +47 -0
- package/skills/ct-skill-validator/SKILL.md +178 -0
- package/skills/ct-skill-validator/agents/ecosystem-checker.md +151 -0
- package/skills/ct-skill-validator/assets/valid-skill-example.md +13 -0
- package/skills/ct-skill-validator/evals/eval_set.json +14 -0
- package/skills/ct-skill-validator/evals/evals.json +52 -0
- package/skills/ct-skill-validator/manifest-entry.json +20 -0
- package/skills/ct-skill-validator/references/cleo-ecosystem-rules.md +163 -0
- package/skills/ct-skill-validator/references/validation-rules.md +168 -0
- package/skills/ct-skill-validator/scripts/__init__.py +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/audit_body.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/check_ecosystem.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/generate_validation_report.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/__pycache__/validate.cpython-314.pyc +0 -0
- package/skills/ct-skill-validator/scripts/audit_body.py +242 -0
- package/skills/ct-skill-validator/scripts/check_ecosystem.py +169 -0
- package/skills/ct-skill-validator/scripts/check_manifest.py +172 -0
- package/skills/ct-skill-validator/scripts/generate_validation_report.py +442 -0
- package/skills/ct-skill-validator/scripts/validate.py +422 -0
- package/skills/ct-spec-writer/SKILL.md +189 -0
- package/skills/ct-stickynote/README.md +14 -0
- package/skills/ct-stickynote/SKILL.md +46 -0
- package/skills/ct-task-executor/SKILL.md +296 -0
- package/skills/ct-validator/SKILL.md +216 -0
- package/skills/manifest.json +469 -0
- package/skills.json +281 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
token_tracker.py — Aggregate token usage stats from a completed A/B run.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python token_tracker.py --run-dir ./ab_results/run-001
|
|
7
|
+
|
|
8
|
+
Reads all timing.json files in the run directory and produces token-summary.json
|
|
9
|
+
with per-arm statistics.
|
|
10
|
+
|
|
11
|
+
Output: <run-dir>/token-summary.json
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import argparse
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
import math
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def find_timing_files(run_dir):
|
|
23
|
+
"""Find all timing.json files under run_dir."""
|
|
24
|
+
return list(Path(run_dir).rglob("timing.json"))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def load_timing(path):
|
|
28
|
+
try:
|
|
29
|
+
with open(path) as f:
|
|
30
|
+
return json.load(f)
|
|
31
|
+
except Exception as e:
|
|
32
|
+
print(f" WARN: Could not read {path}: {e}", file=sys.stderr)
|
|
33
|
+
return None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def mean(values):
|
|
37
|
+
return sum(values) / len(values) if values else 0
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def stddev(values):
|
|
41
|
+
if len(values) < 2:
|
|
42
|
+
return 0
|
|
43
|
+
m = mean(values)
|
|
44
|
+
return math.sqrt(sum((x - m) ** 2 for x in values) / (len(values) - 1))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def stats(values):
|
|
48
|
+
if not values:
|
|
49
|
+
return {"mean": None, "stddev": None, "min": None, "max": None, "count": 0}
|
|
50
|
+
return {
|
|
51
|
+
"mean": round(mean(values), 1),
|
|
52
|
+
"stddev": round(stddev(values), 1),
|
|
53
|
+
"min": min(values),
|
|
54
|
+
"max": max(values),
|
|
55
|
+
"count": len(values),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def main():
|
|
60
|
+
parser = argparse.ArgumentParser(description="Aggregate token stats from ct-grade A/B run")
|
|
61
|
+
parser.add_argument("--run-dir", required=True)
|
|
62
|
+
parser.add_argument("--output", default=None, help="Output path (default: <run-dir>/token-summary.json)")
|
|
63
|
+
args = parser.parse_args()
|
|
64
|
+
|
|
65
|
+
run_dir = args.run_dir
|
|
66
|
+
if not os.path.isdir(run_dir):
|
|
67
|
+
print(f"ERROR: Run dir not found: {run_dir}", file=sys.stderr)
|
|
68
|
+
sys.exit(1)
|
|
69
|
+
|
|
70
|
+
timing_files = find_timing_files(run_dir)
|
|
71
|
+
if not timing_files:
|
|
72
|
+
print(f"ERROR: No timing.json files found in {run_dir}", file=sys.stderr)
|
|
73
|
+
sys.exit(1)
|
|
74
|
+
|
|
75
|
+
print(f"Found {len(timing_files)} timing.json files")
|
|
76
|
+
|
|
77
|
+
# Group by arm
|
|
78
|
+
by_arm = {}
|
|
79
|
+
by_interface = {}
|
|
80
|
+
missing_tokens = []
|
|
81
|
+
|
|
82
|
+
for tpath in timing_files:
|
|
83
|
+
data = load_timing(tpath)
|
|
84
|
+
if data is None:
|
|
85
|
+
continue
|
|
86
|
+
|
|
87
|
+
arm = data.get("arm", "unknown")
|
|
88
|
+
iface = data.get("interface", "unknown")
|
|
89
|
+
tokens = data.get("total_tokens")
|
|
90
|
+
duration = data.get("duration_ms")
|
|
91
|
+
|
|
92
|
+
if arm not in by_arm:
|
|
93
|
+
by_arm[arm] = {"tokens": [], "duration_ms": [], "interface": iface, "files": []}
|
|
94
|
+
if iface not in by_interface:
|
|
95
|
+
by_interface[iface] = {"tokens": [], "duration_ms": [], "files": []}
|
|
96
|
+
|
|
97
|
+
by_arm[arm]["files"].append(str(tpath))
|
|
98
|
+
|
|
99
|
+
if tokens is not None:
|
|
100
|
+
by_arm[arm]["tokens"].append(tokens)
|
|
101
|
+
by_interface[iface]["tokens"].append(tokens)
|
|
102
|
+
else:
|
|
103
|
+
missing_tokens.append(str(tpath))
|
|
104
|
+
|
|
105
|
+
if duration is not None:
|
|
106
|
+
by_arm[arm]["duration_ms"].append(duration)
|
|
107
|
+
by_interface[iface]["duration_ms"].append(duration)
|
|
108
|
+
|
|
109
|
+
# Build summary
|
|
110
|
+
arm_stats = {}
|
|
111
|
+
for arm, data in sorted(by_arm.items()):
|
|
112
|
+
arm_stats[arm] = {
|
|
113
|
+
"interface": data["interface"],
|
|
114
|
+
"file_count": len(data["files"]),
|
|
115
|
+
"total_tokens": stats(data["tokens"]),
|
|
116
|
+
"duration_ms": stats(data["duration_ms"]),
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
iface_stats = {}
|
|
120
|
+
for iface, data in sorted(by_interface.items()):
|
|
121
|
+
iface_stats[iface] = {
|
|
122
|
+
"file_count": len(data["files"]),
|
|
123
|
+
"total_tokens": stats(data["tokens"]),
|
|
124
|
+
"duration_ms": stats(data["duration_ms"]),
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
# Compute delta between arms (A vs B)
|
|
128
|
+
delta = {}
|
|
129
|
+
if "arm-A" in arm_stats and "arm-B" in arm_stats:
|
|
130
|
+
a_mean = arm_stats["arm-A"]["total_tokens"].get("mean") or 0
|
|
131
|
+
b_mean = arm_stats["arm-B"]["total_tokens"].get("mean") or 0
|
|
132
|
+
if b_mean > 0:
|
|
133
|
+
delta = {
|
|
134
|
+
"mean_tokens": round(a_mean - b_mean, 1),
|
|
135
|
+
"percent": f"{((a_mean - b_mean) / b_mean * 100):+.1f}%",
|
|
136
|
+
"note": f"Arm A uses {abs(a_mean - b_mean):.0f} {'more' if a_mean > b_mean else 'fewer'} tokens on average",
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
summary = {
|
|
140
|
+
"run_dir": os.path.abspath(run_dir),
|
|
141
|
+
"timing_files_found": len(timing_files),
|
|
142
|
+
"timing_files_missing_tokens": len(missing_tokens),
|
|
143
|
+
"by_arm": arm_stats,
|
|
144
|
+
"by_interface": iface_stats,
|
|
145
|
+
"delta_A_vs_B": delta,
|
|
146
|
+
"warnings": (
|
|
147
|
+
[f"MISSING total_tokens in {len(missing_tokens)} files — fill these from task notifications"]
|
|
148
|
+
if missing_tokens else []
|
|
149
|
+
),
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
output_path = args.output or os.path.join(run_dir, "token-summary.json")
|
|
153
|
+
with open(output_path, "w") as f:
|
|
154
|
+
json.dump(summary, f, indent=2)
|
|
155
|
+
|
|
156
|
+
# Print summary
|
|
157
|
+
print(f"\nToken Summary")
|
|
158
|
+
print(f"{'='*50}")
|
|
159
|
+
for arm, s in arm_stats.items():
|
|
160
|
+
t = s["total_tokens"]
|
|
161
|
+
if t["mean"] is not None:
|
|
162
|
+
print(f" {arm} ({s['interface']}): {t['mean']:.0f} tokens (±{t['stddev']:.0f}, n={t['count']})")
|
|
163
|
+
else:
|
|
164
|
+
print(f" {arm} ({s['interface']}): NO TOKEN DATA (fill timing.json from task notifications)")
|
|
165
|
+
if delta:
|
|
166
|
+
print(f"\n Delta (A-B): {delta['percent']} ({delta['mean_tokens']:+.0f} tokens)")
|
|
167
|
+
print(f" {delta['note']}")
|
|
168
|
+
if missing_tokens:
|
|
169
|
+
print(f"\n WARNING: {len(missing_tokens)} files missing total_tokens")
|
|
170
|
+
print(f" These must be filled from Claude Code task notification data.")
|
|
171
|
+
print(f"\nWritten: {output_path}")
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
if __name__ == "__main__":
|
|
175
|
+
main()
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ct-memory
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Brain memory protocol with progressive disclosure for anti-hallucination and context recall
|
|
5
|
+
triggers:
|
|
6
|
+
- memory
|
|
7
|
+
- brain
|
|
8
|
+
- recall
|
|
9
|
+
- remember
|
|
10
|
+
- anti-hallucination
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# ct-memory -- Brain Memory Protocol
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Ensures LLM agents never start conversations with amnesia. Provides structured memory access through CLEO's brain system using progressive disclosure.
|
|
18
|
+
|
|
19
|
+
## Tier 0: Session Start (ALWAYS run on first interaction)
|
|
20
|
+
|
|
21
|
+
1. The memory bridge (.cleo/memory-bridge.md) is already loaded via CLEO-INJECTION.md @-reference
|
|
22
|
+
2. If the bridge content feels stale (>2 hours old), refresh:
|
|
23
|
+
- `query memory brain.search {query: "session task decision", limit: 10}`
|
|
24
|
+
3. Check for anti-patterns to avoid:
|
|
25
|
+
- `query memory brain.search {query: "mistake error avoid warning", limit: 5}`
|
|
26
|
+
4. If results are relevant, fetch details:
|
|
27
|
+
- `query memory brain.fetch {ids: ["O-xxx", "O-yyy"]}`
|
|
28
|
+
|
|
29
|
+
## Tier 1: During Work (run when topic-relevant)
|
|
30
|
+
|
|
31
|
+
### Before Making Decisions
|
|
32
|
+
|
|
33
|
+
- `query memory brain.search {query: "decision ADR architecture", limit: 5}`
|
|
34
|
+
- Check if a similar decision was already made
|
|
35
|
+
|
|
36
|
+
### Before Repeating Work
|
|
37
|
+
|
|
38
|
+
- `query memory brain.search {query: "{current-topic}", limit: 10}`
|
|
39
|
+
- Avoid re-doing work that's already been completed
|
|
40
|
+
|
|
41
|
+
### After Completing Significant Work
|
|
42
|
+
|
|
43
|
+
- `mutate memory brain.observe {text: "Completed X using approach Y. Key learning: Z", title: "Work completion"}`
|
|
44
|
+
|
|
45
|
+
### Anti-Hallucination Protocol
|
|
46
|
+
|
|
47
|
+
Before stating facts about the codebase or project:
|
|
48
|
+
|
|
49
|
+
1. Search brain: `query memory brain.search {query: "{claim-topic}", limit: 5}`
|
|
50
|
+
2. If results exist, verify your claim matches stored knowledge
|
|
51
|
+
3. If no results, state your uncertainty clearly
|
|
52
|
+
|
|
53
|
+
## Tier 2: Deep Recall (run when specifically needed)
|
|
54
|
+
|
|
55
|
+
### Full Timeline
|
|
56
|
+
|
|
57
|
+
- `query memory brain.timeline {anchor: "O-xxx", depthBefore: 5, depthAfter: 5}`
|
|
58
|
+
- Understand chronological context around a specific observation
|
|
59
|
+
|
|
60
|
+
### Cross-Project Knowledge (via NEXUS)
|
|
61
|
+
|
|
62
|
+
- `query nexus search {query: "pattern", scope: "global"}`
|
|
63
|
+
- Search across all CLEO-managed projects
|
|
64
|
+
|
|
65
|
+
## MCP Resources (Alternative to search)
|
|
66
|
+
|
|
67
|
+
For providers that support MCP resources:
|
|
68
|
+
|
|
69
|
+
- `ReadResource("cleo://memory/recent")` -- last 15 observations
|
|
70
|
+
- `ReadResource("cleo://memory/learnings")` -- active learnings with confidence
|
|
71
|
+
- `ReadResource("cleo://memory/patterns")` -- patterns to follow/avoid
|
|
72
|
+
- `ReadResource("cleo://memory/handoff")` -- last session handoff
|
|
73
|
+
|
|
74
|
+
## Token Budget Guidelines
|
|
75
|
+
|
|
76
|
+
| Operation | ~Tokens | When |
|
|
77
|
+
|-----------|---------|------|
|
|
78
|
+
| memory-bridge.md (auto-loaded) | 200-400 | Always (free) |
|
|
79
|
+
| brain.search | 50/hit | Discovery |
|
|
80
|
+
| brain.fetch | 500/entry | Details |
|
|
81
|
+
| brain.timeline | 200-500 | Context |
|
|
82
|
+
| MCP resources | 200-500 | On-demand |
|
|
83
|
+
|
|
84
|
+
Stay within LAFS MVI budget: start minimal, escalate only when needed.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Installing the Orchestrator Skill
|
|
2
|
+
|
|
3
|
+
## For Claude Code Plugin Projects
|
|
4
|
+
|
|
5
|
+
1. Copy `skills/ct-orchestrator/` directory to your project's skills directory
|
|
6
|
+
2. Skill will be auto-discovered by Claude Code plugin system
|
|
7
|
+
3. Invoke via `/ct-orchestrator` command or Skill tool
|
|
8
|
+
|
|
9
|
+
## Manual Invocation
|
|
10
|
+
|
|
11
|
+
Use the Skill tool directly:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Skill: ct-orchestrator
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or natural language triggers:
|
|
18
|
+
- "activate orchestrator mode"
|
|
19
|
+
- "run as orchestrator"
|
|
20
|
+
- "orchestrate this workflow"
|
|
21
|
+
- "delegate to subagents"
|
|
22
|
+
|
|
23
|
+
## Verification
|
|
24
|
+
|
|
25
|
+
After activation, you should see the Orchestrator Protocol constraints loaded.
|
|
26
|
+
Test by asking Claude to explain ORC-001 through ORC-005:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
What are the ORC constraints for orchestrator mode?
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Expected response should include:
|
|
33
|
+
- ORC-001: Stay high-level
|
|
34
|
+
- ORC-002: Delegate ALL work
|
|
35
|
+
- ORC-003: No full file reads
|
|
36
|
+
- ORC-004: Dependency order
|
|
37
|
+
- ORC-005: Context budget
|
|
38
|
+
|
|
39
|
+
## Why Skill-Based Delivery?
|
|
40
|
+
|
|
41
|
+
The skill approach is preferred over CLAUDE.md injection because:
|
|
42
|
+
|
|
43
|
+
1. **Selective Activation**: Only the HITL orchestrator agent receives the protocol
|
|
44
|
+
2. **Subagent Isolation**: Subagents spawn without orchestrator constraints
|
|
45
|
+
3. **On-Demand Loading**: Reduces context overhead when not in orchestrator mode
|
|
46
|
+
4. **Clean Separation**: Orchestrator vs worker roles are architecturally distinct
|
|
47
|
+
|
|
48
|
+
## Directory Structure
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
skills/
|
|
52
|
+
ct-orchestrator/
|
|
53
|
+
SKILL.md # Main skill definition with frontmatter
|
|
54
|
+
INSTALL.md # This file
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Dependencies
|
|
58
|
+
|
|
59
|
+
- CLEO task management (`cleo` CLI)
|
|
60
|
+
- Agent manifest system (`claudedocs/agent-outputs/MANIFEST.jsonl`)
|
|
61
|
+
- Task tool for subagent spawning
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Orchestrator Skill
|
|
2
|
+
|
|
3
|
+
Activate orchestrator mode for managing complex multi-agent workflows.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. **Activate**: Say "activate orchestrator mode" or use Skill tool
|
|
8
|
+
2. **Operate**: Follow ORC-001 through ORC-005 constraints
|
|
9
|
+
3. **Delegate**: Use Task tool to spawn subagents for all work
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### Option A: On-Demand (Recommended)
|
|
14
|
+
|
|
15
|
+
Simply invoke the skill when needed:
|
|
16
|
+
```
|
|
17
|
+
# Natural language
|
|
18
|
+
"activate orchestrator mode"
|
|
19
|
+
"run as orchestrator"
|
|
20
|
+
"orchestrate this workflow"
|
|
21
|
+
|
|
22
|
+
# Or Skill tool
|
|
23
|
+
Skill: orchestrator
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Option B: Project Installation
|
|
27
|
+
|
|
28
|
+
Install to your project for persistent availability:
|
|
29
|
+
```bash
|
|
30
|
+
cleo orchestrator skill --install # Copy to .cleo/skills/
|
|
31
|
+
cleo orchestrator skill --verify # Verify installation
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Files
|
|
35
|
+
|
|
36
|
+
| File | Purpose |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `SKILL.md` | Main skill definition (loaded by Claude Code) |
|
|
39
|
+
| `INSTALL.md` | Detailed installation instructions |
|
|
40
|
+
| `README.md` | This file |
|
|
41
|
+
| `references/` | Additional documentation and templates |
|
|
42
|
+
|
|
43
|
+
## Key Principle
|
|
44
|
+
|
|
45
|
+
**Only YOU (the HITL-facing session) become an orchestrator.**
|
|
46
|
+
|
|
47
|
+
Your subagents do NOT inherit this skill and operate normally as task executors.
|
|
48
|
+
This is the critical difference from CLAUDE.md injection, which affected all agents.
|
|
49
|
+
|
|
50
|
+
## Constraints (ORC)
|
|
51
|
+
|
|
52
|
+
See [SKILL.md](SKILL.md) for quick reference or [ORCHESTRATOR-PROTOCOL-SPEC.md](../../docs/specs/ORCHESTRATOR-PROTOCOL-SPEC.md#21-core-constraints) for full specification.
|
|
53
|
+
|
|
54
|
+
**Summary**: ORC-001 (high-level) | ORC-002 (delegate) | ORC-003 (no full reads) | ORC-004 (dependency order) | ORC-005 (10K budget)
|
|
55
|
+
|
|
56
|
+
## Why Skill-Based?
|
|
57
|
+
|
|
58
|
+
| Problem with CLAUDE.md injection | Skill-based solution |
|
|
59
|
+
|----------------------------------|---------------------|
|
|
60
|
+
| ALL agents read CLAUDE.md | Skills load ON-DEMAND |
|
|
61
|
+
| Subagents ALSO try to orchestrate | Subagents do NOT inherit skills |
|
|
62
|
+
| Breaks delegation pattern | Only HITL session operates as orchestrator |
|
|
63
|
+
| Always loaded (context overhead) | Loaded when activated |
|
|
64
|
+
|
|
65
|
+
## Related Documentation
|
|
66
|
+
|
|
67
|
+
- [Orchestrator Protocol Guide](../../docs/guides/ORCHESTRATOR-PROTOCOL.md)
|
|
68
|
+
- [CLI Reference](../../docs/commands/orchestrator.md)
|
|
69
|
+
- [Subagent Protocol Block](references/SUBAGENT-PROTOCOL-BLOCK.md)
|