amazon-q

Instructions for using the Amazon Q Developer command-line tool with project rules or custom chat context. Amazon Q Developer is an AI assistant for software development.

In plain words
What is it for?
It helps request code refactoring through Amazon Q, such as splitting a function, extracting discount logic, or converting callback-based code to async/await. The instructions can be loaded from .amazonq/rules, a chat command, or supported IDE settings.
Why use it?
It gives Amazon Q a reusable set of refactoring instructions instead of requiring the same context to be pasted for every request. It also describes where those instructions can be configured.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/muhiminosim/code-refactoring-skill/amazon-q
Clone the repo
git clone --depth 1 https://github.com/MuhiminOsim/code-refactoring-skill
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 230 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00230
Opus 5 $0.00000 $0.00115
Sonnet 5 $0.00000 $0.00046
Haiku 4.5 $0.00000 $0.00023

Measured 2d ago against content hash f43a53a6c273, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

amazon-q scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -o .amazonq/rules/refactor.md \
agents/amazon-q.md · 42 lines

What it actually says

Setup: Amazon Q Developer

Amazon Q Developer CLI loads rules from .amazonq/rules/ in the project root.

mkdir -p .amazonq/rules
curl -o .amazonq/rules/refactor.md \
  https://raw.githubusercontent.com/MuhiminOsim/code-refactoring-skill/main/PROMPT.md

Via q chat context

q chat --context "$(cat PROMPT.md)"

Or add to your shell alias:

alias qr='q chat --context "$(cat ~/.refactor-skill/PROMPT.md)"'
qr "refactor src/orders.py"

Via IDE Extension (VS Code / JetBrains)

  1. Open Amazon Q panel → Settings → Custom Instructions
  2. Paste contents of PROMPT.md

Usage

q chat

> /dev refactor the processOrder function in src/orders.ts

> extract the discount logic into a separate function

> this has callback pyramid, convert to async/await
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 42 lines · 0 tokens per session scan A f43a53a6c273

Subscribe to this mod's changes

amazon-q is an agent published in the GitHub repository MuhiminOsim/code-refactoring-skill (5 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 230 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.