| name | contacts |
| description | 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. |
Google 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:
https://www.googleapis.com/auth/calendar (Calendar access)
https://www.googleapis.com/auth/contacts (Contacts read/write access)
When either skill refreshes the token, both skills benefit from the updated authentication.
First-Time Setup
If not already configured:
- Ensure
~/.claude/.google/client_secret.json exists with OAuth credentials
- 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:
rm ~/.claude/.google/token.json
~/.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:
contacts_manager.rb --search "John Smith"
contacts_manager.rb --search "John"
Returns JSON with matching contacts including all available fields.
Get Contact Details
Retrieve complete information for a specific contact:
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:
contacts_manager.rb --list
contacts_manager.rb --list --page-size 50
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:
contacts_manager.rb --create '{
"name": {
"given_name": "John",
"family_name": "Doe",
"display_name": "John Doe"
},
"emails": [
{"value": "john@example.com", "type": "home"}
]
}'
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:
contacts_manager.rb --update "people/c1234567890" \
--update-data '{"phones":[{"value":"555-9999","type":"mobile"}]}' \
--update-mask "phoneNumbers"
contacts_manager.rb --update "people/c1234567890" \
--update-data '{"emails":[{"value":"newemail@example.com","type":"work"}]}' \
--update-mask "emailAddresses"
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):
names - Name fields
emailAddresses - Email addresses
phoneNumbers - Phone numbers
organizations - Organization/company info
birthdays - Birthday information
addresses - Physical addresses
biographies - Notes/biography
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_name, display_name
- Emails:
value, type (home, work, other)
- Phones:
value, type (mobile, home, work, other)
- Organizations:
name, title
- Birthdays:
year, month, day
- Addresses:
street, city, state, zip, country, type
- Notes: Free-form text for additional information
- URLs: Website URLs with type classification
Workflow Patterns
Finding Contact Information
SEARCH_RESULT=$(contacts_manager.rb --search "John Smith")
RESOURCE_NAME=$(echo $SEARCH_RESULT | jq -r '.contacts[0].resource_name')
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:
contacts_manager.rb --search "Acme Corp" > contacts.json
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:
calendar_manager.rb --list-events
contacts_manager.rb --create '{"name":{...}, "emails":[...]}'
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:
0 - Success
1 - Operation failed
2 - Authentication error
3 - API error
4 - Invalid arguments
Common Use Cases
Email Skill Integration
The contacts skill complements the email skill by providing contact lookup:
EMAIL=$(contacts_manager.rb --search "Rob" | jq -r '.contacts[0].emails[0].value')
~/.claude/skills/email/SKILL.md "Send Rob a message about the project"
Contact Deduplication
contacts_manager.rb --list > all_contacts.json
contacts_manager.rb --delete "people/c123"
Birthday Reminders
contacts_manager.rb --list | jq '.contacts[] | select(.birthday != null)'
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
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:
cat ~/.claude/.google/token.json | jq -r '.default' | jq -r '.scope'
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.