Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Web-camera support.
.claude/skills/aiskillstore-extension-camera/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 8% | 0% |
Camera extension for Caffeine AI.
This skill adds web-camera access via a prefabricated React hook. Supports photo capture, camera switching, and error handling.
For camera support:
There is a prefabricated React hook @caffeinelabs/camera/hooks/useCamera.ts that cannot be modified.
typescript filepath=@caffeinelabs/camera/hooks/useCamera.tsimport { RefObject } from 'react'; export interface CameraConfig { // Camera facing mode - 'user' for front camera, 'environment' for back camera facingMode?: 'user' | 'environment'; // Ideal video width and height in pixels width?: number; height?: number; // Image quality for capture (0-1, where 1 is highest quality) quality?: number; format?: 'image/jpeg' | 'image/png' | 'image/webp'; } export interface CameraError { type: 'permission' | 'not-supported' | 'not-found' | 'unknown' | 'timeout'; message: string; } export interface UseCameraReturn { // Whether camera is currently active and streaming isActive: boolean; // Whether camera is supported in current browser (null while checking) isSupported: boolean | null; // Current error state, if any error: CameraError | null; // Whether camera is initializing, starting, switching, or stopping isLoading: boolean; currentFacingMode: 'user' | 'environment'; // Returns true on success startCamera: () => Promise<boolean>; stopCamera: () => Promise<void>; capturePhoto: () => Promise<File | null>; // Returns true on success switchCamera: () => (newFacingMode?: 'user' | 'environment') : Promise<boolean>; // Returns true on success retry: () => Promise<boolean>; // Ref to attach to video element for camera preview videoRef: RefObject<HTMLVideoElement>; // Ref to canvas element used for photo capture (can be hidden) canvasRef: RefObject<HTMLCanvasElement>; } export declare function useCamera(config?: CameraConfig): UseCameraReturn;
Usage example:
import { useCamera } from '@caffeineai/camera';
function CameraComponent() {
const {
isActive,
isSupported,
error,
isLoading,
startCamera,
stopCamera,
capturePhoto,
switchCamera,
videoRef,
canvasRef
} = useCamera({
autoStart: true,
facingMode: 'environment'
});
if (isSupported === false) {
return <div>Camera not supported</div>;
}
return (
<div>
<video
ref={videoRef}
style={{ width: '100%', height: 'auto' }}
playsInline
muted
/>
<canvas ref={canvasRef} style={{ display: 'none' }} />
{error && <div>Error: {error.message}</div>}
<div>
<button onClick={startCamera} disabled={isLoading || isActive}>
Start Camera
</button>
<button onClick={stopCamera} disabled={isLoading || !isActive}>
Stop Camera
</button>
<button onClick={switchCamera} disabled={isLoading || !isActive}>
Switch Camera
</button>
<button onClick={capturePhoto} disabled={!isActive}>
Take Photo
</button>
</div>
</div>
);
}Always place a capture button on camera preview! Always show a camera preview when the user opens the camera On desktop, make sure that camera cannot be switched. Only 'environment' is working. Properly display camera error messages in the app. Do not make camera buttons clickable until the camera is fully initialized and ready. Ensure the camera preview has explicit, non-zero dimensions (fixed height, min-height, or an aspect-ratio wrapper) so it never collapses due to layout. Make the preview responsive across screen sizes (e.g., width: 100% with a stable aspect ratio).
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 33,233 | 31,362 | -6% | 1 | 1 | 0% | 5,048 | 6,889 | +36% | 0 | 0 | — |
case-02 | fail→pass | 36,155 | 53,356 | +48% | 1 | 1 | 0% | 6,997 | 9,027 | +29% | 0 | 0 | — |
case-03 | fail→pass | 38,152 | 48,098 | +26% | 1 | 1 | 0% | 8,240 | 9,240 | +12% | 0 | 0 | — |
case-04 | fail→pass | 25,752 | 20,247 | -21% | 1 | 1 | 0% | 2,968 | 4,126 | +39% | 0 | 0 | — |
case-05 | pass→pass | 17,821 | 13,964 | -22% | 1 | 1 | 0% | 2,348 | 3,720 | +58% | 0 | 0 | — |
case-11 | pass→pass | 19,332 | 8,078 | -58% | 1 | 1 | 0% | 2,388 | 1,544 | -35% | 0 | 0 | — |
case-06 | fail→fail | 14,107 | 14,892 | +6% | 1 | 1 | 0% | 2,397 | 2,883 | +20% | 0 | 0 | — |
case-07 | fail→fail | 16,371 | 22,120 | +35% | 1 | 1 | 0% | 3,090 | 5,047 | +63% | 0 | 0 | — |
case-08 | pass→pass | 12,188 | 10,962 | -10% | 1 | 1 | 0% | 2,075 | 3,372 | +63% | 0 | 0 | — |
case-09 | pass→pass | 16,256 | 5,983 | -63% | 1 | 1 | 0% | 2,810 | 2,011 | -28% | 0 | 0 | — |
case-10 | pass→pass | 14,661 | 10,952 | -25% | 1 | 1 | 0% | 2,613 | 3,128 | +20% | 0 | 0 | — |
case-20 | pass→fail | 22,436 | 30,941 | +38% | 1 | 1 | 0% | 4,334 | 6,512 | +50% | 0 | 0 | — |
case-12 | pass→pass | 20,426 | 8,028 | -61% | 1 | 1 | 0% | 2,142 | 2,509 | +17% | 0 | 0 | — |
case-13 | pass→pass | 9,166 | 4,938 | -46% | 1 | 1 | 0% | 1,626 | 1,935 | +19% | 0 | 0 | — |
case-14 | fail→pass | 20,289 | 9,361 | -54% | 1 | 1 | 0% | 2,605 | 2,804 | +8% | 0 | 0 | — |
case-15 | fail→pass | 19,062 | 15,939 | -16% | 1 | 1 | 0% | 2,688 | 4,493 | +67% | 0 | 0 | — |
case-16 | pass→pass | 10,259 | 4,937 | -52% | 1 | 1 | 0% | 1,640 | 1,873 | +14% | 0 | 0 | — |
case-17 | pass→pass | 16,158 | 13,824 | -14% | 1 | 1 | 0% | 2,763 | 3,785 | +37% | 0 | 0 | — |
case-18 | fail→pass | 12,856 | 9,268 | -28% | 1 | 1 | 0% | 2,262 | 1,711 | -24% | 0 | 0 | — |
case-19 | pass→pass | 10,845 | 18,470 | +70% | 1 | 1 | 0% | 2,072 | 3,693 | +78% | 0 | 0 | — |
case-21 | pass→pass | 19,391 | 26,145 | +35% | 1 | 1 | 0% | 2,984 | 3,999 | +34% | 0 | 0 | — |
case-22 | pass→pass | 48,941 | 31,813 | -35% | 1 | 1 | 0% | 3,852 | 7,161 | +86% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.