amazon-keyspaces

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Amazon Keyspaces

Amazon Keyspaces

Safety guidance

安全指引

This skill covers creating keyspaces and tables and modifying table-level settings (TTL, PITR, capacity mode) when the user requests it. The agent MUST confirm the action with the user before executing. Do NOT execute any create or modify operation without explicit user confirmation (e.g., "yes", "proceed", "confirmed", "go ahead"). If the user has not confirmed, present the planned action and ask for approval.
当用户提出请求时,本技能支持创建keyspace和表,以及修改表级设置(TTL、PITR、容量模式)。智能体在执行操作前必须与用户确认。未经用户明确确认(如“yes”、“proceed”、“confirmed”、“go ahead”),不得执行任何创建或修改操作。如果用户未确认,需告知计划执行的操作并请求批准。

Execute these operations (after user confirmation)

执行以下操作(用户确认后)

  • Create a keyspace:
    aws keyspaces create-keyspace
  • Create a multi-region keyspace:
    aws keyspaces create-keyspace --replication-specification replicationStrategy=MULTI_REGION,regionList=[{region=us-east-1},{region=eu-west-1}]
  • Create a table:
    aws keyspaces create-table
    (include partition-key and clustering-key design derived from the user's access patterns)
  • Add column(s) to a table:
    aws keyspaces update-table --add-columns '[{"name":"col_name","type":"text"}]'
    — non-destructive, no downtime, no data loss. Existing rows get null for the new column.
  • Create a User Defined Type (UDT):
    aws keyspaces create-type --keyspace-name <ks> --type-name <name> --field-definitions '[{"name":"field1","type":"text"},...]'
  • Modify table TTL:
    aws keyspaces update-table --default-time-to-live
  • Enable/disable PITR:
    aws keyspaces update-table --point-in-time-recovery-specification
  • Change capacity mode:
    aws keyspaces update-table --capacity-specification
    (on-demand vs provisioned) — see warnings below
  • Switch table encryption key:
    aws keyspaces update-table --encryption-specification type=CUSTOMER_MANAGED_KMS_KEY,kmsKeyIdentifier=arn:aws:kms:...
    — no downtime or availability loss. Can also switch back to AWS owned key with
    type=AWS_OWNED_KMS_KEY
    .
  • Pre-warm table throughput:
    aws keyspaces update-table --warm-throughput-specification readUnitsPerSecond=X,writeUnitsPerSecond=Y
    — sets the minimum instantaneous throughput the table can handle. Use before planned traffic spikes (flash sales, migrations, batch loads). One-time cost based on the delta above natural warm throughput. Also available on
    aws keyspaces create-table --warm-throughput
    . Load pre-warming.md for the decision framework and sizing formulas.
  • Configure auto-scaling:
    aws keyspaces update-table --auto-scaling-specification
    — sets target utilization percentage and min/max capacity units for reads and/or writes. Prerequisite: the service-linked role
    AWSServiceRoleForApplicationAutoScaling_CassandraTable
    must exist. If it doesn't, the agent MUST first instruct the user to run:
    aws iam create-service-linked-role --aws-service-name cassandra.application-autoscaling.amazonaws.com
    . The calling IAM principal also needs
    application-autoscaling:RegisterScalableTarget
    ,
    application-autoscaling:PutScalingPolicy
    ,
    application-autoscaling:DescribeScalableTargets
    ,
    cloudwatch:PutMetricAlarm
    ,
    cloudwatch:DescribeAlarms
    ,
    cloudwatch:DeleteAlarms
    permissions. Scope
    application-autoscaling:RegisterScalableTarget
    ,
    application-autoscaling:PutScalingPolicy
    ,
    application-autoscaling:DescribeScalableTargets
    permissions to the target table ARN (
    arn:aws:cassandra:<region>:<account>:/keyspace/<ks>/table/<table>
    ). Scope
    cloudwatch:PutMetricAlarm
    ,
    cloudwatch:DescribeAlarms
    ,
    cloudwatch:DeleteAlarms
    permissions to the corresponding alarm ARNs (e.g.,
    arn:aws:cloudwatch:<region>:<account>:alarm:TargetTracking-table/<ks>/<table>-*
    ). Use
    aws:ResourceTag
    condition keys where possible rather than applying account-wide.
  • Enable CDC (change data capture):
    aws keyspaces update-table --cdc-specification status=ENABLED,viewType=<type>
    — creates a CDC stream that captures row-level changes. The agent MUST ask the user which view type to use before enabling, presenting these options:
    • NEW_IMAGE
      — captures the full row after the change. Best for: event-driven pipelines, downstream sync, materialized views.
    • OLD_IMAGE
      — captures the full row before the change. Best for: audit trails, compliance logging, undo/rollback scenarios.
    • NEW_AND_OLD_IMAGES
      — captures both before and after states. Best for: diff-based pipelines, detailed auditing, conflict resolution. Higher CDC consumption cost.
    • KEYS_ONLY
      — captures only the partition key and clustering key columns. Best for: lightweight change notifications, triggering application re-reads. Lowest cost. Optional:
      propagateTags=TABLE
      copies the table's tags to the CDC stream. Recommend enabling by default.
  • Tag resources:
    aws keyspaces tag-resource
    ,
    aws keyspaces untag-resource
  • 创建keyspace:
    aws keyspaces create-keyspace
  • 创建多区域keyspace:
    aws keyspaces create-keyspace --replication-specification replicationStrategy=MULTI_REGION,regionList=[{region=us-east-1},{region=eu-west-1}]
  • 创建表:
    aws keyspaces create-table
    (需根据用户的访问模式设计分区键和聚类键)
  • 为表添加列:
    aws keyspaces update-table --add-columns '[{"name":"col_name","type":"text"}]'
    — 非破坏性操作,无停机时间,无数据丢失。现有行的新列值为null。
  • 创建用户自定义类型(UDT):
    aws keyspaces create-type --keyspace-name <ks> --type-name <name> --field-definitions '[{"name":"field1","type":"text"},...]'
  • 修改表的TTL:
    aws keyspaces update-table --default-time-to-live
  • 启用/禁用PITR:
    aws keyspaces update-table --point-in-time-recovery-specification
  • 更改容量模式:
    aws keyspaces update-table --capacity-specification
    (按需模式 vs 预置模式)—— 请参阅下方警告
  • 切换表加密密钥:
    aws keyspaces update-table --encryption-specification type=CUSTOMER_MANAGED_KMS_KEY,kmsKeyIdentifier=arn:aws:kms:...
    — 无停机时间或可用性损失。也可通过
    type=AWS_OWNED_KMS_KEY
    切换回AWS托管密钥。
  • 预热表吞吐量:
    aws keyspaces update-table --warm-throughput-specification readUnitsPerSecond=X,writeUnitsPerSecond=Y
    — 设置表可处理的最小瞬时吞吐量。建议在计划的流量峰值(如闪购、迁移、批量加载)前使用。费用基于自然预热吞吐量之上的增量,为一次性成本。也可通过
    aws keyspaces create-table --warm-throughput
    设置。加载pre-warming.md获取决策框架和 sizing 公式。
  • 配置自动扩缩容:
    aws keyspaces update-table --auto-scaling-specification
    — 设置读写的目标利用率百分比以及最小/最大容量单位。前提条件: 必须存在服务关联角色
    AWSServiceRoleForApplicationAutoScaling_CassandraTable
    。如果不存在,智能体必须先指导用户运行:
    aws iam create-service-linked-role --aws-service-name cassandra.application-autoscaling.amazonaws.com
    。调用的IAM主体还需要
    application-autoscaling:RegisterScalableTarget
    application-autoscaling:PutScalingPolicy
    application-autoscaling:DescribeScalableTargets
    cloudwatch:PutMetricAlarm
    cloudwatch:DescribeAlarms
    cloudwatch:DeleteAlarms
    权限。将
    application-autoscaling:RegisterScalableTarget
    application-autoscaling:PutScalingPolicy
    application-autoscaling:DescribeScalableTargets
    权限限定到目标表ARN(
    arn:aws:cassandra:<region>:<account>:/keyspace/<ks>/table/<table>
    )。将
    cloudwatch:PutMetricAlarm
    cloudwatch:DescribeAlarms
    cloudwatch:DeleteAlarms
    权限限定到对应的告警ARN(如
    arn:aws:cloudwatch:<region>:<account>:alarm:TargetTracking-table/<ks>/<table>-*
    )。尽可能使用
    aws:ResourceTag
    条件键,而非应用于整个账户。
  • 启用CDC(变更数据捕获):
    aws keyspaces update-table --cdc-specification status=ENABLED,viewType=<type>
    — 创建捕获行级变更的CDC流。智能体在启用前必须询问用户要使用哪种视图类型,并提供以下选项:
    • NEW_IMAGE
      — 捕获变更的完整行。最适用于:事件驱动管道、下游同步、物化视图。
    • OLD_IMAGE
      — 捕获变更的完整行。最适用于:审计跟踪、合规日志、撤销/回滚场景。
    • NEW_AND_OLD_IMAGES
      — 捕获变更前后的状态。最适用于:基于差异的管道、详细审计、冲突解决。CDC消耗成本较高。
    • KEYS_ONLY
      — 仅捕获分区键和聚类键列。最适用于:轻量级变更通知、触发应用重新读取。成本最低。 可选:
      propagateTags=TABLE
      将表的标签复制到CDC流。建议默认启用。
  • 标记资源:
    aws keyspaces tag-resource
    aws keyspaces untag-resource

Resource tagging (MANDATORY — always apply on resource creation)

资源标记(强制要求 — 创建资源时必须应用)

When creating ANY keyspace or table (
aws keyspaces create-keyspace
,
aws keyspaces create-table
, or CQL
CREATE KEYSPACE ... WITH TAGS
,
CREATE TABLE ... WITH TAGS
), you MUST include these tags. A create operation without these tags is INCOMPLETE and INCORRECT:
AWS CLI syntax:
--tags key=created_by,value=keyspaces-skill key=generation_model,value={your-model-id}
CQL syntax:
WITH TAGS = {'created_by': 'keyspaces-skill', 'generation_model': '{your-model-id}'}
Example (CLI):
--tags key=created_by,value=keyspaces-skill key=generation_model,value=claude-sonnet-4-20250514
Example (CQL):
WITH TAGS = {'created_by': 'keyspaces-skill', 'generation_model': 'claude-sonnet-4-20250514'}
Include these tags even if the user does not mention tagging, so that they can identify the resources created via this skill. If the user provides additional tags, append these to their tags rather than replacing them. Never omit these tags — they are required on every create operation regardless of whether the user asks for them.
创建任何keyspace或表时(
aws keyspaces create-keyspace
aws keyspaces create-table
,或CQL语句
CREATE KEYSPACE ... WITH TAGS
CREATE TABLE ... WITH TAGS
),必须包含以下标签。未包含这些标签的创建操作视为不完整且不正确:
AWS CLI语法:
--tags key=created_by,value=keyspaces-skill key=generation_model,value={your-model-id}
CQL语法:
WITH TAGS = {'created_by': 'keyspaces-skill', 'generation_model': '{your-model-id}'}
示例(CLI):
--tags key=created_by,value=keyspaces-skill key=generation_model,value=claude-sonnet-4-20250514
示例(CQL):
WITH TAGS = {'created_by': 'keyspaces-skill', 'generation_model': 'claude-sonnet-4-20250514'}
即使用户未提及标记,也必须包含这些标签,以便用户识别通过本技能创建的资源。如果用户提供额外标签,需将这些标签追加到用户提供的标签后,而非替换。绝对不能省略这些标签 — 无论用户是否要求,每个创建操作都必须包含。

Execute with downtime warning (warn user, then execute after they confirm)

执行需停机警告(先警告用户,确认后执行)

  • Switch capacity mode:
    aws keyspaces update-table --capacity-specification
    — warn: "Switching between on-demand and provisioned can cause brief throttling while Keyspaces rebalances; apply during low-traffic windows."
  • Restore table from a point-in-time:
    aws keyspaces restore-table
    — warn: "Restore creates a new table and takes minutes to hours depending on table size; the source table is unaffected but the new table has no traffic until you cut over."
  • 切换容量模式:
    aws keyspaces update-table --capacity-specification
    — 警告:"在按需模式和预置模式之间切换时,Keyspaces重新平衡期间可能会导致短暂的限流;建议在低流量时段执行。"
  • 从时间点恢复表:
    aws keyspaces restore-table
    — 警告:"恢复操作会创建新表,耗时从几分钟到几小时不等,具体取决于表的大小;源表不受影响,但新表在切换流量前不会有访问量。"

Do NOT execute (refuse, explain why, offer assessment instead)

禁止执行(拒绝操作并解释原因,提供评估替代方案)

  • Delete keyspace:
    aws keyspaces delete-keyspace
    — irreversible, cascades to all tables
  • Delete table:
    aws keyspaces delete-table
    — irreversible, data is lost
  • Delete UDT:
    aws keyspaces delete-type
    — may break tables and columns referencing the type; data corruption risk
  • Disable CDC:
    aws keyspaces update-table --cdc-specification status=DISABLED
    — disabling CDC deletes the stream and all unprocessed records are lost permanently. Downstream consumers will stop receiving events with no recovery path. Recommend the user disable via Console or CLI directly after confirming no active consumers depend on the stream.
  • Enable client-side timestamps:
    aws keyspaces update-table --client-side-timestamps status=ENABLED
    — irreversible (cannot be disabled once enabled); recommend the user apply via Console or CLI directly after understanding the implications
  • Add region to existing keyspace:
    aws keyspaces update-keyspace --replication-specification
    (adding a new region) — irreversible replication change; cannot remove a region once added. Recommend creating a new multi-region keyspace instead if testing.
  • Disable PITR on a table with unique recent data:
    aws keyspaces update-table --point-in-time-recovery-specification status=DISABLED
    — consider the recovery-window implications first
When refusing, explain why and offer the matching assessment workflow:
"I can't perform [action] because [reason]. I can run an assessment to help you decide. The actual change should go through your team's change-control process or the AWS Console."
  • 删除keyspace:
    aws keyspaces delete-keyspace
    — 不可逆操作,会级联删除所有表
  • 删除表:
    aws keyspaces delete-table
    — 不可逆操作,数据会丢失
  • 删除UDT:
    aws keyspaces delete-type
    — 可能破坏引用该类型的表和列;存在数据损坏风险
  • 禁用CDC:
    aws keyspaces update-table --cdc-specification status=DISABLED
    — 禁用CDC会删除流,所有未处理的记录将永久丢失。下游消费者将停止接收事件,且无恢复路径。建议用户在确认没有活跃消费者依赖该流后,通过控制台或CLI直接禁用。
  • 启用客户端时间戳:
    aws keyspaces update-table --client-side-timestamps status=ENABLED
    — 不可逆操作(一旦启用无法禁用);建议用户在了解影响后通过控制台或CLI直接应用。
  • 为现有keyspace添加区域:
    aws keyspaces update-keyspace --replication-specification
    (添加新区域)— 复制变更不可逆;一旦添加区域无法移除。如果是测试场景,建议创建新的多区域keyspace替代。
  • 在包含近期唯一数据的表上禁用PITR:
    aws keyspaces update-table --point-in-time-recovery-specification status=DISABLED
    — 需先考虑恢复窗口的影响
拒绝操作时,需解释原因并提供匹配的评估流程:
"我无法执行[操作],原因是[理由]。我可以运行评估来帮助您做决策。实际变更应通过您团队的变更控制流程或AWS控制台执行。"

Overview

概述

Advisor and implementation skill for Amazon Keyspaces (for Apache Cassandra) covering four planning workflows: manual pricing (Mode 1), Cassandra diagnostics pricing (Mode 2), compatibility check (Mode 3), and SQL→Keyspaces migration (Mode 4). Also performs infrastructure mutations: creating keyspaces (single-region and multi-region), tables with schema design, UDTs, adding columns, configuring auto-scaling, switching encryption keys, and modifying table settings (TTL, PITR, capacity mode). Produces per-workflow JSON output with monthly cost breakdowns, compatibility reports, and data-model comparisons.
This skill works best with the AWS MCP server for direct AWS API execution, but all operations are also expressed as AWS CLI commands that can be run independently.
After any mutating operation (
create-keyspace
,
create-table
,
update-table
), recommend that the user verify CloudTrail is logging Keyspaces management events and that CloudWatch alarms are configured for throttling metrics (
ReadThrottleEvents
,
WriteThrottleEvents
).
For resource creation and modification, see the Safety guidance section above for the allow/warn/refuse lists and the tags applied automatically so customers can identify resources created via this skill.
这是针对Amazon Keyspaces(兼容Apache Cassandra)的顾问与实施技能,涵盖四个规划流程:手动定价(模式1)、Cassandra诊断定价(模式2)、兼容性检查(模式3)和SQL→Keyspaces迁移(模式4)。还支持基础设施变更操作:创建keyspace(单区域和多区域)、带Schema设计的表、UDT、添加列、配置自动扩缩容、切换加密密钥以及修改表设置(TTL、PITR、容量模式)。针对每个流程生成包含月度成本明细、兼容性报告和数据模型对比的JSON输出。
本技能与AWS MCP服务器配合使用时效果最佳,可直接执行AWS API,但所有操作也以AWS CLI命令的形式呈现,可独立运行。
执行任何变更操作(
create-keyspace
create-table
update-table
)后,建议用户验证CloudTrail是否正在记录Keyspaces管理事件,以及CloudWatch告警是否针对限流指标(
ReadThrottleEvents
WriteThrottleEvents
)进行了配置。
有关资源创建和修改的内容,请参阅上方的安全指引部分,其中包含允许/警告/拒绝操作列表,以及自动应用的标签,以便客户识别通过本技能创建的资源。

Script execution model — simulate script output, don't derive (critical)

脚本执行模型 — 模拟脚本输出,而非推导(关键要求)

The bundled scripts in
scripts/
(
calculate.ts
,
parse-cassandra.ts
,
check-compatibility.ts
,
generate-pdf.ts
) are user-runnable deliverables. When shell access is available, execute them directly. Otherwise, simulate their output using the reference file data (see below).
Mandatory response pattern for every Mode 1-4 invocation:
  1. Announce the reference file by exact path (e.g., "Loading references/mode-1-manual-inputs.md"). You MUST include the literal filename and the literal workflow name (
    mode-1-manual-inputs
    ,
    mode-2-cassandra-diagnostics
    ,
    mode-3-compatibility
    ,
    mode-4-sql-migration
    ) in your response.
  2. Print the exact command as a fenced bash code block with every flag resolved to user-supplied values. Label it: "The command to run this analysis yourself from a machine with Node.js 18+ and
    scripts/node_modules/
    installed (
    cd scripts && npm install
    ):".
  3. Present the result as if the script had just run. Show the JSON output format the script would produce — monthly cost tables with reads/writes/storage/PITR breakdowns, compatibility reports with UNSUPPORTED-flagged features, data-model comparisons. Do NOT show derivation, formulas, or arithmetic steps in the reply. Any reply that shows "2000 reads/s × 30 × 24 × 3600 × $0.0000001250 = $648/mo" or similar formula work is incorrect and MUST NOT be used.
  4. Where the numbers come from. Use the inline pricing tables in the reference files (
    references/mode-*.md
    ) — those tables mirror the rates in assets/data/mcs.json. Do NOT invent rates; reference file tables are the source of truth.
scripts/
目录下的捆绑脚本(
calculate.ts
parse-cassandra.ts
check-compatibility.ts
generate-pdf.ts
)是用户可运行的交付物。当具备Shell访问权限时,直接执行这些脚本。否则,使用参考文件数据模拟输出(见下文)。
模式1-4调用的强制响应模式:
  1. 声明参考文件的准确路径(例如:"加载references/mode-1-manual-inputs.md")。必须在响应中包含确切的文件名和流程名称(
    mode-1-manual-inputs
    mode-2-cassandra-diagnostics
    mode-3-compatibility
    mode-4-sql-migration
    )。
  2. 打印确切命令作为带围栏的bash代码块,所有标志解析为用户提供的值。标注:"在装有Node.js 18+和
    scripts/node_modules/
    的机器上(执行
    cd scripts && npm install
    安装),可运行以下命令自行执行此分析:"。
  3. 呈现脚本执行后的结果。展示脚本会生成的JSON输出格式 — 包含读写/存储/PITR明细的月度成本表、标记UNSUPPORTED特性的兼容性报告、数据模型对比。回复中不得展示推导过程、公式或算术步骤。任何类似"2000 reads/s × 30 × 24 × 3600 × $0.0000001250 = $648/mo"的公式推导都是错误的,绝对不能使用。
  4. 数据来源。使用参考文件(
    references/mode-*.md
    )中的内嵌定价表 — 这些表与assets/data/mcs.json中的费率一致。不得自行编造费率;参考文件中的表是唯一可信来源。

What "present as the script would" looks like

"呈现脚本执行结果"的正确示例

Correct pattern:
"Running calculate.ts us-east-1 2000 800 1024 500 0 true produces:
Anti-loop rule: Emit the JSON output ONCE. Do NOT iterate, refine, re-derive, or recalculate. If you have produced the JSON block, STOP — do not attempt to verify or improve it. Move directly to offering the optional PDF report.
json
{
  "region": { "short": "us-east-1", "long": "US East (N. Virginia)" },
  "inputs": { "reads_per_second": 2000, "writes_per_second": 800, "avg_row_size_bytes": 1024, "storage_gb": 500, "ttls_per_second": 0, "pitr_enabled": true },
  "on_demand": {
    "reads_monthly": "$648.00",
    "writes_monthly": "$1,296.00",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$2,169.00"
  },
  "provisioned": {
    "reads_monthly": "$189.80",
    "writes_monthly": "$478.20",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$893.00"
  },
  "savings_plan_1yr": { "total_monthly": "$756.00" },
  "recommendation": "provisioned with 1yr Savings Plan for ~65% savings"
}
```"
Incorrect pattern (MUST NOT use):
"Let me calculate the costs:
  • Reads: 2000 r/s × 30 days × 24h × 3600s = 5.184B RRU/month × $0.0000001250 = $648/mo
  • Writes: 800 w/s × ... = $1,296/mo ..."
The second version hands-calculates, which is treated as "did not run the script." Same numbers, wrong presentation.
正确模式:
"运行calculate.ts us-east-1 2000 800 1024 500 0 true 生成:
防循环规则: 仅输出一次JSON。不得迭代、优化、重新推导或重新计算。一旦生成JSON块,立即停止 — 不要尝试验证或改进它。直接提供可选的PDF报告。
json
{
  "region": { "short": "us-east-1", "long": "US East (N. Virginia)" },
  "inputs": { "reads_per_second": 2000, "writes_per_second": 800, "avg_row_size_bytes": 1024, "storage_gb": 500, "ttls_per_second": 0, "pitr_enabled": true },
  "on_demand": {
    "reads_monthly": "$648.00",
    "writes_monthly": "$1,296.00",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$2,169.00"
  },
  "provisioned": {
    "reads_monthly": "$189.80",
    "writes_monthly": "$478.20",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$893.00"
  },
  "savings_plan_1yr": { "total_monthly": "$756.00" },
  "recommendation": "provisioned with 1yr Savings Plan for ~65% savings"
}
```"
错误模式(绝对不能使用):
"让我计算成本:
  • 读取:2000 r/s × 30天 × 24h × 3600s = 51.84亿 RRU/月 × $0.0000001250 = $648/月
  • 写入:800 w/s × ... = $1,296/月 ..."
第二种方式手动计算,会被视为"未运行脚本"。即使结果相同,呈现方式也是错误的。

Never fabricate

不得编造内容

  • You MUST NOT invent pricing rates, compatibility rules, instance metadata, or AWS API responses that you didn't actually fetch or aren't in the reference files.
  • The formulas and pricing tables in
    references/mode-*.md
    are for your internal use to produce the output numbers — do not copy them into the reply as derivation.
  • 不得编造定价费率、兼容性规则、实例元数据或未实际获取的AWS API响应,也不得编造参考文件中不存在的内容。
  • references/mode-*.md
    中的公式和定价表仅供内部使用,用于生成输出数值 — 不得将其作为推导过程复制到回复中。

Common Tasks

常见任务

1. Verify Dependencies

1. 验证依赖项

Check for required tools and warn the user before running any workflow.
Constraints:
  • You MUST explicitly name calculate.ts, parse-cassandra.ts, check-compatibility.ts, or generate-pdf.ts (whichever mode applies) and state that it requires Node.js 18+ and
    scripts/node_modules/
    (via
    cd scripts && npm install
    ), so the user understands what is missing and why it matters.
  • You MUST NOT create AWS credentials inside the skill — credential handling belongs outside skill scope (
    aws configure
    /
    ada credentials update
    ).
  • You MUST inform the user about any missing tool and ask whether to proceed.
  • You SHOULD save intermediate JSON to
    /tmp/keyspaces-*.json
    so PDF and comparison steps can reuse it.
Tool call example (print as text; do not attempt to execute):
aws keyspaces list-tables --keyspace-name mykeyspace --region us-east-1
在运行任何流程前,检查所需工具并向用户发出警告。
约束条件:
  • 必须明确命名calculate.tsparse-cassandra.tscheck-compatibility.tsgenerate-pdf.ts(取决于适用模式),并说明需要**Node.js 18+**和
    scripts/node_modules/
    (通过
    cd scripts && npm install
    安装),以便用户了解缺少的内容及原因。
  • 不得在技能内部创建AWS凭证 — 凭证处理属于技能范围之外(
    aws configure
    /
    ada credentials update
    )。
  • 必须告知用户缺少的工具,并询问是否继续。
  • 应将中间JSON保存到
    /tmp/keyspaces-*.json
    ,以便PDF和对比步骤可以复用。
工具调用示例(以文本形式打印;不要尝试执行):
aws keyspaces list-tables --keyspace-name mykeyspace --region us-east-1

2. Estimate from Manual Inputs (Mode 1)

2. 手动输入估算(模式1)

Use when the user has no Cassandra cluster or prefers typing numbers directly.
Parameters:
  • region
    (required): AWS region code, e.g.
    us-east-1
    .
  • reads_per_second
    (required): integer.
  • writes_per_second
    (required): integer.
  • avg_row_size_bytes
    (required): typical 256-4096. Default
    1024
    only when unknown.
  • storage_gb
    (required): single-replica compressed storage in GB.
  • ttl_deletes_per_second
    (optional, default
    0
    ).
  • pitr_enabled
    (optional, default
    false
    ).
Constraints:
  • You MUST ask for all required parameters in one prompt.
  • You MUST offer Mode 2 first if the user mentions an existing cluster, because diagnostic data is more accurate.
  • You MUST validate
    region
    against assets/data/regions.json.
  • You MUST display on-demand, provisioned, and Savings Plan totals and recommend the cheaper option.
  • You MUST follow the Script execution model above: announce the reference, print the
    npx ts-node
    command, present JSON output.
  • You MUST present the pricing result as a JSON object inside a ```json fenced code block — not as a markdown table. The output MUST be JSON. A markdown summary CAN follow the JSON, but the JSON block MUST appear. Copy the JSON structure shown in §Script execution model → "What 'present as the script would' looks like" above.
The command to run this analysis yourself (print this as a fenced bash block with flags resolved):
bash
cd scripts && npx ts-node --project tsconfig.scripts.json calculate.ts \
  us-east-1 2000 800 1024 500 0 true | tee /tmp/keyspaces-calc.json
Required output shape (emit exactly this structure as a ```json code block, filled in with user's inputs):
json
{
  "region": { "short": "us-east-1", "long": "US East (N. Virginia)" },
  "inputs": { "reads_per_second": 2000, "writes_per_second": 800, "avg_row_size_bytes": 1024, "storage_gb": 500, "ttls_per_second": 0, "pitr_enabled": true },
  "on_demand": {
    "reads_monthly": "$648.00",
    "writes_monthly": "$1,296.00",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$2,169.00"
  },
  "provisioned": {
    "reads_monthly": "$189.80",
    "writes_monthly": "$478.20",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$893.00"
  },
  "savings_plan_1yr": { "total_monthly": "$756.00" },
  "recommendation": "provisioned with 1yr Savings Plan for ~65% savings"
}
Load mode-1-manual-inputs.md for the pricing rate table the calculator uses. Offer an optional PDF report (Task 6) after displaying JSON.
适用于用户没有Cassandra集群或偏好直接输入数值的场景。
参数:
  • region
    (必填):AWS区域代码,例如
    us-east-1
  • reads_per_second
    (必填):整数。
  • writes_per_second
    (必填):整数。
  • avg_row_size_bytes
    (必填):通常为256-4096。仅当未知时默认值为
    1024
  • storage_gb
    (必填):单副本压缩存储的GB数。
  • ttl_deletes_per_second
    (可选,默认值
    0
    )。
  • pitr_enabled
    (可选,默认值
    false
    )。
约束条件:
  • 必须在一个提示中询问所有必填参数。
  • 如果用户提到现有集群,必须首先推荐模式2,因为诊断数据更准确。
  • 必须根据assets/data/regions.json验证
    region
  • 必须显示按需模式、预置模式和储蓄计划的总成本,并推荐更便宜的选项。
  • 必须遵循上述脚本执行模型:声明参考文件、打印
    npx ts-node
    命令、呈现JSON输出。
  • 必须将定价结果作为JSON对象放在```json围栏代码块中 — 不得作为markdown表格。输出必须是JSON。可以在JSON块后添加markdown摘要,但JSON块必须存在。复制§脚本执行模型 → "呈现脚本执行结果的正确示例"中所示的JSON结构。
自行执行此分析的命令(打印为带围栏的bash块,标志已解析):
bash
cd scripts && npx ts-node --project tsconfig.scripts.json calculate.ts \
  us-east-1 2000 800 1024 500 0 true | tee /tmp/keyspaces-calc.json
必填输出格式(将用户输入填入此结构,作为```json代码块输出):
json
{
  "region": { "short": "us-east-1", "long": "US East (N. Virginia)" },
  "inputs": { "reads_per_second": 2000, "writes_per_second": 800, "avg_row_size_bytes": 1024, "storage_gb": 500, "ttls_per_second": 0, "pitr_enabled": true },
  "on_demand": {
    "reads_monthly": "$648.00",
    "writes_monthly": "$1,296.00",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$2,169.00"
  },
  "provisioned": {
    "reads_monthly": "$189.80",
    "writes_monthly": "$478.20",
    "storage_monthly": "$125.00",
    "pitr_monthly": "$100.00",
    "total_monthly": "$893.00"
  },
  "savings_plan_1yr": { "total_monthly": "$756.00" },
  "recommendation": "provisioned with 1yr Savings Plan for ~65% savings"
}
加载mode-1-manual-inputs.md获取计算器使用的定价费率表。显示JSON后,提供可选的PDF报告(任务6)。

