About RoleAlign

💡 Inspiration

Job hunting is exhausting. You spend hours tailoring your CV for each application, trying to figure out which skills to emphasize, and often wondering if you're even a good fit before investing time in the application. I wanted to solve this problem using Chrome's new on-device AI capabilities to create a private, job-matching assistant.

🛠️ What It Does

RoleAlign is a Chrome Extension that:

  1. Analyzes your CV once using Chrome's Prompt API and stores it locally
  2. Automatically scores job compatibility when you visit LinkedIn job postings (0-100% match)
  3. Generates tailored CV content using AI when you're a strong match (80%+)
  4. Operates 100% on-device - your CV never leaves your computer

All processing happens locally using Chrome's built-in Gemini Nano model through the Prompt API, Summarizer API, and Writer/Rewriter API.

🧠 How I Built It

Tech Stack:

  • Chrome Extensions Manifest V3 with TypeScript
  • WXT Framework for modern extension development
  • React for UI components
  • Chrome AI APIs: Prompt API, Summarizer API, Writer/Rewriter API

Architecture:

  1. CV Parsing: Used Prompt API to extract structured data (skills, experience, education) from uploaded CVs
  2. Job Analysis: Summarizer API condenses job descriptions; Prompt API extracts requirements and skill matching
  3. Smart Matching: AI-powered semantic matching between candidate skills and job requirements
  4. CV Tailoring: Writer/Rewriter API generates job-specific CV content optimized for each posting
  5. Shadow DOM Injection: Content scripts inject match scores and UI elements directly on LinkedIn pages

Key Technical Decisions:

  • AI-first architecture with no cloud fallbacks (strict on-device processing)
  • Aggressive caching of analyzed CV to avoid re-parsing
  • Dynamic skill extraction instead of hardcoded skill lists
  • Versioned local storage using chrome.storage.local for data persistence

🚧 Challenges I Faced

1. LinkedIn's Dynamic DOM Structure

LinkedIn frequently changes their HTML structure and uses obfuscated class names. I built a resilient parser with multiple fallback selectors and aggressive content extraction strategies.

Solution: Pattern-based regex matching with 15+ fallback patterns to handle different LinkedIn layouts.

2. AI Non-Determinism in Skill Matching ⚠️ Unsolved

This was the biggest challenge. Using the Prompt API and Summarization API to rate skill-set matches produces different results each time for the same CV and job posting. The match score might be 75% on one run and 82% on the next run.

What I Tried: I extensively refined the prompts to make outputs more deterministic - adding explicit scoring criteria, requesting structured JSON outputs, and providing detailed examples. While the variance improved slightly, the results still fluctuate between runs.

Current State: This remains an unsolved problem. The AI model's non-deterministic nature means match scores aren't perfectly reproducible. I've made them "close enough" (typically within ±5-8%), but true consistency isn't achievable with the current Prompt API. A hybrid approach combining deterministic algorithms with AI insights might be the long-term solution.

3. Chrome AI API Rate Limits & Timeouts

The Prompt API has strict context limits and can timeout on large inputs.

Solution: Implemented chunking for large job descriptions, aggressive timeouts (30s), and graceful error handling with detailed logging.

4. Skill Extraction Accuracy

Early versions extracted too many irrelevant terms (e.g., "experience", "team", "work") as "skills".

Solution: Refined prompts to focus on technical skills only with strict filtering rules. Used Prompt API with detailed instructions to distinguish between soft skills and domain-specific technical terms.

5. CV Format Variability

CVs come in countless formats - PDFs, plain text, different structures.

Solution: Used Prompt API's flexibility to handle unstructured input and extract information regardless of format. The AI adapts to different CV styles naturally.

📚 What I Learned

  1. Chrome's built-in AI is powerful: The Prompt API can handle complex extraction and generation tasks surprisingly well, even offline.

  2. On-device AI has limits: Context windows, rate limits, and processing time require careful prompt engineering and chunking strategies.

  3. AI non-determinism is a real challenge: Unlike cloud APIs with temperature controls, Chrome's built-in AI produces varying outputs. This makes consistent scoring difficult and requires managing user expectations.

  4. Prompt engineering is critical: Small changes in prompts dramatically affect output quality. I iterated 20+ times on skill extraction prompts alone.

  5. User expectations need management: On-device AI isn't instant like cloud APIs. Clear communication about model downloads, processing time, and result variance is essential.

  6. Privacy is a feature: Users love knowing their CV data never leaves their device. On-device processing is a competitive advantage.

🎯 What's Next for RoleAlign

  • Solve AI non-determinism: Explore hybrid approaches combining deterministic algorithms with AI insights for more consistent scoring
  • Indeed support (adapter exists, needs content script implementation)
  • More job sites (Glassdoor, Monster, etc.)
  • Improved CV formatting in generated output
  • Interview prep suggestions based on job requirements
  • Skills gap analysis - highlight skills you need to learn
  • Application tracking - remember which jobs you've applied to

Built With

Share this project:

Updates