Skip to content
Prompt

JsonDbApp — Copilot Instructions

by h-arnold

AI Summary

Copilot instructions for building a synchronous document database in Google Apps Script using Google Drive as storage, following TDD and SOLID principles. Useful for developers building database solutions within Google's ecosystem, though implementation complexity is high.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "JsonDbApp — Copilot Instructions" prompt rules to my project.
Repository: https://github.com/h-arnold/JsonDbApp

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

A document database implemented in Google App Script using the Google Drive API. Recommended for masochists.

Overview

• Synchronous document DB for Google Apps Script (GAS), MongoDB-like syntax. • CRUD on named collections (JSON files in Google Drive). • Access via authenticated Apps Script libraries. • Consistency via ScriptProperties-based master index.

Implementation Requirements

• Classes: Constructor validates inputs, JSDoc on all methods, naming/error patterns. • Tests: Descriptive, Arrange-Act-Assert, independent, per-class folder, per-suite file, orchestrator for all tests. • Serialisation: Use ObjectUtils.serialise()/deserialise(). Classes needing serialisation: implement toJSON(), static fromJSON(), register in ObjectUtils._classRegistry. • Validation: Use Validate class; class-specific validation as private method. • TDD: Always follow Red-Green-Refactor. • Linting: no-magic-numbers is an error for source code. Tests may use numeric literals for clarity because the rule is disabled for tests/*/.js.

Usage Example

When you need to review code, call the appropriate agent: `javascript // For source code review runSubagent({ prompt: 'Please review the new UpdateEngine class for lint compliance, DRY, SOLID, and proper documentation.', description: 'Code review for UpdateEngine', agentName: 'Code Review Agent' }); // For test review runSubagent({ prompt: 'Please review the CollectionReadOperations tests for completeness, DRY, and lint compliance.', description: 'Test review for CollectionReadOperations', agentName: 'Test Review Agent' }); `

Core Principles

• TDD: Red-Green-Refactor. Write failing tests first, minimal passing code, then refactor. • Component Separation: Single responsibility, dependency injection via constructor. • SOLID: Follow SOLID principles. • Reuse: Check for existing functionality before new code. • GAS Limitations: V8 engine, not full JS support. • Style: Concise, analytical, British English (except for American APIs). Challenge incorrect assumptions.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 2mo ago
Active
AdoptionUnder 100 stars
9 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars9
Forks1
Issues1
Updated2mo ago
View on GitHub
AGPL-3.0 License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more