0
0
Source

Local environment management - run SQL queries, set up fake payments, reset test data. Use when the user needs help with local database operations or test data setup.

Install

mkdir -p .claude/skills/local-env && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5674" && unzip -o skill.zip -d .claude/skills/local-env && rm skill.zip

Installs to .claude/skills/local-env

About this skill

Local Environment Management

Help with local development environment tasks for daily-api.

Database Access

PostgreSQL runs locally via Docker in a k8s container.

Finding the Container

docker ps --format "table {{.Names}}" | grep "k8s_app_postgres"

Running Queries

docker exec <CONTAINER_NAME> psql -U postgres -d api -c "YOUR SQL QUERY"

For multi-line queries:

docker exec <CONTAINER_NAME> psql -U postgres -d api <<'EOF'
SELECT * FROM users LIMIT 1;
EOF

Fake Payment Setup

Payment status for opportunities is tracked on the Organization level via recruiterSubscriptionFlags. Opportunities also store subscription info in their flags column.

Organization Subscription Fields

FieldDescription
statusMust be 'active' for payment validation to pass
providerUse 'paddle'
items[].quantityNumber of opportunity "seats" available
items[].priceIdPrice ID that opportunities reference

Opportunity Flags Fields

FieldDescription
planMust match a priceId from the org's subscription items
batchSizeNumber of candidates per batch

Fake Payment for Organization

UPDATE organization
SET "recruiterSubscriptionFlags" = jsonb_build_object(
  'status', 'active',
  'provider', 'paddle',
  'subscriptionId', 'fake_sub_123',
  'createdAt', now(),
  'updatedAt', now(),
  'items', jsonb_build_array(
    jsonb_build_object('priceId', 'pri_fake_123', 'quantity', 5)
  )
)
WHERE id = 'ORGANIZATION_ID';

Reset: UPDATE organization SET "recruiterSubscriptionFlags" = '{}' WHERE id = 'ORGANIZATION_ID';

Fake Payment for Opportunity

Requires updating both the organization AND the opportunity:

-- Step 1: Update organization subscription
UPDATE organization
SET "recruiterSubscriptionFlags" = jsonb_build_object(
  'status', 'active',
  'provider', 'paddle',
  'subscriptionId', 'fake_sub_123',
  'createdAt', now(),
  'updatedAt', now(),
  'items', jsonb_build_array(
    jsonb_build_object('priceId', 'pri_fake_123', 'quantity', 5)
  )
)
WHERE id = (SELECT "organizationId" FROM opportunity WHERE id = 'OPPORTUNITY_ID');

-- Step 2: Update opportunity flags
UPDATE opportunity
SET flags = flags || jsonb_build_object(
  'plan', 'pri_fake_123',
  'batchSize', 50
)
WHERE id = 'OPPORTUNITY_ID';

Reset:

UPDATE organization SET "recruiterSubscriptionFlags" = '{}'
WHERE id = (SELECT "organizationId" FROM opportunity WHERE id = 'OPPORTUNITY_ID');

UPDATE opportunity SET flags = flags - 'plan' - 'batchSize'
WHERE id = 'OPPORTUNITY_ID';

Opportunity State Management

The opportunity table uses a state column (integer) to track lifecycle status. Values come from OpportunityState enum in @dailydotdev/schema.

OpportunityState Values

ValueNameDescription
0UNSPECIFIEDDefault/unset
1DRAFTNot yet published
2LIVEActive and visible
3CLOSEDNo longer active
4IN_REVIEWPending review

Update Opportunity State

-- Set to LIVE
UPDATE opportunity SET state = 2 WHERE id = 'OPPORTUNITY_ID' RETURNING id, state, title;

-- Set to DRAFT
UPDATE opportunity SET state = 1 WHERE id = 'OPPORTUNITY_ID' RETURNING id, state, title;

-- Set to CLOSED
UPDATE opportunity SET state = 3 WHERE id = 'OPPORTUNITY_ID' RETURNING id, state, title;

-- Set to IN_REVIEW
UPDATE opportunity SET state = 4 WHERE id = 'OPPORTUNITY_ID' RETURNING id, state, title;

Instructions

When the user asks for local environment help:

  1. For SQL queries: First find the postgres container, then execute via docker exec
  2. For fake payments: Determine if they're providing an opportunity ID or organization ID, run the appropriate SQL
  3. Always verify: After changes, run a SELECT to confirm
  4. Ask if unclear: If the request is ambiguous, ask clarifying questions

Common requests:

  • "Set up fake payment for opportunity X" → Run both org and opportunity updates
  • "Set up fake payment for org X" → Run only org update
  • "Run SQL: ..." → Execute via docker
  • "Reset payment for X" → Run reset queries
  • "Check subscription for X" → Query and display current state
  • "Update opp X to live/draft/closed" → Update opportunity state

Discovering Schema Information

When handling requests not covered in this skill, use these techniques to discover the correct schema:

1. Check Entity Definitions

Entity files define column names and types:

# Find the entity file
grep -r "TableName" src/entity/ --include="*.ts"
# Read the entity to see column definitions

Key location: src/entity/ - TypeORM entities with @Column decorators show actual DB column names.

2. Find Enum Values

Many columns use integer enums from @dailydotdev/schema. To find enum values:

# Search for enum usage in codebase
grep -r "EnumName\." src/ --include="*.ts" | head -20

# Find enum definition in schema package
grep -r "EnumName" node_modules/@dailydotdev/schema/dist/ --include="*.d.ts"

Common enum locations: node_modules/@dailydotdev/schema/dist/daily-api/*_pb.d.ts

3. Query Existing Data

When unsure about column names or values:

-- Check table structure
\d tablename

-- See existing values
SELECT DISTINCT column_name FROM tablename LIMIT 10;

-- Inspect a specific row
SELECT * FROM tablename WHERE id = 'xxx' LIMIT 1;

4. Common Gotchas

  • Column naming: Entity property names may differ from DB columns (e.g., state not status)
  • Integer enums: Many "status" fields are integers, not strings - find the enum definition
  • JSONB fields: Use jsonb_build_object() for updates, -> or ->> for queries
  • Quoted columns: PostgreSQL requires double quotes for camelCase columns (e.g., "organizationId")

Continuous Improvement

This skill should evolve over time. When you discover new local environment operations, common testing patterns, or useful queries:

  1. Add them to this file - Update the SKILL.md with new sections or examples
  2. Keep it practical - Focus on operations that are frequently needed
  3. Document the why - Explain what fields mean and why certain values are used

If a user asks for something not covered here, help them and then offer to add it to this skill for future use.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

644969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

593705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

319400

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

341398

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

454339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.