Antigravity-Architect
Copilot instructions12 starsChanged 10 months agoMITView on GitHub
Antigravity Architect is an "Agent-First" bootstrapping tool that generates self-describing repositories for AI-assisted development. It's a single-file Python script (2,300+ lines) with zero external dependencies designed for portability and universal deployment. Key Constraint: All logic MUST remain in antigravity_master_setup.py. Never suggest extracting modules or adding external dependencies. The codebase uses a hybrid class-based design with 5 focused classes while maintaining single-file portability: Backward Compatibility: All original module-level functions are preserved as thin wrappers calling class methods. Never break existing function…
The file
We split this copilot-instructions.md into the rules it gives an agent
12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Key Constraint: All logic MUST remain in antigravity_master_setup.py.
- Distinctive: line 21
Backward Compatibility: All original module-level functions are preserved as thin wrappers calling class methods.
- Very specific: line 59
All user inputs MUST be sanitized via sanitize_name() which:
- Very specific: line 74
Use AntigravityEngine.write_file() with exist_ok flag for safe mode:
- Very specific: line 102
All commits must follow format: type: description
- Very specific: line 119
To add new templates: Add as class attribute in AntigravityResources, then reference in generation methods.
- Distinctive: line 142
Type hints required: - All new functions need proper type annotations
- Very specific: line 155
Add to GITIGNORE_MAP or NIX_PACKAGE_MAP in AntigravityResources
- Very specific: line 157
Add test case in test_antigravity.py
- Very specific: line 160
Create template constant in AntigravityResources (e.g., RULE_NEW_FEATURE)
- Very specific: line 161
Call write_file() in generate_agent_rules() method
- Distinctive: line 162
Update README's agent capabilities section
≈ “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: Antigravity Architect
Project Overview
Antigravity Architect is an "Agent-First" bootstrapping tool that generates self-describing repositories for AI-assisted development. It's a single-file Python script (2,300+ lines) with zero external dependencies designed for portability and universal deployment.
Key Constraint: All logic MUST remain in antigravity_master_setup.py. Never suggest extracting modules or adding external dependencies.
Architecture (v1.6.2)
The codebase uses a hybrid class-based design with 5 focused classes while maintaining single-file portability:
| Class | Responsibility | Key Methods |
AntigravityResources | Static templates, constants, mappings | Template strings, classification rules, NIX packages, TECH_ALIASES |
AntigravityEngine | File system operations, validation | write_file(), sanitize_name(), validate_file_path(), setup_logging(force=True) |
AntigravityBuilder | Dynamic config generators | build_gitignore(), build_nix_config(), build_links(), build_readme() |
AntigravityAssimilator | Brain dump parser & classifier | detect_tech_stack(), build_tech_deep_dive(), identify_category() |
AntigravityGenerator | Orchestration & project generation | generate_project(), generate_agent_files() |
Backward Compatibility: All original module-level functions are preserved as thin wrappers calling class methods. Never break existing function signatures.
Development Workflows
Testing
# Run full test suite (59+ tests)
pytest tests/
# With coverage
pytest tests/ --cov=antigravity_master_setup
# Test on specific Python version
python3.10 -m pytest tests/Code Quality (Required Before PR)
# Linting & formatting (must pass)
ruff check antigravity_master_setup.py
ruff format antigravity_master_setup.py
# Type checking (must pass)
mypy antigravity_master_setup.py --ignore-missing-importsVersioning (Maintainers Only)
# Automated version bumping
bump2version patch # 1.4.0 → 1.4.1
bump2version minor # 1.4.0 → 1.5.0
bump2version major # 1.4.0 → 2.0.0This updates VERSION constant, pyproject.toml, creates git commit and tag.
Project-Specific Patterns
1. Sanitization & Security
All user inputs MUST be sanitized via sanitize_name() which:
- Removes special characters except
_and- - Prevents path traversal (
.., leading/or\) - Converts spaces to underscores
- Returns default
"antigravity-project"on invalid input
Example from codebase:
clean = re.sub(r"\s+", "_", name.strip())
clean = re.sub(r"[^a-zA-Z0-9_\-]", "", clean)
if ".." in clean or clean.startswith(("/", "\\")):
return "antigravity-project"2. File Writing Patterns
Use AntigravityEngine.write_file() with exist_ok flag for safe mode:
# Safe mode: skip if exists
write_file(path, content, exist_ok=True)
# Normal mode: overwrite
write_file(path, content, exist_ok=False)3. Keyword-Based Configuration
The system uses keyword detection to dynamically build configs:
- User input →
parse_keywords()→ lowercase list - Keywords matched against
GITIGNORE_MAP,NIX_PACKAGE_MAP - Multiple keywords can be combined (e.g.,
python,react,docker)
Always default to linux OS if no OS keyword detected.
4. Brain Dump Assimilation
The AntigravityAssimilator classifies markdown sections using heuristic scoring:
- Scans for keywords in
CLASSIFICATION_RULESdict rules/→ "always", "never", "must", "security"workflows/→ "step", "guide", "deploy", "workflow"skills/→ "command", "cli", "tool", "automation"docs/→ "overview", "architecture", "introduction"
Sections get imported_*.md filenames to avoid overwriting core agent files.
5. Conventional Commits (Enforced)
All commits must follow format: type: description
Valid types: feat, fix, docs, refactor, test, chore
Examples:
feat: add Python 3.14 supportfix: resolve Windows path issuedocs: update README badges
Critical Integration Points
Template System
Templates are stored as class attributes in AntigravityResources:
CHANGELOG_TEMPLATE,SECURITY_TEMPLATE, etc.- GitHub templates:
GITHUB_BUG_REPORT,GITHUB_PR_TEMPLATE - Agent rules:
RULE_IDENTITY,RULE_TECH_STACK, etc.
To add new templates: Add as class attribute in AntigravityResources, then reference in generation methods.
CLI Mode vs Interactive Mode
Entry point: main() → checks args.name:
- CLI Mode: Uses argparse flags (
--name,--stack,--dry-run, etc.) - Interactive Mode: Prompts user with
input()calls
Special modes:
--doctor ./path: Validates.agent/structure--list-keywords: Displays supported keywords--dry-run: Preview without creating files
Cross-Platform Testing
CI runs on Windows, macOS, Ubuntu with Python 3.10-3.14.
Path handling must use os.path.join() or pathlib.Path for compatibility.
Common Pitfalls
- Don't suggest extracting modules - Single-file architecture is intentional for portability
- Don't add external dependencies - Standard library only (except dev dependencies in
pyproject.toml) - Always update tests - 59+ tests must remain passing
- Preserve function signatures - Module-level functions are public API
- Use logging, not print - Except in interactive/CLI user-facing messages
- Type hints required - All new functions need proper type annotations
Key Files for Context
- antigravity_master_setup.py - Core script (all logic)
- tests/test_antigravity.py - Test suite with fixtures
- pyproject.toml - Build config, tool settings
- CONTRIBUTING.md - Development standards
- README.md - Usage examples, feature list
Quick Reference
Add new keyword support:
- Add to
GITIGNORE_MAPorNIX_PACKAGE_MAPinAntigravityResources - Update
list_keywords()display - Add test case in
test_antigravity.py
Add new agent rule:
- Create template constant in
AntigravityResources(e.g.,RULE_NEW_FEATURE) - Call
write_file()ingenerate_agent_rules()method - Update README's agent capabilities section
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.

