refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조

에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Antigravity Agent
2026-07-11 11:05:56 +09:00
parent 6549ead309
commit c24165b8bc
6193 changed files with 1717 additions and 31 deletions
@@ -0,0 +1,175 @@
---
id: wiki-2026-0508-추상화-abstraction
title: 추상화(Abstraction)
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Abstraction, 추상화, Data Abstraction]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [software-design, fundamentals, oop, abstraction]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: any
framework: any
---
# 추상화(Abstraction)
## 매 한 줄
> **"매 essential 의 의 keep, 매 incidental 의 의 hide"**. 매 complexity management 의 의 의 의 의 핵심 의 mechanism — 매 detail 의 의 selectively 의 의 의 reveal 의 의 conceptual model 의 의 의 expose. 매 SOLID 의 D (Dependency Inversion) 의 의 의 foundation.
## 매 핵심
### 매 Abstraction 의 의 의 forms
1. **Procedural** — 매 function 의 의 의 의 의 step 의 hide.
2. **Data** — 매 representation 의 의 의 의 hide (ADT).
3. **Control** — 매 flow 의 의 의 hide (iterator, async).
4. **Type** — 매 generic / parametric polymorphism.
5. **Interface** — 매 contract 의 의 의 의 의 expose, impl 의 의 의 hide.
### 매 Levels of abstraction
- **High** — 매 business domain ("place order").
- **Mid** — 매 application logic ("validate cart").
- **Low** — 매 implementation ("HTTP POST").
- **Hardware** — 매 CPU instruction.
### 매 핵심 properties
- **Information hiding** (Parnas, 1972) — 매 client 의 의 의 의 implementation 의 의 의 X.
- **Encapsulation** — 매 state + behavior 의 의 의 의 bundle.
- **Substitutability** (LSP) — 매 abstraction 의 의 의 의 의 satisfy 의 implementation 의 의 의 의 swap 의 의 가능.
### 매 vs Encapsulation
- 매 Abstraction = 매 "what" — 매 의 logical model.
- 매 Encapsulation = 매 "how" — 매 mechanism (private, accessor).
## 💻 패턴
### 매 Procedural abstraction
```python
def calculate_invoice_total(invoice: Invoice) -> Money:
subtotal = sum_line_items(invoice.lines)
discount = apply_discounts(subtotal, invoice.coupons)
tax = compute_tax(subtotal - discount, invoice.address)
return subtotal - discount + tax
```
### 매 Data abstraction (ADT)
```python
from abc import ABC, abstractmethod
class Stack[T](ABC):
@abstractmethod
def push(self, item: T) -> None: ...
@abstractmethod
def pop(self) -> T: ...
@abstractmethod
def peek(self) -> T: ...
@abstractmethod
def is_empty(self) -> bool: ...
# 매 ArrayList 의 의 의 implementation, LinkedList 의 의 의 의 implementation — 매 swap 가능
```
### 매 Interface (contract)
```typescript
interface PaymentGateway {
charge(userId: string, amount: Money): Promise<ChargeResult>;
refund(chargeId: string): Promise<RefundResult>;
}
class StripeGateway implements PaymentGateway { /* ... */ }
class AdyenGateway implements PaymentGateway { /* ... */ }
class FakeGateway implements PaymentGateway { /* test */ }
```
### 매 Dependency inversion
```java
// 매 High-level 의 의 의 abstraction 의 의 의 의 의 depend, 매 low-level impl 의 의 의 X.
class OrderService {
private final PaymentGateway gateway; // 매 abstraction
public OrderService(PaymentGateway gw) { this.gateway = gw; }
}
```
### 매 Type abstraction (generic)
```rust
fn largest<T: PartialOrd>(list: &[T]) -> &T {
let mut largest = &list[0];
for item in list {
if item > largest { largest = item; }
}
largest
}
```
### 매 Control abstraction (iterator)
```python
def first_match(items: Iterable[T], pred: Callable[[T], bool]) -> T | None:
for item in items:
if pred(item): return item
return None
# 매 list, generator, file, stream 의 의 모두 의 의 의 work
```
### 매 Leaky abstraction (Joel Spolsky)
```python
# 매 Bad — 매 underlying TCP 의 의 의 의 의 leak
def send(msg):
try: socket.send(msg)
except ConnectionResetError: ... # 매 abstraction 의 의 의 의 의 break
# 매 Better — 매 wrap
class MessageBus:
def send(self, msg) -> SendResult:
try: self._socket.send(msg); return SendResult.OK
except: return SendResult.RETRY
```
### 매 Higher-Kinded abstraction
```scala
trait Functor[F[_]] {
def map[A, B](fa: F[A])(f: A => B): F[B]
}
// 매 List, Option, Future 의 의 모두 의 Functor — 매 abstraction 의 의 의 매 type constructor 의 의 over
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| 매 detail 의 의 의 client 의 의 의 의 X 의 의 needed | 매 hide via 매 interface |
| 매 multiple impl 의 의 의 expected | 매 abstract class / interface |
| 매 single use, single impl | 매 직접 — 매 premature abstraction 의 X |
| 매 stable detail | 매 leak 의 의 의 의 의 fine — 매 simplicity 의 win |
| 매 cross-process boundary | 매 strong abstraction (RPC, queue) |
**기본값**: 매 rule of three — 매 셋 의 의 의 의 의 occur 의 의 의 의 abstract.
## 🔗 Graph
- 변형: [[Encapsulation]] · [[Information Hiding]] · [[Polymorphism]]
- 응용: [[SOLID]] · [[Hexagonal Architecture]] · [[Clean Architecture]]
- Adjacent: [[TypeScript 타입 시스템 (TypeScript Type System)|Type System]]
## 🤖 LLM 활용
**언제**: 매 design — 매 boundary 의 의 의 draw, 매 변경 의 의 absorb 의 의 의 abstraction layer 의 의 의 introduce.
**언제 X**: 매 single-call site, 매 prototype — 매 premature abstraction 의 의 의 cost.
## ❌ 안티패턴
- **Premature abstraction**: 매 한 implementation 의 의 의 의 의 interface 의 의 introduce — 매 noise.
- **Leaky abstraction**: 매 underlying detail 의 의 의 의 surface — 매 client 의 의 의 의 know 의 의 force.
- **God interface**: 매 모든 의 method 의 의 의 의 한 interface 의 의 — ISP 의 violation.
- **Wrong abstraction (Sandi Metz)**: 매 잘못 의 abstraction 의 의 의 duplication 의 의 보다 의 worse.
## 🧪 검증 / 중복
- Verified — Parnas (1972) "On the Criteria To Be Used in Decomposing Systems"; Joel Spolsky "Law of Leaky Abstractions"; Sandi Metz, *Practical Object-Oriented Design*.
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — abstraction forms + leaky / wrong-abstraction discussion |