agentleFS
pkeffectpkeffect/Antigravity-Architect/.github/copilot-instructions.md

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
  1. Very specific:

    Key Constraint: All logic MUST remain in antigravity_master_setup.py.

    line 7
  2. Distinctive:

    Backward Compatibility: All original module-level functions are preserved as thin wrappers calling class methods.

    line 21
  3. Very specific:

    All user inputs MUST be sanitized via sanitize_name() which:

    line 59
  4. Very specific:

    Use AntigravityEngine.write_file() with exist_ok flag for safe mode:

    line 74
  5. Very specific:

    All commits must follow format: type: description

    line 102
  6. Very specific:

    To add new templates: Add as class attribute in AntigravityResources, then reference in generation methods.

    line 119
  7. Distinctive:

    Type hints required: - All new functions need proper type annotations

    line 142
  8. Very specific:

    Add to GITIGNORE_MAP or NIX_PACKAGE_MAP in AntigravityResources

    line 155
  9. Very specific:

    Add test case in test_antigravity.py

    line 157
  10. Very specific:

    Create template constant in AntigravityResources (e.g., RULE_NEW_FEATURE)

    line 160
  11. Very specific:

    Call write_file() in generate_agent_rules() method

    line 161
  12. Distinctive:

    Update README's agent capabilities section

    line 162

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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:

ClassResponsibilityKey Methods
AntigravityResourcesStatic templates, constants, mappingsTemplate strings, classification rules, NIX packages, TECH_ALIASES
AntigravityEngineFile system operations, validationwrite_file(), sanitize_name(), validate_file_path(), setup_logging(force=True)
AntigravityBuilderDynamic config generatorsbuild_gitignore(), build_nix_config(), build_links(), build_readme()
AntigravityAssimilatorBrain dump parser & classifierdetect_tech_stack(), build_tech_deep_dive(), identify_category()
AntigravityGeneratorOrchestration & project generationgenerate_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-imports

Versioning (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.0

This 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_RULES dict
  • 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 support
  • fix: resolve Windows path issue
  • docs: 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

  1. Don't suggest extracting modules - Single-file architecture is intentional for portability
  2. Don't add external dependencies - Standard library only (except dev dependencies in pyproject.toml)
  3. Always update tests - 59+ tests must remain passing
  4. Preserve function signatures - Module-level functions are public API
  5. Use logging, not print - Except in interactive/CLI user-facing messages
  6. 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:

  1. Add to GITIGNORE_MAP or NIX_PACKAGE_MAP in AntigravityResources
  2. Update list_keywords() display
  3. Add test case in test_antigravity.py

Add new agent rule:

  1. Create template constant in AntigravityResources (e.g., RULE_NEW_FEATURE)
  2. Call write_file() in generate_agent_rules() method
  3. Update README's agent capabilities section

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.