File scalar compute

From XuShuwenn/RedAct · View interactive version

File scalar compute is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Compute a single scalar (e.g., a dimensionless number) from parameters in an input file and write a strictly formatted, rounded result to an output file.

How to use this skill

Skill file

File-Driven Scalar Computation

Use this skill to read a small set of parameters from an input file, compute a single scalar via a given formula, then write the result with exact formatting and rounding (e.g., computing a Nusselt number from h, k, D).

When to Use

Activate this skill when the task specifies:

Examples: Nusselt number (h·D/k), Reynolds number (ρ·V·D/μ), or other one-line engineering metrics.

Core Workflow

  1. Read the input file
  1. Parse required parameters
  1. Validate inputs
  1. Compute the scalar
  1. Round and format
  1. Write the output
  1. Verify

Worked Pattern: Nusselt Number

Verification Checklist

Common Pitfalls and How to Avoid Them

Optional Script Usage

You can use the helper script to robustly parse key-value parameters from the input file and return JSON for downstream use.

Example:

Minimal formatting snippet for two decimals:

value_str = f"{value:.2f}"

Success criteria: the output file contains exactly one line with the correct label and a correctly rounded numeric value with the required decimal places.

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.