Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ SkillGraph is an end-to-end AI career mentor and assisted job-application platfo

## 🚀 Features

### 1. OpenClaw — Assisted Apply
OpenClaw does the research and preparation; **the student always submits**.
- **Compliant job sources**: official public ATS APIs (Greenhouse, Lever, Ashby), licensed aggregators (JSearch, optional Adzuna) and company career pages. For LinkedIn, Naukri, Indeed and Glassdoor, students paste the job description — SkillGraph never logs into, scrapes or automates those sites, and never stores third-party credentials.
### 1. OpenClaw — Auto-Apply ([ADR-004](docs/adr/ADR-004-openclaw-auto-apply.md))
OpenClaw finds jobs inside the student's filters, tailors a résumé to each, and applies where that's allowed.
- **Student filters**: target roles, cities/remote, minimum CTC, blocked companies, must-mention and skip keywords. Nothing outside them is prepared or submitted automatically.
- **Résumé tailored per job**, rebuilt from the student's own uploaded résumé (no invented experience).
- **Auto-submit (opt-in)** through the employer's own Greenhouse or Lever API for employers that have connected to SkillGraph (`ATS_PARTNER_KEYS`). If a form asks a question only the student can answer, it waits for them.
- **Browser extension** ([`extension/`](extension/README.md)) for LinkedIn, Naukri, Glassdoor and Superset: checks the job against the filters, tailors the résumé and fills the application form in the student's own browser. The student presses Submit.
- **Never** logs into, scrapes or automates job sites from our servers, and never stores students' passwords, cookies or session tokens for them (ADR-001 C3).
- **Compliant job sources**: official public ATS APIs (Greenhouse, Lever, Ashby), licensed aggregators (JSearch, optional Adzuna) and company career pages.
- **10-dimension fit evaluation** with strengths, gaps and negotiation leverage for any job link or pasted description.
- **Nightly preparation**: for active students the worker discovers roles, scores fit, and queues strong matches as *Ready to apply* with a tailored résumé.
- **Nightly run**: for active students the worker discovers roles, applies the filters, scores fit, and submits (partner employers, opt-in) or queues strong matches as *Ready to apply*.
- **Interview prep**: STAR story bank and salary-negotiation scripts per role.

### 2. Resume-First Engine
- **Authenticity by design**: the student's real uploaded résumé is the source of truth; AI tailors *only* the 2–3 sentence summary for each posting — no fabricated experience or contact details.
- **Authenticity by design**: the student's real uploaded résumé is the source of truth; AI reorders and rewords it for each posting and may not add employers, projects, numbers or skills.
- **ATS-friendly PDF export**, stored privately and downloaded through short-lived signed links.

### 3. Faculty & Recruiter Operating Systems
Expand Down Expand Up @@ -84,7 +89,8 @@ and long-running jobs into a *separate worker service*, and make OpenClaw *compl
| **3 — Trust & operations** | Email verification, password reset, mutual-consent recruiter reveal, DPDP/GDPR data rights, observability, tests | ✅ Done |
| **4 — Commercial** | Razorpay billing & plan limits, college workspaces with tenant isolation, caching, load testing | ✅ Done (Razorpay keys pending) |
| **5 — Academics & drives** ([ADR-002](docs/adr/ADR-002-academics-and-placement-drives.md)) | Attendance, Smart Adjust, marks, timetable; Haveloc-style drives; college CSV imports; university sync providers | 🟡 In review — SRM API key and Academia connector pending |
| **6 — Placement workflow** ([ADR-003](docs/adr/ADR-003-placement-workflow.md)) | Hiring rounds, job tracker, round confirmation & check-in, placement calendar, notice board, drive chats | 🟡 In review — migration pending |
| **6 — Placement workflow** ([ADR-003](docs/adr/ADR-003-placement-workflow.md)) | Hiring rounds, job tracker, round confirmation & check-in, placement calendar, notice board, drive chats | ✅ Done |
| **7 — OpenClaw auto-apply** ([ADR-004](docs/adr/ADR-004-openclaw-auto-apply.md)) | Job filters, per-job tailored résumés, opt-in submission through partner employers' ATS APIs, browser extension for LinkedIn/Naukri/Glassdoor/Superset | 🟡 In review — partner keys and live-site checks pending |

