Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Algebraic thinking for API design. Discover the right API before implementing by specifying rules (equations) that operations must satisfy.
Cross-references: fp-principles | fp-domain-modeling | fp-usable-design
[STARTER]
Code is the wrong abstraction level for design. Starting with data structures inherits unnecessary constraints.
[STARTER]
[STARTER] -> [ADVANCED]
Recurring patterns in software. Recognizing them unlocks known rules and capabilities.
What: Type with one merge operation where grouping doesn't matter.
Rule: (a merge b) merge c = a merge (b merge c) (associativity)
When: Combining things where parenthesization shouldn't matter.
Examples: String concatenation | config merging | min/max.
What: Combinable Value with a default element inert under combination.
Rules: Associativity + default merge x = x and x merge default = x
When: Safe defaults | fold operations | "nothing happened yet" values.
Examples: (+, 0) | (*, 1) | (concat, []) | (and, true).
Design signal: If you find an associative operation, look for a default element. Finding one enables fold/reduce over collections.
What: Combinable Value where merging is also order-independent and idempotent.
When: Conflict resolution | eventually-consistent systems | CRDTs.
Example: Status tracker with seen < failed < completed uses max as merge.
What: Container type where you can transform contents without changing structure. Preserves identity and composition. When: Operations that work on data shape rather than values inside. Design signal: If most operations are agnostic to contained type, you likely have this.
What: Container where you can combine contents element-wise and fill with uniform values. When: Combining containers holding different content types.
What: Combinable Value with Default where every element has an inverse that cancels it. When: Undo operations | spatial transformations. Example: Clockwise/counter-clockwise rotation are inverses; horizontal flip is its own inverse.
[INTERMEDIATE]
Three categories, eight properties:
Clarity (communicates well):
Economy (no waste):
Safety (prevents mistakes):
[INTERMEDIATE]
Complex rules mean coarse building blocks. Split operations with many parameters into smaller, orthogonal ones. If a rule ignores some parameters, those should be separate operations.
Algebraic manipulation reveals contradictions before code is written. Requiring order-independence while returning an ordered list is a contradiction. Fix: use unordered collection.
When multiple observations share traversal logic, find one observation from which all others derive. Simplifies entire rule set.
When you have a "both" operation (parallel composition), look for its symmetric "either" counterpart. Symmetry discovers functionality not explicitly requested but inevitably needed.
[INTERMEDIATE]
Key insight: Two values are equal if no observation distinguishes them. Testing through observations allows completely different implementations to pass the same suite.
Is your domain about COMBINING things?
YES --> Algebraic thinking helps significantly
Do combinations have rules (order irrelevant, defaults, inverses)?
YES --> Known algebraic structures; use their rules directly
NO --> Rules still help, but structures are not standard
NO --> Is your domain about TRANSFORMING things?
YES --> Look for Structure-Preserving Transformation patterns
NO --> Is your API surface small and well-understood?
YES --> Algebraic thinking adds overhead; use conventional design
NO --> Rules can still clarify, even without standard structures
Rules + Property-Based Testing: Rules ARE property tests. Algebraic constructors become PBT generators. Example: empty merge x = x becomes forAll(x -> assertEquals(empty.merge(x), x)).
Rules + Domain Modeling (see fp-domain-modeling): Domain wrappers with smart constructors are algebraic rules. State machine transitions are rules about valid sequences. Example: items(addItem(cart, item)) contains item -- directly a property test.
Rules + Usable Design (see fp-usable-design): Simple algebraic rules map to simple, searchable, nameable operations -- improving navigability and learnability. Example: decomposing processOrder into validate, price, confirm gives three nameable functions instead of one opaque one.
Decomposition + Feature Organization: When algebraic decomposition splits a monolithic operation into orthogonal pieces, organize by feature domain. Example: splitting configureWidget(size, color, border) into resize, recolor, restyle lets each live in its own feature module.
-- 1. Define operations and observations
CartOps = { empty, addItem, removeItem, itemCount, totalPrice }
-- 2. Write rules
rule: itemCount(empty) == 0
rule: itemCount(addItem(cart, item)) == itemCount(cart) + 1
rule: removeItem(addItem(empty, x), x) == empty
rule: totalPrice(addItem(cart, item)) == totalPrice(cart) + item.price
-- 3. Rules become property tests
forAll(item -> assertEquals(itemCount(addItem(empty, item)), 1))
forAll(cart, item -> assertEquals(totalPrice(addItem(cart, item)), totalPrice(cart) + item.price))
-- 4. Implement naive version, run tests, then optimize
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Review dimensions for acceptance test quality - happy path bias, GWT compliance, business language purity, coverage completeness, walking skeleton user-centricity, priority validation, observable behavior assertions, traceability coverage, and walking skeleton boundary proof
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Detailed 5-phase workflow for creating agents - from requirements analysis through validation and iterative refinement
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
5-layer testing approach for agent validation including adversarial testing, security validation, and prompt injection resistance
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Architectural style selection decision matrices, trade-off analysis, structural enforcement rules, and combination patterns. Load when choosing or evaluating architecture styles.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.