Formula from file

From XuShuwenn/RedAct · View interactive version

Formula from file is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Calculate a scalar from parameters in an input file using a specified formula, then write a precisely formatted, rounded result to an output file.

How to use this skill

Skill file

Compute a Formula Result from File Parameters

Use this skill when a task provides named parameters in a text file, specifies a mathematical formula to compute a single numeric result, and requires writing that result to an output file with exact formatting and rounding rules.

When to Use

Activate this skill when the task:

Core Workflow

  1. Extract Requirements
  1. Read the Input File
  1. Parse Parameters Robustly
  1. Compute the Formula Safely
  1. Apply Rounding Rules
  1. Format the Output Exactly
  1. Write and Verify

Verification

Before finalizing, confirm all of the following:

Optional automated checks:

Common Pitfalls and How to Avoid Them

Optional Script Usage

You can use the helper script to compute a formula from a parameter file with strict parsing, safe evaluation, decimal rounding, and exact output formatting.

Example usage pattern (replace paths, label, expression, and precision as required by the task):

Success criteria: the output file contains exactly one line with the correct label and a number rounded to the specified decimals, followed by a newline, matching a recomputation from the parsed inputs.

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.