$npx -y skills add lujiafa/houtu-project-skills --skill houtu-dependencieshoutu-dependencies enterprise-grade Spring Cloud microservice foundational framework complete usage guide. GroupId is io.github.lujiafa, covering unified response, exception handling, parameter parsing, session authentication, permission control, signature verification, anti-repl
| 1 | # Houtu Framework — AI Agent Coding Guide |
| 2 | |
| 3 | houtu-dependencies is an enterprise-grade foundational framework for Spring Boot / Spring Cloud microservices that implements "Activate-on-import" via the Spring Boot Starter mechanism, allowing developers to focus entirely on business logic. |
| 4 | |
| 5 | **Repository**: https://github.com/lujiafa/houtu-dependencies |
| 6 | **Git Branches**: `3.5.2`, `3.5.1`, `3.5.0`, `2.7.3`, `2.7.2`, `2.7.1` (branch name = version) |
| 7 | |
| 8 | --- |
| 9 | |
| 10 | ## Core Principles |
| 11 | |
| 12 | 1. **Activate-on-import** — Capabilities are automatically enabled after adding a starter dependency; no @Enable annotations or manual configuration needed |
| 13 | 2. **Annotation-driven** — Control behavior through annotations (`@Lock`, `@CheckSession`, `@SecurityWatch`...); do not hand-write interceptors/AOP |
| 14 | 3. **Framework-first** — For capabilities already encapsulated by the framework, use the framework approach by default instead of native Spring; defer to user when they explicitly request the native approach |
| 15 | 4. **Convention over configuration** — Follow framework defaults; only override when customization is needed |
| 16 | 5. **Version-aware** — Package paths, API names, and configuration approaches differ across versions; the version must be confirmed before generating code |
| 17 | |
| 18 | --- |
| 19 | |
| 20 | ## Code Generation Workflow (must be executed in order) |
| 21 | |
| 22 | ``` |
| 23 | Step 1: Detect Version & Dependencies → Step 2: Identify Scenario → Step 3: Load Module Reference → Step 4: Generate Code → Step 5: Verify |
| 24 | ``` |
| 25 | |
| 26 | ### Step 1 — Detect Version & Dependencies |
| 27 | |
| 28 | **The version must be determined before generating any code, and the BOM must be imported.** |
| 29 | |
| 30 | Read the project build file (`pom.xml` or `build.gradle` / `build.gradle.kts`) and determine in the following order: |
| 31 | |
| 32 | **1a. houtu already imported —** The build file contains `houtu-dependencies` or `spring-cloud-houtu`: |
| 33 | - Read the version number directly to determine the version, proceed to Step 2 |
| 34 | - **Multi-module projects**: The BOM is usually declared in the root `pom.xml` or root `build.gradle` under `dependencyManagement`; submodules inherit it and do not need to add it again |
| 35 | |
| 36 | **1b. Not imported but user explicitly wants houtu —** The user mentions "use houtu", "integrate houtu", "use houtu-dependencies", etc.: |
| 37 | - Confirm the version (ask the user or infer from the project's Spring Boot version: `3.x` → `3.5.2`, `2.x` → `2.7.3`) |
| 38 | - **Proactively add the BOM to the build file**: |
| 39 | |
| 40 | **Maven (pom.xml):** |
| 41 | ```xml |
| 42 | <!-- Base module BOM (required) --> |
| 43 | <dependency> |
| 44 | <groupId>io.github.lujiafa</groupId> |
| 45 | <artifactId>houtu-dependencies</artifactId> |
| 46 | <version>${version}</version> |
| 47 | <type>pom</type> |
| 48 | <scope>import</scope> |
| 49 | </dependency> |
| 50 | ``` |
| 51 | **Gradle (build.gradle / build.gradle.kts):** |
| 52 | ```kotlin |
| 53 | // Base module BOM (required) |
| 54 | implementation platform("io.github.lujiafa:houtu-dependencies:${version}") |
| 55 | ``` |
| 56 | If the task involves Spring Cloud modules (Feign, canary routing, Sentinel, service discovery), also add: |
| 57 | ```xml |
| 58 | <!-- Maven: Spring Cloud enhancement module BOM --> |
| 59 | <dependency> |
| 60 | <groupId>io.github.lujiafa</groupId> |
| 61 | <artifactId>spring-cloud-houtu</artifactId> |
| 62 | <version>${version}</version> |
| 63 | <type>pom</type> |
| 64 | <scope>import</scope> |
| 65 | </dependency> |
| 66 | ``` |
| 67 | ```kotlin |
| 68 | // Gradle: Spring Cloud enhancement module BOM |
| 69 | implementation platform("io.github.lujiafa:spring-clo |