Skip to content

Commit d62ef3b

Browse files
committed
chore(deps): update TypeScript & Build packages
1 parent fa7e22e commit d62ef3b

File tree

8 files changed

+1069
-645
lines changed

8 files changed

+1069
-645
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Great! Now let's commit these changes incrementally. Each commit creates a **checkpoint** that I can resume from, so commit early and often.
2+
3+
## Core Philosophy (from 12-Factor Agents)
4+
5+
**Commits are checkpoints** - Each commit persists state so work can be paused, resumed, or forked at any point. Don't batch too many changes together.
6+
7+
**Small, focused units** - Just like agents work best with 3-10 steps max, each commit should address ONE logical change. If you can describe a commit with "and" in the message, it's probably too big.
8+
9+
**Pause for review at natural boundaries** - Commit after completing each logical unit of work, before moving to the next. This enables human review and safer rollbacks.
10+
11+
---
12+
13+
## Commit Message Convention
14+
15+
Use the format: `type(scope): message`
16+
17+
**Types:**
18+
19+
- `feat`: New feature or component
20+
- `fix`: Bug fix
21+
- `refactor`: Code change that neither fixes a bug nor adds a feature
22+
- `build`: Changes to build system or dependencies (package.json, tsconfig, etc.)
23+
- `chore`: Maintenance tasks (lockfile updates, etc.)
24+
- `docs`: Documentation changes
25+
- `test`: Adding or updating tests
26+
- `perf`: Performance improvements
27+
- `style`: Code style changes (formatting, semicolons, etc.)
28+
29+
**Scope Examples:**
30+
31+
- Apps: `main`, `main/api`, `main/ui`, `main/routes`
32+
- Features: `auth`, `workspace`, `collections`, `schema`, `onboarding`
33+
- Libs: `auth`, `utils`
34+
- Tools: `eslint-config`, `tsconfig`, `dep-version-map`
35+
- Config: `deps`, `repo`, `ci`
36+
37+
**Message Guidelines:**
38+
39+
- Use imperative mood ("add" not "added", "migrate" not "migrated")
40+
- Keep under 72 characters
41+
- Be specific but concise
42+
- No period at the end
43+
44+
---
45+
46+
## Incremental Commit Workflow
47+
48+
### Step 1: Assess the current state
49+
```bash
50+
git status --porcelain
51+
```
52+
53+
### Step 2: Group changes by logical unit
54+
Identify the smallest set of related changes that:
55+
- Are self-contained and make sense together
56+
- Don't break the build if applied in isolation
57+
- Can be described in a single commit message without "and"
58+
59+
### Step 3: Stage and commit one group at a time
60+
```bash
61+
git add <files-for-this-commit>
62+
git commit -m "type(scope): message"
63+
```
64+
65+
### Step 4: Repeat until all changes are committed
66+
After each commit, reassess remaining changes. Don't try to plan all commits upfront—adapt as you go.
67+
68+
---
69+
70+
## Grouping Strategy (Priority Order)
71+
72+
1. **Infrastructure first** - Build/config changes that other changes depend on
73+
2. **Feature additions** - New components/files created (one feature per commit)
74+
3. **Refactors/Updates** - Exports, imports, structural changes
75+
4. **Fixes** - Bug fixes, test fixes
76+
5. **Lockfile** - Always separate commit for pnpm-lock.yaml
77+
6. **Documentation** - README, migration docs, comments
78+
79+
---
80+
81+
## Anti-Patterns to Avoid
82+
83+
**Mega-commits** - "refactor everything and add new feature and fix tests"
84+
**Waiting until done** - Batching all work into one final commit
85+
**Mixed concerns** - Combining unrelated changes because they happened at the same time
86+
**Broken intermediate states** - Each commit should leave the repo in a working state
87+
88+
---
89+
90+
## Examples
91+
92+
```
93+
feat(auth): add password validation utility
94+
feat(auth): implement login form component
95+
feat(auth): connect login form to API
96+
refactor(main/api): extract user service from controller
97+
refactor(main/routes): move auth routes to dedicated folder
98+
fix(tests): wrap WorkspaceNavigation in SidebarProvider
99+
build(tsconfig): enable strict mode
100+
chore(deps): update pnpm lockfile
101+
docs: add protected routes implementation guide
102+
```
103+
104+
---
105+
106+
## Remember
107+
108+
The git history is your execution log. Make it tell a clear story of how the codebase evolved, one logical step at a time. Future you (and your teammates) will thank you.

