Dependify uses Groq AI with Meta’s Llama models for ultra-fast code analysis and refactoring. The pipeline includes validation, confidence scoring, and comprehensive changelog generation.
The analysis prompt identifies files with outdated syntax:
checker.py:80-91
user_prompt = ( "Analyze the following code and determine if the syntax is out of date. " "If it is out of date, specify what changes need to be made in the following JSON format:\n\n" "{\n" ' "path": "relative/file/path",\n' ' "code_content": "The entire content of the file, before any changes are made.",\n' ' "reason": "A short explanation of why the code is out of date.",\n' ' "add": "Whether the code should be updated and has changes."\n' "}\n\n" f"{file_content}")
System Prompt:
checker.py:99
{ "role": "system", "content": "You are a helpful assistant that analyzes code and returns a JSON object with the path, and raw code content. Your goal is to identify outdated syntax in code and keep track of it."}
Reference: backend/checker.py:80-100
The analysis phase filters out files that don’t need updates (add: false) to reduce processing costs.
The refactoring prompt generates updated code with explanations:
modal_write.py:89-98
user_prompt = ( "Analyze the following code and determine if the syntax is out of date. " "If it is out of date, specify what changes need to be made in the following JSON format:\n\n" "{\n" ' "refactored_code": "A rewrite of the file that is more up to date, using ' 'the native language. The file should be a complete file, ' 'not just a partial updated code segment.",\n' ' "refactored_code_comments": "Comments and explanations for your code changes. ' 'Be as descriptive, informative, and technical as possible."\n' "}\n\n" f"File: {file_path}\n\n" f"Code:\n{code_content}")
System Prompt:
modal_write.py:106-109
{ "role": "system", "content": "You are a helpful assistant that analyzes code and returns a JSON object with the refactored code and the comments that come with it. Your goal is to identify outdated syntax in code and suggest changes to update it to the latest syntax."}
Reference: backend/modal_write.py:89-115
The prompt explicitly asks for complete file rewrites, not just code snippets, ensuring the output is ready to commit.
class JobReport(BaseModel): refactored_code: str refactored_code_comments: str
Reference: backend/modal_write.py:67-69
Pydantic models provide type safety, validation, and automatic parsing of LLM responses. If the LLM returns invalid JSON, Instructor automatically retries.
Dependify generates detailed changelogs inspired by GitButler’s style:
changelog_formatter.py:363-430
@staticmethoddef generate_pr_description(file_changes: List[FileChange]) -> str: """ Generate detailed PR description similar to GitButler style. Shows what changed, why it changed, and the impact. """ pr_desc = [] pr_desc.append("## 🤖 Automated Code Modernization\n") pr_desc.append("This pull request modernizes outdated code patterns...\n") # Summary pr_desc.append("### 📝 Summary\n") pr_desc.append(f"Updated **{total_files} files** with modern syntax...\n") # File-by-file breakdown pr_desc.append("### 📁 Changes by File\n") for fc in file_changes: pr_desc.append(f"#### `{fc.file_path}`\n") # What changed if fc.key_changes: pr_desc.append("**What changed:**") for change in fc.key_changes: pr_desc.append(f"- {change}") # Why it changed (AI explanation) if fc.explanation: pr_desc.append("**Why:**") pr_desc.append(f"> {fc.explanation}") return '\n'.join(pr_desc)
Modal secrets are lazily loaded to avoid initialization errors:
checker.py:13-50
_client = None_supabase_client = Nonedef get_client(): """Get or create Groq client with API key.""" global _client if _client is None: api_key = os.getenv("GROQ_API_KEY") if not api_key: from config import Config api_key = Config.GROQ_API_KEY _client = instructor.from_groq( Groq(api_key=api_key), mode=instructor.Mode.JSON ) return _client
Reference: backend/checker.py:13-50
This pattern prevents errors when Modal containers import modules before secrets are injected.