Database Code One Task

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Generate the query/queries a single database plan task calls for, execute the ones that are safe to execute, and leave a clear record of both in database-report.md.

Purpose

iru-database-code-one-task is the database counterpart to iru-java-code-one-task/iru-dotnet-code-one-task, but its deliverable is usually not application source code — it’s the query text itself, grounded in the actual schema rather than invented table/column names, plus real results wherever it’s safe to obtain them. It reuses this conversation’s own iru-explore findings (or runs iru-explore fresh if none exist yet) to ground each query in the real database engine, schema, and ticket context, classifies every generated query as read-only/idempotent or a write, and — only for the read-only ones, and only if a matching database MCP is connected — executes it and captures what comes back. Write queries are always generated but never executed, since a properly configured database MCP is expected to reject them by design. Everything lands in database-report.md, ending with a reminder that the user should verify its contents and that committing it is a decision for a later step.

Invocation

/iru-database-code-one-task <task description>

Inputs

Argument Required Description Default

task description

Yes

The task’s own text: the operation requested, the named table(s)/collection(s)/field(s), and any sub-tasks.

None — this skill has nothing to do without a task to implement.

Outputs

  • The query/queries the task calls for, written in the query language matching the detected database engine (SQL for relational engines, MongoDB query/aggregation syntax, N1QL for Couchbase, etc.), grounded in the real schema.

  • Each query classified as read-only/idempotent or write.

  • For read-only queries, if a matching database MCP is connected: the query executed and its returned data (or error) captured. Write queries are always generated only, never executed.

  • database-report.md at the repository root, created or appended to, with one entry per query: its text, classification, and (if executed) the data returned or the error.

  • Every query, and any data returned, shown to the user directly in the conversation.

  • A reminder to the user to verify database-report.md’s contents, and that whether to commit it is a decision for a later step — this skill never runs `git add/git commit itself.

  • A short summary handed back to the caller: queries generated, read-only vs. write counts, how many were executed (and against which engine/MCP) vs. skipped and why, and whether the task stopped on a blocker.

Execution flow

flowchart TD A["Start /database-code-one-task\n(task description)"] --> B{Explore findings already\nin this conversation?} B -- yes --> D["Reuse explore's Tech stack\n+ ticket context"] B -- no --> C["Run explore fresh"] C --> D D --> E["Read real schema artifacts:\nmigrations, ORM models, schema dumps,\nconnection config"] E --> F{Task names a table/field\nthat doesn't really exist?} F -- yes, not trivial --> G["Blocked: report and stop"] F -- no --> H["Generate the requested query/queries\nin the detected engine's language"] H --> I["Classify each query:\nread-only/idempotent vs. write"] I --> J{Matching database MCP connected?} J -- no --> K["All queries generated-only"] J -- yes --> L["Execute read-only queries via MCP;\ncapture data/errors. Write queries\nremain generated-only"] K --> M["Write/append database-report.md"] L --> M M --> N["Show queries + any data\nto the user"] N --> O["Remind user to verify report;\ncommit decision deferred"] O --> P["Report outcome to caller"]

Dependencies

Invokes

  • Explore — reused from earlier in the conversation if it already ran, or run fresh otherwise, to ground the query/queries in the real schema, database engine, and any ticket context.

Invoked by

None — this skill calls iru-explore directly via the Skill tool and any database MCP tools directly, without a sub-agent wrapper.

Source

SKILL.md on GitHub — the file this page was generated from.