Skip to content

Commit fa48a75

Browse files
committed
Update agent guidance
1 parent ea2a3ef commit fa48a75

2 files changed

Lines changed: 61 additions & 121 deletions

File tree

AGENTS.md

Lines changed: 61 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,69 @@
22

33
This file provides guidance to AI coding agents working in this repository.
44

5-
## Project Overview
5+
## Project Context
66

7-
AI/ML 용어집 - An open-source glossary that standardizes Korean translations for AI/ML terminology. Operated by PyTorchKR (파이토치 한국 사용자 모임). Currently in PoC stage; all term data is AI-generated draft pending community review.
7+
AI/ML 용어집 - 빠르게 변화하는 AI/ML 분야의 용어를 표준화하여 사람과 AI 번역 도구 모두가 일관된 한국어 번역을 사용할 수 있도록 하는 오픈소스 프로젝트. 파이토치 한국 사용자 모임(PyTorchKR) 운영. 현재 PoC 단계이며, 수록된 용어 데이터는 AI 생성 초안.
88

9-
**Repository**: `PyTorchKorea/kr-terms-poc` | **Branch**: `poc` | **Domain**: `poc.terms.kr`
9+
**Repository**: `PyTorchKorea/kr-terms-poc` (branch: `poc`)
1010

11-
## Build & Dev Commands
11+
## Commands
1212

1313
```bash
1414
npm install # Install dependencies
15-
npm run dev # Dev server at http://localhost:5173 (auto-copies data/ to public/data/)
15+
npm run dev # Dev server (http://localhost:5173), auto-copies data/ to public/data/
1616
npm run build # TypeScript check + Vite production build
1717
npm run lint # ESLint
1818
npm run preview # Preview production build
1919
```
2020

21+
No test framework is configured. Validation runs in CI via inline Node script in `.github/workflows/deploy.yml`.
22+
2123
## Architecture
2224

23-
Static SPA (React 19 + TypeScript + Vite + MUI v7). No backend. All term data is JSON fetched at runtime from `public/data/`.
25+
Static SPA for AI/ML Korean terminology glossary. No backend; all data is JSON fetched at runtime.
26+
27+
**Stack**: React 19 + TypeScript + Vite + MUI v7, deployed to GitHub Pages (`poc.terms.kr`).
28+
29+
**Routing** (`App.tsx`): HashRouter with lazy-loaded pages.
30+
- `/` -> `SearchPage` (search + alphabet filter)
31+
- `/term/:termId` -> `TermDetailPage` (accordion per meaning, related terms)
32+
- `/about` -> `AboutPage`
33+
34+
**Data flow**: `data/index.json` lists alphabet JSON files (`a.json`..`w.json`). At build time, `prebuild` copies `data/` -> `public/data/`. At runtime, `loadTerms.ts` fetches all files in parallel via `Promise.all`, flattens, and sorts. The `useTerms` hook caches this; `useSearch` debounces (200ms) and filters across `term`, `korean`, `synonyms`.
2435

25-
- `data/index.json` → lists alphabet JSON files (`a.json`..`w.json`)
26-
- `prebuild` script copies `data/``public/data/`
27-
- HashRouter: `/` (search), `/term/:termId` (detail), `/about` (info)
36+
**Homepage**: `SearchPage` embeds `HeroSection` (stats) + `AlphabetNavigation` (A-Z chips) + `TermCard` grid. The `Layout` component wraps non-home pages with AppBar + footer; home page hides AppBar.
2837

2938
## Data Model
3039

40+
Defined in `src/types/term.ts`:
41+
3142
```typescript
32-
// src/types/term.ts
3343
interface TermExample { en: string; ko: string; source?: string }
3444
interface TermMeaning {
35-
korean: string // Required - Korean translation
36-
domain: string // Required - no spaces (e.g., "딥러닝")
37-
definition: string // Required - Korean definition
38-
examples: (string | TermExample)[] // Prefer TermExample objects
45+
korean: string // Required
46+
definition: string // Required
47+
examples: (string | TermExample)[] // Union type for backward compat
3948
synonyms: string[]
4049
}
41-
interface Term { term: string; meanings: TermMeaning[] }
50+
interface Term {
51+
term: string
52+
meanings: TermMeaning[]
53+
issueNumber?: number // GitHub Issue number for traceability
54+
notes?: string // Editorial notes (why this translation was chosen)
55+
}
4256
```
4357

