kanban-system 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.env.example +76 -0
  2. package/CLAUDE.md +108 -0
  3. package/README.md +272 -0
  4. package/agents/_TEMPLATE.md +42 -0
  5. package/agents/backend-agent.md +81 -0
  6. package/agents/deploy-gate-agent.md +73 -0
  7. package/agents/frontend-agent.md +73 -0
  8. package/agents/monitor-agent.md +65 -0
  9. package/agents/orchestrator.md +91 -0
  10. package/agents/reviewer-codex.md +51 -0
  11. package/bin/cli.js +171 -0
  12. package/config.example.js +99 -0
  13. package/docs/adapting-to-your-project.md +155 -0
  14. package/docs/example-apex.md +86 -0
  15. package/docs/the-pattern.md +92 -0
  16. package/hooks/launchd.plist.template +66 -0
  17. package/hooks/pre-push.sample +61 -0
  18. package/lib/config.cjs +138 -0
  19. package/lib/detect/_template.cjs +63 -0
  20. package/lib/detect/rules.json +28 -0
  21. package/lib/detect/sentry.cjs +86 -0
  22. package/lib/detect/vercel.cjs +62 -0
  23. package/lib/gate/index.cjs +182 -0
  24. package/lib/runner/adapters/both.cjs +33 -0
  25. package/lib/runner/adapters/claude.cjs +119 -0
  26. package/lib/runner/adapters/codex.cjs +43 -0
  27. package/lib/runner/adapters/reviewer.cjs +91 -0
  28. package/lib/runner/budget.cjs +75 -0
  29. package/lib/runner/index.cjs +93 -0
  30. package/lib/runner/result-merger.cjs +58 -0
  31. package/lib/runner/worktree-manager.cjs +64 -0
  32. package/lib/watch/scheduler.cjs +164 -0
  33. package/package.json +59 -0
  34. package/playbooks/_TEMPLATE.html +54 -0
  35. package/playbooks/build-fail.html +57 -0
  36. package/playbooks/deploy-rollback.html +53 -0
  37. package/playbooks/e2e-regression.html +58 -0
  38. package/playbooks/playbook.css +26 -0
  39. package/playbooks/sentry-spike.html +53 -0
  40. package/server/kanban.cjs +1152 -0
  41. package/skills/archive.md +18 -0
  42. package/skills/gate.md +22 -0
  43. package/skills/standup.md +24 -0
  44. package/skills/triage.md +24 -0
  45. package/ui/kanban.html +628 -0
  46. package/ui/styles/kanban.css +436 -0
  47. package/ui/styles/progress.css +315 -0
  48. package/ui/styles/tokens.css +291 -0
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Playbook: deploy-rollback</title><link rel="stylesheet" href="./playbook.css"></head><body>
2
+ <h1>Playbook · deploy-rollback</h1>
3
+ <div class="meta">
4
+ <span class="tag high">severity: high</span>
5
+ <span class="tag group">deploy</span>
6
+ <span class="tag agent">deploy-gate-agent → orchestrator</span>
7
+ <span class="tag low">SLA: roll back within 10 min of the call</span>
8
+ </div>
9
+ <div class="card danger">
10
+ <strong>Summary</strong> — A deploy is live and causing user impact (or is about to).
11
+ Goal: get back to a known-good state fast, then diagnose calmly. Rolling back is
12
+ cheap; debugging in production is not.
13
+ </div>
14
+
15
+ <h2>Trigger</h2>
16
+ <ul>
17
+ <li>monitor-agent or a person reports user impact correlated with a deploy that just shipped.</li>
18
+ <li>The deploy succeeded the gate but a smoke check / golden path is now failing in production.</li>
19
+ <li>A hotfix is being attempted but isn't ready and the bleeding is ongoing.</li>
20
+ </ul>
21
+
22
+ <h2>Decide: roll back, or roll forward?</h2>
23
+ <div class="tree">is there active user impact?
24
+ ├─ yes, and a fix isn't &lt;10 min away → ROLL BACK now, diagnose after
25
+ ├─ yes, but a 1-line revert fixes it → roll forward with the revert (counts as incident-response)
26
+ └─ no, just elevated errors / noisy logs → no rollback; open a normal task, watch the trend
27
+ </div>
28
+
29
+ <h2>How to roll back (fill in for your platform)</h2>
30
+ <ol>
31
+ <li>Identify the last known-good release/deployment (check <code>data/runs/last-gate.json</code>, your hosting dashboard, or <code>git log</code> on the deploy branch).</li>
32
+ <li>Promote / redeploy that release.
33
+ <ul>
34
+ <li>Vercel: redeploy the previous deployment, or <code>vercel rollback &lt;url&gt;</code>.</li>
35
+ <li>Containers/k8s: re-deploy the previous image tag.</li>
36
+ <li>Plain git deploy: <code>git revert &lt;bad-commit&gt;</code> (don't force-push the branch) and let the pipeline ship it.</li>
37
+ </ul>
38
+ </li>
39
+ <li>If the bad deploy ran a forward database migration, roll the schema back too (or apply the down migration) — coordinate with backend-agent. <em>Never</em> leave the schema ahead of the code.</li>
40
+ <li>Confirm recovery: re-run the golden-path smoke check, watch the error rate fall.</li>
41
+ <li>Post the recovery notice in the incident channel.</li>
42
+ </ol>
43
+
44
+ <h2>After the rollback</h2>
45
+ <ul>
46
+ <li>Within 1 hour: register the incident-response task (<code>metadata.source = "incident-response"</code>) describing what shipped, what broke, and the rollback.</li>
47
+ <li>Open a normal task to fix the underlying bug — it must re-pass the gate before re-shipping.</li>
48
+ <li>If the gate let a breaking change through, file a task to add the check that would have caught it.</li>
49
+ <li>Write a postmortem if there was user impact.</li>
50
+ </ul>
51
+
52
+ <div class="footer">trigger: post-deploy incident · owner: deploy-gate-agent / orchestrator</div>
53
+ </body></html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Playbook: e2e-regression</title><link rel="stylesheet" href="./playbook.css"></head><body>
2
+ <h1>Playbook · e2e-regression</h1>
3
+ <div class="meta">
4
+ <span class="tag high">severity: high</span>
5
+ <span class="tag group">qa</span>
6
+ <span class="tag agent">deploy-gate-agent → frontend-agent / backend-agent</span>
7
+ <span class="tag low">SLA: 1h</span>
8
+ </div>
9
+ <div class="card danger">
10
+ <strong>Summary</strong> — A golden-path end-to-end scenario regressed. Treat as
11
+ user-impacting until proven otherwise.
12
+ </div>
13
+
14
+ <h2>Trigger</h2>
15
+ <ul>
16
+ <li>A scheduled E2E run, or the gate's E2E stage, failed a golden-path scenario.</li>
17
+ <li>The same scenario failed twice in a row → an auto-created task points here (severity high).</li>
18
+ </ul>
19
+
20
+ <h2>Golden paths (priority order — adapt to your app)</h2>
21
+ <table>
22
+ <tr><th>#</th><th>scenario</th><th>impact if it breaks</th></tr>
23
+ <tr><td>1</td><td>sign in (all auth methods)</td><td>everyone locked out — sev1</td></tr>
24
+ <tr><td>2</td><td>core happy path of the product</td><td>users blocked — sev1</td></tr>
25
+ <tr><td>3</td><td>checkout / payment (if any)</td><td>revenue impact — sev1</td></tr>
26
+ <tr><td>4</td><td>account/admin flows</td><td>operational impact</td></tr>
27
+ </table>
28
+
29
+ <h2>Diagnosis</h2>
30
+ <ol>
31
+ <li>Open the E2E log/trace: <code>data/runs/task-&lt;id&gt;/&lt;stage&gt;.log</code> (+ the recorded trace).</li>
32
+ <li>From the failure screenshot, decide: visual regression vs logic regression vs flake.</li>
33
+ <li>Reproduce locally headed.</li>
34
+ <li>Correlate the failure time with the last deploy and with error-tracking events.</li>
35
+ </ol>
36
+
37
+ <h2>Decision tree</h2>
38
+ <div class="tree">failure location
39
+ ├─ broken UI selector → frontend-agent (add stable test ids)
40
+ ├─ changed API response → backend-agent (server-side regression)
41
+ ├─ timeout → environment (cold start) → 3 retries; still failing ⇒ real regression
42
+ └─ DB state → fixture problem (E2E suite self-check)
43
+ </div>
44
+
45
+ <h2>Escalation</h2>
46
+ <ul>
47
+ <li>Two golden paths failing at once → freeze deploys (no merges to the main branch).</li>
48
+ <li>Happening to users right now → page the on-call.</li>
49
+ </ul>
50
+
51
+ <h2>Aftermath</h2>
52
+ <ul>
53
+ <li>Add a sharper assertion to the scenario that broke.</li>
54
+ <li>Consider promoting a near-miss scenario into the golden-path set.</li>
55
+ </ul>
56
+
57
+ <div class="footer">trigger: scheduled E2E / deploy gate · owner: deploy-gate-agent</div>
58
+ </body></html>
@@ -0,0 +1,26 @@
1
+ :root{--bg:#fafafa;--card:#fff;--border:#e4e4e7;--text:#18181b;--text-2:#52525b;--text-3:#71717a;--accent:#059669;--high:#dc2626;--med:#d97706;--low:#71717a;--code-bg:#f4f4f5}
2
+ *{margin:0;padding:0;box-sizing:border-box}
3
+ body{font-family:'Pretendard Variable',Pretendard,-apple-system,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;padding:32px;max-width:920px;margin:0 auto;font-size:14px;letter-spacing:-0.005em}
4
+ h1{font-size:24px;margin-bottom:8px;letter-spacing:-0.02em}
5
+ h2{font-size:17px;margin-top:28px;margin-bottom:10px;border-bottom:2px solid var(--border);padding-bottom:6px}
6
+ h3{font-size:14px;margin-top:18px;margin-bottom:8px;color:var(--text-2)}
7
+ .meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
8
+ .tag{padding:3px 10px;border-radius:9999px;font-size:11px;font-weight:700;font-family:'JetBrains Mono',ui-monospace,monospace;line-height:1.4}
9
+ .tag.high{background:#fee2e2;color:var(--high)}
10
+ .tag.medium{background:#fef3c7;color:var(--med)}
11
+ .tag.low{background:#e4e4e7;color:var(--low)}
12
+ .tag.agent{background:#d1fae5;color:#065f46}
13
+ .tag.group{background:#dbeafe;color:#1e40af}
14
+ .card{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:14px 18px;margin:10px 0}
15
+ .card.danger{border-left:4px solid var(--high)}
16
+ .card.warn{border-left:4px solid var(--med)}
17
+ .card.ok{border-left:4px solid var(--accent)}
18
+ ol,ul{margin-left:22px}
19
+ li{margin:4px 0}
20
+ code{background:var(--code-bg);padding:1px 6px;border-radius:3px;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:12.5px}
21
+ pre{background:var(--code-bg);padding:12px 14px;border-radius:6px;overflow-x:auto;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:12.5px;line-height:1.5}
22
+ .tree{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:12px;background:var(--code-bg);padding:14px;border-radius:6px;white-space:pre-wrap}
23
+ table{width:100%;border-collapse:collapse;margin:8px 0;font-size:13px}
24
+ th,td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--border)}
25
+ th{font-weight:700;color:var(--text-2);font-size:11px;text-transform:uppercase;letter-spacing:0.04em}
26
+ .footer{margin-top:36px;padding-top:16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-3);font-family:'JetBrains Mono',ui-monospace,monospace}
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Playbook: error-rate-spike</title><link rel="stylesheet" href="./playbook.css"></head><body>
2
+ <h1>Playbook · error-rate-spike</h1>
3
+ <div class="meta">
4
+ <span class="tag high">severity: high</span>
5
+ <span class="tag group">monitoring</span>
6
+ <span class="tag agent">monitor-agent → frontend-agent / backend-agent</span>
7
+ <span class="tag low">SLA: triage within 15 min</span>
8
+ </div>
9
+ <div class="card danger">
10
+ <strong>Summary</strong> — The error rate (from Sentry or your error tracker) jumped well
11
+ past baseline. Check causality with the most recent deploy first.
12
+ </div>
13
+
14
+ <h2>Trigger</h2>
15
+ <ul>
16
+ <li>monitor-agent's poll saw error rate &gt; ~3× the rolling baseline.</li>
17
+ <li>More than ~5 new unresolved issues within a short window.</li>
18
+ </ul>
19
+
20
+ <h2>Diagnosis</h2>
21
+ <ol>
22
+ <li>Open Issues for the last hour, sorted by event count.</li>
23
+ <li>Read the top 3 stack traces → find the common origin.</li>
24
+ <li>Match the spike start time against the last deploy time.</li>
25
+ <li>Diff the suspect commit → assess regression likelihood.</li>
26
+ <li>Estimate affected users.</li>
27
+ </ol>
28
+
29
+ <h2>Decision tree</h2>
30
+ <div class="tree">spike origin
31
+ ├─ recent deploy is clearly the cause
32
+ │ ├─ hotfix possible in &lt;15 min → fix directly
33
+ │ └─ hotfix hard → roll back now → split the diagnosis into its own task
34
+ ├─ external dependency (3rd-party API)
35
+ │ └─ add retry / circuit breaker; watch their status page
36
+ └─ user-behaviour change (traffic surge, a launch)
37
+ └─ benign — file a task to retune the threshold
38
+ </div>
39
+
40
+ <h2>Escalation</h2>
41
+ <ul>
42
+ <li>More than ~100 users affected → user-facing notice + incident channel.</li>
43
+ <li>Touches a money path or auth → dispatch backend-agent alongside.</li>
44
+ </ul>
45
+
46
+ <h2>Aftermath</h2>
47
+ <ul>
48
+ <li>Write a postmortem (<code>data/runs/postmortem-&lt;ts&gt;.md</code>) if it had user impact.</li>
49
+ <li>Retune the alert threshold for that error group.</li>
50
+ </ul>
51
+
52
+ <div class="footer">trigger: monitor-agent · owner: frontend-agent / backend-agent</div>
53
+ </body></html>