Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7170ea4
feat(auth): implement authentication modal with sign in, sign up, and…
tyler-dane Feb 21, 2026
5c1ede2
refactor(auth): update authentication modal components and improve te…
tyler-dane Feb 22, 2026
960661e
refactor(auth): update AccountIcon component and improve tooltip func…
tyler-dane Feb 22, 2026
ddd608c
refactor(auth): enhance AuthModal tests and improve semantic accessib…
tyler-dane Feb 22, 2026
dd4beac
feat(oauth): implement custom Google button with SVG logo and enhance…
tyler-dane Feb 22, 2026
e154fdb
refactor(auth): reorganize Google Sign In button placement in AuthModal
tyler-dane Feb 22, 2026
832d19b
feat(auth): update AuthModal for dynamic greetings and improved user …
tyler-dane Feb 22, 2026
e661f66
feat(auth): enhance AuthModal with dynamic greeting updates and impro…
tyler-dane Feb 22, 2026
868ae16
refactor(tests): enhance TooltipWrapper mock for keyboard accessibili…
tyler-dane Feb 22, 2026
85938ae
refactor(calendar): update z-index values in styled components for co…
tyler-dane Feb 26, 2026
01c30d6
refactor(auth): simplify OverlayPanel component and remove unused bac…
tyler-dane Feb 26, 2026
1097210
feat(auth): enhance AuthInput component with optional label and aria-…
tyler-dane Feb 26, 2026
80e663f
feat(Shortcuts): enhance ShortcutTip component with hover interaction…
tyler-dane Feb 26, 2026
e9dd94d
refactor(auth): simplify AuthModal by removing AuthTabs and enhancing…
tyler-dane Feb 26, 2026
bc43648
refactor(auth): improve error handling in Auth forms for better user …
tyler-dane Feb 26, 2026
91e734c
feat(auth): implement useZodForm hook for streamlined form validation…
tyler-dane Feb 26, 2026
29b7234
refactor(auth): update button labels and enhance AuthModal structure
tyler-dane Feb 26, 2026
a4f6fa0
refactor(auth): enhance AuthButton styles for improved user interaction
tyler-dane Feb 26, 2026
ad6679a
chore(dependencies): remove react-google-button from package.json and…
tyler-dane Feb 26, 2026
c09b555
refactor(auth): rename schemas and update AuthModal for improved clarity
tyler-dane Feb 26, 2026
46516b2
chore: remove console log from auth modal
tyler-dane Feb 26, 2026
8cb91e7
feat(tailwind): enhance zIndex configuration for improved layering of…
tyler-dane Feb 26, 2026
c053e50
chore: remove StorageInfoModal component
tyler-dane Feb 26, 2026
e4f33e9
Merge branch 'main' into refactor/zindex-tailwind
tyler-dane Feb 26, 2026
20dd155
refactor(auth): simplify AuthButton styles by removing redundant font…
tyler-dane Feb 26, 2026
048aa34
refactor(agenda): update NowLine component to use Tailwind z-index cl…
tyler-dane Feb 26, 2026
44f0128
fix(Header): ensure consistent rendering of SelectView component
tyler-dane Feb 26, 2026
cf53140
refactor(ContextMenu): update z-index to use constant from web.constants
tyler-dane Feb 26, 2026
c04572b
refactor(z-index): standardize z-index usage across components
tyler-dane Feb 26, 2026
2c09ee3
chore: remove StorageInfoModal component
tyler-dane Feb 26, 2026
52d4703
feat(auth): add useAuthCmdItems hook for authentication command palette
tyler-dane Feb 26, 2026
073149d
feat(simplify-code): add skill and heuristics for code simplification
tyler-dane Feb 26, 2026
98a8d77
feat(event-form): enhance fillTitleAndSaveWithKeyboard function to wa…
tyler-dane Feb 26, 2026
7ea23c6
feat(NowLine): enhance z-index management and add test for z-index be…
tyler-dane Feb 27, 2026
403c98d
feat(auth): add unit tests for useAuthCmdItems hook
tyler-dane Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
299 changes: 299 additions & 0 deletions .claude/skills/simplify-code/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
---
name: simplify-code
description: Simplifies code by minimizing complexity, eliminating duplication, and prioritizing legibility for contributors. Use when implementing features, fixing bugs, refactoring, or when the user asks to simplify, clean up, make DRY, reduce complexity, or improve maintainability.
---

# Simplify Code

Favor minimal, legible implementations. Fewer lines and clearer structure make code easier to understand and maintain.

## Before Making Changes

1. **Necessity**: Does this change only address what's required?
2. **Existing abstractions**: Are there shared utilities, hooks, or helpers in `common/`, `util/`, etc.?
3. **Duplication**: Where else does similar logic exist?
4. **Root cause**: What is actually driving the complexity?

