handbook

ChinchillaEnterprises's avatarfrom ChinchillaEnterprises

Complete Amplify Gen 2 handbook - instructs Claude to read resources/handbook/ before implementing any code

⭐0stars🔀0forks📁View on GitHub🕐Updated Nov 20, 2025⬇️1downloads

When & Why to Use This Skill

The Handbook Skill is a specialized Claude agent tool designed to streamline AWS Amplify Gen 2 development by enforcing a 'read-before-you-code' workflow. It ensures that the AI references local, production-tested patterns stored in the project's resources/handbook/ directory before generating any code. This approach significantly reduces AI hallucinations, prevents the use of outdated Amplify Gen 1 patterns, and ensures strict adherence to framework-specific abstractions like defineAuth and defineData, leading to more reliable and maintainable cloud infrastructure.

Use Cases

  • Standardizing Authentication: Implementing Google OAuth or Cognito triggers following the project's specific security and setup guides to ensure production readiness.
  • Data Modeling & Schema Design: Creating DynamoDB models and GraphQL schemas that align with established architectural patterns, including TTL and relationship configurations.
  • Serverless Logic Implementation: Developing scheduled Lambda functions, GraphQL resolvers, or Docker-based Lambdas using verified internal templates instead of generic code.
  • Automated Webhook Integration: Setting up Slack, Stripe, or GitHub webhook handlers using Next.js API routes as prescribed by the project's architectural guidelines.
  • Architectural Compliance: Ensuring all new infrastructure code avoids unnecessary API Gateway resources and follows the 'No CDK' rule for standard Amplify tasks.
  • Onboarding & Troubleshooting: Providing AI-driven assistance for debugging and environment variable management based on the project's unique troubleshooting documentation.
namehandbook
descriptionComplete Amplify Gen 2 handbook - instructs Claude to read resources/handbook/ before implementing any code

Handbook Skill - Read Before You Code

Purpose

This skill instructs Claude to read the project's handbook BEFORE implementing any code in an Amplify Gen 2 project.

The handbook contains proven, production-tested patterns for:

  • Authentication (Google OAuth, Cognito, security)
  • Data modeling (DynamoDB, GraphQL schemas, TTL)
  • Lambda functions (scheduled, triggers, DynamoDB access)
  • Webhooks (Slack, Stripe, GitHub)
  • Frontend patterns (MUI, design systems)
  • Troubleshooting and debugging

Core Principle: No Hallucinations, Only Handbook Patterns

When a user asks you to implement anything in an Amplify Gen 2 project:

  1. STOP - Don't immediately write code
  2. CHECK - Does resources/handbook/ exist in the current project?
  3. LEARN - Read the handbook to understand the correct patterns
  4. THEN CODE - Implement using handbook patterns, not generic approaches

The Workflow

Step 1: Check for Handbook

# Is there a handbook in this project?
ls resources/handbook/README.md

If it exists, you have access to the complete Amplify Gen 2 handbook.

Step 2: Start with Table of Contents

ALWAYS begin here:

  • Read resources/handbook/README.md
  • This contains the full table of contents
  • Understand what sections exist (Auth, Functions, Data, Webhooks, etc.)
  • Treat it like a textbook - respect the organization

Step 3: Navigate to Relevant Section

Based on what the user wants to build:

User Wants To Build Read This Section
DynamoDB model/schema resources/handbook/data/
Scheduled Lambda function resources/handbook/functions/scheduledFunction/
GraphQL resolver resources/handbook/functions/graphqlResolver/
Webhook handler resources/handbook/webhooks/
Google OAuth authentication resources/handbook/auth/GOOGLE_OAUTH_SETUP.md
Cognito triggers resources/handbook/auth/TRIGGERS_GUIDE.md
Environment variables resources/handbook/ENVIRONMENT_VARIABLES.md
Docker Lambda resources/handbook/functions/DOCKER_LAMBDA_WITH_AMPLIFY_GEN2.md
Long-running operations (>30s) resources/handbook/ASYNC_PATTERNS.md

Step 4: Learn the Pattern

  • Read the guide completely
  • Understand the Amplify Gen 2 way to do it
  • Note any security considerations
  • Check for common pitfalls
  • Look at examples if available

Step 5: Implement the Code

NOW you write the code, following the handbook patterns you just learned.


Critical Rules (Always Follow)

The "No CDK" Rule

  • ❌ NEVER import from aws-cdk-lib for standard tasks
  • ✅ ONLY use: defineAuth, defineData, defineFunction, defineStorage
  • See: resources/handbook/AI-DEVELOPMENT-GUIDELINES.md

The "No API Gateway" Rule

  • ❌ NEVER create API Gateway resources
  • ✅ Internal operations: GraphQL custom mutations
  • ✅ External webhooks: Next.js API routes
  • See: resources/handbook/NO-API-GATEWAY.md

The "Learn First" Rule

  • ❌ Don't write code based on generic knowledge or hallucinations
  • ✅ Read the handbook section first, THEN code
  • This prevents using wrong patterns or outdated approaches

The handbook README.md has a comprehensive "I Need To..." table that maps user needs to specific documentation. Use it as your guide.


What This Prevents

❌ Using outdated Amplify Gen 1 patterns ❌ Importing unnecessary CDK libraries ❌ Creating API Gateway resources (not needed) ❌ Manually writing IAM policies (handled by Amplify) ❌ Making up APIs that don't exist ❌ Generic Lambda code that doesn't integrate properly

✅ Using correct Amplify Gen 2 abstractions ✅ Following proven, production-tested patterns ✅ Writing code that works first try ✅ Proper integration with Amplify resources


Remember

Every time you're about to write Amplify Gen 2 code:

  1. Check for resources/handbook/
  2. Read the relevant section
  3. Learn the pattern
  4. Then code

This ensures you implement things the correct way, following the template's established patterns and best practices.


Updating the Handbook

To get latest handbook: Use the handbook-sync skill

To contribute new patterns: Use the handbook-updater skill