agentleFS
skycivskyciv/skyciv-ai-skills/skyciv-api-v3/SKILL.md

skyciv-api-v3

Skill11 starsChanged 32 days agoMITView on GitHub

You are an agent that interacts with the SkyCiv API. This skill covers authentication, session management, the request/response envelope, and all common patterns shared across every SkyCiv API function. All requests are HTTP POST to: Content-Type must be application/json. Every API call sends a single JSON body with three top-level keys: First call — always provide key: Subsequent calls within 30 min — provide both to allow automatic fallback if session expires: When session_id is valid it is used; if…

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All requests are HTTP POST to:

    line 9
  2. Distinctive:

    Every API call sends a single JSON body with three top-level keys:

    line 21
  3. Very specific:

    Always check response.status === 0 before using results.

    line 169
  4. Very specific:

    Use result_filter and lc_filter in solve/results calls to return only what you need.

    line 235

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SkyCiv Core API Skill

You are an agent that interacts with the SkyCiv API. This skill covers authentication, session management, the request/response envelope, and all common patterns shared across every SkyCiv API function.


API Endpoint

All requests are HTTP POST to:

https://api.skyciv.com/v3

Content-Type must be application/json.


Request Object Structure

Every API call sends a single JSON body with three top-level keys:

{
  "auth": { ... },       // required
  "options": { ... },    // optional
  "functions": [ ... ]   // required — ordered array of functions to run
}

auth

KeyTypeDescription
usernamestringSkyCiv account email / username
keystringAPI key from account settings (required on first call)
session_idstringReuse an open session from a prior call (optional)

First call — always provide key:

{
  "auth": {
    "username": "user@example.com",
    "key": "YOUR_API_KEY"
  }
}

Subsequent calls within 30 min — provide both to allow automatic fallback if session expires:

{
  "auth": {
    "username": "user@example.com",
    "key": "YOUR_API_KEY",
    "session_id": "SESSION_ID_FROM_PREVIOUS_RESPONSE"
  }
}

When session_id is valid it is used; if expired, key starts a fresh session. If key is absent and session_id is expired, the call fails.

options

All fields optional.

KeyTypeDefaultDescription
validate_inputbooleanfalseRun model validation before executing. Strongly recommended.
response_data_onlybooleanfalseReturn only response.data from the last function, omitting the full functions array. Reduces response size.
timeoutint (ms)autoOverride solver timeout. Only use for calls that need extra time.
return_logbooleanfalseInclude a process log for debugging.
return_base64_image_on_errorbooleantrueReturn a screenshot on error for debugging.
response_webhook_urlstring—Send the response to this URL instead of the caller (useful for long-running jobs).
timezonenumberUTCUTC offset for report timestamps (e.g. 10 for GMT+10).
{
  "options": {
    "validate_input": true,
    "response_data_only": false
  }
}

functions

An ordered array of function objects. Functions execute sequentially. Each object must have:

{
  "function": "Namespace.function.name",
  "arguments": { ... }
}

return_data (boolean, default false) can be added to any function object to omit that function's data from the response.


S3D.session.start

Must always be the first function in the array — even when reusing a session_id.

KeyTypeDefaultDescription
keep_openbooleanfalseKeep the session alive for 30 min. Subsequent calls using the returned session_id will be 4–8× faster by skipping re-authentication.
{
  "function": "S3D.session.start",
  "arguments": {
    "keep_open": true
  }
}

Response includes:

{
  "response": {
    "session_id": "Ofd4WYH...",
    "last_session_id": "Ofd4WYH...",
    "session_expiry_time": 1605153571,
    "msg": "S3D session successfully started.",
    "status": 0,
    "function": "S3D.session.start"
  }
}

Store last_session_id for the next call's auth.session_id.


Response Object Structure

