⚙️ Librarian Indexer

22installs

Meta-skill that indexes, optimizes, and auto-generates Claude skills with GitOps automation, OCA GitHub bot integration, and Odoo developer tools. Use for skill creation, CI/CD workflows, OCA module management, and advanced Odoo development.

QUICK INSTALL
npx playbooks add skill jgtolentino/insightpulse-odoo --skill librarian-indexer

Librarian Indexer instructions

Librarian Indexer Skill v2.0

Purpose

Advanced meta-skill that combines knowledge base optimization, skill auto-generation, GitOps automation, OCA GitHub bot workflows, and Odoo developer mode expertise for maximum development efficiency.

Version History

v2.0.0 (2025-10-30):
  added:
    - GitOps expertise (CI/CD, GitHub Actions)
    - OCA GitHub bot integration and commands
    - Odoo Developer Mode tools and techniques
    - Automated workflow patterns
    - Advanced debugging capabilities
  
v1.0.0 (2025-10-30):
  - Initial release
  - Core skill templates
  - Knowledge base optimization
  - Skill taxonomy

Core Functions

1. Skill Taxonomy & Indexing

Automatically catalog all skills with metadata:

  • Category: Technical, Business, Integration, Domain-Specific
  • Dependencies: Which skills/tools/APIs this skill relies on
  • Cross-references: Related skills, overlapping functionality
  • Complexity: Beginner, Intermediate, Advanced, Expert
  • Update frequency: Static knowledge vs. rapidly evolving domains
  • GitOps: CI/CD pipeline requirements, automated testing

2. GitOps Expertise

CI/CD Pipeline Architecture
github_actions_workflows:
  
  module_testing:
    name: "Test Odoo Module"
    trigger: [push, pull_request]
    steps:
      - checkout_code
      - setup_odoo_environment
      - install_dependencies
      - run_unit_tests
      - run_integration_tests
      - generate_coverage_report
    best_practices:
      - Use OCA's maintainer-tools for testing
      - Test against multiple Odoo versions
      - Cache dependencies for speed
      - Fail fast on critical errors
  
  docker_build_push:
    name: "Build and Push Docker Image"
    trigger: [push_to_main, release]
    steps:
      - checkout_code
      - setup_docker_buildx
      - login_to_registry
      - build_multi_arch_image  # AMD64, ARM64
      - push_to_dockerhub
      - create_github_release
    best_practices:
      - Use multi-stage builds
      - Tag with version + latest
      - Sign images for security
      - Use BuildKit for caching
  
  oca_bot_integration:
    name: "OCA Bot Automated Workflows"
    trigger: [pull_request_review, schedule]
    commands:
      - /ocabot merge [major|minor|patch|nobump]
      - /ocabot rebase
      - /ocabot migration <module_name>
    automation:
      - Auto-generate README.rst from fragments
      - Auto-generate addon icons
      - Auto-update setup.py
      - Auto-approve with 2+ approvals
      - Auto-merge after 5 days + green CI
  
  deployment_pipeline:
    name: "Deploy to Production"
    trigger: [release, manual_dispatch]
    environments: [staging, production]
    steps:
      - run_all_tests
      - build_docker_image
      - push_to_registry
      - deploy_to_staging
      - run_smoke_tests
      - manual_approval
      - deploy_to_production
      - rollback_on_failure
Git Workflow Patterns
# OCA-compliant Git workflow

# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/OCA_REPO.git
cd OCA_REPO
git remote add upstream https://github.com/OCA/OCA_REPO.git

# 2. Create feature branch from target version
git checkout -b 19.0-feat-new-feature origin/19.0

# 3. Make changes following OCA conventions
# - One commit per logical change
# - Conventional commit messages: feat:, fix:, docs:, etc.
# - Sign commits: git commit -s

# 4. Pre-commit hooks (OCA maintainer-tools)
pre-commit install
pre-commit run --all-files

# 5. Push and create PR
git push origin 19.0-feat-new-feature
# Create PR via GitHub UI targeting OCA/19.0

# 6. Use OCA bot commands in PR
# /ocabot merge minor  (auto-merge with version bump)
# /ocabot rebase       (rebase on target branch)
# /ocabot migration module_name  (track migration)

# 7. After merge, sync fork
git checkout 19.0
git fetch upstream
git merge upstream/19.0
git push origin 19.0
GitHub Actions Templates
# .github/workflows/test.yml
name: Test Odoo Modules