44-
## Adding/Editing Terms
58+
**Examples format**: Prefer `TermExample` objects (`{en, ko, source?}`) over plain strings. Both are supported. `TermDetailPage` uses `isTermExample()` type guard to render accordingly.
59+
60+
**Optional fields**: `issueNumber` links to the GitHub Issue where the term was discussed. `notes` provides editorial context. Both are set automatically by the co-author workflow, or manually when adding terms via PR.
61+
62+
## Adding New Terms
4563

46-
1. Edit `data/{letter}.json` (alphabetical)
47-
2. New letter file → add to `data/index.json`
48-
3. Required fields: `korean`, `domain` (no spaces), `definition`
49-
4. Examples: prefer `{ "en": "...", "ko": "...", "source": "https://..." }` format
50-
5. New domains need a color entry in `src/utils/domainColors.ts`
64+
1. Edit the appropriate `data/{letter}.json` file
65+
2. If creating a new letter file, add it to `data/index.json`
66+
3. Required fields per meaning: `korean`, `definition`
67+
4. CI validates: JSON syntax, required fields, TermExample `en`/`ko` presence
5168

5269
## Code Style
5370

@@ -56,16 +73,33 @@ interface Term { term: string; meanings: TermMeaning[] }
5673
- Named exports (not default exports)
5774
- Immutable patterns - create new objects, don't mutate
5875

76+
## Co-author Workflow
77+
78+
`.github/workflows/term-coauthor.yml`: Triggered when `approved` label is added to an issue.
79+
80+
**Two-path automation**:
81+
- **새 용어 요청** (label: `새 용어 요청`): Parses structured issue fields -> auto-commits to `data/{letter}.json` with `Co-authored-by` trailer -> closes issue.
82+
- **용어 피드백** (label: `용어 피드백`): Posts formatted JSON snippet as comment -> admin reviews -> `commit-ready` label triggers commit.
83+
84+
**Helper script**: `scripts/update-term-from-issue.mjs` handles collision detection (create/append/warn-on-duplicate) and sets `issueNumber` on the term.
85+
5986
## CI/CD
6087

61-
`.github/workflows/deploy.yml` on push to `poc`:
62-
1. Validates all JSON files (required fields, domain spacing, TermExample structure)
63-
2. Builds with `npm run build`
64-
3. Deploys to GitHub Pages
88+
`.github/workflows/deploy.yml`: On push to `poc`, validates term data -> builds -> deploys to GitHub Pages. The validation step checks all JSON files for required fields, TermExample structure, and optional field types (`issueNumber`, `notes`).
89+
90+
`.github/workflows/term-coauthor.yml`: Co-author workflow (see above).
91+
92+
## LLM Integration
93+
94+
- `public/llms.txt`: [llmstxt.org](https://llmstxt.org/) standard guidance file for LLMs. Includes project overview, links to all data files, and data structure documentation. Available at `poc.terms.kr/llms.txt` after deployment.
95+
- JSON data is discoverable via `poc.terms.kr/data/index.json`, with each alphabet file accessible directly.
6596

66-
## Testing
97+
## Branding
6798

68-
No test framework configured. Validation is done via inline Node script in CI. When editing data, verify with `npm run build` which runs TypeScript checking.
99+
- Project name: "AI/ML 용어집"
100+
- Organization: "파이토치 한국 사용자 모임" (full) / "PyTorchKR" (short)
101+
- Theme primary: `#ee4c2c` (PyTorch orange-red), secondary: `#262626`
102+
- Domain: `poc.terms.kr`
69103

70104
## Security
71105

CLAUDE.md

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)