엔터프라이즈 패턴
대규모 팀과 복잡한 프로젝트를 위한 고급 패턴
엔터프라이즈 패턴
대규모 팀과 복잡한 프로젝트에서 Kiro를 효과적으로 활용하는 고급 패턴을 다룹니다.
v0.9~v0.11 엔터프라이즈 업데이트
| 기능 | 버전 | 설명 |
|---|---|---|
| GovCloud 지원 | v0.9.2+ | AWS GovCloud (US-East/West) 정식 지원, IAM Identity Center 인증 |
| Okta/Entra ID | v0.9+ | Okta, Microsoft Entra ID 로그인 추가 |
| MCP Registry Governance | v0.11 | 허용 MCP 서버 중앙 관리 (JSON 레지스트리, HTTPS 호스팅) |
| Model Governance | v0.11 | 조직 내 사용 가능 AI 모델 관리자 제어 |
| Extension Registry | v0.9+ | VS Code 확장 레지스트리 중앙 관리 |
GovCloud 지원 (v0.9.2+)
# GovCloud 엔드포인트 설정
# IDE v0.9.2+ / CLI v1.25.0+ 필요
# GovCloud에서는 IAM Identity Center만 인증 수단 (소셜 로그인 불가)
# VPN/Direct Connect를 통한 프라이빗 엔드포인트 지원Model Governance (v0.11)
관리자가 조직 내에서 사용 가능한 AI 모델을 제어합니다. 비용 관리나 보안 정책에 따라 특정 모델만 허용할 수 있습니다.
팀 표준화 전략
중앙집중식 Steering 관리
# 팀 공통 Steering 저장소 구조
team-kiro-config/
├── steering/
│ ├── global/
│ │ ├── coding-standards.md
│ │ ├── security-guidelines.md
│ │ └── performance-rules.md
│ ├── frontend/
│ │ ├── react-patterns.md
│ │ └── ui-guidelines.md
│ ├── backend/
│ │ ├── api-standards.md
│ │ └── database-patterns.md
│ └── devops/
│ ├── deployment-rules.md
│ └── monitoring-setup.md
├── hooks/
│ ├── common/
│ └── project-specific/
└── mcp-configs/
├── development.json
├── staging.json
└── production.jsonGit Submodule 활용
# 프로젝트에 팀 설정 추가
git submodule add https://github.com/company/team-kiro-config .kiro-team
# .kiro/steering에 심볼릭 링크 생성
ln -s ../.kiro-team/steering/* .kiro/steering/
# 팀 설정 업데이트
git submodule update --remote .kiro-team대규모 코드베이스 관리
모듈별 컨텍스트 분리
<!-- .kiro/steering/module-context.md -->
---
inclusion: fileMatch
fileMatchPattern: "src/modules/auth/**"
---
# 인증 모듈 컨텍스트
## 관련 파일
#[[file:src/types/auth.ts]]
#[[file:docs/auth-flow.md]]
#[[file:config/auth-config.json]]
## 보안 요구사항
- JWT 토큰 만료 시간: 15분
- 리프레시 토큰: 7일
- 2FA 필수 적용
- 비밀번호 정책: 최소 12자, 특수문자 포함마이크로서비스 패턴
// .kiro/settings/mcp.json - 서비스별 MCP 설정
{
"mcpServers": {
"user-service": {
"command": "uvx",
"args": ["mcp-server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://localhost/users",
"SERVICE_NAME": "user-service"
}
},
"order-service": {
"command": "uvx",
"args": ["mcp-server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://localhost/orders",
"SERVICE_NAME": "order-service"
}
},
"api-gateway": {
"command": "node",
"args": ["./tools/gateway-mcp.js"],
"env": {
"GATEWAY_URL": "https://api.company.com"
}
}
}
}CI/CD 통합 패턴
GitHub Actions 연동
# .github/workflows/kiro-quality-check.yml
name: Kiro Quality Check
on: [pull_request]
jobs:
kiro-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Kiro CLI
run: |
curl -fsSL https://kiro.dev/install.sh | sh
kiro auth login --token ${{ secrets.KIRO_TOKEN }}
- name: Run Kiro Code Review
run: |
kiro review --pr ${{ github.event.number }} \
--format json \
--output review-results.json
- name: Comment PR
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('review-results.json'));
const comment = `## 🤖 Kiro 코드 리뷰
**품질 점수**: ${results.quality_score}/100
### 주요 발견사항
${results.issues.map(issue => `- ${issue.message}`).join('\n')}
### 개선 제안
${results.suggestions.map(s => `- ${s.description}`).join('\n')}
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});Jenkins 파이프라인
// Jenkinsfile
pipeline {
agent any
stages {
stage('Kiro Analysis') {
steps {
script {
// Kiro를 사용한 코드 분석
sh '''
kiro analyze --project . \
--rules .kiro/enterprise-rules.json \
--output analysis.json
'''
// 결과 파싱 및 품질 게이트
def analysis = readJSON file: 'analysis.json'
if (analysis.quality_score < 80) {
error("코드 품질 점수가 기준(80) 미달: ${analysis.quality_score}")
}
}
}
}
stage('Kiro Documentation') {
steps {
sh '''
kiro docs generate \
--format markdown \
--output docs/api/
'''
}
}
}
}보안 및 컴플라이언스
민감 정보 보호
<!-- .kiro/steering/security-rules.md -->
---
inclusion: always
---
# 보안 규칙
## 금지 패턴
- 하드코딩된 API 키, 비밀번호
- 개인정보 로깅
- SQL 인젝션 취약점
- XSS 취약점
## 필수 검증
- 입력값 검증 및 sanitization
- 출력값 인코딩
- 인증/인가 체크
- 에러 메시지에서 민감 정보 제거
## 코드 예시
```typescript
// ❌ 잘못된 예시
const apiKey = "sk-1234567890abcdef";
console.log(`User data: ${JSON.stringify(userData)}`);
// ✅ 올바른 예시
const apiKey = process.env.API_KEY;
console.log(`User logged in: ${userData.id}`);감사 로그 패턴
// .kiro/hooks/audit-log.json
{
"name": "Security Audit Log",
"version": "1.0.0",
"when": {
"type": "fileEdited",
"patterns": ["src/auth/**", "src/security/**", "src/api/**"]
},
"then": {
"type": "runCommand",
"command": "node scripts/audit-log.js"
}
}// scripts/audit-log.js
const fs = require('fs');
const path = require('path');
const auditEntry = {
timestamp: new Date().toISOString(),
user: process.env.USER,
action: 'file_modified',
file: process.env.KIRO_MODIFIED_FILE,
project: path.basename(process.cwd()),
commit: process.env.GIT_COMMIT || 'uncommitted'
};
fs.appendFileSync('.kiro/audit.log', JSON.stringify(auditEntry) + '\n');성능 모니터링
메트릭 수집
// tools/kiro-metrics.ts
interface KiroMetrics {
sessionDuration: number;
contextSize: number;
responseTime: number;
errorRate: number;
userSatisfaction: number;
}
class MetricsCollector {
private metrics: KiroMetrics[] = [];
async collectSessionMetrics(sessionId: string): Promise<KiroMetrics> {
const session = await this.getSession(sessionId);
return {
sessionDuration: session.endTime - session.startTime,
contextSize: session.context.length,
responseTime: session.averageResponseTime,
errorRate: session.errors.length / session.interactions.length,
userSatisfaction: session.feedbackScore || 0
};
}
async generateReport(): Promise<void> {
const report = {
period: this.getPeriod(),
totalSessions: this.metrics.length,
averageMetrics: this.calculateAverages(),
trends: this.analyzeTrends(),
recommendations: this.generateRecommendations()
};
await this.saveReport(report);
await this.sendToMonitoring(report);
}
}대시보드 연동
# docker-compose.monitoring.yml
version: '3.8'
services:
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- ./monitoring/grafana:/var/lib/grafana
kiro-exporter:
build: ./monitoring/kiro-exporter
ports:
- "8080:8080"
environment:
- KIRO_API_TOKEN=${KIRO_TOKEN}고급 자동화 패턴
멀티 환경 배포
#!/bin/bash
# scripts/multi-env-deploy.sh
environments=("dev" "staging" "prod")
services=("frontend" "backend" "api")
for env in "${environments[@]}"; do
echo "🚀 Deploying to $env environment..."
# 환경별 Kiro 설정 로드
export KIRO_CONFIG=".kiro/configs/$env.json"
for service in "${services[@]}"; do
echo "📦 Deploying $service to $env..."
# Kiro를 사용한 배포 전 검증
kiro validate \
--service "$service" \
--environment "$env" \
--config "$KIRO_CONFIG"
if [ $? -eq 0 ]; then
# 배포 실행
kiro deploy \
--service "$service" \
--environment "$env" \
--auto-rollback
else
echo "❌ Validation failed for $service in $env"
exit 1
fi
done
done장애 대응 자동화
// .kiro/hooks/incident-response.json
{
"name": "Incident Response",
"version": "1.0.0",
"when": {
"type": "userTriggered"
},
"then": {
"type": "askAgent",
"prompt": "장애 대응 프로세스를 시작합니다. 다음 단계를 수행해주세요:\n1. 장애 현황 파악\n2. 영향도 분석\n3. 임시 조치 방안 수립\n4. 근본 원인 분석\n5. 재발 방지 대책 수립\n\n현재 시스템 상태를 확인하고 보고서를 작성해주세요."
}
}ROI 측정 및 최적화
생산성 메트릭
interface ProductivityMetrics {
codeGenerationSpeed: number; // 분당 생성된 코드 라인 수
bugFixTime: number; // 평균 버그 수정 시간
codeReviewEfficiency: number; // 리뷰 완료까지 걸린 시간
deploymentFrequency: number; // 일일 배포 횟수
leadTime: number; // 아이디어부터 배포까지 시간
}
class ROICalculator {
calculateDeveloperProductivity(before: ProductivityMetrics, after: ProductivityMetrics): number {
const improvements = {
codeGeneration: (after.codeGenerationSpeed - before.codeGenerationSpeed) / before.codeGenerationSpeed,
bugFix: (before.bugFixTime - after.bugFixTime) / before.bugFixTime,
codeReview: (before.codeReviewEfficiency - after.codeReviewEfficiency) / before.codeReviewEfficiency,
deployment: (after.deploymentFrequency - before.deploymentFrequency) / before.deploymentFrequency,
leadTime: (before.leadTime - after.leadTime) / before.leadTime
};
return Object.values(improvements).reduce((sum, improvement) => sum + improvement, 0) / 5;
}
calculateCostSavings(teamSize: number, averageSalary: number, productivityGain: number): number {
const annualCost = teamSize * averageSalary;
const timeSaved = productivityGain * 0.3; // 30% 시간 절약 가정
return annualCost * timeSaved;
}
}지속적 개선
## 월간 Kiro 최적화 체크리스트
### 성능 분석
- [ ] 평균 응답 시간 측정
- [ ] 컨텍스트 크기 최적화
- [ ] 메모리 사용량 모니터링
- [ ] 에러율 분석
### 사용 패턴 분석
- [ ] 가장 많이 사용되는 기능 파악
- [ ] 비효율적인 워크플로우 식별
- [ ] 팀원별 사용 패턴 분석
- [ ] 새로운 요구사항 수집
### 설정 최적화
- [ ] Steering 규칙 업데이트
- [ ] Hook 성능 개선
- [ ] MCP 서버 최적화
- [ ] 불필요한 설정 제거
### 교육 및 확산
- [ ] 새로운 패턴 공유
- [ ] 베스트 프랙티스 문서화
- [ ] 팀 교육 세션 진행
- [ ] 성공 사례 수집이러한 엔터프라이즈 패턴을 통해 대규모 조직에서도 Kiro를 효과적으로 활용할 수 있습니다. 각 조직의 특성에 맞게 패턴을 조정하여 사용하세요.