Agent skill

Smooth Translation

by openforecast-org in openforecast-org/smooth

Port a feature from the R smooth package to the Python port, or check how an R name maps to Python.

LGPL-2.1Auto-check passedWriting & Content

Install Smooth Translation

skills CLI
$ npx skills add openforecast-org/smooth --skill smooth-translation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openforecast-org/smooth smooth-translation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openforecast-org/smooth.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/smooth-translation .claude/skills/smooth-translation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
smooth-translation
GitHub stars
107
Token cost
~2.2k tokens
SKILL.md length
920 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
LGPL-2.1

At a glance

Port a feature from the R smooth package to the Python port, or check how an R name maps to Python.

  • Works in 6 steps: A difference in results is never… → Distributions come from greybox, never… → Never clip, clamp or floor bad numerics.… → …
  • Translating an R function
  • SKILL.md covers Where things live, Name map, Rules the port is held to and Landing a translation
  • Calls ruff and mypy

What it does

Smooth Translation is an agent skill from openforecast-org/smooth. Port a feature from the R smooth package to the Python port, or check how an R name maps to Python. Covers the R↔Python name map for user arguments, fitted attributes, state-space matrices and internal dicts; the R and Python call flows side by side; the parity rules that govern the port (same optimiser, same initialisation, distributions from greybox, no clipping); and the checklist for landing a translation with a test that proves it. Use when translating an R function or argument to Python, when a Python…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Writing & Content, covering Translation and Forecasting and time series. It works with Python and C++. The repository describes itself as: The set of functions used for time series analysis and in forecasting.

When your agent uses it

  • Translating an R function
  • Argument to Python
  • A Python result disagrees with R
  • Looking up what an R name is called on the Python side

Example prompts

  • “/smooth-translation”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. A difference in results is never "optimiser noise". Both languages run
  2. Distributions come from greybox, never re-derived. greybox supplies
  3. Never clip, clamp or floor bad numerics. No np.clip on fitted values,
  4. Match R's error behaviour, not just its results. R stops in
  5. Summation order matters. R's sum() and mean() accumulate in a long
  6. No frequency parameter. Seasonal period is inferred from the data,

What it can do on your machine

Read from SKILL.md and the folder at commit aa89029. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • ruff
    • mypy

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Smooth Translation loads about 2.2k tokens when it runs. Until then it costs about 155 tokens; SKILL.md has 920 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~155
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from openforecast-org/smooth at commit aa89029, republished under its LGPL-2.1 licence (© openforecast-org). 920 words, ~2,212 tokens.

