Xiaojia Skills
Use the bundled scripts to inspect available projects and skills, then call the deployed JustAI openapi endpoint in two steps:
list_projects.pylists your available资料库 folders/projectslist_skills.pylists your available skill IDschat.pysubmits the task and returnsconversation_idchat_result.pypollschat_resultuntil the task iscompletedorfailed
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
- Ensure these environment variables are set before using the script:
JUSTAI_OPENAPI_BASE_URLJUSTAI_OPENAPI_API_KEY- Optional:
JUSTAI_OPENAPI_TIMEOUT
- If the task should be scoped to a specific资料库, run
scripts/list_projects.pyfirst and choose one or moreproject_id. - If the task should preload a specific skill, run
scripts/list_skills.pyfirst and choose one or moreskill_id. - Run
scripts/chat.pywith--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:
branchtells which real path ran, such ascollect_info,confirm_info,generate_plan,generate_notes, orgenerate_imageresultis the primary payloadtextis the human-readable summary or fallback textconversation_idmust be preserved for follow-up turns
- If the user asks to continue an existing conversation, pass the previous
conversation_idback intoscripts/chat.pytogether with the new--message. - For
confirm_inforesults:- 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.
- To accept the card and continue, send a natural-language follow-up such as
Commands
List projects:
python3 "${CLAUDE_SKILL_DIR}/scripts/list_projects.py"
List skills:
python3 "${CLAUDE_SKILL_DIR}/scripts/list_skills.py"
Run a new turn:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" --message "帮我做一份小红书运营方案"
Poll the result:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat_result.py" \
--conversation-id "existing-conversation-id"
Continue an existing turn:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--conversation-id "existing-conversation-id" \
--message "继续展开第二部分"
Continue after a confirmation card:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--conversation-id "existing-conversation-id" \
--message "这些信息没问题,继续生成方案"
Revise a confirmation card in natural language:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--conversation-id "existing-conversation-id" \
--message "预算改成3万,目标用户改成25到30岁女性,其他不变,请更新资料卡片"
Run a turn scoped to a selected project/folder:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--project-id "fld_demo" \
--message "请参考这个资料库里的内容,帮我写一篇港理工校园生活图文笔记"
Run a turn with a manually selected skill:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--skill-id "skill_demo" \
--message "使用这个技能继续分析"
Run a turn with both selected project and skill:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--project-id "fld_demo" \
--skill-id "skill_demo" \
--message "优先参考这个资料库并使用这个 skill 帮我生成方案"
Override the timeout for slower branches:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat.py" \
--message "我是做敏感肌护肤的品牌,先帮我整理资料卡片"
Control polling interval:
python3 "${CLAUDE_SKILL_DIR}/scripts/chat_result.py" \
--conversation-id "existing-conversation-id" \
--poll-interval 2 \
--timeout 300
Guardrails
- Prefer the scripts over hand-written
curlso 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_idfrom the last successful submit response and reuse it for polling and follow-up requests. - Treat
resultas the primary machine-readable payload. Usetextonly as fallback whenresultis plain text. confirm_infocurrently continues through natural-language follow-up on the sameconversation_id; there is no structuredform_datasubmission path in openapi yet.- If the endpoint returns
status=failed, surfacemessagedirectly instead of retrying blindly.