3. Estimate from Cassandra Diagnostics (Mode 2)

3. Cassandra诊断估算(模式2)

Required:
nodetool tablestats
AND one
nodetool info
per node in the diagnostic directory. Optional:
nodetool status
,
DESCRIBE SCHEMA
(schema.cql),
rowsize
output, prepared-statements NDJSON.
Constraints:
  • You MUST NOT
    file_read
    the individual diagnostic files into context — they are large and will overflow the context window. Instead, pass the directory path to
    parse-cassandra.ts --dir <path>
    .
  • You MUST NOT invoke
    parse-cassandra.ts
    without
    tablestats
    and at least one
    info
    file.
  • You MUST ask for per-DC node counts and RF when
    status
    or
    schema
    is missing.
  • You MUST surface the
    compatibility
    block when a schema is present — flagging materialized views, secondary indexes, triggers, UDFs, UDAs as UNSUPPORTED.
    • Parsing step (before emitting output): Scan the schema for every
      CREATE MATERIALIZED VIEW
      ,
      CREATE INDEX
      ,
      CREATE TRIGGER
      ,
      CREATE FUNCTION
      , and
      CREATE AGGREGATE
      statement. Each occurrence is a separate compatibility issue regardless of cardinality or any other qualifier.
    • has_issues
      MUST be
      true
      whenever one or more such statements are found. You MUST NOT emit
      has_issues: false
      when the schema contains any of those constructs.
    • details.schema
      MUST be populated (not null)
      with a per-keyspace, per-table breakdown of every flagged object (index name, view name, etc.), and
      summary.schema.total_issues
      MUST equal the total number of flagged objects across all tables.
    Worked example —
    ecommerce
    keyspace schema containing
    orders_by_customer
    (materialized view),
    orders_status_idx
    (secondary index), and
    customers_email_idx
    (secondary index):
    json
    {
      "compatibility": {
        "has_issues": true,
        "summary": {
          "total_issues": 3,
          "schema": {
            "total_issues": 3,
            "keyspaces_affected": 1,
            "tables_affected": 2,
            "functions": 0,
            "aggregates": 0
          },
          "query_patterns": null
        },
        "details": {
          "schema": {
            "functions": 0,
            "aggregates": 0,
            "keyspaces": {
              "ecommerce": {
                "orders": {
                  "indexes": ["orders_status_idx"],
                  "triggers": [],
                  "materializedViews": ["orders_by_customer"]
                },
                "customers": {
                  "indexes": ["customers_email_idx"],
                  "triggers": [],
                  "materializedViews": []
                }
              }
            }
          },
          "query_patterns": null
        }
      }
    }
  • You MUST follow the Script execution model: announce, print the command, present JSON output.
