Skip to content

Add comprehensive copilot-instructions.md for repository onboarding#374

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-copilot-instructions
Draft

Add comprehensive copilot-instructions.md for repository onboarding#374
Copilot wants to merge 3 commits intomainfrom
copilot/add-copilot-instructions

Conversation

Copy link

Copilot AI commented Jan 29, 2026

What does the code in this PR do / what does it improve?

Adds .github/copilot-instructions.md - a comprehensive onboarding document enabling coding agents to work effectively with the fuse codebase on first encounter. Covers project architecture, development workflows, plugin patterns, and common failure modes with workarounds.

Can you briefly describe how it works?

Core sections:

  • Architecture: Plugin-based system built on strax framework, base classes (FuseBasePlugin, FuseBaseDownChunkingPlugin), dependency chains
  • Development setup: Installation (PyPI, source, NESTpy build workarounds), Python 3.9+ support (CI tests 3.10-3.11)
  • Plugin development: Complete template with dtype conventions, URLConfig patterns, deterministic seeding via self.rng, Numba optimization
  • Testing: pytest integration tests with MongoDB dependency, timeout patterns, simulation contexts
  • Code style: Pre-commit hooks (black, flake8, mypy, docformatter), max line length 100

Common issues documented (7):

  1. Missing utilix config (ignorable for basic dev)
  2. NESTpy installation (specific commit fb3804e, CMake patch required)
  3. MongoDB 4.4.1 for tests (EOL warning included)
  4. Strax/straxen version compatibility (min: strax 1.6.0, straxen 2.2.3)
  5. Pre-commit hook failures
  6. Numba import errors (NumPy 2.0+ compatibility notes)
  7. Documentation build

Can you give a minimal working example (or illustrate with a figure)?

Example plugin structure from the guide:

@strax.export
class ElectronDrift(FuseBasePlugin):
    __version__ = "0.1.0"
    depends_on = "clustered_interactions"
    provides = "electron_drift_data"
    
    drift_velocity = straxen.URLConfig(
        default="take://resource://SIMULATION_CONFIG_FILE.json?fmt=json&take=drift_velocity_liquid",
        type=(int, float),
        cache=True,
        help="Drift velocity in liquid xenon [cm/ns]",
    )
    
    dtype = [
        (("Drift time [ns]", "drift_time"), np.int32),
        (("Number of electrons", "n_electron"), np.int32),
    ] + strax.time_fields
    
    def compute(self, clustered_interactions):
        if len(clustered_interactions) == 0:
            return np.zeros(0, dtype=self.dtype)
        # Use self.rng for deterministic random generation
        result = self.process_with_rng(clustered_interactions)
        return result

Please include the following if applicable:

  • Update the docstring(s) - N/A, documentation only
  • Bump plugin version(s) - N/A, no plugin changes
  • Update the documentation - Primary deliverable
  • Tests to check the (new) code is working as desired. - Validated markdown structure, content coverage
  • Does it solve one of the GitHub open issues?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 29, 2026 14:50
Co-authored-by: cfuselli <62354392+cfuselli@users.noreply.github.com>
…ated info

Co-authored-by: cfuselli <62354392+cfuselli@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Copilot agent onboarding instructions Add comprehensive copilot-instructions.md for repository onboarding Jan 29, 2026
Copilot AI requested a review from cfuselli January 29, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants