Copilot Instructions (.github)
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The GeNCorE Command Center is an AI Agent Command Center designed to manage and orchestrate specialized AI agents, specifically GitHub Copilot, Claude (Anthropic), and Codex (OpenAI). Within the scope of this project, "Copilot Instructions" and agent configurations define the operational boundaries, identification logic, and interaction patterns between the web interface and the GitHub ecosystem.
The system acts as a bridge, allowing users to delegate tasks via GitHub Issues and manage the resulting Pull Requests (PRs) through a centralized dashboard. It leverages the GitHub REST API to provide a mobile-first "remote control" for automated development agents working on the GentelmeN-CorE repository.
Sources: README.md:1-15, package.json:2-4
Agent Architecture and Configuration
The project defines a structured configuration for each AI agent. This configuration is central to how the application identifies agent activity and routes tasks. Each agent is assigned specific visual metadata (emojis and colors) and GitHub-specific identifiers for interaction.
Central Agent Definitions
Agents are defined in a centralized library to ensure consistency across the UI and API routes.
| Agent ID | Label | Emoji | GitHub Login | Issue Label |
|---|---|---|---|---|
copilot | GitHub Copilot | 🟣 | copilot | agent:copilot |
claude | Claude (Anthropic) | 🟠| claude[bot] | agent:claude |
codex | Codex (OpenAI) | 🔵 | codex[bot] | agent:codex |
Sources: lib/agents.ts:25-63, README.md:78-83
Agent Identification Logic
The system identifies which agent is responsible for a Pull Request by inspecting the branch name (headRef) or the author's GitHub login.
The logic uses case-insensitive string matching to ensure robust detection regardless of minor variations in branch naming conventions.
Sources: lib/agents.ts:75-108, app/page.tsx:50-53
Task Orchestration (GitHub Issues)
Users interact with agents by creating tasks through the /task panel. This process generates a GitHub Issue formatted specifically for the chosen agent to process.
Task Flow Logic
- User Input: User selects an agent and provides a task description.
- API Routing: The
POST /api/taskendpoint receives the request. - Issue Creation: The system calls the GitHub REST API to create an issue with specific attributes:
- Title: Prefixed with the agent's emoji and label.
- Body: Includes the description and a signature indicating it was created via GeNCorE.
- Labels: The specific
agent:*label is applied. - Assignee: The issue is automatically assigned to the agent's GitHub login.
Pull Request Management
The dashboard monitors active Pull Requests and provides administrative controls for the review cycle.
PR Status and Actions
The interface categorizes PRs based on their state and allows for direct intervention through the GitHub API.
- Detection: Uses
detectAgentFromPRto associate PRs with specific agents for visual grouping. - Review Actions: Supports
APPROVE,REQUEST_CHANGES, andCOMMENTevents. - Merging: Implements a
squashmerge strategy by default to maintain a clean history.
| Action | API Endpoint | GitHub Method | Required Data |
|---|---|---|---|
| Review | /api/review | POST | prNumber, event, body (if changes/comment) |
| Merge | /api/merge | PUT | prNumber, mergeMethod (default: squash) |
Sources: app/api/review/route.ts:18-77, app/api/merge/route.ts:24-73, components/PRCard.tsx:55-103
Security and Operational Guidelines
The integration with GitHub and agent instructions is governed by several security layers to prevent unauthorized access or injection attacks.
- Token Isolation:
GITHUB_TOKENis strictly server-side and never exposed to the frontend. - Input Validation: PR numbers are validated as safe integers (1 to 2,147,483,647) before being interpolated into GitHub API URLs to prevent SSRF (Server-Side Request Forgery).
- Authentication: Access to the command center is protected by an
ADMIN_TOKEN, with sessions managed via HMAC-SHA256 hashed cookies to ensure the raw token is never stored in the browser.
Sources: README.md:87-101, app/api/merge/route.ts:35-39
Summary
The Copilot Instructions and agent management system in GeNCorE provide a structured, secure way to interact with AI development agents. By combining centralized configuration, automated GitHub Issue assignment, and a robust PR review workflow, the project enables efficient "remote control" of automated coding assistants. The architecture ensures that every agent task is traceable via GitHub labels and assignees while maintaining strict security through server-side token management and input sanitization.