Skip to content

Commit 773a328

Browse files
committed
chore: address review feedback — add knip, type import, code style section
1 parent f84addf commit 773a328

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.cursor/rules/git-workflow.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ git add -A
1919
git commit -m "<type>: <description>"
2020

2121
# 3. Run checks before pushing (see post-change-checks rule)
22-
bun run typecheck && trunk check --fix && bun test
22+
bun run typecheck && trunk check --fix && bun test && bun run knip
2323

2424
# 4. Push and open PR
2525
git push origin <branch>

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ channels/telegram.ts (formatBriefingForTelegram)
100100
1. Create `src/sources/my-source.ts` with:
101101

102102
```typescript
103+
import type { DataSource } from "../types";
104+
103105
export const mySource: DataSource = {
104106
name: "My Source",
105107
priority: 5, // lower = higher in briefing
@@ -124,6 +126,18 @@ from `fetch`. The orchestrator flattens arrays automatically.
124126

125127
---
126128

129+
## Code Style
130+
131+
- **No classes** — factory functions returning interfaces (e.g. `createTelegramChannel`)
132+
- **Functional style**`const` arrow functions, pure where possible
133+
- **Named exports only** — no default exports
134+
- **File naming** — kebab-case (`etf-flows.ts`, not `etfFlows.ts`)
135+
- **No `any`** — strict TypeScript, `noUncheckedIndexedAccess` enabled
136+
- **Error handling** — sources never throw; orchestrator catches via `Promise.allSettled`
137+
- **Telegram formatting** — MarkdownV2 requires escaping special chars; use `escapeMarkdown()` in `telegram.ts`
138+
139+
---
140+
127141
## Local Dev
128142

129143
```bash
@@ -144,6 +158,7 @@ Always run these before committing (not just before pushing):
144158
bun run typecheck # Catch type errors
145159
trunk check --fix # Lint + format (catches unused imports etc.)
146160
bun test # Full test suite
161+
bun run knip # Dead code detection
147162
```
148163

149164
See `.cursor/rules/post-change-checks.mdc` for the full decision tree.

0 commit comments

Comments
 (0)