728x90
준비
Gemini CLI로 프로젝트 분석이나 바이브 코딩을 할 때 .md 파일로 만들어 두는 것이 가장 좋습니다.
특히 Gemini CLI 는 프로젝트 폴더의 Markdown 문서를 자동으로 참고하는 방식이기 때문에 .md 파일이 있으면 분석 정확도가 올라갑니다.
1️⃣ 어디에 만들어야 하나
프로젝트 루트 폴더에 만듭니다.
project-root
├ src
├ pom.xml
├ ai-context.md
├ requirement.md
└ architecture.md
2️⃣ 가장 중요한 파일 (추천)
ai-context.md
requirement.md
architecture.md
3️⃣ ai-context.md 예시
Gemini가 프로젝트를 이해하는 핵심 파일입니다.
# Project Context
Framework: eGovFrame (Spring MVC)
Language: Java
View: JSP
Persistence: MyBatis / iBATIS
Database: Oracle
Build Tool: Maven
Server: Tomcat
Architecture:
Controller → Service → DAO → Mapper(XML)
Purpose:
Maintain and improve legacy eGovFrame web system.
4️⃣ requirement.md 예시
AI에게 프로젝트 목표를 알려주는 문서
# Requirements
Goals:
- Analyze legacy eGovFrame project
- Improve maintainability
- Refactor duplicated SQL
- Generate documentation
Features:
- Controller flow analysis
- SQL query analysis
- Database relationship explanation
5️⃣ architecture.md 예시
# Architecture
## Layers
Controller
Handles HTTP request mapping.
Service
Contains business logic.
DAO
Handles database access.
Mapper
MyBatis XML queries.
## Request Flow
Client → Controller → Service → DAO → Mapper → Database
6️⃣ Gemini 사용 방법
프로젝트 루트에서 실행
gemini
Analyze this project using the context files.
- 컨텍스트 파일을 사용하여 이 프로젝트를 분석하십시오.
Explain this egovframe project architecture.
- 이 egovframe 프로젝트의 아키텍처를 설명하십시오.
👍 .md 파일을 쓰는 이유
AI가 매번 프로젝트 구조를 추론하지 않아도 됩니다.
그래서
- 코드 분석 정확도 상승
- 토큰 사용 감소
- 답변 품질 상승
효과가 있습니다.
💡 전자정부 프로젝트에서 추가로 만들면 좋은 파일
sql-guide.md
controller-map.md
table-structure.md
이렇게 하면 레거시 분석 속도가 매우 빨라집니다.
👍 Gemini 사용할 때 좋은 질문 패턴
전자정부 프로젝트 분석 순서
1 프로젝트 구조 분석
2 Controller 목록
3 URL mapping
4 Service 흐름
5 Mapper SQL
6 DB 테이블
🚀 추천 (전자정부 분석용 첫 명령)
처음 실행할 때 이 질문이 가장 좋습니다.
Analyze this legacy eGovFrame project.
Use the context files.
Explain:
- architecture
- request flow
- controller endpoints
- mapper SQL structure
- database usage
🚀 또다른 추천
Analyze this project using the context files.
Use the following files as reference:
- ai-context.md
- requirement.md
- architecture.md
Tasks:
1. Analyze the overall project structure.
2. Identify Controller, Service, DAO, and Mapper layers.
3. List all Controller endpoints and request mappings.
4. Explain the request flow from Controller to SQL query.
5. Analyze mapper XML files and summarize major SQL queries.
6. Identify the main database tables used.
7. Identify legacy patterns or technical debt.
Output format:
1. Project Architecture
2. Package Structure
3. Controller Endpoints
4. Request Flow
5. SQL Layer Analysis
6. Database Tables
7. Technical Debt
🚀 전자정부 프로젝트 분석용 “한방 프롬프트”
You are a senior Java architect specialized in eGovFrame.
Analyze this legacy eGovFrame project.
Project characteristics:
- Framework: eGovFrame (Spring MVC)
- Language: Java
- View: JSP
- Persistence: MyBatis / iBATIS XML
- Database: Oracle
- Build Tool: Maven
- Server: Tomcat
Use the context files if present:
- ai-context.md
- requirement.md
- architecture.md
Tasks:
1. Analyze the project structure
- explain package structure
- identify Controller, Service, DAO, Mapper layers
2. Extract all Controller endpoints
- list request mapping URLs
- identify controller classes
3. Analyze request flow
- trace Controller → Service → DAO → Mapper
4. Analyze mapper XML files
- list major SQL queries
- identify database tables used
5. Identify database structure
- infer table relationships
- list main tables used
6. Identify technical debt
- duplicated SQL
- legacy patterns
- security risks
- performance issues
7. Suggest modernization strategy
- Spring Boot migration
- REST API conversion
- SQL optimization
Output format:
1. Project Architecture
2. Package Structure
3. Controller Endpoints
4. Request Flow
5. SQL Layer Analysis
6. Database Tables
7. Technical Debt
8. Modernization Recommendations
👍 이 프롬프트의 장점
이 프롬프트 하나로 다음이 나옵니다.
✔ 프로젝트 구조
✔ Controller URL 목록
✔ Service 흐름
✔ Mapper SQL
✔ DB 테이블
✔ 개선 방향
즉 레거시 분석 문서 자동 생성입니다.
🚀 (강력 추천) 추가 프롬프트
프로젝트 분석 후 바로 실행하면 좋은 질문
Generate a system documentation for this project.
Include architecture diagram, controller endpoints, and database tables.
그러면 프로젝트 기술 문서까지 자동 생성됩니다.
무료 모델 추천
Gemini CLI에서는 보통 이렇게 씁니다.
gemini --model flash
gemini auto
Flash 모델은
- 빠름
- 무료 quota 넉넉
- 코드 분석 충분
728x90
'AI > Gemini CLI' 카테고리의 다른 글
| 개인 무료 Gemini Code Assist for individuals 종료 (0) | 2026.08.01 |
|---|---|
| Gemini CLI 토큰 줄이기. (0) | 2026.03.08 |
| VS CODE 에서 Gemini CLI 설치 (0) | 2026.03.08 |
| Gemini CLI 를 이용한 바이브 코딩 테스트. (0) | 2026.03.08 |
| Gemini CLI 설치 (0) | 2026.03.08 |