First off, thank you for considering contributing! Your help is essential for making this template collection even better. We welcome contributions of all kinds, from reporting bugs and proposing new features to submitting pull requests for new templates, code improvements, or documentation enhancements.
Please take a moment to review this document to understand how you can contribute effectively.
This project and everyone participating in it is governed by our Code of Conduct (TODO: Create this file). By participating, you are expected to uphold this code. Please report unacceptable behavior.
- Ensure the bug was not already reported by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
- Open a new issue to discuss your idea. This allows us to coordinate efforts and ensure your suggestion aligns with the project's goals.
- For new template ideas, please outline:
- The primary use case and target audience.
- A proposed file structure.
- Key features or GAS APIs it would showcase.
- How it would differ from existing templates.
We welcome pull requests for bug fixes, improvements, and new features.
- Fork the repository and create your branch from
main(or the relevant development branch). - Set up your development environment:
- If working within Firebase Studio (Project IDX), the root
.idx/dev.nixfile provides a pre-configured environment with tools likegoogle-clasp,nodejs,go(forcontextvibes), etc. - Ensure you have
google-claspinstalled and authenticated if working locally outside IDX.
- If working within Firebase Studio (Project IDX), the root
- Make your changes:
- Adhere to the coding style and conventions used in the project (see "Coding Standards" below).
- If adding a new template, follow the structure of existing templates (include a
README.md,src/appsscript.json,.idx/dev.nix,.idx/airules.md, etc.). - Ensure any new template is registered in the root
idx-template.jsonand thatidx-template.nixcan correctly bootstrap it. - Update documentation (READMEs, comments) as needed.
- Test your changes thoroughly. (See "Testing" below).
- Commit your changes: Use clear and descriptive commit messages. Consider following conventional commit formats if you're comfortable (e.g.,
feat: Add new template for X,fix: Correct issue in Y module). - Open a Pull Request:
- Ensure your PR clearly describes the problem and solution. Include the relevant issue number if applicable.
- Provide details on how to test your changes.
- Google Apps Script (GAS):
- Use the V8 runtime (
"runtimeVersion": "V8"inappsscript.json). - Follow modern JavaScript (ES6+) best practices where supported by GAS V8.
- Modularity: Employ factory functions (Crockford-style) for creating service modules. Avoid
classsyntax for core GAS logic unless there's a compelling reason and it's well-encapsulated. - Global Scope: Understand that all server-side
.jsfiles insrc/share a single global scope. Do not userequire()or ES6import/export. - Clarity: Use descriptive variable and function names.
- Comments: Write JSDoc comments for all functions, explaining their purpose, parameters, and return values. Comment complex logic.
- Error Handling: Implement robust error handling using
try...catchblocks, and consider using or extending theErrorManagerpattern seen in some templates. clasp: Useclaspfor local development and pushing changes to Google Apps Script. EnsurerootDirin.clasp.jsonis set correctly (usually tosrc).
- Use the V8 runtime (
- Nix Environments (
.idx/dev.nix):- Define the minimal necessary packages for both the template collection development (root
dev.nix) and for end-users of each specific template (template-leveldev.nix).
- Define the minimal necessary packages for both the template collection development (root
- AI Rules (
.idx/airules.md):- When creating or updating AI rules for a template, ensure they are tailored to the template's specific use case and provide genuinely helpful guidance for an end-user. Follow THEA principles for prompt design.
- Documentation (
README.md):- All templates MUST have a clear
README.mdexplaining their purpose, setup, usage, and key features. - The root
README.mdshould provide an overview of the collection.
- All templates MUST have a clear
- Linters/Formatters: While not strictly enforced by CI yet, consider using Prettier and ESLint for consistent code style (example configurations might be added to templates like the API Connector).
- Manual Testing: For GAS projects, thorough manual testing is crucial.
- Push your code using
clasp push. - Test all functionalities in the relevant Google Workspace application (Sheets, Docs, Web App URL, etc.).
- Check Apps Script dashboard logs for errors.
- Test different scenarios and edge cases.
- Push your code using
- Conceptual Validation (for AI Rules & Structure):
- When modifying AI rules or project structure, use
bin/contextvibes describeto get a snapshot and conceptually validate that the AI assistance will be effective and the structure is sound.
- When modifying AI rules or project structure, use
Feel free to open an issue if you have questions about contributing.
Thank you for contributing to this project!