One CLI: send the user question + the specified Alice Skill (either the Chinese or English name works) to the Wind Alice Agent interface, pull it via SSE streaming, and print
agentResult.value。
Key mechanics (must read)
Verified: the Alice serverdoes notselect the Skill via selectedSkillIds / activatedSkills but rather via a prompt text prefix(choose one based on the language of the question):
问句含中文:使用「<中文 Skill 名>」技能:<原 prompt>
问句全英文:Using "<英文 Skill 名>" skill:<原 prompt>
At the same time, switch chatMode to "12"、originalChatMode set to "4", anddo not carry metadata.agentCard. This CLI already encapsulates this behavior in buildBody ; externally you only need to pass --skill "<Skill 名>"。
Therefore:
--skillBoth the Chinese name and the English name are supported, not the id. For example, the following are equivalent:--skill "上市公司调研问题清单"(Chinese nameZh)--skill "Stock DD List"(English nameEn)--skill "stock-dd-list"(English fuzzy: ignores case/spaces/-_)--skill "信用报告"(colloquial alias, automatically mapped to "Credit Analysis")
- After a match, the CLI assembles the prefix according to the language of the question: question contains Chinese ->
使用「nameZh」技能:; question entirely in English ->Using "nameEn" skill:。 - Do not mistake deliverable names for Skill names: users often say "credit report", "one-pager", "earnings review", but the official Skill names on the portal are "Credit Analysis", "Company One-Pager", and "Global Listed Company Quarterly Earnings Review" respectively. The CLI has built-in mappings for common colloquial aliases; if
[warn]still occurs, uselist-skillsto check the official name. - Names not in
KNOWN_SKILLSand the alias table will be indicated with[warn], but they will still be submitted with the prefix assembled from the literal value (Skills newly created or renamed on the portal can also be used immediately).
When to use this skill
Use it if any condition is met:
- The user explicitly says: "run / call / execute with Alice...", "run with Wind's XX skill...".
- The user names a specific professional sub-Skill of Alice (such as "Listed Company Research Question List", "Company One-Pager", "Fact Verification", "Stock Selection by Theme", etc.).
- The user's question highly matches the capability of a certain Skill, and they want to go through the professional pipeline rather than auto routing.
Scenarios where this skill should not be used: the user is just asking a general financial question and does not care which sub-Skill is used - let Alice auto route on its own (do not pass --skill)。
How to invoke (Agent workflow)
- Get the user question -> decide the Skill:
- User names a Skill -> directly pass that Skill'sChinese name or English nameto
--skill(the script will automatically normalize and backfill the English name); when the user says colloquial terms such as "credit report", you can also pass--skill "信用报告", and the CLI will map it to "Credit Analysis"; - The user did not name one, but the question clearly belongs to a certain Skill (such as "verify facts", "company research question list", "earnings review") -> you may suggest and ask first, then specify it;
- Otherwise do not pass
--skill, and use auto. - Do not rewrite the user's question: pass the user'soriginal wordingas
--prompt(e.g. passCan I get a one-pager for [300498]?as-is), do not "help the user organize their language", do not extract only the stock ticker, and do not translate or rewrite. The CLI will automatically prepend the Skill identifier in the prefix (e.g.Using "Company One-Page Investment Memo" skill:), and the user's question itself must remain as-is.
- User names a Skill -> directly pass that Skill'sChinese name or English nameto
- Before initiating the calltell the user in one sentence: Alice professional Skills usually take several minutes to over ten minutes(complex research reports, one-pagers, comparable analysis, etc. take longer), and may consume a relatively large number of credits; this is normal, so please wait patiently,do not cancel the command midway or repeatedly initiate the same request。
- First locate this skill directory: the
scripts/wind-alice.mjsin the command below is relative to the currentSKILL.mdwherewind-alicedirectory is located. If the current working directory is not that directory, firstcdto that directory before executing. - Execute (either form works):
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<中文 Skill 名>"
node scripts/wind-alice.mjs --prompt "<USER_QUESTION>" --skill "<英文 Skill 名>"
- After the streaming output ends, output according to the deliver to the user rules below; during the wait, if the terminal has no new output for a long time, you should still continue waiting until the process exits, and do not mistakenly judge it as stuck.
You can also first list the known Skills for the user to choose from:
node scripts/wind-alice.mjs list-skills
One-time configuration
- Node.js 18+ (comes with
fetch)。 - Configure WIND_API_KEY:
- priority:
%USERPROFILE%\.wind-aifinmarket\config(dotenv:WIND_API_KEY=...) > this skill directoryconfig.json({"wind_api_key":"..."})>WIND_API_KEYenvironment variable. - Do not manually check some sources and then determine that the Key is missing. You must directly execute the CLI; only when the CLI returns
KEY_MISSINGcan you determine that none of the sources provided a valid Key. - Key acquisition entry:https://aifinmarket.wind.com.cn/#/user/overview。
- priority:
- Optional:
WIND_ALICE_API_URLoverrides the default API address.
Security requirements
- Never output the real
WIND_API_KEY、Bearer token、config.jsoncontent or%USERPROFILE%\.wind-aifinmarket\configcontent. - If you need to explain the download method, only show the
Authorization: Bearer <WIND_API_KEY>placeholder format; do not construct curl, PowerShell, or HTTP examples containing a real Key. - The report URL returned by Alice can be used for delivery and download in the current user session; when writing to long-term materials such as READMEs, examples, tickets, commit messages, etc., use a placeholder URL.
File download handling
Many Skills (company one-pager / research question list / quarterly report commentary / market size estimation / comparable company analysis, etc.) produce downloadable report / data attachments.
At the end of each CLI calldirectly use WIND_API_KEY as the Bearer Token to download the attachments to the .agents/download/ directory, and print the download result (saved path or failure reason) to stderr。
The attachment list has two sources, with the following priority:
- Server-side
A2A.PresentFilesdeclaration (authoritative): when the SSE artifact includes thecomponentName: "A2A.PresentFiles"component, take the files it lists as authoritative—the server has explicitly said which files are to be presented this time, no more and no less. agentResult.valuebody link scanning (fallback): enabled only when the entire SSE round has no PresentFiles component at all, relying on regex to capture markdown links / bare URLs //project/xxx.extpaths from the body.
Before downloading, the CLI prints its decision process to stderr; if the attachment didn't come down, these lines are enough to locate the issue:
[下载] A2A.PresentFiles 诊断:命中 1 个组件,列出 2 个文件:报告.md, 财务模型.xlsx
[下载] 清单来源:服务端 A2A.PresentFiles 声明(2 个文件)
=== 检测到 2 个可下载文件,正在下载到:<目标目录> ===
- <文件名>
已保存:<目标目录>\<文件名>
If a diagnostic line shows "matched N components, but no file leaf was resolved", stderr will dump the raw component structure (up to 4000 characters each) for troubleshooting.
Download directory resolution rules (by priority):
- User level: If this skill is installed under
%USERPROFILE%\.agents(on POSIX,~/.agents) (typically~/.agents/skills/wind-alice), download to%USERPROFILE%\.agents\download\。 - Project level: Otherwise, from the directory containing the skill, search upward for the nearest ancestor directory that contains a
.agents/subdirectoryP, and download toP\.agents\download\(typically<项目根>\.agents\download\)。 - Fallback (user level): If none of the above match (for example, the skill is in an SVN/Git source development directory and no project-level
.agents),has ever been created), fall back uniformly to the user-level%USERPROFILE%\.agents\download\--that is, the same physical directory as rule 1. The CLI will notscatter files intoprocess.cwd()。
Whichever rule matches, if the directory does not exist the CLI will create it automatically in recursive mode, with no need for the user to manually mkdir; only when mkdir fails due to permissions/disk or other reasons will it fall back as a final resort to process.cwd(), and print [warn] to stderr.
Memory point:All files downloaded by Alice are either under some <...>/.agents/download/ or under ~/.agents/download/ Down, so you can reliably "find files by directory".
Important facts:
- The file interface and the Agent interface share the same
WIND_API_KEY(that is, the apiKey provided by Wind AIFin Market). The CLI has a built-inAuthorization: Bearer <WIND_API_KEY>that downloads via HTTP GET. - Conflicting files with the same name automatically get suffixes such as
(1)、(2)appended, and existing files are not overwritten. - CLI The Key is not printed to logs; download results appear only on stderr and will not pollute stdout's
agentResult.valuemain body. - Download failures (401 / 403 / network errors, etc.) only print the failure reason + the original URL, and do not affect the main flow's exit code.
After the call ends, there is no need to explain "how to download" to the user; the local download path has already been inlined by the CLI into the stdout body(wherever the file appears in the original text, the path is filled in there). No additional note needs to be appended at the end of the reply; only when the CLI stderr reports "download failed" do you need to relay the URL and failure reason to the user for troubleshooting.
Deliver to the user
Delivery contract:Use
agentResult.valuefor the body; attachment paths are already inlined in the body, and reading attachments for display is prohibited.
Correct process
- Extract from CLI stdout the body after
agentResult.value:(removing the line-leading prefix), andas-ispresent it to the user; - The CLI has automatically replaced the non-clickable
/project/...attachment referencesin placewith local download paths (such asD:\...\.agents\download\xxx.md), and filtered out the### …完整报告heading--do notrepeat the server-side workspace path to the user; - ProhibitedAdd your own opening remarks (such as "The following is a one-page investment report on XX" or "Generated by the Wind Alice skill") — this will duplicate the main body title;
- ProhibitedLabeling internal field names such as "agentResult.value (original text)";
- Prohibited: summarizing, abstracting, or rewriting
agentResult.valuethe main body (do not condense the report into a table or restate the key points yourself); - Do notappend an attachment path hint such as "Saved to: ..." at the end of the reply -- the local path is already displayed inline in the main body;
- ProhibitedUsing Read / view_files to load the
.agents/download/attachment body to display to the user —agentResult.valueis already the user-facing core analysis summary; the complete Markdown attachment is for the user to open and review locally.
Prohibited phrasing
| ❌ Wrong | ✅ Correct |
|---|---|
| Starting with "The complete Markdown has been saved to: ..." | Deliver the main body first agentResult.value, the path is already inlined in the main body |
Then restating "The file is saved at:/project/...」 |
The CLI has already replaced it with the local path; do not repeat the server-side path to the user |
Appending "Saved to:D:...」 |
The path is already displayed inline in the main body; no need to append it at the end |
| Writing "agentResult.value (original text):" | Output the main body directly, without internal labels |
| Writing "The following is a one-page investment report on ... (generated by the XX skill)" | Output the main body directly (the main body usually already has a title) |
Read the downloaded .md and paste the full text to the user |
Deliver only the stdout summary (including the already-inlined attachment path) |
When stdout is truncated
If the host terminal truncates stdout,still only read the agentResult.value on-disk copy(if provided by the CLI);Do notswitch to reading the .agents/download/ attachment instead to deliver the main body. The attachment path is already inlined in the main body; no additional handling is needed.
Hard requirements
- Under PowerShell, reading this document must explicitly use UTF-8: for example
Get-Content -Encoding UTF8 skills\wind-alice\SKILL.md; if you see garbled Chinese characters, re-read as UTF-8 first, and do not act based on garbled content. --skillAccepts Chinese or English Skill names, and common colloquial aliases(consistent withKNOWN_SKILLS/ portal). The script matches in the order nameEn -> nameZh -> normalize(nameEn) -> normalize(nameZh) -> alias table; after a match, it assembles the prefix according to the question language (use nameZh for Chinese questions, nameEn for all-English questions).--promptYou can say "credit report" in--skillshould pass "credit analysis" or the alias "credit report"; when unsure, firstlist-skills。- Prompt must be non-empty: if blank or missing, exit directly with code 2 and do not send a request.
- Must not print the Key to logs: the script only uses it in the
Authorizationheader and will not output it to stdout/stderr. - Streaming must wait until completion: the CLI already handles
awaitbetween parent and child processes for the child process exit; never change it to "return as soon as sent". - Expected duration and patience reminder: Before invoking, the user must be reminded that Alice Skill may be slow; during execution, do not interrupt the CLI due to a long wait, switch to other tools, or invoke the same task repeatedly in parallel.
- Do not fabricate
selectedSkillIds/agentCardor similar legacy fields to specify a Skill - it has been tested and does not work; the text prefix must be used. - Rewriting the user's question is prohibited:
--promptmust be the user'soriginal wording, and it must not "help the user organize their language", extract only keywords, translate, or rewrite. For example, if the user asksCan I get a one-pager for [300498]?, then--prompt "Can I get a one-pager for [300498]?"must be passed, and it must not be rewritten as--prompt "300498". The CLI will automatically prepend the Skill identifier prefix (such asUsing "Company One-Page Investment Memo" skill:), and the user's question itself must be passed through as-is, so that the server can receive the complete original question. - Deliver the gentResult.value body (attachment paths are already inlined): The body must come from gentResult.value in stdout (the CLI has replaced /project/ attachment references in place with local download paths); summarizing, abstracting, or rewriting is prohibited;Do notappend an attachment path hint at the end of the reply (the paths are already inlined in the body);It is prohibitedto read the contents of attachments in .agents/download/ and show them to the user.
Update check handling
After each valid invocation of wind-alice.mjs ends, the script silently triggers a background update check:
- It only records that the current skill has just been used, and starts in the background
scripts/update-check.mjs, without blocking the finalization of the main Alice request. - The background check waits for a short quiet window to avoid being overwritten by an update while the skill is in use.
- It reads the lock according to the installation scope, checks the remote HEAD, and deduplicates successful states daily; when the Gitee source or
skills updatehas not been written to disk, it switches tonpx skills add ... --skill wind-aliceto reinstall. - When the update fails, the network is unreachable, or there is no update, no content is output, and this Alice invocation is not affected.