## Core Principles

### Minimal Surface Area

- Prefer the smallest change that achieves the goal
- Add abstractions only when reuse is real and obvious
- Avoid "future-proofing" that adds complexity now

### DRY

- **Literal duplication**: Same logic in 2+ places → extract shared function
- **Similar structure**: Parameterize or compose instead of copying
- **Config-driven branches**: Use maps/objects instead of long switch/if chains
- **Do not over-DRY**: Don't unify logic that merely _looks_ similar; shared abstractions must cleanly handle all real cases

### Legibility

- One clear responsibility per function/component
- Guard clauses and early returns over deep nesting
- Functions under ~20 lines when feasible; flag functions over ~30 lines
- Each line readable without jumping around

### Durability

- Prefer built-ins and stable, minimal dependencies
- Abstractions with narrow, stable contracts
- Avoid hidden state and surprising side effects

## When to Extract vs. Inline

**Extract when:**

- Logic is used in 2+ places with shared intent
- A block has a clear, reusable name
- The abstraction has a narrow, stable API

**Do not extract when:**

- Used once and clear inline
- The abstraction would need many params or special cases
- The abstraction name would be vague (e.g. `doStuff`)

## Complexity Thresholds

| Metric | Prefer | Flag | Action |
| -------------------- | ---------- | ---------- | ---------------------------- |
| Function length | < 20 lines | > 30 lines | Split or extract |
| Nesting depth | ≤ 2 levels | > 3 levels | Guard clauses, early returns |
| Parameters | ≤ 3 | > 4 | Options object or context |
| Conditional branches | ≤ 3 | > 4 | Map/object or polymorphism |
| Similar blocks | 0 | 2+ | Extract and parameterize |

## DRY Detection Rules

### Extract when you see

- Same expression or block in 2+ places
- Copy-paste with variable name changes only
- Parallel structures (e.g. handlers for A and B that mirror each other)
- Repeated validation, formatting, or mapping logic

### Parameterize when

- Logic is identical except for a value or small behavior
- A good abstraction name exists (e.g. `formatDate`, `validateEmail`)
- The parameter surface is small (< 4 params typically)

### Do not extract when

- Used once and inline logic is clear
- Abstraction would need many optional params or flags
- Name would be generic (`handleThing`, `processData`)
- Only superficial similarity — real behavior diverges
- Combining would obscure intent or create hidden coupling

## Nesting Reduction

**Preferred**: Guard clauses and early returns

```
if (!user?.isActive) return;
if (!user.hasPermission) return;
doThing();
```

**Avoid**: Deep nesting

```
if (user) {
if (user.isActive) {
if (user.hasPermission) {
doThing();
}
}
}
```

## Config Over Conditionals

**When**: Multiple similar branches based on a key or type

**Instead of**: Long switch or if-else chain

```
switch (type) {
case 'a': return handleA();
case 'b': return handleB();
case 'c': return handleC();
}
```

**Prefer**: Map or object lookup (when handlers are simple)

```
const handlers = { a: handleA, b: handleB, c: handleC };
return handlers[type]?.();
```

## Project-Aware Simplification

Before adding new abstractions:

1. Search for existing utilities in `common/`, `util/`, `hooks/`
2. Check sibling components or similar views for shared patterns
3. Follow established conventions (e.g. naming, file layout)
4. Prefer composition over new inheritance

## Durability Checklist

- [ ] Abstraction has a clear, narrow contract
- [ ] No hidden globals or mutable shared state
- [ ] Types/interfaces document inputs and outputs
- [ ] Dependencies are minimal and stable
- [ ] Change is incremental; no big-bang refactors

## Anti-Patterns to Avoid

- Abstracting "for the future" without current reuse
- Clever one-liners that obscure intent
- Premature micro-optimization over clarity
- Collapsing unrelated responsibilities into one abstraction
- Overly deep inheritance or generic hierarchies

## Output Format

When proposing simplifications:

1. One-sentence summary of the change
2. Minimal diff or before/after
3. Principle(s) applied (DRY, legibility, etc.)
4. Any tradeoffs noted

## Examples

### Guard Clauses vs. Nesting

**Before:**

```ts
function processUser(user: User | null) {
if (user) {
if (user.isActive) {
if (user.hasPermission) {
return doThing(user);
}
}
}
return null;
}
```

**After:**

```ts
function processUser(user: User | null) {
if (!user?.isActive || !user.hasPermission) return null;
return doThing(user);
}
```

### Single Pass vs. Repeated Iteration

**Before:**

```ts
const names = items.map((i) => i.name);
const ids = items.map((i) => i.id);
const active = items.filter((i) => i.active);
```