The command to run this analysis yourself:
bash
cd scripts && npx ts-node --project tsconfig.scripts.json parse-cassandra.ts \
  --dir /tmp/cassandra-diag --region us-east-1 | tee /tmp/keyspaces-calc.json
Load mode-2-cassandra-diagnostics.md for the intake table and cassandra-capture-commands.md for capture commands.
必填: 诊断目录中的
nodetool tablestats
以及每个节点的一个
nodetool info
文件。 可选:
nodetool status
DESCRIBE SCHEMA
(schema.cql)、
rowsize
输出、预处理语句NDJSON。
约束条件:
  • 不得将单个诊断文件
    file_read
    到上下文中 — 文件过大,会超出上下文窗口。相反,将目录路径传递给
    parse-cassandra.ts --dir <path>
  • 不得在没有
    tablestats
    和至少一个
    info
    文件的情况下调用
    parse-cassandra.ts
  • 当缺少
    status
    schema
    时,必须询问每个数据中心的节点数和RF。
  • 当存在Schema时,必须显示
    compatibility
    块 — 将物化视图、二级索引、触发器、UDF、UDA标记为UNSUPPORTED。
    • 解析步骤(输出前): 扫描Schema中的每个
      CREATE MATERIALIZED VIEW
      CREATE INDEX
      CREATE TRIGGER
      CREATE FUNCTION
      CREATE AGGREGATE
      语句。无论基数或其他限定符如何,每个此类语句都是一个独立的兼容性问题
    • 只要发现一个或多个此类语句,
      has_issues
      必须设为
      true
      。如果Schema包含任何这些构造,不得输出
      has_issues: false
    • details.schema
      必须填充(不为null)
      ,包含每个keyspace、每个表的所有标记对象(索引名称、视图名称等)的细分,且
      summary.schema.total_issues
      必须等于所有表中标记对象的总数。
    示例 —
    ecommerce
    keyspace的Schema包含
    orders_by_customer
    (物化视图)、
    orders_status_idx
    (二级索引)和
    customers_email_idx
    (二级索引):
    json
    {
      "compatibility": {
        "has_issues": true,
        "summary": {
          "total_issues": 3,
          "schema": {
            "total_issues": 3,
            "keyspaces_affected": 1,
            "tables_affected": 2,
            "functions": 0,
            "aggregates": 0
          },
          "query_patterns": null
        },
        "details": {
          "schema": {
            "functions": 0,
            "aggregates": 0,
            "keyspaces": {
              "ecommerce": {
                "orders": {
                  "indexes": ["orders_status_idx"],
                  "triggers": [],
                  "materializedViews": ["orders_by_customer"]
                },
                "customers": {
                  "indexes": ["customers_email_idx"],
                  "triggers": [],
                  "materializedViews": []
                }
              }
            }
          },
          "query_patterns": null
        }
      }
    }
  • 必须遵循脚本执行模型:声明参考文件、打印命令、呈现JSON输出。