```
Browser ──► Next.js (Vercel, stateless) ──► lib/services ──► Postgres (migrations, backups)
Expand Down
78 changes: 78 additions & 0 deletions docs/adr/ADR-004-openclaw-auto-apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ADR-004: OpenClaw Auto-Apply — Filters, Tailored Résumés, Partner ATS Submission, Browser Extension

**Status:** Accepted, in review
**Date:** 2026-10-13
**Deciders:** Product owner (Aakash), engineering

## Context

The product owner asked for OpenClaw to apply to jobs automatically on LinkedIn, Naukri, Glassdoor and
Superset, using each student's user id or session token for those sites, with a résumé customised to
each job and only for jobs that pass the student's own filters.

ADR-001 (finding C3) removed exactly this design in Phase 2. Logging in as the student, or replaying
their session cookies, to automate those sites:
- breaks those sites' terms, which forbid automated access and applications;
- gets **students'** accounts restricted or banned, often during placement season;
- turns SkillGraph into a store of live third-party sessions, the most valuable thing an attacker could take from us.

Two findings shaped the alternative:
1. **Public ATS "apply" APIs need the employer's key.** Greenhouse's Job Board API and Lever's Postings API
accept applications only with an API key the employer issues. A third party can't submit to them on its own.
So genuine auto-submit is possible only for employers who connect their hiring system to SkillGraph.
2. **The old agent tailored only the summary.** Other sections came from saved Résumé Builder versions,
so a student who had only uploaded a PDF got a résumé with no experience or projects.

## Decision

1. **Job filters** (`lib/openclaw/filters.ts`). Target roles, cities (including remote), minimum CTC
(parsed from the band in LPA), blocked companies, and two new filters:
- **must mention:** the job has to mention at least one of these keywords;
- **skip if mentioning:** the job is skipped if it mentions any of these.

One pure function, `checkFilters`, is used by the nightly agent and by the extension. A job outside the filters is never
prepared or submitted automatically. In the extension the student can choose "Tailor anyway".
2. **Full tailored résumé** (`lib/resume/tailor.ts`). It is built from the student's uploaded résumé and
profile for each job, with the same no-invention rules as the Résumé Builder. It is stored privately as a
`ResumeVersion` and shared by the Résumé Builder, the agent and the extension.
3. **Partner ATS auto-submit, opt-in** (`lib/openclaw/submit.ts`).
- **When it runs:** only if the student turns on *Submit for me where the employer allows it* and the posting is on a Greenhouse
board or Lever site whose employer key is in `ATS_PARTNER_KEYS`.
- **What it sends:** OpenClaw reads the application form and answers only standard fields from the profile (name, email, phone,
links, college), then attaches the tailored résumé.
- **When it stops:** if any required question can't be answered from the profile (expected CTC, notice period, essays), nothing is sent and
the application waits as `ReadyToApply` with the reason.
- **What it records:** submitted applications are `Applied` with `submittedVia = ats_api` and the ATS's application id.
4. **Browser extension for LinkedIn, Naukri, Glassdoor and Superset** (`extension/`, Chrome MV3).
- **Flow:** on a job page it reads the job, checks the filters through SkillGraph, gets the tailored résumé
and fills the application form in the student's own signed-in browser.
- **What it fills:** empty fields only, never overwriting the student's answers. It attaches the PDF and
highlights questions only the student can answer.
- **What it never does:** it never clicks Submit. *I submitted it* records the application as `Applied` with `submittedVia = extension`.
- **Authentication:** a 30-day bearer token stored hashed (`AuthToken` type `extension`). It is created, shown once and revoked on the OpenClaw page.
- **What it reads:** the extension reads nothing from job sites except the job shown, and sends nothing
of the student's sessions or cookies anywhere.
5. **Superset** is a college-run platform. Beyond the extension, deeper integration should come through the
placement cell's official export, like the Haveloc CSV import in ADR-002, never through student logins.

Rejected: storing students' job-site session tokens or passwords and automating applications server-side
(the request as stated), for the reasons in *Context*.

## Consequences

- Students get one-click assisted applications on the four sites and true auto-apply where employers allow it, with a résumé
tailored to each job.
- Auto-submit stays inactive until an employer issues a key. Getting partner employers is a business task, not an engineering one.
- Job sites change their markup. The extension's readers (`extension/sites.js`) need maintenance, and students can always
select the job text manually.
- The extension is distributed unpacked for now. Publishing to the Chrome Web Store needs a privacy policy entry (done in
`/privacy`, pending legal review) and a store listing.
- Schema: `OpenClawConfig.includeKeywords`, `excludeKeywords` and `autoSubmit`, plus `OpenClawApplication.submittedVia` and
`externalRef` (migration `20261018000000_openclaw_auto_apply`, additive only).

## Action items
1. [x] Filters, tailored résumé, partner ATS submitter, agent integration, settings UI.
2. [x] Extension API (`/api/extension/*`), per-token rate limiting, extension (MV3), connect/revoke UI.
3. [ ] Verify the Greenhouse and Lever submit calls against a real partner's sandbox before enabling `ATS_PARTNER_KEYS` in production.
4. [ ] Check the extension's site readers against live LinkedIn, Naukri, Glassdoor and Superset pages (they are written from public markup and need a signed-in check).
5. [ ] Chrome Web Store listing once legal has reviewed the privacy text.
32 changes: 32 additions & 0 deletions extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SkillGraph OpenClaw — browser extension

Assisted apply on **LinkedIn, Naukri, Glassdoor and Superset** (ADR-004).

On a job page the extension:
1. reads the job (role, company, location, pay, description);
2. checks it against your OpenClaw filters in SkillGraph;
3. builds a résumé tailored to that job from your uploaded résumé (no invented experience);
4. fills the application form with your profile and attaches the tailored résumé.

**You review the form and press Submit yourself.** Then click *I submitted it* to track the job as Applied.

## Privacy and safety
- SkillGraph never receives your passwords, cookies or session tokens for job sites. The
extension works inside your own signed-in browser.
- The extension stores one SkillGraph token, which expires after 30 days. Disconnect it any time in SkillGraph → OpenClaw. That stops it working immediately.
- It fills only empty fields, never overwrites what you typed, and never clicks buttons.
Questions only you can answer (expected CTC, notice period, experience, personal details) are
highlighted in amber and left blank.

## Install (developer mode)
1. Open `chrome://extensions`, turn on **Developer mode**, click **Load unpacked**, choose this `extension/` folder.
2. In SkillGraph → OpenClaw → **Browser extension**, click **Connect extension** and copy the token.
3. Click the extension icon, paste the token, then press **Connect**.

To use a local server, enter its address (e.g. `http://localhost:3000`) in the popup. Only the
addresses listed in `manifest.json` → `host_permissions` are allowed.

## Limits
Job sites change their page markup. If the role or description isn't detected, select the job
description text on the page and press the button again. Form filling is best effort: always
check every field before submitting.
118 changes: 118 additions & 0 deletions extension/autofill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Fills the application form on the page with the student's SkillGraph profile and attaches the
// tailored résumé. It only fills empty fields, never changes an answer the student typed, and
// never clicks a button: the student reviews the form and submits it themselves.
/* exported fillApplicationForm */

