검사기 수정 모드(세션 범위)
규칙교차 세션 오염 없이 React 구성요소와 이에 상응하는 격리된 개발 검사기를 공동 유지보수하기 위해 스테이트풀(Stateful) 세션 범위 검사기 수정 모드를 설정합니다.
이 규칙에 액세스하려면 로그인하세요.
Google 개발자 프로필로 로그인하여 Build It! 시리즈에 사용된 전체 규칙을 확인하고 복사하세요.
개발자 프로필 필요
개발자 프로필을 사용할 수 없습니다. Workspace 관리자에게 이 기능을 사용 설정하도록 요청하세요.
개발자 프로필 만들기
무료 Google 개발자 프로필을 만들어 모든 Build It! 기술, 규칙, 프롬프트, 아티팩트를 활용하세요.
Builder Central에 가입하여 활용하기
클릭 한 번으로 무료 빌더 멤버십 배지를 신청하여 모든 Build It! 기술, 규칙, 프롬프트, 아티팩트를 활용해 보세요.
세션 범위 검사기 수정 모드 작동 방식
구성요소 검사기가 열린 상태에서 UI 구성요소를 반복할 때 구성요소 수정사항이 동일한 차례에 일치하는 검사기 뷰를 업데이트하도록 하고, 향후 세션에서 검사기 수정사항을 영구적으로 강제하지 않도록 합니다. 이 규칙은 대화 범위 마커 파일을 사용하여 이 문제를 해결합니다.
- 새 세션마다 기본적으로 사용 중지됨: 새로운 대화는 일반 모드에서 시작되므로 일상적인 수정은 요청한 파일에만 적용됩니다.
- 검사기 수정 모드 시작: "검사기 수정 모드 시작"(또는 "검사기 모드 사용 설정")이라고 말합니다. 에이전트는
<appDataDir>/brain/<conversation-id>/inspector-mode.active에서 세션 범위 마커 파일을 만들고src/dev/registry.ts를 읽고 이 세션에 포함된 등록된 모든 구성요소를 나열합니다. - 자동 공동 유지보수: 활성화된 상태에서 등록된 구성요소에 대한 변경을 요청하면 구성요소가 먼저 업데이트되고 구성요소 검사기 업데이터 워크플로를 사용하여 일치하는
src/dev/inspectors/[ComponentName]Inspector.tsx가 즉시 동기화되며npx tsc --noEmit가 실행되고 응답에 확인 칩이 표시됩니다. - 언제든지 깔끔하게 종료: "Exit inspector editing mode"라고 말하면 마커 파일이 삭제되고 일반적인 단일 타겟 수정 모드로 돌아갑니다. 한 세션에서 모드를 사용 설정해도 동시 세션이나 향후 세션에는 영향을 미치지 않습니다.
Google Antigravity에서 설치하는 방법
이 규칙을 Google Antigravity 작업공간에 에피소드 9 구성요소 검사기 기술 2개와 함께 배치합니다.
- 프로젝트 작업공간에
.agents/rules/폴더를 만들거나 Google Antigravity 맞춤설정 > 규칙을 열어 작업공간 규칙을 추가합니다. - 아래의 전체 마크다운 규칙을
.agents/rules/내에inspector-editing-mode.md로 저장합니다. - 에이전트에 이 규칙에서 참조하는 스캐폴딩 및 동기화 워크플로가 모두 포함되도록 컴패니언 스킬인 Component Inspector Generator 및 Component Inspector Updater를 설치합니다.
검사기 수정 모드 규칙 정의
이 전체 규칙 정의를 작업공간에 inspector-editing-mode.md로 복사합니다.
inspector-editing-mode.md (.agents/rules/inspector-editing-mode.md)
# Inspector Editing Mode (Session-Scoped)
This rule establishes a stateful, session-scoped **Inspector Editing Mode** for co-maintaining React components and their corresponding isolated development inspectors (`src/dev/inspectors/[ComponentName]Inspector.tsx`).
---
## 1. Scope & Isolation Model
* **Session-Scoped**: The on/off state of this mode is strictly scoped to the current conversation session (`<conversation-id>`).
* **Default State**: Every new conversation session begins with Inspector Editing Mode **OFF** by default.
* **State Marker**:
- Activation is tracked at `<appDataDir>/brain/<conversation-id>/inspector-mode.active`.
- If this file exists for the active session's conversation ID, Inspector Editing Mode is **ON**.
- If this file does NOT exist, Inspector Editing Mode is **OFF**.
* **Zero Cross-Session Contamination**: Turning this mode on in one conversation has no effect on any other parallel or future conversation sessions.
---
## 2. Trigger Commands & State Transitions
### A. Entering Inspector Mode
* **Trigger Phrases**:
- *"Enter inspector editing mode"*
- *"Start inspector editing mode"*
- *"Turn on inspector mode"*
- *"Inspector mode on"*
* **Agent Action**:
1. Create the marker file at `<appDataDir>/brain/<conversation-id>/inspector-mode.active`.
2. Read `src/dev/registry.ts` to identify all currently registered components.
3. Respond confirming:
- Inspector Editing Mode is now **ACTIVE** for this session.
- Any subsequent changes to registered components will automatically update both the component and its dev inspector.
- List the currently registered components covered by this mode.
### B. Exiting Inspector Mode
* **Trigger Phrases**:
- *"Exit inspector editing mode"*
- *"Stop inspector editing mode"*
- *"Turn off inspector mode"*
- *"Inspector mode off"*
* **Agent Action**:
1. Remove the marker file at `<appDataDir>/brain/<conversation-id>/inspector-mode.active` if present.
2. Respond confirming that Inspector Editing Mode is now **DEACTIVATED** for this session and normal single-target editing has resumed.
### C. Status Query
* **Trigger Phrases**:
- *"Is inspector mode active?"*
- *"Inspector mode status"*
- *"What mode am I in?"*
* **Agent Action**:
- Check for the existence of `<appDataDir>/brain/<conversation-id>/inspector-mode.active`.
- Report whether the current session is in **Inspector Mode** or **Normal Mode**.
---
## 3. Co-Maintenance Behavior While Mode is ACTIVE
Whenever the user requests changes, fixes, or refactors to ANY component registered in `src/dev/registry.ts`:
1. **Step 1: Update the Core Component**
- Apply the requested code changes, props modifications, or behavioral logic in `src/components/.../[ComponentName].tsx` (or `src/views/.../[ComponentName].tsx`).
- Update any relevant unit tests in `scripts/` or `__tests__/`.
2. **Step 2: Automatically Synchronize the Dev Inspector**
- Locate the matching inspector at `src/dev/inspectors/[ComponentName]Inspector.tsx`.
- Apply the `component-inspector-updater` workflow:
- **Props & State**: Reconcile any new, altered, or deleted props into the *Editable State* or *Props State* categories.
- **Computed State**: Update derived `useMemo` metrics if underlying rules or formulas changed.
- **Test Verification Cards**: Synchronize the plain-English test fixtures at the bottom of the inspector with the new behavior, updating click handlers so `[Load Test Fixture]` accurately reflects the new state.
- **Preserve Custom Presets**: Keep all existing scenario presets (e.g. week overhauls, superset pairs, edge cases) intact, adapting their shapes to new prop signatures.
- **Advance Timestamp Chip**: Advance `const GENERATED_AT = 'YYYY-MM-DD HH:MM [TIMEZONE]';` to the current local timestamp.
- **No Auto-Scroll**: Ensure all internal scrolling is scoped strictly to element containers (`containerRef.current.scrollTop = containerRef.current.scrollHeight`) with zero page-level scrolling.
3. **Step 3: Verify Types**
- Run `npx tsc --noEmit` to ensure type alignment between the component and its inspector.
- **DO NOT** run raw `npm run build` while a local dev server is active to prevent wiping out `.next/` chunk manifests.
4. **Step 4: Badge Confirmation in Response**
- Include an explicit status chip in your response header or summary:
`[Inspector Mode: Synced <ComponentName> & Dev Inspector]`
---
## 4. Behavior While Mode is INACTIVE (Default)
* When the mode is OFF, the agent performs only the exact requested file modifications.
* Do NOT edit `src/dev/inspectors/` unless the user explicitly requests an inspector update or instructs the agent to create a brand new inspector route.