Claude-skill-registry contacts
Manage Google Contacts with full CRUD operations via Ruby scripts. This skill should be used when searching, viewing, creating, updating, or deleting contacts in Google Contacts. Supports contact lookup, batch operations, and comprehensive contact field management including names, emails, phones, addresses, birthdays, organizations, and notes.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/contacts" ~/.claude/skills/majiayu000-claude-skill-registry-contacts && rm -rf "$T"
skills/data/contacts/SKILL.mdGoogle Contacts Management Skill
Overview
Provide comprehensive Google Contacts management capabilities through Ruby-based scripts with shared authentication. Enable full CRUD operations (Create, Read, Update, Delete) on Google Contacts with support for all standard contact fields.
When to Use This Skill
Use this skill for ANY Google Contacts operations:
- Search & Lookup: Find contacts by name, email, or other fields
- View Details: Get complete contact information including all fields
- Create Contacts: Add new contacts with any combination of fields
- Update Contacts: Modify existing contact information
- Delete Contacts: Remove contacts from Google Contacts
- List & Browse: View all contacts with pagination support
- Batch Operations: Manage multiple contacts efficiently
Authentication
This skill shares authentication with the calendar skill via
~/.claude/.google/token.json. Both skills use the same OAuth token with scopes:
(Calendar access)https://www.googleapis.com/auth/calendar
(Contacts read/write access)https://www.googleapis.com/auth/contacts
When either skill refreshes the token, both skills benefit from the updated authentication.
First-Time Setup
If not already configured:
- Ensure
exists with OAuth credentials~/.claude/.google/client_secret.json - Run any contacts operation - the script will prompt for authorization
- The token will be stored and shared with calendar skill
Re-authorization for New Scope
Since the contacts scope has been updated from readonly to full access, you'll need to re-authorize once:
# Delete the existing token to force re-authorization rm ~/.claude/.google/token.json # Run any contacts operation to trigger OAuth flow ~/.claude/skills/contacts/scripts/contacts_manager.rb --list
Follow the authorization URL and enter the code when prompted.
Core Script: contacts_manager.rb
Location:
scripts/contacts_manager.rb
Comprehensive Ruby script providing all Google Contacts operations through the People API v1.
Search Contacts
Find contacts by name or other search criteria:
# Search by name contacts_manager.rb --search "John Smith" # Search by partial name contacts_manager.rb --search "John"
Returns JSON with matching contacts including all available fields.
Get Contact Details
Retrieve complete information for a specific contact:
# Get by resource name (from search results) contacts_manager.rb --get "people/c1234567890"
Returns full contact details including names, emails, phones, addresses, birthdays, organizations, notes, and URLs.
List All Contacts
Browse contacts with pagination support:
# List first 100 contacts contacts_manager.rb --list # List with custom page size contacts_manager.rb --list --page-size 50 # Get next page using token from previous response contacts_manager.rb --list --page-token "NEXT_PAGE_TOKEN"
Returns array of contacts with
next_page_token for pagination.
Create New Contact
Add a new contact with any combination of fields:
# Minimal contact (name and email) contacts_manager.rb --create '{ "name": { "given_name": "John", "family_name": "Doe", "display_name": "John Doe" }, "emails": [ {"value": "john@example.com", "type": "home"} ] }' # Complete contact with all fields contacts_manager.rb --create '{ "name": { "given_name": "Jane", "family_name": "Smith", "display_name": "Jane Smith" }, "emails": [ {"value": "jane@work.com", "type": "work"}, {"value": "jane@personal.com", "type": "home"} ], "phones": [ {"value": "555-1234", "type": "mobile"}, {"value": "555-5678", "type": "work"} ], "organization": { "name": "Acme Corp", "title": "Senior Engineer" }, "birthday": { "year": 1990, "month": 5, "day": 15 }, "addresses": [ { "street": "123 Main St", "city": "Springfield", "state": "IL", "zip": "62701", "country": "US", "type": "home" } ], "notes": "Met at conference 2024" }'
Update Existing Contact
Modify contact information using resource name:
# Update phone number contacts_manager.rb --update "people/c1234567890" \ --update-data '{"phones":[{"value":"555-9999","type":"mobile"}]}' \ --update-mask "phoneNumbers" # Update email addresses contacts_manager.rb --update "people/c1234567890" \ --update-data '{"emails":[{"value":"newemail@example.com","type":"work"}]}' \ --update-mask "emailAddresses" # Update multiple fields contacts_manager.rb --update "people/c1234567890" \ --update-data '{ "phones":[{"value":"555-1111","type":"mobile"}], "organization":{"name":"New Company","title":"Director"} }' \ --update-mask "phoneNumbers,organizations"
Update Mask Fields: Specify which fields to update (comma-separated):
- Name fieldsnames
- Email addressesemailAddresses
- Phone numbersphoneNumbers
- Organization/company infoorganizations
- Birthday informationbirthdays
- Physical addressesaddresses
- Notes/biographybiographies
Delete Contact
Remove a contact permanently:
contacts_manager.rb --delete "people/c1234567890"
Warning: This permanently deletes the contact. There is no undo.
Contact Field Reference
See
references/contact_fields.md for comprehensive documentation of all available contact fields and their data structures.
Common Fields
- Names:
,given_name
,family_namedisplay_name - Emails:
,value
(home, work, other)type - Phones:
,value
(mobile, home, work, other)type - Organizations:
,nametitle - Birthdays:
,year
,monthday - Addresses:
,street
,city
,state
,zip
,countrytype - Notes: Free-form text for additional information
- URLs: Website URLs with type classification
Workflow Patterns
Finding Contact Information
# 1. Search for contact SEARCH_RESULT=$(contacts_manager.rb --search "John Smith") # 2. Extract resource name from results RESOURCE_NAME=$(echo $SEARCH_RESULT | jq -r '.contacts[0].resource_name') # 3. Get full details contacts_manager.rb --get "$RESOURCE_NAME"
Creating Contact from Name
When user provides just a name, create minimal contact:
contacts_manager.rb --create '{ "name": { "given_name": "FirstName", "family_name": "LastName", "display_name": "FirstName LastName" } }'
Then update with additional information as provided.
Bulk Updates
For updating multiple contacts, search first, then update each:
# Find all contacts at company contacts_manager.rb --search "Acme Corp" > contacts.json # Process each contact (example in shell) cat contacts.json | jq -r '.contacts[].resource_name' | while read resource; do contacts_manager.rb --update "$resource" \ --update-data '{"organization":{"name":"Acme Corporation"}}' \ --update-mask "organizations" done
Integration with Calendar Skill
Since both skills share authentication, they work seamlessly together:
# Use calendar skill to find meeting attendees calendar_manager.rb --list-events # Add attendee to contacts contacts_manager.rb --create '{"name":{...}, "emails":[...]}' # Update contact with meeting notes contacts_manager.rb --update "people/c123" \ --update-data '{"notes":"Met at Q1 planning meeting"}' \ --update-mask "biographies"
Error Handling
The script returns JSON with status and error details:
{ "status": "error", "code": "AUTH_ERROR|API_ERROR|INVALID_ARGS", "message": "Detailed error message" }
Exit Codes:
- Success0
- Operation failed1
- Authentication error2
- API error3
- Invalid arguments4
Common Use Cases
Email Skill Integration
The contacts skill complements the email skill by providing contact lookup:
# Find contact email EMAIL=$(contacts_manager.rb --search "Rob" | jq -r '.contacts[0].emails[0].value') # Use with email skill ~/.claude/skills/email/SKILL.md "Send Rob a message about the project"
Contact Deduplication
# List all contacts contacts_manager.rb --list > all_contacts.json # Process to find duplicates (requires custom logic) # Then delete duplicates contacts_manager.rb --delete "people/c123"
Birthday Reminders
# Search contacts with birthdays contacts_manager.rb --list | jq '.contacts[] | select(.birthday != null)' # Add birthday to contact contacts_manager.rb --update "people/c123" \ --update-data '{"birthday":{"month":5,"day":15}}' \ --update-mask "birthdays"
Best Practices
- Search Before Create: Always search to avoid duplicates
- Use Resource Names: Store resource names for quick access to frequently used contacts
- Minimal Creates: Create contacts with minimal info, update with details later
- Careful Deletes: Double-check before deleting - it's permanent
- Batch Operations: Use pagination for large contact lists
- Update Masks: Always specify update mask to avoid overwriting unintended fields
- Error Handling: Check JSON status field before processing results
Troubleshooting
Authentication Issues
# Re-authorize if token invalid rm ~/.claude/.google/token.json contacts_manager.rb --list
Scope Errors
If you see scope-related errors, ensure the token has the full contacts scope:
# Check current scopes cat ~/.claude/.google/token.json | jq -r '.default' | jq -r '.scope' # Should include: https://www.googleapis.com/auth/contacts
API Quota Limits
Google Contacts API has rate limits. If you hit quota:
- Wait a few minutes before retrying
- Reduce page size for list operations
- Batch updates efficiently
Script Version
Current version: 1.0.0
Run
contacts_manager.rb --version to check installed version.