Use this skill for SLS Logstore index configuration.
This file only covers trigger-time setup, routing, and cross-scenario safety. Read only the reference document needed for the user's request.
Run aliyun version to verify the version is >= 3.3.8. If not installed or outdated, follow references/cli-installation-guide.md to install or update.
Before executing any SLS API commands, enable AI-Mode, set User-Agent, and update plugins:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sls-index-config-management"
aliyun plugin update
Run aliyun configure list to check if credentials are configured.
If no valid profile is shown, STOP here and ask the user to run aliyun configure outside of this session.
Security rules:
aliyun configure list to check credential statusOn Unauthorized error, surface references/ram-policies.md to the user. Do not retry with a different account without explicit confirmation.
After environment and credential checks, classify the user's request and follow the matching reference:
If the user wants to …Go toView / create / update / delete an index, or change a single field, TTL, max_text_len, full-text on-off, log_reduce, etc.references/manage-index-config.mdBuild an index for a Logstore that has none, or rebuild from scratch using user-provided structured log samplesreferences/generate-index-from-logs.mdAdjust an existing index to support a new query / SQL, reduce cost, or improve write throughputreferences/optimize-index-config.md
Mixed requests are common (e.g. "generate an index for these logs and then update it on Logstore X"). Read the relevant scenario docs in order.
sls; subcommands and flags are kebab-case. Use references/acceptance-criteria.md only when validating command shape or debugging CLI invocation issues.Every time you present an index configuration to the user — whether from a read ( get-index), after a
write ( create-index / update-index), or during generation/optimization — output both:
get-index JSON response (or the equivalent JSON body you are about
to submit for a write). Wrap it in a fenced json code block so the user can copy-paste it
directly.Put the Complete JSON first, then the summary. The summary helps the user understand the config at a glance;
the JSON is the authoritative, machine-readable reference they can use for scripting, version control,
or future update-index calls.
Whether operations succeed or fail, you MUST disable AI-Mode before ending the session:
bash
aliyun configure ai-mode disable
DocumentDescriptionreferences/manage-index-config.mdIndex config format and get / create / update / delete command examplesreferences/generate-index-from-logs.mdInfer a complete index configuration from user-provided structured log samplesreferences/optimize-index-config.mdOptimize an existing index for query/SQL workload, cost, and write throughputreferences/related-apis.mdGetIndex / CreateIndex / UpdateIndex / DeleteIndex API & CLI referencerelated_apis.yamlMachine-readable dependent API metadata for this skillreferences/ram-policies.mdMinimum and complete RAM policies for index managementreferences/acceptance-criteria.mdCLI invocation acceptance testsreferences/cli-installation-guide.mdAliyun CLI install, auth modes, profiles