.github/prompts/fixit.prompt.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Fix Lint Issues and Test Failures
2+
3+
> **Agent Scope**: This is a focused, single-purpose task following [12-factor-agents](https://github.com/humanlayer/12-factor-agents) principles. Fix one category of issues at a time, commit after each fix, and iterate.
4+
5+
## Context
6+
7+
This monorepo uses:
8+
- **Turbo** for orchestrating builds, linting, and tests across packages
9+
- **ESLint** with TypeScript for linting
10+
- **Vitest** for unit and component testing
11+
- **pnpm** as the package manager
12+
13+
### Key Commands
14+
15+
| Command | Scope | Description |
16+
|---------|-------|-------------|
17+
| `pnpm lint` | Monorepo | Run ESLint across all packages |
18+
| `pnpm test` | Monorepo | Run all tests via Turbo |
19+
| `pnpm build` | Monorepo | Build all packages |
20+
| `pnpm lint:fix` | Monorepo | Auto-fix lint issues where possible |
21+
22+
### Package-Specific Commands (apps/main)
23+
24+
| Command | Description |
25+
|---------|-------------|
26+
| `pnpm --filter @cbnsndwch/struktura-main lint` | Lint main app only |
27+
| `pnpm --filter @cbnsndwch/struktura-main test` | Test main app only |
28+
| `pnpm --filter @cbnsndwch/struktura-main test:unit` | Unit tests only |
29+
| `pnpm --filter @cbnsndwch/struktura-main test:components` | Component tests only |
30+
31+
---
32+
33+
## Step-by-Step Process
34+
35+
### 1. Discover Issues
36+
37+
First, run a full lint check to identify all issues:
38+
39+
```bash
40+
pnpm lint 2>&1
41+
```
42+
43+
Then run tests to find failures:
44+
45+
```bash
46+
pnpm test 2>&1
47+
```
48+
49+
Report findings in a structured format:
50+
51+
```
52+
<issues_found>
53+
category: "lint"
54+
count: 5
55+
breakdown:
56+
- rule: "@typescript-eslint/no-unused-vars"
57+
count: 3
58+
files: ["src/foo.ts", "src/bar.ts"]
59+
- rule: "import/order"
60+
count: 2
61+
files: ["src/baz.ts"]
62+
</issues_found>
63+
```
64+
65+
### 2. Categorize and Prioritize
66+
67+
Group issues by type for atomic fixes:
68+
69+
**Lint Issue Categories (in order of priority):**
70+
1. **Build-breaking**: Type errors, missing imports, syntax errors
71+
2. **Auto-fixable**: Issues that `pnpm lint:fix` can resolve
72+
3. **Manual fixes**: Unused variables, missing types, logic issues
73+
4. **Warnings**: Non-critical style or deprecation warnings
74+
75+
**Test Failure Categories:**
76+
1. **Missing dependencies**: Tests failing due to missing mocks/providers
77+
2. **API changes**: Tests failing due to changed function signatures
78+
3. **Assertion failures**: Actual logic/expectation mismatches
79+
4. **Flaky tests**: Intermittent failures (timing, race conditions)
80+
81+
### 3. Fix One Category at a Time
82+
83+
Follow this cycle for EACH category:
84+
85+
#### A. Attempt Auto-Fix First (for lint)
86+
87+
```bash
88+
pnpm lint:fix
89+
```
90+
91+
#### B. Review Remaining Issues
92+
93+
```bash
94+
pnpm lint 2>&1 | head -100
95+
```
96+
97+
#### C. Apply Manual Fixes
98+
99+
For each issue:
100+
1. Read the affected file
101+
2. Understand the context (3-5 lines before/after)
102+
3. Apply the minimal fix that resolves the issue
103+
4. Verify the fix doesn't break anything else
104+
105+
#### D. Validate
106+
107+
```bash
108+
pnpm build && pnpm lint && pnpm test
109+
```
110+
111+
#### E. Commit the Fix
112+
113+
```bash
114+
git add -A
115+
git commit -m "fix(scope): resolve [issue type] in [file/area]"
116+
```
117+
118+
### 4. Handle Errors and Edge Cases
119+
120+
If a fix introduces new issues:
121+
122+
```
123+
<error_context>
124+
original_issue: "unused variable 'foo'"
125+
attempted_fix: "removed variable declaration"
126+
new_error: "ReferenceError: foo is not defined"
127+
root_cause: "variable was used in a different scope"
128+
resolution: "keep variable, add eslint-disable comment with explanation"
129+
</error_context>
130+
```
131+
132+
**Escape hatches (use sparingly):**
133+
- `// eslint-disable-next-line <rule>` - Disable for one line with reason
134+
- `// @ts-expect-error <reason>` - Suppress type error with explanation
135+
- Skip the issue and document for manual review
136+
137+
---
138+
139+
## Compact Error Handling (Factor 9)
140+
141+
When encountering errors:
142+
1. Capture the essential error (type + message + location)
143+
2. Discard full stack traces after understanding the issue
144+
3. Focus on root cause, not symptoms
145+
146+
Example transformation:
147+
```
148+
# Before (verbose)
149+
Error: Cannot find module '@/lib/utils'
150+
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
151+
at Function.Module._load (node:internal/modules/cjs/loader:901:27)
152+
... 20 more lines
153+
154+
# After (compact)
155+
Issue: Missing module alias '@/lib/utils' in src/components/Button.tsx:3
156+
Fix: Update import path or add path alias to tsconfig.json
157+
```
158+
159+
---
160+
161+
## Small, Focused Fixes (Factor 10)
162+
163+
Each commit should address ONE logical issue:
164+
165+
**Good commits:**
166+
- `fix(main): remove unused imports in auth module`
167+
- `fix(tests): add SidebarProvider wrapper to navigation tests`
168+
- `fix(lint): resolve no-unused-vars in workspace components`
169+
170+
**Bad commits:**
171+
- `fix: resolve all lint issues` (too broad)
172+
- `fix: lint and tests and add new feature` (mixed concerns)
173+
174+
---
175+
176+
## Progress Tracking
177+
178+
After each fix cycle, update progress:
179+
180+
```
181+
<fix_progress>
182+
phase: "lint"
183+
completed:
184+
- "@typescript-eslint/no-unused-vars" (3 issues)
185+
in_progress:
186+
- "import/order" (2 remaining)
187+
remaining:
188+
- Test failures (7 total)
189+
commits_made: 2
190+
</fix_progress>
191+
```
192+
193+
---
194+
195+
## Completion Criteria
196+
197+
The task is complete when:
198+
199+
1. `pnpm lint` exits with code 0 (no errors)
200+
2. `pnpm test` exits with code 0 (all tests pass)
201+
3. `pnpm build` completes successfully
202+
4. Each fix has been committed with a descriptive message
203+
204+
---
205+
206+
## Resumption Context
207+
208+
If pausing this task, capture:
209+
210+
```markdown
211+
## Fix Session State
212+
213+
**Last successful command**: `pnpm lint` (0 errors)
214+
**Current phase**: Fixing test failures
215+
**Next file to fix**: `apps/main/app/components/__tests__/Sidebar.test.tsx`
216+
**Remaining issues**: 4 test failures in component tests
217+
**Commits made**: 3
218+
```

0 commit comments

Comments
 (0)