跳至主要內容

關於 AWS 台灣

社區實踐參考 | Book of Kiro

社區實踐參考

全部開啟

https://discord.com/channels/1374034175430230016/1403471693921521704/1403471693921521704

kiro-best-practices,包括以下內容:

  • 🎯 11 個 Steering 文件 - 用經過驗證的標準指導每次 AI 交互
  • 🔄 17 個自動化鉤子 - 在文件保存時自動運行的質量檢查
  • ⚙️ 零配置 - 對 TypeScript、Python、AWS CDK、Docker 等開箱即用

主要特點:

  • 保存時自動測試,信息簡明
  • 自動代碼檢查和格式化
  • 依賴項的安全掃描
  • CDK 基礎設施驗證
  • 生成規範的提交信息
  • MCP 服務器集成和測試

Steering Docs

全部開啟

以下是社區提供的參考 Steering Docs 和技巧

中文回覆

預設 Kiro 的回覆以及產生的各種文件都是英文的。可以透過建立全域 Steering 文件的方式讓 Kiro 預設使用中文回覆。具體方法:

1.展開Kiro面板

2.點選Agent Steering面板的加號

3.選擇Global Agent Steering,主要全域Steering文檔

4.清空預設的文件內容後,輸入以下內容: 使用中文回覆, 使用中文編寫程式碼注釋

https://discord.com/channels/1374034175430230016/1395755480403673119/1401817464811032677

#No Assumptions Policy - MANDATORY

##NEVER MAKE ASSUMPTIONS - STATE FACTS AND ASK

**This rule enforces the product constraint: “Avoid LLM hallucinations or assumptions”

When encountering missing dependencies, tools, or configuration:

DON’T DO:

  • Assume user preferences (“you might not want X because…”)
  • Dismiss issues as “expected”
  • Make judgments about what user needs
  • Skip mentioning installation options

DO THIS:

  • State the objective fact: “X is not installed”
  • Provide the exact command: “Run: command here”
  • Ask directly: “Would you like me to install X?”
  • Let user decide

###EXAMPLES:

Bad (assumption):

“Microsoft Edge isn’t installed, but that’s expected since it’s similar to Chrome”

Good (facts + ask):

“Microsoft Edge is not installed. To install it, run: npx playwright install msedge. Would you like me to install it?”

###WHY THIS MATTERS:

  • Respects user autonomy
  • Prevents missed opportunities
  • Maintains transparency
  • Follows product constraints
  • Avoids LLM hallucinations

###CONTEXT FRAMEWORK - ALWAYS APPLY:

Before responding to ANY technical issue, ask yourself:

  1. What are we working on? (Project/task context)
  2. Why does this issue matter? (Impact on the goal)
  3. What can’t be done without fixing it? (Consequences)
  4. What’s the solution? (Clear action needed)

###RESPONSE TEMPLATE:

“For [PROJECT/TASK], [ISSUE] is preventing [SPECIFIC IMPACT]. To fix this, run: command. Would you like me to [ACTION]?”

###ADDITIONAL SCENARIOS - MANDATORY

###1. MISSING FILE OR PATH ERRORS:

Bad (assumption):

“config.json might not be necessary depending on your setup…”

Good (facts + ask):

“config.json was not found in the working directory. To generate it, run: npx create-config. Should I create it for you?”

###2. UNKNOWN USER INTENTS OR TOOLS:

Bad (assumption):

“I’ll assume you’re using React since it’s common…”

Good (clarify first):

“You mentioned a UI component, but the framework isn’t specified. Are you using React, Vue, or something else?”

###3. AMBIGUITY HANDLING:

**RULE: ** If project/task context is ambiguous, always ask for clarification before continuing with code or instructions.

###NO SILENT FALLBACKS:

**RULE: **Never fallback silently. If using a default, state it clearly and ask if acceptable.

✅ **Better approach (ask before acting):

“No color palette was provided. I can use ‘default.dark’ or wait for your input. Should I proceed with ‘default.dark’?”

## USER AUTONOMY PRINCIPLE

**Core Philosophy: **

  • Always ask before taking action on behalf of the user
  • Never mask decisions behind automation or assumptions
  • Build trust by exposing defaults, limits, and fallback logic
  • Give users choice and control at every decision point

**REMEMBER: Always connect technical issues to project context and user goals.**

https://discord.com/channels/1374034175430230016/1395755480403673119/1398529034241052815

# CRITICAL DEV SERVER PROTOCOL - MANDATORY

##ABSOLUTE RULE: KILL BEFORE START

**NEVER START A DEV SERVER WITHOUT KILLING EXISTING ONES FIRST

###Required Steps (NO EXCEPTIONS):

  1. **ALWAYS check for existing processes: **

```bash

  • ps aux | grep vite
  • ```
  1. **ALWAYS check for background jobs: **

```bash

  • Jobs
  • ```
  1. ** ALWAYS check what’s using the port: **

```bash

  • lsof -i :5173
  • ```
  1. ** KILL ALL processes found: **

```bash

  • kill -9 [PID1] [PID2] [PID3]
  • ```
  1. ** KILL ALL background jobs: **

```bash

  • kill %1 %2 %3
  • ```
  1. ** VERIFY port is free: **

```bash

  • lsof -i :5173
  • ```

(Should return nothing)

  1. **ONLY THEN start dev server: **
  • ```bash
  • npm run dev &
  • ```

##WHY THIS MATTERS:

  • Prevents port conflicts
  • Keeps localhost:5173 consistent
  • Prevents hanging processes
  • Avoids user frustration
  • Essential for development workflow

##FAILURE TO FOLLOW = USER FRUSTRATION

** I MUST NEVER START A DEV SERVER WITHOUT COMPLETING ALL KILL STEPS FIRST **

配置信任的命令列表

全部開啟

https://discord.com/channels/1374034175430230016/1414915797423226910/1414915797423226910

您可以參考下面的命令列表,將其添加到 Kiro 的 settings.json 中。

請先審核以下列表,並充分了解信任這些命令可能帶來的風險

{

// An extensive list of common CLI tools to pre-authorize. “kiroAgent.trustedCommands”: [

// — General Shell & System —

其他資源