Synthèse automatique
Gère l'environnement de développement local de daily-api : exécution de requêtes PostgreSQL dans le conteneur Docker, création de faux paiements Paddle et réinitialisation des données de test.
Points forts
- Fournit des commandes docker exec/psql directement copiables, y compris pour les requêtes multi-lignes.
- Décrit précisément les champs JSONB à renseigner pour simuler un abonnement Paddle au niveau organisation et opportunité.
- Inclut les requêtes de réinitialisation et la correspondance des valeurs de l'enum OpportunityState.
- Explique la relation entre l'abonnement de l'organisation et les flags de l'opportunité.
Limites
- Très lié au schéma et au nommage de conteneur de daily-api ; peu réutilisable tel quel ailleurs.
- Suppose un PostgreSQL local via Docker/k8s et l'accès à psql, sans garde-fou sur les UPDATE destructifs.
- Ne traite pas des migrations, sauvegardes ou environnements partagés.
À utiliser lorsqu'il faut inspecter ou modifier la base PostgreSQL locale de daily-api, simuler un paiement ou changer l'état d'une opportunité pour tester.
À ne pas utiliser sur une base partagée, de staging ou de production, ni pour des migrations de schéma.
Analyse de sécurité
PrudenceAll actions are local development housekeeping: finding a Postgres container, running SQL, and seeding fake subscription/state data for testing. There is no network exfiltration, no curl|sh, no obfuscated payloads, and no attempt to disable safety controls. The risk is 'caution' because the skill deliberately uses powerful tools (docker exec, superuser SQL, destructive UPDATE/reset queries) and explicitly manufactures 'active' payment flags to bypass payment validation, with no environment guardrail to stop a mis-targeted run against shared or production data.
- •Executes arbitrary SQL via `docker exec ... psql -U postgres` including UPDATE statements that mutate organization/opportunity payment and lifecycle state
- •Skill's purpose is to fabricate 'active' payment/subscription state (`recruiterSubscriptionFlags`, paddle price IDs) so payment validation passes — legitimate for local test data but is a payment-logic bypass if ever pointed at a non-local environment
- •No guardrail confining commands to a local/dev database; container lookup greps for `k8s_app_postgres` but nothing prevents running against a remote or production kube context or DATABASE_URL
- •Uses the `postgres` superuser role with no read-only or scoped credentials
Exemples
Find the local postgres container and show me the last 5 opportunities with their id, title, and state.Set up a fake active Paddle subscription for organization org_123 with 5 seats, then show me the updated recruiterSubscriptionFlags.Set opportunity opp_456 to LIVE and give it a batchSize of 50, making sure its organization has an active fake payment plan that matches.name: local-env description: 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.
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
| Field | Description |
|-------|-------------|
| status | Must be 'active' for payment validation to pass |
| provider | Use 'paddle' |
| items[].quantity | Number of opportunity "seats" available |
| items[].priceId | Price ID that opportunities reference |
Opportunity Flags Fields
| Field | Description |
|-------|-------------|
| plan | Must match a priceId from the org's subscription items |
| batchSize | Number 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
| Value | Name | Description | |-------|------|-------------| | 0 | UNSPECIFIED | Default/unset | | 1 | DRAFT | Not yet published | | 2 | LIVE | Active and visible | | 3 | CLOSED | No longer active | | 4 | IN_REVIEW | Pending 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:
- For SQL queries: First find the postgres container, then execute via docker exec
- For fake payments: Determine if they're providing an opportunity ID or organization ID, run the appropriate SQL
- Always verify: After changes, run a SELECT to confirm
- 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.,
statenotstatus) - 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:
- Add them to this file - Update the SKILL.md with new sections or examples
- Keep it practical - Focus on operations that are frequently needed
- 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.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/local-environment-management-mmbizkuf/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/local-environment-management-mmbizkuf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/local-environment-management-mmbizkuf/download' --output '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md.part' && mv '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md.part' '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && test -s '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/local-env' && cp -R '.skill-downloads/local-environment-management-mmbizkuf' '.claude/skills/local-env'Cursor
test -f '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && test -s '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/local-env' && cp -R '.skill-downloads/local-environment-management-mmbizkuf' '.cursor/skills/local-env'Codex
test -f '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && test -s '.skill-downloads/local-environment-management-mmbizkuf/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/local-env' && cp -R '.skill-downloads/local-environment-management-mmbizkuf' '.agents/skills/local-env'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/local-environment-management-mmbizkuf'openskills read 'local-environment-management-mmbizkuf'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/local-environment-management-mmbizkuf/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.