Communitygithub.com

swapit — 家用有毒物品清查与替换引擎

有状态、本地优先的家用有毒物品清查与替换引擎。识别家中含内分泌干扰物和持久性化学物质(BPA/BPS、邻苯二甲酸酯、PFAS/PTFE、对羟基苯甲酸酯、阻燃剂、VOCs、微塑料)的物品,根据实际暴露情况(严重性 × 存在性 × 使用方式 × 状况)评分,并跟踪替换为更安全的替代品,从“标记”到“已寻源”到“已替换”。搭载一个经过精心准备、有引用的知识图谱,包含约20种危害、约40种物品类别和约40种替代品。将寻源工作交给 `procurer` 技能。该技能的状态即真相来源——智能体本身就是应用。

swapit — 家用有毒物品清查与替换引擎 是什么?

这项技能是一个全面的、状态化的、本地优先的工具,用于清查家庭环境中的有毒物品,并制定、跟踪替换计划。它内置了一个知识图谱,涵盖了约20种公认的化学危害(如BPA、邻苯二甲酸酯、PFAS)、约40种物品类别(如不粘锅、塑料水瓶)以及约40种更安全的替代品。用户可以通过CLI或本地仪表板添加物品,系统会根据实际暴露风险(严重性、存在可能性、使用频率、状况等)进行评分,并生成优先级排序的“优先替换”列表。 技能严格遵守隐私约定:所有家庭物品库存数据(私有领域)永远留存在本地设备上,绝不跨出同步边界。只有匿名化的通用事实(如替代品信息、购买渠道)才能在用户明确选择后贡献到公共“共享知识库”。 技能的设计强调模块化和可组合性。其状态(`~/.config/swapit/`)是真相来源,支持完整的CRUD操作。通过`swap`命令管理替换计划,`procure`命令则为特定物品生成寻源任务并查询公共购买渠道。此外,它与`procurer`等技能协同,实现更复杂的自动化工作流。

兼容平台~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 获取完整、有引用的数据集):

  • 危害 — id · name · aliases · class · mechanism · exposure_routes · regulatory · severity(0-3) · evidence_strength · sources
  • 物品类别 — id · name · category · description · hazards[]{hazard_id, presence_likelihood, rationale} · detection_hints · sources
  • 替代品 — id · name · replaces[] · material · rationale · tradeoffs · caveats · avoids_hazards · residual_concerns · sources
  • 采购选项(公开的购买渠道)— id · alternative · item_class · retailer · region(ISO-3166-1 a2) · area · url · price_min · price_max · currency · as_of · availability · confidence · corroboration_count
  • 物品(私有)— id · name · item_class · room · quantity · brand · condition · usage{frequency, food_contact, heat, child_contact} · status · notes · photos
  • 替换计划(私有)— 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 报告(Category-C)
procure采购任务摘要 + 已知的购买渠道 用于替换目标(可按 --region 筛选);记录你找到的优惠信息(--retailer/--url/--price-*)到公共共享知识库
knowledge浏览/搜索知识图谱(list/search/show)
rooms列出/添加房间
selfheal验证知识边、库存引用和基础引用;出错时返回非零退出码
serve本地实时仪表板,位于 http://127.0.0.1:8731 — 看板、检查清单、书签、状态;每次点击都写回状态
contribute加入一个匿名化事实的队列 — product / hazard(物品类别→危害)/ alternative / procurement(公开的购买渠道)/ item-class(新的分类节点);在本地应用并等待共享知识库审核
sync推送贡献队列并拉取社区知识(选择加入);--dry-run 预览将要发送的;--configure 设置端点

典型流程

swapit init
swapit add --name "Old Teflon pan" --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 "buy 10in skillet"
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、美国 EPA、美国 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 报告生成器(Category-C)
  • scripts/server.py — swapit serve 实时仪表板(基于 stdlib http.server,仅本地主机)
  • scripts/anonymize.py — 隐私门:允许列表事实构建器 + 禁止字段扫描
  • scripts/sync.py — 共享知识库同步客户端(队列、--dry-run 预览、推/拉、合并)
  • scripts/selfheal.py — 完整性验证器
  • templates/dashboard.html — 实时仪表板(内联 CSS/JS,Category-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) 进行内容寻址——同一优惠信息在不同用户间会互相佐证;不同的地区是一个不同的事实(地理尺度轴)。价格/URL/地区是可细化的市场数据:一个具有严格更新 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'.

相关技能