bp-component-design

bp-component-design is a skill for Claude Code, Codex from davidYichengWei/agentic-engineering-framework. It costs 50 tokens per session (2,099 once invoked), scanned A, original, MIT.

A guide to designing individual software components, such as classes, modules, interfaces, and data models. It includes rules for responsibilities, dependencies, error handling, concurrency, and common design patterns.

In plain words
What is it for?
Use it during detailed system design or code review to evaluate module boundaries, public interfaces, class responsibilities, dependencies, and design patterns.
Why use it?
It helps prevent components from becoming too tightly connected, too difficult to replace, or unclear about what they own and expose.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/davidyichengwei/agentic-engineering-framework/bp-component-design
Any agent
npx skills add davidYichengWei/agentic-engineering-framework --skill bp-component-design
Clone the repo
git clone --depth 1 https://github.com/davidYichengWei/agentic-engineering-framework

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bp-component-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidyichengwei/agentic-engineering-framework/bp-component-design.svg)](https://agentmods.dev/skills/davidyichengwei/agentic-engineering-framework/bp-component-design)
Your own site
<a href="https://agentmods.dev/skills/davidyichengwei/agentic-engineering-framework/bp-component-design"><img src="https://agentmods.dev/badge/skills/davidyichengwei/agentic-engineering-framework/bp-component-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,099 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.02099
Opus 5 $0.00025 $0.01050
Sonnet 5 $0.00010 $0.00420
Haiku 4.5 $0.00005 $0.00210

Measured 4d ago against content hash 7428cfd61472, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bp-component-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bp-component-design/SKILL.md · 231 lines

How it starts

The opening of the file, as written. The whole thing — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.

组件设计

使用场景workflow-system-design skill 在讨论 spec.md 4.2 组件设计 时加载本 skill。

第一性原理

组件设计的本质:把架构方案转化为可实现的代码结构,定义清晰的职责边界和交互契约。


4.2.1 核心类/模块设计

SOLID 原则

原则 含义 检查点
Single Responsibility 类只做一件事 这个类能用一句话描述吗?
Open/Closed 对扩展开放,对修改关闭 新增功能是否需要改现有代码?
Liskov Substitution 子类可替换父类 子类是否违反父类契约?
Interface Segregation 接口精简专一 调用方是否被迫依赖不需要的方法?
Dependency Inversion 依赖抽象而非具体 高层模块是否直接依赖低层实现?

设计原则

原则 说明
组合优于继承 继承紧耦合,组合松耦合易替换
面向接口编程 依赖抽象接口,而非具体实现
最小知识原则 避免链式调用暴露内部结构

常用设计模式

类型 模式 适用场景
创建型 Factory 封装对象创建逻辑
创建型 Builder 分步构建复杂对象
结构型 Adapter 接口转换
结构型 Decorator 动态添加职责
行为型 Strategy 可替换算法
行为型 Template Method 定义算法骨架,子类实现细节
行为型 Iterator 数据流处理、管道模式

Checklist

  • 类职责是否单一清晰?
  • 继承层次是否合理(不超过 2-3 层)?
  • 依赖是否指向抽象而非具体实现?
  • 模块边界是否明确?

4.2.2 接口设计

接口设计关注对外暴露的 public API,内部接口在 4.2.1 中定义。

设计原则

原则 说明
最小化 只暴露必要的接口,隐藏实现细节
一致性 命名、参数顺序、错误处理风格统一
向后兼容 接口变更不破坏现有调用方
自描述 接口签名本身能表达意图

接口定义要素

// 示例:接口定义应包含
class StorageEngine {
public:
    // 1. 方法签名:清晰的命名和参数
    // 2. 参数约束:哪些可为空?取值范围?
    // 3. 返回值:成功/失败如何表示?
    // 4. 错误码:可能返回哪些错误?
    // 5. 线程安全:是否可并发调用?
    
    /**
     * @brief 写入 KV 对
     * @param key 键,不能为空
     * @param value 值
     * @return Status::OK 成功
     *         Status::KeyTooLong key 超过 64KB
     *         Status::IOError 写入失败
     * @thread_safety 线程安全
     */
    virtual Status Put(const Slice& key, const Slice& value) = 0;
};

版本兼容策略

变更类型 兼容性 处理方式
新增方法 向后兼容 直接添加
新增可选参数 向后兼容 提供默认值
删除方法 不兼容 先废弃,下个大版本删除
修改参数类型 不兼容 新增方法,废弃旧方法

Checklist

  • 接口是否最小化(不暴露不必要的方法)?
  • 参数和返回值是否清晰定义?
  • 错误码是否完整列出?
  • 线程安全性是否说明?
  • 是否考虑了向后兼容?

Read the full file on GitHub · 231 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 231 lines · 50 tokens per session scan A 7428cfd61472

Subscribe to this mod's changes

bp-component-design is a skill published in the GitHub repository davidYichengWei/agentic-engineering-framework (158 stars, last pushed 5mo ago), licensed MIT. It adds 50 tokens to every session and 2,099 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens