본문으로 건너뛰기
cccskills
무료GitHub에 공개

code-agent-patterns

Use when building autonomous code editing, bug fixing, or software engineering agents. Keywords: SWE-agent, code agent, bug localization, patch generation, AST, diff, TDD loop, repository indexing.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Autonomous Code Agent Patterns

Overview

The code-agent-patterns skill provides a standardized architectural framework for building, maintaining, and scaling autonomous Software Engineering (SWE) agents. It focuses on reliability, precision, and contextual awareness, drawing heavily from industry benchmarks like SWE-Bench and modern LLM-driven development tools.

When To Use

  • Implementing autonomous code editing agents.
  • Designing specialized agents for bug localization or patch generation.
  • Orchestrating multi-agent systems for code review or testing.
  • Building tools that need to interface with existing large codebases.

Core Patterns

1. Minimal Context Assembly

Avoid dumping the entire repository into the LLM context. Instead:

  • Use dependency graph analysis to identify "impact zones."
  • Implement "Breadth-First Context Discovery" (start with high-level symbols, drill down only when necessary).
  • Support dynamic file inclusion based on the specific task (e.g., test files, related interfaces).

2. Symbol-Level Repository Indexing

Build a robust index that enables the agent to navigate the codebase as a human developer would:

  • Symbol Maps: Index classes, functions, and interfaces along with their file locations.
  • Call Graphs: Track function calls and dependencies to understand side effects.
  • AST Analysis: Utilize Abstract Syntax Tree (AST) parsing to ensure structural awareness during code modifications.

3. Unified Diff & Search-Replace Patching

To minimize hallucination and merge conflicts:

  • Prefer "Search-Replace" blocks over entire file rewrites.
  • Validate that the "Search" block matches exact file content before applying the "Replace" content.
  • Use unified diffs as a secondary representation for human review.

TDD Fix Loop Workflow

Agents must follow a strict "Red-Green-Refactor" loop for any bug fix:

  1. Reproduce: Write a test case that captures the reported bug (assert failure).
  2. Localize: Identify the source using logs, stack traces, or symbol-level search.
  3. Patch: Apply minimal code changes to satisfy the failing test.
  4. Verify: Run the test suite.
  5. Rollback: If tests fail after patching, discard changes and restart the process.

Multi-Agent Coding Triad

To ensure high-quality output, structure teams as:

  • Coder: Responsible for reading the codebase and proposing patches.
  • Code Reviewer: Audits patches for logic errors, style violations, and architecture alignment.
  • Test Engineer: Manages test execution and ensures sufficient coverage for the change.

Patch Validation Pipeline

Every proposed change must survive an automated gauntlet:

  1. Syntax Check: Ensure the code is parsable.
  2. Type Check: Validate against TypeScript/Python type definitions.
  3. Unit Tests: Pass local unit tests.
  4. Lint: Adhere to project linting standards.
  5. Security Scan: Check against common patterns like OWASP Top 10.

SWE-Bench Lessons

  • Mitigation Strategy: The most common failure mode is "blind editing" without understanding global constraints. Ensure agents have access to ADR (Architecture Decision Records).
  • Hard Fixes: Avoid over-complex regex. Use AST-based transformations whenever possible.
  • Context Drift: Periodically refresh context maps when making many changes in a single session.

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

2d-games

무료

2D game development principles. Sprites, tilemaps, physics, camera.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

3d-games

무료

3D game development principles. Rendering, shaders, physics, cameras.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

aesthetic

무료

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when implementing or managing persistent, hierarchical memory systems for AI agents. Covers cross-session state, fact supersession, and self-managed memory tools to enable long-term recall and adaptive agent behavior.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when monitoring, tracing, or debugging agentic workflows in production. Keywords: observability, tracing, OpenTelemetry, Langfuse, latency, token cost, loop detection, telemetry.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

VoDaiLocz/kilo-kit-mcp282026년 9월 13일 업데이트

VoDaiLocz의 스킬 모두 보기

이 스킬의 문제 신고