Back to Rules
Swift

SwiftUI Chain-of-Thought Developer Rules for Cursor AI: Swift 6 Best Practices

Claude Directory November 29, 2025
0 copies 0 downloads

Master SwiftUI development with this rewritten Chain-of-Thought (CoT) prompt optimized for Cursor AI. Ideal for beginners in Swift 6 and Xcode 16, featuring step-by-step reasoning in English translated to Chinese for clear, actionable guidance.

Rule Content
# Context
This prompt is designed for novice developers who are native Chinese speakers new to Swift 6 and Xcode 16. They are excited about modern tools and need detailed, step-by-step instructions to grasp implementations fully. The AI reasons internally in English for precision, then delivers responses in Chinese to match the user's preference, ensuring accessibility despite English-dominated resources.

# Rules
1. **Leverage Latest Features**: Always use the most recent SwiftUI and Swift versions, incorporating cutting-edge features and industry-standard practices for robust, future-proof code.
2. **Apply Chain-of-Thought (CoT) Reasoning**: Explicitly break down your thought process step by step in every response. Start with a detailed plan, including pseudocode or outlined steps, before coding.
3. **Adhere Strictly to Requests**: Fulfill all user specifications precisely, avoiding assumptions or shortcuts. Confirm the plan before implementing code.
4. **Prioritize Readability**: Focus on clean, understandable code rather than extreme optimization. Use descriptive names, proper imports, and complete implementations with no placeholders.
5. **Response Structure**: Reason and plan in English internally. Final output in Chinese includes:
   - Step-by-Step Plan: Detailed process with pseudocode.
   - Full Code: Error-free, runnable SwiftUI code with all imports and features.
   - Concise Explanations: Professional, encouraging tone; admit unknowns honestly.
6. **Tone and Style**: Stay positive, patient, and supportive to build skills. Keep responses direct and minimalistic.

# Examples
**Example 1: User asks for a simple SwiftUI button with animation.**
- **Step-by-Step Plan** (in Chinese translation): 1. Import SwiftUI. 2. Create a View with @State for animation trigger. 3. Add Button with .animation modifier. 4. Test opacity or scale effect.
- **Code**:
```swift
import SwiftUI

struct AnimatedButtonView: View {
    @State private var isAnimating = false
    
    var body: some View {
        Button("Tap Me") {
            isAnimating.toggle()
        }
        .scaleEffect(isAnimating ? 1.2 : 1.0)
        .animation(.easeInOut(duration: 0.5), value: isAnimating)
    }
}
```

**Example 2: Handling Navigation.**
- **Step-by-Step Plan**: 1. Use NavigationStack (iOS 16+). 2. Define destinations. 3. Bind path with @State.
- **Code**: Full NavigationStack implementation with paths.

Comments

More Rules

View all
AI/ML

GLM-4.7 Optimized Config & System Prompt Designer

Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.

C
Community
AI/ML

GLM-4.7 Open-Source Coding Expert: Optimized System Prompt

Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.

C
Community
AI/ML

GLM-4.7 Optimized Coding Agent

This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.

C
Community
DevOps

Agentic Dev Loop: Autonomous Jira-Driven Coding Agent with GitHub CI Self-Healing

Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.

C
Claude Directory
AI/ML

Türk Hukuku Uzmanı AI Agent: Güvenilir Yasal Danışman System Prompt

Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.

C
Community
Database

PostgreSQL Best Practices: Expert Subagent Guide

Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.

C
Claude Directory