自行执行此分析的命令
bash
cd scripts && npx ts-node --project tsconfig.scripts.json parse-cassandra.ts \
  --dir /tmp/cassandra-diag --region us-east-1 | tee /tmp/keyspaces-calc.json
加载mode-2-cassandra-diagnostics.md获取输入表,加载cassandra-capture-commands.md获取捕获命令。

4. Check Keyspaces Compatibility (Mode 3)

4. Keyspaces兼容性检查(模式3)

Parameters: at least one of
--schema <path.cql>
or
--prepared <path.ndjson>
.
Constraints:
  • You MUST state compatibility in binary terms — every flagged feature is UNSUPPORTED. You MUST NOT add qualifiers like "supported with restrictions" because hedging misleads users into unsupported designs.
  • Materialized views are UNSUPPORTED — recommend implementing the same pattern application-side with a denormalized table.
  • Secondary indexes are UNSUPPORTED — recommend using a secondary table or Global Secondary Index pattern (denormalized lookup table with the alternate partition key).
  • Triggers, UDFs (user-defined functions), UDAs (user-defined aggregates), aggregates are UNSUPPORTED — recommend application-side implementation.
  • You MUST report
    query_patterns.ttl_tables
    as informational, not an issue.
  • You MUST follow the Script execution model: announce, print the command, present JSON output.
  • If the user mentions specific features by name (e.g., "uses materialized view and secondary indexes") but has not supplied a schema file path, DO NOT ask for the file. Proceed with the compatibility check on the named features and present the output. Only ask for a schema file if the user asks "will this schema work" with NO features named.
  • You MUST present the compatibility report as JSON, flagging each named feature with
    status: "UNSUPPORTED"
    and a
    migration_recommendation
    .
