Agent skill

vendix-development-rules

General development rules.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/vendix-development-rules-rzyfront-vendix-2

Metadata

Additional technical details for this skill

scope
[
    "root"
]
auto invoke
General Development

SKILL.md

Vendix Development Rules

CRITICAL SKILL - ALWAYS ACTIVE - Estas reglas son MANDATORIAS para toda interacciΓ³n con el cΓ³digo base.

🚨 MANDATORY REQUIREMENTS

Rule 1: ALWAYS Use Task Tools

🚨 CRITICAL: Use Task tools for ANY operation involving multiple files, research, or complex analysis. NEVER attempt complex operations without proper task management.


πŸ“Š Decision Matrix: When to Use Task Tools

Scenario Files Affected Use Task Tool? Agent Type
Single file edit 1 ❌ No N/A (Edit directly)
Rename across codebase 5+ βœ… YES general-purpose
Find pattern in unknown locations Unknown βœ… YES Explore
Understand architecture Research βœ… YES Explore
Plan new feature Design βœ… YES Plan
Debug complex issue 3+ βœ… YES general-purpose
Add simple field to DTO 1 ❌ No N/A
Refactor multi-file logic 3+ βœ… YES general-purpose
Search how X works Research βœ… YES Explore

πŸ€– Agent Selection Guide

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     TASK SELECTION FLOW                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  Start Task                                                     β”‚
β”‚      β”‚                                                          β”‚
β”‚      β–Ό                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                           β”‚
β”‚  β”‚ Need to explore  │──── YES ──→ Use Explore agent             β”‚
β”‚  β”‚ or understand?  β”‚                                           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                           β”‚
β”‚           β”‚ NO                                                  β”‚
β”‚           β–Ό                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                           β”‚
β”‚  β”‚ Planning needed │──── YES ──→ Use Plan agent                 β”‚
β”‚  β”‚ for feature?    β”‚                                           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                           β”‚
β”‚           β”‚ NO                                                  β”‚
β”‚           β–Ό                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                           β”‚
β”‚  β”‚ Affects 3+      │──── YES ──→ Use general-purpose agent     β”‚
β”‚  β”‚ files?          β”‚                                           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                           β”‚
β”‚           β”‚ NO                                                  β”‚
β”‚           β–Ό                                                     β”‚
β”‚     Use direct tools (Edit, Read, Grep, Glob, Bash)            β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Explore Agent

Use for: Fast codebase exploration, finding files by patterns, understanding how things work

Examples:
β€’ "Find all files related to user authentication"
β€’ "Where are order payment methods handled?"
β€’ "Show me the inventory adjustment flow"
β€’ "How does multi-tenancy work in this codebase?"

Plan Agent

Use for: Designing implementation strategies before coding

Examples:
β€’ "Plan how to add product variant pricing"
β€’ "Design the refund flow integration"
β€’ "Plan the store settings restructure"

General-Purpose Agent

Use for: Complex multi-step tasks requiring multiple tools

Examples:
β€’ "Rename UserService to CustomerService across all files"
β€’ "Add error handling to all inventory endpoints"
β€’ "Refactor the cart calculation logic"

βœ… ❌ Real Examples from Vendix

βœ… CORRECT: Using Task Tool

typescript
// ❌ DON'T DO THIS: Manual search across codebase
// Grep β†’ Search "payment" β†’ Grep β†’ Search "stripe" β†’ Read β†’ Read...

// βœ… DO THIS: Use Explore agent
Task tool β†’ Explore agent β†’ "Find all payment processing files and explain the flow"
typescript
// ❌ DON'T DO THIS: Manually finding all references
// Grep "UserService" β†’ Edit β†’ Edit β†’ Edit... (10+ files)

// βœ… DO THIS: Use general-purpose agent
Task tool β†’ general-purpose agent β†’ "Rename UserService to CustomerService in all files"
typescript
// ❌ DON'T DO THIS: Guessing architecture
// Read random files hoping to understand the pattern

// βœ… DO THIS: Use Explore agent
Task tool β†’ Explore agent β†’ "Explain how multi-tenant context is managed across domains"

❌ INCORRECT: Using Task Tool Unnecessarily

typescript
// ❌ DON'T DO THIS: Overkill for simple tasks
Task tool β†’ "Add one field to CreateUserDto"

// βœ… DO THIS: Direct Edit tool
Edit tool β†’ Add field directly
typescript
// ❌ DON'T DO THIS: Task for single command
Task tool β†’ "Run docker compose restart"

// βœ… DO THIS: Direct Bash tool
Bash tool β†’ docker compose restart

🎯 Quick Reference Table

Need Use Pattern
Find where X is defined Explore "Find where {interface/class} is defined"
Understand flow Explore "Explain the {feature} flow from start to end"
Plan implementation Plan "Plan how to implement {feature} with {constraints}"
Multi-file refactor general-purpose "Refactor {pattern} across all {domain} files"
Find bug across files general-purpose "Find why {symptom} happens in {context}"
Single file change Direct tools Edit tool directly
Run command Direct tools Bash tool directly
Read specific file Direct tools Read tool directly

⚠️ Common Mistakes to Avoid

