Skip to content

AI coding rules and patterns for PJ, Core and High-Income development workflows

Notifications You must be signed in to change notification settings

nubank/cross-segment-ai-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cross-Segment AI Tools

AI-powered coding assistants for Nu's cross-segment development workflows. This repository contains Cursor rules and commands that automate repetitive tasks, enforce best practices, and accelerate development across Core, PJ, and other data domains.

πŸš€ Quick Start

Installation

Install commands or rules to your project using the nu CLI:

# Install commands to a project
nu cross-segment-ai-tools commands install <repo>
nu cross-segment-ai-tools commands install itaipu
nu cross-segment-ai-tools commands install ~/dev/nu/my-project

# Install rules to a project
nu cross-segment-ai-tools rules install <repo>
nu cross-segment-ai-tools rules install itaipu
nu cross-segment-ai-tools rules install ~/dev/nu/my-project

Update

Keep your tools up to date:

# Update all projects that have commands installed
nu cross-segment-ai-tools commands update

# Update a specific project
nu cross-segment-ai-tools commands update ~/dev/nu/itaipu

# Update all projects that have rules installed
nu cross-segment-ai-tools rules update

# Update a specific project
nu cross-segment-ai-tools rules update ~/dev/nu/itaipu

Remove

Remove tools from a project:

# Remove commands from a project
nu cross-segment-ai-tools commands remove <repo>
nu cross-segment-ai-tools commands remove itaipu

# Remove rules from a project
nu cross-segment-ai-tools rules remove <repo>
nu cross-segment-ai-tools rules remove itaipu

Help

nu cross-segment-ai-tools commands --help
nu cross-segment-ai-tools rules --help

πŸ“ Repository Structure

.cursor/
└── commands/                    # AI commands (executable prompts & agents)
    β”œβ”€β”€ core/                    # Core-specific commands
    β”‚   β”œβ”€β”€ pe-de-pano-v2.md    # Purple Loop campaign automation
    β”‚   └── clm_doc_creator.md   # CLM business rules documentation automation
    β”œβ”€β”€ pj/                      # PJ-specific commands
    β”‚   └── Papa-LΓ©guas - Campaign Updater - v1.1.md  # Ranking strategy synchronizer
    └── cross-segments/          # Cross-segment commands
        β”œβ”€β”€ rapidash.md          # Audience Manager attribute generator
        └── edwiges-cockpit-metric-creator.md  # Cockpit metric creation assistant

docs/
└── agents/
    └── clm_doc_creator.md       # CLM Doc Creator Agent documentation

πŸ€– Available AI Assistants

πŸ”₯ Rapidash β€” Audience Manager Attribute Generator

Domain: Cross-segment (Core, PJ, High-Income)

Rapidash automates the entire process of creating audience manager attributesβ€”from requirements gathering to production-ready code. In ~10 minutes, it can:

  • βœ… Generate complete Scala attribute code
  • βœ… Detect duplicates with comprehensive validation
  • βœ… Suggest attribute generators for parameter variations
  • βœ… Handle git workflows automatically
  • βœ… Deliver a ready-to-review pull request

How to use:

  1. Open your Itaipu project in Cursor
  2. Use the command: /rapidash
  3. Follow the conversational prompts

Supported domains: core-brazil, high-income, pj-brazil, and more

Documentation: Included in agent file


🦢 PΓ© de Pano β€” Purple Loop Campaign Automation

Domain: Core (PF segment)

PΓ© de Pano automates three Purple Loop-related tasks:

  1. Campaign Updater β€” Add campaign vals to product config files
  2. Templates Updater β€” Insert templates into product template lists
  3. Ranking Strategy Updater β€” Include campaigns in ranking strategy lists

How to use:

  1. Open your Itaipu project in Cursor
  2. Use the command: /pe-de-pano-v2
  3. Provide campaign/template data as tables
  4. Review dry-run plan before applying changes

Supported products: Money Boxes, Caixinha Turbo, Insurance, Lending, and 30+ more

Documentation: Included in command file


πŸ“ CLM Doc Creator Agent β€” Business Rules Documentation Automation

Domain: Core (PF segment)

CLM Doc Creator Agent automates the creation and maintenance of technical documentation for Customer Lifecycle Management (CLM) business rules in Confluence. It analyzes Scala code files for product eligibility, activity, and conversion logic, then creates human-readable documentation that non-technical stakeholders (PMs, business analysts) can understand.

Key Features:

  • πŸ” Analyzes Scala code to extract business rules from activity, eligibility, and conversion datasets
  • πŸ“Š Queries metadata from Data Discovery to enrich documentation
  • πŸ“ Generates structured documentation in clear, accessible language
  • πŸ“€ Publishes to Confluence automatically with proper hierarchy and navigation
  • πŸ”„ Detects changes and provides intelligent diff comparisons before updating
  • πŸ“ˆ Maintains version history with semantic versioning

How to use:

  1. Open your Itaipu project in Cursor
  2. Use the command: /clm-doc-creator
  3. Specify a product (e.g., "document nucel") or let it detect from context
  4. Review the generated documentation before publishing

