tryboy869/dojutsu-for-ai/gcp
Claude Code and agent skill by tryboy869/dojutsu-for-ai
- community
Checking that the SKILL.md file is still in the repository.
[Applies to: **/*] This guide provides definitive best practices for developing, deploying, and operating applications on Google Cloud Platform (GCP), emphasizing security, performance, and maintainability.
Install
npx vskill@latest install tryboy869/dojutsu-for-ai/gcpSKILL.md
The same SKILL.md was published earlier as tryboy869/dojutsu-for-ai/gcp.
gcp Best Practices
Adhering to these guidelines ensures your GCP applications are robust, secure, and performant. Treat these as non-negotiable standards.
Code Organization and Structure
1. Adhere to Google's Language Style Guides
Consistency is paramount. Always follow the official Google Style Guides for your chosen language. This improves readability and maintainability across the team.
Guideline: Integrate linting and formatting tools (e.g., Black for Python, Prettier for JS) configured with Google's style.
2. Infrastructure as Code (IaC) is Mandatory
Provision and manage all GCP resources using IaC. This ensures declarative, version-controlled, and auditable infrastructure. Terraform is the default choice.
Guideline: Treat your infrastructure code with the same rigor as application code.
❌ BAD: Manual console configuration, gcloud commands for provisioning. ✅ GOOD: Terraform for all resource definitions.
Common Patterns and Anti-patterns
1. Write Idempotent Functions and Services
Your functions and services must produce the same result regardless of how many times they are called with the same input. This is critical for retries and distributed systems.
❌ BAD: Non-idempotent operation.
✅ GOOD: Idempotent operation using a transaction or state check.
2. Ensure HTTP Functions Send a Response
HTTP-triggered Cloud Functions and Cloud Run services must send an HTTP response. Failing to do so results in timeouts and unnecessary billing.
3. Least Privilege for Service Accounts
Service accounts must have the absolute minimum permissions required. Never embed service account keys in code. Use Workload Identity Federation or attach service accounts to resources.
❌ BAD: Hardcoding service account keys or granting roles/owner.
✅ GOOD: Attaching service account to Cloud Run/Functions/GKE or using Workload Identity.
4. Firestore Document IDs: Avoid Sequential Values
Monotonically increasing or decreasing document IDs (e.g., item1, item2) can lead to "hotspotting" and contention, severely impacting write performance.
❌ BAD: Sequential document IDs.
✅ GOOD: Use automatic IDs or UUIDs.
Performance Considerations
1. Minimize Cold Start Latency for Serverless
For Cloud Functions and Cloud Run, optimize container startup time by minimizing dependencies and performing heavy computations in global scope.
❌ BAD: Heavy computation on every request.
✅ GOOD: Cache expensive operations in global scope.
2. Configure Cloud Run for Background Activities
If your Cloud Run service performs background tasks after responding to an HTTP request, you must use instance-based billing. Otherwise, CPU access will be severely limited.
Guideline: For request-based billing, ensure all asynchronous operations complete before sending a response.
3. Optimize Firestore Indexing
Reduce write latency by setting collection-level index exemptions for fields not used in queries (e.g., large strings, sequential values, TTL fields, large arrays/maps).
Guideline: Only index what you query.
Common Pitfalls and Gotchas
1. Neglecting Temporary Files in Serverless
Files written to /tmp in Cloud Functions/Run consume memory and can persist between invocations. Always delete temporary files to prevent out-of-memory errors.
❌ BAD: Not cleaning up temporary files.
✅ GOOD: Explicitly delete temporary files.
2. Relying on Offsets for Firestore Pagination
Using offset in Firestore queries retrieves all skipped documents internally, billing you for reads and increasing latency.
❌ BAD: Using offset.
✅ GOOD: Use cursors for efficient pagination.
Testing Approaches
1. Implement a Comprehensive CI/CD Pipeline
Adopt Google's "change safety" lifecycle: design, development, qualification, and rollout. This mandates automated testing (unit, integration, E2E), canary deployments, and post-deployment monitoring.
Guideline: Every code change must pass automated tests and be deployed through a controlled, staged release process.
2. Test Infrastructure as Code
Validate your Terraform or Config Connector configurations. Use tools like terraform validate and terraform plan in CI, and consider policy enforcement tools like OPA Gatekeeper.
Security
- Security scanPassed, 100 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 repositoryCheckingsenjutsu/skills/gcp/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. 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/tryboy869/dojutsu-for-ai/gcp)