Quy trình Đề xuất Bán hàngSales Proposal Pipeline — cơ chế hiện tại— current mechanics
Đây là cơ chế hiện tại của pipeline — không còn là kế hoạch. technext-sales-proposal nay là một orchestrator + 10 sub-skill trong skills/ + 5 loại agent trong agents/, cộng 4 script tất định (bind_check.py, stitch_group.py, validate-proposal.py, ccusage_to_csv.py) — phần đếm/so khớp không giao cho LLM. Sơ đồ dưới vẽ đúng luồng chạy thật: pre-fetch một lần, gate dữ kiện trước khi viết, rồi hai cổng chặn cứng.These are the pipeline's current mechanics — no longer a plan. technext-sales-proposal is now one orchestrator + 10 sub-skills under skills/ + 5 agent definitions under agents/, plus 4 deterministic scripts (bind_check.py, stitch_group.py, validate-proposal.py, ccusage_to_csv.py) — the counting/matching work is never handed to an LLM. The diagram below draws the real flow: pre-fetch once, gate the facts before writing, then two hard gates.
Quy trình cần những gìWhat the pipeline consumes
Mọi thứ người dùng cung cấp trước khi quy trình bắt đầu chạy.Everything the user provides before the workflow starts running.
-
Tên/website khách hàngClient name / websiteYêu cầu tối thiểu để khởi động — "làm sales proposal cho X"Minimum needed to kick off — "make a sales proposal for X"
-
Bản ghi cuộc gọi khám phá (tùy chọn)Discovery-call transcript (optional)Dán trực tiếp — nâng cấp độ tin cậy của phần nghiên cứu lên "Đã xác nhận"Pasted in directly — upgrades research confidence to "Confirmed"
-
Checkpoint JSON đã có (tùy chọn)Existing checkpoint JSON (optional)Cho phép chỉ chạy lại một phase/nhóm/section thay vì toàn bộ pipelineLets a single phase/group/section resume instead of a full rebuild
Bên trong chạy gìWhat runs inside
Một orchestrator điều phối bốn subagent nghiên cứu song song, cộng một worker cho mỗi đối thủ. Mọi con số dưới đây là hiện trạng đã chạy được.One orchestrator dispatches four parallel research subagents, plus one worker per competitor. Every number below is the current, working state.
web-scan.json, nhận diện 2–4 đối thủ và pre-fetch song song mọi URL vào captures/*.md (~39 trang ≈ 1–2 phút, thay cho ~29 phút fetch live). Mỗi đối thủ có một competitor-research-worker (model rẻ, ≤8 fetch / ≤8 phút) trả JSON dữ kiện, và bind_check.py --facts của source-auditor là cổng chặn trước khi Phase 1 chạy. Bốn nhóm A–D đọc section-shell.md (~5 KB, không đọc template 250 KB) + captures/, trả fragment thô; stitch_group.py ghép thành trang xem được. source-auditor merge 4 file findings, gộp nguồn trùng gốc, re-grade, bind-check lại từ cache và sinh sources-citation bằng máy. front-matter-writer viết 6 section đầu, assembler ráp thành 1 file, mechanical-validator (13 check cứng: no-CDN, HTML hợp lệ qua html5lib, đủ 18 chart + 4 sơ đồ…) và judgment-reviewer duyệt lần cuối. ccusage (miễn phí) xuất CSV chi phí thật theo từng task.sales-proposal-run (any capable model) verifies identity via company-verifier (GLEIF + Wikidata, free) + officers-lookup (Companies House / OpenCorporates / SEC EDGAR, free), then web-osint-scanner writes web-scan.json, identifies 2–4 competitors and pre-fetches every URL in parallel into captures/*.md (~39 pages ≈ 1–2 min, replacing ~29 min of live fetching). One competitor-research-worker per competitor (cheap model, ≤8 fetches / ≤8 min) returns facts-only JSON, and source-auditor's bind_check.py --facts is a hard gate before Phase 1 runs. Groups A–D read section-shell.md (~5 KB, never the 250 KB template) + captures/ and return raw fragments; stitch_group.py stitches them into a previewable page. source-auditor merges the 4 findings files, collapses duplicate-origin sources, re-grades, re-runs bind-check from cache and generates sources-citation mechanically. front-matter-writer writes the 6 opening sections, assembler assembles one file, mechanical-validator (13 hard checks: no-CDN, html5lib HTML validity, all 18 charts + 4 diagrams…) and judgment-reviewer sign off. ccusage (free) exports a real per-task cost CSV.
Người dùng nhận được gìWhat user receive
Năm sản phẩm bàn giao mỗi task, khớp 1:1 với giai đoạn đã tạo ra chúng.Five deliverables per task, mapped 1:1 to the stages that produced them.
HTMLĐề xuất bán hàng song ngữBilingual sales proposal .html
Trang HTML tự chứa ~40 section, 18 biểu đồ + 4 sơ đồ tĩnh, trích dẫn dạng hover-card đã bind-check với nguồn thật.Self-contained ~40-section page, 18 charts + 4 static diagrams, bind-checked hover-card citations.
JSONCơ sở dữ liệu phát hiện, đọc được bằng máyMachine-readable findings base .json
claim/section/nguồn/hạng A-D/Đã xác nhận — để bước sau nạp vào Odoo CRM qua MCP.claim/section/source/grade A-D/Confirmed — for a later MCP step to load into Odoo CRM.
PWABộ file PWA đi kèmCompanion PWA bundle manifest+sw+icons
Manifest, service worker, 2 icon — để bản đề xuất đã giao có thể cài đặt được.Manifest, service worker, 2 icons — makes the delivered proposal installable.
CSVChi phí thật theo từng taskReal per-task cost report -cost-report.csv
Sinh bởi ccusage_to_csv.py sau mỗi task — một dòng một task, tự cảnh báo nếu có model lạ lẫn vào session.Written by ccusage_to_csv.py after each task — one row per task, auto-warns if a foreign model shows up inside a session.
HTMLBảng điều khiển chi phí (tạo một lần)Cost dashboard (built once) cost-dashboard.html
Mở một lần rồi nạp nhiều file *-cost-report.csv để xem bảng gộp, cộng dồn theo lần chạy và tổng — không sinh lại mỗi lần chạy.Opened once, then loads any number of *-cost-report.csv files into a merged table with per-run subtotals and a grand total — not regenerated on every run.
Bên trong quy trìnhInside the workflow — từng giai đoạn— stage by stage
Sáu giai đoạn, trái sang phải — cộng hai cổng chặn cứng: gate --facts (trước khi viết) và source-auditor (Phase 2.5). Mỗi node thể hiện loại, tên, và việc nó làm. Node Agent mang logo Claude và chip model. Rê chuột vào một Agent (trên màn hình) hoặc đọc callout (bản in) để xem thẻ chi tiết đầy đủ.Six phases, left to right — plus two hard gates: the --facts gate (before any writing) and source-auditor (Phase 2.5). Each node shows its kind, name, and what happens in it. Agent nodes carry the Claude brand mark and the model chip. Hover an Agent (screen) or read the callout (print) for its full detail card.
Năm chỗ dây nối chưa khớpFive places the wiring does not connect yet
Sơ đồ trên vẽ đúng luồng đang chạy. Phần dưới là những chỗ tài liệu và code chưa khớp nhau — đã kiểm chứng bằng cách chạy thật, không phải suy đoán. Sửa xong thì xoá mục tương ứng khỏi đây.The graph above draws the flow that actually runs. Below are the places where docs and code disagree — each verified by running it, not guessed. Delete an item here once it is fixed.
Cần sửa để sơ đồ đúng 100%What still needs fixing for the diagram to be 100% true
Xếp theo mức ảnh hưởng: #1 làm mất lợi ích cache, #2–#4 làm gate yếu hơn tưởng, #5 chỉ là nhãn.Ordered by impact: #1 nullifies the cache gain, #2–#4 weaken a gate more than the docs imply, #5 is cosmetic.
-
`captures/manifest.json` — quy ước đường dẫn lệch nhau`captures/manifest.json` — path convention mismatchCode resolve trường
filetheo thư mục chứa manifest, còn ví dụ trongweb-osint-scanner/SKILL.mdlại ghi"file": "captures/xxx.md"→ ghép thànhcaptures/captures/xxx.md→OSError→ rơi xuống fetch live, đúng cái ~17,5 phút vừa cắt. Đã kiểm chứng:"abc123.md"→cached, 0 fetched live;"captures/abc123.md"→1 fetched live. Sửa: đổi ví dụ cho khớp, hoặc cho code thử lần lượtbase_dirrồibase_dir/...The code resolves thefilefield against the manifest's own directory, but the example inweb-osint-scanner/SKILL.mdwrites"file": "captures/xxx.md"→ resolves tocaptures/captures/xxx.md→OSError→ falls back to a live fetch — exactly the ~17.5 min the change was meant to remove. Verified:"abc123.md"→cached, 0 fetched live;"captures/abc123.md"→1 fetched live. Fix: align the example, or have the code trybase_dirthenbase_dir/... -
Chart có hai chủCharts have two ownersNhóm A vẫn được lệnh "build all of these yourself, in this same call" (12 chart) và
front-matter-writerdựng 5 chart inline — trong khichart-data-analystlại tuyên bố là nơi duy nhất quyết định số liệu cho cả 18 chart. Chạy thật thì chart inline thắng,chart-manifest.jsonthành file chết.Group A is still instructed to "build all of these yourself, in this same call" (12 charts) andfront-matter-writerbuilds 5 inline — whilechart-data-analystclaims to be the single place deciding numbers for all 18. In a real run the inline charts win andchart-manifest.jsonbecomes a dead file. -
`html-renderer` — tên không tồn tại trên đĩa`html-renderer` — a name that is not on diskThư mục thật là
skills/assembler/, nhưng 4 file skill vẫn gọi nó làhtml-renderer. Trang này đã sửa vềassembler; còn phải sửa trongsource-auditor(×2),mechanical-validator(×2),chart-data-analyst— hoặc đổi tên thư mục.The real folder isskills/assembler/, yet 4 skill files still call ithtml-renderer. This page is corrected toassembler; the same fix is still needed insource-auditor(×2),mechanical-validator(×2) andchart-data-analyst— or rename the folder instead. -
`--facts` chỉ bắt được một nửa số claim`--facts` only catches half the claimsHàm quét JSON chỉ nhận dict có đủ cả
source_urlvàexcerpt. Schema củacompetitor-research-workerđểpositioningvàpricing_tierlà chuỗi trần, vàmessaging_themescósource_urlnhưng thiếuexcerpt→ 3 nhóm claim này lọt gate, chỉstrengths/weaknessesđược kiểm.The JSON walker only collects dicts holding bothsource_urlandexcerpt.competitor-research-worker's schema keepspositioningandpricing_tieras bare strings, andmessaging_themeshassource_urlbut noexcerpt→ those 3 claim groups slip past the gate; onlystrengths/weaknessesget checked. -
Check #6 — nhãn cũ, logic đúngCheck #6 — stale label, correct logic
validate-proposal.pyin ra ".assess label on Roadmap/Change Management/Hypercare" nhưngREQUIRED_ASSESS_SECTIONSchỉ còn["recommendations"]— 5 section cũ đã bị bỏ nên kết quả đúng, chỉ nhãn còn cũ. Không ảnh hưởng PASS/FAIL.validate-proposal.pyprints ".assess label on Roadmap/Change Management/Hypercare" whileREQUIRED_ASSESS_SECTIONSnow holds only["recommendations"]— those 5 sections were removed, so the result is right and only the label is stale. No effect on PASS/FAIL.
Vì sao chọn tool này, bỏ tool kiaWhy this tool, not that one — 4 nhóm quyết định— 4 decision groups
4 nhóm tool được cân nhắc — mỗi cái đánh giá theo đúng 1 câu hỏi: có áp dụng được vào pipeline technext-sales-proposal hiện tại không, và tại sao.4 tool groups considered — each judged on exactly one question: does it actually fit the current technext-sales-proposal pipeline, and why.
_xxhash), không phải do chọn sai tool. Pipeline hiện tại dùng chỉ Jina Reader, không dùng Crawl4AI. Xem web-osint-scanner/SKILL.md để biết quyết định thật hiện hành.the Crawl4AI decision below has since changed — a real install attempt got blocked by this machine's own Application Control policy (a native _xxhash DLL), not a wrong tool choice. The pipeline now uses Jina Reader only, not Crawl4AI. See web-osint-scanner/SKILL.md for the current real decision.1. Đo chi phí1. Cost tracking
ccusage, Langfuse, Heliconeccusage, Langfuse, Helicone
ccusage
Áp dụng đượcAppliesĐọc trực tiếp log local của Claude Code, miễn phí hoàn toàn, không cần key.Reads Claude Code's local logs directly, fully free, no key needed.
judgment-reviewer, xuất CSV có task label + duration.integrated into judgment-reviewer, exports a CSV with task label + duration.Langfuse
Không áp dụngDoesn't applyNền tảng LLM observability — theo dõi app tự viết gọi API LLM, cần nhúng SDK vào code.An LLM observability platform — tracks a hand-built app calling an LLM API, requires embedding an SDK in the code.
Helicone
Không áp dụngDoesn't applyHoạt động như 1 proxy đứng giữa app và LLM — đổi 1 URL trong code gọi API là xong.Works as a proxy between your app and the LLM — swap one URL in your API-calling code.
2. Đọc/quét web2. Read/crawl web
Firecrawl, Jina Reader, Crawl4AIFirecrawl, Jina Reader, Crawl4AI
Firecrawl
Được nhưng không tối ưuWorks but not optimalAPI biến website thành dữ liệu sạch, có MCP integration sẵn.API that turns websites into clean data, has a ready MCP integration.
Jina Reader (r.jina.ai)
Áp dụng được — nên dùng thay FirecrawlApplies — recommended over FirecrawlChỉ cần thêm r.jina.ai/ trước 1 URL bất kỳ là ra ngay nội dung sạch dạng markdown — không cần key cho request cơ bản.Just prepend r.jina.ai/ to any URL to get clean markdown back — no key needed for basic requests.
web-osint-scanner khi chỉ cần đọc trang chủ/trang About của khách hàng.zero setup — no signup, no install, no API key for reading one page. Fits exactly what web-osint-scanner needs when it's just reading a client's homepage/About page.web-osint-scanner dùng Jina Reader cho việc đọc từng trang đơn lẻ.switch web-osint-scanner to Jina Reader for single-page reads.Crawl4AI
Áp dụng được — giữ cho việc quét nhiều trangApplies — kept for multi-page crawlingMã nguồn mở, tự cài, hoàn toàn miễn phí, không giới hạn.Open source, self-hosted, fully free, unlimited.
3. Xác minh pháp nhân3. Legal entity verification
GLEIF, Wikidata, SEC EDGAR Full-TextGLEIF, Wikidata, SEC EDGAR Full-Text
GLEIF
Áp dụng được — đã tích hợp làm chínhApplies — already integrated as primaryAPI miễn phí, không key, chuyên biệt cho mã định danh pháp nhân (LEI) toàn cầu.Free API, no key, purpose-built for global Legal Entity Identifiers (LEI).
company-verifier — xác thực tên pháp lý/quốc gia/tình trạng hoạt động.matches company-verifier's core need exactly — verifying legal name/country/active status.Wikidata (SPARQL)
Dùng bổ sung, không thay thếSupplement only, not a replacementFree hoàn toàn, không key — nhưng là knowledge graph chung (100 triệu+ thực thể), không chuyên biệt cho pháp nhân/LEI.Fully free, no key — but a general knowledge graph (100M+ entities), not specialized for legal entities/LEI.
company-profile.SPARQL needs a roughly-known name to query, not strong for "confirm this is the right company" like GLEIF — but has other useful data (founding year, founders) for company-profile.SEC EDGAR Full-Text Search
Không áp dụngDoesn't applyMiễn phí hoàn toàn, tìm được toàn văn hồ sơ nộp lên SEC từ 2001 tới nay.Fully free, full-text search across SEC filings since 2001.
4. Kiểm tra/validate HTML4. HTML validation
BeautifulSoup4, lxml, html5validatorBeautifulSoup4, lxml, html5validator
BeautifulSoup4
Áp dụng được — nên đổi sang dùngApplies — recommended switchvalidate-proposal.py hiện tại dùng regex (re.findall) để soát HTML — khá thô, dễ báo sai khi format thay đổi nhẹ.The current validate-proposal.py uses regex (re.findall) to check HTML — fairly crude, prone to false results on minor format changes.
validate-proposal.py từ regex sang BeautifulSoup4 để giảm lỗi false positive/negative.switch validate-proposal.py's checks from regex to BeautifulSoup4 to reduce false positive/negative results.lxml
Không cần thiếtNot necessaryNhanh hơn, hỗ trợ XPath — mạnh cho xử lý file lớn/XML.Faster, supports XPath — strong for large-file/XML processing.
html5lib / html5validator
Áp dụng được — nên thêmApplies — recommended additionTuân thủ đúng spec HTML5 — dùng khi cần kiểm tra chuẩn (validator, công cụ sanitize).Strict HTML5 spec compliance — used when spec-correctness is non-negotiable (validators, sanitizers).
mechanical-validator dùng html5lib để xác nhận file xuất ra là HTML5 hợp lệ thật sự.add a new check in mechanical-validator using html5lib to confirm the output file is genuinely valid HTML5.Tóm tắt hành độngAction summary
- Đổi:
web-osint-scannerdùng Jina Reader thay Firecrawl cho việc đọc 1 trangSwitch:web-osint-scannerto Jina Reader instead of Firecrawl for single-page reads - Giữ: ccusage, GLEIF, Crawl4AI — đã đúng việc, không đổiKeep: ccusage, GLEIF, Crawl4AI — already the right fit, no change
- Thêm nhẹ: Wikidata bổ sung cho
company-profile, không thay GLEIFLight addition: Wikidata to supplementcompany-profile, not replacing GLEIF - Nâng cấp:
validate-proposal.pyđổi regex → BeautifulSoup4, thêm check html5libUpgrade:validate-proposal.pyswitch regex → BeautifulSoup4, add an html5lib check - Bỏ hẳn: Langfuse, Helicone, SEC EDGAR, lxml — không phù hợp quy mô/mục đích pipeline nàyDrop entirely: Langfuse, Helicone, SEC EDGAR, lxml — don't fit this pipeline's scale/purpose