Inspector এডিটিং মোড (সেশন-স্কোপড)
নিয়মক্রস-সেশন দূষণ ছাড়াই React কম্পোনেন্ট এবং তাদের সংশ্লিষ্ট বিচ্ছিন্ন ডেভেলপমেন্ট ইন্সপেক্টরদের সহ-রক্ষণাবেক্ষণের জন্য একটি স্টেটফুল, সেশন-স্কোপড ইন্সপেক্টর এডিটিং মোড প্রতিষ্ঠা করে।
এই নিয়ম অ্যাক্সেস করতে সাইন-ইন করুন
Build It! সিরিজে ব্যবহৃত সম্পূর্ণ নিয়ম দেখতে ও কপি করতে আপনার Google Developer Profile-এ সাইন-ইন করুন।
ডেভেলপার প্রোফাইল প্রয়োজন
আপনি ডেভেলপার প্রোফাইল তৈরি করার জন্য উপযুক্ত নন। এই ফিচার চালু করতে আপনার Workspace অ্যাডমিনিস্ট্রেটরকে বিজ্ঞপ্তি পাঠান।
Developer প্রোফাইল তৈরি করুন
সব Build It! স্কিল, নিয়ম, প্রম্পট ও আর্টিফ্যাক্ট আনলক করতে ফ্রিতে Google Developer প্রোফাইল তৈরি করুন।
আনলক করতে 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রান করে এবং কনফার্মেশন চিপের মাধ্যমে উত্তরে স্ট্যাম্প দেয়। - যেকোনও সময় সহজে বেরিয়ে আসুন: মার্কার ফাইল সরিয়ে দিতে এবং স্বাভাবিক সিঙ্গল-টার্গেট এডিটিংয়ে ফিরে যেতে "ইন্সপেক্টর এডিটিং মোড থেকে বেরিয়ে আসুন" বলুন। একটি সেশনে মোড চালু করলে তা সমান্তরাল বা ভবিষ্যতের সেশনকে কখনই প্রভাবিত করে না।
Google Antigravity-তে কীভাবে ইনস্টল করবেন
আপনার Google Antigravity ওয়ার্কস্পেসে এই নিয়মটি Episode 9 Component Inspector-এর দুটি স্কিলের সাথে রাখুন:
- আপনার প্রোজেক্ট ওয়ার্কস্পেসে
.agents/rules/ফোল্ডার তৈরি করুন (অথবা ওয়ার্কস্পেস সংক্রান্ত নিয়ম যোগ করতে Google Antigravity কাস্টমাইজেশন > নিয়ম খুলুন)। .agents/rules/-এর মধ্যেinspector-editing-mode.mdহিসেবে নিচে সম্পূর্ণ Markdown নিয়ম সেভ করুন।- কম্প্যানিয়ন স্কিল Component Inspector Generator এবং Component Inspector Updater ইনস্টল করুন যাতে আপনার এজেন্টের কাছে এই নিয়ম দ্বারা রেফারেন্স করা স্ক্যাফোল্ডিং এবং সিঙ্ক্রোনাইজেশন ওয়ার্কফ্লো উভয়ই থাকে।
ইন্সপেক্টর এডিটিং মোড রুল ডেফিনিশন
এই সম্পূর্ণ নিয়ম সংজ্ঞা আপনার ওয়ার্কস্পেসে 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.