on:
  push:
    branches: [19.0, 18.0]
  pull_request:
    branches: [19.0, 18.0]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        odoo-version: ['19.0']
        python-version: ['3.11']
    
    services:
      postgres:
        image: postgres:15
        env:
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          
      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
          
      - name: Install OCA maintainer-tools
        run: |
          git clone https://github.com/OCA/maintainer-tools.git
          cd maintainer-tools
          pip install -r requirements.txt
          
      - name: Install Odoo
        run: |
          git clone --depth=1 --branch=${{ matrix.odoo-version }} https://github.com/odoo/odoo.git
          pip install -r odoo/requirements.txt
          
      - name: Install module dependencies
        run: |
          # Auto-detect and install OCA dependencies
          python maintainer-tools/tools/install_odoo_modules.py
          
      - name: Run tests
        run: |
          export ODOO_RC=/dev/null
          python -m pytest tests/ --cov=. --cov-report=xml
          
      - name: Upload coverage
        uses: codecov/codecov-action@v3
        with:
          file: ./coverage.xml

# .github/workflows/dockerhub-publish.yml
name: Build and Push Docker Image

on:
  push:
    branches: [main]
    tags: ['v*']
  release:
    types: [published]

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
        
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
        
      - name: Login to DockerHub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          
      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: yourorg/insightpulse-odoo
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            
      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          context: .
          platforms: linux/amd64,linux/arm64
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

3. OCA GitHub Bot Integration

Bot Commands
# Available commands in OCA repositories

# Merge with version bump
/ocabot merge major     # Breaking changes (1.0.0 -> 2.0.0)
/ocabot merge minor     # New features (1.0.0 -> 1.1.0)
/ocabot merge patch     # Bug fixes (1.0.0 -> 1.0.1)
/ocabot merge nobump    # No version change (tests, docs)

# Rebase PR on target branch
/ocabot rebase

# Track module migration
/ocabot migration account_payment_order
# Links PR to migration issue for version tracking

# Bot will automatically:
# ✅ Merge when CI is green and approved
# ✅ Bump version in __manifest__.py
# ✅ Update CHANGELOG with oca-towncrier
# ✅ Generate wheels and upload to PyPI
# ✅ Run all post-merge operations
Bot Automated Operations

Webhooks (Real-time):

on_pull_request_opened:
  - mention_maintainers  # @-mention addon maintainers
  - call_for_maintainers # If no maintainers, ask for volunteers
  
on_pull_request_approved:
  - set_approved_label  # When 2+ approvals
  - set_ready_to_merge_label  # When >5 days old
  
on_ci_success:
  - set_needs_review_label  # Unless "wip:" in title
  
on_merge:
  - delete_pr_branch  # Auto-cleanup
  - bump_version  # If requested
  - update_changelog  # With oca-towncrier
  - generate_wheel  # Upload to PyPI

Scheduled Tasks (Nightly):

daily_maintenance:
  - update_readme_table  # Addons table in README.md
  - generate_addon_readme  # From readme/ fragments
  - generate_addon_icons  # Default OCA icon if missing
  - update_setup_py  # Via setuptools-odoo-make-defaults
  - generate_wheels  # For all addons
  - upload_to_pypi  # Or rsync to PEP 503 index
Setting Up OCA Bot for Your Org
# 1. Clone and configure
git clone https://github.com/OCA/oca-github-bot.git
cd oca-github-bot

# 2. Create .env file
cp environment.sample .env

# Edit .env with your settings:
GITHUB_TOKEN=ghp_xxxxx  # GitHub PAT with repo access
GITHUB_SECRET=your_webhook_secret
BOT_TASKS=all  # Or specific tasks
BOT_TASKS_DISABLED=  # Tasks to disable

# 3. Docker Compose deployment
docker-compose up -d

# Services started:
# - Bot webhook server (port 8080)
# - Celery worker (task processor)
# - Celery beat (scheduler)
# - Flower (monitoring at port 5555)
# - Redis (message queue)

# 4. Configure GitHub webhook
# URL: https://your-bot-url.com/webhooks
# Content type: application/json
# Secret: [value from GITHUB_SECRET]
# Events: All or specific (pull_request, push, etc.)

# 5. Test locally with ngrok
ngrok http 8080
# Use ngrok URL for GitHub webhook during development
Custom Bot Tasks
# src/oca_github_bot/tasks/custom_validation.py

from celery import task
from ..github import gh_call

@task()
def validate_module_structure(org, repo, pr_number):
    """Custom task: Validate Odoo module structure"""
    
    # Get PR files
    files = gh_call(f'repos/{org}/{repo}/pulls/{pr_number}/files')
    
    required_files = [
        '__manifest__.py',
        '__init__.py',
        'README.rst',
        'security/ir.model.access.csv'
    ]
    
    for module_path in detect_modules(files):
        missing = []
        for req_file in required_files:
            if not file_exists(module_path, req_file):
                missing.append(req_file)
        
        if missing:
            # Post comment on PR
            gh_call(
                f'repos/{org}/{repo}/issues/{pr_number}/comments',
                method='POST',
                data={
                    'body': f'⚠️ Module `{module_path}` is missing: {", ".join(missing)}'
                }
            )
            return False
    
    return True

