Learning
Kiro IDE

Kód szerkesztés és refaktorálás AI-val

Refaktor, hibajavítás, tesztírás, dokumentáció, magyarázat és code review minták Kiro-val.

Kód szerkesztés és refaktorálás AI-val

Refaktorálás kérése

A Kiro kiemelkedően jó komplex refaktorálási feladatokban, ahol több fájlt érint a változás:

@src/store/userStore.ts
@src/hooks/useUser.ts
@src/components/UserProfile.tsx

The userStore is using local state for authentication.
Refactor it to use Zustand with persist middleware.
Update all related hooks and components to use the new store.
Don't change the existing component API.

Hibajavítás

Hibaüzenet beillesztésével a Kiro képes diagnosztizálni és kijavítani a problémát:

I'm getting this error in the console:

TypeError: Cannot read properties of undefined (reading 'map')
  at ProductList.tsx:34:23

@src/components/ProductList.tsx

The data is fetched with React Query. Find the root cause
and add proper null/loading state handling.

Tesztek írása meglévő kódhoz

@src/utils/formatCurrency.ts

Write comprehensive unit tests for this utility function using
Vitest. Cover edge cases: null input, negative numbers,
different currencies, and locale formatting.

Dokumentáció generálása

@src/api/ordersApi.ts

Generate JSDoc comments for all exported functions.
Include parameter descriptions, return types, and
usage examples for complex functions.

Kód magyarázat

Ismeretlen kódbázis esetén a Kiro magyarázni is tud:

@src/middleware/auth.ts

Explain how this middleware works step by step.
What security assumptions does it make?
Are there any potential vulnerabilities?

Kód review

@src/services/paymentService.ts

Review this code for:
1. Potential race conditions
2. Error handling completeness
3. Security issues
4. Performance bottlenecks

Suggest concrete improvements with code examples.

Rövid összefoglaló

  • A Kiro több fájlt érintő refaktorálást is képes koordináltan elvégezni.
  • Hibaüzenetek közvetlen beillesztésével gyorsan diagnosztizálható a probléma gyökere.
  • Tesztek, dokumentáció és kód review is kérhető természetes nyelven.

On this page