Mistake Why It's Wrong Correct Approach
Using Grep to find all usages Slow, error-prone, incomplete Task β†’ Explore agent
Manually editing 10+ files Time-consuming, easy to miss one Task β†’ general-purpose agent
Reading random files to understand Inefficient, misses context Task β†’ Explore agent
Starting coding without planning Creates wrong patterns Task β†’ Plan agent first

metadata: scope: [root] auto_invoke: "Complex Tasks"

Rule 2: Consistency Over Preferences

ALWAYS prioritize:

  1. Established patterns in the codebase
  2. Existing conventions over personal preferences
  3. Code consistency across the project

NEVER:

  • Suggest "better" ways that differ from established patterns
  • Introduce new conventions without justification
  • Change working patterns for marginal improvements

Principle: If it works in the codebase, follow that pattern.


Rule 3: Code Quality Standards

YOU MUST MAINTAIN:

  • Strong typing: Use TypeScript interfaces, NEVER any
  • Modularity: Keep code modular and reusable
  • Multi-tenancy: Always consider tenant isolation
  • Error handling: Implement proper error handling at all layers
  • Documentation: Add comments only when logic isn't self-evident

AVOID:

  • Over-engineering simple solutions
  • Premature abstractions
  • Adding features "just in case"
  • Changing code that already works

Rule 4: Technology Constraints

BACKEND:

  • NEVER suggest JavaScript - Always TypeScript
  • NEVER bypass Prisma - Always use generated clients
  • NEVER hardcode tenant IDs - Use RequestContext (multi-tenant is automatic)

FRONTEND:

  • NEVER use promises for HTTP - Always RxJS Observables
  • NEVER create isolated state - Use global state when appropriate
  • NEVER hardcode branding - Resolve from domain config
  • NEVER use alert() - Use ToastService

Note: Backend uses global JWT authentication via APP_GUARD. Use @Public() decorator for public routes. See vendix-backend-auth for authentication patterns.


Rule 5: Before Making Changes

YOU MUST:

  1. Read existing code before suggesting changes
  2. Understand the pattern before implementing
  3. Follow existing structures unless explicitly requested to change
  4. Test builds after any code change

NEVER:

  • Propose changes without reading the file first
  • Assume patterns without verification
  • Skip build verification

Rule 6: File Organization

BACKEND DOMAINS:

apps/backend/src/domains/{domain}/
β”œβ”€β”€ {domain}.module.ts
β”œβ”€β”€ {domain}.controller.ts
β”œβ”€β”€ {domain}.service.ts
β”œβ”€β”€ dto/
└── entities/

FRONTEND MODULES:

apps/frontend/src/app/private/modules/{module}/
β”œβ”€β”€ {module}.component.ts
β”œβ”€β”€ {module}.component.html
β”œβ”€β”€ {module}.component.scss
β”œβ”€β”€ components/
β”‚   └── index.ts
β”œβ”€β”€ services/
β”‚   └── {module}.service.ts
└── interfaces/
    └── {module}.interface.ts

ALL COMPONENTS:

  • MUST be in folders - Even if standalone, even if small
  • MUST have index.ts - For clean exports
  • MUST follow naming - kebab-case for folders, PascalCase for classes

Rule 7: Verification Workflow

BEFORE completing ANY task:

  1. βœ… Check Docker logs for ALL modified components
  2. βœ… Verify ZERO errors exist
  3. βœ… Use appropriate commands:
    • Backend: docker logs --tail 40 vendix_backend
    • Frontend: docker logs --tail 40 vendix_frontend
    • Database: docker logs --tail 40 vendix_postgres
  4. βœ… Re-check after fixes
  5. βœ… Only then mark task complete

NO EXCEPTIONS - A task is NEVER complete with build errors.


🎯 Quick Reference

Task Tool/Approach
Explore codebase Task β†’ Explore agent
Plan implementation Task β†’ Plan agent
Complex multi-step Task β†’ general-purpose agent
Simple commands Bash tool directly
Find file by name Glob tool
Search content Grep tool
Read file Read tool

πŸ“‹ Decision Tree

Start Task
    β”‚
    β”œβ”€β†’ Is it complex/multi-step?
    β”‚   └─→ YES: Use Task tool
    β”‚   └─→ NO: Can I do it with one tool?
    β”‚       └─→ YES: Use that tool
    β”‚       └─→ NO: Use Task tool
    β”‚
    β”œβ”€β†’ Does it involve code changes?
    β”‚   └─→ YES: Read file first
    β”‚   └─→ Follow existing patterns
    β”‚   └─→ Verify build after
    β”‚
    └─→ Is it a new feature/module?
        └─→ YES: Use Plan agent first
        └─→ Get user approval
        └─→ Then implement

πŸ”΄ CRITICAL REMINDERS

  1. NEVER skip Task tools for complex operations
  2. NEVER compromise naming conventions (see vendix-naming-conventions)
  3. NEVER skip build verification (see buildcheck-dev)
  4. ALWAYS read existing code before changing
  5. ALWAYS follow established patterns

Related Skills

  • vendix-naming-conventions - ABSOLUTE PRIORITY for naming
  • buildcheck-dev - MANDATORY build checks
  • vendix-backend-domain - Backend domain patterns
  • vendix-frontend-component - Frontend component patterns

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results