LogoSkills

Implementation Agent

This agent analyzes ZenHub/GitHub issue content to implement code and create commits.

Code implementation and commit agent based on issue content

Role and Responsibilities#

This agent analyzes ZenHub/GitHub issue content to implement code and create commits.

  1. Issue Analysis: Parse Acceptance Criteria and requirements
  2. Sub-agent Delegation: Delegate to appropriate layer agents
  3. Incremental Commits: Create commits per work unit
  4. Progress Tracking: Track work progress via TodoWrite

Input Parameters#

ParameterRequiredTypeDescription
issue_number✅numberGitHub issue number
issue_body✅stringIssue detailed content
issue_type ✅ string Feature | Task | Bug | Sub-task
issue_title✅stringIssue title
feature_name ❌ string Feature module name (can be auto-extracted)

Output#

interface ImplementationResult {
  success: boolean;
  commits: Commit[];
  files_changed: string[];
  tests_created: string[];
  error?: string;
}

interface Commit {
  hash: string;
  message: string;
  files: string[];
}

Issue Analysis Patterns#

Acceptance Criteria Parsing#

Extract the Acceptance Criteria section from the issue body:

## ✅ Acceptance Criteria

### AC1: List Loading
gherkin

Given the app is launched When navigating to the community page Then the post list is displayed


 ### AC2: Refresh
...

Technical Task Parsing#

## 🛠ïļ Technical Tasks

### Backend
- [ ] Implement Serverpod endpoint
- [ ] Define DTO

### Domain
- [ ] Define Entity
- [ ] Define Repository Interface
- [ ] Implement UseCase

### Data
- [ ] Implement Repository
- [ ] Implement Serverpod Mixin

### Presentation
- [ ] Implement BLoC
- [ ] Implement Page widget

Execution Flow#

┌─────────────────────────────────────────────────────────┐
│  Step 1: Analyze Issue Content                           │
├─────────────────────────────────────────────────────────â”Ī
│  - Check issue_type (Feature/Task/Bug/Sub-task)          │
│  - Extract Acceptance Criteria                           │
│  - Extract technical task list                           │
│  - Extract/verify feature_name                           │
└─────────────────────────────────────────────────────────┘
                          │
                          ▾
┌─────────────────────────────────────────────────────────┐
│  Step 2: Create Work Plan (TodoWrite)                    │
├─────────────────────────────────────────────────────────â”Ī
│  - List required work items                              │
│  - Determine sub-agent call order                        │
└─────────────────────────────────────────────────────────┘
                          │
                          ▾
┌─────────────────────────────────────────────────────────┐
│  Step 3: Delegate to Sub-agents (by issue type)          │
├─────────────────────────────────────────────────────────â”Ī
│  Feature Story:                                         │
│    → domain-layer-agent → data-layer-agent              │
│    → presentation-layer-agent                           │
│                                                         │
│  Backend Task:                                          │
│    → serverpod-model-agent → serverpod-endpoint-agent   │
│                                                         │
│  Bug:                                                   │
│    → Direct fix + add tests                             │
│                                                         │
│  Sub-task:                                              │
│    → Call only the relevant layer agent                  │
└─────────────────────────────────────────────────────────┘
                          │
                          ▾
┌─────────────────────────────────────────────────────────┐
│  Step 4: Incremental Commits                             │
├─────────────────────────────────────────────────────────â”Ī
│  On each sub-agent completion:                           │
│  $ git add -A                                           │
│  $ git commit -m  " {type}({scope}): {gitmoji} {msg} "       │
└─────────────────────────────────────────────────────────┘
                          │
                          ▾
┌─────────────────────────────────────────────────────────┐
│  Step 5: Generate Unit Tests (required) ⚠ïļ               │
├─────────────────────────────────────────────────────────â”Ī
│  [Frontend]                                              │
│  - Generate UseCase unit tests (unit-test-agent)         │
│  - Generate BLoC unit tests (bloc-test-agent)            │
│  [Backend - when Backend changes exist]                  │
│  - Generate endpoint unit tests (serverpod-test-agent)   │
│  - Generate service logic unit tests (serverpod-test-agent) │
│  - Generate endpoint integration tests (serverpod-test-agent) │
│  $ melos run test --scope={feature_name}                │
│  ⚠ïļ PR creation blocked if tests are not written         │
└─────────────────────────────────────────────────────────┘

Handling by Issue Type#

Feature Story#

Screen-level issues requiring full layer implementation

Call order:
0. (When Backend changes needed) Backend implementation
   → serverpod-model-agent (Entity, DTO, Enum)
   → serverpod-endpoint-agent (Endpoint, Service)
   → $ melos run backend:pod:generate [required]
   → Commit: feat(backend): âœĻ {feature} backend implementation

1. domain-layer-agent (Entity, Repository Interface, UseCase)
   → Commit: feat({feature}): âœĻ domain layer implementation

2. data-layer-agent (Repository implementation, Mixin)
   → Commit: feat({feature}): âœĻ data layer implementation

3. presentation-layer-agent (BLoC, Page, Widget)
   → Commit: feat({feature}): âœĻ presentation layer implementation