// Field descriptor (label, name, placeholder…) → profile key. First match wins.
const SG_RULES = [
[/first[\s_-]*name|given[\s_-]*name|fname/, 'firstName'],
[/last[\s_-]*name|surname|family[\s_-]*name|lname/, 'lastName'],
[/linked[\s_-]*in/, 'linkedin'],
[/git[\s_-]*hub|portfolio|personal[\s_-]*(web)?site|website/, 'github'],
[/e-?mail/, 'email'],
[/phone|mobile|contact[\s_-]*(no|number)|whatsapp/, 'phone'],
[/college|university|institut|school/, 'college'],
[/degree|qualification|course/, 'degree'],
[/branch|major|speciali[sz]ation|discipline|stream|department/, 'branch'],
[/cgpa|\bgpa\b|grade[\s_-]*point/, 'cgpa'],
[/graduation[\s_-]*year|year[\s_-]*of[\s_-]*(passing|graduation)|batch|passing[\s_-]*year/, 'year'],
[/current[\s_-]*(city|location)|\bcity\b|location/, 'city'],
[/full[\s_-]*name|^name$|your[\s_-]*name|candidate[\s_-]*name|applicant[\s_-]*name/, 'fullName'],
]

// Questions only the student can answer: highlighted, never guessed
const SG_ASK_STUDENT = /ctc|salary|notice|experience|years|relocat|visa|sponsor|why|cover|gender|disab|veteran|race|ethnic|date of birth|dob|aadhaar|pan\b/

function SG_describe(el) {
const parts = [el.getAttribute('aria-label'), el.name, el.id, el.placeholder, el.getAttribute('autocomplete')]
if (el.id) {
const label = document.querySelector(`label[for="${CSS.escape(el.id)}"]`)
if (label) parts.push(label.innerText)
}
const labelledBy = el.getAttribute('aria-labelledby')
if (labelledBy) labelledBy.split(/\s+/).forEach(id => parts.push(document.getElementById(id)?.innerText))
const wrapping = el.closest('label')
if (wrapping) parts.push(wrapping.innerText)
// Many forms put the question text in the field's container rather than a <label>
const container = el.closest('[class*="form"], [class*="question"], [class*="field"], fieldset, li, div')
if (container && container.innerText.length < 200) parts.push(container.innerText)
return parts.filter(Boolean).join(' ').toLowerCase()
}

const SG_visible = el => el.offsetParent !== null && !el.disabled && !el.readOnly

