/pauls-skills:spart-widget-admin-configfrom pauls-skills
Add, edit or wire up a widget configuration modal in the SPART Board admin settings (Admin Settings > Feature Permissions > Widget Config Modal), NOT the user-level widget settings panel on the dashboard. Use for "add admin config for a widget", "create a config modal", "the widget needs global settings", "add building defaults", "admin config is not showing", or any request to manage widget behavior from the admin level.
Ships in pauls-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Creating or editing the admin-level widget configuration modals accessed via:
Admin Settings → Feature Permissions tab → ⚙️ (gear) button on a widget card
This is not the user-level settings panel (the small panel that opens when a teacher clicks the gear on their own widget). This is the global admin config that sets building-level defaults and admin-only controls that users cannot see or edit.
All widget admin configs are stored in Firestore:
/feature_permissions/{widgetType}
.config: Record<string, unknown> ← this is where your settings go
.widgetType: string
.accessLevel: 'admin' | 'beta' | 'public'
.enabled: boolean
The config field is a flexible object typed per widget. Always store building-specific defaults nested under buildingDefaults[buildingId].
A self-contained *ConfigurationModal.tsx component that handles its own Firestore read/write.
Example: components/admin/SpecialistScheduleConfigurationModal.tsx
This is the gold standard. Prefer this path when:
Wiring location: components/admin/FeaturePermissionsManager.tsx — the explicit conditional block near the bottom of the JSX:
{activeModalTool?.type === 'your-widget-type' && (
<YourWidgetConfigurationModal
isOpen={true}
onClose={() => setActiveModalTool(null)}
/>
)}
Also add the type to the exclusion array above GenericConfigurationModal:
{activeModalTool &&
!['instructionalRoutines', 'stickers', 'calendar', 'specialist-schedule', 'miniApp', 'starter-pack', 'your-widget-type'].includes(activeModalTool.type) && (
<GenericConfigurationModal ... />
)}
A *ConfigurationPanel.tsx component rendered inside the shared GenericConfigurationModal.
Wiring location 1: Register in BUILDING_CONFIG_PANELS map in components/admin/FeatureConfigurationPanel.tsx:
const BUILDING_CONFIG_PANELS: Partial<Record<WidgetType | InternalToolType, BuildingConfigPanel>> = {
// existing entries...
'your-widget-type': YourWidgetConfigurationPanel,
};
Wiring location 2: Import the panel at the top of FeatureConfigurationPanel.tsx:
import { YourWidgetConfigurationPanel } from './YourWidgetConfigurationPanel';
Wiring location 3: Add to the exclusion list in FeatureConfigurationPanel.tsx at the bottom (the ![]includes(tool.type) guard that shows the "No global settings available" placeholder):
![
'lunchCount', 'weather', /* ... existing ... */,
...Object.keys(BUILDING_CONFIG_PANELS),
].includes(tool.type)
Note: Since BUILDING_CONFIG_PANELS already covers this with Object.keys(...), you usually only need to register in the map.
components/admin/YourWidgetConfigurationModal.tsxcomponents/admin/FeaturePermissionsManager.tsx — add import + conditional render + update exclusion arraytypes.ts — add YourWidgetGlobalConfig interface if not already presentcomponents/admin/YourWidgetConfigurationPanel.tsxcomponents/admin/FeatureConfigurationPanel.tsx — add import + register in BUILDING_CONFIG_PANELStypes.ts — add YourWidgetGlobalConfig interface if not already presentStudy components/admin/SpecialistScheduleConfigurationModal.tsx carefully before implementing. Key patterns it uses:
<div className="fixed inset-0 z-modal flex items-center justify-center p-4 bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-200">
<div className="bg-white rounded-3xl shadow-2xl w-full max-w-5xl max-h-[90vh] flex flex-col overflow-hidden border border-white/20 animate-in zoom-in-95 duration-200">
{/* Header */}
{/* Content - flex-1 overflow-y-auto p-6 space-y-8 custom-scrollbar */}
{/* Footer with Save button */}
</div>
</div>
const fetchConfig = useCallback(async () => {
if (isAuthBypass) { setLoading(false); return; }
const docRef = doc(db, 'feature_permissions', 'your-widget-type');
const snap = await getDoc(docRef);
if (snap.exists()) {
const data = snap.data() as FeaturePermission;
if (data.config) setConfig(data.config as unknown as YourWidgetGlobalConfig);
}
setLoading(false);
}, []);
await setDoc(
doc(db, 'feature_permissions', 'your-widget-type'),
{ type: 'your-widget-type', config: config as unknown as Record<string, unknown>, updatedAt: Date.now() },
{ merge: true }
);
Always use BUILDINGS from @/config/buildings for the building list. Use a tab or sidebar selector so admins can configure each building independently. Store per-building data as:
config.buildingDefaults[buildingId] = { /* building-specific config */ }
import { BUILDINGS } from '@/config/buildings';
import { doc, getDoc, setDoc } from 'firebase/firestore';
import { db, isAuthBypass } from '@/config/firebase';
import { Toast } from '../common/Toast';
import { Button } from '../common/Button';
Any setting that exists in the user-level widget settings (components/widgets/YourWidget/Settings.tsx) should be replicated here as a per-building default value. When a teacher adds the widget, it initializes from this config based on their assigned building.
Read the user-level
Settings.tsxfile for the widget first to inventory all configurable fields.
Common pattern: check featurePermissions in AuthContext / useAuth() to hydrate widget initial state from global config.
Settings that should not be exposed to users at all:
When a widget is added to a dashboard, its initial config is typically populated from:
selectedBuildings[0] from useAuth()featurePermissions array from useAuth() → find the permission for the widget type → read .config.buildingDefaults[buildingId]Make sure the widget's initialization code in DashboardContext.tsx or the widget component itself reads from featurePermissions. Reference how SpecialistScheduleSettings.tsx reads featurePermissions for a working example:
const globalConfig = useMemo(() => {
const perm = featurePermissions.find(p => p.widgetType === 'your-widget-type');
return perm?.config as YourWidgetGlobalConfig | undefined;
}, [featurePermissions]);
const buildingId = selectedBuildings[0] ?? 'schumann-elementary';
const buildingConfig = globalConfig?.buildingDefaults?.[buildingId] ?? defaultConfig;
In types.ts, add a global config interface:
export interface YourWidgetGlobalConfig {
buildingDefaults?: Record<string, YourWidgetBuildingConfig>;
// admin-only top-level fields here
}
export interface YourWidgetBuildingConfig {
// mirrors user-level WidgetConfig fields as optional defaults
fontFamily?: string;
someToggle?: boolean;
// ... other default fields
}
Update FeaturePermission if it doesn't already have a union type for your config — most widgets use config?: Record<string, unknown> on FeaturePermission and cast at the call site, which is fine.
For simpler configs, the panel component receives:
interface YourWidgetConfigurationPanelProps {
config: Record<string, unknown>;
onChange: (newConfig: Record<string, unknown>) => void;
}
It renders building selector tabs + config fields. The parent GenericConfigurationModal handles Save/Cancel and Firestore persistence via FeaturePermissionsManager's updatePermission → savePermission flow.
See ClockConfigurationPanel.tsx, ScheduleConfigurationPanel.tsx, or DiceConfigurationPanel.tsx for simple examples.
Match the specialist-schedule modal's visual quality:
text-sm font-black text-slate-700 uppercase tracking-widestbg-slate-50 p-5 rounded-2xl border border-slate-200BUILDINGS arraypx-3 py-1.5 text-xs border border-slate-200 rounded-xl focus:ring-2 focus:ring-[color]-500 outline-none font-boldbg-brand-blue-primary text-white or widget-specific accent color<Toast> component for save confirmations/errorsisAuthBypass is true (dev mode)Wrong location — Do NOT put this in components/widgets/YourWidget/Settings.tsx. That is the user-level panel. Admin config goes in components/admin/.
Not wiring in FeaturePermissionsManager — Creating the modal file is not enough. You MUST add the conditional render block in FeaturePermissionsManager.tsx. Without this, the gear button does nothing.
Not adding to the exclusion array — If you create a dedicated modal but forget to exclude the widget type from the GenericConfigurationModal fallback, both will try to render.
Missing isAuthBypass guard — Dev/test environments use isAuthBypass = true to skip Firebase. Always check this before Firestore reads/writes.
Hardcoding building IDs — Always import and iterate over BUILDINGS from @/config/buildings rather than hardcoding building IDs.
Forgetting to update types.ts — If you add new config fields, add them to the interface in types.ts. The config field on FeaturePermission accepts Record<string, unknown> and is cast at the callsite.
Using local widget state — Admin configs are global. Ensure saves go to Firestore, not just component state.
What SKILL.md sets; muted values are Claude Code's defaults
41 skills in this plugin
/aim-higherTake a task, research how top practitioners in its field work, push it to go deeper across altitude, depth, range and verification, grill the user until the plan is settled, then do the work and prove it worked with real measurements./animateBuild an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations./Other plugins' skills for the same job
npx claudepluginhub ops-pivers/claude-skills --plugin pauls-skills