sisyo 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -16
- package/README.md +177 -166
- package/bin/known-hashes.json +8 -1
- package/bin/sisyo.js +285 -285
- package/package.json +30 -30
- package/templates/.claude/rules/agents-and-tests.md +32 -24
- package/templates/.claude/rules/docs.md +39 -19
- package/templates/.claude/skills/fastapi-best-practices/ASYNC-PATTERNS.md +121 -121
- package/templates/.claude/skills/fastapi-best-practices/DATABASE.md +153 -153
- package/templates/.claude/skills/fastapi-best-practices/DEPENDENCIES.md +140 -140
- package/templates/.claude/skills/fastapi-best-practices/PROJECT-STRUCTURE.md +90 -90
- package/templates/.claude/skills/fastapi-best-practices/PYDANTIC-GUIDE.md +155 -155
- package/templates/.claude/skills/fastapi-best-practices/SKILL.md +123 -123
- package/templates/.claude/skills/g6-style/SKILL.md +125 -125
- package/templates/.claude/skills/g6-style/references/checks.md +58 -58
- package/templates/.claude/skills/g6-style/references/imagery.md +103 -103
- package/templates/.claude/skills/g6-style/references/motion.md +121 -121
- package/templates/.claude/skills/g6-style/references/sections.md +263 -263
- package/templates/.claude/skills/g6-style/references/tokens.md +197 -197
- package/templates/.claude/skills/hindsight/SKILL.md +175 -175
- package/templates/.claude/skills/hoang-auth/SKILL.md +188 -0
- package/templates/.claude/skills/html-docs/SKILL.md +207 -207
- package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -153
- package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -47
- package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -46
- package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -17
- package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -6
- package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -4
- package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -6
- package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -22
- package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -10
- package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -5
- package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -20
- package/templates/.claude/skills/i18n-multilang/references/format.md +100 -100
- package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -97
- package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -256
- package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -161
- package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -142
- package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -107
- package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -143
- package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -271
- package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -1041
- package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -1013
- package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -478
- package/templates/.claude/skills/neon-game-ui-ux-skill/COMPONENTS.md +490 -490
- package/templates/.claude/skills/neon-game-ui-ux-skill/GAMIFICATION.md +246 -246
- package/templates/.claude/skills/neon-game-ui-ux-skill/ICONS.md +249 -249
- package/templates/.claude/skills/neon-game-ui-ux-skill/LAYOUT-NAV.md +362 -362
- package/templates/.claude/skills/neon-game-ui-ux-skill/MOTION-A11Y.md +168 -168
- package/templates/.claude/skills/neon-game-ui-ux-skill/SKILL.md +137 -137
- package/templates/.claude/skills/neon-game-ui-ux-skill/TOKENS.md +323 -323
- package/templates/.claude/skills/react-page-oriented/SKILL.md +407 -407
- package/templates/.claude/skills/react-page-oriented/triggers.md +12 -12
- package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
- package/templates/.claude/skills/typesafe-jev/SKILL.md +148 -148
- package/templates/.claude/skills/vibe-docs/SKILL.md +139 -242
- package/templates/SISYO.md +39 -37
- package/templates/docs/99_progress/features.md +7 -7
- package/templates/docs/99_progress/handoff.md +19 -19
- package/templates/docs/99_progress/todo.md +15 -15
- package/templates/docs/MAP.md +26 -26
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
# Agents, Tests and Deploys Rule
|
|
2
|
-
|
|
3
|
-
The owner's rules (2026-11-16) for every project. A project's `SISYO.md` may be stricter, never looser.
|
|
4
|
-
|
|
5
|
-
## Models
|
|
6
|
-
- Default: Opus (Opus 5.5 as of 2026-11) at effort `xhigh`, for the main session and for every agent it starts (`model: "opus"`, `effort: "xhigh"`).
|
|
7
|
-
- A model above Opus (Fable) only when the owner names it for a task, typically one about money or something important. Never switch on your own judgement.
|
|
8
|
-
- Small or single-area work is done in the main session. Agents are for work that splits into independent parts running in parallel.
|
|
9
|
-
|
|
10
|
-
## Writing code
|
|
11
|
-
1. Before writing code, read the related parts: the code that calls it and that it calls, the existing tests, the project's skills and docs for the area.
|
|
12
|
-
2. Write the test cases first, then the code.
|
|
13
|
-
3. Working alone: run the tests related to the change once, at the end (the tests of the packages changed, the browser or e2e checks of the pages changed). Not the whole suite.
|
|
14
|
-
4. Agents in parallel: each writes its tests and runs none. When all are done, one pass runs the tests of the combined work once, on the zone the batch touched (lint, typecheck, the touched packages' tests, the changed pages' checks), and fixes what fails.
|
|
15
|
-
5. Nobody runs the project's whole test gate locally "to be sure".
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
|
|
1
|
+
# Agents, Tests and Deploys Rule
|
|
2
|
+
|
|
3
|
+
The owner's rules (2026-11-16) for every project. A project's `SISYO.md` may be stricter, never looser.
|
|
4
|
+
|
|
5
|
+
## Models
|
|
6
|
+
- Default: Opus (Opus 5.5 as of 2026-11) at effort `xhigh`, for the main session and for every agent it starts (`model: "opus"`, `effort: "xhigh"`).
|
|
7
|
+
- A model above Opus (Fable) only when the owner names it for a task, typically one about money or something important. Never switch on your own judgement.
|
|
8
|
+
- Small or single-area work is done in the main session. Agents are for work that splits into independent parts running in parallel.
|
|
9
|
+
|
|
10
|
+
## Writing code
|
|
11
|
+
1. Before writing code, read the related parts: the code that calls it and that it calls, the existing tests, the project's skills and docs for the area.
|
|
12
|
+
2. Write the test cases first, then the code.
|
|
13
|
+
3. Working alone: run the tests related to the change once, at the end (the tests of the packages changed, the browser or e2e checks of the pages changed). Not the whole suite.
|
|
14
|
+
4. Agents in parallel: each writes its tests and runs none. When all are done, one pass runs the tests of the combined work once, on the zone the batch touched (lint, typecheck, the touched packages' tests, the changed pages' checks), and fixes what fails.
|
|
15
|
+
5. Nobody runs the project's whole test gate locally "to be sure".
|
|
16
|
+
|
|
17
|
+
## Sessions and agents
|
|
18
|
+
- Do the work in the main session and manage it yourself. Start an agent only for a large part that is independent and truly runs in parallel, never for a short step (a lookup, a build or deploy with the project's existing scripts) that the main session would then sit waiting on.
|
|
19
|
+
- At most 4 agents run at the same time in one session. More parallel work waits for a free place or goes to another session.
|
|
20
|
+
- Keep each batch small: if its changes would make the test pass select most of the project's test groups, split the batch, so each pass runs only the groups that batch touched.
|
|
21
|
+
- A session is not the project's memory; the docs and git are. When a session has run long (about a day of work, a transcript over about 5 MB, tool calls that take minutes to answer, or a frozen tab), write the handoff, end the session, and continue in a new one that starts from the handoff.
|
|
22
|
+
|
|
23
|
+
## Deploys
|
|
24
|
+
- A deploy to dev or staging does not run the whole test gate: build, deploy, smoke check. A broken build still stops it.
|
|
25
|
+
- A deploy that reaches production runs the whole gate on the exact commit released, and deploys nothing if it fails. Where a push to `main` deploys production, that push is a production deploy.
|
|
26
|
+
- The PR's CI run, where a project has one, is the one whole run for a change before production.
|
|
27
|
+
- If a project's CI does not work this way yet, propose the change (a workflow change usually goes through the project's review rule); do not change it on your own.
|
|
28
|
+
|
|
29
|
+
## Why
|
|
30
|
+
Batches took hours: the whole gate ran in each agent, again in each integration pass, on the PR, on the push to `main` and in the dev deploy, the last ones at once on one shared runner host.
|
|
31
|
+
|
|
32
|
+
A long session slowed to a crawl (2026-11-16): one session carried its lead and up to ten agents for a day. Simple file reads and edits took one to three minutes each, while other sessions on the same PC took seconds. The lead waited 2 h 40 min on an agent writing a deploy runbook, and one batch of 811 changed files made the test pass select every group (3 h 30 min).
|
|
@@ -1,19 +1,39 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
1
|
+
# Docs and Code Rule
|
|
2
|
+
|
|
3
|
+
The owner's rules (2026-11-30) for every project: two sets of docs for two kinds of readers, and code that explains
|
|
4
|
+
itself. A project's `SISYO.md` may be stricter, never looser.
|
|
5
|
+
|
|
6
|
+
## Agent docs: `docs/` in the repo
|
|
7
|
+
Readers: agents. Goal: find, load and fix one fact quickly, with few tokens.
|
|
8
|
+
- English, as short as possible: facts, tables, lists, paths. No prose, no history, no repeating what the code says.
|
|
9
|
+
- 3-level routing: `docs/MAP.md` → `<folder>/_summary.md` → detail file. One topic per file, under about 100 lines.
|
|
10
|
+
- Refer to code by path (`src/auth/service.ts`) and do not copy it. Write what the code cannot say: why, contracts,
|
|
11
|
+
constraints, gotchas, commands.
|
|
12
|
+
- Describe what is true now. Replace outdated lines; do not append. Git keeps the history.
|
|
13
|
+
- After a change: update the detail file, then `_summary.md`, then the MAP.md line (skill `vibe-docs`).
|
|
14
|
+
- Session start: read MAP.md, then `99_progress/handoff.md`. Before the session ends, write the handoff (≤ 30 lines).
|
|
15
|
+
- When a feature is done, add one line to `99_progress/features.md`.
|
|
16
|
+
|
|
17
|
+
## Human docs: the project's hub
|
|
18
|
+
Readers: the owner and other people. Goal: understand the system in a few minutes.
|
|
19
|
+
- Location: the project's Kicho hub when it has one (`.kicho-devflow.json`, skill `kicho-devflow`), written in the
|
|
20
|
+
owner's language.
|
|
21
|
+
- Short and plain. Cover the architecture, the main techniques and why they were chosen, and the key numbers
|
|
22
|
+
(performance, tests, data sizes, costs), plus one summary per sprint.
|
|
23
|
+
- Leave out code-level detail, long path lists and agent task progress.
|
|
24
|
+
- Write for a person. Never paste agent docs there, and never put human prose into `docs/`. When the sources of these
|
|
25
|
+
pages are kept in the repo, keep them outside `docs/` (for example `kicho-pages/`).
|
|
26
|
+
|
|
27
|
+
## Code reads like prose
|
|
28
|
+
- Names say what a thing is or does:
|
|
29
|
+
- functions are verb phrases (`sendReminderEmail`);
|
|
30
|
+
- booleans are questions (`isExpired`, `hasPaidPlan`);
|
|
31
|
+
- values are nouns, with units where needed (`timeoutMs`, `priceYen`).
|
|
32
|
+
Use only abbreviations everyone knows.
|
|
33
|
+
- Keep functions small, with one job each. If a block of code needs a heading, extract it into a function named
|
|
34
|
+
after that heading.
|
|
35
|
+
- No comments. Rename or extract code instead. Write a comment only for what the code cannot say:
|
|
36
|
+
- why a choice that looks wrong is right (a workaround and its bug link, a spec or law, a security reason);
|
|
37
|
+
- where a magic value comes from;
|
|
38
|
+
- doc comments that tooling publishes (the API of a public package).
|
|
39
|
+
- In code you change, delete the comments that the names now say. Never sweep comments out of the whole repo.
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
# Async Patterns
|
|
2
|
-
|
|
3
|
-
## Route Types Comparison
|
|
4
|
-
|
|
5
|
-
| Route Type | Blocking Code | Event Loop | Use Case |
|
|
6
|
-
|------------|--------------|------------|----------|
|
|
7
|
-
| `async def` + `await` | Non-blocking | Free | Async I/O (httpx, asyncpg) |
|
|
8
|
-
| `def` (sync) | Runs in threadpool | Free | Sync libraries, simple ops |
|
|
9
|
-
| `async def` + blocking | BLOCKS EVERYTHING | Blocked | NEVER DO THIS |
|
|
10
|
-
|
|
11
|
-
## I/O Operations
|
|
12
|
-
|
|
13
|
-
### Async Database Calls
|
|
14
|
-
|
|
15
|
-
```python
|
|
16
|
-
# GOOD - async database
|
|
17
|
-
@router.get("/users/{user_id}")
|
|
18
|
-
async def get_user(user_id: int):
|
|
19
|
-
user = await db.fetch_one("SELECT * FROM users WHERE id = $1", user_id)
|
|
20
|
-
return user
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Sync Libraries in Async Routes
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
from fastapi.concurrency import run_in_threadpool
|
|
27
|
-
|
|
28
|
-
@router.get("/sync-lib")
|
|
29
|
-
async def use_sync_library():
|
|
30
|
-
# Run sync code in threadpool
|
|
31
|
-
result = await run_in_threadpool(sync_client.fetch_data)
|
|
32
|
-
return result
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### HTTP Calls
|
|
36
|
-
|
|
37
|
-
```python
|
|
38
|
-
import httpx
|
|
39
|
-
|
|
40
|
-
# GOOD - async HTTP client
|
|
41
|
-
@router.get("/external")
|
|
42
|
-
async def call_external():
|
|
43
|
-
async with httpx.AsyncClient() as client:
|
|
44
|
-
response = await client.get("https://api.example.com/data")
|
|
45
|
-
return response.json()
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## CPU-Intensive Tasks
|
|
49
|
-
|
|
50
|
-
CPU-bound work blocks regardless of async/sync. Offload to workers:
|
|
51
|
-
|
|
52
|
-
```python
|
|
53
|
-
from fastapi import BackgroundTasks
|
|
54
|
-
|
|
55
|
-
@router.post("/process")
|
|
56
|
-
async def process_data(background_tasks: BackgroundTasks):
|
|
57
|
-
# Queue for background processing
|
|
58
|
-
background_tasks.add_task(heavy_computation, data)
|
|
59
|
-
return {"status": "processing"}
|
|
60
|
-
|
|
61
|
-
# For heavy CPU work, use Celery or multiprocessing
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Common Mistakes
|
|
65
|
-
|
|
66
|
-
### Blocking in Async Route
|
|
67
|
-
|
|
68
|
-
```python
|
|
69
|
-
# BAD - blocks entire server
|
|
70
|
-
@router.get("/terrible")
|
|
71
|
-
async def terrible():
|
|
72
|
-
time.sleep(10) # NEVER do this in async route
|
|
73
|
-
return {"done": True}
|
|
74
|
-
|
|
75
|
-
# GOOD - use sync route for blocking code
|
|
76
|
-
@router.get("/acceptable")
|
|
77
|
-
def acceptable():
|
|
78
|
-
time.sleep(10) # runs in threadpool
|
|
79
|
-
return {"done": True}
|
|
80
|
-
|
|
81
|
-
# BEST - use async sleep
|
|
82
|
-
@router.get("/perfect")
|
|
83
|
-
async def perfect():
|
|
84
|
-
await asyncio.sleep(10)
|
|
85
|
-
return {"done": True}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Sync ORM in Async Route
|
|
89
|
-
|
|
90
|
-
```python
|
|
91
|
-
# BAD
|
|
92
|
-
@router.get("/users")
|
|
93
|
-
async def get_users():
|
|
94
|
-
return db.query(User).all() # sync ORM blocks event loop
|
|
95
|
-
|
|
96
|
-
# GOOD - use async ORM or threadpool
|
|
97
|
-
@router.get("/users")
|
|
98
|
-
async def get_users():
|
|
99
|
-
return await run_in_threadpool(lambda: db.query(User).all())
|
|
100
|
-
|
|
101
|
-
# BEST - use async ORM (SQLAlchemy 2.0 async)
|
|
102
|
-
@router.get("/users")
|
|
103
|
-
async def get_users():
|
|
104
|
-
result = await session.execute(select(User))
|
|
105
|
-
return result.scalars().all()
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Dependencies
|
|
109
|
-
|
|
110
|
-
Prefer async dependencies when possible:
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
# GOOD - async dependency
|
|
114
|
-
async def get_current_user(token: str = Depends(oauth2_scheme)):
|
|
115
|
-
user = await users_service.get_by_token(token)
|
|
116
|
-
return user
|
|
117
|
-
|
|
118
|
-
# OK but less efficient - sync dependency runs in threadpool
|
|
119
|
-
def get_settings():
|
|
120
|
-
return Settings()
|
|
121
|
-
```
|
|
1
|
+
# Async Patterns
|
|
2
|
+
|
|
3
|
+
## Route Types Comparison
|
|
4
|
+
|
|
5
|
+
| Route Type | Blocking Code | Event Loop | Use Case |
|
|
6
|
+
|------------|--------------|------------|----------|
|
|
7
|
+
| `async def` + `await` | Non-blocking | Free | Async I/O (httpx, asyncpg) |
|
|
8
|
+
| `def` (sync) | Runs in threadpool | Free | Sync libraries, simple ops |
|
|
9
|
+
| `async def` + blocking | BLOCKS EVERYTHING | Blocked | NEVER DO THIS |
|
|
10
|
+
|
|
11
|
+
## I/O Operations
|
|
12
|
+
|
|
13
|
+
### Async Database Calls
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# GOOD - async database
|
|
17
|
+
@router.get("/users/{user_id}")
|
|
18
|
+
async def get_user(user_id: int):
|
|
19
|
+
user = await db.fetch_one("SELECT * FROM users WHERE id = $1", user_id)
|
|
20
|
+
return user
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Sync Libraries in Async Routes
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from fastapi.concurrency import run_in_threadpool
|
|
27
|
+
|
|
28
|
+
@router.get("/sync-lib")
|
|
29
|
+
async def use_sync_library():
|
|
30
|
+
# Run sync code in threadpool
|
|
31
|
+
result = await run_in_threadpool(sync_client.fetch_data)
|
|
32
|
+
return result
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### HTTP Calls
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import httpx
|
|
39
|
+
|
|
40
|
+
# GOOD - async HTTP client
|
|
41
|
+
@router.get("/external")
|
|
42
|
+
async def call_external():
|
|
43
|
+
async with httpx.AsyncClient() as client:
|
|
44
|
+
response = await client.get("https://api.example.com/data")
|
|
45
|
+
return response.json()
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## CPU-Intensive Tasks
|
|
49
|
+
|
|
50
|
+
CPU-bound work blocks regardless of async/sync. Offload to workers:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from fastapi import BackgroundTasks
|
|
54
|
+
|
|
55
|
+
@router.post("/process")
|
|
56
|
+
async def process_data(background_tasks: BackgroundTasks):
|
|
57
|
+
# Queue for background processing
|
|
58
|
+
background_tasks.add_task(heavy_computation, data)
|
|
59
|
+
return {"status": "processing"}
|
|
60
|
+
|
|
61
|
+
# For heavy CPU work, use Celery or multiprocessing
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Common Mistakes
|
|
65
|
+
|
|
66
|
+
### Blocking in Async Route
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
# BAD - blocks entire server
|
|
70
|
+
@router.get("/terrible")
|
|
71
|
+
async def terrible():
|
|
72
|
+
time.sleep(10) # NEVER do this in async route
|
|
73
|
+
return {"done": True}
|
|
74
|
+
|
|
75
|
+
# GOOD - use sync route for blocking code
|
|
76
|
+
@router.get("/acceptable")
|
|
77
|
+
def acceptable():
|
|
78
|
+
time.sleep(10) # runs in threadpool
|
|
79
|
+
return {"done": True}
|
|
80
|
+
|
|
81
|
+
# BEST - use async sleep
|
|
82
|
+
@router.get("/perfect")
|
|
83
|
+
async def perfect():
|
|
84
|
+
await asyncio.sleep(10)
|
|
85
|
+
return {"done": True}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Sync ORM in Async Route
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
# BAD
|
|
92
|
+
@router.get("/users")
|
|
93
|
+
async def get_users():
|
|
94
|
+
return db.query(User).all() # sync ORM blocks event loop
|
|
95
|
+
|
|
96
|
+
# GOOD - use async ORM or threadpool
|
|
97
|
+
@router.get("/users")
|
|
98
|
+
async def get_users():
|
|
99
|
+
return await run_in_threadpool(lambda: db.query(User).all())
|
|
100
|
+
|
|
101
|
+
# BEST - use async ORM (SQLAlchemy 2.0 async)
|
|
102
|
+
@router.get("/users")
|
|
103
|
+
async def get_users():
|
|
104
|
+
result = await session.execute(select(User))
|
|
105
|
+
return result.scalars().all()
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Dependencies
|
|
109
|
+
|
|
110
|
+
Prefer async dependencies when possible:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
# GOOD - async dependency
|
|
114
|
+
async def get_current_user(token: str = Depends(oauth2_scheme)):
|
|
115
|
+
user = await users_service.get_by_token(token)
|
|
116
|
+
return user
|
|
117
|
+
|
|
118
|
+
# OK but less efficient - sync dependency runs in threadpool
|
|
119
|
+
def get_settings():
|
|
120
|
+
return Settings()
|
|
121
|
+
```
|