Add web-frontend, web-project-audit and web-project-scaffold-containerized-python skills

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Neil Bantoc 2026-11-04 14:46:25 -08:00
parent 59fc08fa5f
commit 5201aa9bd5
63 changed files with 3042 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/* App styles on top of tokens.css. Plain CSS, no preprocessor. */
.wrap { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); }
.topbar { border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 3.5rem; }
.brand { font-weight: var(--weight-semibold); color: var(--fg); text-decoration: none; }
main.wrap { display: grid; gap: var(--space-6); padding-block: var(--space-12); }
.lead { font-size: var(--text-lg); color: var(--fg-muted); max-width: var(--measure); margin: 0; }
h1 { margin: 0; text-wrap: balance; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); max-width: 32rem; }
.card h2 { margin: 0 0 var(--space-2); }
.card p { margin: 0; }
.badge { display: inline-flex; align-items: center; height: 1.375rem; padding-inline: var(--space-2);
font: var(--weight-medium) var(--text-xs) / 1 var(--font-mono); border-radius: var(--radius-full);
background: var(--surface-2); color: var(--fg-muted); }
.ok { color: var(--ok); }
.error { color: var(--danger); }

View file

@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>__TITLE__</title>
<link rel="stylesheet" href="/static/css/tokens.css">
<link rel="stylesheet" href="/static/css/app.css">
<script type="module" src="/static/js/main.js"></script>
</head>
<body>
<header class="topbar">
<div class="wrap topbar-inner">
<a class="brand" href="/">__TITLE__</a>
<span class="badge" id="version" title="Running commit">…</span>
</div>
</header>
<main class="wrap">
<h1>__TITLE__</h1>
<p class="lead">FastAPI serves this page and the JSON API under <code>/api</code>. Edit <code>app/static</code> and reload; there is no build step.</p>
<section class="card" aria-labelledby="status-heading">
<h2 id="status-heading" class="label">Server</h2>
<p id="status" aria-live="polite">Checking…</p>
</section>
</main>
</body>
</html>

View file

@ -0,0 +1,14 @@
// Small fetch wrapper: JSON in, JSON out, errors carry the server's message.
export async function getJSON(path, options = {}) {
const response = await fetch(path, { headers: { Accept: "application/json" }, ...options });
if (!response.ok) {
let detail = response.statusText;
try { detail = (await response.json()).detail ?? detail; } catch {}
throw new Error(`${response.status} ${detail}`);
}
return response.json();
}
export function postJSON(path, body) {
return getJSON(path, { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, body: JSON.stringify(body) });
}

View file

@ -0,0 +1,15 @@
// Plain ES modules, no bundler. Vendor any library into /static/vendor and import it by path.
import { getJSON } from "./api.js";
const status = document.getElementById("status");
const version = document.getElementById("version");
try {
const info = await getJSON("/api/info");
version.textContent = info.version;
status.textContent = `Running ${info.name} at commit ${info.version}.`;
status.className = "ok";
} catch (err) {
status.textContent = `Could not reach the API: ${err.message}`;
status.className = "error";
}