new-method

Add org-scoped Meteor 3 server methods with check-gate-data flow.

3|4|Updated Mar 22, 2014
One-click install
npx skills add https://github.com/gui81/scorekeeper --skill new-method
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-method
Source: https://github.com/gui81/scorekeeper/tree/main/.claude/skills/new-method
Command: npx skills add https://github.com/gui81/scorekeeper --skill new-method

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers add secure, org-scoped server methods to Meteor 3 apps, ensuring member/admin actions are properly gated and isolated by organization.

Core Features & Use Cases

  • Supports two action categories: member actions and admin actions, directing code to the correct files (methods.js for members, org-methods.js for admins) and validating org_id scope.
  • Enforces a strict execution order (check, gate, data) to prevent invalid inputs and unauthorized access, and uses async Mongo calls to operate only within the targeted org_id.
  • Example: add a method that creates a new document for an organization after verifying membership and role, then persists it to the correct collection.

Quick Start

Identify the target file (methods.js or org-methods.js) and insert a new async method following the existing template.

Frequently Asked Questions about new-method

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add secure server methods in Meteor 3 with org gating?

Meteor 3 server methods enforce org security by applying a strict check, gate, data execution order. This validates inputs, verifies membership or admin roles, and isolates all database operations by doc.org_id to prevent cross-organization access.

How do I scope async MongoDB calls to a specific org_id in Meteor 3?

Scope async MongoDB calls to a specific org_id by using findOneAsync, insertAsync, updateAsync, removeAsync, fetchAsync, or countAsync with queries filtered by doc.org_id to ensure all data operations remain isolated within the targeted organization.

What is the security-ordered flow for Meteor 3 server methods?

The security-ordered flow for Meteor 3 server methods is check, gate, data. This sequence validates arguments first, enforces authorization and org membership second, and executes scoped async MongoDB operations last to maintain strict data isolation.

Does this method structure separate member and admin actions in Meteor?

Yes, member actions route to app/imports/api/methods.js and admin actions route to app/imports/api/org-methods.js. Admin actions specifically require owner or maintainer roles, while member actions are accessible by any validated organization member.

Why should I use async MongoDB calls instead of synchronous ones in Meteor 3?

Meteor 3 requires async MongoDB calls like findOneAsync and updateAsync because synchronous database operations are no longer supported. Using async calls ensures non-blocking execution while maintaining org_id scoping for secure data access.

Can I create org-scoped documents with admin role validation in Meteor 3?

Yes, you can create org-scoped documents with admin role validation by adding an async method to org-methods.js that checks for owner or maintainer roles, then uses insertAsync scoped by doc.org_id to persist the new document securely.