Add Copilot instructions for repository-specific code generation#19
Add Copilot instructions for repository-specific code generation#19groupthinking merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
| Required environment variables (see `.env.example`): | ||
| - `X_USERNAME`: X account username to monitor | ||
| - `X_BEARER_TOKEN`: X API bearer token for read operations | ||
| - `X_CONSUMER_KEY`, `X_CONSUMER_SECRET`: OAuth 1.0a credentials |
There was a problem hiding this comment.
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 |
|
|
||
| ### Adding New Action Types | ||
|
|
||
| 1. Add to `AgentActionType` enum in `types/index.ts` |
There was a problem hiding this comment.
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` |
| - **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 |
There was a problem hiding this comment.
Inconsistent file naming convention description. The instructions state files should use "kebab-case for multi-word (e.g., x-api.ts) or camelCase for single word", but the actual codebase uses camelCase for all multi-word filenames: xapi.ts (not x-api.ts), grok.ts, agent.ts, config.ts, examples.ts, server.ts. The file naming convention should be corrected to reflect that the codebase uses camelCase consistently for TypeScript files.
| - **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`) |
| @@ -0,0 +1,336 @@ | |||
| # GitHub Copilot Instructions for MyXstack | |||
There was a problem hiding this comment.
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.
GitHub Copilot generates better suggestions when provided project-specific context. Added comprehensive instructions covering this repository's patterns.
Changes
.github/copilot-instructions.md(336 lines)Key Patterns Documented
API Client Pattern:
Copilot will now suggest code that follows established patterns for error handling, simulation support, and logging conventions specific to this autonomous AI agent system.
Original prompt
This section details on the original issue you should resolve
<issue_title>✨ Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository. [ [curl -fsSL https://openclaw.ai/install.sh | bash Learn more → (https://svelte.dev/packages) support for end-to-end API and service workflows across development, testing, and production.
Introduction
TODO
Dependencies
This specification depends on the Infra Standard. [[!INFRA]]
As with the rest of the web platform, human languages are identified in these APIs by BCP 47 language tags, such as "
ja", "en-US", "sr-Cyrl", or "de-CH-1901-x-phonebk-extended". The specific algorithms used for validation, canonicalization, and language tag matching are those from the ECMAScript Internationalization API Specification, which in turn defers some of its processing to Unicode Locale Data Markup Language (LDML). [[BCP47]] [[!ECMA-402]] [[UTS35]].These APIs are part of a family of APIs expected to be powered by machine learning models, which share common API surface idioms and specification patterns. Currently, the specification text for these shared parts lives in [[WRITING-ASSISTANCE-APIS#supporting]], and the common privacy and security considerations are discussed in [[WRITING-ASSISTANCE-APIS#privacy]] and [[WRITING-ASSISTANCE-APIS#security]]. Implementing these APIs requires implementing that shared infrastructure, and conforming to those privacy and security considerations. But it does not require implementing or exposing the actual writing assistance APIs. [[!WRITING-ASSISTANCE-APIS]]
The API
<xmp class="idl"> [Exposed=Window, SecureContext] interface LanguageModel : EventTarget { static Promise create(optional LanguageModelCreateOptions options = {}); static Promise availability(optional LanguageModelCreateCoreOptions options = {}); static Promise params();// These will throw "NotSupportedError" DOMExceptions if role = "system"
Promise prompt(
LanguageModelPrompt input,
optional LanguageModelPromptOptions options = {}
);
ReadableStream promptStreaming(
LanguageModelPrompt input,
optional LanguageModelPromptOptions options = {}
);
Promise append(
LanguageModelPrompt input,
optional LanguageModelAppendOptions options = {}
);
Promise measureInputUsage(
LanguageModelPrompt input,
optional LanguageModelPromptOptions options = {}
);
readonly attribute double inputUsage;
readonly attribute unrestricted double inputQuota;
attribute EventHandler onquotaoverflow;
readonly attribute unsigned long topK;
readonly attribute float temperature;
Promise clone(optional LanguageModelCloneOptions options = {});
undefined destroy();
};
[Exposed=Window, SecureContext]
interface LanguageModelParams {
readonly attribute unsigned long defaultTopK;
readonly attribute unsigned long maxTopK;
readonly attribute float defaultTemperature;
readonly attribute float maxTemperature;
};
callback LanguageModelToolFunction = Promise (any... arguments);
// A description of a tool call that a language model can invoke.
dictionary LanguageModelTool {
required DOMString name;
required DOMString description;
// JSON schema for the input parameters.
required object inputSchema;
// The function to be invoked by user agent on behalf of language model.
required LanguageModelToolFunction execute;
};
dictionary LanguageModelCreateCoreOptions {
// Note: these two have custom out-of-range handling behavior, not in the IDL layer.
// They are unrestricted double so as to allow +Infinity without failing.
unrestricted double topK;
unrestricted double temperature;
sequence expectedInputs;
sequence expectedOutputs;
sequence tools;
};
dictionary LanguageModelCreateOptions : LanguageModelCreateCoreOptions {
AbortSignal signal;
CreateMonitorCallback monitor;
sequence initialPrompts;
};
dictionary LanguageModelPromptOptions {
object responseConstraint;
boolean omitResponseConstraintInput = false;
AbortSignal signal;
};
...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.