4. Odoo Developer Mode

Activation Methods
# Method 1: Settings app
# Settings → Developer Tools → Activate the developer mode

# Method 2: URL parameter
https://example.odoo.com/odoo?debug=1      # Standard mode
https://example.odoo.com/odoo?debug=assets # With JS assets
https://example.odoo.com/odoo?debug=tests  # With test tours
https://example.odoo.com/odoo?debug=0      # Deactivate

# Method 3: Command palette (Ctrl+K or Cmd+K)
# Type "debug" → select activation mode

# Method 4: Browser extension
# Chrome: https://chromewebstore.google.com/detail/odoo-debug/...
# Firefox: https://addons.mozilla.org/firefox/addon/odoo-debug/
Developer Mode Tools

View Architecture:

# In any view, click "Developer Mode" menu
→ Edit View: Form / Tree / Kanban / etc.
→ View Fields: See all field definitions
→ View Metadata: Created, modified, version info
→ Manage Filters: Edit search filters
→ Edit Action: Modify window actions
→ Edit Workflow: (Legacy) View state transitions

# Access technical info on any field
→ Hover over field → See technical name
→ Right-click field → "View Field"
  - Name: account_id
  - Model: account.move
  - Type: many2one
  - Widget: many2one
  - Required: True
  - Readonly: False

Database Tools:

# Technical Menu Access
Settings → Technical

# Key sections:
Database Structure/
  ├── Models          # All Odoo models (res.partner, sale.order, etc.)
  ├── Fields          # Field definitions across all models
  ├── Menu Items      # Application menu structure
  ├── Views           # Form, tree, kanban, search views
  ├── Actions         # Window actions, server actions, reports
  ├── Translations    # i18n strings
  └── Parameters      # System parameters (ir.config_parameter)

Sequences/
  └── Sequences       # Number sequences (SO001, INV/2024/0001, etc.)

Automation/
  ├── Scheduled Actions (Cron)  # Background jobs
  ├── Automation Rules          # Trigger-based automation
  └── Server Actions            # Python code execution

Security/
  ├── Users & Companies
  ├── Groups                    # Access groups
  ├── Access Rights             # Model-level (ir.model.access)
  ├── Record Rules              # Row-level security
  └── Access Control Lists      # File access

Python Debugging:

# In Odoo shell or code

# 1. Enable debug mode programmatically
self.env.user.write({'debug': True})

# 2. Debug ORM queries
import logging
_logger = logging.getLogger(__name__)

# Log SQL queries
_logger.setLevel(logging.DEBUG)
self.env['sale.order'].search([('state', '=', 'draft')])
# SQL: SELECT "sale_order".id FROM "sale_order" WHERE ...

# 3. Inspect recordsets
order = self.env['sale.order'].browse(1)
_logger.info(f"Order: {order}")
_logger.info(f"Fields: {order.fields_get()}")
_logger.info(f"Values: {order.read()}")

# 4. Test computed fields
order._compute_amount_total()

# 5. Check access rights
self.env['sale.order'].check_access_rights('write', raise_exception=False)
order.check_access_rule('write')

# 6. View active context
_logger.info(f"Context: {self.env.context}")

# 7. Use debugger breakpoints
import pdb; pdb.set_trace()
# Or use built-in debugger in IDE

XML ID Inspector:

# Find XML ID for any record

# Method 1: Developer mode menu
→ View Metadata → External ID

# Method 2: Python
record = self.env['res.partner'].browse(1)
xml_id = record.get_external_id()
# Returns: {'1': 'base.main_partner'}

# Method 3: Search by XML ID
partner = self.env.ref('base.main_partner')

# Method 4: Create with XML ID
self.env['ir.model.data'].create({
    'module': 'my_module',
    'name': 'partner_demo',
    'model': 'res.partner',
    'res_id': partner.id,
})

Performance Profiling:

# Enable profiling in odoo.conf
[options]
limit_time_cpu = 3600
limit_time_real = 7200
log_level = debug
log_db = True
log_db_level = debug

# Or via URL
?debug=1&profile=1

# View profiles at:
# /web/profiler

# Python profiling
import cProfile
import pstats

profiler = cProfile.Profile()
profiler.enable()

# Your code here
self.env['sale.order'].search([])

profiler.disable()
stats = pstats.Stats(profiler)
stats.sort_stats('cumulative')
stats.print_stats(20)  # Top 20 slow functions

5. Knowledge Base Optimization

