claude-initial-setup
Copilot instructions4 starsChanged 9 months agoMITView on GitHub
Always create new objects instead of mutating existing ones. Use spread operators, structuredClone, or immutable patterns like @dataclass(frozen=True) in Python and value receivers in Go. Never use .push(), .pop(), .splice(), .sort(), or .reverse() on shared arrays. Use [...arr, item], .filter(), .map(), .toSorted(), and .toReversed() instead. Keep files between 200-400 lines. Extract separate modules when files grow beyond 800 lines. Organize files by feature or domain, not by type. Keep functions under 50 lines. If longer, extract helper functions with descriptive…
- Reads credentials
In this repository78 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rules/agents.mdAGENTS.md
- .cursor/rules/claude-initial-setup.mdcCursor rule
- parallel-task-executionSkill
- subagent-patternsSkill
- task-coordinationSkill
- agent-communicationSkill
- context-managementSkill
- multi-agent-orchestrationSkill
- deploy-strategiesSkill
- github-actions-guideSkill
- pipeline-patternsSkill
- anthropic-sdk-guideSkill
- prompt-engineeringSkill
- tool-use-patternsSkill
- automated-review-setupSkill
- pr-standardsSkill
- review-checklistSkill
- file-organizationSkill
- immutability-patternsSkill
- naming-conventionsSkill
- branching-strategySkill
- commit-conventionsSkill
- pr-workflowSkill
- migration-patternsSkill
- query-optimizationSkill
- schema-design-guideSkill
- error-tracingSkill
- log-analysisSkill
- systematic-debuggingSkill
- django-admin-customizationSkill
- django-orm-masterySkill
- drf-api-patternsSkill
- docker-compose-guideSkill
- dockerfile-best-practicesSkill
- multi-stage-buildsSkill
- express-error-handlingSkill
- middleware-patternsSkill
- rest-api-nodeSkill
- async-fastapiSkill
- dependency-injection-fastapiSkill
- pydantic-validationSkill
- concurrency-patterns-goSkill
- error-handling-goSkill
- idiomatic-goSkill
- automation-triggersSkill
- hook-recipesSkill
- pre-post-hooksSkill
- junit-testingSkill
- maven-gradle-guideSkill
- spring-boot-patternsSkill
- mcp-resource-patternsSkill
- mcp-server-creationSkill
- mcp-tool-designSkill
- context-optimizationSkill
- knowledge-persistenceSkill
- memory-patternsSkill
- caching-strategiesSkill
- lazy-loading-patternsSkill
- profiling-guideSkill
- The first 60 shown.
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
41 rules. About 0 are common, 28 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈28
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 5
Always create new objects instead of mutating existing ones.
- Very specific: line 7
Never use .push(), .pop(), .splice(), .sort(), or .reverse() on shared arrays.
- Distinctive: line 9
Keep files between 200-400 lines.
- Distinctive: line 11
Keep functions under 50 lines.
- Distinctive: line 13
Avoid nesting deeper than 4 levels.
- Very specific: line 21
Use plural nouns for collections: users, orderItems.
- Very specific: line 23
Use SCREAMING_SNAKE_CASE for true constants: MAX_RETRIES, API_BASE_URL.
- Distinctive: line 25
Follow language-specific casing: camelCase for JS/TS variables, PascalCase for classes/types, snake_case for Python, PascalCase for …
- Very specific: line 29
Use conventional commits: <type>(<scope>): <description>.
- Distinctive: line 31
Write commit messages in imperative mood ("add feature" not "added feature"), lowercase after type, under 72 characters, no trailing period.
- Distinctive: line 35
Keep pull requests under 400 lines.
- Distinctive: line 37
Never rebase commits that have been pushed to a shared branch.
- Distinctive: line 41
Write tests before implementation (TDD).
- Distinctive: line 47
Use factories for dynamic test data with unique values.
- Very specific: line 51
Always restore mocks after each test.
- Distinctive: line 53
Use dependency injection to make code testable.
- Very specific: line 59
Never hardcode secrets, API keys, or passwords in source code.
- Very specific: line 61
Always include .env, .env.local, *.pem, *.key, credentials.json in .gitignore.
- Distinctive: line 67
Prefer allowlists over denylists when filtering or validating input.
- Distinctive: line 69
Use parameterized queries for all SQL.
- Distinctive: line 77
Verify authorization on every resource access.
- Distinctive: line 83
Never log passwords, tokens, API keys, or PII.
- Distinctive: line 85
Never return sensitive fields (password hashes, internal notes) in API responses.
- Distinctive: line 89
Always handle errors explicitly.
- Very specific: line 93
Check response.ok after fetch calls.
- Distinctive: line 95
Use custom error classes for domain-specific errors to enable typed error handling.
- Distinctive: line 101
Follow the debugging loop: REPRODUCE, HYPOTHESIZE, TEST, ISOLATE, FIX, VERIFY.
- Very specific: line 103
Use git bisect to find the commit that introduced a bug.
- Distinctive: line 105
Create minimal reproductions that isolate the failing behavior from surrounding complexity.
- Very specific: line 111
Avoid N+1 queries. Use joins, include, select_related, or batch loading.
- Distinctive: line 115
Use appropriate caching: in-memory LRU for hot paths, Redis for distributed state, CDN for static assets.
- Very specific: line 119
Use lazy loading and code splitting for frontend bundles.
- Distinctive: line 123
Use multi-stage builds to separate build dependencies from runtime.
- Very specific: line 125
Run containers as non-root users.
- Distinctive: line 131
Use Alpine-based images unless specific system libraries require a full distribution.
- Distinctive: line 137
Use snake_case for all table names, column names, and indexes.
- Distinctive: line 139
Add indexes for columns frequently used in WHERE, JOIN, and ORDER BY clauses.
- Distinctive: line 141
Use foreign key constraints for referential integrity.
- Distinctive: line 149
Check for edge cases: empty arrays, null values, zero, negative numbers, boundary conditions.
- Distinctive: line 151
Verify error states are handled: network failures, invalid data, timeouts.
- Distinctive: line 155
Look for N+1 queries and unbounded result sets.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions
Code Style
Always create new objects instead of mutating existing ones. Use spread operators, structuredClone, or immutable patterns like @dataclass(frozen=True) in Python and value receivers in Go.
Never use .push(), .pop(), .splice(), .sort(), or .reverse() on shared arrays. Use [...arr, item], .filter(), .map(), .toSorted(), and .toReversed() instead.
Keep files between 200-400 lines. Extract separate modules when files grow beyond 800 lines. Organize files by feature or domain, not by type.
Keep functions under 50 lines. If longer, extract helper functions with descriptive names.
Avoid nesting deeper than 4 levels. Use early returns, guard clauses, or extracted functions to flatten logic.
Name variables to describe WHAT they contain, not HOW they were computed. Use activeUsers instead of data or result.
Prefix boolean variables with is, has, can, should, was, or will: isActive, hasPermission, canEdit.
Name functions with a verb describing what they do: getUserById, formatDate, validateEmail, createOrder.
Use plural nouns for collections: users, orderItems. Use singular for individual items in iteration.
Use SCREAMING_SNAKE_CASE for true constants: MAX_RETRIES, API_BASE_URL.
Follow language-specific casing: camelCase for JS/TS variables, PascalCase for classes/types, snake_case for Python, PascalCase for exported Go identifiers.
Git Workflow
Use conventional commits: <type>(<scope>): <description>. Types: feat, fix, refactor, docs, test, chore, perf, ci.
Write commit messages in imperative mood ("add feature" not "added feature"), lowercase after type, under 72 characters, no trailing period.
Name branches as feature/, fix/, hotfix/, release/ followed by ticket ID and kebab-case description: feature/AUTH-123-add-sso-login.
Keep pull requests under 400 lines. Include a summary, list of changes, and test plan in every PR description.
Never rebase commits that have been pushed to a shared branch. Never force-push to main or develop.
Testing
Write tests before implementation (TDD). Follow Red-Green-Refactor: write a failing test, write minimal code to pass, then refactor.
Target 80% minimum code coverage across unit, integration, and E2E tests.
Co-locate unit tests next to source files: auth.ts and auth.test.ts in the same directory.
Use factories for dynamic test data with unique values. Use fixtures for static, predictable test data.
Mock only at system boundaries: external APIs, databases, file I/O, email services. Never mock pure functions or the code under test.
Always restore mocks after each test. Use afterEach(() => vi.restoreAllMocks()) or equivalent.
Use dependency injection to make code testable. Accept dependencies as parameters rather than importing directly.
For bug fixes, always write a test that reproduces the bug before writing the fix.
Security
Never hardcode secrets, API keys, or passwords in source code. Use environment variables loaded from .env files.
Always include .env, .env.local, *.pem, *.key, credentials.json in .gitignore.
Validate required environment variables at application startup using Zod, Pydantic, or equivalent schema validation.
Validate all user input at system boundaries. Use Zod for TypeScript, Pydantic for Python, struct tags for Go.
Prefer allowlists over denylists when filtering or validating input.
Use parameterized queries for all SQL. Never concatenate user input into query strings.
Sanitize user-generated HTML with DOMPurify. Use textContent instead of innerHTML for plain text.
Implement CSRF protection with anti-CSRF tokens and SameSite cookie attributes.
Prevent SSRF by allowlisting permitted domains for server-side HTTP requests.
Verify authorization on every resource access. Check that the requesting user owns or has permission to access the resource.
Rate limit authentication endpoints. Use bcrypt with 12+ salt rounds for password hashing.
Set security headers using helmet or equivalent: CSP, HSTS, Referrer-Policy.
Never log passwords, tokens, API keys, or PII.
Never return sensitive fields (password hashes, internal notes) in API responses. Select only needed fields.
Error Handling
Always handle errors explicitly. Never swallow errors with empty catch blocks.
Throw descriptive errors with context: include what operation failed and relevant identifiers.
Check response.ok after fetch calls. Throw on non-2xx responses with status and statusText.
Use custom error classes for domain-specific errors to enable typed error handling.
Return consistent API error responses with success, error, and field-level validation details.
Debugging
Follow the debugging loop: REPRODUCE, HYPOTHESIZE, TEST, ISOLATE, FIX, VERIFY.
Use git bisect to find the commit that introduced a bug. Use git bisect run <test-script> for automation.
Create minimal reproductions that isolate the failing behavior from surrounding complexity.
Fix root causes, not symptoms. Do not add null checks to silence errors without understanding why values are null.
Performance
Avoid N+1 queries. Use joins, include, select_related, or batch loading.
Bound all database queries with LIMIT and pagination. Never fetch entire tables.
Use appropriate caching: in-memory LRU for hot paths, Redis for distributed state, CDN for static assets.
Set proper Cache-Control headers: public for shared resources, private for user-specific data, no-store for sensitive data.
Use lazy loading and code splitting for frontend bundles. Prefer React.lazy and dynamic import().
Docker
Use multi-stage builds to separate build dependencies from runtime.
Run containers as non-root users. Create a dedicated user with adduser.
Order Dockerfile instructions to maximize layer caching: dependencies first, source code last.
Include HEALTHCHECK directives in production Dockerfiles.
Use Alpine-based images unless specific system libraries require a full distribution.
Database
Normalize schemas to 3NF. Denormalize selectively only when proven necessary for performance.
Use snake_case for all table names, column names, and indexes.
Add indexes for columns frequently used in WHERE, JOIN, and ORDER BY clauses.
Use foreign key constraints for referential integrity.
Plan migrations for zero downtime. Add new columns as nullable, backfill, then add constraints.
Code Review
Review priority: Correctness, Security, Performance, Maintainability, Testing, Style.
Check for edge cases: empty arrays, null values, zero, negative numbers, boundary conditions.
Verify error states are handled: network failures, invalid data, timeouts.
Confirm authorization checks exist on every resource access endpoint.
Look for N+1 queries and unbounded result sets.
Automate style enforcement with linters and formatters. Do not nitpick formatting in reviews.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

