Communitygithub.com

swapit — 家庭有害物質盤點與替代方案引擎

基於狀態、本機優先的家中毒物盤點與取代引擎。辨識家中含有內分泌干擾物與持久性化學物質(BPA/BPS、鄰苯二甲酸酯、PFAS/PTFE、對羥基苯甲酸酯、阻燃劑、VOCs、微塑膠)的物品,依據*真實*暴露程度(嚴重性 × 存在機率 × 使用方式 × 狀態)進行評分,並追蹤從「標記」→「來源」→「已取代」的替代方案交換。隨附一個引用完整的知識圖譜,涵蓋約20種危害、約40個物品類別與約40種替代方案。將採購任務交由 `procurer` 技能處理。技能的狀態即為真相來源——代理程式本身就是應用程式。

swapit — 家庭有害物質盤點與替代方案引擎 是什麼?

swapit 是一個專為 AI 代理程式設計的家中毒物盤點與取代引擎,支援 Claude Code、Cursor 等平台。其核心功能是將使用者對家中塑膠與化學物質的模糊擔憂,轉化為具體、優先且可追蹤的行動計畫。使用者可以新增物品、獲取風險評分、查看「優先取代清單」,並追蹤替代方案的採購與取代狀態。技能採用本機優先的設計,所有物品清單資料僅儲存在本地磁碟,不會上傳至雲端,確保隱私。此外,swapit 內建一個引用政府與公衛機構(如 NIEHS、EPA、WHO)的知識圖譜,涵蓋危害、物品類別與替代方案,並支援社群貢獻(透過匿名化的事實共享),但嚴格禁止任何物品清單資料跨越同步邊界。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/broomva/skills/tree/HEAD/skills/commerce/swapit

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

swapit — 家庭有害物質盤點與替代方案引擎 是做什麼的?

這個技能是做什麼的

swapit 能將模糊的擔憂(「我家裡大概有很多塑膠和 BPA」)轉化為具體、優先、可追蹤的計畫。它是有狀態的:你的家庭物品清單存在磁碟上,並跨工作階段持續存在。它是本機優先的:零付費服務,除非你明確選擇加入 (M3) 共享知識庫,否則所有資料都不會離開你的裝置。

一次執行可以產生:

  1. 一份物品清單,列出你擁有的物品,每個物品都標有其通用的物品類別。
  2. 每件物品的風險評分,反映實際暴露程度 — 每天高溫使用的刮傷不沾鍋,風險遠高於車庫中未開封的塑膠箱。
  3. 一份排序的「優先取代清單」 — 能最大程度降低暴露風險的 5% 改變。
  4. 取代追蹤 — 選擇的替代方案、採購狀態、檢查清單、書籤。
  5. 一份可分享的 HTML 報告(在 M2 中,還有 swapit serve 的即時儀表板)。

三個領域(以及隱私不變性)

領域內容分享性
1 · 知識危害 → 物品類別 → 替代方案(通用、引用的事實)可分享;快取 + (M3) 共享知識庫同步
2 · 物品清單你的物品、房間、數量、品牌、照片、取代、書籤私密 — 絕不離開裝置
3 · 共享知識庫 (M3)匿名貢獻,豐富共享的知識圖譜選擇加入,經審查,僅限通用事實

隱私不變性(具約束力): 領域-2 物品清單(物品、房間、數量、品牌、照片、購買資訊、位置)絕不跨越同步邊界。只有領域-1 的通用事實可分享,且需經明確選擇加入 + 可審查的 swapit sync --dry-run。由客戶端上的允許清單序列化器 (scripts/anonymize.py) 以及共享知識庫伺服器上的後備防護強制執行,並輔以模糊測試,斷言每個真實物品清單項目都會被閘門拒絕。禁止欄位清單:anonymize.CONTRIBUTION_FORBIDDEN(state.PRIVATE_FIELDS 中物品清單結構的子集)。

資料模型

狀態資料位於 ~/.config/swapit/(可用 $SWAPIT_HOME 覆蓋;遵循 $XDG_CONFIG_HOME)。

~/.config/swapit/
├── knowledge/   hazards.jsonl · item-classes.jsonl · alternatives.jsonl · products.jsonl · procurement.jsonl
├── inventory/   events.jsonl(僅附加稽核) · items.json · swaps.json · rooms.json · bookmarks.json
├── contributions/ queue.jsonl   (M3)
├── sync/        config.json · sync-log.jsonl   (M3)
└── photos/