Information Architecture Patterns

Pattern 1: API-First Documentation
Best for: Odoo, OCA, Salesforce, SAP

Structure:
1. Quick Reference (most common operations)
2. API Endpoints/Methods (with examples)
3. Data Models/Schema
4. Integration Patterns
5. GitOps/CI-CD workflows
6. Troubleshooting Guide
7. Deep Reference (comprehensive docs)

Pattern 2: Decision Tree Format
Best for: Module selection, architecture decisions

Structure:
1. Decision flowchart (IF/THEN logic)
2. Comparison matrices
3. Use case mappings
4. Cost/benefit analysis
5. Implementation priorities
6. GitOps automation opportunities

Pattern 3: Recipe Book
Best for: Deployment, automation, scripts

Structure:
1. Prerequisites checklist
2. Step-by-step instructions (copy-paste ready)
3. Configuration templates
4. GitHub Actions workflows
5. OCA bot commands
6. Validation steps
7. Common pitfalls & solutions
8. Real examples from your stack

6. Skill Generation Templates

Template A: SaaS Replacement Skill
# [SaaS Product] → Odoo Replacement

## Gap Analysis
- Feature comparison matrix
- OCA module coverage
- Custom module requirements
- GitOps considerations

## Implementation Guide
- Module installation order
- Configuration steps
- Integration points (Supabase, Superset, Notion)
- CI/CD pipeline setup

## Migration Path
- Data export from SaaS
- Import scripts/mappings
- User training plan
- Rollback strategy

## GitOps Automation
- GitHub Actions workflows
- Automated testing
- Deployment pipelines
- OCA bot integration

## Cost Savings
- Annual licensing: $XXX
- Self-hosted cost: $XX
- Net savings: $XXX

## Maintenance
- Update schedule
- Backup strategy
- Monitoring setup
- Support resources
Template B: GitOps Workflow Skill
# [Project] GitOps Automation

## Repository Structure
- Branch strategy
- Commit conventions
- PR templates
- Code review process

## CI/CD Pipeline
- Test workflows
- Build processes
- Deployment stages
- Rollback procedures

## OCA Bot Integration
- Webhook configuration
- Automated tasks
- Bot commands
- Custom workflows

## Monitoring
- GitHub Actions logs
- Deployment metrics
- Error tracking
- Performance monitoring
Template C: Odoo Development Skill
# [Module/Feature] Development Guide

## Developer Mode Setup
- Activation methods
- Debugging tools
- Performance profiling

## Module Structure
- Required files
- Naming conventions
- OCA compliance

## Development Workflow
- Local development setup
- Git workflow with OCA bot
- Testing strategy
- CI/CD integration

## Debugging Techniques
- ORM query inspection
- Computed field testing
- Access rights validation
- XML ID management

7. Skill Dependency Mapping

skill_dependencies:
  odoo-finance-automation:
    requires:
      - odoo19-oca-devops (deployment)
      - supabase-rpc-manager (database)
      - paddle-ocr-validation (document processing)
      - gitops-odoo (CI/CD workflows)
      - oca-bot-integration (automated merges)
    integrates_with:
      - superset-dashboard-automation (reporting)
      - notion-workflow-sync (task management)
      - travel-expense-management (AP integration)
    gitops:
      - .github/workflows/test-finance-module.yml
      - .github/workflows/deploy-finance.yml
    
  oca-module-development:
    requires:
      - gitops-odoo (GitHub Actions)
      - oca-bot-integration (merge automation)
      - odoo-developer-mode (debugging)
    tools:
      - pre-commit hooks
      - OCA maintainer-tools
      - pytest for testing
    workflows:
      - Fork → Feature branch → PR → OCA bot → Merge

8. GitOps Best Practices

Repository Organization
odoo-project/
├── .github/
│   ├── workflows/
│   │   ├── test.yml                 # Run tests on PR
│   │   ├── deploy-staging.yml       # Auto-deploy to staging
│   │   ├── deploy-production.yml    # Manual production deploy
│   │   ├── oca-bot-sync.yml         # Sync with OCA upstream
│   │   └── security-scan.yml        # Dependency vulnerabilities
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── ISSUE_TEMPLATE/
│       ├── bug_report.md
│       └── feature_request.md
├── .pre-commit-config.yaml          # Code quality checks
├── .dockerignore
├── .gitignore
├── docker-compose.yml               # Local development
├── docker-compose.prod.yml          # Production config
├── Dockerfile                       # Multi-stage build
├── odoo.conf                        # Odoo configuration
├── requirements.txt                 # Python dependencies
└── addons/                          # Custom and OCA modules
    ├── custom_module_1/
    ├── custom_module_2/
    └── README.md
Pre-commit Configuration
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.