Skip to content

Commit 9765779

Browse files
chore: sync claude skills mirror from source
1 parent 0ffecb9 commit 9765779

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • config/.claude/skills/cloud-functions

config/.claude/skills/cloud-functions/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Keep local `references/...` paths for files that ship with the current skill dir
5050
- Confusing official CloudBase API client work with building your own HTTP function.
5151
- Mixing Event Function code shape (`exports.main(event, context)`) with HTTP Function code shape (`req` / `res` on port `9000`).
5252
- Treating HTTP Access as the implementation model for HTTP Functions. HTTP Access is a gateway configuration for Event Functions, not the HTTP Function runtime model.
53+
- Assuming `db.collection("name").add(...)` will create a missing document-database collection automatically. Collection creation is a separate management step.
5354
- Forgetting that runtime cannot be changed after creation.
5455
- Using cloud functions as the first answer for Web login.
5556
- Forgetting that HTTP Functions must ship `scf_bootstrap`, listen on port `9000`, and include dependencies.
@@ -111,6 +112,12 @@ Use this skill when developing, deploying, and operating CloudBase cloud functio
111112
- HTTP Function details -> `./references/http-functions.md`
112113
- Logs, gateway, env vars, and legacy mappings -> `./references/operations-and-config.md`
113114

115+
## Database write reminder
116+
117+
- If a function will write to CloudBase document database, create the target collection first through console or management tooling.
118+
- `db.collection("feedback").add(...)` only inserts into an existing collection; it does not auto-create `feedback` when absent.
119+
- If the product requirement says "create when missing", implement that as an explicit collection-management step before the first write instead of assuming the runtime write call will provision it.
120+
114121
## Function types comparison
115122

116123
| Feature | Event Function | HTTP Function |

0 commit comments

Comments
 (0)