**After** (when two+ iterations over same array):

```ts
const { names, ids, active } = items.reduce(
(acc, i) => ({
names: [...acc.names, i.name],
ids: [...acc.ids, i.id],
active: i.active ? [...acc.active, i] : acc.active,
}),
{ names: [] as string[], ids: [] as string[], active: [] as Item[] },
);
```

_Note:_ Keep separate passes if they are clearer; avoid reduce when simple map/filter is more readable.

### Config-Driven Handlers

**Before:**

```ts
function getLabel(type: string) {
if (type === "email") return "Email";
if (type === "phone") return "Phone";
if (type === "address") return "Address";
return "Unknown";
}
```

**After:**

```ts
const LABELS: Record<string, string> = {
email: "Email",
phone: "Phone",
address: "Address",
};
const getLabel = (type: string) => LABELS[type] ?? "Unknown";
```

### Duplicated Logic → Shared Helper

**Before:**

```ts
// In ComponentA
const formatted = `${user.firstName} ${user.lastName}`.trim();

// In ComponentB
const displayName = `${user.firstName} ${user.lastName}`.trim();
```

**After:**

```ts
// common/util/formatUser.ts
export const formatFullName = (user: { firstName: string; lastName: string }) =>
`${user.firstName} ${user.lastName}`.trim();
```

### Inline When Single Use

**Before** (over-extraction):

```ts
const getIsValid = (x: number) => x > 0 && x < 100;
if (getIsValid(value)) { ... }
```

**After:**

```ts
if (value > 0 && value < 100) { ... }
```

### Composing Hooks Instead of Duplication

**Before** (similar logic in two components):

```ts
// DayCmdPalette.tsx
const authItems = isLoggedIn ? [logoutItem] : [loginItem, signupItem];

// NowCmdPalette.tsx
const authItems = isLoggedIn ? [logoutItem] : [loginItem, signupItem];
```

**After:**

```ts
// useAuthCmdItems.ts
export const useAuthCmdItems = (isLoggedIn: boolean) =>
isLoggedIn ? [logoutItem] : [loginItem, signupItem];
```
79 changes: 79 additions & 0 deletions .codex/skills/simplify-code/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: codex-simplify-code
description: Simplifies code by minimizing complexity, eliminating duplication, and prioritizing legibility for contributors. Use when implementing features, fixing bugs, refactoring, or when the user asks to simplify, clean up, make DRY, reduce complexity, or improve maintainability.
---

# Simplify Code

Favor minimal, legible implementations. Fewer lines and clearer structure make code easier to understand and maintain.

## Before Making Changes

1. **Necessity**: Does this change only address what's required?
2. **Existing abstractions**: Are there shared utilities, hooks, or helpers in `common/`, `util/`, etc.?
3. **Duplication**: Where else does similar logic exist?
4. **Root cause**: What is actually driving the complexity?

## Core Principles

### Minimal Surface Area

- Prefer the smallest change that achieves the goal
- Add abstractions only when reuse is real and obvious
- Avoid "future-proofing" that adds complexity now

### DRY

- **Literal duplication**: Same logic in 2+ places → extract shared function
- **Similar structure**: Parameterize or compose instead of copying
- **Config-driven branches**: Use maps/objects instead of long switch/if chains
- **Do not over-DRY**: Don't unify logic that merely _looks_ similar; shared abstractions must cleanly handle all real cases

### Legibility

- One clear responsibility per function/component
- Guard clauses and early returns over deep nesting
- Functions under ~20 lines when feasible; flag functions over ~30 lines
- Each line readable without jumping around

### Durability

- Prefer built-ins and stable, minimal dependencies
- Abstractions with narrow, stable contracts
- Avoid hidden state and surprising side effects

## When to Extract vs. Inline

**Extract when:**

- Logic is used in 2+ places with shared intent
- A block has a clear, reusable name
- The abstraction has a narrow, stable API

**Do not extract when:**

- Used once and clear inline
- The abstraction would need many params or special cases
- The abstraction name would be vague (e.g. `doStuff`)

## Anti-Patterns to Avoid

- Abstracting "for the future" without current reuse
- Clever one-liners that obscure intent
- Premature micro-optimization over clarity
- Collapsing unrelated responsibilities into one abstraction
- Overly deep inheritance or generic hierarchies

## Output Format

When proposing simplifications:

1. One-sentence summary of the change
2. Minimal diff or before/after
3. Principle(s) applied (DRY, legibility, etc.)
4. Any tradeoffs noted

## Additional Resources

- For detailed heuristics and decision rules, see [heuristics.md](heuristics.md)
- For before/after patterns, see [examples.md](examples.md)
Loading