TheSimpleApp

context-loader

0
0
# Install this skill:
npx skills add TheSimpleApp/agent-skills --skill "context-loader"

Install specific skill from multi-skill repository

# Description

Loads project context including database schema, business rules, and coding standards before task execution. Use at the start of any significant work to ensure agents have full context.

# SKILL.md


name: context-loader
description: Loads project context including database schema, business rules, and coding standards before task execution. Use at the start of any significant work to ensure agents have full context.
license: MIT
metadata:
author: thesimpleapp
version: "1.0"


Context Loader

Systematically loads project context for informed decision-making.

Why Context Matters

WITHOUT CONTEXT:
Agent writes code β†’ Breaks conventions β†’ Review rejects β†’ Rework

WITH CONTEXT:
Load context β†’ Agent writes code β†’ Matches patterns β†’ Ships faster

Context Loading Sequence

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            CONTEXT LOADING              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  1. Project Identity                    β”‚
β”‚     └─ What type of project?            β”‚
β”‚                                         β”‚
β”‚  2. Database Schema                     β”‚
β”‚     └─ What data structures exist?      β”‚
β”‚                                         β”‚
β”‚  3. Business Rules                      β”‚
β”‚     └─ What domain logic applies?       β”‚
β”‚                                         β”‚
β”‚  4. Coding Standards                    β”‚
β”‚     └─ What patterns to follow?         β”‚
β”‚                                         β”‚
β”‚  5. Current State                       β”‚
β”‚     └─ What's in progress?              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 1: Project Identity

Detection Queries

# Flutter project
ls pubspec.yaml

# React/Next.js project
ls package.json next.config.*

# Supabase integration
ls -d supabase/

# Existing context
ls CLAUDE.md .claude/

Project Type Matrix

Files Found Project Type Primary Skills
pubspec.yaml Flutter flutter-excellence
package.json + next.config Next.js react-excellence
package.json + vite.config Vite React react-excellence
supabase/ Supabase Backend supabase-mastery
pubspec.yaml + supabase/ Flutter + Supabase flutter-excellence, supabase-mastery
package.json + supabase/ React + Supabase react-excellence, supabase-mastery

Step 2: Database Schema

Supabase Projects

Load schema from these locations (in order):

1. supabase/schema.sql (if generated)
2. supabase/migrations/*.sql (chronological)
3. Query live database (if connected)

Schema Summary Template

After loading, create mental model:

## Database Schema Summary

### Core Tables
- users: id, email, created_at
- profiles: id, user_id (FK), name, avatar_url
- orders: id, user_id (FK), status, total, created_at

### Key Relationships
- profiles.user_id β†’ users.id (1:1)
- orders.user_id β†’ users.id (1:many)

### RLS Status
- users: RLS enabled βœ“
- profiles: RLS enabled βœ“
- orders: RLS enabled βœ“

### Important Constraints
- orders.status: enum('pending', 'processing', 'completed', 'cancelled')
- profiles.user_id: unique

Step 3: Business Rules

Load From

Primary:   .claude/rules/business-logic.md
Fallback:  docs/BUSINESS_RULES.md
Legacy:    agent-os/standards/business-rules.md

Business Rules Template

# Business Rules

## User Management
- Email must be verified before full access
- Users can only see their own data (enforced via RLS)
- Account deletion: soft delete, 90-day retention

## Pricing & Limits
- Free tier: 100 API calls/day
- Pro tier: 10,000 API calls/day
- Rate limiting: 60 requests/minute

## Content Rules
- User-generated content requires moderation
- Maximum file upload: 10MB
- Allowed file types: jpg, png, pdf

## Workflow States
- Order flow: pending β†’ processing β†’ shipped β†’ delivered
- Refund window: 30 days from delivery

Step 4: Coding Standards

Load From (check both locations)

New convention:    .claude/standards/
Legacy convention: agent-os/standards/

Common Standards Files

File Purpose
typescript.md TypeScript conventions
flutter.md Flutter/Dart patterns
supabase.md Database patterns
testing.md Test conventions
git.md Commit/branch standards

Standards Summary

After loading, note key patterns:

## Active Standards

### Code Style
- TypeScript strict mode
- Functional components preferred
- Zustand for client state
- TanStack Query for server state

### Naming Conventions
- Components: PascalCase
- Hooks: use* prefix
- Types: PascalCase with *Props, *State suffixes

### File Organization
- Feature-based folders
- Barrel exports (index.ts)
- Co-located tests

Step 5: Current State

Load Sprint/Task Context

Check: docs/SPRINT.md
Check: .github/CURRENT_SPRINT.md
Check: TODO.md or TASKS.md

Current State Summary

## Current Sprint

### In Progress
- [ ] User dashboard feature (Agent A)
- [ ] API optimization (Agent B)

### Blocked
- Payment integration (waiting on Stripe keys)

### Recently Completed
- [x] Auth flow refactor
- [x] Database migrations

Context Output Format

After loading all context, produce summary:

# Project Context: [Project Name]

## Identity
- Type: Flutter + Supabase
- Primary Skills: flutter-excellence, supabase-mastery

## Database
- Tables: users, profiles, orders, products
- RLS: Enabled on all tables
- Key patterns: Soft deletes, updated_at triggers

## Business Rules
- Multi-tenant: No (single org)
- Auth: Email + OAuth (Google, Apple)
- Limits: 100 free / 10k pro API calls

## Standards
- State: Riverpod
- Architecture: Clean architecture
- Testing: Unit + Widget + Integration

## Current Work
- Sprint: Dashboard v2
- Active: 3 features in progress
- Blocked: 1 (payment integration)

## Files Loaded
- supabase/migrations/*.sql
- .claude/rules/business-logic.md
- .claude/standards/flutter.md
- docs/SPRINT.md

Dynamic Context Fetching

Using Context7 MCP

For up-to-date library documentation:

1. Identify libraries in use
   - Read pubspec.yaml or package.json

2. Fetch current docs
   - context7: resolve-library-id β†’ get-library-docs

3. Cache relevant sections
   - Focus on APIs being used

Example: Supabase Docs

When working with Supabase RLS:
1. Fetch latest Supabase docs via Context7
2. Check for any API changes
3. Apply patterns from supabase-mastery skill
4. Verify against current docs

Context Refresh Triggers

Reload context when:

β–‘ Starting new feature
β–‘ Switching between projects
β–‘ Database schema changed
β–‘ New team member onboarded
β–‘ Standards updated
β–‘ Sprint changed

Integration with Other Skills

context-loader β†’ Provides context to all other skills

Typical flow:
1. /context-loader    β†’ Load project context
2. /sprint-planning   β†’ Plan with context awareness
3. /orchestrator      β†’ Spawn agents with context
4. Agents execute     β†’ Using loaded context

Minimal Context Mode

For quick tasks, load only essentials:

## Quick Context (< 30 seconds)

1. Project type (pubspec.yaml OR package.json)
2. CLAUDE.md (if exists)
3. Relevant standard for task domain

Skip: Full schema, all business rules, sprint state

Context Handoff

When spawning agents, pass context summary:

## Agent Prompt Template

You are working on [project name], a [Flutter/React] + Supabase project.

Key context:
- Database: [key tables]
- Business rules: [relevant rules]
- Standards: [relevant patterns]
- Current task: [specific task]

Files to reference:
- [list of relevant files]

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.