Use this skill as the entry point for Claude Code when handling Kingscript work.
Local resource discovery
This skill should not hardcode the path of any single machine. Each time you enter a Kingscript task, first resolve the local resource root directory in the following order:
- Prefer reading the
local-paths.json - If not present, then read the current workspace's
CLAUDE.md、AGENTS.mdor similar local instruction file to find the local resource path declared by the user - If still not present, then try default directory discovery
Only when the path from the previous step actually exists may it continue to be used; if it does not exist, continue falling back, and do not directly assume the directory must be there.
local-paths.json convention
File location:
- In the skill installation directory,
local-paths.json
Suggested fields:
workspace_rootrepo_rootreferences_rootdocs_rootexamples_rootsdk_roottemplates_rootlanguage_rootjava_sample_jarbos_docs_path
Default directory discovery
Only when local-paths.json and the workspace instruction file both fail to provide a usable path should you try in the following order:
- Whether the current workspace contains
references/examples、references/sdk、references/templates - The current workspace's
kingscript-code-generator/references - Whether a repository copy named
kingscript-code-generatorexists in the current workspace's parent or sibling directories
Read first
- First resolve
references_root / docs_root / examples_root / sdk_root / templates_root / language_root - If the user mentions
KWC、脚本控制器、controller、REST API、Web API, first read<references_root>\docs\custom-development\脚本控制器开发指南.md - Read
<examples_root>the most relevant example in - If a plugin skeleton is needed, read
<templates_root> - If an SDK is involved, first read
<sdk_root>\README.md、<sdk_root>\strategy.mdand<sdk_root>\indexes\ - If syntax or keywords are involved, read
<language_root>\README.md - If the materials in the repository are insufficient and an external knowledge disk is locally mounted, follow
<sdk_root>\strategy.mdto enter the external extension layer, and first read*-description.md, and when actual usage or pitfalls are needed, then read the accompanying*-example.md - If
local-paths.jsonis configured inbos_docs_path, treat it as the main entry point of the external knowledge disk; enter only when the materials in the repository are insufficient
Fallback search order
- First open
README.md - in the target directory
- Then see whether the file name can already directly locate it.
<sdk_root>\indexes\ - When only the class name, method name, or event name is known, first return to
<examples_root>\plugins\README.mdWhen only the scenario is known, first return to - and the corresponding "scenario breakdown" directory README
<references_root>If it is still insufficient, then perform a keyword search on - If the indexes and examples are both insufficient, then fall back to
<sdk_root>\manifests\ - If still insufficient, then check the local
.d.ts、jardecompilation results or the online Javadoc
Output conventions
By default includes:
- Scenario
- Assumptions
- Code or solution
- Risks
- Open questions to confirm
Security boundaries
- Do not fabricate Kingscript APIs, event names, or context fields
- Do not assume TypeScript declarations guarantee runtime availability
- Do not ignore permissions, tenant isolation, account set boundaries, or lifecycle timing
- Before generating code, you must confirm the real import paths of every external class, helper class, event class, enum, and utility class
- Before the final output of code, you must self-check that all non-global symbols are explicitly imported and must not rely on IDE or editor autocompletion
- If a symbol does not need to be imported, you must be able to explain that it is a runtime global, a local definition in the current file, or automatically injected by the framework
- If information is missing, provide a bounded assumption-based approach, rather than a false definitive answer
- When looking up the SDK, prioritize the route of "index -> target document" rather than scanning the entire directory
- Methods related to page prompts, notifications, and message boxes must return to
IFormViewor the local declaration layer to confirm - Before calling
obj.method(), you must confirm thatmethodbelongs toobjthe current type or its declaration inheritance chain, and must not mix in methods from adjacent event parameters or context objects - It is not allowed to guess methods by "approximate name"; for example, if the declaration says
addItemClickListeners(...), you must not arbitrarily write it asaddItemClickService(...) - When generating code, you must not write the event parameter as
any; if the declaration layer only providesBizDataEventArgsor$.java.util.EventObject, you must also use it exactly as declared - When the user points out that an example, template, or generated code contains an error, you must not only fix the current fragment; you must also determine whether this issue should be distilled into a reusable constraint, and write it back according to the scope of impact to the platform entry point, policy, knowledge card, index, template, or example entry point, to avoid repeated generation of the same type of issue