ai-assistant
Skill14 starsChanged 5 days agoMITView on GitHub
Use when an API call should hand a task to the SkyCiv AI Assistant inside an S3D session through S3D.ai_assistant.*: plain-English model edits ('change member 1 to a W14x90', 'add a 3 m cantilever at node 12'), building a structure from a description, code wind loads via the Load Generator, Quick Design checks, solving and results questions, diagnosing a failed solve, comparing options, or importing a structural plan PDF. Covers runPrompt, the outcome/pendingAction loop (keep_or_undo, approval, questions, sheet_selection, choice), keepChanges/undoChanges, approve/reply/answer/choose, auto_keep, attachments, timeouts, AI credits vs API credits, and keeping the session open between calls. Trigger even without the word SkyCiv, e.g. 'ask the assistant to...', 'let the AI build this frame', 'import this plan PDF into S3D via the API'. Not for building an s3d_model JSON yourself (use s3d-api) or for standalone design modules (use baseplate, connection, foundation-api).
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analysis-resultsSkill
- baseplateSkill
- build-quick-design-calculatorSkill
- cloudcad-apiSkill
- connectionSkill
- foundation-apiSkill
- load-combinationsSkill
- load-gen-apiSkill
- project-managerSkill
- qa-engineerSkill
- rendererSkill
- run-quick-designSkill
- s3d-apiSkill
- s3d-appsSkill
- schema-agentSkill
- section-selectorSkill
- skill-writerSkill
- skyciv-api-v3Skill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 22
Never resend the same prompt to "try again".
- Very specific: line 93
Old sections stay in the model: When it reassigns a section, the assistant leaves the old one in sections unused.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
SkyCiv AI Assistant via the API
S3D.ai_assistant.* sends prompts to the SkyCiv AI Assistant inside an API S3D session and answers its
cards, exactly as a user would in the panel. Use it when the assistant can do the job in one sentence
(an edit, wind loads, a plan import), rather than building or patching the s3d_model JSON yourself.
Full reference: https://skyciv.com/api/v3/docs/S3D.ai_assistant/
Prerequisite: call
S3D.session.startfirst, then put a model in the session withS3D.model.setorS3D.file.open. The assistant works on the session's model, and you read the result back withS3D.model.get.
Credits
- The
S3D.ai_assistant.*functions use 0 API credits. Every prompt uses the account's AI credits, including questions, errors and refusals.S3D.ai_assistant.getCreditsreturns{ used, limit, remaining }. - An
approvalcard may spend more, such as the Load Generator's API credits. Only approve what the user asked for. - Never resend the same prompt to "try again". Read
data.responsefirst.
Workflow
{
"auth": { "username": "...", "key": "..." },
"functions": [
{ "function": "S3D.session.start", "arguments": { "keep_open": true } },
{ "function": "S3D.model.set", "arguments": { "s3d_model": { "...": "..." } } },
{ "function": "S3D.ai_assistant.runPrompt", "arguments": { "prompt": "Change the section of member 1 to a W14x90.", "auto_keep": true } },
{ "function": "S3D.model.get" }
]
}Then read functions[i].data.outcome for the runPrompt entry:
outcome | status | Do this |
completed | 0 | Read data.response. Changes were kept if data.changes_kept is true. |
awaiting_input | 0 | Respond to data.pendingAction (see the next table). The functions that follow in the same call still run. |
error | 1 | The model is unchanged (see data.errors). Rephrase or simplify, and after two failures report back. |
refused | 1 | Out of AI credits or no access. Tell the user; don't retry. |
timeout | 1 | Still running in the session. Call waitUntilIdle (or stop) in a follow-up call. |
stopped / no_response | 1 | Nothing more to read. |
pendingAction.type | Respond with |
keep_or_undo | S3D.ai_assistant.keepChanges / undoChanges (no args) |
approval | approve (no args), reply { "text": "use exposure C" }, or dismiss. Check rows[] with assumed: true first. |
questions | answer { "value": 0 } (option index, [indexes], label, typed text such as "3.2 m", or null for the recommended answer), answerAll { "answers": [null, 1] }, or reply |
sheet_selection | answer { "value": { "plan": 12, "supporting": [30, 31] } }, "confirm", "plan_only", or null |
choice | choose { "index": 0 } |
An approval with blocking: false is only an offer. Ignore it, and the next runPrompt dismisses it.
To respond in a later API call, the first call must use keep_open: true. Then pass its
last_session_id as auth.session_id. The chat, and any pending card, live in that session's browser page.
Arguments
runPrompt: prompt (string), attachment?, plan_import? (boolean), auto_keep? (boolean).
auto_keep: truekeeps any changes still waiting from an earlier turn before sending, and keeps this turn's changes when it finishes. Use it only when the user wants changes applied without review. It is also accepted byreply,approve,answer,answerAllandchoose.attachmenttakes{ "name": "plan.pdf", "base64": "..." },{ "name": "x.csv", "text": "..." },{ "name": "plan.pdf", "url": "https://..." }(the server must allow CORS) or a data URL. It accepts PDF, CSV, XLS/XLSX, HTML reports and images. Always include the extension inname.plan_import: truebuilds the model from the attached plan PDF. A PDF recognised as a plan needs no prompt.- The wait is 15 min by default, or
options.timeout(ms) if set. Plan imports, whole buildings and meshing can take minutes.
Other functions: getStatus, getLastResponse { format: "text" | "markdown" | "detailed" },
waitUntilIdle, stop, newChat, getConversation, listConversations,
resumeConversation { conversation_id }, and getCredits.
Gotchas (live-verified)
- A bad call stops the chain. Responding to a card that isn't showing returns
status: 1with the assistant's message (e.g. "There are no changes waiting for Keep or Undo."), and the functions after it don't run. Don't putkeepChangesafter a prompt that might not change anything; useauto_keep: trueinstead. runPromptrefuses while a card is blocking. Settlekeep_or_undo,approvalandquestionsfirst, or passauto_keepto clear a waiting Keep/Undo.- Changes are on the model before Keep.
S3D.model.getstraight after an unsettled edit already includes the changes. Settle Keep/Undo before you rely on the model, and don't edit it with other S3D functions while a decision is waiting. lastTurncan lag. It can show the previous turn for a second or two, and wasnullstraight after the first prompt in testing. UsegetCreditsfor totals.- Old sections stay in the model. When it reassigns a section, the assistant leaves the old one in
sectionsunused. - Be specific. Name ids, sections (exact library names), codes, units and locations. Context carries over
within a chat; use
newChatfor an unrelated task. - The assistant only loads for regular user accounts with AI Assistant access. If it isn't available, every function returns "The AI Assistant is not available in this S3D session...".
Samples
sample-api/ask-and-edit/ holds a live request and response: a question about
the model, then an edit with auto_keep, then S3D.model.get.
Related skills
s3d-api: build or edit thes3d_modelJSON directly, solve, and read results.load-gen-api: wind/snow/seismic loads without the assistant.run-quick-design: run a specific calculator directly.
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
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.

