codecall 1.3.0 → 1.5.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.
Files changed (27) hide show
  1. package/ARCHITECTURE.md +3 -1
  2. package/README.md +56 -1
  3. package/package.json +1 -1
  4. package/plugins/codecall/.claude-plugin/plugin.json +1 -1
  5. package/plugins/codecall/.codex-plugin/plugin.json +1 -1
  6. package/plugins/codecall/agents/codecall-planner.md +6 -1
  7. package/plugins/codecall/skills/codecall/SKILL.md +46 -7
  8. package/plugins/codecall/skills/codecall/references/backend-map/api.md +113 -0
  9. package/plugins/codecall/skills/codecall/references/backend-map/architecture.md +65 -0
  10. package/plugins/codecall/skills/codecall/references/backend-map/async.md +81 -0
  11. package/plugins/codecall/skills/codecall/references/backend-map/auth.md +97 -0
  12. package/plugins/codecall/skills/codecall/references/backend-map/caching.md +65 -0
  13. package/plugins/codecall/skills/codecall/references/backend-map/data.md +144 -0
  14. package/plugins/codecall/skills/codecall/references/backend-map/http.md +97 -0
  15. package/plugins/codecall/skills/codecall/references/backend-map/index.md +165 -0
  16. package/plugins/codecall/skills/codecall/references/backend-map/observability.md +65 -0
  17. package/plugins/codecall/skills/codecall/references/backend-map/ops.md +129 -0
  18. package/plugins/codecall/skills/codecall/references/backend-map/quality.md +81 -0
  19. package/plugins/codecall/skills/codecall/references/backend-map/realtime.md +65 -0
  20. package/plugins/codecall/skills/codecall/references/backend-map/reliability.md +65 -0
  21. package/plugins/codecall/skills/codecall/references/backend-map/scaling.md +81 -0
  22. package/plugins/codecall/skills/codecall/references/backend-map/security.md +97 -0
  23. package/plugins/codecall/skills/codecall/references/backend-map/storage.md +81 -0
  24. package/plugins/codecall/skills/codecall/references/drill-receipt-template.html +78 -0
  25. package/plugins/codecall/skills/codecall/references/drill.md +116 -0
  26. package/plugins/codecall/skills/codecall/references/receipt-template.html +9 -3
  27. package/plugins/codecall/skills/codecall/references/trace.md +42 -0
