# Claude Goal Prompt - Canonical Data View Cleanup

`/goal` 조건은 길이 제한이 있으므로, 긴 분석서는 파일로 읽게 하고 `/goal`에는 아래 짧은 완료 조건만 넣는다.

## 바로 실행할 명령

```text
/goal Read notes/gbpark/2026-05-18-canonical-data-view-goal.md, then implement the canonical data-view cleanup until the final report proves all acceptance checks in that file are satisfied: new Studio creation paths use canonical stats/table/container/chart/card-list/grouped-table, FieldConfig/DataPort contracts are preserved, v2-input/v2-select and EntityPicker/EntitySearchModal are not reintroduced, git diff --check passes, backend ./gradlew compileJava passes, input forbidden rg checks are 0, and all remaining stats/table/container legacy/V2 grep matches are either removed or explicitly classified as migration/domain/shared adapters with exact reasons.
```

이 명령 하나로 충분하게 설계했다. 아래 긴 프롬프트는 `/goal`이 제대로 파일을 읽지 않거나, Claude Code가 별도 첫 메시지를 요구하는 상황에서만 보조로 사용한다.

## 보조 프롬프트

```text
You are working in /Users/gbpark/invyone.

Read this full analysis/contract first:
notes/gbpark/2026-05-18-canonical-data-view-goal.md

Goal:
Finish the INVYONE Studio canonical data-view cleanup after the canonical input migration. Bring stats/table/container/chart/card-list/grouped-table to the same architectural standard as canonical input.

Definition of done:
1. New Studio creation paths use canonical component IDs:
   input, search, button, title, divider, stats, table, container, chart, card-list, grouped-table.
2. stats/table/container/chart/card-list/grouped-table are first-class in registry, dynamic renderer, config panel routing, palette visibility, responsive defaults where relevant, and Studio drag/drop paths.
3. Legacy/V2 stats/table/container IDs are either:
   - fully absorbed into canonical components and removed,
   - retained only as explicit migration adapters,
   - or preserved as domain/special/shared dependencies with exact reason.
4. Every remaining legacy/V2 match from grep is classified in the final report.
5. FieldConfig and DataPort contracts are preserved.

Non-negotiable rules:
1. Do not reintroduce v2-input, v2-select, V2InputRenderer, V2SelectRenderer, V2Input.tsx, or V2Select.tsx.
2. Do not put EntityPicker or EntitySearchModal into canonical input. canonical input entity mode is only a code-name option source.
3. Do not write DB layout JSON migration SQL.
4. Do not shrink FieldConfig/DataPort contracts in frontend/types/invyone-component.ts.
5. Do not delete a legacy/V2 folder just because an alias exists. First prove no active imports remain, or preserve/classify it.
6. Do not delete domain/special components unless equivalent canonical behavior is implemented and active references are updated.
7. Keep unrelated dirty files intact. Do not revert user changes.

Start with inventory, then continue into implementation. Do not stop at analysis.

Inventory commands:

rg -n "v2-aggregation-widget|v2-status-count|aggregation-widget" \
  frontend/lib frontend/components frontend/app frontend/types

rg -n "v2-table-list|table-list|v2-split-panel-layout|split-panel-layout|split-panel-layout2" \
  frontend/lib frontend/components frontend/app frontend/types

rg -n "v2-tabs-widget|tabs-widget|v2-section-card|v2-section-paper|section-card|section-paper|v2-repeat-container|repeat-container|v2-repeater" \
  frontend/lib frontend/components frontend/app frontend/types

rg -n "INVYONE_UNIFIED_IDS|LEGACY_TO_UNIFIED|CONFIG_PANEL_ALIAS|v2-table-list|v2-aggregation-widget|v2-status-count|v2-tabs-widget|v2-split-panel-layout" \
  frontend/lib/registry frontend/lib/utils frontend/lib/schemas frontend/components/screen

Implementation phases:

Phase 1 - Canonical entry points
- Add chart, card-list, grouped-table to every canonical component ID path where they belong, especially DynamicComponentRenderer INVYONE_UNIFIED_IDS.
- Ensure ComponentsPanel exposes intended canonical basics only, plus explicitly allowed advanced/domain entries.
- Ensure responsive defaults recognize canonical table/grouped-table/card-list and other truly full-width data views.
- Keep all dataPorts declarations intact.

Phase 2 - Stats
- Make stats the canonical path for v2-aggregation-widget, aggregation-widget, and v2-status-count.
- Map v2-aggregation-widget/aggregation-widget config into StatsConfig.items[].dataSource where safe.
- Map v2-status-count tableName/statusColumn/items into StatsItem.dataSource.filters where safe.
- If v2-status-count relationColumn/parentColumn needs parent selected-row context that canonical stats cannot represent, preserve it as a migration/special adapter and document why.
- Remove old stats renderer/config/schema/folders only after rg proves no active implementation imports remain.

Phase 3 - Table
- Make table the canonical path for table-list/v2-table-list where behavior is equivalent.
- Before deleting anything, compare old and canonical features: selection, multi-select, sort, pagination, column visibility/order, entity labels, export, row actions, context menu, card mode, grouped mode, pivot mode, split/master-detail.
- FlowWidget imports table-list/SingleTableWithSticky. Do not break it. Extract/migrate/preserve with reason.
- Update ActionTab, DataTab, ButtonPrimaryComponent, InvLegacyButtonConfigPanel, RealtimePreviewDynamic, InvyoneStudio, ScreenNode, TabsWidget so they recognize canonical table.
- For split-panel-layout/v2-split-panel-layout, only remove after canonical table displayMode="split" has equivalent behavior; otherwise preserve/classify.
- Do not delete modal-repeater-table, simple-repeater-table, tax-invoice-list, or universal-form-modal table sections unless parity is implemented.

Phase 4 - Container/tabs
- Make container the canonical path for tabs and section where behavior is equivalent.
- Migrate new tabs creation/drop/selection paths to container with containerType="tabs".
- Use ContainerTab.components with child.componentType and child.componentConfig.
- Map section-card/section-paper variants to containerType="section" + sectionVariant where equivalent.
- Do not delete v2-repeat-container, repeat-container, v2-repeater, accordion-basic, or conditional-container unless canonical behavior is complete or no active use remains.

Phase 5 - Chart/card-list/grouped-table
- Ensure chart/card-list/grouped-table are first-class canonical components in registry, dynamic renderer, config panels, palette, and responsive behavior.
- Keep dataPorts input data(rows).
- Avoid broad UX redesign. ColumnPicker improvements are optional only if low risk.

Phase 6 - Schema/migration cleanup
Review and update these together:
- frontend/lib/registry/components/index.ts
- frontend/lib/registry/DynamicComponentRenderer.tsx
- frontend/lib/utils/getComponentConfigPanel.tsx
- frontend/lib/utils/templateMigrate.ts
- frontend/lib/schemas/componentConfig.ts
- frontend/lib/utils/layoutV2Converter.ts
- frontend/types/v2-components.ts
- frontend/lib/utils/responsiveDefaults.ts
- frontend/components/screen/panels/ComponentsPanel.tsx
- frontend/components/screen/InvyoneStudio.tsx
- frontend/components/screen/RealtimePreviewDynamic.tsx
- frontend/components/screen/config-panels/button-config/ActionTab.tsx
- frontend/components/screen/config-panels/button/DataTab.tsx
- frontend/lib/registry/components/v2-button-primary/ButtonPrimaryComponent.tsx

Verification:

git diff --check

rg "v2-input|v2-select|V2InputRenderer|V2SelectRenderer" \
  frontend/lib frontend/components frontend/app frontend/types frontend/styles

rg "EntityPicker|entity-picker|EntitySearchModal" \
  frontend/lib/registry/components/input \
  frontend/components/v2/config-panels/InvFieldConfigPanel.tsx

rg -n "v2-aggregation-widget|v2-status-count|aggregation-widget" \
  frontend/lib frontend/components frontend/app frontend/types

rg -n "v2-table-list|table-list|v2-split-panel-layout|split-panel-layout|split-panel-layout2" \
  frontend/lib frontend/components frontend/app frontend/types

rg -n "v2-tabs-widget|tabs-widget|v2-section-card|v2-section-paper|section-card|section-paper|v2-repeat-container|repeat-container|v2-repeater" \
  frontend/lib frontend/components frontend/app frontend/types

cd backend-spring && ./gradlew compileJava

Run the repo frontend type/lint command if available. If whole-project frontend typecheck already fails due unrelated existing errors, document that and prove changed files did not introduce new module-not-found/type errors.

Manual smoke scenarios:
1. New stats: user_info count.
2. New stats: user_info count where status = 재직.
3. New table: load columns, select one row, multi-select if enabled.
4. New search + table: searchParams flow still works.
5. New container tabs: one tab has stats child, another tab has table child.
6. New chart: group by a real column.
7. New card-list and grouped-table: configure real table/fields/groupBy.

Final report format:
- Summary
- Canonical entry points changed
- Files changed
- Deleted folders/files
- Preserved legacy/V2 adapters with exact reasons
- Verification command results
- Remaining risks / next phases
```

---

## 기대값

이 프롬프트의 성공 기준은 "legacy/V2 문자열 0건"이 아니다. `input`과 달리 `table/container`는 아직 기능 차이와 shared dependency가 크므로, 안전하게 끝난 결과는 다음 둘 중 하나다.

- 흡수 완료된 legacy/V2는 삭제된다.
- 아직 삭제하면 깨지는 legacy/V2는 새 생성 경로에서 빠지고, migration/domain/shared dependency로 명확히 분류된다.
