Skip to content

Commit e334f31

Browse files
yunbowclaude
andcommitted
style(docs): markdownlintエラーを一括修正
- MD025: セクション見出し(# N.)をH2(##)に降格(160箇所) - MD040: コードブロックに言語識別子を追加(typescript/bash/text/json等) - MD036: 哲学的引用をブロッククォートに、ラベルをH3見出しに変換 - MD024: 無効化(各フックの繰り返しサブセクションは意図的設計) - MD022/MD032等: 空行・リストスタイルを自動修正 Co-Authored-By: Claude <assistant> <noreply@anthropic.com>
1 parent 93ba1af commit e334f31

62 files changed

Lines changed: 888 additions & 511 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.markdownlint-cli2.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"config": {
33
"MD001": false,
44
"MD013": false,
5+
"MD024": false,
56
"MD033": false,
67
"MD041": false
78
}

01_philosophy/anti-patterns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Anti-Patterns
34

45
This defines repeatedly observed "do not do this" patterns.

01_philosophy/mental-models.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Mental Models
34

45
This defines the thinking patterns behind design decisions.
@@ -8,7 +9,7 @@ These are not concrete rules, but the "way of thinking" from which rules emerge.
89

910
## 1. Constraints Breed Creativity
1011

11-
**"Fewer choices lead to faster and better decisions."**
12+
> *"Fewer choices lead to faster and better decisions."*
1213
1314
"Faster" here means reduced decision fatigue and shorter code review cycles. When the framework constrains choices (e.g., "no Enums, use union literals"), developers spend zero time debating the approach and reviewers can focus on logic rather than style. This compounds across a team — eliminating 10 micro-decisions per PR across 50 PRs/week saves meaningful cognitive load.
1415

@@ -22,7 +23,7 @@ These are not concrete rules, but the "way of thinking" from which rules emerge.
2223

2324
## 2. Code is Read More Than Written
2425

25-
**"Write code that the future reader (including yourself 3 months later) can understand as quickly as possible."**
26+
> *"Write code that the future reader (including yourself 3 months later) can understand as quickly as possible."*
2627
2728
- Write code where intent is clear, rather than optimizing for brevity or shortness
2829
- Consistency in naming conventions directly impacts searchability and refactoring ease
@@ -34,9 +35,9 @@ These are not concrete rules, but the "way of thinking" from which rules emerge.
3435

3536
## 3. Validate at Boundaries
3637

37-
**"Trust the internals, but validate strictly at the points of contact with the outside."**
38+
> *"Trust the internals, but validate strictly at the points of contact with the outside."*
3839
39-
```
40+
```text
4041
External Input ──[Zod]──▶ Server Action ──[Types]──▶ Business Logic ──[ORM]──▶ DB
4142
↑ Guard here ↑ Protected by types here
4243
```
@@ -49,7 +50,7 @@ External Input ──[Zod]──▶ Server Action ──[Types]──▶ Busines
4950

5051
## 4. Design for Failure
5152

52-
**"Don't write code that assumes things work. Design with the assumption that things break."**
53+
> *"Don't write code that assumes things work. Design with the assumption that things break."*
5354
5455
- All external communication can fail (timeouts, rate limits, service outages)
5556
- Use types to prevent forgetting error handling (discriminated union `ActionResult<T>`)
@@ -62,9 +63,9 @@ External Input ──[Zod]──▶ Server Action ──[Types]──▶ Busines
6263

6364
## 5. Unidirectional Data Flow
6465

65-
**"If the data flow is consistent, most bugs disappear."**
66+
> *"If the data flow is consistent, most bugs disappear."*
6667
67-
```
68+
```text
6869
Server Actions (commands)
6970
7071
Hooks (state management / side-effect control)
@@ -86,7 +87,7 @@ Server Actions (next command)
8687

8788
## 6. Rule of Three (Timing of Abstraction)
8889

89-
**"Premature abstraction leads to wrong abstraction."**
90+
> *"Premature abstraction leads to wrong abstraction."*
9091
9192
| Occurrences | Action |
9293
|-------------|--------|
@@ -102,7 +103,7 @@ Server Actions (next command)
102103

103104
## 7. Make the Implicit Explicit
104105

105-
**"Implicit agreements become bugs the moment the team changes."**
106+
> *"Implicit agreements become bugs the moment the team changes."*
106107
107108
- Make side effects clear through naming (`fetchUser()` = has side effects, `calculatePrice()` = pure)
108109
- Always include a reason with `eslint-disable`

01_philosophy/principles.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Design Principles
34

45
This document defines the fundamental principles that underpin all projects.
@@ -10,23 +11,23 @@ It articulates the "why" behind our guidelines and serves as the ultimate refere
1011

1112
All design decisions are made in this order of priority.
1213

13-
```
14+
```text
1415
1. Correctness — Guarantee correct behavior through types and validation
1516
2. Observability — Ensure the running state can be observed and traced
1617
3. Pragmatism — Achieve goals with the minimum necessary complexity
1718
```
1819

1920
### 1. Correctness
2021

21-
**"Eliminate code that fails at runtime by catching it at compile time."**
22+
> *"Eliminate code that fails at runtime by catching it at compile time."*
2223
2324
- Security is built into the architecture, not bolted on after the fact
2425

2526
> The "cost" of types is negligible compared to the cost of runtime errors.
2627
2728
### 2. Observability
2829

29-
**"Understand what is happening in production without redeploying."**
30+
> *"Understand what is happening in production without redeploying."*
3031
3132
- Assign a Trace ID to every request and propagate it across layers
3233
- Automatically mask PII. Never expose secrets in logs
@@ -36,7 +37,7 @@ All design decisions are made in this order of priority.
3637
3738
### 3. Pragmatism
3839

39-
**"Don't build it until you need it. When you need it, build it the simplest way possible."**
40+
> *"Don't build it until you need it. When you need it, build it the simplest way possible."*
4041
4142
- Copy-paste is not evil. Don't abstract until duplication appears in 3 places. The number 3 is deliberate: with 1 occurrence you have no pattern; with 2 you see similarity but may be misled by coincidence; with 3 you have enough evidence to extract a correct, stable abstraction. Abstracting at 2 often produces the *wrong* abstraction because you lack sufficient examples to identify the true commonality
4243
- Convention over Configuration
@@ -65,7 +66,7 @@ All design decisions are made in this order of priority.
6566

6667
## Security Philosophy: Zero Trust
6768

68-
**"Trust no input. Every user is a potential attacker."**
69+
> *"Trust no input. Every user is a potential attacker."*
6970
7071
1. **API Layer**: Zod validation, CORS, rate limiting
7172
2. **Auth Layer**: Session validation, IDOR checks (always verify ownership for resource access)
@@ -78,7 +79,7 @@ Apply the principle of least privilege to everything (DB users, API scopes, feat
7879

7980
## Approach to Errors
8081

81-
**"Don't try to prevent every failure — detect, contain, and communicate them."**
82+
> *"Don't try to prevent every failure — detect, contain, and communicate them."*
8283
8384
- Errors fall into 3 categories: System (unexpected), Application (expected), User (input mistakes)
8485
- Do not leak internal error details to the UI (return sanitized messages)
@@ -89,7 +90,7 @@ Apply the principle of least privilege to everything (DB users, API scopes, feat
8990

9091
## UI/Design Philosophy
9192

92-
**"Constraints create consistency, and consistency creates speed."**
93+
> *"Constraints create consistency, and consistency creates speed."*
9394
9495
- Constraint-based design with Tailwind CSS (spacing scale, color palette)
9596
- CSS Variables serve as the Single Source of Truth

02_decision-criteria/abstraction.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Decision Criteria for Generalization and Abstraction
34

45
Criteria for deciding whether to "extract" or "leave as-is" when you find code duplication.
@@ -7,7 +8,7 @@ Criteria for deciding whether to "extract" or "leave as-is" when you find code d
78

89
## Fundamental Principle
910

10-
**"Premature abstraction leads to wrong abstraction."**
11+
> *"Premature abstraction leads to wrong abstraction."*
1112
1213
Abstraction increases the cost of understanding. It only has value when "enough reuse" exists — meaning 3+ call sites with genuinely identical logic, not just superficially similar code. Two similar-looking functions that evolve independently don't justify abstraction.
1314

02_decision-criteria/architecture.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Architecture Decision Criteria
34

45
Defines the selection criteria for rendering strategies, data fetching, component placement, and API design.
@@ -126,7 +127,7 @@ Defines the selection criteria for rendering strategies, data fetching, componen
126127

127128
### Test Target Priority
128129

129-
```
130+
```text
130131
1. Authentication/authorization (sessions, IDOR) ← Highest: a flaw here means full data breach
131132
2. Payment processing ← Financial loss is immediate and concrete
132133
3. DB operations + API Routes ← Data corruption is hard to reverse

02_decision-criteria/error-strategy.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Error Strategy Decision Criteria
34

45
Defines error handling policies, retry decisions, and how to communicate errors to users.
@@ -7,7 +8,7 @@ Defines error handling policies, retry decisions, and how to communicate errors
78

89
## Fundamental Principle
910

10-
**"Don't try to prevent all failures — detect, contain, and communicate them."**
11+
> *"Don't try to prevent all failures — detect, contain, and communicate them."*
1112
1213
---
1314

@@ -23,7 +24,7 @@ Defines error handling policies, retry decisions, and how to communicate errors
2324

2425
The boundary between System and Application errors: "Could the developer have predicted it?" means — is this error a known, enumerable case in the domain logic? If yes (e.g., "user not found", "insufficient balance"), it's an Application error that should be handled with a specific code path. If no (e.g., database connection dropped, OOM), it's a System error that gets generic handling.
2526

26-
```
27+
```text
2728
Error Occurs
2829
2930
├─ Is this a known, enumerable domain case?
@@ -51,7 +52,7 @@ Error Occurs
5152

5253
### Retry Implementation Criteria
5354

54-
```
55+
```text
5556
Should we retry?
5657
5758
├─ Is the status code 5xx?
@@ -133,7 +134,7 @@ type ActionResult<T> =
133134
134135
### Server Action Checklist
135136
136-
```
137+
```typescript
137138
Use withAction() wrapper
138139
Authentication check with requireAuth()
139140
Resource ownership check with requireOwnership() (IDOR prevention)

02_decision-criteria/security-vs-ux.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Balancing Security and UX
34

45
Criteria for judging the appropriate balance by considering the impact of security measures on user experience.
@@ -7,7 +8,7 @@ Criteria for judging the appropriate balance by considering the impact of securi
78

89
## Fundamental Principle
910

10-
**"Security is enabled by default. When relaxing it for UX reasons, make the risks explicit before deciding."**
11+
> *"Security is enabled by default. When relaxing it for UX reasons, make the risks explicit before deciding."*
1112
1213
---
1314

@@ -52,7 +53,7 @@ Criteria for judging the appropriate balance by considering the impact of securi
5253

5354
### UX When Rate Limit Is Exceeded
5455

55-
```
56+
```text
5657
Limit Exceeded
5758
5859
├─ Return Retry-After header
@@ -74,7 +75,7 @@ Limit Exceeded
7475

7576
### Suspicious Login Detection Flow
7677

77-
```
78+
```text
7879
Login Attempt
7980
8081
├─ First-time login? → No alert (accept)
@@ -131,7 +132,7 @@ Login Attempt
131132

132133
## 6. Decision Tree When in Doubt
133134

134-
```
135+
```text
135136
Want to relax a security measure
136137
137138
├─ Can the user not complete their operation without relaxation?

02_decision-criteria/technology-selection.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$NOTE
2+
23
# Decision Criteria for Technology Selection
34

45
A decision framework for introducing new technologies, libraries, and tools.
@@ -22,6 +23,7 @@ Weight definitions: **High** = can veto adoption on its own. **Medium** = weigh
2223
### De Facto Standard Identification
2324

2425
A library qualifies as "de facto standard" when it meets 2+ of:
26+
2527
- Referenced in the framework's official documentation (e.g., Next.js docs mention it)
2628
- 10x+ GitHub stars compared to the next alternative
2729
- Used by the framework's own starter templates or examples

0 commit comments

Comments
 (0)