節點架構(完整、引用資料集請參閱 seed/*.jsonl):

  • hazards — id · name · aliases · class · mechanism · exposure_routes · regulatory · severity(0-3) · evidence_strength · sources
  • item_class — id · name · category · description · hazards[]{hazard_id, presence_likelihood, rationale} · detection_hints · sources
  • alternative — id · name · replaces[] · material · rationale · tradeoffs · caveats · avoids_hazards · residual_concerns · sources
  • procurement_option(何處購買,公開) — id · alternative · item_class · retailer · region(ISO-3166-1 a2) · area · url · price_min · price_max · currency · as_of · availability · confidence · corroboration_count
  • item(私密) — id · name · item_class · room · quantity · brand · condition · usage{frequency, food_contact, heat, child_contact} · status · notes · photos
  • swap(私密) — id · item_id · chosen_alternative · procurement{status, cost, vendor} · checklist[] · bookmarks[]

風險模型

risk = severity × presence_likelihood × evidence × exposure_relevance × frequency × condition
  • exposure_relevance 會根據物品的使用方式啟動危害的暴露途徑(食品接觸 + 高溫會將食入/食品接觸/高溫危害最大化;皮膚接觸對個人護理品很重要;吸入對清潔/家具很重要;兒童接觸會放大)。
  • 物品分數 = 每個危害風險的加權總和 → 劃分為高 / 中 / 低等級。
  • 這是優先排序的智慧 — 類似於採購技能的「主導失效模式」:先修復造成大部分暴露的少數物品,而不是列出一份讓人有罪惡感的全部塑膠清單。

模式

模式功能
init建立狀態 + 載入種子知識圖譜
add新增家庭物品(名稱、類別、房間、狀態、使用方式) → 顯示其評估結果
assess評估物品或臨時物品類別 → 危害 + 風險 + 排序的替代方案
list列出物品清單,依 --room/--band/--status/--class/--hazard 篩選,依風險排序
swap建立/更新取代計畫:選擇替代方案,設定狀態、檢查清單、書籤、成本
score家庭暴露摘要 + 優先取代排名
report產生自包含的 HTML 報告(類別-C)
procure採購技能交接簡報 + 針對取代目標的已知購買管道(依 --region 篩選);記錄找到的管道(--retailer/--url/--price-*)到公開共享知識庫
knowledge瀏覽/搜尋知識圖譜(list/search/show)
rooms列出/新增房間
selfheal驗證知識邊緣 + 物品清單引用 + 基礎事實;錯誤時以非零狀態碼退出
serve本機即時儀表板於 http://127.0.0.1:8731 — 看板、檢查清單、書籤、狀態;每次點擊都會寫回狀態
contribute將匿名事實排入佇列 — product / hazard (item-class→hazard) / alternative / procurement(公開購買管道)/ item-class(新分類節點);在本機套用 + 經閘門控管後進入共享知識庫
sync推送貢獻佇列 + 拉取社群知識(選擇加入);--dry-run 預覽將發送的確切內容;--configure 設定端點

典型流程

swapit init
swapit add --name "舊的不沾鍋" --class nonstick-cookware --room kitchen \
           --condition scratched --frequency daily --food-contact --heat
swapit score                      # 看看優先取代什麼
swapit swap itm_xxxx --to cast-iron-skillet --status sourcing --add-task "買一個10吋鑄鐵鍋"
swapit procure itm_xxxx           # -> 將簡報交給 `procurer` 技能
swapit report --open              # 可分享的 HTML

與其他技能協作

  • procurer — swapit procure <item> 建立需求(「更換 3 個聚碳酸酯水瓶為玻璃/不鏽鋼」)和現成的採購提示;procurer 回傳引用來源 + 預算範圍。
  • bookkeeping (P6) — 一個新穎、持久的危害/產品發現(例如新表徵的物品類別)會主動歸檔到 research/entities/,之後可流入共享知識庫。
  • health — 個人暴露背景。content-creation — 從知識圖譜產生教育文章。

基礎事實紀律

種子知識僅引用權威機構(NIEHS、ATSDR/CDC、US EPA、US FDA、ECHA/EU REACH、CA OEHHA Prop 65、WHO、EWG)。每筆記錄都有 ≥1 個來源;verified: false 標記這些為參考級(非最新擷取)——執行一次來源更新(或透過共享知識庫)來重新整理。selfheal 在任何節點失去引用時會失敗。這是基於公共衛生科學的消費者指導,非醫療或法律建議。

資源

  • scripts/swapit.py — CLI 入口點 + 指令處理器
  • scripts/state.py — 兩個領域的狀態層(PRIVATE_FIELDS 定義同步邊界)
  • scripts/ops.py — 單一狀態變更寫入路徑(CLI 與儀表板共用)
  • scripts/knowledge.py — 知識圖譜載入 + 邊緣解析
  • scripts/risk.py — 暴露風險評分引擎
  • scripts/report.py — 自包含 HTML 報告產生器(類別-C)
  • scripts/server.py — swapit serve 即時儀表板(標準庫 http.server,僅限本機)
  • scripts/anonymize.py — 隱私閘門:允許清單事實建構器 + 禁止欄位掃描
  • scripts/sync.py — 共享知識庫同步客戶端(佇列、--dry-run 預覽、推送/拉取、合併)
  • scripts/selfheal.py — 完整性驗證器
  • templates/dashboard.html — 即時儀表板(內嵌 CSS/JS,類別-C)
  • commons/ — 網路共享知識庫參考伺服器(FastAPI + SQLite;部署需經過閘門)
  • seed/{hazards,item-classes,alternatives}.jsonl — 有基礎事實的起始知識
  • tests/ — 風險、知識、自我修復、CLI、隱私/匿名化、同步、報告和伺服器測試

協作(共享知識庫)

貢獻僅限於通用事實 — swapit contribute product|hazard|alternative|procurement|item-class 建立一個匿名化事實(公開產品→物品類別映射、危害邊緣修正、替代方案、購買管道或新的分類節點),在本機套用並排入佇列。swapit sync --dry-run 顯示完全將被傳送的內容;swapit sync 推送佇列並拉取社群知識(選擇加入,在 --configure 之後)。來自不同使用者的相同事實會相互佐證(以內容定址)而非重複;共享知識庫在兩個不同貢獻者確認該事實後才提供該事實(corroboration >= 2)——審核是以佐證為門檻,非信任度為門檻,因為 confidence 由呼叫者提供,單一提交者可能自我核准。隱私不變性在兩端(客戶端 anonymize 閘門 + 伺服器後備防護)強制執行——物品清單永不跨越。

購買管道(採購)共享知識庫

一個 procurement_option 事實是一個公開管道:由 retailer 在 region(ISO-3166-1 alpha-2)銷售的較安全 alternative,附有可選的 url、price_min/price_max + currency + as_of、area 和 availability。它以 (alternative, retailer, region) 的組合進行內容定址——跨使用者佐證同一管道;不同地區則視為不同事實(地理尺度軸線)。價格/網址/區域是可細化的市場資料:佐證一個嚴格更新 as_of 的事實會將價格向前更新,絕不會回歸更新的資料。隱私界線清晰——公開管道使用 retailer + price_*,絕不使用私密的 vendor/cost(你在哪裡買以及付了多少錢留在領域 2)。swapit procure <item> --region <CC> 會顯示已知管道,並記錄你找到的新管道——建立一個開放、詳細、地理範圍明確的資料集,任何人都可以使用。

路線圖

  • M1(已發布,0.1.0) — 資料模型、種子知識、CLI、風險引擎、靜態 HTML 報告、自我修復。
  • M2(已發布,0.2.0) — swapit serve:具有讀/寫回狀態功能的即時本機儀表板。
  • M3(0.3.0) — 匿名化協作 + 網路共享知識庫(commons/,FastAPI + SQLite)。透過允許清單序列化 + 客戶端和伺服器端的模糊測試強制執行隱私不變性。
  • M4(本次發布,0.4.0) — 地理擴展的採購共享知識庫 + 分類學成長:procurement_option(公開購買管道,以 (alternative, retailer, region) 為鍵,僅向前更新價格)和 item_class(以佐證為門檻的分類學成長)事實類型;procure 顯示 + 記錄管道;跨 US/CO/DE/GB 的種子管道;跨語言雜湊奇偶校驗由固定向量鎖定。部署到 broomva.tech 基礎設施須經明確許可(憑證/DNS);該技能在離線狀態下也能完全正常運作。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

broomva/skills

Local TTS, voice cloning, voice design, and video dubbing via the OmniVoice Studio MCP server (open-source ElevenLabs alternative; nothing leaves the machine, runs on MPS/CUDA/CPU). Use when: (1) generating speech from text in any of 646 languages, (2) cloning a voice from a 3-second reference clip, (3) designing a voice by gender/age/accent/pitch/style, (4) dubbing a video into another language, (5) listing voice profiles or personality presets, (6) producing narration where privacy, cost, or absent API keys matter, (7) non-English narration where Edge TTS/kokoro fall short, (8) batch audio for blog posts or content pipelines. Triggers: 'omnivoice', 'voice clone', 'clone this voice', 'tts', 'narrate', 'generate speech', 'voice synthesis', 'dub video', 'voice design', 'local tts', 'multilingual voice', 'narrate this post', 'elevenlabs alternative'.

broomva/skills

>- Speak an explanation out loud while working in any project — tiered text-to-speech with a pluggable backend (ElevenLabs by default and quota-guarded, macOS `say` via `--fast` for free instant local speech, local OmniVoice as an unlimited private tier). Markdown-aware, so code fences, URLs and deep paths collapse to short spoken placeholders instead of being dictated character by character, while snake_case identifiers survive intact so the listener can still search for them. Every utterance is saved to disk for later replay. Also carries a **talk mode** toggle: turn it on and the agent speaks a full readback of every turn, for as long as that session lasts — the whole response, not a summary of it, with `brief` and `marker` levels for when you want less. Talk mode is off by default and scoped to the single session that enabled it, so parallel agents in other worktrees stay silent. Use when the user asks to hear something rather than read it — an explanation of a change, a walkthrough of what just happen...

broomva/skills

Shop Tiendas D1 (Colombia, d1.com.co) from the command line — search the catalogue, resolve your nearest physical store, price a basket against that store's real stock, and quote delivery. D1 runs VTEX IO (account `d1tiendas`), so this drives its public storefront API with no admin key at all — catalogue and cart work fully anonymously, and a one-time emailed code unlocks order history. Handles the two traps that make naive D1 automation wrong — availability is regionalized (an unregioned query reports a national catalogue nobody can actually buy from) and prices arrive in two different units (search reports whole pesos, checkout reports hundredths, a silent 100x). Builds and prices baskets; it deliberately cannot pay, handing a checkout URL to a human instead. USE WHEN the user wants to find D1 products or prices, check whether D1 delivers somewhere, build or cost a D1 grocery basket, compare D1 items, or review their D1 orders. NOT FOR other Colombian retailers (Éxito, Jumbo, Ara, Alkosto), and not for c...

broomva/skills

Tekton — the shared architecture-intent substrate for co-designing systems with the agent. One typed graph across six tiers (system / journey / data / infra / decisions / qualities); views are queries, not separate diagrams. The canonical artifact is a diff-friendly YAML model both human and agent read and write; it renders to Mermaid (agent-legible, GitHub-native) and a self-contained tabbed HTML viewer (human-visual). Cross-tier traceability (`tekton query <from> <to>`) answers "which infra does this user-journey step touch?" as a path query. USE WHEN: designing or thinking deeply about architecture, a system, a data model, user journeys/flows, or a technical plan WITH the agent; when a Category-C HTML doc isn't enough because you need to see AND edit AND traverse the design across tiers; "let's design X", "architect this", "model the system", "draw the flow", "how does this fit together", "diagram this", "/tekton". NOT FOR: a one-off throwaway diagram (use Mermaid inline); prose-only ADRs (write the ADR...

broomva/skills

Generate a polished Remotion video and X thread showcasing the full agent skills inventory. Use when creating social media content about skills, rendering category-based skill visualizations, or producing animated showcases of agent capabilities. Triggers on "skills video", "showcase skills", "skills thread", "render skills", "social content for skills", or requests to visualize the skills inventory.

broomva/skills

OpenCaptions extension for Content Engine — adds intent-driven CWI (Caption With Intent) captions to the post-production pipeline. Hooks into the grade → caption → final stage. Generates captions that understand video intent (pitch, volume, emotion, emphasis) and style themselves accordingly with variable font weight, size, and color. Uses the OpenCaptions CLI or MCP server. Triggers on: 'add captions', 'opencaptions', 'CWI captions', 'intent captions'.

broomva/skills

Produce polished product launch videos using the Liquid Glass aesthetic — dark void backgrounds, 3D perspective floating UI panels, particle effects, spring animations, and cinematic pacing. Built on Remotion with Imagen 4.0 for frames and Veo 3.1 for B-roll. Use when: (1) creating a product demo or launch video, (2) showcasing a UI/app/tool with cinematic polish, (3) building a social-ready video from screenshots and renders, (4) applying the liquid glass floating panel style, (5) composing Remotion videos with 3D transforms and spring animations. Triggers on: 'launch video', 'product video', 'liquid glass video', 'demo video', 'showcase video', 'remotion video', 'floating panel', 'glass aesthetic'.

相關技能