Agent skill
managing-appwrite-functions
Handles backend logic that cannot run in the browser. Use for sensitive tasks like price calculation, cleanup, or payment verification.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/managing-appwrite-functions
SKILL.md
Appwrite Server Functions
When to use this skill
- When logic requires an API Key that shouldn't be exposed.
- For scheduled tasks (CRON jobs like "Cancel Unpaid Bookings").
- For heavy processing that would slow down the frontend.
Workflow
- Create a new function in the Appwrite Console.
- Set runtime to Node.js.
- Use
node-appwriteSDK inside the function. - Trigger via events (e.g.,
databases.*.collections.bookings.documents.*.create) or HTTP.
Example (Node.js)
const sdk = require('node-appwrite');
module.exports = async function (context) {
const client = new sdk.Client()
.setEndpoint(process.env.APPWRITE_FUNCTION_ENDPOINT)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
.setKey(context.req.headers['x-appwrite-key']);
const databases = new sdk.Databases(client);
// Logic: e.g., Confirm payment with Stripe and update DB
context.log('Function triggered');
return context.res.json({ success: true });
};
Instructions
- Security: Never hardcode keys in the function code; use Appwrite Function Environment Variables.
- Runtimes: Prefer the latest stable Node.js runtime (e.g., 18.x or 20.x).
- Execution: Check "Execute" permissions to ensure only authorized users or events can run it.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?