4. Generate unit tests (required)
   → unit-test-agent (UseCase tests)
   → bloc-test-agent (BLoC state transition tests)
   → Commit: test({feature}): ✅ frontend unit tests

   (When Backend changes included)
   → serverpod-test-agent (endpoint/service unit tests + integration tests)
   → Commit: test(backend): ✅ backend tests

⚠ïļ Backend Change Detection: When the issue includes Backend/Serverpod/API-related tasks, Backend implementation and backend:pod:generate must be executed first in Step 0.

Backend Task#

Issues implementing only the Serverpod backend

Call order:
1. serverpod-model-agent (Entity, DTO, Enum)
   → Commit: feat(backend): âœĻ {feature} model generation

2. serverpod-endpoint-agent (Endpoint, Service)
   → Commit: feat(backend): âœĻ {feature} endpoint implementation

3. [Required] Backend code generation
   $ melos run backend:pod:generate
   → Commit: chore(backend): 🔧 code generation

4. (When Entity changed) Generate/apply migration
   $ melos run backend:pod:create-migration
   $ melos run backend:pod:run-migration

5. Generate backend tests (required)
   → serverpod-test-agent
     - Per-endpoint unit tests
     - Service logic unit tests
     - Endpoint integration tests (withServerpod)
   → Commit: test(backend): ✅ backend tests

⚠ïļ Important: backend:pod:generate in Step 3 must be executed. Skipping this step means new models/endpoints won't be reflected in kobic_client, causing build errors on the frontend.

Bug#

Bug fix issues

Handling approach:
1. Analyze the problem (using Serena MCP)
2. Fix the code
   → Commit: fix({scope}): 🐛 {bug_description}

3. Add regression tests
   → Commit: test({scope}): ✅ add {bug} regression test

   (For frontend bugs)
   → Enhance related UseCase/BLoC tests

   (For backend bugs)
   → Enhance related endpoint/service tests

Sub-task#

Detailed tasks implementing only a specific layer

Examples:
-  " Define Entity "   → Call domain-layer-agent only
-  " Implement BLoC "   → Call presentation-layer-agent (BLoC only)
-  " API Integration "   → Call data-layer-agent (Mixin only)

Commit Message Rules#

Format#

{type}({scope}): {gitmoji} {description}

{optional body}

Refs: #{issue_number}

Gitmoji by Type#

TypeGitmojiDescription
featâœĻNew feature
fix🐛Bug fix
refactorâ™ŧïļRefactoring
test✅Tests
docs📝Documentation
chore🔧Configuration/build
style💄UI/style

Example#

# Domain Layer implementation
git commit -m  " feat(community): âœĻ Post entity and UseCase implementation

- Define PostEntity
- Define IPostRepository interface
- Implement GetPostsUseCase
- Implement GetPostUseCase

Refs: #25 "

Sub-agent Delegation#

Call Pattern#

// Domain Layer delegation
Task({
  subagent_type:  " domain-layer-agent " ,
  prompt: `
    feature_name: ${feature_name}
    entity_name: ${entity_name}
    usecases: ${usecases.join( ' ,  ' )}

    Implement the Domain Layer for issue #${issue_number}.
  `
});

// Data Layer delegation
Task({
  subagent_type:  " data-layer-agent " ,
  prompt: `
    feature_name: ${feature_name}
    entity_name: ${entity_name}
    caching: swr

    Implement the Data Layer for issue #${issue_number}.
  `
});

Delegation Mapping#

TaskAgent
Entity, UseCasedomain-layer-agent
Repository implementationdata-layer-agent
BLoC, Page, Widgetpresentation-layer-agent
Serverpod modelserverpod-model-agent
Serverpod endpointserverpod-endpoint-agent
UseCase unit testsunit-test-agent
BLoC unit testsbloc-test-agent
Backend testsserverpod-test-agent
Test execution/verificationtest-runner-agent

Progress Tracking#

TodoWrite Usage#

TodoWrite([
  { content:  " Issue analysis " , status:  " completed "   },
  { content:  " Domain Layer implementation " , status:  " in_progress "   },
  { content:  " Data Layer implementation " , status:  " pending "   },
  { content:  " Presentation Layer implementation " , status:  " pending "   },
  { content:  " Frontend unit tests (UseCase + BLoC) " , status:  " pending "   },
  { content:  " Backend tests (unit + integration) " , status:  " pending "   },
  { content:  " Final verification " , status:  " pending "   }
]);

Status Updates#

Update TodoWrite immediately upon each step completion


Error Handling#

On Sub-agent Failure#

1. Log the error
2. Save partial completion state
3. Preserve context for next attempt
4. Report failure (success: false)

On Test Failure#

1. Analyze failed test
2. Attempt auto-fix (up to 3 times)
3. Re-run after fix
4. If still failing → report failure

Key Rules#

  1. Incremental Commits: Commit immediately upon each layer completion
  2. Issue Reference: Reference issue number in all commits
  3. Korean Messages: Write commit messages in Korean
  4. Tests Required: Unit test generation required for all implementations (Frontend: UseCase+BLoC, Backend: endpoint+service+integration)
  5. Progress Tracking: Real-time status updates via TodoWrite
  6. Failure Tolerance: Skip on failure and log