SuperAPI AI Directory

kingscript-code-generator

Coding & development

View repository

Updated 10-15 23:42

About this skill

Kingscript Expert (Qoder-adapted version)

This entry point consolidates the most commonly used retrieval order and output constraints for Qoder scenarios into a single file, preventing deviations when the platform side lacks additional guidance files.

Local resource discovery

This skill should not hard-code the path of any single machine. Each time a Kingscript task is entered, first resolve the local resource root directory in the following order:

  1. Prefer reading the one in the same directory as the skill local-paths.json
  2. If not present, then read the workspace's AGENTS.md or similar local documentation files to find the local resource path declared by the user
  3. If still not present, then try default directory discovery

Only when the path from the previous step actually exists is it allowed to continue being used; if it does not exist, continue downgrading, and do not directly assume the directory must be there.

local-paths.json conventions

File location:

  • Under the skill installation directory local-paths.json

Suggested fields:

  • workspace_root
  • repo_root
  • references_root
  • docs_root
  • examples_root
  • sdk_root
  • templates_root
  • language_root
  • java_sample_jar
  • bos_docs_path

Default directory discovery

Only when local-paths.json and the workspace documentation file both fail to provide a usable path, try in the following order:

  1. Whether references/examples、references/sdk、references/templates
  2. The current workspace's kingscript-code-generator/references
  3. Whether in the current workspace's parent or sibling directory there exists a repository copy named kingscript-code-generator repository copy

Fixed entry points after resolution

  • <references_root>\docs\README.md
  • <references_root>\docs\custom-development\README.md
  • <references_root>\docs\custom-development\脚本控制器开发指南.md
  • <examples_root>\README.md
  • <examples_root>\plugins\README.md
  • <templates_root>\README.md
  • <sdk_root>\README.md
  • <sdk_root>\strategy.md
  • <sdk_root>\indexes\class-index.md
  • <sdk_root>\indexes\method-index.md
  • <sdk_root>\indexes\methods-by-name.md
  • <sdk_root>\indexes\scenario-index.md
  • <sdk_root>\indexes\keyword-index.md
  • <language_root>\README.md

Recommended retrieval order

  1. First resolve references_root / docs_root / examples_root / sdk_root / templates_root / language_root
  2. When the user mentions KWC、脚本控制器、controller、REST API、Web API , first look at:<references_root>\docs\custom-development\脚本控制器开发指南.md
  3. First look at the closest code examples:<examples_root>
  4. When a starting skeleton is needed, look at:<templates_root>\README.md
  5. When SDK semantics are involved, look at:<sdk_root>\README.md、<sdk_root>\indexes\
  6. When syntax, keywords, and naming rules are involved, look at:<language_root>\README.md

Fallback search order

  1. First open the target directory's README.md
  2. Then check whether the file name can already locate it directly
  3. When only the class name, method name, or event name is known, first return to <sdk_root>\indexes\
  4. When only the scenario is known, first return to <examples_root>\plugins\README.md and the corresponding "scenario breakdown" directory README
  5. If still insufficient, then perform keyword search on <references_root> perform keyword search
  6. When both indexes and examples are insufficient, then fall back to <sdk_root>\manifests\
  7. When still insufficient, then look at the local .d.ts、jar decompilation results or online Javadoc

Local search methods

  1. Prefer rg --files or rg -n
  2. If rg is unavailable or permission errors occur, switch to PowerShell:
Get-ChildItem -Path '<references_root>' -Recurse -Include *.md |
  Select-String -Pattern 'SearchEnterEvent|EntryGridBindDataEvent|AbstractReportFormPlugin' -Encoding UTF8
  1. If you need to find the Java source from jar , use:
jar tf '<java_sample_jar>' | Select-String 'SearchSample|TreeViewSample|ReportColumnMergePlugin'

Task routing under Qoder

  • User asks "how to write this code": first go to <examples_root>
  • User asks "how to configure, write, and deploy a KWC controller / script controller": first go to <references_root>\docs\custom-development\脚本控制器开发指南.md
  • User asks "what is this class/event": first go to <sdk_root>\classes\ or <sdk_root>\packages\
  • User asks "which plugin should I start from": first go to <templates_root>
  • User pastes an error or exception: first go to <sdk_root>\indexes\error-index.md
  • When repository materials are insufficient and an external knowledge drive is mounted locally: follow <sdk_root>\strategy.md to enter the external extension layer, first read *-description.md, and when code and pitfalls are needed, then read *-example.md
  • If local-paths.json is configured in bos_docs_path, treat it as the main entry point of the external knowledge base; only enter it when the materials in the repository are insufficient

Output rules

  • First explain the scenario, then provide the code or conclusion.
  • Declare key assumptions before the code.
  • Before generating code, first confirm the import paths of every external class, helper class, event class, enum, and utility class.
  • Before the final output, you must self-check that all non-global symbols are explicitly imported, and must not rely on the IDE or editor for automatic imports.
  • If a symbol does not need to be imported, you must explain that it is a runtime global, locally defined in the current file, or automatically injected by the framework.
  • You must point out risk points and items to be confirmed.
  • Prioritize reusing the examples and templates in this skill; do not invent APIs out of thin air.
  • When local knowledge is insufficient, degrade according to indexes -> classes/packages -> manifests -> 外部知识盘(可选) -> 本地 .d.ts -> 在线 Javadoc .
  • For methods related to page prompts, notifications, and message boxes, first return to IFormView or the local declaration layer to confirm, then decide whether they are usable.
  • Before calling obj.method() , you must confirm that method belongs to obj the current type or its declaration inheritance chain; you must not directly apply methods from other event parameters or context objects.
  • When generating code, you must not write event parameters as any; if the current version declaration only provides BizDataEventArgs or $.java.util.EventObject, you must also output them as declared.

Prohibitions

  • Do not fabricate Kingscript APIs, event names, or context objects.
  • Do not assume by default that Java open capabilities are necessarily available.
  • Do not ignore permissions, organization, tenant, account set, and lifecycle boundaries.