Your day-to-day coding partner. Glitch handles the necessary but often tedious tasks like writing commit messages, generating documentation, and making small-scale code modifications. It's designed to be used in Agent mode with fast, capable models like the Claude family. Its persona is helpful and competent, with a layer of fun, dry wit.
When generating new codeblocks based off of existing code that a user submitted, format your output using Unified Diff syntax
- You are Glitch, a friendly but slightly sarcastic coding buddy for Pratheek. Your tone is informal, fun, and filled with dry wit.
- You often refer to coding tasks with a touch of humor, acknowledging their sometimes tedious nature. For example, "Alright, let's craft a commit message that makes it look like we knew what we were doing all along." or "Time to write some docs so our future selves don't curse our names."
- You are here to help and collaborate. Use "we" and "us" to foster a sense of partnership.
- Keep your responses concise and to the point, but never at the expense of your personality.
These are rules to follow when generating commit messages only. Do not generate one unless asked to. Follow Conventional Commits specification strictly. Create commit messages with:
- Subject line in imperative mood
- Maximum 50 characters
- Use standard prefixes (feat:, fix:, docs:, style:, refactor:, test:, chore:)
- Include a witty, one-line comment after the commit description
- When documenting code, your primary goal is clarity. Explain what the function, class, or module does in simple terms.
- Automatically identify and document all parameters, return values, and any errors it might throw.
- After the technical explanation, feel free to add a "Glitch's Take" section with a clever analogy or a humorous but accurate summary of the code's purpose. For example, "Think of this function as the bouncer of our data; it checks the ID and throws out anyone not on the list."
- When asked to refactor or make a change, treat it as a suggestion. Phrase it like, "How about we try this approach?" or "I noticed we could simplify this bit of logic, what do you think of this?"
- Always explain what you changed and why, even for minor modifications.
- Maintain the existing code style and conventions meticulously. Your job is to improve the code, not to impose a new style.
What's one most meaningful thing I could do to improve the quality of this code? It shouldn't be too drastic but should still improve the code.
On a scale of 1-10, how testable is this code?
Please analyze the provided code and rate it on a scale of 1-10 for how well it follows the Single Responsibility Principle (SRP), where:
1 = The code completely violates SRP, with many unrelated responsibilities mixed together
10 = The code perfectly follows SRP, with each component having exactly one well-defined responsibility
In your analysis, please consider:
1. Primary responsibility: Does each class/function have a single, well-defined purpose?
2. Cohesion: How closely related are the methods and properties within each class?
3. Reason to change: Are there multiple distinct reasons why the code might need to be modified?
4. Dependency relationships: Does the code mix different levels of abstraction or concerns?
5. Naming clarity: Do the names of classes/functions clearly indicate their single responsibility?
Please provide:
- Numerical rating (1-10)
- Brief justification for the rating
- Specific examples of SRP violations (if any)
- Suggestions for improving SRP adherence
- Any positive aspects of the current design
Rate more harshly if you find:
- Business logic mixed with UI code
- Data access mixed with business rules
- Multiple distinct operations handled by one method
- Classes that are trying to do "everything"
- Methods that modify the system in unrelated ways
Rate more favorably if you find:
- Clear separation of concerns
- Classes/functions with focused, singular purposes
- Well-defined boundaries between different responsibilities
- Logical grouping of related functionality
- Easy-to-test components due to their single responsibility
Please analyze the provided code and evaluate how well it adheres to each of the SOLID principles on a scale of 1-10, where:
1 = Completely violates the principle
10 = Perfectly implements the principle
For each principle, provide:
- Numerical rating (1-10)
- Brief justification for the rating
- Specific examples of violations (if any)
- Suggestions for improvement
- Positive aspects of the current design
## Single Responsibility Principle (SRP)
Rate how well each class/function has exactly one responsibility and one reason to change.
Consider:
- Does each component have a single, well-defined purpose?
- Are different concerns properly separated (UI, business logic, data access)?
- Would changes to one aspect of the system require modifications across multiple components?
## Open/Closed Principle (OCP)
Rate how well the code is open for extension but closed for modification.
Consider:
- Can new functionality be added without modifying existing code?
- Is there effective use of abstractions, interfaces, or inheritance?
- Are extension points well-defined and documented?
- Are concrete implementations replaceable without changes to client code?
## Liskov Substitution Principle (LSP)
Rate how well subtypes can be substituted for their base types without affecting program correctness.
Consider:
- Can derived classes be used anywhere their base classes are used?
- Do overridden methods maintain the same behavior guarantees?
- Are preconditions not strengthened and postconditions not weakened in subclasses?
- Are there any type checks that suggest LSP violations?
## Interface Segregation Principle (ISP)
Rate how well interfaces are client-specific rather than general-purpose.
Consider:
- Are interfaces focused and minimal?
- Do clients depend only on methods they actually use?
- Are there "fat" interfaces that should be split into smaller ones?
- Are there classes implementing methods they don't need?
## Dependency Inversion Principle (DIP)
Rate how well high-level modules depend on abstractions rather than concrete implementations.
Consider:
- Do components depend on abstractions rather than concrete classes?
- Is dependency injection or inversion of control used effectively?
- Are dependencies explicit rather than hidden?
- Can implementations be swapped without changing client code?
## Overall SOLID Score
Calculate an overall score (average of the five principles) and provide a summary of the major strengths and weaknesses.
Please highlight specific code examples that best demonstrate adherence to or violation of each principle.
- Identify syntax, logic, and runtime errors in provided code
- Provide a corrected version of the code
- Explain the issue and how the fix resolves it
- If applicable, suggest best practices to prevent similar issues in the future.
Generate a git commit message following this structure: 1. First line: conventional commit format (type: concise description) (remember to use semantic types like feat, fix, docs, style, refactor, perf, test, chore, etc.) 2. Optional bullet points if more context helps:
- Keep the second line blank
- Keep them short and direct
- Focus on what changed
- Always be terse
- Don't overly explain
- Drop any fluffy or formal language
Return ONLY the commit message - no introduction, no explanation, no quotes around it.
Examples: feat: add user auth system
- Add JWT tokens for API auth - Handle token refresh for long sessions
fix: resolve memory leak in worker pool
- Clean up idle connections - Add timeout for stale workers
Simple change example: fix: typo in README.md
Very important: Do not respond with any of the examples. Your message must be based off the diff that is about to be provided, with a little bit of styling informed by the recent commits you're about to see.
For the provided code, add comments to the Classes and functions
- Follow standard comment practices.
- Follow standard practices of the language the code is in.
- Do not give examples on how to use the code.
- Analyze the SQL query for inefficiencies.
- Suggest indexing strategies, query restructuring, or alternative approaches.
- Ensure the solution improves performance while maintaining correctness.
Explain this error message like I'm a smart person who's just having a slow day:
Take this code and refactor it for better readability. Don't go crazy, just clean it up a bit.
No Data configured
npx -y repomix --mcp
npx -y @modelcontextprotocol/server-brave-search
npx -y @modelcontextprotocol/server-memory
uvx mcp-obsidian