spatial-design – skill Thiết kế & UI cho agent AI
Hướng dẫn triển khai Spatial Design cho web và ứng dụng. Kích hoạt khi người dùng muốn bố cục nhận biết môi trường, lấy cảm hứng từ Apple Vision Pro và thẩm mỹ mixed reality.
Cài skill spatial-design bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/spatial-design-9e83d.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /spatial-design – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/spatial-design-9e83d.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $spatial-design – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/spatial-design-9e83d.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /spatial-design – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/spatial-design-9e83d.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /spatial-design – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Spatial Design
> "UI that belongs in the room with you. Transparent, glass-like panels that react to the lighting of the physical space."
When to Use
Use this sub-style when the user's request matches the aesthetic described above. This is a child reference of the design-it skill and is not meant to be triggered directly.
Core Principles
1. Environmental Transparency: The UI acts like a glass pane. It is deeply reliant on background blur, but specifically aims to let the environment (or a simulated environment image) dictate the mood.
2. Dynamic Lighting: Elements respond to cursor position as if a flashlight is shining on them.
3. Subtle Volume: Not flat, but not extremely 3D. Elements have a very thin rim of light around the edge (specular highlight).
Visual DNA
- Colors: Almost exclusively uses
rgba()white or black. The actual color comes entirely from the background environment. - Typography: Extremely sharp, high legibility. Often uses varying font weights to establish hierarchy without relying on color. Apple's
SF Prois the gold standard here. - Icons: Outlined, high-legibility glyphs.
Web Implementation
- CSS Example:
body {
/* Needs a complex background to look right */
background: #203040 url('room-environment.jpg') center / cover no-repeat;
}
.spatial-panel {
/* The core material */
background: rgba(255, 255, 255, 0.2); /* Very sheer */
backdrop-filter: blur(40px) saturate(150%);
-webkit-backdrop-filter: blur(40px) saturate(150%);
border-radius: 32px;
padding: 40px;
/* The specular rim light */
box-shadow:
inset 0 1px 1px rgba(255,255,255,0.6),
inset 0 0 1px 1px rgba(255,255,255,0.2),
0 24px 48px rgba(0,0,0,0.1);
}
.spatial-btn {
background: rgba(0,0,0,0.1);
color: white;
border-radius: 20px;
padding: 12px 24px;
backdrop-filter: blur(10px);
transition: all 0.2s;
}
.spatial-btn:hover {
background: rgba(255,255,255,0.2);
/* Highlight effect */
box-shadow: inset 0 0 20px rgba(255,255,255,0.4);
}App Implementation
SwiftUI
struct SpatialDesignView: View {
var body: some View {
ZStack {
// Environment background
Image("room-environment")
.resizable()
.aspectRatio(contentMode: .fill)
.ignoresSafeArea()
// Spatial Panel
VStack(spacing: 24) {
Text("Environmental UI")
.font(.title).fontWeight(.bold)
.foregroundColor(.white)
Button(action: {}) {
Text("Interact")
.foregroundColor(.white)
.padding(.horizontal, 32)
.padding(.vertical, 16)
}
.background(.ultraThinMaterial)
.clipShape(Capsule())
.overlay(Capsule().stroke(Color.white.opacity(0.3), lineWidth: 1))
}
.padding(40)
.background(.ultraThinMaterial) // The core spatial material
.cornerRadius(32)
// Specular rim light
.overlay(
RoundedRectangle(cornerRadius: 32)
.stroke(
LinearGradient(
colors: [.white.opacity(0.6), .white.opacity(0.1)],
startPoint: .topLeading, endPoint: .bottomTrailing
),
lineWidth: 1
)
)
// Very soft, diffuse shadow
.shadow(color: .black.opacity(0.1), radius: 40, y: 20)
}
}
}.background(.ultraThinMaterial)is exactly what Apple uses for this aesthetic.- The specular highlight is critical. Use an
.overlaywith aLinearGradientstroke to simulate a light source hitting the top-left edge of the glass.
Flutter
import 'dart:ui';
class SpatialDesignScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
fit: StackFit.expand,
children: [
Image.asset('assets/room-environment.jpg', fit: BoxFit.cover),
Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(32),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 30.0, sigmaY: 30.0),
child: Container(
width: 350,
padding: const EdgeInsets.all(40),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.1),
borderRadius: BorderRadius.circular(32),
// Specular rim light
border: Border.all(color: Colors.white.withOpacity(0.4), width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text('Environmental UI', style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold)),
const SizedBox(height: 32),
// Spatial Button
ClipRRect(
borderRadius: BorderRadius.circular(50),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.1),
border: Border.all(color: Colors.white.withOpacity(0.2)),
borderRadius: BorderRadius.circular(50),
),
child: const Text('Interact', style: TextStyle(color: Colors.white)),
),
),
)
],
),
),
),
),
),
],
),
);
}
}BackdropFilteris required to blur the background.- Notice the button *inside* the panel also has a
BackdropFilter. This creates nested glass, which is a hallmark of Spatial Design.
React Native
// REQUIRES: @react-native-community/blur
import { BlurView } from '@react-native-community/blur';
const SpatialDesignScreen = () => {
return (
<ImageBackground source={{uri: 'room_bg'}} style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<View style={{ width: '85%', shadowColor: '#000', shadowOffset: { width: 0, height: 20 }, shadowOpacity: 0.1, shadowRadius: 40, elevation: 10 }}>
<BlurView
style={{ borderRadius: 32, borderWidth: 1, borderColor: 'rgba(255,255,255,0.4)', padding: 40, alignItems: 'center' }}
blurType="light"
blurAmount={20}
>
<Text style={{ color: '#FFF', fontSize: 28, fontWeight: 'bold', marginBottom: 32 }}>
Environmental UI
</Text>
<View style={{ borderRadius: 50, overflow: 'hidden' }}>
<BlurView blurType="dark" blurAmount={10} style={{ paddingVertical: 16, paddingHorizontal: 32, borderWidth: 1, borderColor: 'rgba(255,255,255,0.2)' }}>
<Text style={{ color: '#FFF', fontSize: 16 }}>Interact</Text>
</BlurView>
</View>
</BlurView>
</View>
</ImageBackground>
);
};BlurViewfrom@react-native-community/bluris one backdrop-blur option; evaluate platform support and reduced-transparency fallback.- Use
blurType="light"for the main panel andblurType="dark"for the buttons to create contrast between the glass layers.
Jetpack Compose
@Composable
fun SpatialDesignScreen() {
Box(modifier = Modifier.fillMaxSize()) {
Image(painterResource(R.drawable.room_environment), null, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize())
Box(
modifier = Modifier
.align(Alignment.Center)
.width(350.dp)
// Shadow goes on the outside
.shadow(20.dp, RoundedCornerShape(32.dp), spotColor = Color.Black.copy(alpha = 0.1f))
// Android 12+ Blur
.graphicsLayer {
// No renderEffect here: it would blur this panel and its text, not the room.
clip = true
shape = RoundedCornerShape(32.dp)
}
.background(Color.White.copy(alpha = 0.1f))
.border(1.dp, Brush.linearGradient(listOf(Color.White.copy(alpha = 0.6f), Color.Transparent)), RoundedCornerShape(32.dp))
.padding(40.dp),
content… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- spec-driven-loop – Chốt PRD, thiết kế kỹ thuật và tiêu chí nghiệm thu trước khi làm việc Codex quy mô trung…
- stability-ai – Tạo ảnh qua Stability AI (SD3.5, Ultra, Core). Text-to-image, img2img, inpainting…
- stitch-design-taste – Dùng khi tạo hệ thống DESIGN.md cho Google Stitch với kiểu chữ, màu sắc, bố cục, ý định…
- stitch-ui-design – Hướng dẫn chuyên sâu viết prompt hiệu quả trong Google Stitch, công cụ thiết kế UI bằng…
- styleseed-design-review – Rà soát mã UI/frontend và chỉ ra chính xác vì sao nó "trông như do AI tạo ra", rồi hướng…
- swiftui-ui-patterns – Áp dụng các UI pattern SwiftUI đã được kiểm chứng cho điều hướng, sheet, trạng thái…
- swiss-design – Hướng dẫn triển khai web và app theo Swiss Design (International Typographic Style)…
- synthwave – Hướng dẫn triển khai web và app theo phong cách Synthwave. Kích hoạt khi người dùng muốn…