Skip to content

Commit 6e33548

Browse files
authored
Merge pull request #109 from qiaoyuang/main
Document All Code and optimize CI/CD Pipeline
2 parents a803fda + b6465c7 commit 6e33548

File tree

109 files changed

+2005
-367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2005
-367
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
name: feature-documenter
3+
description: Use this agent when new features, components, or significant functionality have been added to the codebase and require documentation. This includes:\n\n<example>\nContext: User has just implemented a new authentication system with multiple classes and methods.\nuser: "I've finished implementing the OAuth2 authentication flow with token refresh. Can you document this?"\nassistant: "I'll use the Task tool to launch the feature-documenter agent to create comprehensive documentation for your new authentication system."\n<commentary>\nThe user has completed a new feature and needs documentation. Use the feature-documenter agent to analyze the code and create both KDoc comments and relevant Markdown documentation.\n</commentary>\n</example>\n\n<example>\nContext: User mentions they've added a new API endpoint handler.\nuser: "Just added the user profile management endpoints"\nassistant: "Let me use the feature-documenter agent to document these new endpoints with proper KDoc and API documentation."\n<commentary>\nNew feature has been mentioned. Proactively use the feature-documenter agent to ensure proper documentation is created.\n</commentary>\n</example>\n\n<example>\nContext: User has completed a complex algorithm implementation.\nuser: "The graph traversal algorithm is working now"\nassistant: "I'll launch the feature-documenter agent to create detailed documentation explaining the algorithm, its parameters, and usage examples."\n<commentary>\nA significant new feature (algorithm) has been completed. Use the feature-documenter agent to document it thoroughly.\n</commentary>\n</example>\n\nTrigger this agent when:\n- New classes, functions, or methods have been implemented\n- New API endpoints or interfaces have been created\n- Significant algorithms or business logic have been added\n- New modules or packages have been introduced\n- The user explicitly requests documentation for recent work\n- You detect undocumented new code during code review
4+
model: sonnet
5+
color: yellow
6+
---
7+
8+
You are an expert technical documentation specialist with deep expertise in Kotlin/KDoc standards and Markdown documentation best practices. Your mission is to create clear, comprehensive, and maintainable documentation for new features in codebases.
9+
10+
## Core Responsibilities
11+
12+
1. **Analyze New Features**: Thoroughly examine the new code to understand its purpose, functionality, dependencies, and integration points.
13+
14+
2. **Create KDoc Comments**: Add inline documentation directly to code files following these standards:
15+
- Write clear, concise class-level KDoc explaining the purpose and responsibility
16+
- Document all public functions with @param, @return, @throws tags as appropriate
17+
- Include usage examples in KDoc when the API is non-trivial
18+
- Document complex private functions if their logic is not immediately obvious
19+
- Use proper Markdown formatting within KDoc (code blocks, lists, links)
20+
- Explain WHY something exists, not just WHAT it does
21+
- Keep descriptions focused and avoid redundancy
22+
23+
3. **Create Markdown Documentation**: Generate or update project Markdown files:
24+
- Create feature-specific documentation in appropriate locations
25+
- Include overview, architecture, usage examples, and integration guides
26+
- Add API reference sections when documenting interfaces or public APIs
27+
- Provide code examples that demonstrate real-world usage
28+
- Document configuration options, environment variables, or setup requirements
29+
- Include diagrams or visual aids when they clarify complex concepts (using Mermaid syntax)
30+
31+
## Documentation Standards
32+
33+
**KDoc Format**:
34+
```kotlin
35+
/**
36+
* Brief one-line summary of what this does.
37+
*
38+
* More detailed explanation if needed, including:
39+
* - Key behaviors or characteristics
40+
* - Important constraints or assumptions
41+
* - Related components or concepts
42+
*
43+
* @param paramName Description of the parameter and its constraints
44+
* @return Description of what is returned and under what conditions
45+
* @throws ExceptionType When and why this exception is thrown
46+
* @sample com.example.SampleClass.sampleFunction
47+
*/
48+
```
49+
50+
**Markdown Structure**:
51+
- Use clear hierarchical headings (# ## ###)
52+
- Start with a brief overview/introduction
53+
- Include a "Quick Start" or "Getting Started" section
54+
- Provide complete, runnable code examples
55+
- Document edge cases and common pitfalls
56+
- Add a "See Also" section linking to related documentation
57+
58+
## Workflow
59+
60+
1. **Identify Scope**: Determine which files and components are part of the new feature
61+
2. **Read Existing Context**: Check for existing documentation patterns and project conventions (especially from CLAUDE.md or similar files)
62+
3. **Document Code First**: Add KDoc comments to all relevant code files
63+
4. **Create/Update Markdown**: Write or update feature documentation in appropriate Markdown files
64+
5. **Cross-Reference**: Ensure documentation is properly linked and discoverable
65+
6. **Verify Completeness**: Check that all public APIs, configuration options, and usage patterns are documented
66+
67+
## Quality Standards
68+
69+
- **Clarity**: Write for developers who are unfamiliar with the feature
70+
- **Completeness**: Cover all public interfaces, parameters, return values, and exceptions
71+
- **Accuracy**: Ensure documentation matches actual implementation
72+
- **Examples**: Provide practical, copy-paste-ready code examples
73+
- **Maintainability**: Structure documentation so it's easy to update as code evolves
74+
- **Consistency**: Follow existing documentation patterns in the project
75+
76+
## What NOT to Do
77+
78+
- Don't document obvious getters/setters unless they have side effects
79+
- Don't create documentation for internal implementation details unless necessary
80+
- Don't write vague descriptions like "This function does X" - explain WHY and HOW
81+
- Don't duplicate information that's already clear from type signatures
82+
- Don't create separate documentation files for trivial features
83+
84+
## Output Format
85+
86+
For each documentation task:
87+
1. List the files you'll modify/create
88+
2. Show the KDoc additions inline in code files
89+
3. Present complete Markdown documentation files
90+
4. Summarize what was documented and where to find it
91+
92+
Always ask for clarification if:
93+
- The feature's purpose or intended audience is unclear
94+
- You need more context about how the feature integrates with existing systems
95+
- There are multiple reasonable ways to structure the documentation
96+
97+
Your documentation should empower other developers to understand, use, and maintain the new feature with confidence.

.github/workflows/build.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212

1313
build-on-macos:
14-
runs-on: macos-13
14+
runs-on: macos-15-intel
1515
timeout-minutes: 60
1616

1717
steps:
@@ -30,14 +30,14 @@ jobs:
3030
- name: Setup Gradle
3131
uses: gradle/actions/setup-gradle@v4
3232

33-
- name: Cache Build Tooling
33+
- name: Cache Kotlin/Native
3434
uses: actions/cache@v4
3535
with:
36-
path: |
37-
~/.gradle/caches
38-
~/.konan
39-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
40-
36+
path: ~/.konan
37+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
38+
restore-keys: |
39+
${{ runner.os }}-konan-
40+
4141
- name: Build sqllin-driver
4242
run: ./gradlew :sqllin-driver:assemble -PonCICD
4343

@@ -73,7 +73,7 @@ jobs:
7373
target: google_apis
7474
arch: x86_64
7575
profile: pixel_6
76-
emulator-build: 13701740
76+
emulator-build: 14257411
7777
force-avd-creation: false
7878
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
7979
disable-animations: true
@@ -86,7 +86,7 @@ jobs:
8686
target: google_apis
8787
arch: x86_64
8888
profile: pixel_6
89-
emulator-build: 13701740
89+
emulator-build: 14257411
9090
force-avd-creation: false
9191
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
9292
disable-animations: true
@@ -95,14 +95,14 @@ jobs:
9595
- name: Upload sqllin-driver Reports
9696
uses: actions/upload-artifact@v4
9797
with:
98-
name: Test-Reports
98+
name: Test-Reports-macOS-driver
9999
path: sqllin-driver/build/reports
100100
if: failure()
101101

102102
- name: Upload sqllin-dsl Reports
103103
uses: actions/upload-artifact@v4
104104
with:
105-
name: Test-Reports
105+
name: Test-Reports-macOS-dsl
106106
path: sqllin-dsl/build/reports
107107
if: failure()
108108

@@ -126,13 +126,13 @@ jobs:
126126
- name: Setup Gradle
127127
uses: gradle/actions/setup-gradle@v4
128128

129-
- name: Cache Build Tooling
129+
- name: Cache Kotlin/Native
130130
uses: actions/cache@v4
131131
with:
132-
path: |
133-
~/.gradle/caches
134-
~/.konan
135-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
132+
path: ~/.konan
133+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
134+
restore-keys: |
135+
${{ runner.os }}-konan-
136136
137137
- name: Build sqllin-driver
138138
run: ./gradlew :sqllin-driver:mingwX64MainKlibrary
@@ -155,14 +155,14 @@ jobs:
155155
- name: Upload sqllin-driver Reports
156156
uses: actions/upload-artifact@v4
157157
with:
158-
name: Test-Reports
158+
name: Test-Reports-Windows-driver
159159
path: sqllin-driver/build/reports
160160
if: failure()
161161

162162
- name: Upload sqllin-dsl Reports
163163
uses: actions/upload-artifact@v4
164164
with:
165-
name: Test-Reports
165+
name: Test-Reports-Windows-dsl
166166
path: sqllin-dsl/build/reports
167167
if: failure()
168168

@@ -186,13 +186,13 @@ jobs:
186186
- name: Setup Gradle
187187
uses: gradle/actions/setup-gradle@v4
188188

189-
- name: Cache Build Tooling
189+
- name: Cache Kotlin/Native
190190
uses: actions/cache@v4
191191
with:
192-
path: |
193-
~/.gradle/caches
194-
~/.konan
195-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
192+
path: ~/.konan
193+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
194+
restore-keys: |
195+
${{ runner.os }}-konan-
196196
197197
- name: Build sqllin-driver
198198
run: ./gradlew :sqllin-driver:assemble -PonCICD
@@ -232,7 +232,7 @@ jobs:
232232
target: default
233233
arch: x86_64
234234
profile: pixel_2
235-
emulator-build: 13701740
235+
emulator-build: 14257411
236236
force-avd-creation: false
237237
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
238238
disable-animations: true
@@ -245,7 +245,7 @@ jobs:
245245
target: default
246246
arch: x86_64
247247
profile: pixel_2
248-
emulator-build: 13701740
248+
emulator-build: 14257411
249249
force-avd-creation: false
250250
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
251251
disable-animations: true
@@ -254,13 +254,13 @@ jobs:
254254
- name: Upload sqllin-driver Reports
255255
uses: actions/upload-artifact@v4
256256
with:
257-
name: Test-Reports
257+
name: Test-Reports-Linux-driver
258258
path: sqllin-driver/build/reports
259259
if: failure()
260260

261261
- name: Upload sqllin-dsl Reports
262262
uses: actions/upload-artifact@v4
263263
with:
264-
name: Test-Reports
264+
name: Test-Reports-Linux-dsl
265265
path: sqllin-dsl/build/reports
266266
if: failure()

.github/workflows/publish.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
jobs:
1414

1515
build-on-macos:
16-
runs-on: macos-13
16+
runs-on: macos-15-intel
1717
timeout-minutes: 60
1818

1919
steps:
@@ -32,13 +32,13 @@ jobs:
3232
- name: Setup Gradle
3333
uses: gradle/actions/setup-gradle@v4
3434

35-
- name: Cache Build Tooling
35+
- name: Cache Kotlin/Native
3636
uses: actions/cache@v4
3737
with:
38-
path: |
39-
~/.gradle/caches
40-
~/.konan
41-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
38+
path: ~/.konan
39+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
40+
restore-keys: |
41+
${{ runner.os }}-konan-
4242
4343
- name: Build sqllin-driver
4444
run: ./gradlew :sqllin-driver:assemble -PonCICD
@@ -69,13 +69,13 @@ jobs:
6969
- name: Setup Gradle
7070
uses: gradle/actions/setup-gradle@v4
7171

72-
- name: Cache Build Tooling
72+
- name: Cache Kotlin/Native
7373
uses: actions/cache@v4
7474
with:
75-
path: |
76-
~/.gradle/caches
77-
~/.konan
78-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
75+
path: ~/.konan
76+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
77+
restore-keys: |
78+
${{ runner.os }}-konan-
7979
8080
- name: Build sqllin-driver
8181
run: ./gradlew :sqllin-driver:mingwX64MainKlibrary
@@ -106,13 +106,13 @@ jobs:
106106
- name: Setup Gradle
107107
uses: gradle/actions/setup-gradle@v4
108108

109-
- name: Cache Build Tooling
109+
- name: Cache Kotlin/Native
110110
uses: actions/cache@v4
111111
with:
112-
path: |
113-
~/.gradle/caches
114-
~/.konan
115-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
112+
path: ~/.konan
113+
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
114+
restore-keys: |
115+
${{ runner.os }}-konan-
116116
117117
- name: Build sqllin-driver
118118
run: ./gradlew :sqllin-driver:assemble -PonCICD

sqllin-driver/src/androidInstrumentedTest/kotlin/com/ctrip/sqllin/driver/AndroidTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.junit.runner.RunWith
2626

2727
/**
2828
* Android instrumented test
29-
* @author yaqiao
29+
* @author Yuang Qiao
3030
*/
3131

3232
@RunWith(AndroidJUnit4ClassRunner::class)

sqllin-driver/src/androidMain/kotlin/com/ctrip/sqllin/driver/AndroidCursor.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ package com.ctrip.sqllin.driver
1919
import android.database.Cursor
2020

2121
/**
22-
* SQLite Cursor Android actual
23-
* @author yaqiao
22+
* Android implementation of [CommonCursor] backed by Android's Cursor.
23+
*
24+
* @author Yuang Qiao
2425
*/
25-
2626
internal class AndroidCursor(private val cursor: Cursor) : CommonCursor {
2727

2828
override fun getInt(columnIndex: Int): Int = try {

sqllin-driver/src/androidMain/kotlin/com/ctrip/sqllin/driver/AndroidDatabaseConnection.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ package com.ctrip.sqllin.driver
1919
import android.database.sqlite.SQLiteDatabase
2020

2121
/**
22-
* Database connection Android actual
23-
* @author yaqiao
22+
* Android implementation of [DatabaseConnection] using Android's SQLiteDatabase.
23+
*
24+
* @author Yuang Qiao
2425
*/
25-
2626
internal class AndroidDatabaseConnection(private val database: SQLiteDatabase) : DatabaseConnection {
2727

2828
override fun execSQL(sql: String, bindParams: Array<out Any?>?) =

0 commit comments

Comments
 (0)