Skip to content

lgy1027/specflow-agent-pack / skills/proto

用最小原型回答一个产品、流程、技术或集成问题,适用于需求验证、团队评审和客户试点准备;根据问题选择媒介,不限定行业或技术栈。

templates/job-pipeline.html

View on GitHub
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SpecFlow 异步流水线任务看板 (Job-Pipeline 模板)</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>

<body class="bg-slate-950 text-slate-100 min-h-screen flex flex-col font-sans antialiased">

    <header class="bg-slate-900 border-b border-slate-800 px-6 py-3.5 flex justify-between items-center shrink-0">
        <div class="flex items-center space-x-3">
            <div class="w-3 h-3 bg-cyan-500 rounded-full animate-pulse"></div>
            <h1 class="text-sm font-bold tracking-wide">SpecFlow 异步作业流水线</h1>
            <span
                class="text-[11px] px-2 py-0.5 bg-cyan-950 text-cyan-300 rounded border border-cyan-800 font-mono">Template:
                Job-Pipeline</span>
        </div>
        <div class="text-xs">
            <span class="text-cyan-300 mr-4">模拟演示(固定数据,不访问文件或 Worker)</span>
            <span class="text-slate-400">流水线状态: <strong id="current-state"
                    class="text-amber-400 font-mono">IDLE</strong></span>
        </div>
    </header>

    <main class="flex-1 p-6 max-w-5xl w-full mx-auto flex flex-col space-y-5">

        <!-- 任务触发与配置卡 -->
        <div class="bg-slate-900 border border-slate-800 rounded-xl p-5 shadow-xl flex justify-between items-center">
            <div>
                <h2 class="text-sm font-bold text-slate-200">批量文档离线向量化与索引构建</h2>
                <p class="text-xs text-slate-400 mt-1">目标对象: 知识库 `/data/docs/batch_2026` (共 42 份大型 PDF 文件)</p>
            </div>
            <button onclick="startPipeline()" id="btn-start"
                class="bg-cyan-600 hover:bg-cyan-500 text-white px-5 py-2 rounded-lg text-xs font-semibold transition flex items-center space-x-1.5">
                <i class="fa-solid fa-play"></i>
                <span>启动异步任务</span>
            </button>
        </div>

        <!-- 阶段步进条 (Pipeline Stages) -->
        <div class="bg-slate-900 border border-slate-800 rounded-xl p-6 shadow-xl">
            <h3 class="text-xs font-bold uppercase tracking-wider text-slate-400 mb-6">作业阶段追踪 (State Progression)</h3>
            <div class="grid grid-cols-4 gap-4 relative">
                <!-- Stage 1 -->
                <div id="step-1" class="border border-slate-800 bg-slate-950 p-3.5 rounded-lg text-center transition">
                    <div class="text-[11px] font-mono text-slate-400 mb-1">STAGE 1</div>
                    <div class="text-xs font-semibold text-slate-300">文本切片与清洗</div>
                    <div id="status-1" class="text-[10px] text-slate-400 mt-2 font-mono">WAITING</div>
                </div>
                <!-- Stage 2 -->
                <div id="step-2" class="border border-slate-800 bg-slate-950 p-3.5 rounded-lg text-center transition">
                    <div class="text-[11px] font-mono text-slate-400 mb-1">STAGE 2</div>
                    <div class="text-xs font-semibold text-slate-300">向量 Embedding</div>
                    <div id="status-2" class="text-[10px] text-slate-400 mt-2 font-mono">WAITING</div>
                </div>
                <!-- Stage 3 -->
                <div id="step-3" class="border border-slate-800 bg-slate-950 p-3.5 rounded-lg text-center transition">
                    <div class="text-[11px] font-mono text-slate-400 mb-1">STAGE 3</div>
                    <div class="text-xs font-semibold text-slate-300">写入向量数据库</div>
                    <div id="status-3" class="text-[10px] text-slate-400 mt-2 font-mono">WAITING</div>
                </div>
                <!-- Stage 4 -->
                <div id="step-4" class="border border-slate-800 bg-slate-950 p-3.5 rounded-lg text-center transition">
                    <div class="text-[11px] font-mono text-slate-400 mb-1">STAGE 4</div>
                    <div class="text-xs font-semibold text-slate-300">索引自检与生效</div>
                    <div id="status-4" class="text-[10px] text-slate-400 mt-2 font-mono">WAITING</div>
                </div>
            </div>

            <!-- 总进度条 -->
            <div class="mt-6">
                <div class="flex justify-between text-xs text-slate-400 mb-1.5 font-mono">
                    <span>总任务完成度</span>
                    <span id="percent-label">0%</span>
                </div>
                <div class="w-full bg-slate-950 h-2 rounded-full overflow-hidden border border-slate-800">
                    <div id="progress-bar" class="bg-cyan-500 h-full w-0 transition-all duration-300"></div>
                </div>
            </div>
        </div>

        <!-- 实时执行日志终端 -->
        <div class="bg-slate-900 border border-slate-800 rounded-xl p-4 flex-1 flex flex-col shadow-xl">
            <div class="flex justify-between items-center mb-2">
                <span class="text-xs font-bold text-slate-400 uppercase tracking-wider font-mono">Worker Live Log</span>
                <span class="text-[10px] text-emerald-400 font-mono">ASYNC_POLLING</span>
            </div>
            <div id="terminal"
                class="bg-slate-950 p-3 rounded-lg border border-slate-800 text-[11px] font-mono text-slate-300 flex-1 h-36 overflow-y-auto leading-relaxed">
                > 等待作业启动...
            </div>
        </div>
    </main>

    <script>
        async function startPipeline() {
            document.getElementById('btn-start').disabled = true;
            document.getElementById('btn-start').className = "bg-slate-800 text-slate-500 px-5 py-2 rounded-lg text-xs font-semibold cursor-not-allowed";
            document.getElementById('current-state').innerText = "RUNNING";

            const log = (msg) => {
                const t = document.getElementById('terminal');
                t.textContent += `> [${new Date().toLocaleTimeString()}] ${msg}\n`;
                t.scrollTop = t.scrollHeight;
            };

            const setStage = (num, status, percent) => {
                const card = document.getElementById(`step-${num}`);
                const stat = document.getElementById(`status-${num}`);
                if (status === 'RUNNING') {
                    card.className = "border border-cyan-500 bg-cyan-950/30 p-3.5 rounded-lg text-center transition";
                    stat.className = "text-[10px] text-cyan-400 mt-2 font-mono animate-pulse";
                    stat.innerText = "RUNNING...";
                } else if (status === 'DONE') {
                    card.className = "border border-emerald-600 bg-emerald-950/20 p-3.5 rounded-lg text-center transition";
                    stat.className = "text-[10px] text-emerald-400 mt-2 font-mono";
                    stat.innerText = "COMPLETED";
                }
                document.getElementById('progress-bar').style.width = percent + "%";
                document.getElementById('percent-label').innerText = percent + "%";
            };

            log("创建异步任务 ID: task_7f8a91b2 (Worker 分配中...)");
            await new Promise(r => setTimeout(r, 600));

            // Stage 1
            setStage(1, 'RUNNING', 15);
            log("读取 42 份 PDF,启动多进程切片清洗...");
            await new Promise(r => setTimeout(r, 1000));
            setStage(1, 'DONE', 25);

            // Stage 2
            setStage(2, 'RUNNING', 45);
            log("调用嵌入模型向量化文本切片 (Batch size: 16)...");
            await new Promise(r => setTimeout(r, 1200));
            setStage(2, 'DONE', 60);

            // Stage 3
            setStage(3, 'RUNNING', 75);
            log("写入本地向量库 (HNSW 索引建立中)...");
            await new Promise(r => setTimeout(r, 1000));
            setStage(3, 'DONE', 85);

            // Stage 4
            setStage(4, 'RUNNING', 90);
            log("执行召回率抽样断言验证 (Recall Precision: 98.4%)...");
            await new Promise(r => setTimeout(r, 800));
            setStage(4, 'DONE', 100);

            log("🎉 异步流水线全部完成,索引已原子化切换发布!");
            document.getElementById('current-state').innerText = "COMPLETED";
        }
    </script>
</body>

</html>
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall