gradient-methods

gradient-methods is a skill for Claude Code from foryourhealth111-pixel/Vibe-Skills. It costs 12 tokens per session (1,054 once invoked), scanned A, a copy of gradient-methods, Apache-2.0.

A guide to gradient-based optimization methods, which improve a solution by repeatedly using the slope of a function. It covers methods such as gradient descent, momentum, Newton's method, and conjugate gradient.

In plain words
What is it for?
Use it to solve mathematical optimization problems, select step-size rules, and diagnose slow, unstable, or incomplete convergence.
Why use it?
It helps choose a suitable optimization method and step size instead of relying on trial and error. It also explains how to check whether the method is converging.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Good fit Use it to solve mathematical optimization problems, select step-size rules, and diagnose slow, unstable, or incomplete convergence.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/foryourhealth111-pixel/vibe-skills/gradient-methods
About the project

Vibe-Skills is a collection and routing system that helps AI agents discover, select, and coordinate specialized skills for completing tasks. It is intended for agents that need to organize workflows across many installed capabilities. The catalogue entries are skills and an agent belonging to this system.

foryourhealth111-pixel/Vibe-Skills · 3,252 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add foryourhealth111-pixel/Vibe-Skills --skill gradient-methods
Clone the repo
git clone --depth 1 https://github.com/foryourhealth111-pixel/Vibe-Skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gradient-methods

README.md
[![agentmods](https://agentmods.dev/badge/skills/foryourhealth111-pixel/vibe-skills/gradient-methods/github.svg)](https://agentmods.dev/skills/foryourhealth111-pixel/vibe-skills/gradient-methods)
Your own site
<a href="https://agentmods.dev/skills/foryourhealth111-pixel/vibe-skills/gradient-methods"><img src="https://agentmods.dev/badge/skills/foryourhealth111-pixel/vibe-skills/gradient-methods/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gradient-methods

Your own site · 80×15
<a href="https://agentmods.dev/skills/foryourhealth111-pixel/vibe-skills/gradient-methods"><img src="https://agentmods.dev/badge/skills/foryourhealth111-pixel/vibe-skills/gradient-methods.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.01054
Opus 5 $0.00006 $0.00527
Sonnet 5 $0.00002 $0.00211
Haiku 4.5 $0.00001 $0.00105

Measured 8d ago against content hash c32ac8806dba, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

gradient-methods scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to gradient-methods — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

bundled/skills/gradient-methods/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gradient Methods

When to Use

Use this skill when working on gradient-methods problems in optimization.

Decision Tree

  1. Basic Gradient Descent

    • Update: x_{k+1} = x_k - alpha * grad f(x_k)
    • Step size alpha: fixed, diminishing, or line search
    • Convergence: O(1/k) for convex, linear for strongly convex
  2. Step Size Selection

    Method Approach
    Fixed alpha constant (requires tuning)
    Backtracking Armijo condition: f(x - alphagrad) <= f(x) - calpha*
    Exact line search minimize f(x - alpha*grad) over alpha
    Adaptive Adam, RMSprop (ML applications)
  3. Accelerated Methods

    • Momentum: add velocity term
    • Nesterov: look-ahead gradient
    • Conjugate gradient: for quadratic functions
    • scipy.optimize.minimize(f, x0, method='CG') - conjugate gradient
  4. Newton's Method

    • Update: x_{k+1} = x_k - H^{-1} * grad f
    • Requires Hessian (expensive but quadratic convergence)
    • Quasi-Newton (BFGS): approximate Hessian
    • scipy.optimize.minimize(f, x0, method='BFGS')
  5. Convergence Diagnostics

    • Monitor ||grad f|| < tolerance
    • Check function value decrease
    • Watch for oscillation (step size too large)
    • sympy_compute.py diff "f" --var x for gradient

Tool Commands

Scipy_Bfgs

uv run python -c "from scipy.optimize import minimize; res = minimize(lambda x: (x[0]-1)**2 + 100*(x[1]-x[0]**2)**2, [0, 0], method='BFGS'); print('Rosenbrock min at', res.x)"

Scipy_Cg

uv run python -c "from scipy.optimize import minimize; res = minimize(lambda x: x[0]**2 + x[1]**2, [1, 1], method='CG'); print('Min at', res.x)"

Sympy_Gradient

uv run python -m runtime.harness scripts/sympy_compute.py diff "x**2 + y**2" --var "[x, y]"

Key Techniques

From indexed textbooks:

  • [nonlinear programming_tif] Gradient Methods** - These methods use gradient information to iteratively approach the optimum. Convergence** - Addressing convergence properties. Descent Directions and Stepsize Rules:** Focuses on how to choose descent directions and appropriate step sizes.
  • [nonlinear programming_tif] The application of gradient methods to unconstrained optimal control prob- lems is straightforward in principle. For example the steepest descent method takes the form W = b oMV H, (kb ph,y), i=0,. Pl = Thus, given u¥, one computes zF by forward propagation of the system equation, and then p*¥ by backward propagation of the adjoint equation.
  • [nonlinear programming_tif] Footer or Trailing Row**: - There is an empty concluding element indicated by a single ". Overall, this table serves as an index for chapters or sections within a document, with particular emphasis on optimization methods and related mathematical strategies, as evidenced by the listed methods like Gradient, Newton, and other derivative techniques. The scattered letters and empty slots may denote a form of stylistic or formatting choice rather than meaningful content in this context.
  • [nonlinear programming_tif] Zoutendijk’s method uses tw ) oscalatse)Oand'ye 0,1), a i ! P, where ¢ — Y™k € and my is the firs onnegative k ok 28 %, ) it T #(z*,7"e) < -y (a) Show that (b) Prove that {d*} is gradient relat ishi i i Tt pones A related, thus establishing stationarity of the 2. Min-H Method for Optimal Control) Consider the problem of findin g sequences u = (z1,22,.
  • [nonlinear programming_tif] Mustration of the function f of Exercise 1. Stability) (www) We are often interested in whether optimal solutions change radically when the problem data are slightly perturbed. This issue is addressed by stability analysis, to be contrasted with sensitivity analysis, which deals with how much optimal solutions change when problem data change.

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 78 lines · 12 tokens per session scan A c32ac8806dba

Subscribe to this mod's changes

gradient-methods is a skill published in the GitHub repository foryourhealth111-pixel/Vibe-Skills (3,252 stars, last pushed 11d ago), licensed Apache-2.0. It adds 12 tokens to every session and 1,054 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to gradient-methods, differing in 0 lines, and is treated as a copy.