Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Lqr Design

ASecurity

Use when you must design an LQR state-feedback gain matrix for a scalar-input two-state system such as spacecraft attitude control: solve the algebraic Riccati equation for the cost weights, compute the gain matrix, verify closed-loop stability of the regulated system, and assess the Q over R weighting trade. Produces the Riccati solution, the gain vector, and the stability verdict that feed the control-law design. Trigger: lqr, linear quadratic regulator, riccati equation, gain matrix, state...

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
ai-agentspython

Works with

claude code

Security Analysis

A100/100

Scanned 9/27/2026

Install to Claude Code

$npx -y skills add ashfordeOU/aero-agent-skills --skill lqr-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lqr Design?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Lqr Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashfordeou-lqr-design/badge)](https://www.skillsdirectory.com/skills/ashfordeou-lqr-design)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: lqr-design
description: "Use when you must design an LQR state-feedback gain matrix for a scalar-input two-state system such as spacecraft attitude control: solve the algebraic Riccati equation for the cost weights, compute the gain matrix, verify closed-loop stability of the regulated system, and assess the Q over R weighting trade. Produces the Riccati solution, the gain vector, and the stability verdict that feed the control-law design. Trigger: lqr, linear quadratic regulator, riccati equation, gain matrix, state feedback, closed loop stability, control effort, spacecraft attitude control."
license: Apache-2.0
compliance: STANDARDS-REF
standards:
  - id: arp4754a
    reference-only: true
gated: false
domain: gnc-autonomy
pack: gnc-autonomy
compatibility: "agentskills.io SKILL.md; any SKILL.md host (Claude Code, Hermes, OpenClaw)"
metadata:
  domain: gnc-autonomy
  subdomain: optimal-control
  tags: [lqr-design, linear-quadratic-regulator, riccati, gain-matrix, state-feedback, closed-loop-stability, control-effort, spacecraft-attitude-control]
  version: 0.1.0
  author: Aero Agent Skills
---

# LQR Design (gnc-autonomy/optimal-control/lqr-design)

Use when the task is LQR state-feedback design for a scalar-input
two-state system: solving the Riccati equation, computing the gain
matrix, and verifying closed-loop stability.

## Domain quick reference

- LQR minimizes the quadratic cost J = integral(x'Qx + u'Ru) over the
  linear system x' = A x + B u; the optimal state feedback is u = -K x.
- The gain is K = R^-1 B' P with P the stabilizing solution of the
  algebraic Riccati equation A'P + PA - P B R^-1 B' P + Q = 0.
- For the canonical scalar-input two-state form A = [[0,1],[0,-a]],
  B = [0,1] (a damped double integrator), the Riccati equation reduces
  to a small closed-form system solved directly from q1, q2, r, and a.
- A 2x2 closed-loop matrix A - B K is stable exactly when its trace is
  negative and its determinant positive; the pole pair follows from the
  quadratic formula.
- Q penalizes state error and R penalizes control effort; their ratio
  sets the gain magnitude and the settling speed of the regulated
  system.
- ARP4754A (reference-only) frames development assurance for aircraft
  systems; the Riccati mathematics here is common control-theory
  knowledge.

## Workflow

1. Put the plant in canonical form: A = [[0,1],[0,-a]] with damping
   a >= 0, input B = [0,1], and pick cost weights Q = diag(q1, q2),
   R = r in one consistent SI convention (for an attitude plant: q1 in
   1/rad^2, q2 in 1/(rad/s)^2, r in 1/(N m)^2).
2. Solve the Riccati equation with riccati_gain for the symmetric
   matrix P.
3. Compute the gain with gain_matrix: K = R^-1 B' P, returned as
   [k1, k2].
4. Verify the closed loop with closed_loop_stable: eigenvalues of
   A - B K, reported as a stability verdict plus the pole pair.
5. Assess the weights with cost_weight_guide and re-tune q1, q2, r
   when the gains are too aggressive or too weak.

## Pitfalls

- Iterating the Riccati equation with the policy-iteration map
  P <- A'P + PA - P B R^-1 B' P + Q; that map is not a contraction and
  need not converge. Solve the ARE directly instead.
- Applying the closed form outside the canonical family: a general A
  and B need a general Riccati solver, not this leaf's equations.
- Mixing weight conventions (rad with deg, torque in N m with weights
  scaled for a different unit); the gain and the closed-loop poles
  change with the convention.
- Checking stability from the determinant alone; a 2x2 closed loop
  needs trace < 0 AND determinant > 0.
- Accepting negative q or nonpositive r; the module raises ValueError
  on impossible weights.

## Behavior contract (gate 3)

The Riccati solve, gain computation, closed-loop stability verdict,
and cost-weight guidance are exercised by the gate 3 contract test:
scripts/test_lqr_design_logic.py against scripts/lqr_design_logic.py
(stdlib unittest, offline). Run:
python3 scripts/test_lqr_design_logic.py

## Compliance

- ARP4754A is proprietary (SAE); name and paraphrase only per
  standards-map.yaml, reference-only: true.
- Revision note: ARP4754B (2023) supersedes ARP4754A; this skill keys to
  ARP4754A as the certification-baseline revision (FAA AC 20-174 cites A);
  see standards-map.yaml arp4754a.revision_decision.
- compliance: STANDARDS-REF, gated: false.

Attribution

ashfordeOUashfordeOU
View sourceMore from ashfordeOU →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

694821 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →