-
Notifications
You must be signed in to change notification settings - Fork 0
Add Copilot instructions for repository-specific code generation #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,336 @@ | ||||||
| # GitHub Copilot Instructions for MyXstack | ||||||
|
|
||||||
| ## Repository Overview | ||||||
|
|
||||||
| MyXstack is an autonomous AI agent system for X (Twitter) that uses Grok AI via the xMCP (Model Context Protocol) server. The agent monitors mentions, analyzes conversations using AI, and autonomously responds with context-aware actions. | ||||||
|
|
||||||
| ## Technology Stack | ||||||
|
|
||||||
| - **Language**: TypeScript (ES2022) | ||||||
| - **Runtime**: Node.js 18+ | ||||||
| - **AI Service**: Grok (xAI API) | ||||||
| - **Protocol**: Model Context Protocol (MCP) | ||||||
| - **APIs**: X (Twitter) API v2 | ||||||
| - **Build Tool**: TypeScript Compiler (tsc) | ||||||
|
|
||||||
| ## Project Structure | ||||||
|
|
||||||
| ``` | ||||||
| src/ | ||||||
| ├── index.ts # Main entry point | ||||||
| ├── examples.ts # Usage examples | ||||||
| ├── types/ # TypeScript type definitions | ||||||
| ├── services/ | ||||||
| │ ├── config.ts # Configuration management | ||||||
| │ ├── xapi.ts # X API client | ||||||
| │ ├── grok.ts # Grok AI service | ||||||
| │ └── agent.ts # Autonomous agent orchestrator | ||||||
| └── mcp/ | ||||||
| └── server.ts # xMCP server implementation | ||||||
| ``` | ||||||
|
|
||||||
| ## Coding Standards | ||||||
|
|
||||||
| ### TypeScript | ||||||
|
|
||||||
| - **Strict Mode**: Always maintain strict TypeScript compilation | ||||||
| - **Types**: Use explicit types; avoid `any` except when absolutely necessary | ||||||
| - **Async/Await**: Prefer async/await over raw promises | ||||||
| - **Error Handling**: Always wrap API calls in try-catch blocks | ||||||
| - **Null Safety**: Use optional chaining (`?.`) and nullish coalescing (`??`) | ||||||
| - **ES Modules**: Use ES module syntax (`import`/`export`), not CommonJS | ||||||
|
|
||||||
| ### Naming Conventions | ||||||
|
|
||||||
| - **Classes**: PascalCase (e.g., `XAPIClient`, `AutonomousAgent`) | ||||||
| - **Interfaces/Types**: PascalCase (e.g., `AgentConfig`, `XApiResponse`) | ||||||
| - **Functions/Methods**: camelCase (e.g., `fetchMentions`, `analyzeAndDecide`) | ||||||
| - **Constants**: UPPER_SNAKE_CASE (e.g., `DEFAULT_POLLING_INTERVAL`) | ||||||
| - **Files**: kebab-case for multi-word (e.g., `x-api.ts`) or camelCase for single word | ||||||
|
||||||
| - **Files**: kebab-case for multi-word (e.g., `x-api.ts`) or camelCase for single word | |
| - **Files**: camelCase for all TypeScript files (including multi-word, e.g., `xapi.ts`, `grok.ts`, `agent.ts`) |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect environment variable names. The codebase uses X_API_KEY and X_API_SECRET, not X_CONSUMER_KEY and X_CONSUMER_SECRET. These should be updated to match the actual variables used in src/services/config.ts and .env.example.
| - `X_CONSUMER_KEY`, `X_CONSUMER_SECRET`: OAuth 1.0a credentials | |
| - `X_API_KEY`, `X_API_SECRET`: OAuth 1.0a credentials |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference to non-existent enum. The instructions mention adding to AgentActionType enum in types/index.ts, but this enum doesn't exist in the codebase. The action types are currently defined as a union type in the AgentAction interface: type: 'reply' | 'search' | 'generate' | 'analyze'. This guidance should be updated to reflect the actual type definition approach used.
| 1. Add to `AgentActionType` enum in `types/index.ts` | |
| 1. Update the `AgentAction['type']` union in `types/index.ts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description contains a large block of unrelated content about "Prompt API" and Web ML specifications that appears to be accidentally included. This content (starting with the
<pre class='metadata'>section and the W3C-style specification) is completely unrelated to the GitHub Copilot instructions being added and should be removed from the PR description for clarity.