claude-code-session-manager 0.26.0 → 0.28.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/.claude-plugin/marketplace.json +21 -0
- package/dist/assets/{TiptapBody-BsI_35c5.js → TiptapBody-CJ6GK5CM.js} +1 -1
- package/dist/assets/index-DtQ4LzuV.js +3534 -0
- package/dist/assets/index-Dwb94Uxm.css +32 -0
- package/dist/index.html +2 -2
- package/package.json +3 -1
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +19 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +112 -0
- package/plugins/session-manager-dev/skills/develop/standards.md +67 -0
- package/plugins/session-manager-dev/skills/explain-to-me/SKILL.md +192 -0
- package/plugins/session-manager-dev/skills/explain-to-me/assets/style-reference.html +163 -0
- package/plugins/session-manager-dev/skills/local-project-health/SKILL.md +58 -0
- package/plugins/session-manager-dev/skills/my-feedback/SKILL.md +132 -0
- package/plugins/session-manager-dev/skills/optimize-kpi/SKILL.md +289 -0
- package/plugins/session-manager-dev/skills/prd/SKILL.md +134 -0
- package/plugins/session-manager-dev/skills/process-feedback/SKILL.md +183 -0
- package/plugins/session-manager-dev/skills/project-status/SKILL.md +244 -0
- package/plugins/session-manager-dev/skills/requesting-code-review/SKILL.md +105 -0
- package/plugins/session-manager-dev/skills/requesting-code-review/code-reviewer.md +146 -0
- package/plugins/session-manager-dev/skills/security-review/SKILL.md +105 -0
- package/src/main/__tests__/scheduler-autofix-select.test.cjs +95 -0
- package/src/main/__tests__/scheduler-autopromote.test.cjs +33 -0
- package/src/main/hives.cjs +96 -36
- package/src/main/scheduler.cjs +135 -11
- package/src/main/templates/PRD_AUTHORING.md +316 -0
- package/src/preload/api.d.ts +8 -7
- package/dist/assets/index-BKkf6gtA.css +0 -32
- package/dist/assets/index-C61eFtxs.js +0 -3525
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>explain-to-me · style reference (copy this)</title>
|
|
7
|
+
<!--
|
|
8
|
+
STYLE REFERENCE for the /explain-to-me skill.
|
|
9
|
+
This is a complete, self-contained exemplar page. When writing a HUMAN_LEARN
|
|
10
|
+
page, mirror this structure and CSS. Replace the placeholder "Widget Pipeline"
|
|
11
|
+
content with the real, file:line-grounded explanation of the user's topic.
|
|
12
|
+
Every component below is optional — use the ones the topic needs.
|
|
13
|
+
-->
|
|
14
|
+
<style>
|
|
15
|
+
:root{
|
|
16
|
+
--bg:#0d1117; --panel:#161b22; --panel2:#1c2330; --line:#2d333b;
|
|
17
|
+
--fg:#e6edf3; --dim:#9da7b3; --faint:#6e7681;
|
|
18
|
+
--blue:#60a5fa; --green:#34d399; --amber:#fbbf24; --violet:#a78bfa;
|
|
19
|
+
--pink:#f472b6; --red:#f87171; --cyan:#22d3ee;
|
|
20
|
+
--mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
|
|
21
|
+
}
|
|
22
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
23
|
+
html{scroll-behavior:smooth}
|
|
24
|
+
body{background:var(--bg);color:var(--fg);font:15px/1.6 ui-sans-serif,system-ui,sans-serif;padding:0 20px 80px}
|
|
25
|
+
.wrap{max-width:980px;margin:0 auto}
|
|
26
|
+
a{color:var(--blue);text-decoration:none} a:hover{text-decoration:underline}
|
|
27
|
+
.crumb{font-size:12px;color:var(--faint);margin:24px 0 14px}
|
|
28
|
+
h1{font-size:28px;letter-spacing:-.5px;margin-top:26px}
|
|
29
|
+
.sub{color:var(--dim);margin:8px 0 6px;max-width:780px}
|
|
30
|
+
h2{font-size:22px;margin:44px 0 12px;padding-top:18px;border-top:1px solid var(--line)}
|
|
31
|
+
h3{font-size:16px;margin:24px 0 8px}
|
|
32
|
+
p{margin:8px 0;color:var(--dim)} p strong,li strong{color:var(--fg)}
|
|
33
|
+
ul.tight{margin:6px 0 6px 20px;color:var(--dim);font-size:13.5px} ul.tight li{margin:4px 0}
|
|
34
|
+
code{font-family:var(--mono);font-size:12.5px;background:var(--panel2);border:1px solid var(--line);border-radius:4px;padding:1px 5px;color:var(--fg);white-space:nowrap}
|
|
35
|
+
pre{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px 16px;overflow-x:auto;margin:10px 0;line-height:1.55}
|
|
36
|
+
pre code{background:none;border:none;padding:0;white-space:pre}
|
|
37
|
+
|
|
38
|
+
/* signature element: every file:line reference is a traceable chip */
|
|
39
|
+
.loc{font-family:var(--mono);font-size:11px;color:var(--cyan);background:rgba(34,211,238,.08);border:1px solid rgba(34,211,238,.25);border-radius:99px;padding:1px 9px;white-space:nowrap}
|
|
40
|
+
|
|
41
|
+
/* layer badges — one color per place a step runs */
|
|
42
|
+
.proc{font-size:11px;text-transform:uppercase;letter-spacing:.08em;padding:1px 8px;border-radius:99px;border:1px solid}
|
|
43
|
+
.proc.hook{color:var(--amber);border-color:rgba(251,191,36,.4);background:rgba(251,191,36,.07)}
|
|
44
|
+
.proc.main{color:var(--green);border-color:rgba(52,211,153,.4);background:rgba(52,211,153,.07)}
|
|
45
|
+
.proc.sub{color:var(--violet);border-color:rgba(167,139,250,.4);background:rgba(167,139,250,.07)}
|
|
46
|
+
.proc.rend{color:var(--pink);border-color:rgba(244,114,182,.4);background:rgba(244,114,182,.07)}
|
|
47
|
+
.proc.disk{color:var(--cyan);border-color:rgba(34,211,238,.4);background:rgba(34,211,238,.07)}
|
|
48
|
+
.legend{display:flex;flex-wrap:wrap;gap:14px;margin:10px 0;font-size:12px;color:var(--dim)}
|
|
49
|
+
|
|
50
|
+
/* sticky in-page nav */
|
|
51
|
+
nav.toc{position:sticky;top:0;z-index:10;background:rgba(13,17,23,.92);backdrop-filter:blur(6px);border-bottom:1px solid var(--line);margin:0 -20px;padding:10px 20px}
|
|
52
|
+
nav.toc .row{max-width:980px;margin:0 auto;display:flex;gap:8px;flex-wrap:wrap}
|
|
53
|
+
nav.toc a{font-size:13px;padding:4px 14px;border-radius:99px;border:1px solid var(--line);color:var(--dim)}
|
|
54
|
+
nav.toc a:hover{color:var(--fg);border-color:var(--faint);text-decoration:none}
|
|
55
|
+
|
|
56
|
+
/* stat strip */
|
|
57
|
+
.statline{display:flex;gap:18px;flex-wrap:wrap;margin:16px 0}
|
|
58
|
+
.stat{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:10px 18px}
|
|
59
|
+
.stat .v{font-size:22px;font-weight:700} .stat .k{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--faint)}
|
|
60
|
+
|
|
61
|
+
/* horizontal flow diagram */
|
|
62
|
+
.flow{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;margin:16px 0}
|
|
63
|
+
.flow .box{flex:1 1 150px;min-width:150px;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
|
|
64
|
+
.flow .box .bt{font-weight:700;font-size:13px;margin-bottom:2px}
|
|
65
|
+
.flow .box .bd{font-size:12px;color:var(--dim)}
|
|
66
|
+
.flow .box .where{font-family:var(--mono);font-size:10px;color:var(--cyan);margin-top:6px}
|
|
67
|
+
.flow .arrow{align-self:center;color:var(--faint);font-size:18px;flex:0 0 auto}
|
|
68
|
+
.box.b-amber{border-top:3px solid var(--amber)} .box.b-green{border-top:3px solid var(--green)}
|
|
69
|
+
.box.b-violet{border-top:3px solid var(--violet)} .box.b-cyan{border-top:3px solid var(--cyan)}
|
|
70
|
+
.box.b-pink{border-top:3px solid var(--pink)}
|
|
71
|
+
|
|
72
|
+
/* callouts */
|
|
73
|
+
.callout{border-left:3px solid var(--amber);background:rgba(251,191,36,.06);border-radius:0 8px 8px 0;padding:12px 16px;margin:14px 0;font-size:14px;color:var(--dim)}
|
|
74
|
+
.callout.ok{border-color:var(--green);background:rgba(52,211,153,.06)}
|
|
75
|
+
.callout.bad{border-color:var(--red);background:rgba(248,113,113,.06)}
|
|
76
|
+
.callout strong{color:var(--fg)}
|
|
77
|
+
|
|
78
|
+
/* tables + collapsible knobs */
|
|
79
|
+
table{border-collapse:collapse;width:100%;margin:12px 0;font-size:13px}
|
|
80
|
+
th,td{text-align:left;padding:6px 11px;border:1px solid var(--line)}
|
|
81
|
+
th{background:var(--panel2);font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--dim)}
|
|
82
|
+
td{background:var(--panel);color:var(--dim)} td code{white-space:nowrap}
|
|
83
|
+
details.consts summary{cursor:pointer;font-size:13px;color:var(--blue);margin:10px 0}
|
|
84
|
+
|
|
85
|
+
/* two-column rationale */
|
|
86
|
+
.twocol{display:grid;grid-template-columns:1fr 1fr;gap:16px}
|
|
87
|
+
@media(max-width:760px){.twocol{grid-template-columns:1fr}.flow .box{flex-basis:100%}}
|
|
88
|
+
|
|
89
|
+
footer{margin-top:60px;padding-top:16px;border-top:1px solid var(--line);font-size:12px;color:var(--faint)}
|
|
90
|
+
</style>
|
|
91
|
+
</head>
|
|
92
|
+
<body>
|
|
93
|
+
|
|
94
|
+
<nav class="toc"><div class="row">
|
|
95
|
+
<a href="index.html">📖 HOME</a>
|
|
96
|
+
<a href="#flow">Flow</a>
|
|
97
|
+
<a href="#knobs">Knobs</a>
|
|
98
|
+
<a href="#why">Why</a>
|
|
99
|
+
</div></nav>
|
|
100
|
+
|
|
101
|
+
<div class="wrap">
|
|
102
|
+
<div class="crumb"><a href="index.html">HUMAN_LEARN</a> / Widget Pipeline</div>
|
|
103
|
+
<h1>⚙️ Widget Pipeline — how a request becomes a widget</h1>
|
|
104
|
+
<p class="sub">
|
|
105
|
+
One-sentence lead: what this is and when it runs. (Replace this whole page with the
|
|
106
|
+
real, <code>file:line</code>-grounded explanation of the user's topic — this file is only the
|
|
107
|
+
visual template.)
|
|
108
|
+
</p>
|
|
109
|
+
<div class="legend">
|
|
110
|
+
<span><span class="proc hook">trigger</span> what kicks it off</span>
|
|
111
|
+
<span><span class="proc main">core</span> main logic</span>
|
|
112
|
+
<span><span class="proc sub">worker</span> spawned work</span>
|
|
113
|
+
<span><span class="proc disk">store</span> persistence</span>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div class="statline">
|
|
117
|
+
<div class="stat"><div class="v">5</div><div class="k">stages</div></div>
|
|
118
|
+
<div class="stat"><div class="v">20</div><div class="k">batch cap</div></div>
|
|
119
|
+
<div class="stat"><div class="v">8 MB</div><div class="k">read window</div></div>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<h2 id="flow">The flow, step by step</h2>
|
|
123
|
+
<div class="flow">
|
|
124
|
+
<div class="box b-amber"><div class="bt">1 · Trigger</div><div class="bd">what starts it</div><div class="where">file.ext:NN</div></div>
|
|
125
|
+
<div class="arrow">→</div>
|
|
126
|
+
<div class="box b-green"><div class="bt">2 · Read</div><div class="bd">bounded input read</div><div class="where">file.ext:NN</div></div>
|
|
127
|
+
<div class="arrow">→</div>
|
|
128
|
+
<div class="box b-green"><div class="bt">3 · Transform</div><div class="bd">the core step</div><div class="where">file.ext:NN</div></div>
|
|
129
|
+
<div class="arrow">→</div>
|
|
130
|
+
<div class="box b-sub b-violet"><div class="bt">4 · Work</div><div class="bd">spawned subprocess</div><div class="where">file.ext:NN</div></div>
|
|
131
|
+
<div class="arrow">→</div>
|
|
132
|
+
<div class="box b-cyan"><div class="bt">5 · Persist</div><div class="bd">atomic write</div><div class="where">file.ext:NN</div></div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<h3>3 · Transform <span class="proc main">core</span> <span class="loc">file.ext:120-148</span></h3>
|
|
136
|
+
<p>Prose explaining the step, with inline <code>constants</code> and a <span class="loc">file.ext:NN</span> for
|
|
137
|
+
each claim. Show a real snippet when it clarifies:</p>
|
|
138
|
+
<pre><code>doThing(input, { cap: 20, windowBytes: 8 * 1024 * 1024 })</code></pre>
|
|
139
|
+
|
|
140
|
+
<div class="callout ok"><strong>Key insight.</strong> The one thing a reader must take away —
|
|
141
|
+
e.g. why the design is correct, or the invariant it preserves.</div>
|
|
142
|
+
|
|
143
|
+
<h2 id="knobs">The knobs</h2>
|
|
144
|
+
<details class="consts" open><summary>All constants (real names + values)</summary>
|
|
145
|
+
<table>
|
|
146
|
+
<tr><th>Constant</th><th>Value</th><th>Where</th><th>Bounds</th></tr>
|
|
147
|
+
<tr><td><code>BATCH</code></td><td>20</td><td><span class="loc">file.ext:50</span></td><td>items per unit of work</td></tr>
|
|
148
|
+
<tr><td><code>MAX_BYTES</code></td><td>8 MB</td><td><span class="loc">file.ext:52</span></td><td>read window per run</td></tr>
|
|
149
|
+
</table>
|
|
150
|
+
</details>
|
|
151
|
+
|
|
152
|
+
<h2 id="why">Why it's shaped this way</h2>
|
|
153
|
+
<div class="twocol">
|
|
154
|
+
<div><h3>Constraint A</h3><p>The real reason — an incident, a platform limit, a cost guard.</p></div>
|
|
155
|
+
<div><h3>Constraint B</h3><p>Another forcing function that explains a non-obvious choice.</p></div>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<footer>
|
|
159
|
+
HUMAN_LEARN · <project> · generated <date> from <code>file.ext</code> + live on-disk state.
|
|
160
|
+
</footer>
|
|
161
|
+
</div>
|
|
162
|
+
</body>
|
|
163
|
+
</html>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: local-project-health
|
|
3
|
+
description: >-
|
|
4
|
+
Run the CURRENT project's own definition of "health" and report one rollup.
|
|
5
|
+
Each project defines health differently (a trading bot tracks circuit-breakers
|
|
6
|
+
+ benchmark alpha; a web app tracks uptime + error rate), so this skill runs
|
|
7
|
+
the project-supplied health entrypoint rather than imposing a generic check.
|
|
8
|
+
Use whenever the user asks "is this project healthy?", "/local-project-health",
|
|
9
|
+
"system health", "is everything running / green", or wants a one-shot status
|
|
10
|
+
rollup for the repo they're in. Keywords: health, status, healthcheck, is it
|
|
11
|
+
up, are we green, rollup, system health, project health.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Local project health
|
|
15
|
+
|
|
16
|
+
Report a single health verdict for the project in the current working directory
|
|
17
|
+
by running **that project's own** health definition. Health is project-specific
|
|
18
|
+
by design — do not invent generic checks.
|
|
19
|
+
|
|
20
|
+
## Procedure
|
|
21
|
+
|
|
22
|
+
1. **Find the project's health entrypoint**, checking these paths in order
|
|
23
|
+
(first hit wins):
|
|
24
|
+
- `scripts/health.sh`
|
|
25
|
+
- `.claude/health.sh`
|
|
26
|
+
- `bin/health.sh`
|
|
27
|
+
- `Makefile` / `justfile` target named `health`
|
|
28
|
+
|
|
29
|
+
2. **If an entrypoint exists**, run it from the repo root and relay its output:
|
|
30
|
+
- `bash scripts/health.sh` (or the path found / `make health` / `just health`).
|
|
31
|
+
- These scripts are designed to print a human rollup and exit 0/1/2
|
|
32
|
+
(GREEN/YELLOW-or-UNKNOWN/RED). Show the user the rollup verbatim, then add a
|
|
33
|
+
one-line plain-English verdict leading with the overall color and the worst
|
|
34
|
+
layer (e.g. "🟡 YELLOW — performance is the drag: −3 pts vs SPY").
|
|
35
|
+
- If the script persists a structured artifact (e.g.
|
|
36
|
+
`data/system_health.json`), mention where it landed.
|
|
37
|
+
- If it exits non-zero, that is expected for YELLOW/RED — it is NOT a skill
|
|
38
|
+
failure. Only treat a *crash* (missing interpreter, traceback, unbound var)
|
|
39
|
+
as a failure to debug.
|
|
40
|
+
|
|
41
|
+
3. **If NO entrypoint exists**, do not guess at health with ad-hoc commands.
|
|
42
|
+
Instead:
|
|
43
|
+
- Read `CLAUDE.md`, `README*`, and skim the repo to infer what "health" means
|
|
44
|
+
for THIS project (what it monitors, what would constitute degraded/broken).
|
|
45
|
+
- Propose a concrete `scripts/health.sh` that collapses those project-specific
|
|
46
|
+
layers into one GREEN/YELLOW/RED rollup (terminal output + a persisted
|
|
47
|
+
`*.json` artifact), reusing the project's existing CLIs/artifacts rather
|
|
48
|
+
than re-deriving thresholds.
|
|
49
|
+
- Offer to create it. Once created, it becomes the convention this skill runs
|
|
50
|
+
on every future invocation.
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- The contract is the **convention path**, not a shared implementation: every
|
|
55
|
+
project owns its own `scripts/health.sh`. This skill is just the launcher +
|
|
56
|
+
interpreter of the result.
|
|
57
|
+
- Keep the relayed summary tight: overall color first, then the offending
|
|
58
|
+
layer(s), then where the full report is. Lead with the answer.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: my-feedback
|
|
3
|
+
description: >-
|
|
4
|
+
File a feedback/enhancement request FROM the current project INTO another
|
|
5
|
+
project's inbound feedback folder, following that project's own README
|
|
6
|
+
convention. The cross-project complement of /process-feedback (which works the
|
|
7
|
+
*current* project's inbox). Use whenever the user says "/my-feedback to X",
|
|
8
|
+
"send feedback to X", "file a feedback item to X", "request an enhancement
|
|
9
|
+
from X", "drop a note in X's feedback folder", or "ask X to add/fix Y". The
|
|
10
|
+
target project MUST be named — error if it is missing. Keywords: feedback,
|
|
11
|
+
cross-project request, enhancement request, upstream, downstream, service
|
|
12
|
+
boundary, file feedback, request a feature, inter-service.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# my-feedback
|
|
16
|
+
|
|
17
|
+
**Role:** the *outbound* end of the agent↔agent channel — it files a request into another
|
|
18
|
+
project's intake, where their `/process-feedback` picks it up and (if codeable) runs it
|
|
19
|
+
through their `/develop` pipeline. It is the send side; `/process-feedback` is the receive
|
|
20
|
+
side. **Never** cross the service boundary to fix the other project's code yourself — the
|
|
21
|
+
deliverable is an auditable request, not a patch.
|
|
22
|
+
|
|
23
|
+
Write one actionable feedback file into **another** project's intake folder, so
|
|
24
|
+
the team that owns the boundary can act on it via their `/process-feedback`. The
|
|
25
|
+
current project is the **From**; the named project is the **To**.
|
|
26
|
+
|
|
27
|
+
This is the send side of the same channel `/process-feedback` reads. Respect the
|
|
28
|
+
service boundary: you are *requesting* a change in their code, never reaching
|
|
29
|
+
across to make it yourself.
|
|
30
|
+
|
|
31
|
+
## 0. Resolve the target — error if missing
|
|
32
|
+
|
|
33
|
+
The invocation is `/my-feedback to <<project>>` (or "send feedback to
|
|
34
|
+
<<project>>"). **`<<project>>` is required.**
|
|
35
|
+
|
|
36
|
+
- **If no target project is named, STOP and error.** Do not guess, do not file
|
|
37
|
+
into the current project. Print: *"Name the target project: `/my-feedback to
|
|
38
|
+
<project>`."* Then list candidate sibling projects that have an intake folder:
|
|
39
|
+
```bash
|
|
40
|
+
for d in ~/Projects/*/; do
|
|
41
|
+
[ -d "$d/feedback" ] && echo " - $(basename "$d") (feedback/)"
|
|
42
|
+
[ -d "$d/external-feedback" ] && echo " - $(basename "$d") (external-feedback/)"
|
|
43
|
+
done
|
|
44
|
+
```
|
|
45
|
+
and stop.
|
|
46
|
+
- Resolve the path: `~/Projects/<project>/feedback/` (some projects
|
|
47
|
+
use `external-feedback/` — check both). Fuzzy-match a near miss to a real
|
|
48
|
+
directory, but confirm the resolved name before writing.
|
|
49
|
+
- **If the target has no feedback/external-feedback folder, STOP.** Don't invent
|
|
50
|
+
one — say the project doesn't accept feedback this way and ask how to proceed
|
|
51
|
+
(it may take requests via issues, a different folder, or not at all).
|
|
52
|
+
|
|
53
|
+
## 1. Read the target's README FIRST — it is the authority
|
|
54
|
+
|
|
55
|
+
**Every project's feedback folder has its own `README.md`, and the convention is
|
|
56
|
+
unique per project** (file-naming scheme, required sections, the status-log
|
|
57
|
+
table, the closing ritual). Read it before writing anything:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cat ~/Projects/<project>/feedback/README.md
|
|
61
|
+
ls ~/Projects/<project>/feedback/ # open items + numbering
|
|
62
|
+
ls ~/Projects/<project>/feedback/processed/ 2>/dev/null # closed examples to match
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Read one **processed** example end-to-end to copy the house format exactly — the
|
|
66
|
+
processed files are the calibrated bar. If the README and an example disagree,
|
|
67
|
+
the example wins (it's what actually got accepted).
|
|
68
|
+
|
|
69
|
+
## 2. Name the file by their convention
|
|
70
|
+
|
|
71
|
+
Most intakes use `YYYY-MM-DD-NN-short-slug.md` (today's date, next free `NN` for
|
|
72
|
+
the day — check existing files so you don't collide). Use the **target's** scheme
|
|
73
|
+
if it differs. The "From" is the **current project** — derive it from the cwd
|
|
74
|
+
basename, not an assumption.
|
|
75
|
+
|
|
76
|
+
## 3. Write to the bar — make it closeable without a back-and-forth
|
|
77
|
+
|
|
78
|
+
These hold across every intake (and most READMEs say the same):
|
|
79
|
+
|
|
80
|
+
- **Cite real `file:line` from the target's current `src/`** — verify by `grep`,
|
|
81
|
+
not memory. "You spawn a process per call — `_burrow_mcp.py:75`" beats "your
|
|
82
|
+
transport seems slow." Quote the offending code, then name the contract/PRD it
|
|
83
|
+
violates so the gap is self-evident.
|
|
84
|
+
- **Lead with the cost already paid.** A concrete incident ("the silent 11-day
|
|
85
|
+
mentions hole", "shorted into earnings on a stale zero") earns priority over a
|
|
86
|
+
hypothetical. Tie it to money/correctness, not taste.
|
|
87
|
+
- **Give a copy-pasteable Fix _and_ the deps to unblock it** (env var, new tool,
|
|
88
|
+
rate bucket). Don't leave the closer to discover side-asks.
|
|
89
|
+
- **Separate "must change" from "nice."** Credit what's already right so the file
|
|
90
|
+
reads as calibrated, not a pile-on.
|
|
91
|
+
- **Name the symptom and hypothesize the cause, but don't confidently assign the
|
|
92
|
+
fix's home.** A wrong attribution stalls; "frozen at 06-08 (evidence) — maybe
|
|
93
|
+
scoring, maybe upstream gather" closes faster.
|
|
94
|
+
- **Flag third-service dependencies up front.** If an ask needs *another*
|
|
95
|
+
project's tool/contract to land, say so — the closer forwards it on day one
|
|
96
|
+
instead of discovering it mid-fix. (You can also file the dependent half
|
|
97
|
+
directly into that third project with another `/my-feedback` pass.)
|
|
98
|
+
- **End with concrete Asks + the target's closing ritual** (the README usually
|
|
99
|
+
specifies marking ✅ and appending `## RESOLUTION`). State what "done" looks
|
|
100
|
+
like, with an acceptance test per ask.
|
|
101
|
+
- **One file = one coherent thread, scoped to the boundary.** Don't smuggle in
|
|
102
|
+
unrelated requests.
|
|
103
|
+
|
|
104
|
+
Anti-patterns that stall: vague severity ("seems slow"), no reproduction, fixes
|
|
105
|
+
that assume internals the other team can't see, asks with no acceptance test.
|
|
106
|
+
|
|
107
|
+
## 4. Register and hand off
|
|
108
|
+
|
|
109
|
+
- If the README keeps a **status-log table**, add a row for the new item (open/🆕)
|
|
110
|
+
using their exact column format. This is usually required — the log is the
|
|
111
|
+
durable index.
|
|
112
|
+
- **Don't commit or push into the target repo unless the user asks.** The file in
|
|
113
|
+
their tree is the deliverable; their team picks it up via `/process-feedback`.
|
|
114
|
+
If you do commit, commit in the **target** repo only, and never touch their
|
|
115
|
+
source — just the feedback file + README log row.
|
|
116
|
+
- Report back: the file path written, the From→To, priority, and the one-line
|
|
117
|
+
ask — so the user can relay or follow up.
|
|
118
|
+
|
|
119
|
+
## Tips
|
|
120
|
+
|
|
121
|
+
- **You're the sender, not the fixer.** Resist editing the target's code to
|
|
122
|
+
"just fix it" — that violates the boundary the channel exists to protect. The
|
|
123
|
+
whole point is an auditable request the owner acts on.
|
|
124
|
+
- **Mirror their tone.** A terse intake wants terse; a structured one wants every
|
|
125
|
+
section. Match the processed examples.
|
|
126
|
+
- **Reuse evidence you already have.** If this session surfaced the incident
|
|
127
|
+
(logs, audit rows, live tool output), quote it verbatim — freshly-gathered
|
|
128
|
+
`file:line` and timestamps are exactly what makes a file closeable.
|
|
129
|
+
- **Stale-claim guard.** Feedback captures the world when written; note the
|
|
130
|
+
as-of timestamp on live data you cite, so the closer knows what to re-verify.
|
|
131
|
+
- **If the right home is a third project,** file there too rather than overloading
|
|
132
|
+
one team with an ask they can only forward.
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: optimize-kpi
|
|
3
|
+
description: >-
|
|
4
|
+
Project-agnostic North-Star-KPI optimization cycle. Reads the current project's
|
|
5
|
+
declared North-Star KPI from its CLAUDE.md, measures it, audits real
|
|
6
|
+
consumption/usage telemetry + operational logs, grades the prior iteration's
|
|
7
|
+
filed lever, then fans out 3 INDEPENDENT recommender agents (Opus 4.8, max
|
|
8
|
+
thinking) that each diagnose the gap and propose the single
|
|
9
|
+
highest-leverage improvement — every recommendation grounded in usage + logs,
|
|
10
|
+
not the scorecard alone; one consolidator agent merges them into ONE feedback
|
|
11
|
+
item filed into this project's own feedback inbox plus a ranked backlog.
|
|
12
|
+
Implementation is NEVER done inline — it always goes through the scheduler via
|
|
13
|
+
/process-feedback → /develop. Use whenever the user says "/optimize-kpi",
|
|
14
|
+
"optimize the KPI", "improve our north-star metric", or runs the daily KPI
|
|
15
|
+
optimization loop. Keywords: optimize, KPI, north-star, metric, coverage,
|
|
16
|
+
recommenders, consolidate, feedback, scheduler, attribution.
|
|
17
|
+
model: opus
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# /optimize-kpi — measure → grade last lever → 3 recommenders → consolidate → file → scheduler
|
|
21
|
+
|
|
22
|
+
You are the optimization driver for **whatever this project has declared as its
|
|
23
|
+
North-Star KPI**. You do not implement code. Each run is one closed iteration of a
|
|
24
|
+
*converging* loop: **discover the KPI → measure + validate → grade the prior
|
|
25
|
+
lever → fan out 3 independent recommenders → consolidate into one feedback item +
|
|
26
|
+
backlog → hand off to the scheduler → log**.
|
|
27
|
+
|
|
28
|
+
**Non-negotiable: never implement, review, commit, publish, or reboot inline.**
|
|
29
|
+
The single consolidated recommendation is filed into this project's own feedback
|
|
30
|
+
inbox and dispatched through **`/process-feedback` → `/develop`**, which queues
|
|
31
|
+
PRDs onto the session-manager scheduler and tracks them to done. Bypassing the
|
|
32
|
+
scheduler is the one thing this skill must not do.
|
|
33
|
+
|
|
34
|
+
**Autonomy contract.** This skill is usually driven headless by a cron with
|
|
35
|
+
`--dangerously-skip-permissions`, so it must run to completion without human
|
|
36
|
+
input. **Never call `AskUserQuestion` or otherwise block on a prompt in loop
|
|
37
|
+
mode.** If a decision genuinely needs the operator, take the reversible default,
|
|
38
|
+
record the open question as a `> NOTE:` line in the feedback item, and continue —
|
|
39
|
+
do not stall the loop. (Interactive, user-invoked runs may ask; detect this by
|
|
40
|
+
whether a human is in the turn.)
|
|
41
|
+
|
|
42
|
+
## Step 0 — Discover the project's North-Star KPI (do not assume)
|
|
43
|
+
|
|
44
|
+
The KPI lives in the project's mission statement: read `./CLAUDE.md` and find the
|
|
45
|
+
section whose heading names the **North-Star KPI** (e.g. `## Objective &
|
|
46
|
+
North-Star KPI`). That section is the authority. Extract, by reading it and the
|
|
47
|
+
files it points to:
|
|
48
|
+
|
|
49
|
+
- **The KPI statement** — what is being optimized, the target (usually 100% / a
|
|
50
|
+
ceiling), and the precise definition doc it links (e.g. `docs/<kpi>.md`).
|
|
51
|
+
- **The measurement command** — the scorecard/metric script it names (e.g.
|
|
52
|
+
`scripts/coverage_scorecard.py`). Prefer a `--json` form and a `--trend N`
|
|
53
|
+
form if they exist.
|
|
54
|
+
- **The driving pipeline(s)** — which scheduled job(s) actually move the metric
|
|
55
|
+
(the gatherer/worker named in the KPI section or registry). You need this for
|
|
56
|
+
the validity gate in Step 1.
|
|
57
|
+
- **The usage / consumption audit** — how the project's *outputs* are consumed
|
|
58
|
+
and the operational logs that show whether the machine is healthy. The CLAUDE.md
|
|
59
|
+
observability/telemetry pointer names them (e.g. a usage-audit script over a
|
|
60
|
+
request log, a metrics endpoint, the run-history DB, `data/logs/`). Capture the
|
|
61
|
+
exact audit command(s). If the project exposes **no** consumption telemetry at
|
|
62
|
+
all, that itself is a finding — recommend adding it.
|
|
63
|
+
- **The levers** — the files the section names as the knobs (tiers/config,
|
|
64
|
+
selection, throughput/cadence/registry, etc.).
|
|
65
|
+
- **The feedback intake** — `feedback/` (or `external-feedback/`) at the repo
|
|
66
|
+
root, and its `README.md` convention.
|
|
67
|
+
|
|
68
|
+
**If CLAUDE.md declares no North-Star KPI section, STOP** and tell the user this
|
|
69
|
+
project hasn't declared one — the KPI belongs in CLAUDE.md's mission statement
|
|
70
|
+
(that's the convention this skill reads), and ask them to add it before running.
|
|
71
|
+
|
|
72
|
+
Capture the discovered KPI statement, measurement command, driving pipeline,
|
|
73
|
+
lever files, and intake path — you pass all of them verbatim into the recommender
|
|
74
|
+
agents so they work from the project's own definition, not your guess.
|
|
75
|
+
|
|
76
|
+
## Step 1 — Measure + validity gate (don't tune a corpse)
|
|
77
|
+
|
|
78
|
+
Run the discovered measurement command in both its snapshot and trend forms (e.g.
|
|
79
|
+
`<scorecard> --json` and `<scorecard> --trend 14`). Read the JSON outputs. Record:
|
|
80
|
+
today's KPI value, any floor/SLO breaches, per-segment breakdown, the
|
|
81
|
+
worst-performing units, and the trend direction over the last several days. This
|
|
82
|
+
evidence block is the shared input every recommender receives.
|
|
83
|
+
|
|
84
|
+
**Validity gate — before diagnosing, prove the metric is real.** A low KPI has
|
|
85
|
+
two very different causes: a *mis-set knob* (a tuning problem) or *the driving
|
|
86
|
+
pipeline didn't run / is wedged* (an ops problem). Confirm the Step-0 driving
|
|
87
|
+
pipeline actually produced work in the measurement window — check the
|
|
88
|
+
orchestrator/run history (last successful run, duration, whether it hung to its
|
|
89
|
+
max-duration cap or held a lock). If the pipeline **did not run a healthy cycle
|
|
90
|
+
in the window**, the metric is an artifact:
|
|
91
|
+
|
|
92
|
+
- Do **not** run the recommender fan-out. A selection/tiering "fix" against a
|
|
93
|
+
dead pipeline is noise.
|
|
94
|
+
- File a single feedback item whose Ask is **"restore the driving pipeline"**
|
|
95
|
+
(cite the stuck/missing runs), hand it to the scheduler (Step 5), log it, and
|
|
96
|
+
stop the iteration there.
|
|
97
|
+
|
|
98
|
+
Only when the metric reflects a pipeline that genuinely ran do you proceed to the
|
|
99
|
+
tuning loop.
|
|
100
|
+
|
|
101
|
+
## Step 1b — Audit usage + logs (MANDATORY evidence, not optional)
|
|
102
|
+
|
|
103
|
+
The scorecard says *how high* the KPI is; it never says *why*. The why lives in
|
|
104
|
+
how the project's outputs are actually consumed and what the logs are screaming.
|
|
105
|
+
**This step is required every run — a recommendation that cites only the
|
|
106
|
+
scorecard is rejected in Step 4.**
|
|
107
|
+
|
|
108
|
+
- **Usage / consumption audit.** Run the Step-0 usage-audit command (for a
|
|
109
|
+
contract/MCP project, the per-consumer + per-tool telemetry; for others, the
|
|
110
|
+
request/access log or metrics endpoint). Extract: who the consumers are, the
|
|
111
|
+
call distribution across outputs, **dark outputs** (shipped but never consumed),
|
|
112
|
+
**error hotspots** (esp. a write/auth path failing silently), and **latency/SLO
|
|
113
|
+
breaches**. Consumption shape tells you what's load-bearing vs dead weight — you
|
|
114
|
+
do not optimize what nobody reads, and a silently-failing consumer is often the
|
|
115
|
+
real KPI gap.
|
|
116
|
+
- **Operational-log audit.** Scan the run history + `data/logs/` (or the
|
|
117
|
+
project's log sink) for failed/stuck runs, repeated errors, max-duration
|
|
118
|
+
overruns, and lock contention in the measurement window. These are frequently
|
|
119
|
+
the *direct* root cause of a depressed KPI (e.g. the gatherer hitting its
|
|
120
|
+
duration cap → fewer units visited → coverage falls) — and they're invisible to
|
|
121
|
+
the scorecard.
|
|
122
|
+
|
|
123
|
+
Produce a compact **usage+log evidence block** alongside the Step-1 scorecard
|
|
124
|
+
block. Both are handed to every recommender. If the audit surfaces an ops failure
|
|
125
|
+
that is *itself* the dominant KPI cause (a dead consumer, a crashing pipeline),
|
|
126
|
+
treat it like the validity gate: the recommendation is "fix that," and you may
|
|
127
|
+
skip the tuning fan-out.
|
|
128
|
+
|
|
129
|
+
## Step 2 — Grade the prior lever + read in-flight work (close the loop)
|
|
130
|
+
|
|
131
|
+
Before proposing anything new, find out what the *last* iteration did and whether
|
|
132
|
+
it worked. Open-loop optimizers don't converge — this step is what makes the loop
|
|
133
|
+
learn.
|
|
134
|
+
|
|
135
|
+
- **Read the optimization log** (`docs/kpi-optimization-log.md`, if present) for
|
|
136
|
+
the last filed lever, its predicted effect, and its measure-by date.
|
|
137
|
+
- **Check whether it shipped:** look at the feedback folder (is last run's item
|
|
138
|
+
✅/archived?) and the scheduler's PRD history for the ids it queued. Status:
|
|
139
|
+
*not yet queued* / *queued, running* / *shipped on `<date>`* / *failed*.
|
|
140
|
+
- **Grade it against the metric:** if it shipped, compare the KPI/breach numbers
|
|
141
|
+
before vs after its ship date using the Step-1 trend. Did it move the metric in
|
|
142
|
+
the predicted direction and magnitude? Record `helped` / `no-effect` /
|
|
143
|
+
`regressed` / `too-early-to-tell`.
|
|
144
|
+
- **Build the in-flight + cooldown set:** list every lever currently *queued or
|
|
145
|
+
awaiting its first post-ship measurement*. These are **off-limits this run** —
|
|
146
|
+
do not let the recommenders or consolidator re-file a lever that is already in
|
|
147
|
+
flight or whose effect hasn't been measured yet (cooldown). Re-filing the same
|
|
148
|
+
ask stacks duplicate PRDs on the scheduler and never learns.
|
|
149
|
+
|
|
150
|
+
Carry forward into Step 3: `{last lever, its grade, why it under/over-performed,
|
|
151
|
+
the in-flight/cooldown lever set}`.
|
|
152
|
+
|
|
153
|
+
## Step 3 — Fan out 3 INDEPENDENT recommenders (parallel)
|
|
154
|
+
|
|
155
|
+
Spawn **3 Agent calls in a single message** so they run concurrently and blind to
|
|
156
|
+
each other. Each is a peer doing the full diagnosis independently — divergence is
|
|
157
|
+
the point; do not coordinate them. (Default panel = 3; you may scale to 4–5 when
|
|
158
|
+
the gap is large and token budget allows, or drop to 2 for a tiny gap — note the
|
|
159
|
+
choice.)
|
|
160
|
+
|
|
161
|
+
- **Model:** `opus` (Opus 4.8) with **failover to `sonnet`** — launch each agent
|
|
162
|
+
with `model: opus`; if an agent dies on a model/availability error, re-spawn
|
|
163
|
+
that one with `model: sonnet`. A **mixed panel** (some opus, some sonnet) is
|
|
164
|
+
fine — don't block waiting for a uniform fleet. (Fable is not GA and only
|
|
165
|
+
causes availability failures — do not use it.) Instruct each to think at
|
|
166
|
+
**maximum depth** before answering.
|
|
167
|
+
- **Prompt (identical for all 3, vary only an angle hint):** give each the KPI
|
|
168
|
+
statement, the definition doc path, the Step-1 scorecard block, the **Step-1b
|
|
169
|
+
usage+log evidence block**, the **Step-2 prior-lever grade + in-flight/cooldown
|
|
170
|
+
set**, the lever files, and the project's standing design directives from the
|
|
171
|
+
KPI section. Ask each to:
|
|
172
|
+
1. Diagnose *why* the KPI is below target — name the single root cause with the
|
|
173
|
+
highest expected KPI delta. **Ground the diagnosis in the usage+log evidence,
|
|
174
|
+
not the scorecard alone:** cite the specific consumer behaviour, dark output,
|
|
175
|
+
error hotspot, or failing/over-running run that supports the root cause. A
|
|
176
|
+
diagnosis with no usage/log citation is not acceptable. Account for the prior
|
|
177
|
+
lever's result: if it under-performed, say why and whether to escalate or
|
|
178
|
+
abandon it.
|
|
179
|
+
2. Propose ONE concrete, highest-leverage change as numbered implementation
|
|
180
|
+
steps an executor could follow without further design: exact file(s), the
|
|
181
|
+
change, the lever value, the **expected KPI/breach delta as a falsifiable
|
|
182
|
+
numeric target with a measure-by horizon** (e.g. "floor breaches 82→<40
|
|
183
|
+
within 2 days"), and how the next measurement run will confirm it. Quality
|
|
184
|
+
bar / service contracts stay fixed — never raise the KPI by lowering a
|
|
185
|
+
quality gate. **Must not** be a lever in the in-flight/cooldown set.
|
|
186
|
+
3. State assumptions and the one risk that would make it backfire.
|
|
187
|
+
Give each a different framing nudge so they don't converge: e.g. agent 1
|
|
188
|
+
"selection/throughput first", agent 2 "tiering/cadence/targets-achievability
|
|
189
|
+
first", agent 3 "consolidation/architecture first". The nudge biases the lens,
|
|
190
|
+
not the conclusion — each still considers all levers.
|
|
191
|
+
- **Output:** each agent **writes its recommendation to a temp file** and returns
|
|
192
|
+
the path. Use a per-run temp dir derived from the project + date, e.g.
|
|
193
|
+
`downloads/optimize-kpi/<YYYY-MM-DD>/agent-{1,2,3}.md` (create it; fall back to
|
|
194
|
+
`/tmp/optimize-kpi-<date>/` if `downloads/` doesn't exist). One file per agent,
|
|
195
|
+
full reasoning + the numbered steps. (Old per-run dirs are disposable — GC dirs
|
|
196
|
+
older than ~14 days when you create today's.)
|
|
197
|
+
|
|
198
|
+
## Step 4 — Consolidate into ONE recommendation + a ranked backlog (single agent)
|
|
199
|
+
|
|
200
|
+
Spawn **one** consolidator agent (same `opus`→`sonnet` failover, max thinking).
|
|
201
|
+
Give it the 3 temp files **and** the Step-2 in-flight/cooldown set. It must:
|
|
202
|
+
|
|
203
|
+
- Read all three, dedupe overlapping ideas, and **score** the distinct proposals
|
|
204
|
+
by expected KPI delta × achievability × reversibility.
|
|
205
|
+
- **Reject any proposal not grounded in the usage+log evidence** — a root cause
|
|
206
|
+
citing only the scorecard is not eligible. The winning lever must trace to an
|
|
207
|
+
observed consumer behaviour, dark output, error hotspot, or failing/over-running
|
|
208
|
+
run.
|
|
209
|
+
- **Drop any proposal that collides with the in-flight/cooldown set** (already
|
|
210
|
+
queued or awaiting measurement) — those are not eligible this run.
|
|
211
|
+
- **Pick the single highest-leverage *eligible* lever** to change this iteration
|
|
212
|
+
(resist bundling — one lever per iteration), grafting the best supporting ideas
|
|
213
|
+
from the runners-up into the plan where they strengthen it.
|
|
214
|
+
- Verify targets are achievable for real throughput — if a proposal sets targets
|
|
215
|
+
the system can't meet, say so and adjust rather than let the KPI lie.
|
|
216
|
+
- **Route the lever by ownership first.** If the winning lever's root cause
|
|
217
|
+
belongs to an **upstream/downstream service** — the data source hasn't gathered
|
|
218
|
+
the inputs, an upstream contract drifted, a consumer needs a change — the
|
|
219
|
+
deliverable is a **cross-project filing via `/my-feedback <project>`** into THAT
|
|
220
|
+
service's intake, not a this-project item this repo can't action. (Canonical
|
|
221
|
+
case: signal-builder's sellable-KPI binding constraint is frequently the
|
|
222
|
+
`acquisition` cohort — tickers Burrow simply hasn't gathered — which is filed to
|
|
223
|
+
`burrow`, per this project's CLAUDE.md North-Star section.) A this-project-owned
|
|
224
|
+
lever is filed here (next bullet); a **mixed** lever splits — the local half here
|
|
225
|
+
via `/develop`, the upstream half via `/my-feedback`, each cross-referencing the
|
|
226
|
+
other. Leaving an upstream-owned lever buried as a local item it can't fix is the
|
|
227
|
+
failure mode this rule exists to prevent.
|
|
228
|
+
- **Write ONE consolidated feedback item** (for the this-project-owned half) into
|
|
229
|
+
this project's intake folder, named by the folder README's convention
|
|
230
|
+
(`feedback/<YYYY-MM-DD>-NN-kpi-optimization.md`, next free `NN`), with: title,
|
|
231
|
+
**From:** `optimize-kpi loop`, date (PT), priority + why, **TL;DR**, **Evidence**
|
|
232
|
+
(cite the Step-1 scorecard numbers, the **Step-1b usage+log findings** the root
|
|
233
|
+
cause rests on, *and* the Step-2 prior-lever grade), **Why it matters**
|
|
234
|
+
(expected KPI gain), and **Ask** (the numbered implementation steps from the
|
|
235
|
+
winning proposal). The Ask **must** carry a falsifiable acceptance test: the
|
|
236
|
+
numeric success criterion + measure-by date the next run will grade it against.
|
|
237
|
+
Note which of the 3 agents it drew from and why it rejected the others.
|
|
238
|
+
- **Write/refresh a ranked backlog** at `docs/kpi-optimization-backlog.md`: the
|
|
239
|
+
eligible-but-not-chosen levers, ranked, each with its one-line rationale and
|
|
240
|
+
expected delta. The next iteration reads this first and can pull the next-best
|
|
241
|
+
lever without re-deriving from scratch. Remove entries that shipped or went
|
|
242
|
+
stale.
|
|
243
|
+
|
|
244
|
+
The consolidator writes the feedback file + backlog; it does **not** touch
|
|
245
|
+
project source.
|
|
246
|
+
|
|
247
|
+
## Step 5 — Hand off to the scheduler (do NOT implement)
|
|
248
|
+
|
|
249
|
+
Dispatch the consolidated item through the scheduler pipeline:
|
|
250
|
+
|
|
251
|
+
- Invoke **`/process-feedback`**, scoped to the one file you just wrote (name it
|
|
252
|
+
explicitly — never let it sweep unrelated open items). `/process-feedback`
|
|
253
|
+
evaluates it and queues the codeable work as PRDs via **`/develop`** onto the
|
|
254
|
+
session-manager scheduler, then tracks those PRDs to completion.
|
|
255
|
+
- This skill does **not** edit code, run `/code-review`/`/security-review`, bump
|
|
256
|
+
`VERSION`, commit, or reboot anything. All of that happens as the scheduled
|
|
257
|
+
PRDs run headlessly. Your job ends at "filed + dispatched + tracked".
|
|
258
|
+
|
|
259
|
+
## Step 6 — Log the iteration
|
|
260
|
+
|
|
261
|
+
Append one line to `docs/kpi-optimization-log.md` (create if missing):
|
|
262
|
+
`<date> | KPI <today> (trend <dir>) | breaches <n> | prior lever: <one-line> → <helped|no-effect|regressed|too-early> | lever filed: <one-line> (target: <numeric>, by <date>) | feedback: <file> | PRDs: <ids or "queued">`.
|
|
263
|
+
This is the running record — and the input Step 2 grades next time.
|
|
264
|
+
|
|
265
|
+
## Stop conditions
|
|
266
|
+
|
|
267
|
+
- **No KPI declared** (Step 0) → STOP, ask the user to add it to CLAUDE.md.
|
|
268
|
+
- **Validity gate fails** (Step 1) → file the "restore the driving pipeline" item,
|
|
269
|
+
hand off, log, and stop the iteration — skip the tuning fan-out entirely.
|
|
270
|
+
- **Step-1b audit finds an ops failure that is itself the dominant KPI cause**
|
|
271
|
+
(a dead/failing consumer, a crashing or max-duration-overrunning pipeline) →
|
|
272
|
+
file *that* fix and skip the tuning fan-out; it outranks any tuning lever.
|
|
273
|
+
- **KPI already at/above target** with zero breaches for 2 consecutive days →
|
|
274
|
+
file a *consolidation / quality-hardening* recommendation instead of a coverage
|
|
275
|
+
one (move toward the architecture end-state the KPI section describes).
|
|
276
|
+
- **Everything eligible is in-flight/cooldown** (Step 2 leaves no eligible lever)
|
|
277
|
+
→ do not invent a duplicate. Log "no eligible lever — N in flight" and stop;
|
|
278
|
+
next run grades them.
|
|
279
|
+
- **Measurement, the agents, or `/process-feedback` fail** → STOP, leave the tree
|
|
280
|
+
untouched (you never modified source anyway), and report what broke. Never file
|
|
281
|
+
a recommendation built on a failed measurement.
|
|
282
|
+
|
|
283
|
+
## Scheduling
|
|
284
|
+
|
|
285
|
+
Typically run as a daily `/loop` (the project may install a cron that drives this
|
|
286
|
+
skill headless). Each firing runs Steps 0–6 once. Because implementation is
|
|
287
|
+
delegated to the scheduler, this skill stays fast and side-effect-light: its only
|
|
288
|
+
writes to the repo are the temp recommender files, the one feedback item, the
|
|
289
|
+
backlog, and the log line.
|