{
  "response": {
    "data": { ... },
    "msg": "Human-readable message",
    "status": 0,
    "function": "last-function-name",
    "last_session_id": "...",
    "monthly_api_credits": {
      "quota": 6000,
      "total_used": 22,
      "used_this_call": 1
    }
  },
  "functions": [
    { /* result for functions[0] */ },
    { /* result for functions[1] */ },
    { /* ... */ }
  ]
}
FieldMeaning
response.status0 = success, ≥1 = failure
response.dataData from the last function executed
response.msgStatus or error message
functions[i]Per-function result at index i

Always check response.status === 0 before using results.


Full Minimal Example

Session start → set model → solve:

{
  "auth": {
    "username": "user@example.com",
    "key": "YOUR_API_KEY"
  },
  "options": {
    "validate_input": true
  },
  "functions": [
    {
      "function": "S3D.session.start",
      "arguments": { "keep_open": false }
    },
    {
      "function": "S3D.model.set",
      "arguments": { "s3d_model": { /* model object */ } }
    },
    {
      "function": "S3D.model.solve",
      "arguments": { "analysis_type": "linear" }
    }
  ]
}

Available Function Namespaces

NamespacePurpose
S3D.sessionSession management
S3D.modelSet, solve, repair, screenshot, mesh a structural model
S3D.resultsRetrieve and post-process analysis results
S3D.fileSave/open/share S3D files in cloud storage
S3D.designMember and RC design checks
S3D.SBSection Builder — load library sections, build custom shapes
standalone.foundationStandalone foundation design (piles only at the moment). See the foundation-api skill.
standalone.memberStandalone member design
standalone.loadsWind and snow loads
cloudcad.modelCreate CAD models
cloudcad.fileSave/open CAD files in cloud storage

Common Patterns

Check success before using data:

if (response.status === 0) {
  const data = response.data;
} else {
  console.error(response.msg);
}

Minimise response size with filters:
Use result_filter and lc_filter in solve/results calls to return only what you need. Only if you're confident that load combination exists.

Reuse sessions for speed:
Set keep_open: true in S3D.session.start, then pass the returned last_session_id as auth.session_id in subsequent calls. This skips re-authentication and is 4–8× faster.

Troubleshooting

"Your API credentials could not be authenticated. Please try again." / any auth-rejection response.msg: This message comes straight from the live API when auth.username/auth.key don't validate — it is not something a client can trigger by sending a malformed request shape (a shape bug produces a different kind of error, e.g. about the missing/invalid field itself). If you see this and the {username, key} shape already matches this skill's docs exactly, don't keep editing the request code looking for a bug — the credentials themselves are almost certainly the problem:

  • Confirm this same failure reproduces across every function call in the account (e.g. a plain S3D.model.solve and a standalone.loads.*/cloudcad.* call), not just one namespace — if it's every call, that confirms it's account-wide, not specific to whichever call you were debugging.
  • Re-copy the username (account email) and API key fresh from https://platform.skyciv.com/api — a stale, truncated, or wrong-field value pasted into .env (or wherever credentials are stored) is the most common cause. A real SkyCiv API key is a long alphanumeric string (tens of characters); a much shorter value is a strong signal something got truncated or the wrong value was pasted.
  • If credentials are loaded from a .env file via dotenv, double check the value actually landed in .env (the file actually read at runtime) and not just .env.example (a template file, not loaded by the app) — easy to mix up when copying a real key in for local testing.

Recommendations

Allow user to download API Object If prototyping, it's helpful to allow users to see and download the API input object being sent to the SkyCiv API. It makes troubleshooting a bit easier. So prepare the API object all client-side, then only when they want to send it to the API do you actually send it.

Logging It's also a good idea to show a log of what the software is doing, what API it is calling. Makes it easier to find where things have gone wrong.

Transparency and Results It's also helpful to show results for each step in the API, even if the results are partial. For example, if you intend to run S3D.model.solve and then plan to pass your results to Quick Design - it's a good idea to show some results for the S3D.model.solve so we can see that part is running and you can show what information you're passing to the Quick Design. This transparency is very valuable to the engineer.

Return the link to the S3D model. Once the model is saved to cloud storage, it's a good idea to send back the link to the UI so the user can open the model and validate it's been built correctly. They can also inspect the loads, load combos and structural data much more easily.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.