Skip to content

Commit f5d1fb1

Browse files
committed
chore: 같은 레이어 내부 DI 제한 지침 추가
1 parent 55ee883 commit f5d1fb1

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

.hermes/skills/devlog-architecture-harness/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Ask the user before editing when:
7979
- Data would gain concrete SDK or storage implementation details.
8080
- Data or Presentation would expand platform SDK usage beyond the existing narrow cancellation-classification or notification-badge patterns.
8181
- Infra would add any Domain dependency, source import, or SDK service contract coupling.
82+
- A same-layer dependency would be injected outside a SwiftUI `View` file in `Application/DevLogPresentation`.
8283
- The Presentation `StorePattern` flow or reducer responsibility would change.
8384
- A compile fix requires relaxing the intended architecture.
8485
- The change is outside the requested issue or PR scope.
@@ -120,6 +121,7 @@ After completion, report only:
120121

121122
- Do not infer project-specific architecture policy from generic Clean Architecture rules when DevLog already has a concrete pattern.
122123
- Do not move domain entities to Core just because multiple modules need them.
124+
- Do not inject same-layer dependencies except from SwiftUI `View` files in `Application/DevLogPresentation` into same-layer presentation objects for UI composition.
123125
- Do not hide architecture decisions inside build-fix wording.
124126
- Do not broaden a modularization task into unrelated Firestore, Messaging, or UI safety edits.
125127
- Do not mark work complete if the diff contains unrelated project-file or lockfile churn.

.hermes/skills/devlog-architecture-harness/references/devlog-architecture-flow.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ flowchart TD
130130
| `DevLogWidgetCore` | widget snapshot models, factories, app-group keys/defaults store, deep links, pure snapshot logic | Core | Adding Domain, Data, Infra, Persistence, Presentation, App, or DevLogWidget dependency |
131131
| `DevLogWidgetExtension` | WidgetKit rendering and timeline plumbing | WidgetCore | Calling app/domain services directly |
132132

133+
## Layer-internal dependency injection
134+
135+
Do not inject dependencies between types that belong to the same layer.
136+
137+
This rule covers initializer injection, stored-property injection, environment injection, and resolving same-layer types through `DIContainer`.
138+
139+
The only allowed exception is a SwiftUI `View` file in `Application/DevLogPresentation` receiving same-layer presentation objects such as a ViewModel, Coordinator, or Store for UI composition.
140+
141+
That exception does not apply to non-View files in Presentation, and does not apply to Core, Domain, Data, Infra, Persistence, Widget, App, WidgetCore, WidgetExtension, or Firebase functions.
142+
133143
## Presentation StorePattern flow
134144

135145
```mermaid
@@ -165,6 +175,7 @@ flowchart TD
165175
CoreDomain{"Core vs Domain ownership?"}
166176
Shared{"Moved only because shared?"}
167177
NewDependency{"New module dependency?"}
178+
SameLayerDI{"Same-layer dependency injection?"}
168179
ExternalSDK{"External SDK crosses layer?"}
169180
WidgetBoundary{"WidgetCore sees app/domain/data?"}
170181
BuildShortcut{"Build fix relaxes boundary?"}
@@ -178,7 +189,10 @@ flowchart TD
178189
Shared -->|Yes| Ask
179190
Shared -->|No| NewDependency
180191
NewDependency -->|Yes| Ask
181-
NewDependency -->|No| ExternalSDK
192+
NewDependency -->|No| SameLayerDI
193+
SameLayerDI -->|Presentation View file| ExternalSDK
194+
SameLayerDI -->|No| ExternalSDK
195+
SameLayerDI -->|Other| Ask
182196
ExternalSDK -->|Yes| Ask
183197
ExternalSDK -->|No| WidgetBoundary
184198
WidgetBoundary -->|Yes| Ask

.hermes/skills/devlog-architecture-harness/references/devlog-workflow-rules.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ This reference holds DevLog-specific working rules that should live with the pro
5757
- Keep project-file, lockfile, and code changes separated when the task scope requires clean review.
5858
- Do not broaden architecture work into unrelated Firestore, Messaging, UI, or safety edits.
5959

60+
## Layer-internal dependency injection
61+
62+
- Do not inject dependencies between types that belong to the same layer.
63+
- This includes initializer injection, stored-property injection, environment injection, and resolving same-layer types through `DIContainer`.
64+
- The only allowed exception is a SwiftUI `View` file in `Application/DevLogPresentation` receiving same-layer presentation objects such as a ViewModel, Coordinator, or Store for UI composition.
65+
- The exception does not apply to non-View files in Presentation, and does not apply to Core, Domain, Data, Infra, Persistence, Widget, App, WidgetCore, WidgetExtension, or Firebase functions.
66+
6067
## Data, Domain, and Infra boundary
6168

6269
- Do not move domain entities to Core only because multiple modules need them.

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ Treat this repository as a Tuist-generated, workspace-based modular iOS app. The
5353
- `Widget/DevLogWidgetExtension`: WidgetKit UI, widget providers, entries, timelines, and extension resources. It should consume WidgetCore outputs rather than app/domain services directly.
5454
- `Firebase/functions`: TypeScript Cloud Functions. Deploy updated functions one by one separately.
5555

56+
### Layer-internal dependency injection
57+
58+
- Do not inject dependencies between types that belong to the same layer.
59+
- This applies to initializer injection, stored-property injection, environment injection, and resolving same-layer types through `DIContainer`.
60+
- The only allowed exception is a SwiftUI `View` file in `Application/DevLogPresentation` receiving same-layer presentation objects such as a ViewModel, Coordinator, or Store for UI composition.
61+
- The exception does not apply to non-View files in Presentation, and does not apply to Core, Domain, Data, Infra, Persistence, Widget, App, WidgetCore, WidgetExtension, or Firebase functions.
62+
5663
### StorePattern flow
5764

5865
- Preserve the existing Presentation `StorePattern`.
@@ -72,6 +79,7 @@ Ask the user before editing when any of these are true:
7279
- Firebase, GoogleSignIn, AuthenticationServices, UserNotifications, LinkPresentation, Network, WidgetKit, or storage implementation details would move to another layer.
7380
- A repository protocol, service protocol, assembler, or DI ownership boundary would change.
7481
- WidgetCore would start depending on app/domain/data implementation concepts.
82+
- A same-layer dependency would be injected outside a SwiftUI `View` file in `Application/DevLogPresentation`.
7583
- The requested change suggests cleanup outside the current issue or PR scope.
7684

7785
### Safe mechanical changes

0 commit comments

Comments
 (0)