Cursor rules for building Danish language learning applications with Next.js, focusing on proper build management and environment configuration
This skill provides Cursor AI rules for developing Danish language learning applications, with emphasis on build optimization and proper environment variable handling.
Configures Cursor AI to assist with Danish language learning app development by:
When working on Danish language learning applications, follow these rules strictly:
1. **Exclude Large Files Before Build**
- Always check for and exclude node_modules from builds
- Node modules contain especially large files that WILL cause build failures
- Verify .gitignore includes node_modules before any build operation
- Scan for other large binary or media files that should be excluded
2. **Pre-Build Checklist**
- Confirm node_modules is in .gitignore
- Check for large asset files (videos, audio, images) and optimize or exclude as needed
- Verify build directory is clean
- Run build in isolated environment when possible
3. **Environment Configuration**
- All API keys and secrets are stored in `.env.local` (development) or `.env.production` (production)
- These environment files are NOT visible to Cursor
- **NEVER ask the user to create environment variables**
- **NEVER request to see .env files**
- Assume all necessary environment variables are properly configured
- If functionality requires an API key, document which variable name is expected (e.g., "Requires `OPENAI_API_KEY` in .env.local") but do not ask user to create it
4. **When Encountering Missing Environment Variables**
- If code needs an environment variable, use the standard Next.js pattern: `process.env.VARIABLE_NAME`
- Add clear comments indicating which env var is required
- Document required variables in code comments only
- Trust that the user has configured their environment correctly
5. **Language Learning Features**
- Support Danish character encoding (æ, ø, å)
- Consider text-to-speech requirements for pronunciation
- Handle both Bokmål and Nynorsk if relevant
- Plan for vocabulary, grammar, and conversation practice modules
6. **Performance Considerations**
- Optimize language audio/media assets
- Implement lazy loading for lesson content
- Consider offline-first architecture for language practice
- Cache frequently accessed vocabulary and grammar rules
7. **Next.js Best Practices**
- Use App Router for modern Next.js applications
- Implement proper TypeScript types for language learning content
- Follow React best practices for interactive learning components
- Optimize images and media with Next.js built-in optimization
8. **Error Handling**
- Gracefully handle missing translations
- Provide fallbacks for failed audio loads
- Implement proper loading states for language content
- Log errors without exposing sensitive configuration
```typescript
// Good - Document what's needed, don't ask for it
const apiKey = process.env.OPENAI_API_KEY; // Configured in .env.local
if (!apiKey) {
throw new Error('OpenAI API key not configured');
}
```
```typescript
// Bad - Don't do this
"I need to create an OPENAI_API_KEY. Should I add it to .env.local?"
```
```bash
echo "Checking .gitignore for node_modules..."
grep -q "node_modules" .gitignore && echo "✓ node_modules excluded" || echo "⚠ Add node_modules to .gitignore"
```
This skill is optimized for Danish language learning applications but the build management and environment variable principles apply to any Next.js project. The rules prevent common deployment failures and maintain security best practices.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/danish-language-learning-app-development/raw