Antigravity base

From boisenoise/skills-collections · View interactive version

Antigravity base is an AI agent skill from the GitHub repository boisenoise/skills-collections. Database management, forms, reports, and data operations with LibreOffice Base.

How to use this skill

Skill file

LibreOffice Base

Overview

LibreOffice Base skill for creating, managing, and automating database workflows using the native ODB (OpenDocument Database) format.

When to Use This Skill

Use this skill when:

Core Capabilities

1. Database Creation

2. Data Operations

3. Form and Report Automation

4. Query and SQL

5. Integration

Workflows

Creating a New Database

Method 1: Command-Line
soffice --base
Method 2: Python with UNO
import uno

def create_database():
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=127.0.0.1,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", ctx)
    doc = desktop.loadComponentFromURL("private:factory/sdatabase", "_blank", 0, ())
    doc.storeToURL("file:///path/to/database.odb", ())
    doc.close(True)

Connecting to External Database

import uno

def connect_to_mysql(host, port, database, user, password):
    local_ctx = uno.getComponentContext()
    resolver = local_ctx.ServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", local_ctx
    )
    ctx = resolver.resolve(
        "uno:socket,host=127.0.0.1,port=8100;urp;StarOffice.ComponentContext"
    )
    smgr = ctx.ServiceManager
    
    desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", ctx)
    doc = desktop.loadComponentFromURL("private:factory/sdatabase", "_blank", 0, ())
    datasource = doc.getDataSource()
    datasource.URL = f"sdbc:mysql:jdbc:mysql://{host}:{port}/{database}"
    datasource.User = user
    datasource.IsPasswordRequired = True  # supply password at connection time; do not persist it
    
    doc.storeToURL("file:///path/to/connected.odb", ())
    return doc

Database Connection Reference

Supported Database Types

Connection Strings

# MySQL
sdbc:mysql:jdbc:mysql://localhost:3306/database

# PostgreSQL
sdbc:postgresql://localhost:5432/database

# SQLite
sdbc:sqlite:file:///path/to/database.db

# ODBC
sdbc:odbc:DSN_NAME

Command-Line Reference

soffice --headless
soffice --base  # Base

Python Libraries

pip install pyodbc    # ODBC connectivity
pip install sqlalchemy # SQL toolkit

Best Practices

  1. Use parameterized queries
  2. Create indexes for performance
  3. Backup databases regularly
  4. Use transactions for data integrity
  5. Keep private versioned backups; do not commit database contents or credentials
  6. Document database schema
  7. Use appropriate data types
  8. Handle connection errors gracefully

Troubleshooting

Cannot open socket

# Inspect the listener and stop only the task-owned process after saving its documents.
soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;"

Connection Issues

Resources

Related Skills

Limitations

Automation and document limits

Verify the actual LibreOffice version, filters, Python UNO binding and database drivers; installing unrelated Python libraries does not provide UNO. Bind any UNO listener to loopback in a separate task-owned profile and stop it after use; UNO is not an authenticated sandbox. Do not terminate all office processes or expose the listener publicly. Use a fresh private output directory, check expected file type/nonempty output and inspect the rendered result; exit zero alone is insufficient.

Opening documents can invoke macros, external links or embedded content: use approved inputs with macros/updates disabled and isolate untrusted conversions. Format conversion may lose layout, formulas, links, notes, multiple sheets/pages or features. Retain originals, clarify CSV sheet/delimiter/encoding and preserve formula/identifier semantics. Do not automatically install packages, publish documents or put sensitive records in Git. These examples were statically reviewed only; no LibreOffice process or conversion was run.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.