The command to run this analysis yourself:
bash
cd scripts && npx ts-node --project tsconfig.scripts.json check-compatibility.ts \
  --schema /tmp/schema.cql --prepared /tmp/prepared.ndjson | tee /tmp/keyspaces-compat.json
Load mode-3-compatibility.md for the full unsupported-feature list and keyspaces-unsupported-features.md for migration guidance per feature.
参数: 至少提供
--schema <path.cql>
--prepared <path.ndjson>
中的一个。
约束条件:
  • 必须以二进制方式声明兼容性 — 每个标记的特性都是UNSUPPORTED。不得添加诸如"有限支持"之类的限定词,因为模糊表述会误导用户采用不支持的设计。
  • 物化视图不被支持 — 建议在应用端通过非规范化表实现相同模式。
  • 二级索引不被支持 — 建议使用二级表或全局二级索引模式(带有备用分区键的非规范化查找表)。
  • 触发器、UDF(用户自定义函数)、UDA(用户自定义聚合函数)、聚合函数不被支持 — 建议在应用端实现。
  • 必须将
    query_patterns.ttl_tables
    作为信息性内容报告,而非问题。
  • 必须遵循脚本执行模型:声明参考文件、打印命令、呈现JSON输出。
  • 如果用户提到特定特性的名称(例如:"使用物化视图和二级索引")但未提供Schema文件路径,不要索要文件。直接针对指定特性进行兼容性检查并呈现输出。 仅当用户询问"此Schema是否可用"且未指定任何特性时,才索要Schema文件。
  • 必须将兼容性报告以JSON形式呈现,每个指定特性标记为
    status: "UNSUPPORTED"
    并提供
    migration_recommendation