Download SKILL.mdSave it as .claude/skills/smooth-translation/SKILL.md (or your agent's skills folder).
name
smooth-translation
description
Port a feature from the R smooth package to the Python port, or check how an R name maps to Python. Covers the R↔Python name map for user arguments, fitted attributes, state-space matrices and internal dicts; the R and Python call flows side by side; the parity rules that govern the port (same optimiser, same initialisation, distributions from greybox, no clipping); and the checklist for landing a translation with a test that proves it. Use when translating an R function or argument to Python, when a Python result disagrees with R, or when looking up what an R name is called on the Python side.

R → Python translation

The Python port is a numerical port of the R package. Same C++ kernel, same optimiser, same initialisation: on the same data the two are expected to return the same bits, not merely the same answer to a few decimals.

Source of truth is always the code — R/ and python/src/smooth/ — never this file. Read the R implementation before writing the Python one.

Where things live

LayerRPython
User entry pointsR/adam.R, R/adam-es.R, R/adam-ces.R, R/adam-msarima.R, R/adam-sma.R, R/om.R, R/omg.R, R/om-oes.R, R/sm.R, R/msdecompose.Rsmooth.ADAM, ES, CES/AutoCES, MSARIMA/AutoMSARIMA, SMA, OM/OMG/AutoOM, sm, msdecompose
ValidationparametersChecker() in R/adamGeneral.Rcore/checker/ (package)
Architecture / matricesarchitector(), creator(), filler(), initialiser() — locals in R/adam.Rcore/creator/ (package)
Estimation / selectionestimator(), selector() — locals in R/adam.Rcore/estimator/ (package)
Forecastingpreparator(), forecaster() — locals in R/adam.Rcore/forecaster/ (package)
Cost functionsCF(), logLikADAM() — locals in R/adam.Rcore/utils/cost_functions.py
Information criteriaICFunction()core/utils/ic.py
CovariancecovarAnal(), adamVarAnal()core/utils/var_covar.py
Shared C++see the smooth-cpp-shared skill—

checker, creator, estimator and forecaster are packages (directories) on the Python side, not single modules.

Call flow
R    adam() → parametersChecker → architector → creator → initialiser
              → CF (filler + adamCpp$fit) → forecaster

Py   ADAM.fit() → parameters_checker → architector → creator → estimator
                  → initialiser → CF (filler + adam_fitter) → ...
     ADAM.predict() → preparator → forecaster → adam_forecaster

Name map

User arguments
RPython
model, lags, phi, persistence, initial, distribution, loss, ic, bounds, h, holdout, regressorssame names
orders = list(ar=, i=, ma=)orders={"ar": …} or the scalar trio ar_order, i_order, ma_order
xreg / formulaX (positional, on fit)
initialSeason, initialXfolded into initial, which takes a dict of state values as well as a method name (MSARIMA also has initial_X)
lambda (LASSO/RIDGE weight)lambda_param, or **{"lambda": …}. OM / OMG use reg_lambda
silentverbose (inverted)
sm(object, …) + implant(model, scale)model.sm(…) then model.scale_model = scale; = None detaches
Fitted attributes

R exposes model$x; Python uses properties, with a trailing underscore only where the plain name would clash with a constructor argument.

RPython
coef(m)m.coef
logLik(m)m.loglik
nparam(m)m.nparam (m.n_param on CES)
nobs(m)m.nobs
AIC / AICc / BIC / BICcm.aic / m.aicc / m.bic / m.bicc
fitted(m), residuals(m), actuals(m)m.fitted, m.residuals, m.actuals
m$statesm.states
m$persistencem.persistence_vector
m$phim.phi_
m$initialm.initial_value
m$scale (number or scale model)m.scale (always a float) and m.scale_model (model or None)
m$lossValuem.loss_value
m$loss, m$distributionm.loss_, m.distribution_
m$modelm.model_name
m$timeElapsedm.time_elapsed
sigma(m)m.sigma
extractScale(m), extractSigma(m)m.extract_scale(), m.extract_sigma()
pointLik(m)m.point_lik()
forecast(m, h=)m.predict(h=) → ForecastResult with .mean / .lower / .upper

R stores either a number or a model in the single $scale slot and disambiguates with is.scale(). Python keeps the two apart so the return type is stable.

State-space matrices and internal structures
RPython
matVtmat_vt
matFmat_f
matWtmat_wt
vecgvec_g
matxtmat_xt
profilesRecentTableprofiles_recent_table
indexLookupTableindex_lookup_table
lagsModel, lagsModelAlllags_dict
yInSample, yHoldoutobservations_dict
otLogicalobservations_dict["ot_logical"]
Etype, Ttype, Stypemodel_type_dict
initialType, initialValueinitials_dict

R passes state through the calling environment; Python passes explicit dicts. Matrices must stay Fortran (column-major) order for Armadillo.

Coverage

Do not keep a coverage table here — it rots. The maintained answers are:

  • Roadmap — what is R-only (ssarima(), gum()), partial, or not planned.
  • R vs Python differences — measured numerical status, with the scripts that reproduce it.
Show full SKILL.md (455 more words)Show less

Rules the port is held to

  1. A difference in results is never "optimiser noise". Both languages run NLopt on the same loss from the same initialisation, so a materially different optimum is impossible as an optimiser artefact. A real gap means either the initialisation differs (seed, B0, bounds, profile tables) or the two are not fitting the same model (state structure, lags, matrices). The diagnostic that settles it in one step: evaluate the likelihood in both languages at identical parameter values. Equal there means the seed differs; different there means the models differ, and the next move is to print lagsModelAll, the persistence vector and the component counts side by side.
  2. Distributions come from greybox, never re-derived. greybox supplies dnorm/dlaplace/ds/dgnorm/dalaplace/dlnorm/dllaplace/dls/ dlgnorm/dinvgauss/dgamma and their p/q counterparts — the same functions R's smooth calls. Spell out the parameterisation, not the density. The r* draws keep scipy, because greybox's take no random_state.
  3. Never clip, clamp or floor bad numerics. No np.clip on fitted values, no np.maximum(x, 1e-15) inside log(). A -Inf log-likelihood is the optimiser reporting that those parameters are inconsistent with the data. The one legitimate exception is an infeasibility guard at the top of a cost function returning a uniformly large penalty.
  4. Match R's error behaviour, not just its results. R stops in match.arg() on a bad argument; Python should raise, not warn and substitute a default.
  5. Summation order matters. R's sum() and mean() accumulate in a long double register. Where a 1-ulp difference can reorder the optimiser, use the _sum_r / _mean_r helpers in core/utils/, not np.sum.
  6. No frequency parameter. Seasonal period is inferred from the data, lags, or the model spec. The standalone sim_* generators are the documented exception.

Landing a translation

  1. Read the R implementation end to end — arguments, defaults, what it calls, what it returns.
  2. Find where it belongs on the Python side (checker / creator / estimator / forecaster / utils) and whether a partial version already exists.
  3. Mirror the algorithm. Match argument names per the map above; flag any parameter that exists on one side only rather than inventing one.
  4. Prove it against R. Generate the data in one language and read it in the other — never rely on a shared seed, the RNGs differ. Add the test to python/tests/ with the r_parity marker if it shells out to R; those run through tests/_r_bridge.py, which loads the local R source with devtools::load_all() so it always compares against the working tree.
  5. Run ruff check src/, ruff format src/ and mypy src/smooth — all three, every time.
  6. Add a python/NEWS.md entry under the current unreleased version.
  7. If the behaviour is user-visible, update the wiki: the function page, plus Roadmap or R-Python-differences if the parity status moved.

© openforecast-org, LGPL-2.1. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/smooth-translation of openforecast-org/smooth.

Open the folder on GitHubat commit aa89029

Compare with similar skills

Smooth Translation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Smooth Translation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Smooth Translation this skillopenforecast-org/smooth107—~2.2kAutomated safety check: PassLGPL-2.1
Code TranslationArabelaTso/Skills-4-SE253—~3.1kAutomated safety check: PassApache-2.0
Elodin DBelodin-sys/elodin547—~2.9kAutomated safety check: PassApache-2.0
Translationdoxygen/doxygen6.6k—~5.2kAutomated safety check: PassGPL-2.0
China Travel Kittczyliu/china-travel-kit194—~1.3kAutomated safety check: PassMIT
Technology Searchfreestylefly/wesight944—~3.3kAutomated safety check: PassMIT

Similar skills

  • Code Translation

    ArabelaTso/Skills-4-SE

    Convert code between programming languages while preserving functionality and semantics.

    253 GitHub stars~3.1k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Elodin DB

    elodin-sys/elodin

    Work with Elodin-DB, the time-series telemetry database. An agent skill from elodin-sys/elodin.

    547 GitHub stars~2.9k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Translation

    doxygen/doxygen

    Keeps all Doxygen and Doxywizard translations up to date across three mechanisms: translator C++ classes (src/translatorxx.h), Qt .ts locale files for the Doxywizard GUI (addon/doxywizard/i18n/)…

    6.6k GitHub stars~5.2k tokensUpdated 9 days ago
    Writing & ContentAuto-check passed
  • China Travel Kit

    tczyliu/china-travel-kit

    Research and plan first-time independent trips in China with bilingual, source-aware city data and official live-check entry points.

    194 GitHub stars~1.3k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Technology Search

    freestylefly/wesight

    Search tech blogs, developer forums, and IT media (TechCrunch, Hacker News, 36氪, etc.) for software and hardware industry updates with heat ranking and EN↔CN translation.

    944 GitHub stars~3.3k tokensUpdated 8 days ago
    Writing & ContentAuto-check passed
  • Stata C Plugins

    dylantmoore/stata-skill

    Develop high-performance C/C++ plugins for Stata using the stplugin.h SDK.

    291 GitHub starsUsed in 1 repo~5.8k tokens
    Research & ScienceAuto-check passed

More from openforecast-org/smooth

  • Smooth Cpp Shared

    openforecast-org/smooth

    Work on the C++ layer that the R package and the Python port share — the headers under src/headers/, the Rcpp bindings in src/, the pybind11 bindings in src/python/, and the two build systems that…

    107 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Smooth Translation

What does Smooth Translation do?

Port a feature from the R smooth package to the Python port, or check how an R name maps to Python. Smooth Translation is an agent skill from openforecast-org/smooth. Port a feature from the R smooth package to the Python port, or check how an R name maps to Python.

When should I use Smooth Translation?

Smooth Translation fits situations like: translating an R function; argument to Python; A Python result disagrees with R; looking up what an R name is called on the Python side.

How do I install Smooth Translation in Claude Code?

Run `npx skills add openforecast-org/smooth --skill smooth-translation -a claude-code`. Or copy the skill folder (.claude/skills/smooth-translation in openforecast-org/smooth) into .claude/skills/smooth-translation in your project. Claude Code loads it when a task matches its description.

How do I install Smooth Translation in Codex?

Run `npx skills add openforecast-org/smooth --skill smooth-translation -a codex`. Or copy the skill folder (.claude/skills/smooth-translation in openforecast-org/smooth) into .agents/skills/smooth-translation in your project. Codex loads it when a task matches its description.

Can I use Smooth Translation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openforecast-org/smooth --skill smooth-translation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/smooth-translation, .gemini/skills/smooth-translation, .github/skills/smooth-translation and .opencode/skills/smooth-translation in your project.

What does Smooth Translation need to run?

Going by SKILL.md and its folder, Smooth Translation needs the command-line tools its instructions call (ruff and mypy). Our summary lists: Python 3.

Does Smooth Translation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Smooth Translation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Smooth Translation use?

Smooth Translation is published under the LGPL-2.1 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Smooth Translation use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Smooth Translation?

Skills that share tags, products or a category with Smooth Translation: Code Translation (ArabelaTso/Skills-4-SE, 253 stars), Elodin DB (elodin-sys/elodin, 547 stars), Translation (doxygen/doxygen, 6.6k stars) and China Travel Kit (tczyliu/china-travel-kit, 194 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Smooth Translation?

openforecast-org (a GitHub organization) maintains it in openforecast-org/smooth, which has 107 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: openforecast-org/smooth on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.