用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arm2arm/AstroAgentAssistant --skill webxr-experience命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | webxr-experience |
| description | Build WebXR portal doors. Use when creating portal doors. |
| version | 1.0.0 |
| author | Hermes Agent |
Create WebXR portal doors and AR experiences with camera access, running in browsers behind HAProxy with HTTPS.
getUserMedia) vs WebXR ARproject/
├── index.html # Landing page with buttons
├── css/style.css # Styling
├── js/app.js # Three.js + WebXR logic
├── Dockerfile # nginx container
├── ssl/ # Pre-generated certs (if building SSL in Docker)
└── .dockerignore
Direct Camera Access (Universal):
// Works on any browser with HTTPS
async openCamera() {
const stream = await navigator.mediaDevices.getUserMedia({
video: { facingMode: 'environment', width: 1920, height: 1080 },
audio: false
});
videoElement.srcObject = stream;
videoElement.play();
}
WebXR AR (Chrome for Android only):
// Check support first
const supported = await navigator.xr.isSessionSupported('immersive-ar');
if (!supported) return;
// Dynamic feature detection (don't hardcode domOverlay)
const features = ['local-floor'];
// Try optional features one by one
const session = await navigator.xr.requestSession('immersive-ar', {
requiredFeatures: features,
optionalFeatures: ['hand-tracking', 'hit-test', 'light-estimation']
});
| Feature | Chrome Android | Brave | Firefox | Desktop Chrome |
|---|---|---|---|---|
| Direct Camera | ✅ | ✅ | ✅ | ✅ |
| WebXR AR | ✅ | ❌ | ❌ | ❌ |
| WebXR VR | ✅ | Partial | ❌ | ✅ (flags) |
Requirements for WebXR AR:
crossOriginIsolated headersCritical Permission Fix:
# Files copied into Docker get root:root 600 permissions
# This causes 403 errors - nginx can't read them
COPY index.html /usr/share/nginx/html/
RUN chown -R nginx:nginx /usr/share/nginx/html && \
find /usr/share/nginx/html -type d -exec chmod 755 {} \; && \
find /usr/share/nginx/html -type f -exec chmod 644 {} \;
Dockerfile Template:
FROM nginx:alpine
COPY . /usr/share/nginx/html/
RUN chown -R nginx:nginx /usr/share/nginx/html && \
find /usr/share/nginx/html -type d -exec chmod 755 {} \; && \
find /usr/share/nginx/html -type f -exec chmod 644 {} \;
RUN rm -f /etc/nginx/conf.d/default.conf
RUN cat > /etc/nginx/conf.d/portal.conf << 'EOF'
server {
listen 8123;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / { try_files $uri $uri/ =404; }
}
EOF
EXPOSE 8123
CMD ["nginx", "-g", "daemon off;"]
Frontend (SSL Termination):
frontend webxr_frontend
bind *:443 ssl crt /etc/haproxy/certs/webxr.pem
# Required for WebXR
http-response set-header Cross-Origin-Embedder-Policy require-corp
http-response set-header Cross-Origin-Opener-Policy same-origin
http-response set-header Cross-Origin-Resource-Policy cross-origin
# Forward protocol
http-request set-header X-Forwarded-Proto https
http-request set-header Host webxr.example.com
use_backend webxr_backend
Backend:
backend webxr_backend
mode http
server webxr 127.0.0.1:8123 check inter 30s
chown nginx:nginx)domOverlay failures - Don't use domOverlay in session request. Many devices don't support it.isSessionSupported() to check each feature before requesting. Don't hardcode.Permissions-Policy: camera=() blocks ALL domains — If HAProxy has a blanket Permissions-Policy in the frontend, it blocks camera for ar.aip.de too. Fix: use rspdel + rspadd with { ssl_fc_sni ar.aip.de } to override per-domain. Must set camera=(self) not camera=().@vitejs/plugin-react which changed API. Remove babel key from plugin config. Run pnpm config set allow-scripts true before pnpm build to allow esbuild scripts.Use glass-morphism cards, gradient text, animated backgrounds, and hero sections for premium portal landing pages. See references/css-theming.md for CSS variable palettes.
Key patterns:
:root CSS custom properties for theme variables (primary, accent, bg-dark, bg-card, text-muted, border, glow)radial-gradient + repeating-linear-gradient with @keyframesbackdrop-filter: blur(20px), semi-transparent backgrounds, colored borders-webkit-background-clip: text with animated background-size: 200%backdrop-filter: blur(20px), brand icon, gradient textDesign system: references/css-theming.md — pre-built palettes (ocean blue, purple, green, red)
Modern WebXR stack. Session 2026-07-29 deployed to /home/hermes/projects/react-xr-portal.
Build flow:
pnpm installbabel key from @vitejs/plugin-react (changed API)pnpm config set allow-scripts true (allows esbuild postinstall)pnpm build → outputs to dist/Common build errors:
babel key in Vite config → remove it (plugin API changed in v6+)pnpm config set allow-scripts true