Skip to content

Reference

For agents

What the cslope skill for AI agents does, how to install it, and what it will and will not do when it checks a slope with the cSlope engine.

The repository has a skill for AI agents: skills/cslope, a SKILL.md with five examples. An agent that reads skills uses it when someone asks for the factor of safety of a slope, an embankment, a cut or an excavation, or for a check with Swedish partial factors. It then describes the slope with the Python package, validates it, runs a limit equilibrium analysis with the cSlope engine and reports the result.

Install

  1. Install the Python package as described under Python › Install. With uv, the agent can also run it without an install step (uvx cslope info).
  2. Copy the folder skills/cslope into your agent's skills folder, for example ~/.claude/skills/cslope for your own account or .claude/skills/cslope in a project.
  3. Check that the agent finds it: ask for the factor of safety of a slope and give its geometry and soils.

What it does

The agent always takes the same four steps:

  1. It asks for the inputs: the geometry, every soil's parameters, the water, the loads and, for a check with partial factors, the safety class and the conversion factors η.
  2. It writes an analysis document (JSON) with the builder cslope.build.Definition. The builder checks each value as it is given, and the document is what you read to see what was analyzed.
  3. It runs cslope validate and then cslope analyze on the document (--json for the summary and the full result).
  4. It reports the summary the engine writes, unchanged.
skills/cslope/examples/swedish_partial_factors.py
"""The layered slope with a distributed load, checked with Swedish partial
factors.

With partial factors the strengths are divided and the variable loads
multiplied before the analysis, so F is an over-design factor on design
values (it must be at least 1.0), not a factor of safety.

The safety class and the conversion factors η are engineering decisions for
the slope at hand. The values below are illustrative: ask for them, never
assume them. The soil values are illustrative too.

    python swedish_partial_factors.py   # writes swedish_partial_factors.json and analyzes it
"""

from pathlib import Path

from cslope.build import Definition, swedish_partial_factors


def build() -> Definition:
    d = Definition(orientation="ltr")
    d.exterior = [(0, 0), (0, 12), (16, 12), (32, 4), (44, 4), (44, 0)]
    d.add_material("Sand", c=3, phi=34, gamma=19, gamma_sat=20)
    d.add_material("Clay", c=12, phi=24, gamma=20, gamma_sat=20)
    d.add_interior_boundary([(0, 6), (28, 6)])
    d.assign("Sand", at=(8, 9))
    d.assign("Clay", at=(20, 2))
    # A variable load (kPa) behind the crest: γQ applies to it.
    d.add_distributed_load(x=(6, 14), q=10)
    d.search_limits(entry=(2, 18), exit=(28, 42))
    d.options.method = "Morgenstern-Price"
    d.options.slices = 30
    d.options.partial_factors = swedish_partial_factors(
        safety_class=2,  # from the project's requirements
        eta_cu=1.0,  # η on su (no undrained material here)
        eta_drained=1.0,  # η on c′ and tan φ′
        variable_load_base=1.3,  # γQ before γd
    )
    return d


if __name__ == "__main__":
    from cslope.cli import main

    path = Path(__file__).with_suffix(".json")
    build().save(path)
    raise SystemExit(main(["analyse", str(path)]))

The summary says what F is: a factor of safety on characteristic values, or an over-design factor on design values when partial factors are applied, which must be at least 1.0. It also gives the method, the critical surface with its entry and exit, every warning and the engine build. The document's format and the schemas are on the Python page.

What it will and will not do

The skill tells the agent:

  • Never assume a safety class or η. They come from the project; the agent asks for them, and every argument of swedish_partial_factors is required.
  • Never invent soil parameters. A missing value stops the agent, which says which value is missing. The soil values in the skill's examples are illustrative.
  • Forward the summary unchanged. F is not rounded differently or relabeled ("safe", "FoS"), and no warning is left out: a warning can mean that F is not reliable.
  • Do not work around a check. When the builder or cslope validate refuses the input, the agent fixes the input.
  • Stay within limit equilibrium. Circular, composite and block surfaces with Morgenstern-Price, Bishop or Janbu. Finite elements and reliability are not covered by the skill yet; the agent says so and does not approximate them.
  • Do not verify the engine itself. Its verification against published problems is the Verification page.

The required F for a factor of safety comes from the governing document, not from cSlope or the agent.

Suggest a change to this page