whshang's AI Practice and Tooling Notes
website·Indexed 30 days ago
https://note.whshang.meA collection of practical guides and reflections on AI-native workflows, featuring tool comparisons (Claude Code vs Cursor), prompt engineering, AI Agent design, and organizational strategies for building AI knowledge bases using /CLAUDE.md. Covers technical career transitions from IC to AI manager and frameworks for AI adoption in development teams.
What's inside whshang Notes
- Increase review efficiency by using AI to handle code standards and common pattern checks, allowing human reviewers to focus exclusively on business logic and system architecture.
Apply Human-AI Collaboration principles for Agent workflows
Divide responsibilities based on strengths to ensure quality and architectural integrity. AI should handle execution, checking, and generation, while humans focus on business logic, architecture, and final decision-making.AI Responsibilities: Code generation, code review (style/standards), test case generation. Human Responsibilities: Business logic, architectural design, quality gatekeeping, effect evaluation.Understand and apply the Luck Surface Area formula
Luck Surface Area is a framework for increasing the probability of positive opportunities (luck) occurring. Instead of viewing luck as a random event, it is treated as a probability that can be expanded through two primary drivers: Passion and Effective Communication.
The Formula:
Luck Surface Area = Degree of Passion × Number of People Effectively Reached- Degree of Passion: The level of enthusiasm for a subject, the amount of effort invested, and the duration of persistence in a specific field.
- Effective Communication: The number of people who know what you are doing, recognize the value of your work, and are willing to help or collaborate.
Increasing either variable expands your 'surface area,' making it more likely that a 'lucky' opportunity will collide with your efforts.
Structure a CLAUDE.md file for maximum AI utility
A practical
CLAUDE.mdshould be problem-oriented and instantiated with concrete examples rather than abstract descriptions. Use the following framework to organize information:- Quick Overview: One-sentence project description, core feature list, and target audience.
- Tech Stack: Specific versions of frontend/backend frameworks, languages, tools, databases, and deployment environments.
- Coding Standards: Naming conventions (e.g., PascalCase for components), style guides (ESLint/Prettier), and commit message formats.
- Business Context: Core business logic, key business rules, and common business scenarios (e.g., user roles and order states).
- FAQ: Standard answers to common technical questions (e.g., 'How to get the current user').
- Caveats/Notes: Critical constraints and mandatory requirements (e.g., 'All APIs must be authenticated').
# CLAUDE.md ## Quick Overview - Project: SaaS E-commerce Admin System - Core Features: User management, Product management, Order management - Target User: E-commerce operators ## Tech Stack - Frontend: React 18, TypeScript, Ant Design - Backend: Node.js, Express, TypeScript - Database: PostgreSQL 14 - Deployment: Docker, AWS ## Coding Standards - Naming: Components (PascalCase), Hooks (useVerb), Variables (camelCase) - Style: ESLint, Prettier, TS Strict Mode - Commits: feat, fix, docs, style prefixes ## Business Context - Roles: ROLE_USER, ROLE_VIP, ROLE_ADMIN - Order Status: PENDING, PAID, SHIPPED, COMPLETED - Inventory: Real-time sync, locked upon order ## FAQ - How to get current user? Use `req.user` via JWT parsing. - How to handle permissions? Use `@RequireRole` decorator. - How to add new features? Follow MVC pattern with frontend/backend separation. ## Caveats - All APIs must be authenticated. - Database operations must use transactions. - Sensitive information must not be printed in logs.Transition from Individual Contributor (IC) to AI Manager
In the AI era, the role of a developer shifts from a 'coder' (focused on execution efficiency) to an 'AI Manager' (focused on problem definition and judgment). The core philosophy changes from 'how to implement' to 'what to implement.' The value shifts from execution speed to the ability to define requirements, decompose tasks, and control quality.Understand the AI Native work philosophy
AI Native is not about using AI as a tool (like an IDE or Git) or a simple assistant for repetitive tasks, but about a fundamental shift in work philosophy. The core transition is moving from a human-led process (Analyze $\rightarrow$ Plan $\rightarrow$ Execute $\rightarrow$ Check) to a human-AI collaborative process (AI Analyzes $\rightarrow$ Human Judges $\rightarrow$ AI Executes $\rightarrow$ Human Checks $\rightarrow$ AI Optimizes). In this model, the human shifts from being an 'executor' (coder, writer) to a 'manager' (task definer, quality controller, process optimizer).Adopt a product-oriented mindset for technical development
To avoid the gap between 'technical success' (high code quality, elegant architecture) and 'product failure' (low user adoption, poor UX), developers should shift their cognitive framework from a technology-first approach to a user-value-first approach. Technical excellence is a means to an end, not the goal itself. Success should be measured by user satisfaction and business value rather than technical metrics like test coverage or response times.Compare Claude Code and Cursor for programming tasks
Choosing between Claude Code and Cursor depends on whether the task requires deep architectural understanding or rapid iterative development.
Claude Code is better suited for 'slow' work where the core objective is understanding complex relationships rather than just completing code snippets. It excels at refactoring, cross-file adjustments, and evaluating multiple architectural trade-offs due to its strong long-context capabilities (e.g., Claude 3.5 Sonnet's 200K token window).
Cursor is better suited for 'fast' work, integrating AI directly into the editor workflow. It minimizes the friction of switching windows and re-explaining context, making it ideal for continuous iteration and small, incremental commits. While fast, it is less effective at untangling chaotic systems or making high-level system judgments compared to a dedicated long-context agent.
Career paths for technical professionals in the AI era
In the AI era, technical professionals can pursue three primary career trajectories based on their strengths and interests: Expert, Product, and Entrepreneurial. AI serves as a tool to amplify individual capabilities rather than a replacement for human judgment, architecture, and business strategy.Manage and scale CLAUDE.md for large projects
For larger projects or evolving teams, apply these management strategies to prevent the knowledge base from becoming bloated or outdated:
- Information Layering:
- Level 1 (Essential): Tech stack and core business logic.
- Level 2 (Important): Coding standards and FAQs.
- Level 3 (Optional): Deployment details and general notes.
- Modularization: Split the knowledge base into domain-specific files if the main file becomes too large:
CLAUDE.main.md(General/Comprehensive)CLAUDE.frontend.md(Frontend specific)CLAUDE.backend.md(Backend specific)CLAUDE.mobile.md(Mobile specific)
- Version Control: Use naming conventions like
CLAUDE.v1.mdfor history andCLAUDE.temp.mdfor draft updates. - Maintenance Cycle:
- Weekly checks by the Tech Lead.
- Trigger updates upon tech stack changes or business logic adjustments.
- Collaborative ownership: Tech Lead (Standards), Product Manager (Business Logic), Team (FAQs).
- Information Layering:
Strategies for remaining competitive in the AI era
To avoid being replaced by AI, professionals should shift from pure specialization to becoming 'AI + Domain' composite talents. The core strategy involves three pillars: continuous learning, leveraging AI for augmentation rather than competition, and establishing differentiation in areas where AI struggles (complex decision-making, innovation, and emotional intelligence).Guidelines for developers reviewing AI-generated code
Developers should treat AI-generated code with caution and maintain technical authority:
- Rigorous Review: Do not lower review standards just because the code was AI-generated; check for bugs and adherence to team standards.
- Architectural Authority: If the generated architecture is unreasonable, reject and rewrite it.
- Active Inquiry: Ask the AI to explain its design choices (e.g., 'Why use this pattern instead of that one?') to leverage the AI's educational value and ensure the implementation is correct.