recipe-copy-sheet-for-new-month

Duplicates a Google Sheets template tab and renames it for a new month of tracking.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-copy-sheet-for-new-month-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recipe-copy-sheet-for-new-month
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/recipe-copy-sheet-for-new-month
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-copy-sheet-for-new-month-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually duplicating a Google Sheets template tab and renaming it for each new month is repetitive and error-prone. This Skill automates the copy-and-rename workflow through the Google Sheets API so monthly tracking sheets are created consistently. ## Core Features & Use Cases - Template Duplication: Copies an existing template sheet tab within a spreadsheet using the Google Sheets API via the gws CLI. - Automatic Renaming: Renames the newly created tab to a target month title such as "February 2025" using a batchUpdate request. - Use Case: You maintain a monthly expense or habit tracker in Google Sheets. At the start of each month, run this recipe to clone last month's template tab and label it for the new month without opening the Sheets UI. ## Quick Start Ask the assistant to duplicate the template tab in your Google Sheet and rename it for the new month, providing your spreadsheet ID.

Frequently Asked Questions about recipe-copy-sheet-for-new-month

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

FAQPage Schema
How do I duplicate a sheet tab in Google Sheets programmatically?

Use the Google Sheets API sheets copyTo method to copy a tab within or across spreadsheets, then call batchUpdate with updateSheetProperties to rename it. This recipe performs both steps through the gws CLI.

How to rename a Google Sheets tab using the API?

Send a spreadsheets batchUpdate request containing an updateSheetProperties entry with the target sheetId, the new title, and the fields mask set to title. The recipe shows this with a month name like February 2025.

What tools are required to run this Google Sheets recipe?

You need the gws command-line tool installed and the gws-sheets skill loaded, as declared in the skill metadata. You also need the spreadsheet ID of the target Google Sheet.

Can I copy a sheet tab to a different spreadsheet?

Yes, the sheets copyTo method accepts a destinationSpreadsheetId in its JSON body, which can differ from the source spreadsheet. This recipe copies within the same spreadsheet by reusing the same ID.

Why does the sheet copy step return a different sheetId than expected?

Google Sheets assigns a new numeric sheetId to every copied tab, so the ID in the rename step must match the newly created sheet, not the template. Retrieve the new sheetId from the copyTo response before running batchUpdate.