/** Sets a value the way a user would, so React/Angular forms register it. */
function SG_setValue(el, value) {
const proto = el instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : el instanceof HTMLSelectElement ? HTMLSelectElement.prototype : HTMLInputElement.prototype
Object.getOwnPropertyDescriptor(proto, 'value').set.call(el, value)
el.dispatchEvent(new Event('input', { bubbles: true }))
el.dispatchEvent(new Event('change', { bubbles: true }))
el.dispatchEvent(new Event('blur', { bubbles: true }))
}

function SG_selectOption(select, value) {
const want = value.toLowerCase()
const option = [...select.options].find(o => o.text.toLowerCase().trim() === want) || [...select.options].find(o => want && o.text.toLowerCase().includes(want))
if (!option) return false
SG_setValue(select, option.value)
return true
}

function SG_resumeFile(resume) {
const bytes = Uint8Array.from(atob(resume.base64), c => c.charCodeAt(0))
return new File([bytes], resume.fileName, { type: 'application/pdf' })
}

function SG_highlight(el, color) {
el.style.outline = `2px solid ${color}`
el.style.outlineOffset = '2px'
}

/**
* Fills every visible, empty field it recognises. Returns counts for the panel to report.
* `root` defaults to the whole document (open modals such as LinkedIn Easy Apply included).
*/
function fillApplicationForm(profile, resume, root = document) {
const result = { filled: 0, attached: 0, needsYou: 0 }
const fields = root.querySelectorAll('input:not([type=hidden]):not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]), textarea, select')

for (const el of fields) {
if (!SG_visible(el) && el.type !== 'file') continue

if (el.type === 'file') {
const desc = SG_describe(el)
const accepts = (el.accept || '').toLowerCase()
if (/photo|image|picture|avatar|logo|cover/.test(desc) || /^image\//.test(accepts)) continue
const isResume = /resume|cv|curriculum/.test(desc) || accepts.includes('pdf') || accepts === ''
if (!isResume || !resume || el.files?.length) continue
try {
const transfer = new DataTransfer()
transfer.items.add(SG_resumeFile(resume))
el.files = transfer.files
el.dispatchEvent(new Event('input', { bubbles: true }))
el.dispatchEvent(new Event('change', { bubbles: true }))
result.attached++
} catch {
/* the site blocks programmatic uploads; the panel offers a download instead */
}
continue
}

if (el.value && el.value.trim()) continue // never overwrite the student's own answer
const desc = SG_describe(el)
if (SG_ASK_STUDENT.test(desc)) {
SG_highlight(el, '#f59e0b')
result.needsYou++
continue
}
const rule = SG_RULES.find(([re]) => re.test(desc))
const value = rule && profile[rule[1]]
if (!value) continue
const done = el instanceof HTMLSelectElement ? SG_selectOption(el, value) : (SG_setValue(el, value), true)
if (done) {
SG_highlight(el, '#22c55e')
result.filled++
}
}
return result
}
40 changes: 40 additions & 0 deletions extension/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Service worker: the only part of the extension that talks to SkillGraph.
// It holds the SkillGraph access token; job-site pages never see it, and nothing from the
// job sites (cookies, sessions, passwords) is ever read or sent.

const DEFAULT_BASE_URL = 'https://skillgraphai.vercel.app'

async function settings() {
const { baseUrl = DEFAULT_BASE_URL, token = '' } = await chrome.storage.local.get(['baseUrl', 'token'])
return { baseUrl: baseUrl.replace(/\/+$/, ''), token }
}

async function api(path, { method = 'GET', body } = {}) {
const { baseUrl, token } = await settings()
if (!token) return { ok: false, status: 401, data: { error: 'Connect the extension first: click its icon and paste your SkillGraph token.' } }
try {
const res = await fetch(`${baseUrl}${path}`, {
method,
headers: { Authorization: `Bearer ${token}`, ...(body ? { 'Content-Type': 'application/json' } : {}) },
body: body ? JSON.stringify(body) : undefined,
})
const data = await res.json().catch(() => ({}))
return { ok: res.ok, status: res.status, data }
} catch (err) {
return { ok: false, status: 0, data: { error: `Could not reach SkillGraph (${err.message}).` } }
}
}

// Only these SkillGraph endpoints can be called from content scripts
const ALLOWED = new Set(['GET /api/extension/me', 'POST /api/extension/prepare', 'POST /api/extension/applied'])

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message?.type !== 'api') return false
const key = `${message.method || 'GET'} ${message.path}`
if (!ALLOWED.has(key)) {
sendResponse({ ok: false, status: 400, data: { error: 'Not allowed' } })
return false
}
api(message.path, { method: message.method, body: message.body }).then(sendResponse)
return true // async response
})
Loading
Loading