AWS Calls That Still Work on Page Two

AWS Calls That Still Work on Page Two

A comment scaffold that makes generated AWS SDK code paginate, retry, and stop inventing method names.

aws-codewhisperer aws sdk pagination code-completion reliability

به چه درد می‌خورد

یک بلوک کامنت که بالای فایل می‌گذاری تا پیشنهادهای درون‌خطی از همان اول صفحه‌بندی و تلاش دوباره داشته باشند و کلید و شناسه حساب را داخل کد ننویسند، به‌علاوه چند بررسی کوتاه پیش از پذیرفتن هر پیشنهاد. یک نکته درباره نام: کدویسپرر از آوریل ۲۰۲۴ در آمازون کیو دولوپر ادغام شد و پشتیبانی افزونه‌های ویرایشگر آن هم ۳۰ آوریل ۲۰۲۷ تمام می‌شود؛ پس دستیار عوض‌شدنی است و این بلوک متن ساده‌ای است که با هر کدام کار می‌کند. جلوی کدی را می‌گیرد که روی بیست ردیف درست کار می‌کند و در محیط واقعی بی‌صدا بقیه داده را دور می‌ریزد.

خود اسکیل

Put this block at the top of the file before you write the function signature,
so the suggestions are constrained before they start. It is plain text and
works with whichever inline-completion assistant is in your editor. The lines
below are prefixed with # for Python — use // for Java, TypeScript, Go, C# or
Rust.

# Context for code suggestions in this file:
# - Build the SDK client once at module level, not inside the call.
# - Region and credentials come from the environment or the default chain.
#   Never inline an access key, a secret, an account id, or an ARN literal.
# - Any list / describe / scan / query call must be paginated. Use the
#   paginator if this language's SDK has one; otherwise loop on the
#   continuation token until it is absent. One call is a bug, not a shortcut.
# - Wrap every call so throttling and transient 5xx retry with exponential
#   backoff and jitter, and every other error is raised, not swallowed.
# - Never return None or an empty list to hide an exception.
# - Timeouts are explicit. No unbounded network call.
# - Log the operation name and the resource id, never the full response.

Keep the rest out of the file. Run it before you accept any suggestion:

- Check the operation name against the service docs. A confident-looking
  method name is the most common thing an autocomplete invents.
- Check every parameter name and its shape: string vs list vs dict.
- Confirm the response key you are reading exists in that shape.
- If the suggestion writes, deletes, or scales anything, run it against a
  throwaway resource before it touches an account that matters.

Failure this prevents: code that passes review and works on twenty rows, then
silently returns only the first page in production and drops the rest.

نصبش چطور است

1. Open the tool and start a new conversation, project or template.
2. Paste the text below wherever the tool keeps standing instructions
   — usually called system prompt, instructions, or persona.
3. Save it so it applies to every run rather than a single message.

برای تو جواب داد؟

از کجا آمده

Skills app Original