business-log-skill

Log business operations in-transaction with TxSave and Query for GORM databases.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/Penitence1992/go-zero-backend-skills --skill business-log-skill
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: business-log-skill
Source: https://github.com/Penitence1992/go-zero-backend-skills/tree/main/skills/business-log-skill
Command: npx skills add https://github.com/Penitence1992/go-zero-backend-skills --skill business-log-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables reliable in-transaction logging of business operations for audit, change tracking, and data recovery within transactional workflows.

Core Features & Use Cases

  • In-transaction log recording: persist BusinessOpLog entries alongside business data inside a transaction.
  • Log querying: fetch logs by businessId or type to support auditing and traceability.
  • Structured data: log entries store business_id, business_type, operate_type, and Data payload for flexible analysis.

Quick Start

Use the business-log-skill to wrap your business operation inside a transaction and call TxSave to persist logs, then query results with Query for auditing.

Frequently Asked Questions about business-log-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I record business operation logs within a database transaction for auditing?▼

To record business operation logs within a database transaction for auditing, use the TxSave service to persist structured BusinessOpLog entries alongside your business data inside a single commit. This ensures logs and business changes are saved atomically.

Does GORM support in-transaction logging for change tracking and data recovery?▼

Yes, GORM supports in-transaction logging for change tracking and data recovery. This Skill integrates directly with GORM-backed databases, allowing you to wrap operations in a transaction and persist structured log entries atomically within the same commit.

What is the best way to query operation logs by business ID for traceability?▼

The best way to query operation logs by business ID for traceability is using the Query service. It fetches persisted log entries by filtering on business_id or business_type, enabling flexible analysis and auditing of past in-transaction operations.

What structured data does an in-transaction audit log need for flexible analysis?▼

An in-transaction audit log needs structured data fields including business_id, business_type, operate_type, and a Data payload. Storing these specific fields in each BusinessOpLog entry ensures operations are traceable and supports flexible querying for audits.

Can I use this transactional log service without a GORM-backed database setup?▼

No, you cannot use this transactional log service effectively without a GORM-backed database setup. The TxSave and Query functions are specifically designed to integrate with GORM to guarantee that business operations and audit logs share the same transactional commit.