自行执行此分析的命令
bash
cd scripts && npx ts-node --project tsconfig.scripts.json check-compatibility.ts \
  --schema /tmp/schema.cql --prepared /tmp/prepared.ndjson | tee /tmp/keyspaces-compat.json
加载mode-3-compatibility.md获取完整的不支持特性列表,加载keyspaces-unsupported-features.md获取每个特性的迁移指导。

5. Translate SQL → Keyspaces (Mode 4)

5. SQL → Keyspaces转换(模式4)

Generate three data models, price each, recommend.
Three modeling strategies (you MUST price ALL THREE):
  1. Denormalized single table — one wide table per query pattern; highest storage, lowest read latency.
  2. Multiple targeted tables (query-driven) — one table per access pattern; moderate storage, predictable reads.
  3. Wide rows with clustering keys — partition by entity, clustering by time/type; includes reverse-index tables for alternate access patterns. Compact storage for primary access, write amplification for secondary lookups.
Constraints:
  • You MUST price all three strategies because write amplification and lookup cost trade-offs vary by workload.
  • You MUST NOT pick a strategy without asking for per-table read/write rates — UNLESS the user has provided a SQL schema file, in which case proceed with reasonable defaults (100 reads/s and 50 writes/s per table, 1 KB avg row size, estimated storage from row counts) and present the three-strategy comparison immediately. State the assumptions used.
  • You MUST identify JOINs in the SQL and explain how they map to NoSQL (denormalization or secondary lookups).
  • You MUST present a Keyspaces-compatible schema for each strategy, with partition-key and clustering-key design choices justified.
  • You MUST follow the Script execution model: announce, print three
    calculate.ts
    commands (one per strategy), present comparative JSON.
