Validate and report completed external workflow usage to LoopForge
Validate a host-supplied terminal execution summary, report attributable model usage to LoopForge, and preserve stable execution IDs for safe retries.
npx skills add agentskillexchange/skills --skill validate-and-report-completed-external-workflow-usage-to-loopforge
Invoke LoopForge’s bundled report-workflow-usage skill after an external agent workflow has finished, when its real model usage needs to appear in a configured LoopForge project’s analytics. The input is a host-produced JSON summary for exactly one succeeded, failed or cancelled execution, with stable record and execution identifiers, timestamps, workflow identity and per-provider/model token counts.
What this skill actually does
Obtain the skills/report-workflow-usage directory from the official repository and follow its contract and workflow-integration references. Python 3 is sufficient for its standard-library reporting script. The operator must already have a LoopForge instance and project-scoped data-source token configured. The host supplies AGENTFLOW_USAGE_FILE, AGENTFLOW_URL and the secret environment variable AGENTFLOW_INSIGHT_TOKEN. Keep the credential out of prompts, arguments and logs.
Run python3 /absolute/path/to/report-workflow-usage/scripts/report_usage.py --check to validate the designated file without a network call or credential. If valid and the reporting step is authorized, invoke the same script without --check. Return the accepted or duplicate receipt, record ID and external execution ID. Preserve the original input and identifiers for retries; investigate conflicting records instead of inventing a new ID. Missing actual token counts stop reporting; unknown cost can remain null with unknown status.
This workflow records completed external execution facts. It does not execute or resume jobs, provision data sources, infer missing usage, change the business outcome or report native LoopForge runs again. To include the final agent’s complete usage, the host must invoke the script after that agent exits. The procedure is portable across agent runtimes because the host supplies a common JSON contract.