Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .claude/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Claude Code Configuration for PetSphere
# Claude Code Configuration for PetFolio

This directory contains tailored automation, skills, and settings for PetSphere Flutter development.
This directory contains tailored automation, skills, and settings for PetFolio Flutter development.

## 📋 Contents

Expand All @@ -10,7 +10,7 @@ This directory contains tailored automation, skills, and settings for PetSphere
### Skills (User-Invocable)

#### 1. `/flutter-new-component`
Scaffold new reusable Flutter components following PetSphere patterns.
Scaffold new reusable Flutter components following PetFolio patterns.

```bash
/flutter-new-component PetCard "Displays a pet profile card"
Expand Down Expand Up @@ -47,7 +47,7 @@ Scaffold complete feature layers (model + repository + controller) in one comman
- `lib/repositories/{feature_name}_repository.dart`
- `lib/controllers/{feature_name}_controller.dart`

All three files follow PetSphere architecture patterns and are production-ready.
All three files follow PetFolio architecture patterns and are production-ready.

---

Expand Down
30 changes: 22 additions & 8 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"hooks": [
{
"trigger": "PostToolUse",
"tool": "Edit",
"description": "Auto-format and lint Dart files after editing",
"commands": ["dart format {filePath}", "flutter analyze --no-pub {filePath}"]
}
],
"hooks": {
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [
{"type": "command", "command": "dart format {filePath}"},
{"type": "command", "command": "flutter analyze --no-pub {filePath}"}
]
},
{
"matcher": "Edit",
"hooks": [
{"type": "command", "command": "flutter test --reporter=compact test/ 2>&1 | head -100"}
]
}
]
},
"permissions": {
"preToolUse": [
{
Expand All @@ -33,6 +42,11 @@
"type": "plugin",
"name": "context7",
"description": "Real-time Flutter/Dart/Riverpod documentation lookup"
},
{
"type": "plugin",
"name": "github",
"description": "GitHub repository access for issues, PRs, and actions"
}
]
}
Expand Down
12 changes: 10 additions & 2 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
"Bash(gh run *)",
"Bash(git restore *)",
"Bash(git commit -m 'Fix: Update deprecated actions/upload-artifact from v3 to v4 *)",
"Bash(git push *)"
"Bash(git push *)",
"Bash(flutter pub *)",
"mcp__plugin_supabase_supabase__execute_sql",
"Bash(Remove-Item \"g:\\\\Pet\\\\petsphere\\\\lib\\\\core\\\\repositories\\\\feature_repositories.dart\" -Force)",
"Bash(Get-ChildItem -Path \"G:\\\\Pet\\\\petsphere\\\\lib\\\\features\" -Directory)",
"Bash(Select-Object -ExpandProperty Name)",
"Bash(xargs grep -l \"\\\\.insert\\(\")",
"Bash(Remove-Item \"g:\\\\Pet\\\\petsphere\\\\lib\\\\features\\\\home\\\\presentation\\\\screens\\\\main_layout.dart\")"
]
}
},
"outputStyle": "default"
}
76 changes: 76 additions & 0 deletions .claude/skills/flutter-supabase-migration/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: flutter-supabase-migration
description: Scaffold and manage Supabase database migrations for PetSphere
disable-model-invocation: false
user-invocable: true
---

# Flutter Supabase Migration Helper

Generate migration files, review schema changes, and manage PostgreSQL schema evolution for PetSphere's Supabase backend.

## Quick Usage

```bash
/flutter-supabase-migration --action create --table users --fields "name:text, email:text:unique"
```

## What This Does

- **Create**: Scaffold new migration files with SQL templates
- **Review**: Analyze schema changes for RLS policies and indexes
- **Validate**: Check migration syntax and Supabase compatibility
- **Rollback**: Generate rollback scripts

## Common Workflows

### Create a New Table Migration

```bash
/flutter-supabase-migration --action create --table pet_health_metrics \
--fields "pet_id:uuid:fk(pets),metric_type:text,value:float,recorded_at:timestamp"
```

Generates migration file with:
- Table creation with proper types and constraints
- RLS policy stubs (to be configured)
- Index recommendations
- Timestamp audit columns

### Add a Column to Existing Table

```bash
/flutter-supabase-migration --action add-column --table pets \
--column "care_goals:jsonb" --default "'{}'::jsonb"
```

### Generate RLS Policy Template

```bash
/flutter-supabase-migration --action rls --table pets --policy "users own pets"
```

## Migration File Location

Migrations are stored in: `supabase/migrations/`

Each file is named: `TIMESTAMP_description.sql`

Example:
```
supabase/migrations/20260508120000_create_pet_health_metrics.sql
```

## Important Notes

- Always review generated migrations before applying
- Test migrations on a development branch first: `supabase db push --local`
- Include RLS policies for data isolation
- Add indexes for performance-critical queries
- Document schema changes in CLAUDE.md after merge

## Reference

- [Supabase Migrations Docs](https://supabase.com/docs/guides/migrations/using-cli)
- [PostgreSQL Data Types](https://www.postgresql.org/docs/current/datatype.html)
- [RLS Best Practices](https://supabase.com/docs/guides/auth/row-level-security)
112 changes: 112 additions & 0 deletions .claude/skills/riverpod-inspector/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
name: riverpod-inspector
description: Debug and visualize Riverpod state management and provider dependencies
disable-model-invocation: false
user-invocable: true
---

# Riverpod Inspector

Analyze Riverpod providers, trace state mutations, and visualize dependency graphs for PetSphere controllers.

## Quick Usage

```bash
/riverpod-inspector --action trace --provider petProvider
/riverpod-inspector --action deps --controller PetNotifier
/riverpod-inspector --action profile --threshold 50ms
```

## What This Does

- **Trace**: Follow state changes in a provider from action to UI update
- **Deps**: Map dependencies between providers (what watches what)
- **Profile**: Identify slow state computations and unnecessary rebuilds
- **Graph**: Generate ASCII dependency diagram
- **Search**: Find all providers matching a pattern

## Common Workflows

### Debug Why a Widget Isn't Rebuilding

```bash
/riverpod-inspector --action trace --provider petProvider --watch myPetsSelector
```

Output:
```
petProvider
└─ build() initializes state
└─ loadPets() updates state.myPets
└─ Watched by: PetListScreen, PetCardComponent
```

### Find Unused Providers

```bash
/riverpod-inspector --action deps --all --unused
```

Lists providers with no watchers (candidates for removal).

### Visualize Controller Dependencies

```bash
/riverpod-inspector --action graph --controller AuthNotifier
```

Shows what providers `AuthNotifier` depends on and what depends on it:

```
healthProvider ──┐
└─> petProvider ──┐
feedProvider ────┘ └─> AuthNotifier
└─> uiStateProvider
```

### Profile Controller Performance

```bash
/riverpod-inspector --action profile --threshold 50ms
```

Lists all state mutations taking >50ms:
```
petProvider.loadPets() → 245ms (DB query + image processing)
healthProvider.updateVitals → 87ms (Supabase update)
feedProvider.createPost() → 1200ms ⚠️ (SLOW: consider memoization)
```

## Key Patterns to Look For

### ✅ Good Patterns

- Providers with `.select()` to watch only needed fields
- `.autoDispose` on temporary providers
- Notifier methods that batch state updates
- Comments explaining why dependency exists

### ❌ Anti-Patterns to Fix

- Watching entire state when only one field is needed
- Circular dependencies (A watches B watches A)
- State mutations in `build()` (should be in methods)
- Providers that listen to everything

## Integration with DevTools

For visual debugging, also use Flutter DevTools:

```bash
flutter run
# In another terminal
flutter devtools
```

Then navigate to Riverpod DevTools tab to inspect state in real-time.

## Reference

- [Riverpod Docs](https://riverpod.dev/)
- [Provider Families & Selectors](https://riverpod.dev/docs/concepts/modifiers/family)
- [Auto-Dispose Pattern](https://riverpod.dev/docs/concepts/modifiers/auto_dispose)
1 change: 1 addition & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
13 changes: 13 additions & 0 deletions .gemini/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"mcp": {
"excluded": [
"datacloud_bigquery_toolbox",
"datacloud_spanner_toolbox",
"datacloud_alloydb-postgres-admin_toolbox",
"datacloud_alloydb-postgres_toolbox",
"datacloud_cloud-sql-postgresql-admin_toolbox",
"datacloud_cloud-sql-postgresql_toolbox",
"datacloud_knowledge_catalog_toolbox",
"datacloud_dataproc_toolbox",
"datacloud_serverless-spark_toolbox"
]
},
"mcpServers": {
"appium-mcp": {
"command": "npx",
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/claude-code-review.yml.md

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/claude.yml.md

This file was deleted.

Loading
Loading