AgentSkillsCN

architecture

为 theme-extractor 设计并持续演进软件架构,明确各模块边界、制定策略接口,并引入后端抽象层。适用于定义模块结构、引入提取策略,或实现 Elasticsearch/OpenSearch 互操作性时使用。

SKILL.md
--- frontmatter
name: architecture
description: Design and evolve the software architecture of theme-extractor with explicit boundaries, strategy interfaces, and backend abstractions. Use when defining module structure, introducing extraction strategies, or implementing Elasticsearch/OpenSearch interoperability.

Architecture Skill

Purpose

Design a maintainable architecture with clear contracts and low coupling.

Workflow

  1. Run MBAD before deciding architecture changes.
  2. Define or update typed contracts first (models, protocols, interfaces).
  3. Apply strategy pattern for extraction methods.
  4. Decouple ingestion, preprocessing, extraction, and output serialization.
  5. Record architecture tradeoffs in plan.md.

Mandatory Decisions

  • Define one thin search backend protocol with:
    • search_documents(...)
    • terms_aggregation(...)
    • significant_terms_aggregation(...)
    • significant_text_aggregation(...)
  • Implement one Elasticsearch adapter.
  • Implement one OpenSearch adapter.
  • Keep one normalized result schema shared by all extractors.

Deliverables

  • Update interfaces and protocols.
  • Update module boundaries.
  • Update plan entries for architecture decisions.