mcpField
A
alibabacloud-sls-index-config-management

alibabacloud-sls-index-config-management

github.com/aliyunCloud & DevOps281281 installsUpdated 1d ago
Repository

About alibabacloud-sls-index-config-management

A skill for managing Alibaba Cloud SLS Logstore index configurations, intended for users handling index operations, generating configurations from log samples, or tuning indexes for queries. It routes requests to relevant references and sets credential, security, and write-operation safeguards.

Key features

  1. 01View, create, update, and delete indexes
  2. 02Generate indexes from structured log samples
  3. 03Tune indexes for queries and SQL
  4. 04Check credentials and RAM permissions
  5. 05Read scenario rules before writes

Use cases

  1. 01Inspect or change Logstore index fields and TTL
  2. 02Generate a configuration for a Logstore without an index
  3. 03Reduce cost or improve write throughput for a query workload

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aliyun/alibabacloud-aiops-skills --skill alibabacloud-sls-index-config-management

After installing, type/alibabacloud-sls-index-config-managementin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
acceptance-criteria.md
cli-installation-guide.md
generate-index-from-logs.md
manage-index-config.md
manifest.json
optimize-index-config.md
ram-policies.md
related-apis.md
scripts/
user_agent.py

Details

From the project README

Alibaba Cloud SLS Index Configuration Manager

Scenario Description

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.


Prerequisites

These checks apply when executing cloud operations; log-sample generation can run offline.

Install Aliyun CLI

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.

Check Alibaba Cloud credentials configured

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:

  • NEVER read, echo, or print AK/SK values
  • NEVER ask the user to paste AK/SK into the conversation
  • ONLY use aliyun configure list to check credential status

RAM Permission Requirements

On Unauthorized error, surface references/ram-policies.md to the user. Do not retry with a different account without explicit confirmation.


Observability

Run scripts/user_agent.py once per session to generate the UA, then reuse it for all cloud API commands, including request-only dry runs:

SLS_INDEX_USER_AGENT="$(python3 scripts/user_agent.py)" || exit 1
aliyun sls get-index --project <project> --logstore <logstore> \
  --user-agent "$SLS_INDEX_USER_AGENT"

Example generated UA:

AlibabaCloud-Agent-Skills/alibabacloud-sls-index-config-management/59ae5afe2075fc3dc1f0e7e39539c902 skill-version/0.0.1

Routing the Request

Follow the reference matching the user's request:

If the user wants to …Go to
View / create / update / delete an index, or change a field, TTL, max_text_len, full-text, automatic index discovery, log_reduce, etc.references/manage-index-config.md
Build an index for a Logstore that has none, or rebuild from scratch using user-provided structured log samplesreferences/generate-index-from-logs.md
Adjust 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.


Global Rules

  • No writes without the scenario reference. Before any write operation, read the relevant reference document and follow its confirmation, full-body, rollback, and timing rules.
  • Preserve discovered indexes. Keep line.auto_text_keys unchanged on updates unless explicitly requested otherwise; see automatic index discovery.
  • Use exact SLS CLI names. Product is sls; subcommands and flags are kebab-case. Use references/acceptance-criteria.md only when validating command shape or debugging CLI invocation issues.

Reference Documents

DocumentDescription
references/manage-index-config.mdIndex config format and get / create / update / delete command examples
references/generate-index-from-logs.mdInfer a complete index configuration from user-provided structured log samples
references/optimize-index-config.mdOptimize an existing index for query/SQL workload, cost, and write throughput
references/related-apis.mdGetIndex / CreateIndex / UpdateIndex / DeleteIndex API & CLI reference
related_apis.yamlMachine-readable dependent API metadata for this skill
references/ram-policies.mdMinimum and complete RAM policies for index management
references/acceptance-criteria.mdCLI invocation acceptance tests
references/cli-installation-guide.mdAliyun CLI install, auth modes, profiles

Comments

Markdown supported