2389-research/firebase-development/add-feature
Claude Code and agent skill by 2389-research/firebase-development
- community
Checking that the SKILL.md file is still in the repository.
Adds Cloud Functions, Firestore collections, and API endpoints to existing Firebase projects using TDD. Use when adding a function, creating an endpoint, implementing a new Firestore collection, or building a feature in an existing Firebase project.
Install
npx vskill@latest install 2389-research/firebase-development/add-featureSKILL.md
The same SKILL.md was published earlier as 2389-research/firebase-development/add-feature.
Firebase Add Feature
Overview
This sub-skill guides adding new features to existing Firebase projects using TDD. It handles Cloud Functions, Firestore collections, and API endpoints.
Key principles:
- Write tests FIRST (TDD requirement)
- Use
{success, message, data?}response pattern - Every file starts with ABOUTME comments
- Verify with emulators before claiming done
When This Sub-Skill Applies
- Adding a new Cloud Function
- Creating a new Firestore collection with rules
- Adding an API endpoint to Express app
- User says: "add function", "create endpoint", "new collection", "implement"
Do not use for:
- Initial project setup →
firebase-development:project-setup - Debugging →
firebase-development:debug - Code review →
firebase-development:validate
TodoWrite Workflow
Create checklist with these 12 steps:
Step 1: Identify Feature Type
Determine what's being added:
- HTTP Endpoint - API route (GET/POST/etc.)
- Firestore Trigger - Runs on document changes
- Scheduled Function - Cron job
- Callable Function - Client SDK calls
- New Collection - Firestore collection with rules
Step 2: Check Existing Architecture
Examine the project to understand patterns:
Determine: Architecture style, auth method, security model.
Reference: docs/examples/express-function-architecture.md
Step 3: Write Failing Test First (TDD)
Create test file before implementation:
Run test to confirm it fails: npm run test
Step 4: Create Function File with ABOUTME
Create implementation file:
Reference: docs/examples/express-function-architecture.md
Step 5: Add Firestore Security Rules
Update firestore.rules for new collections:
Server-write-only (preferred):
Client-write (if needed):
Reference: docs/examples/firestore-rules-patterns.md
Step 6: Update Indexes if Needed
Add to firestore.indexes.json for complex queries:
Skip if no complex queries (single-field indexes are automatic).
Step 7: Add Authentication Checks
Based on project pattern:
API Keys:
Firebase Auth:
Reference: docs/examples/api-key-authentication.md
Step 8: Implement Handler with Response Pattern
All handlers use consistent pattern:
Include validation at every layer (defense in depth).
Step 9: Export Function Properly
Add to functions/src/index.ts:
Express: Add route or switch case Domain-grouped: export * from './yourDomain'; Individual: Import and export in index.js
Verify: npm run build
Step 10: Make Tests Pass (TDD Green)
Run tests: npm run test
All tests should pass. If not, fix implementation (not tests).
Step 11: Write Integration Test
Create functions/src/__tests__/emulator/yourFeature.test.ts:
Test complete workflow with emulators:
- HTTP request to endpoint
- Verify Firestore data created
- Test auth enforcement
Run: npm run test:emulator (with emulators running)
Step 12: Test with Emulators
Verify:
- Endpoint returns 200
- Response follows pattern
- Documents appear in Firestore
- Auth enforced (401 for invalid)
- Rules work in Rules Playground
Response Pattern
All handlers MUST return:
Verification Checklist
Before marking complete:
- [ ] Tests written FIRST and pass
- [ ] ABOUTME comments on all files
- [ ] Security rules added
- [ ] Auth checks implemented
- [ ] Response pattern followed
- [ ] Emulator testing successful
- [ ] Code linted
Pattern References
- Architecture:
docs/examples/express-function-architecture.md - Auth:
docs/examples/api-key-authentication.md - Rules:
docs/examples/firestore-rules-patterns.md - Emulators:
docs/examples/emulator-workflow.md
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/add-feature/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/2389-research/firebase-development/add-feature)