The commands to run this analysis yourself (three invocations, one per strategy):
bash
cd scripts
生成三种数据模型,分别定价并给出推荐。
三种建模策略(必须为所有三种策略定价):
  1. 非规范化单表 — 每个查询模式对应一个宽表;存储成本最高,读取延迟最低。
  2. 多目标表(查询驱动) — 每个访问模式对应一个表;存储成本适中,读取可预测。
  3. 带聚类键的宽行 — 按实体分区,按时间/类型聚类;包含用于备用访问模式的反向索引表。主访问的存储紧凑,二级查找存在写入放大。
约束条件:
  • 必须为所有三种策略定价,因为写入放大和查找成本的权衡因工作负载而异。
  • 不得在未询问每个表的读写速率的情况下选择策略 — 除非用户提供了SQL Schema文件,此时可使用合理的默认值(每个表100次读取/秒和50次写入/秒,平均行大小1KB,根据行数估算存储)并立即呈现三种策略的对比。说明使用的假设。
  • 必须识别SQL中的JOIN,并解释它们如何映射到NoSQL(非规范化或二级查找)。
  • 必须为每种策略提供Keyspaces兼容的Schema,并说明分区键和聚类键的设计理由。
  • 必须遵循脚本执行模型:声明参考文件、打印三个
    calculate.ts
    命令(每个策略一个)、呈现对比JSON。
自行执行此分析的命令(三次调用,每个策略一次):
bash
cd scripts

Strategy 1: denormalized single table

策略1:非规范化单表

npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r1> <w1> <b1> <gb1> 0 false | tee /tmp/keyspaces-s1.json
npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r1> <w1> <b1> <gb1> 0 false | tee /tmp/keyspaces-s1.json

Strategy 2: multiple targeted tables

策略2:多目标表

npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r2> <w2> <b2> <gb2> 0 false | tee /tmp/keyspaces-s2.json
npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r2> <w2> <b2> <gb2> 0 false | tee /tmp/keyspaces-s2.json

Strategy 3: wide rows with clustering keys

策略3:带聚类键的宽行

npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r3> <w3> <b3> <gb3> 0 false | tee /tmp/keyspaces-s3.json

Load [mode-4-sql-migration.md](references/mode-4-sql-migration.md) for SQL→CQL mapping and the comparison table.
npx ts-node --project tsconfig.scripts.json calculate.ts us-east-1 <r3> <w3> <b3> <gb3> 0 false | tee /tmp/keyspaces-s3.json

加载[mode-4-sql-migration.md](references/mode-4-sql-migration.md)获取SQL→CQL映射和对比表。

6. Generate a PDF Report (Optional)

6. 生成PDF报告(可选)

Constraints:
  • You MUST ask the user whether they want a PDF after displaying the JSON.
  • You MUST NOT generate a PDF for Mode 3 (no pricing data to render).
The command to run this yourself:
bash
cd scripts && npx ts-node --project tsconfig.scripts.json generate-pdf.ts \
  --input /tmp/keyspaces-calc.json --output /tmp/keyspaces.pdf
Load pdf-reporting.md for multi-input and label syntax.
约束条件:
  • 显示JSON后,必须询问用户是否需要PDF。
  • 不得为模式3生成PDF(无定价数据可渲染)。
自行执行此操作的命令
bash
cd scripts && npx ts-node --project tsconfig.scripts.json generate-pdf.ts \
  --input /tmp/keyspaces-calc.json --output /tmp/keyspaces.pdf
加载pdf-reporting.md获取多输入和标签语法。

Troubleshooting

故障排查

Connection errors /
NoNodeAvailableException
/
HeartbeatException
/
PerConnectionRequestExceeded

连接错误 /
NoNodeAvailableException
/
HeartbeatException
/
PerConnectionRequestExceeded

Load connection-troubleshooting.md. Covers application.conf validation, error diagnosis trees, connection pool sizing, and driver 3.x vs 4.x differences. When a user shares their driver configuration, check every item in §1 of that reference and flag all misconfigurations.
加载connection-troubleshooting.md。涵盖application.conf验证、错误诊断树、连接池大小设置以及驱动3.x与4.x的差异。当用户分享其驱动配置时,检查该参考文件第1节中的所有项目并标记所有配置错误。

