Xiaojia Skills
Use the bundled scripts to inspect available projects and skills, then call the deployed JustAI openapi endpoint in two steps:
- 1.
list_projects.py lists your available资料库 folders/projects - INLINECODE1 lists your available skill IDs
- INLINECODE2 submits the task and returns INLINECODE3
- INLINECODE4 polls
chat_result until the task is completed or INLINECODE7
This keeps the interface stable for slower branches such as card generation, plan generation, notes generation, and image generation.
When running inside Claude Code, ${CLAUDE_SKILL_DIR} resolves to this skill directory. Use that path when invoking the bundled scripts. In Codex or a plain shell, run the same scripts from the installed skill directory.
Workflow
- 1. Ensure these environment variables are set before using the script:
-
JUSTAI_OPENAPI_BASE_URL
-
JUSTAI_OPENAPI_API_KEY
- Optional:
JUSTAI_OPENAPI_TIMEOUT
- 2. If the task should be scoped to a specific资料库, run
scripts/list_projects.py first and choose one or more project_id. - If the task should preload a specific skill, run
scripts/list_skills.py first and choose one or more skill_id. - Run
scripts/chat.py with --message, optional --conversation-id, optional repeated --project-id, and optional repeated --skill-id. - Preserve the returned
conversation_id. - Run
scripts/chat_result.py --conversation-id ... to poll the task result. - Read the returned JSON and use it directly:
-
branch tells which real path ran, such as
collect_info,
confirm_info,
generate_plan,
generate_notes, or
generate_image
-
result is the primary payload
-
text is the human-readable summary or fallback text
-
conversation_id must be preserved for follow-up turns
- 8. If the user asks to continue an existing conversation, pass the previous
conversation_id back into scripts/chat.py together with the new --message. - For
confirm_info results:
- To accept the card and continue, send a natural-language follow-up such as
这些信息没问题,继续生成方案.
- To revise the card, send a natural-language correction such as
预算改成3万,目标用户改成25到30岁女性,请更新资料卡片.
- Do not attempt structured form submission yet; the openapi layer currently supports message-based continuation only.
Commands
List projects:
CODEBLOCK0
List skills:
CODEBLOCK1
Run a new turn:
CODEBLOCK2
Poll the result:
CODEBLOCK3
Continue an existing turn:
CODEBLOCK4
Continue after a confirmation card:
CODEBLOCK5
Revise a confirmation card in natural language:
CODEBLOCK6
Run a turn scoped to a selected project/folder:
CODEBLOCK7
Run a turn with a manually selected skill:
CODEBLOCK8
Run a turn with both selected project and skill:
CODEBLOCK9
Override the timeout for slower branches:
CODEBLOCK10
Control polling interval:
CODEBLOCK11
Guardrails
- - Prefer the scripts over hand-written
curl so submit and polling stay consistent. - When the task depends on a specific资料库 or手动技能, list them first and pass the exact IDs. The openapi request now统一使用
project_id 和 skill_id 两个字段,值都是字符串数组。 - Keep
conversation_id from the last successful submit response and reuse it for polling and follow-up requests. - Treat
result as the primary machine-readable payload. Use text only as fallback when result is plain text. - INLINECODE45 currently continues through natural-language follow-up on the same
conversation_id; there is no structured form_data submission path in openapi yet. - If the endpoint returns
status=failed, surface message directly instead of retrying blindly.
小家技能
使用捆绑的脚本来检查可用的项目和技能,然后分两步调用已部署的JustAI开放API端点:
- 1. listprojects.py 列出您可用的资料库文件夹/项目
- listskills.py 列出您可用的技能ID
- chat.py 提交任务并返回 conversationid
- chatresult.py 轮询 chat_result 直到任务 completed 或 failed
这为较慢的分支(如卡片生成、方案生成、笔记生成和图片生成)保持接口稳定。
在Claude Code中运行时,${CLAUDESKILLDIR} 解析为此技能目录。调用捆绑脚本时请使用该路径。在Codex或普通shell中,请从已安装的技能目录运行相同的脚本。
工作流程
- 1. 使用脚本前确保已设置以下环境变量:
- JUSTAI
OPENAPIBASE_URL
- JUSTAI
OPENAPIAPI_KEY
- 可选:JUSTAI
OPENAPITIMEOUT
- 2. 如果任务应限定到特定资料库,先运行 scripts/listprojects.py 并选择一个或多个 projectid。
- 如果任务应预加载特定技能,先运行 scripts/listskills.py 并选择一个或多个 skillid。
- 运行 scripts/chat.py,附带 --message、可选的 --conversation-id、可选的重复 --project-id 和可选的重复 --skill-id。
- 保留返回的 conversationid。
- 运行 scripts/chatresult.py --conversation-id ... 轮询任务结果。
- 读取返回的JSON并直接使用:
- branch 指示实际运行的路径,如 collect
info、confirminfo、generate
plan、generatenotes 或 generate_image
- result 是主要负载
- text 是人类可读的摘要或备选文本
- conversation_id 必须保留以供后续轮次使用
- 8. 如果用户要求继续现有对话,将之前的 conversationid 连同新的 --message 一起传回 scripts/chat.py。
- 对于 confirminfo 结果:
- 要接受卡片并继续,发送自然语言后续消息,如 这些信息没问题,继续生成方案
- 要修改卡片,发送自然语言更正消息,如 预算改成3万,目标用户改成25到30岁女性,请更新资料卡片
- 暂时不要尝试结构化表单提交;开放API层目前仅支持基于消息的延续。
命令
列出项目:
bash
python3 ${CLAUDESKILLDIR}/scripts/list_projects.py
列出技能:
bash
python3 ${CLAUDESKILLDIR}/scripts/list_skills.py
运行新轮次:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py --message 帮我做一份小红书运营方案
轮询结果:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat_result.py \
--conversation-id existing-conversation-id
继续现有轮次:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--conversation-id existing-conversation-id \
--message 继续展开第二部分
在确认卡片后继续:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--conversation-id existing-conversation-id \
--message 这些信息没问题,继续生成方案
用自然语言修改确认卡片:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--conversation-id existing-conversation-id \
--message 预算改成3万,目标用户改成25到30岁女性,其他不变,请更新资料卡片
运行限定到选定项目/文件夹的轮次:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--project-id fld_demo \
--message 请参考这个资料库里的内容,帮我写一篇港理工校园生活图文笔记
运行使用手动选定技能的轮次:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--skill-id skill_demo \
--message 使用这个技能继续分析
运行同时选定项目和技能的轮次:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--project-id fld_demo \
--skill-id skill_demo \
--message 优先参考这个资料库并使用这个 skill 帮我生成方案
为较慢的分支覆盖超时时间:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat.py \
--message 我是做敏感肌护肤的品牌,先帮我整理资料卡片
控制轮询间隔:
bash
python3 ${CLAUDESKILLDIR}/scripts/chat_result.py \
--conversation-id existing-conversation-id \
--poll-interval 2 \
--timeout 300
防护措施
- - 优先使用脚本而非手写 curl,以保持提交和轮询的一致性。
- 当任务依赖于特定资料库或手动技能时,先列出它们并传递确切的ID。开放API请求现在统一使用 projectid 和 skillid 两个字段,值都是字符串数组。
- 保留上次成功提交响应中的 conversationid,并在轮询和后续请求中重复使用。
- 将 result 视为主机器可读负载。仅当 result 是纯文本时,才使用 text 作为备选。
- confirminfo 目前通过同一 conversationid 上的自然语言后续消息继续;开放API中尚无结构化的 formdata 提交路径。
- 如果端点返回 status=failed,直接展示 message,而不是盲目重试。