Requirements:

  • Atlassian MCP Server (for Confluence integration)
  • Data Discovery MCP Server (for dataset metadata)

Documentation: docs/agents/clm_doc_creator_agent.md


🐦 Edwiges β€” Cockpit Metric Creator

Domain: Cross-segment (Experimentation)

Edwiges is an AI assistant that guides developers through creating simple metrics in Cockpit (Nu's experimentation platform) in a friendly, step-by-step manner. It helps create User-level Base Metrics (-users, -volume, -value) and ensures Event Logs and necessary records are created following established patterns.

Key Features:

  • 🎯 Guided workflow - Step-by-step interactive process
  • πŸ“Š Multiple metric types - Supports users, volume, and value metrics
  • πŸ—ƒοΈ Event Log creation - Automatically creates Event Logs when needed
  • βœ… Validations - Alerts about potential issues before proceeding
  • πŸ” Dataset validation - Checks dataset sharing and visibility requirements
  • πŸ“ Code generation - Creates production-ready Scala code
  • 🎨 Formatting - Runs code formatting automatically
  • πŸ”„ Multiple metrics - Create multiple metrics in the same session

How to use:

  1. Open your Itaipu project in Cursor
  2. Use the command: /edwiges-cockpit-metric-creator
  3. Follow the interactive prompts step by step
  4. Review the generated code before committing

Supported metric types:

  • Users metrics (-users) - Customer proportion metrics
  • Volume metrics (-volume) - Average frequency metrics
  • Value metrics (-value) - Average value metrics

Documentation: Included in command file


🐦 Papa-LΓ©guas β€” Ranking Strategy Synchronizer

Domain: PJ (Pessoa JurΓ­dica)

Papa-LΓ©guas synchronizes campaign strategies between Scala source files and CSV files. It helps manage Journey Moments, Narratives, and Campaigns across different ranking strategies (Heuristics, Random, and Projota) in a guided and safe manner.

Key Features:

  • πŸ” Consultar (Read) - Export campaign configurations to CSV files
  • βž• Adicionar (Add) - Add new campaigns to ranking strategies
  • πŸ”„ Modificar (Modify) - Update existing campaign configurations
  • ❌ Deletar (Delete) - Remove campaigns from ranking strategies
  • βœ… Validations - Ensures consistency across all ranking strategies
  • πŸ”’ Safe modifications - Preserves code formatting and comments
  • πŸ“‹ PR creation - Automatically creates pull requests with proper approvals

How to use:

  1. Open your Itaipu project in Cursor
  2. Use the command: /papa-leguas-campaign-updater (or invoke the file directly)
  3. Follow the interactive menu in Portuguese
  4. Review changes before confirmation

Supported ranking strategies:

  • Heuristics - Constant scoring strategy
  • Random - Random distribution strategy
  • Projota - Model-based ranking strategy

Documentation: Included in command file


🎯 Commands vs Rules

Feature Commands Rules
Purpose Executable prompts for specific tasks Context & guidelines for AI behavior
Usage Invoke with /command-name Applied automatically or by glob pattern
Scope Task-specific (e.g., create attribute) Domain-wide (e.g., Scala best practices)
Output Code, PRs, changes AI behavior modification

πŸ“– Adding New Agents or Commands

Adding a New Command

  1. Create a new .md file in the appropriate folder:

    • .cursor/commands/core/ β€” Core-specific
    • .cursor/commands/pj/ β€” PJ-specific
    • .cursor/commands/cross-segments/ β€” Cross-segment
  2. Include clear step-by-step instructions for the AI

  3. Test with a real project before committing

Adding a New Rule/Agent

  1. Create a new .md or .mdc file in the appropriate folder:

    • .cursor/commands/core/ β€” Core-specific agents
    • .cursor/commands/pj/ β€” PJ-specific agents
    • .cursor/commands/cross-segments/ β€” Cross-segment agents
  2. For .mdc files, use frontmatter:

---
description: "Brief description of the agent"
globs: ["**/*.scala", "**/pj/**"]
alwaysApply: false
---

# Agent Name

Your agent rules and guidelines...
  1. Test the rule with real projects

πŸ› οΈ Development

Prerequisites

  • Cursor IDE with AI features enabled
  • Access to Nu's internal repositories
  • nu CLI installed

Testing Changes

  1. Make your changes to commands/rules
  2. Install to a test project:
    nu cross-segment-ai-tools commands install ~/dev/nu/test-project
  3. Test the AI assistant behavior
  4. Update if needed

🀝 Contributing

  1. Keep it focused β€” Each command/rule should have a clear, single purpose
  2. Document thoroughly β€” Include examples and expected behavior
  3. Test before submitting β€” Verify with real projects
  4. Follow conventions β€” Match existing naming and structure

πŸ“š Related Resources


πŸ“œ License

This project is part of Nu's internal development ecosystem.

About

AI coding rules and patterns for PJ, Core and High-Income development workflows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •