lagrangian-core

lagrangian-core is a skill for Claude Code, Codex from Sliky1/lagrangian-skills. It costs 56 tokens per session (441 once invoked), scanned A, original, MIT.

A method for solving optimization problems with limits or requirements, such as equality and inequality constraints. It uses the augmented Lagrangian method, which combines the objective with penalties for breaking those requirements.

In plain words
What is it for?
It is for convex quadratic problems, smooth nonlinear problems, and basic non-convex problems, including KKT-condition checks and constraint-status reporting.
Why use it?
It helps find candidate solutions while checking whether constraints and the mathematical optimality conditions are satisfied.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for convex quadratic problems, smooth nonlinear problems, and basic non-convex problems, including KKT-condition checks and constraint-status reporting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sliky1/lagrangian-skills/v0.1.0
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 Sliky1/lagrangian-skills --skill v0.1.0
Clone the repo
git clone --depth 1 https://github.com/Sliky1/lagrangian-skills

Made for: Claude Code, Codex.

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 lagrangian-core

README.md
[![agentmods](https://agentmods.dev/badge/skills/sliky1/lagrangian-skills/v0.1.0/github.svg)](https://agentmods.dev/skills/sliky1/lagrangian-skills/v0.1.0)
Your own site
<a href="https://agentmods.dev/skills/sliky1/lagrangian-skills/v0.1.0"><img src="https://agentmods.dev/badge/skills/sliky1/lagrangian-skills/v0.1.0/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 lagrangian-core

Your own site · 80×15
<a href="https://agentmods.dev/skills/sliky1/lagrangian-skills/v0.1.0"><img src="https://agentmods.dev/badge/skills/sliky1/lagrangian-skills/v0.1.0.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 441 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 original No closer match found 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.00056 $0.00441
Opus 5 $0.00028 $0.00220
Sonnet 5 $0.00011 $0.00088
Haiku 4.5 $0.00006 $0.00044

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

Security

Grade A, and why

lagrangian-core 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 11d 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.

archive/v0.1.0/SKILL.md · 41 lines

What it actually says

Lagrangian Core Skill — v0.1.0

能力边界

支持: 凸QP | 光滑NLP | 基础非凸NLP 不支持: 分布式 | Safe RL | 多目标 | 贝叶斯混合

核心方法: 增广拉格朗日法 (ALM)

目标: min f(x) s.t. h(x)=0, g(x)≤0

L_ρ = f(x) + Σλ·h(x) + Σμ·g(x) + ρ/2·||h||²

求解步骤:

  1. 初始化 x₀, λ₀, μ₀, ρ₀=1.0
  2. 内层: min_x L_ρ(x, λ, μ) → x*
  3. 更新乘子: λ ← λ + ρ·h(x*), μ ← max(0, μ + ρ·g(x*))
  4. 更新惩罚: ρ ← 1.5ρ if ||h||>tol
  5. 收敛判断: ||h(x*)||<1e-6 且 ||∇L||<1e-6

KKT条件验证

∇f + Σλ∇h + Σμ∇g = 0 h(x*) = 0, g(x*) ≤ 0 μ ≥ 0, μ·g(x*) = 0

失败处理

输出: 错误类型 + 一行说明

输出格式

最优解 x* → 目标值 f(x*) → KKT残差 → 约束状态

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. 11d ago First seen · 41 lines · 56 tokens per session scan A 16c72ac7982b

Subscribe to this mod's changes

lagrangian-core is a skill published in the GitHub repository Sliky1/lagrangian-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 56 tokens to every session and 441 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

audit-reproducibility

Enforce the replication-protocol.md rule by cross-checking numeric claims in a manuscript against the actual R / Stata / Python outputs. Report PASS/FAIL per claim against tolerance thresholds. Use before submission and before releasing a replication package.

pedrohcgs/claude-code-my-workflow · 54 tokens

review-paper

Comprehensive manuscript review with three modes: single-pass (default), --adversarial critic-fixer loop, and --peer [journal] simulated peer-review pipeline (editor + 2 dispositioned referees + editorial decision, calibrated to a target journal). R&R continuation via --peer --r2/--r3; hostile-editor stress test via…

pedrohcgs/claude-code-my-workflow · 114 tokens

grant-proposal

Scaffold a research grant proposal (NSF, NIH, ERC, or foundation) by composing existing primitives — pulls identification strategy from an /interview-me spec, delegates the data-management plan to /data-management-plan and the facilities statement to /capture-environment, and emits a funder-requirements checklist. Use…

pedrohcgs/claude-code-my-workflow · 131 tokens

preregister

Draft a structured preregistration document (OSF, AsPredicted, or AEA RCT Registry style) from a research spec or free-form study description. Output is a Markdown file with hypotheses, design, sampling plan, analysis plan, exclusions, and inference criteria — annotated with MUST / SHOULD / MAY clarity flags. Use when…

pedrohcgs/claude-code-my-workflow · 153 tokens

capture-environment

Snapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt / environment.yml / uv.lock, Stata version + ado package list), records seeds and RNG kind, optionally writes a pinning…

pedrohcgs/claude-code-my-workflow · 139 tokens

data-management-plan

Draft a funder-compliant Data Management Plan (NSF DMP, NIH DMS Policy 2023, ERC, Horizon Europe) by composing the confidential-data and environment-capture primitives. Sections cover data description, formats/metadata, storage/backup, access/sharing, preservation/archiving, and roles. Use when user says "data…

pedrohcgs/claude-code-my-workflow · 143 tokens