sldd-99-existing-codebase-understanding-and-context-summary

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill: Existing Codebase Understanding and Context Summary

Skill:现有代码库理解与上下文总结

This is an optional prerequisite step. For greenfield projects, skip this and proceed directly to sldd-01.
Context: You are a senior engineer joining a project with an existing codebase. Before any design or implementation work begins, you must read and understand the current code so that all subsequent decisions build on established patterns instead of contradicting them.
Repository or module scope: <provide path or module names>
Objective: Read and summarize the existing codebase so that all subsequent SLDD steps (product intent, design, implementation) are grounded in reality.
This is critical because:
  • Alignment: solutions should build on established patterns, not contradict them.
  • Consistency: naming, architecture, and error handling should match the codebase, not impose new conventions.
  • Risk reduction: AI-generated designs that ignore existing code often lead to conflicts, duplicated logic, or architectural surprises.
  • Faster integration: understanding the codebase upfront prevents redesign cycles later.
Audience: Engineers and tech leads who will use this summary as shared context for design and implementation prompts.
Style: Structured and factual. Reference real files and patterns. No speculation.
Tone: Objective. Report what exists. Flag risks and unknowns clearly.
Response: Deliver exactly these sections in this order:
  1. Repository structure overview (main folders, entry points, build system)
  2. Architecture summary (layers, modules, boundaries, key abstractions)
  3. Conventions to preserve (naming, error handling, code style, test patterns)
  4. Integration points (APIs, data stores, messaging, external services)
  5. Risks and unknowns (tech debt, drift areas, undocumented decisions)
  6. Context summary to carry into subsequent SLDD steps
Include this summary as context in all subsequent design and implementation prompts.
这是一个可选的前置步骤。对于greenfield(全新从零开发)项目,可跳过本步骤直接进入sldd-01。
背景: 你是一名加入某现有代码库项目的资深工程师。在开始任何设计或实现工作之前,你必须阅读并理解当前代码,确保所有后续决策都建立在已有模式之上,而非与其冲突。
代码仓库或模块范围:<提供路径或模块名称>
目标: 阅读并总结现有代码库,确保后续所有SLDD步骤(产品意图、设计、实现)都基于实际情况开展。
这一步至关重要,原因如下:
  • 一致性:解决方案应当基于已有模式构建,而非与之冲突。
  • 统一性:命名、架构和错误处理应当与现有代码库保持一致,不要强行引入新的规范。
  • 降低风险:忽略现有代码的AI生成设计通常会导致冲突、逻辑重复或架构隐患。
  • 提升集成效率:提前理解代码库可以避免后续的返工重设计。
适用人群: 需要将该总结作为设计和实现提示共享上下文的工程师和技术负责人。
风格要求: 结构化、符合事实。引用真实文件和模式,不要主观臆测。
语气要求: 客观。如实报告现有内容,清晰标注风险和未知项。
输出要求: 严格按照如下顺序输出对应章节:
  1. 代码仓库结构概览(主要文件夹、入口点、构建系统)
  2. 架构总结(分层、模块、边界、核心抽象)
  3. 需要遵守的规范(命名、错误处理、代码风格、测试模式)
  4. 集成点(API、数据存储、消息队列、外部服务)
  5. 风险与未知项(技术债务、偏离规范的区域、无文档说明的决策)
  6. 带入后续SLDD步骤的上下文总结
在所有后续的设计和实现提示中,都需要将该总结作为上下文包含在内。