claude-code-session-manager 0.27.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-BsNr6F0B.js → TiptapBody-CJ6GK5CM.js} +1 -1
- package/dist/assets/{index-DU1pkhIQ.js → index-DtQ4LzuV.js} +243 -242
- package/dist/index.html +1 -1
- 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/scheduler.cjs +76 -3
- package/src/main/templates/PRD_AUTHORING.md +316 -0
package/dist/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Geist:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-DtQ4LzuV.js"></script>
|
|
11
11
|
<link rel="modulepreload" crossorigin href="./assets/monaco-editor-BW5C4Iv1.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./assets/monaco-editor-BTnBOi8r.css">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="./assets/index-Dwb94Uxm.css">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-session-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Local cockpit for the Claude Code CLI — multi-tab terminal, full config surface, scheduler, voice dictation, and live observability.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main/index.cjs",
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/",
|
|
12
|
+
".claude-plugin/",
|
|
13
|
+
"plugins/",
|
|
12
14
|
"src/main/",
|
|
13
15
|
"src/preload/",
|
|
14
16
|
"dist/index.html",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "session-manager-dev",
|
|
3
|
+
"description": "The default end-to-end development skillset for the Claude Code Session Manager: decompose work into scheduler PRDs (/develop, /prd), triage cross-project feedback (/process-feedback, /my-feedback), roll up operational status and optimize the North-Star KPI (/project-status, /optimize-kpi, /local-project-health), gate with review (/requesting-code-review, /security-review), and document how the project works (/explain-to-me). Together with the session-manager scheduler these form a closed develop → queue → track → review → status → improve loop.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Stanislav Georgiev",
|
|
7
|
+
"url": "https://github.com/StanislavBG"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/StanislavBG/claude-code-session-manager",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"development",
|
|
12
|
+
"scheduler",
|
|
13
|
+
"prd",
|
|
14
|
+
"feedback",
|
|
15
|
+
"code-review",
|
|
16
|
+
"kpi",
|
|
17
|
+
"session-manager"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: develop
|
|
3
|
+
description: >-
|
|
4
|
+
Lead a software-development task by decomposing a feature/refactor/bugfix prompt into a
|
|
5
|
+
series of self-contained PRDs queued for the session-manager scheduler, each carrying the
|
|
6
|
+
engineering standards inline so the headless executor honors them — then track those PRDs
|
|
7
|
+
to completion, verify them against their acceptance criteria, and report back. Use whenever
|
|
8
|
+
the user says "/develop", "develop X", "build me X", "implement X", "let's code X", or
|
|
9
|
+
otherwise starts dev work that should run as scheduled PRDs rather than inline now. This
|
|
10
|
+
skill is the home for the developer-only guidance (performance, debugging, API-reuse, TDD)
|
|
11
|
+
that was removed from the always-on global CLAUDE.md. Keywords: develop, build, implement,
|
|
12
|
+
code, feature, refactor, bugfix, queue dev work, PRDs.
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /develop — prompt → scheduled PRDs → tracked to done
|
|
16
|
+
|
|
17
|
+
**Role:** `/develop` owns the *pipeline*: it turns a development request into one or more
|
|
18
|
+
self-contained PRDs, queues them, and tracks them to completion. It is the convergence point
|
|
19
|
+
for both entry paths — an interactive human prompt comes straight here; an agent feedback file
|
|
20
|
+
arrives via `/process-feedback`, which evaluates it and then calls this skill. Everything from
|
|
21
|
+
here on is identical regardless of who asked.
|
|
22
|
+
|
|
23
|
+
**Never** hand-implement the work inline in chat, and never restate rules that live elsewhere:
|
|
24
|
+
single-PRD structure/sizing belongs to `/prd`, the engineering rules belong to `standards.md`.
|
|
25
|
+
Reference them; don't fork them.
|
|
26
|
+
|
|
27
|
+
## Standards (single source of truth)
|
|
28
|
+
|
|
29
|
+
The engineering standards (Performance, Debugging, API reuse / single source of truth, TDD,
|
|
30
|
+
and the executor-facing Execution discipline) live in **`standards.md`** beside this file:
|
|
31
|
+
`~/.claude/skills/develop/standards.md`. Read it, hold it while planning, and inline it
|
|
32
|
+
verbatim into every PRD you emit (Phase 1 step 4). Never restate or fork its content — one
|
|
33
|
+
concept, one implementation.
|
|
34
|
+
|
|
35
|
+
For interactive dev work, also apply the `test-driven-development` and `systematic-debugging`
|
|
36
|
+
skills; the headless PRDs get the distilled core from `standards.md` instead, since they
|
|
37
|
+
can't load skills.
|
|
38
|
+
|
|
39
|
+
## Phase 1 — Author + queue the PRDs
|
|
40
|
+
|
|
41
|
+
1. **Clarify scope first.** If the prompt has genuine ambiguity (acceptance criteria, target
|
|
42
|
+
repo, framework, edge cases), ask 2–4 focused questions as plain text and wait. Don't use
|
|
43
|
+
the AskUserQuestion tool. Don't guess on decisions that would cost real rework. (When the
|
|
44
|
+
caller is `/process-feedback`, scope is already established by its evaluation — don't
|
|
45
|
+
re-ask; build from the brief it hands you.)
|
|
46
|
+
|
|
47
|
+
2. **Explore the target repo.** Identify the absolute `cwd`, existing patterns/utilities to
|
|
48
|
+
reuse (per the API-reuse standard — search before writing new code), the test command, and
|
|
49
|
+
any constraints. Capture exact file paths and signatures; they go straight into the PRDs.
|
|
50
|
+
|
|
51
|
+
3. **Decompose into a series of SMALL, bounded PRDs.** This is the part `/develop` owns that
|
|
52
|
+
`/prd` doesn't: split a large ask into multiple PRDs and sequence them. For each PRD's
|
|
53
|
+
*size, command-bounding, `NN` parallel group, and structure*, follow `~/.claude/skills/prd/SKILL.md`
|
|
54
|
+
— it is the canonical authority; do not restate its rules here. To pick `NN`, **compute the
|
|
55
|
+
highest in-use number deterministically — never eyeball or narrow-grep the `ls`** (a
|
|
56
|
+
narrowed pattern like `'^10[0-9]'` silently misses `110+` and collides):
|
|
57
|
+
```bash
|
|
58
|
+
ls ~/.claude/session-manager/scheduled-plans/prds/ | grep -oE '^[0-9]+' | sort -n | uniq | tail -5
|
|
59
|
+
```
|
|
60
|
+
The last line is the current max. Then: same `NN` as a logically independent sibling that
|
|
61
|
+
can run in parallel; **next free `NN` = max+1** when this PRD hard-depends on prior work or
|
|
62
|
+
is unrelated to every existing group. Record each cross-PRD dependency in the dependent
|
|
63
|
+
PRD's notes.
|
|
64
|
+
|
|
65
|
+
4. **Emit each PRD** to the canonical path per `/prd`'s structure, then **append `## Engineering
|
|
66
|
+
standards` and paste the full contents of `standards.md` verbatim.** This is the
|
|
67
|
+
load-bearing step — it's the only way the standards (incl. Execution discipline) reach the
|
|
68
|
+
headless run. Honor the `PRD_AUTHORING.md` §10 pre-queue checklist.
|
|
69
|
+
|
|
70
|
+
5. **Confirm to the user**, per emitted PRD: filename, chosen `NN` + rationale
|
|
71
|
+
(parallel-with-X / serial-after-Y), `cwd`, and an ETA + token-cost ballpark. Note they can
|
|
72
|
+
"Run now" in the SchedulePanel or wait for `when-available` polling.
|
|
73
|
+
|
|
74
|
+
## Phase 2 — Track to completion (reusable tail)
|
|
75
|
+
|
|
76
|
+
The queued PRDs run headlessly and can take a while. Don't fire-and-forget, and don't block —
|
|
77
|
+
hand off to a recurring check. `/process-feedback` delegates to this exact phase, so it is the
|
|
78
|
+
single definition of "tracked to done" for both entry paths.
|
|
79
|
+
|
|
80
|
+
6. **Watch the scheduler every ~30 min.** Start a 30-minute monitoring loop (`/loop 30m` over
|
|
81
|
+
this watch step, or a `ScheduleWakeup` at 1800s if self-pacing) scoped to the PRD ids you
|
|
82
|
+
emitted. On each tick, read the scheduler's job status (queue + run history under
|
|
83
|
+
`~/.claude/session-manager/scheduled-plans/`, or the SchedulePanel) and branch:
|
|
84
|
+
- **Still queued / running, within its window** — leave it; re-check next tick.
|
|
85
|
+
- **Failed / errored / `needs_review` / timed out / killed by the watchdog or supervisor /
|
|
86
|
+
overran its estimate badly** — STOP waiting and surface it now: which PRD, the failure
|
|
87
|
+
signal, the relevant log tail, and the likely cause (a stuck poll-loop or post-AC overrun
|
|
88
|
+
per `PRD_AUTHORING.md`). Don't silently retry forever. A `rateLimited` exit-1 is the
|
|
89
|
+
scheduler's benign auto-pause (auto-resumes next window) — keep waiting, don't escalate.
|
|
90
|
+
- **All PRDs completed successfully** — go to step 7.
|
|
91
|
+
|
|
92
|
+
7. **Gate: definition of done** (same for both entry paths). Once the code has landed:
|
|
93
|
+
- **Verify live against each PRD's acceptance criteria** — run the health check, hit the
|
|
94
|
+
endpoint, show before/after. The headless run asserted its own test command; this is the
|
|
95
|
+
interactive confirmation it actually does what was asked.
|
|
96
|
+
- For a **major feature or risky change**, dispatch a review via the
|
|
97
|
+
`requesting-code-review` skill before calling it done; fix Critical/Important findings.
|
|
98
|
+
- **Report back**: what landed, PRD/commit refs, verification result, anything left open.
|
|
99
|
+
|
|
100
|
+
## References (reuse, don't duplicate)
|
|
101
|
+
|
|
102
|
+
- `~/.claude/skills/prd/SKILL.md` — canonical single-PRD structure, location, filename rules, scope sizing.
|
|
103
|
+
- `~/.claude/session-manager/scheduled-plans/PRD_AUTHORING.md` — the §1–§10 safety rules.
|
|
104
|
+
- `~/.claude/skills/develop/standards.md` — the engineering + execution-discipline rules inlined into every PRD.
|
|
105
|
+
- `test-driven-development`, `systematic-debugging` — interactive dev sessions.
|
|
106
|
+
- `requesting-code-review` — the Phase-2 review gate.
|
|
107
|
+
|
|
108
|
+
## Notes
|
|
109
|
+
|
|
110
|
+
- Write PRD files directly, then confirm — don't draft them inline in chat for review first.
|
|
111
|
+
- Don't combine unrelated features into one PRD. One focused, completable unit each.
|
|
112
|
+
- Don't add a `parallelGroup` frontmatter key — the filename `NN-` prefix drives grouping.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Engineering standards
|
|
2
|
+
|
|
3
|
+
> Single source of truth for the developer guidance that used to live in the global
|
|
4
|
+
> `~/.claude/CLAUDE.md`. Consumers: the `/develop` skill reads it while planning and
|
|
5
|
+
> inlines it **verbatim** into every PRD it emits (under an `## Engineering standards`
|
|
6
|
+
> heading); the `/prd` command points here for the execution-discipline rules so a
|
|
7
|
+
> directly-authored PRD carries the same block. The headless `claude -p` executor sees no
|
|
8
|
+
> skills and no conversation — inlining this is the only way these rules reach it. Edit
|
|
9
|
+
> here once; every call site updates.
|
|
10
|
+
>
|
|
11
|
+
> The **Execution discipline** section below is the executor-facing core — it is the part
|
|
12
|
+
> that MUST appear in every PRD body. The rest (Performance, Debugging, API reuse, TDD)
|
|
13
|
+
> guides authoring and interactive work.
|
|
14
|
+
|
|
15
|
+
## Performance
|
|
16
|
+
|
|
17
|
+
- State the time and space complexity of any non-trivial algorithm in a comment.
|
|
18
|
+
- Flag any nested loop over user-scaled data as a complexity hazard.
|
|
19
|
+
- Prefer O(n) solutions over O(n log n) only when n is provably small or constant.
|
|
20
|
+
- Lay out hot data contiguously and traverse it in memory order.
|
|
21
|
+
- Prefer arrays of structs or structs of arrays based on actual access patterns.
|
|
22
|
+
- Avoid pointer-chasing in inner loops on large datasets.
|
|
23
|
+
|
|
24
|
+
## Debugging approach
|
|
25
|
+
|
|
26
|
+
- State an explicit hypothesis before each debugging action.
|
|
27
|
+
- Describe what observation would confirm or refute the hypothesis.
|
|
28
|
+
- If three hypotheses fail, stop and re-examine your assumptions from scratch.
|
|
29
|
+
- When a bug was recently introduced, bisect commits to find the offender.
|
|
30
|
+
- When a bug is in a long pipeline, halve the input or code path until it localizes.
|
|
31
|
+
- Record each bisection step so the path to the root cause is reproducible.
|
|
32
|
+
- Never attempt a fix until you can reproduce the bug on demand.
|
|
33
|
+
- Capture the reproduction as a failing test before changing production code.
|
|
34
|
+
- If the bug cannot be reproduced, instrument the system until it can.
|
|
35
|
+
|
|
36
|
+
## API reuse and single source of truth
|
|
37
|
+
|
|
38
|
+
- One concept = one implementation. Before writing code that computes, fetches, formats, or displays a value, search the codebase for an existing implementation and reuse it. Do not write a second or third copy of the same logic.
|
|
39
|
+
- N display sites, ONE source. When the same datum appears in multiple places (a metric shown in several tabs, a value returned by several endpoints), it must flow from a single shared accessor / store / hook / endpoint. Displaying something in 3 places must not mean 3 implementations — it means 1 implementation with 3 call sites.
|
|
40
|
+
- Extend, don't fork. If an existing function/module/API is close but not sufficient, generalize it (add a param, widen the contract) rather than cloning a divergent variant. Prefer composition over duplication.
|
|
41
|
+
- Treat duplication as a latent bug. Copy-pasted logic drifts; divergence between copies is how silent inconsistencies ship (e.g. one site reads a 0–100 percentage as a 0–1 fraction). When you see the same logic in two places, consolidate it on sight and route both through the shared unit.
|
|
42
|
+
- Design for extensibility: stable shared contracts, single ownership, callers depend on the contract — not on a private copy. New surfaces consume the canonical API; they never reimplement it.
|
|
43
|
+
- When reviewing or implementing, explicitly check: "is this value/behaviour already produced elsewhere, and am I reusing that path?" If not, fix the reuse before adding the feature.
|
|
44
|
+
|
|
45
|
+
## Test-driven development
|
|
46
|
+
|
|
47
|
+
- Write the failing test first, then the implementation that makes it pass — for every feature and every bugfix.
|
|
48
|
+
- A bugfix starts with a test that reproduces the bug (red), then the fix (green).
|
|
49
|
+
- Do not write production code without a test asserting the behavior it adds.
|
|
50
|
+
- (Interactive sessions: the `test-driven-development` skill has the full red-green-refactor
|
|
51
|
+
workflow. Headless PRD runs can't load it — the three rules above are the load-bearing core.)
|
|
52
|
+
|
|
53
|
+
## Execution discipline (headless runs)
|
|
54
|
+
|
|
55
|
+
Data-driven from 400+ scheduler runs: long hangs (not bad code) are the dominant real failure, and "exited clean but left a red test" is the top verifier downgrade. These rules run at execution time — they are inlined into every PRD because the headless executor reads nothing else.
|
|
56
|
+
|
|
57
|
+
- **Bound every command.** Wrap every test/build/dev-server/deploy/poll command in a hard timeout: `timeout 300 <typecheck|unit>`, `timeout 120 <one e2e spec>`, `curl --max-time 15`. Never run a bare `playwright test`/`vite`/`pnpm dev`, a full e2e suite, or an endpoint-polling publish — those are the SIGTERM/4h-watchdog tail.
|
|
58
|
+
- **Verify before done.** Run the acceptance test command once before declaring success. If it's red, fix it or `exit 1` with the failure — never end the run on a failing test (that trips the verifier's `transcript_errors` downgrade).
|
|
59
|
+
- **Fail loud, fail fast.** On any step failure, print one diagnostic line and `exit 1`; don't swallow with `|| true` or spin in a silent retry. A `rateLimited` exit-1 is the scheduler's benign auto-pause (auto-resumes next window) — not a failure to engineer around.
|
|
60
|
+
- **Stay in the AC.** Do not add work past the acceptance checklist ("while we're here" generators/fixtures are the post-AC-overrun incident). Body must be clean UTF-8 — no NUL/control bytes.
|
|
61
|
+
- **Negative-assertion checks must exit 0 when clean.** A check that verifies the *absence* of something (a `grep` that should find nothing, "no leftover X", `diff` expecting no change) must return exit 0 on the clean case. A bare `grep` exits **1 on no-match** — so the *success* path surfaces as `is_error=true` and the verifier downgrades a perfect run to `needs_review`. Always invert: `if <detector>; then echo "HALT: <what was found>"; exit 1; fi; echo clean`. Never let the no-match/empty path carry the non-zero exit.
|
|
62
|
+
- **Recover or annotate every error — don't strand a Traceback in the transcript.** The verifier downgrades an otherwise-perfect run to `needs_review` when a `Traceback`/`Error` appears with *no visible recovery within ~10 lines* (the `transcript_errors` heuristic — the single most common false-positive on green deliverables). Two executor habits cause it: (1) **throwaway probes that error** — an inline `python -c` with a quoting/f-string slip, a wrong kwarg, a bad path. When a probe errors, immediately re-run the corrected version *or* print one line `# expected/handled: <why>` right after, so recovery is adjacent. Don't move on leaving a bare error as the last thing in that step. Prefer a small temp `.py` file over a fragile multi-quote `python -c` one-liner (inline f-string errors are the top source of stranded tracebacks). (2) See the timeout rule below.
|
|
63
|
+
- **An *expected* bounded-timeout (exit 124) must be annotated, not bare.** `timeout`-capping a genuinely long task you expect to hit the cap (a full-universe ingest, a long scan) is correct — but a bare `Exit code 124` reads as a failure to the verifier. Wrap it so the cap is a success-with-note: `timeout 120 <cmd> || { rc=$?; [ $rc -eq 124 ] && echo "hit time cap — idempotent/partial, rows persist incrementally; OK" || { echo "HALT: <cmd> failed rc=$rc"; exit 1; }; }`. (Distinguish 124 = expected cap from a real non-zero.) For work that legitimately needs longer than a safe cap, run it in the background and poll a bounded number of times rather than capping the foreground command.
|
|
64
|
+
- **Finish so the verifier auto-clears you.** The scheduler appends a finish protocol that requires you to COMMIT your work and emit `SCHEDULER_VERDICT: PASS` (or `FAIL <reason>` + `exit 1`) as the literal last line. Honor it exactly: a *truthful* PASS plus a commit that landed during the run is what lets the verifier override incidental transcript noise (a grep hit containing "Error", a TDD red-phase run, a debug Traceback) instead of parking the job in `needs_review` for a human. A job that exits 0 with **uncommitted** changes, or with no PASS sentinel, is the #1 cause of needless `needs_review`. Never print PASS on a red gate — a lying PASS turns the verifier into a silent-failure shipper.
|
|
65
|
+
- **Don't leak expected-error text into tool output.** The verifier pattern-matches transcript content for `Traceback`/`FAIL`/`Error:`. When a step is *expected* to error (a TDD red-phase test, an availability/existence probe, a "should raise" assertion), don't let the raw exception land verbatim — capture it and surface a clean token instead: `if python -c '…' 2>/dev/null; then echo PROBE_OK; else echo PROBE_ABSENT; fi`, or pipe the noisy run through a matcher that prints only `RED (expected)` / `GREEN`. When you retry a transient failure, re-run the **same command with the same description** — the verifier's self-recovery detector pairs a failed call with a later identical-description call that succeeds and clears it.
|
|
66
|
+
- **End green: run the acceptance/test gate LAST, and let nothing error after it.** The post-run verifier scans the transcript and downgrades to `needs_review` on error markers — and weighs the *final* portion of the run most heavily (a tool error in the last ~20% trips it even if everything actually passed). So order the run so the last command is the green AC gate: do any intentionally-failing step (e.g. a TDD red test, an expected-nonzero probe) **early**, never after the gate. If you must demonstrate a failure late, capture it so it doesn't surface as a raw `is_error`/`Traceback` (`… 2>&1 | tail` inside a conditional, or assert on the captured text) rather than letting it hit the transcript bare.
|
|
67
|
+
- **The verdict sentinel is your authoritative "I passed" signal — emit it truthfully.** The scheduler appends a FINISH PROTOCOL that ends by printing `SCHEDULER_VERDICT: PASS` once the AC gate is green and the commit has landed (or `SCHEDULER_VERDICT: FAIL <reason>` + `exit 1` otherwise). The verifier treats `PASS` + a commit that landed during the run as **authoritative** and overrides incidental transcript markers — so a *deliberately reproduced* red test (systematic-debugging) or a grep result containing the word "Error" will **not** false-trip `needs_review`, as long as the run genuinely ends green and committed. Never print `PASS` when the gate is red — that's the one thing that turns a safety net into a silent-failure machine.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explain-to-me
|
|
3
|
+
description: >-
|
|
4
|
+
Build and maintain HUMAN_LEARN/ — a human-readable, visually-rich HTML
|
|
5
|
+
knowledge base at the repo root that explains how this project actually works.
|
|
6
|
+
Deep-probes the codebase for a given topic/component (real file:line refs,
|
|
7
|
+
real constants, real on-disk state — never invented), then writes or updates a
|
|
8
|
+
clean, self-contained HTML — one combined component page (HUMAN_LEARN/index.html)
|
|
9
|
+
plus a separate skill-chain map (HUMAN_LEARN/SKILL_MAP.html) for the local-dev
|
|
10
|
+
workflow — with advanced CSS, flow diagrams, sticky nav, collapsible tables. Use
|
|
11
|
+
whenever the user says "/explain-to-me X", "explain X to me", "explain how X
|
|
12
|
+
works", "document X for me", "add X to HUMAN_LEARN", "make me a human-readable
|
|
13
|
+
page for X", or "update the skill map". Keywords: explain, explain-to-me,
|
|
14
|
+
human-learn, HUMAN_LEARN, skill map, document, one-pager, how does X work, visual
|
|
15
|
+
explainer, knowledge base.
|
|
16
|
+
model: opus
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# explain-to-me
|
|
20
|
+
|
|
21
|
+
Turn a question about this codebase ("explain how the scheduler works") into a
|
|
22
|
+
**clean, visually-rich HTML one-pager** in `HUMAN_LEARN/` at the repo root, and
|
|
23
|
+
keep that folder's index coherent as it grows. The output is for a *human*
|
|
24
|
+
catching up on the project — not for the model. It is the human-facing complement
|
|
25
|
+
to the Memory tab (which is Claude's own terse recall store).
|
|
26
|
+
|
|
27
|
+
The bar: **clean, explanatory, visually rich, self-contained** (opens directly in
|
|
28
|
+
a browser — no build, no external network deps). Every claim grounded in the
|
|
29
|
+
actual code.
|
|
30
|
+
|
|
31
|
+
**Document the CURRENT state, present-tense — never the journey.** A reader wants
|
|
32
|
+
to know *what the project is and how it works right now*, not how it got there.
|
|
33
|
+
This is a snapshot of the system as it stands today, not a changelog. So:
|
|
34
|
+
|
|
35
|
+
- **No PRD numbers, ticket ids, or commit refs** ("added in PRD 66", "schema
|
|
36
|
+
bumped to v3"). State the field/behavior as it simply *is* — `panels.ticker_metrics`
|
|
37
|
+
*carries* an `as_of` freshness field; don't say when or why it was added.
|
|
38
|
+
- **No evolution or "was X → now Y"** ("grew from 2 to 5 tools", "migrated off the
|
|
39
|
+
local cache", "reborn processed"). Describe the 5 tools that exist; the prior
|
|
40
|
+
count is irrelevant to someone reading today.
|
|
41
|
+
- **No incident/history narrative** ("the 06-10 churn incident", "the outage that
|
|
42
|
+
shaped this", "the bug we fixed"). If a guard exists, describe *what it guards*
|
|
43
|
+
in the present, not the failure that motivated it.
|
|
44
|
+
- **No migration tiers / in-flight roadmap / "gated" future work.** Document what
|
|
45
|
+
is true now; a thing that's being retired is just "internal, not on the public
|
|
46
|
+
surface" today.
|
|
47
|
+
|
|
48
|
+
Present-tense **design rationale is fine and useful** — *why the system is shaped
|
|
49
|
+
this way as it stands* (a tradeoff, a complexity bound, a boundary rule). That is
|
|
50
|
+
not history. The line is: explain the *standing* reason, never the *chronology*.
|
|
51
|
+
If you can't state it in the present tense without a date or a PRD, cut it.
|
|
52
|
+
|
|
53
|
+
## Where things live
|
|
54
|
+
|
|
55
|
+
- Repo root: `git rev-parse --show-toplevel` (fall back to cwd if not a git repo).
|
|
56
|
+
- Knowledge base: `<root>/HUMAN_LEARN/`. Create it if missing.
|
|
57
|
+
- **One combined page** — `HUMAN_LEARN/index.html`. Every component explainer is a
|
|
58
|
+
`<section>` in this single file, under a sticky section-nav, ordered so the page
|
|
59
|
+
reads top-to-bottom as one narrative. A new topic becomes a **new `<section>`**,
|
|
60
|
+
never a new file. One navigable page that logically follows itself beats a folder
|
|
61
|
+
of thin pages; do not re-introduce per-topic `.html` files.
|
|
62
|
+
- **The Skill Map** — `HUMAN_LEARN/SKILL_MAP.html`, a **separate, dedicated** page
|
|
63
|
+
(NOT a section of index.html) that visualizes the *local-development skill chain*:
|
|
64
|
+
the two intakes (interactive human prompt; agent feedback via `/process-feedback`)
|
|
65
|
+
converging on `/develop`, which reads `/prd` + `standards.md`, queues onto the
|
|
66
|
+
scheduler, and gates with review/verify — plus `/my-feedback` outbound. It is the
|
|
67
|
+
"how I build on this project" companion to index.html's "how this project works."
|
|
68
|
+
index.html links to it from the nav; it links back.
|
|
69
|
+
|
|
70
|
+
## Workflow
|
|
71
|
+
|
|
72
|
+
1. **Locate & survey.** Find the repo root + `HUMAN_LEARN/`. If `index.html`
|
|
73
|
+
exists, read it to see what's already documented — you are *maintaining* a
|
|
74
|
+
knowledge base, not starting fresh. If the topic already has a page/section,
|
|
75
|
+
you are updating it, not duplicating it.
|
|
76
|
+
2. **Deep-probe the topic.** Read the real code. Gather exact `file:line`
|
|
77
|
+
references, real constant names + values, and real on-disk state where it
|
|
78
|
+
matters (run `ls`/`cat`/`jq` to ground claims in what actually exists). For a
|
|
79
|
+
broad topic, fan out parallel `Explore` subagents over the relevant
|
|
80
|
+
subsystems and collect the conclusions. **Never invent** a path, constant, or
|
|
81
|
+
behavior — if you can't verify it, don't write it.
|
|
82
|
+
3. **Decide placement.** A component/subsystem topic → a new (or edited) `<section>`
|
|
83
|
+
in `index.html`, slotted into the narrative order. The dev skill chain → it's in
|
|
84
|
+
`SKILL_MAP.html`. Re-explaining an existing topic → edit that section in place,
|
|
85
|
+
refresh the "generated" date. Never spin up a new per-topic `.html`.
|
|
86
|
+
4. **Write the HTML.** Use the design system below — both pages share the same tokens
|
|
87
|
+
and components so they read as one product. A page must be self-contained (inline
|
|
88
|
+
`<style>`, no external fonts/scripts/CDNs). Lead with what the thing *is* and *when
|
|
89
|
+
it runs*, then the step-by-step flow with `file:line` tags, then the knobs (a
|
|
90
|
+
collapsible constants table), then the present-tense design rationale ("why
|
|
91
|
+
it's shaped this way" as it *stands* — a standing tradeoff/bound, never a dated
|
|
92
|
+
history or a PRD).
|
|
93
|
+
5. **Wire the navigation.** Add/refresh the topic's pill in `index.html`'s sticky
|
|
94
|
+
section-nav (and the footer's source-file list). Keep the nav and `SKILL_MAP.html`
|
|
95
|
+
cross-links intact: index.html's nav has a "⛓ Skill Map ↗" link, SKILL_MAP.html's
|
|
96
|
+
nav links back to "📖 HUMAN_LEARN".
|
|
97
|
+
6. **Maintain the Skill Map.** When the local-dev skills/commands change — a new skill
|
|
98
|
+
in `~/.claude/skills/`, a changed Role/Never contract, a re-routed step in the
|
|
99
|
+
chain — refresh `SKILL_MAP.html` (its chain diagram + the role-contract table +
|
|
100
|
+
the two walkthroughs) so it stays a faithful map of the actual files on disk.
|
|
101
|
+
7. **Tell the user the path** to open (`HUMAN_LEARN/index.html` or
|
|
102
|
+
`HUMAN_LEARN/SKILL_MAP.html`, optionally with a `#anchor`). Do not commit unless asked.
|
|
103
|
+
|
|
104
|
+
## Grounding rules (non-negotiable)
|
|
105
|
+
|
|
106
|
+
- Every behavioral claim cites a real `file:line`. Spot-check by reading the
|
|
107
|
+
cited line before writing it.
|
|
108
|
+
- Constants show their real values from the source, not approximations.
|
|
109
|
+
- "On disk" claims are verified with a real command first.
|
|
110
|
+
- If two sources disagree (e.g. a stale CLAUDE.md vs the code), trust the code
|
|
111
|
+
and note the discrepancy.
|
|
112
|
+
|
|
113
|
+
## Maintenance
|
|
114
|
+
|
|
115
|
+
- Idempotent: re-running for the same topic updates that `<section>` (and its nav
|
|
116
|
+
pill) in place — it never appends a duplicate or spawns a new file.
|
|
117
|
+
- Never clobber unrelated sections. Edit the one section the topic owns.
|
|
118
|
+
- Refresh the footer "generated <date>" and the source-file list on each update.
|
|
119
|
+
- HUMAN_LEARN holds exactly two pages: `index.html` (components, one combined page)
|
|
120
|
+
and `SKILL_MAP.html` (the dev skill chain). They cross-link via their navs. Don't
|
|
121
|
+
add a third page.
|
|
122
|
+
|
|
123
|
+
## Design system
|
|
124
|
+
|
|
125
|
+
Reuse these tokens and patterns verbatim so every page looks like one product.
|
|
126
|
+
A complete, copy-ready exemplar lives at `assets/style-reference.html` next to
|
|
127
|
+
this file — **read it and mirror its structure/CSS** for any new page. The
|
|
128
|
+
essentials:
|
|
129
|
+
|
|
130
|
+
**Palette + base** (inline `<style>`, dark theme):
|
|
131
|
+
|
|
132
|
+
```css
|
|
133
|
+
:root{
|
|
134
|
+
--bg:#0d1117; --panel:#161b22; --panel2:#1c2330; --line:#2d333b;
|
|
135
|
+
--fg:#e6edf3; --dim:#9da7b3; --faint:#6e7681;
|
|
136
|
+
--blue:#60a5fa; --green:#34d399; --amber:#fbbf24; --violet:#a78bfa;
|
|
137
|
+
--pink:#f472b6; --red:#f87171; --cyan:#22d3ee;
|
|
138
|
+
--mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
|
|
139
|
+
}
|
|
140
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
141
|
+
html{scroll-behavior:smooth}
|
|
142
|
+
body{background:var(--bg);color:var(--fg);
|
|
143
|
+
font:15px/1.6 ui-sans-serif,system-ui,sans-serif;padding:0 20px 80px}
|
|
144
|
+
.wrap{max-width:980px;margin:0 auto}
|
|
145
|
+
code{font-family:var(--mono);font-size:12.5px;background:var(--panel2);
|
|
146
|
+
border:1px solid var(--line);border-radius:4px;padding:1px 5px}
|
|
147
|
+
pre{font-family:var(--mono);font-size:12px;background:var(--panel);
|
|
148
|
+
border:1px solid var(--line);border-radius:8px;padding:14px 16px;overflow-x:auto}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Component patterns** (use the ones the topic needs — don't force all of them):
|
|
152
|
+
|
|
153
|
+
- **`.loc` chip** — a cyan monospace pill for every `file:line` reference. This is
|
|
154
|
+
the signature element: claims are traceable.
|
|
155
|
+
`font:11px var(--mono);color:var(--cyan);background:rgba(34,211,238,.08);
|
|
156
|
+
border:1px solid rgba(34,211,238,.25);border-radius:99px;padding:1px 9px`
|
|
157
|
+
- **`.proc` badge** — colored uppercase pill marking *where* a step runs
|
|
158
|
+
(e.g. shell hook / main process / subprocess / renderer / disk / network). One
|
|
159
|
+
color per layer; show a legend once near the top.
|
|
160
|
+
- **Sticky section nav** — for multi-section pages: a `position:sticky;top:0`
|
|
161
|
+
bar with `backdrop-filter:blur(6px)` and pill links to each `#section`.
|
|
162
|
+
- **Flow diagram** — a horizontal row of `.box` cards joined by `→` arrows for a
|
|
163
|
+
pipeline, OR a numbered vertical "stage" stack for a deeper step-by-step. Each
|
|
164
|
+
box: a title, a one-line what, and a `.where` `file:line`. Color the top border
|
|
165
|
+
by the layer it runs in.
|
|
166
|
+
- **Stat strip** — a row of big-number cards for the load-bearing figures
|
|
167
|
+
(counts, caps, sizes) pulled from real state.
|
|
168
|
+
- **Callout** — left-border tinted block for "the key insight" / "the caveat"
|
|
169
|
+
(`.ok` green, `.bad` red, default amber).
|
|
170
|
+
- **Collapsible constants table** — `<details><summary>` wrapping a table of
|
|
171
|
+
`constant · value · file:line · what it bounds`. Keeps the page scannable.
|
|
172
|
+
- **Two-column rationale** — a `grid-template-columns:1fr 1fr` "why it's shaped
|
|
173
|
+
this way" section, collapsing to one column under `@media(max-width:760px)`.
|
|
174
|
+
- **Footer** — muted, lists the exact source files the page was distilled from +
|
|
175
|
+
"generated <date>".
|
|
176
|
+
|
|
177
|
+
**Advanced techniques to deploy** (tasteful, not gratuitous): CSS grid layouts,
|
|
178
|
+
`position:sticky` nav, `scroll-behavior:smooth` + anchor links, `backdrop-filter`,
|
|
179
|
+
`<details>`/`<summary>` for progressive disclosure, responsive `@media`
|
|
180
|
+
breakpoints, CSS-only flow diagrams (borders + flex, no images), subtle
|
|
181
|
+
`transition`/`:hover` affordances on cards. **No** external fonts, scripts, CDNs,
|
|
182
|
+
or build step — every page is one self-contained `.html` file.
|
|
183
|
+
|
|
184
|
+
## What good looks like
|
|
185
|
+
|
|
186
|
+
Lead with the outcome (what the thing *is*, when it runs). Make the flow the
|
|
187
|
+
centerpiece. Tag everything with `file:line`. Surface the real numbers. Give the
|
|
188
|
+
present-tense design rationale where it helps (the *standing* tradeoff or
|
|
189
|
+
constraint that makes the shape make sense) — but **no chronology**: no PRD
|
|
190
|
+
numbers, no "was X → now Y", no incident/migration history, no roadmap. A reader
|
|
191
|
+
should learn what the project *is* today, not how it got here. Keep prose tight
|
|
192
|
+
and in complete sentences — visually rich, not noisy.
|
|
@@ -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>
|