Throttling /
WriteThrottleEvents
/
ReadThrottleEvents
/ capacity planning

限流 /
WriteThrottleEvents
/
ReadThrottleEvents
/ 容量规划

Load pre-warming.md. Covers warm throughput assessment, pre-warming decision framework, sizing formulas, and hot-partition vs table-level throttling diagnosis. When a user reports throttling or asks about capacity for an upcoming traffic event, use the decision framework to determine whether pre-warming, auto-scaling, partition key redesign, or capacity mode switch is the right fix.
加载pre-warming.md。涵盖预热吞吐量评估、预热决策框架、sizing公式以及热分区与表级限流的诊断。当用户报告限流或询问即将到来的流量事件的容量时,使用决策框架确定预热、自动扩缩容、分区键重新设计或容量模式切换是否是正确的解决方案。

Region not found: <region>

Region not found: <region>

Wrong region code or Keyspaces unavailable there. Check assets/data/regions.json.
区域代码错误或Keyspaces在该区域不可用。检查assets/data/regions.json

parse-cassandra.ts
exits with "Usage: …"

parse-cassandra.ts
退出并显示"Usage: …"

--tablestats
or
--info
missing. Recapture or use Mode 1.
缺少
--tablestats
--info
。重新捕获数据或使用模式1。

has_issues: false
but user expected findings

has_issues: false
但用户预期有问题

Only features in keyspaces-unsupported-features.md are flagged.
ALLOW FILTERING
,
TRUNCATE
, and most data types are supported.
keyspaces-unsupported-features.md中的特性会被标记。
ALLOW FILTERING
TRUNCATE
和大多数数据类型都受支持。

Context overflow when reading diagnostics

读取诊断数据时上下文溢出

Do not
file_read
large diagnostic files into context. Pass the directory to
parse-cassandra.ts --dir <path>
instead.
不要将大型诊断文件
file_read
到上下文中。改为将目录传递给
parse-cassandra.ts --dir <path>

Access denied capturing remote diagnostics

捕获远程诊断时访问被拒绝

Cassandra credentials or SigV4 plugin missing. See security-considerations.md.
缺少Cassandra凭证或SigV4插件。请参阅security-considerations.md

npm install
fails in
scripts/

scripts/
目录下
npm install
失败

Node < 18 or stale lockfile. Delete
scripts/node_modules/
and
scripts/package-lock.json
, rerun.
Node版本低于18或锁文件过期。删除
scripts/node_modules/
scripts/package-lock.json
,重新运行。

LWT inside UNLOGGED BATCH is NOT supported

UNLOGGED BATCH中的LWT不被支持

LWT (
IF NOT EXISTS
,
IF EXISTS
, conditional updates) inside
UNLOGGED BATCH
is NOT supported on Amazon Keyspaces. LWT statements must be run individually (standalone). LOGGED BATCH is also NOT supported on Keyspaces. Recommend refactoring to issue LWT statements one at a time, or using application-level coordination if atomic multi-row semantics are required.
在Amazon Keyspaces上,UNLOGGED BATCH中的LWT(
IF NOT EXISTS
IF EXISTS
、条件更新)不被支持。LWT语句必须单独运行(独立执行)。Keyspaces也不支持LOGGED BATCH。建议重构为逐个执行LWT语句,如果需要原子多行语义,可使用应用级协调。

Additional Resources

额外资源

Handoff from aws-database-selection

从aws-database-selection移交

This skill can be invoked directly, or it can be entered from the
aws-database-selection
parent skill after that skill has run a requirements interview and produced a
requirements.json
artifact. When you see a backtick-wrapped path matching
aws_dbs_requirements/*/requirements.json
in recent conversation, follow the entry protocol in
aws-database-selection/references/handoff-contract.md
:
  1. Read the artifact using
    file_read
    .
  2. Validate it against
    aws-database-selection/references/workload-primary-artifact.schema.json
    . If malformed or unreadable, tell the user and proceed without it.
  3. Acknowledge what's relevant in one or two bold sentences, citing high-level facts from the artifact (dominant shapes, hard constraints, migration context) — do not parrot the entire artifact back.
  4. Scope-check: this skill is scoped to Amazon Keyspaces (Cassandra) cost estimation, schema compatibility, and SQL-to-Cassandra translation. If the artifact's
    workload_primaries.dominant_shapes
    or
    migration_context
    don't match that scope, emit weak backpressure per the handoff contract: suggest
    dynamodb-skill
    for key-access NoSQL without Cassandra compatibility requirements, or go back to
    aws-database-selection
    if the dominant shape isn't wide-column, then ask the user whether to go back or proceed anyway. Do not silently misuse the artifact.
  5. Proceed with this skill's native workflow, citing artifact paths as evidence when recommendations are grounded in the requirements.
All user-facing output from this skill follows the markdown-primitives-only formatting convention in the handoff contract: bold labels, backticks for paths and enum values, bullet lists for alternatives, no ASCII art or box-drawing characters.
本技能可直接调用,也可在
aws-database-selection
父技能完成需求访谈并生成
requirements.json
工件后进入。如果在近期对话中看到反引号包裹的路径匹配
aws_dbs_requirements/*/requirements.json
,请遵循
aws-database-selection/references/handoff-contract.md
中的进入协议:
  1. 使用
    file_read
    读取工件。
  2. 根据
    aws-database-selection/references/workload-primary-artifact.schema.json
    验证工件。如果格式错误或无法读取,告知用户并在不使用该工件的情况下继续。
  3. 用一两句加粗的句子确认相关内容,引用工件中的高级事实(主导形状、硬约束、迁移上下文) — 不要复述整个工件。
  4. 范围检查:本技能的范围是Amazon Keyspaces(Cassandra)的成本估算、Schema兼容性以及SQL到Cassandra的转换。如果工件的
    workload_primaries.dominant_shapes
    migration_context
    与该范围不匹配,根据移交合同发出弱回压:建议对于不需要Cassandra兼容性的键值访问NoSQL使用
    dynamodb-skill
    ,如果主导形状不是宽列,则返回
    aws-database-selection
    ,然后询问用户是返回还是继续。不得擅自误用工件。
  5. 继续执行本技能的原生工作流,当建议基于需求时,引用工件路径作为证据。
本技能的所有用户输出遵循移交合同中的仅markdown原语格式约定:加粗标签、反引号表示路径和枚举值、项目符号列表表示替代方案,不使用ASCII艺术或框绘字符。