@@ -0,0 +1,78 @@
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">
6
+ <!-- Fill every double-brace placeholder. Keep the meta tags: later sessions read them for the streak line. -->
7
+ <meta name="codecall-mode" content="drill">
8
+ <!-- "found" or "missed". -->
9
+ <meta name="codecall-drill" content="{{FOUND_OR_MISSED}}">
10
+ <meta name="codecall-hints" content="{{HINTS}}">
11
+ <meta name="codecall-minutes" content="{{MINUTES}}">
12
+ <meta name="codecall-date" content="{{DATE}}">
13
+ <!-- The mapped concept the bug exercised, e.g. "http-status-codes:ok" (ok means found with at most two hints); leave content empty when nothing was mapped. -->
14
+ <meta name="codecall-concepts" content="{{MAPPED_CONCEPT_OR_EMPTY}}">
15
+ <title>codecall drill · {{AREA}}</title>
16
+ <style>
17
+ :root { --bg:#fbfaf7; --ink:#151515; --muted:#6b6760; --line:#e4e0d8; --ok:#1f7a4d; --no:#b3261e; --accent:#2b3e8c; }
18
+ @media (prefers-color-scheme: dark) { :root { --bg:#161513; --ink:#ece8e0; --muted:#9a948a; --line:#2c2a26; --ok:#5fc48d; --no:#f28b82; --accent:#9fb0ff; } }
19
+ * { box-sizing: border-box; }
20
+ body { margin:0; background:var(--bg); color:var(--ink); font: 18px/1.45 ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, sans-serif; }
21
+ main { max-width: 720px; margin: 0 auto; padding: 48px 24px 64px; }
22
+ .brand { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
23
+ h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 4px; }
24
+ .date { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
25
+ .score { font-size: 56px; font-weight: 700; line-height: 1; margin: 0 0 4px; }
26
+ .score small { font-size: 18px; font-weight: 500; color: var(--muted); margin-left: 8px; }
27
+ .streak { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
28
+ h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; }
29
+ ul { list-style: none; padding: 0; margin: 0; }
30
+ li { padding: 10px 0; border-top: 1px solid var(--line); }
31
+ li:last-child { border-bottom: 1px solid var(--line); }
32
+ .concept { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: baseline; }
33
+ .ok { color: var(--ok); } .no { color: var(--no); }
34
+ .concept b { display: block; }
35
+ .concept span { color: var(--muted); font-size: 16px; }
36
+ .points li::before { content: "→ "; color: var(--accent); }
37
+ .deeper { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
38
+ .result.ok { color: var(--ok); } .result.no { color: var(--no); }
39
+ .deeper a { color: var(--accent); }
40
+ footer { margin-top: 40px; font-size: 13px; color: var(--muted); }
41
+ @media print { body { background: #fff; color: #000; } main { padding: 0; } }
42
+ </style>
43
+ </head>
44
+ <body>
45
+ <main>
46
+ <div class="brand">codecall drill</div>
47
+ <h1>{{AREA}}</h1>
48
+ <div class="date">{{DATE}} · {{DIFFICULTY}}</div>
49
+
50
+ <!-- class="result ok" with "Found it" or class="result no" with "Missed it". -->
51
+ <p class="score result ok">{{FOUND_IT_OR_MISSED_IT}}<small>{{MINUTES}} min · {{HINTS}} of 4 hints</small></p>
52
+ <div class="streak">{{STREAK_LINE_OR_EMPTY}}</div>
53
+
54
+ <h2>The bug</h2>
55
+ <ul>
56
+ <!-- Keep the deeper line only for a missed drill whose bug maps to a concept card, with that card's links (drop the second link when the card has one); delete it otherwise. -->
57
+ <li class="concept"><span class="no">●</span><div><b>{{BUG_KIND}}</b><span>{{FILE_NAME}}: {{WHY_IT_CAUSED_THE_SYMPTOM}}</span><span class="deeper">Go deeper: <a href="{{LINK_1_URL}}">{{LINK_1_TEXT}}</a> · <a href="{{LINK_2_URL}}">{{LINK_2_TEXT}}</a></span></div></li>
58
+ </ul>
59
+
60
+ <h2>What went well</h2>
61
+ <ul class="points">
62
+ <li>{{WENT_WELL}}</li>
63
+ </ul>
64
+
65
+ <h2>Habit to work on</h2>
66
+ <ul class="points">
67
+ <li>{{HABIT}}</li>
68
+ </ul>
69
+
70
+ <h2>Fastest route</h2>
71
+ <ul class="points">
72
+ <li>{{FASTEST_ROUTE}}</li>
73
+ </ul>
74
+
75
+ <footer>Written locally by codecall. The planted bug was removed with Git before this receipt was written. Nothing was uploaded.</footer>
76
+ </main>
77
+ </body>
78
+ </html>
@@ -0,0 +1,116 @@
1
+ # Drill: debugging practice on real code
2
+
3
+ A drill is a debugging interview round run on the developer's own project.
4
+ Plant one bug, hand over only the symptom, coach without solving, then put the
5
+ code back exactly as it was. Drills are the only codecall mode that edits
6
+ source code, so every rule below about Git and restoring is mandatory.
7
+
8
+ ## Start gate
9
+
10
+ 1. Check Git: `git rev-parse --is-inside-work-tree` must succeed and
11
+ `git status --porcelain` must print nothing outside `codecall/`, where
12
+ earlier receipts live. Otherwise stop and ask the developer to commit or
13
+ stash first; never commit, stash, branch or reset on their behalf. Record
14
+ `git rev-parse HEAD`.
15
+ 2. Pick the target: the area named in the argument, else the implementation
16
+ from this conversation, else ask for one line. Read progressively, as in
17
+ the Session: the named files first, then focused excerpts. Never scan the
18
+ whole repository.
19
+ 3. Find how the developer will see the bug: an existing test, a run command,
20
+ a request (`curl`), or a script. Prefer an existing test that covers the
21
+ target. If nothing can show a symptom, pick another site or say so.
22
+ 4. Show this and wait:
23
+
24
+ ```text
25
+ Debugging drill: <area>
26
+ Difficulty: <easy|medium|hard>
27
+ Estimated time: <N> minutes
28
+ I will change one file to plant a bug and restore it with Git at the end.
29
+ If your editor asks you to approve that edit, approve it without reading it.
30
+
31
+ Start Drill / Skip
32
+ ```
33
+
34
+ On Skip or cancel: stop, and write nothing.
35
+
36
+ ## Plant the bug
37
+
38
+ 1. Choose one realistic bug, the kind people actually ship: an off-by-one, a
39
+ flipped comparison, a missing `await`, an unhandled null or empty case,
40
+ swapped arguments, a wrong status code, a stale or wrong cache key, a
41
+ mutable default, a missing transaction or lock, a wrong state update.
42
+ For server-side code, prefer a misconception from the matching card in
43
+ [backend-map/](backend-map/index.md), so the bug teaches a mapped concept;
44
+ remember its id. When earlier receipts' `codecall-concepts` meta tags show
45
+ a mapped id as missed and the target exercises it, prefer it.
46
+ 2. Match the difficulty:
47
+ - `easy`: it crashes, and the stack trace points near the bug.
48
+ - `medium`: wrong output, with the bug one call or layer away from where the
49
+ symptom shows.
50
+ - `hard`: wrong only for some inputs or timings, or fails silently; the
51
+ developer has to find the input that shows it.
52
+ 3. Constraints: one file, at most three changed lines, compiles or parses,
53
+ and looks like plausible code, not like a planted bug. No comment, name or
54
+ formatting change gives it away. Never plant a bug in auth or permission
55
+ checks, secrets, migrations, data deletion, generated files, lockfiles or
56
+ CI config, and never make a change that is unsafe if it runs against a
57
+ shared service.
58
+ 4. Make the edit, then run the reproduction once yourself to confirm the
59
+ symptom appears. If it does not, restore and pick a different bug.
60
+ 5. Record the time (`date +%s`). From here, never name the file, function,
61
+ line or kind of bug in chat until the reveal.
62
+
63
+ ## Run the drill
64
+
65
+ 1. Hand over a symptom report, as an interviewer would: what users see, what
66
+ was expected, and the reproduction command. Nothing else.
67
+ 2. The developer drives. Answer questions the way an interviewer would: say
68
+ what the system does, but never where the bug is. Let them run commands,
69
+ add logs and set breakpoints themselves.
70
+ 3. Hints only when asked, one at a time, in this order:
71
+ 1. The area or layer to look in.
72
+ 2. What to log, print or break on, and what to compare.
73
+ 3. The function.
74
+ 4. The line.
75
+ Count every hint given.
76
+ 4. The drill ends when the developer names the line and why it causes the
77
+ symptom (found), gives up, or asks to stop (missed). A fix they write is
78
+ welcome but not required; the code is restored either way.
79
+
80
+ ## Reveal and restore
81
+
82
+ 1. Show `git diff`: the planted change and what it should have been.
83
+ 2. Explain the causal chain from that line to the symptom in two or three
84
+ steps, then the fastest route a strong candidate would take: reproduce,
85
+ read the error in full, narrow down with logs or breakpoints, state a
86
+ hypothesis, confirm it.
87
+ 3. Restore: `git checkout -- <file>`. Then run `git status --porcelain`.
88
+ Anything still changed outside `codecall/` is the developer's own debugging
89
+ (logs, prints, a fix): list it and ask whether to revert it; revert only on
90
+ a yes. Confirm `git rev-parse HEAD` matches the recorded value; if it moved,
91
+ check `git diff <recorded> HEAD -- <file>` and tell the developer if the
92
+ bug was committed, without rewriting their history.
93
+ 4. Restore on every way out: found, missed, stop, error, or a new request
94
+ that abandons the drill. If restoring fails, stop and tell the developer
95
+ the exact command to run; never leave a drill bug in silently.
96
+
97
+ ## The drill receipt
98
+
99
+ Write `./codecall/NNNN-drill-<slug>.html` from
100
+ [drill-receipt-template.html](drill-receipt-template.html), numbered like
101
+ every other receipt. Print the path and the result line in chat. It holds:
102
+
103
+ - The area and the date.
104
+ - Found or missed, the minutes taken, and the hints used out of 4.
105
+ - The kind of bug in a few words, with the file name only; no source code.
106
+ - What the developer did well and one habit to work on, both specific to
107
+ how this drill went, and the fastest route in one line.
108
+ - For a missed drill whose bug maps to a concept card, one "Go deeper" line
109
+ with that card's links, exactly as written there.
110
+ - Meta tags: `codecall-mode` is `drill`, `codecall-drill` is `found` or
111
+ `missed`, `codecall-hints` and `codecall-minutes` are numbers,
112
+ `codecall-concepts` is `id:ok` or `id:no` for the mapped concept, or empty.
113
+ `id:ok` means found with at most two hints.
114
+ - When earlier receipts exist, the same streak line as a quiz receipt.
115
+
116
+ Write the receipt only after the code is restored.
@@ -3,9 +3,13 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <!-- Fill every double-brace placeholder and remove unused concept rows. Keep the two meta tags: later sessions read them for the streak line. -->
6
+ <!-- Fill every double-brace placeholder and remove unused concept rows. Keep the four meta tags: later sessions read them for the streak line. -->
7
+ <!-- "learn" for a quiz session, "trace" for a trace. -->
8
+ <meta name="codecall-mode" content="{{MODE}}">
7
9
  <meta name="codecall-score" content="{{SCORE_N}}/{{SCORE_M}}">
8
10
  <meta name="codecall-date" content="{{DATE}}">
11
+ <!-- Mapped concepts only, e.g. "cache-aside:ok,cache-invalidation:no"; leave content empty when nothing was mapped. -->
12
+ <meta name="codecall-concepts" content="{{MAPPED_CONCEPTS_OR_EMPTY}}">
9
13
  <title>codecall · {{TITLE}}</title>
10
14
  <style>
11
15
  :root { --bg:#fbfaf7; --ink:#151515; --muted:#6b6760; --line:#e4e0d8; --ok:#1f7a4d; --no:#b3261e; --accent:#2b3e8c; }
@@ -28,6 +32,8 @@
28
32
  .concept b { display: block; }
29
33
  .concept span { color: var(--muted); font-size: 16px; }
30
34
  .points li::before { content: "→ "; color: var(--accent); }
35
+ .deeper { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
36
+ .deeper a { color: var(--accent); }
31
37
  footer { margin-top: 40px; font-size: 13px; color: var(--muted); }
32
38
  @media print { body { background: #fff; color: #000; } main { padding: 0; } }
33
39
  </style>
@@ -43,9 +49,9 @@
43
49
 
44
50
  <h2>What was in the change</h2>
45
51
  <ul>
46
- <!-- One li per concept. Use class="ok" with ✅ or class="no" with ❌. -->
52
+ <!-- One li per concept. Use class="ok" with ✅ or class="no" with ❌. Only a ❌ concept with a map id keeps the deeper line, with its card's links (drop the second link when the card has one); delete it everywhere else. -->
47
53
  <li class="concept"><span class="ok">✅</span><div><b>{{CONCEPT_1}}</b><span>{{WHY_1}}</span></div></li>
48
- <li class="concept"><span class="no">❌</span><div><b>{{CONCEPT_2}}</b><span>{{WHY_2}}</span></div></li>
54
+ <li class="concept"><span class="no">❌</span><div><b>{{CONCEPT_2}}</b><span>{{WHY_2}}</span><span class="deeper">Go deeper: <a href="{{LINK_1_URL}}">{{LINK_1_TEXT}}</a> · <a href="{{LINK_2_URL}}">{{LINK_2_TEXT}}</a></span></div></li>
49
55
  </ul>
50
56
 
51
57
  <h2>Points to remember</h2>
@@ -0,0 +1,42 @@
1
+ # Trace: follow one flow through the code
2
+
3
+ A trace walks one concrete path, such as "what happens on `POST /login`" or
4
+ "where does this value get set", from its entry point to its end, then checks
5
+ that the developer can follow it. It never edits code.
6
+
7
+ ## Start gate
8
+
9
+ 1. Identify the flow from the argument. If it is unclear, ask for one line
10
+ before reading any code.
11
+ 2. Find the entry point (route, handler, `main`, UI event, CLI command, job)
12
+ and read forward from it, one hop at a time. Read only the files on the
13
+ path; never scan the whole repository.
14
+ 3. Pick the 2 or 3 hops where a bug would most likely hide: where data is
15
+ transformed, validated, stored, cached, sent across a boundary, or can
16
+ fail. These are the session's ideas. For server-side hops, give each at
17
+ most one [backend map](backend-map/index.md) id, under the same rules as
18
+ the Session.
19
+ 4. Show the Start Learning / Skip card from the Start gate in SKILL.md, with
20
+ `Learning opportunity: trace <flow> through <N> files`. On Skip or cancel:
21
+ stop, and write nothing.
22
+
23
+ ## Session
24
+
25
+ 1. Walk the path hop by hop: `file:line`, what comes in, what it does, what
26
+ goes out, and how it can fail. Quote only the few lines that matter.
27
+ 2. End the walk with the path as one arrow chain, for example
28
+ `routes/auth.ts:login → AuthService.verify → users.findByEmail → bcrypt.compare → signJwt`.
29
+ 3. Check each chosen hop with one question, one at a time: a debugging or
30
+ failure question grounded in the path, such as "if `findByEmail` returns
31
+ nothing, what does the client get, and where is that decided?". Never a
32
+ generic definition.
33
+ 4. Branch as in the Session: correct moves on; wrong names the gap, reteaches
34
+ it from the path, and asks a new isomorphic question. A hop counts as
35
+ explained when its check was answered correctly without a reteach.
36
+
37
+ ## The receipt
38
+
39
+ Write it from [receipt-template.html](receipt-template.html) like a quiz
40
+ receipt, with `codecall-mode` set to `trace`, the flow as the title, each
41
+ chosen hop as a concept, the arrow chain as the first point to remember, and
42
+ the score as `Could explain N of M` hops.