{"skill":{"slug":"igot-karmayogi","displayName":"iGOT Karmayogi Automation","summary":"Automates iGOT Karmayogi portal (portal.igotkarmayogi.gov.in) using OpenClaw's built-in Playwright managed browser. Use this skill whenever the user mentions...","description":"---\nname: igot-karmayogi\ndescription: >\n  Automates iGOT Karmayogi portal (portal.igotkarmayogi.gov.in) using OpenClaw's\n  built-in Playwright managed browser. Use this skill whenever the user mentions iGOT,\n  Karmayogi, government courses, civil servant training, Mission Karmayogi, or wants to:\n  play course videos, enroll in courses, complete assessments, download certificates, or\n  track learning progress. Trigger for phrases like \"do my iGOT courses\", \"complete\n  karmayogi\", \"play the videos\", \"get my certificate from igot\", \"finish my assigned\n  courses\", \"continue my paused course\". The skill launches its own browser, runs fully\n  autonomously, and only contacts the user for login and genuine errors after 3 retries.\nmetadata:\n  clawdbot:\n    emoji: \"🎓\"\n    requires:\n      env: []\n    files:\n      - \"references/*\"\n---\n\n# iGOT Karmayogi Automation Skill\n\nAutomates iGOT Karmayogi from browser launch to certificate download.\nNo Chrome extension. No DevTools. No external connections. Self-contained.\n\n---\n\n## CRITICAL: HOW TO READ THIS SKILL\n\nThis skill is written for models with limited context windows (Gemini Flash Lite etc).\nEvery rule is written as a SHORT, DIRECT command. Follow each line exactly.\nWhen in doubt: take a screenshot, read the screen, then act.\n\n---\n\n## RULE 1 — NEVER STOP\n\nThe single most important rule:\n\n```\nDO NOT stop between steps.\nDO NOT wait for the user to message you.\nDO NOT pause after completing an action.\nDO NOT ask \"should I continue?\" — just continue.\nThe only times to stop and wait for user:\n  - Initial login confirmation (say \"go\")\n  - Error after 3 retries\n  - User types \"pause\" or \"stop\"\n```\n\nIf you feel like stopping — don't. Take a screenshot instead,\nread what's on screen, and do the next action immediately.\n\n---\n\n## RULE 2 — SAVE STATE AFTER EVERY ACTION\n\nBecause this model may lose context mid-task, write the current state\nto a file after every completed action:\n\n```\nFile: ~/.openclaw/workspace/igot-state.json\nFormat:\n{\n  \"phase\": \"playing_video\",\n  \"course_id\": \"do_114480908489883648\",\n  \"course_name\": \"Human Rights in Governance\",\n  \"module_index\": 2,\n  \"module_name\": \"What are Human Rights\",\n  \"item_index\": 0,\n  \"item_type\": \"video\",\n  \"retry_count\": 0,\n  \"last_action\": \"clicked play button\",\n  \"timestamp\": \"2026-03-22T14:30:00Z\"\n}\n```\n\nOn startup: ALWAYS check if this file exists first.\nIf it exists: read it and resume from saved position — do not restart.\nIf it does not exist: start fresh from Phase 1.\n\n---\n\n## RULE 3 — SCREENSHOT BEFORE AND AFTER EVERY ACTION\n\n```\nBefore clicking anything: take screenshot → read screen → confirm target visible\nAfter clicking anything: take screenshot → read screen → confirm action worked\nIf before-screenshot shows unexpected page: run RECOVERY (see below)\nIf after-screenshot shows nothing changed: action failed → increment retry_count\n```\n\nScreenshots are cheap. They prevent all silent failures.\nA weak model MUST use screenshots to know where it is at all times.\n\n---\n\n## PHASE 0 — LAUNCH BROWSER (First Action, Every Time)\n\n```\n1. Check if igot-state.json exists:\n   exec: cat ~/.openclaw/workspace/igot-state.json\n\n   If file exists and phase is NOT \"launch_browser\":\n     → Read saved state\n     → Launch browser (step 2)\n     → Navigate directly to saved position\n     → Resume from saved phase\n     → SKIP the rest of Phase 0\n\n   If file does not exist OR phase = \"launch_browser\":\n     → Continue with step 2\n\n2. Launch browser using OpenClaw browser tool:\n   tool: browser\n   action: launch\n   options:\n     headless: false\n     viewport: \"1280x800\"\n     userDataDir: \"~/.openclaw/browser/openclaw/user-data/igot-profile\"\n\n   If browser tool fails:\n     → Try: playwright-mcp launch\n     → If that fails: exec: npx playwright open https://portal.igotkarmayogi.gov.in/page/home\n     → If all fail: message user \"Run: openclaw gateway restart then say 'retry'\"\n\n3. Navigate to: https://portal.igotkarmayogi.gov.in/page/home\n\n4. Take screenshot. Read screen.\n   If login page visible: proceed to step 5\n   If dashboard visible: user already logged in → skip to Phase 1\n\n5. Message user exactly:\n   \"Browser is open on iGOT. Please log in and say 'go' when on the dashboard.\"\n\n6. Wait for user to say \"go\" / \"done\" / \"logged in\" / \"ready\"\n\n7. Take screenshot. Confirm dashboard visible (user name in header).\n   If dashboard visible: save state {phase: \"load_courses\"} → go to Phase 1\n   If login still showing: message \"Still on login page. Please complete login.\"\n```\n\n---\n\n## PHASE 1 — LOAD COURSE QUEUE\n\n```\n1. Navigate to: https://portal.igotkarmayogi.gov.in/app/my-dashboard\n2. Wait: networkidle + spinner gone + 3s buffer\n3. Take screenshot. Read screen.\n4. Collect all courses from:\n   - \"In Progress\" section\n   - \"Assigned\" / \"Upcoming\" section\n5. Sort by due date (earliest first)\n6. Save state: {phase: \"enrolling\", course_queue: [...]}\n7. Message user: \"Found [N] courses. Starting: [Course Name] (due [date])\"\n8. Go to Phase 2 immediately — do not wait for response\n```\n\n---\n\n## PHASE 2 — ENROLL\n\n```\n1. Navigate to: https://portal.igotkarmayogi.gov.in/app/toc/[COURSE_ID]/overview\n2. Wait: networkidle + spinner gone + 3s buffer\n3. Take screenshot. Read the main action button text.\n\n   Button says \"Enroll\":\n     → Click Enroll\n     → Wait for confirmation dialog → click Confirm\n     → Wait for page update (button changes)\n     → Take screenshot to confirm enrolled\n     → Save state → Go to Phase 3\n\n   Button says \"Start Learning\" or \"Continue Learning\":\n     → Already enrolled\n     → Save state → Go to Phase 3\n\n   Button not found after 10s:\n     → Run RECOVERY → retry\n```\n\n---\n\n## PHASE 3 — BUILD MODULE CHECKLIST\n\n```\n1. Take screenshot of course TOC page. Read all module rows.\n2. For each module row, record:\n   - Module name\n   - Items inside (video title, quiz title)\n   - Completion state (tick/checkmark present = done)\n3. Save checklist to state file\n4. Find first item that does NOT have a tick mark\n5. Save state: {phase: \"playing_video\", module_index: N, item_index: N}\n6. Go to Phase 4 immediately\n```\n\n---\n\n## PHASE 4 — PLAY VIDEO\n\nThis is the most complex phase. Follow every sub-step exactly.\n\n```\nSUB-STEP 4.1 — NAVIGATE TO VIDEO:\n  a. On TOC page: find the target module row\n  b. Take screenshot — confirm module row visible\n  c. If module row is collapsed: click it to expand\n     → Wait 2s → take screenshot → confirm items visible inside\n  d. Find the target video item inside the expanded row\n  e. Click the video item\n  f. Wait for URL to change to: /viewer/video/\n     → Timeout: 10s\n     → If URL unchanged after 10s: take screenshot, run RECOVERY\n\nSUB-STEP 4.2 — START VIDEO:\n  a. Take screenshot. Confirm video player visible.\n  b. Find countdown timer (bottom-right of player)\n     → Wait up to 10s for timer to appear\n     → If timer not visible after 10s: run RECOVERY\n  c. Check if video is paused (play button visible)\n     → If paused: click play button\n  d. Take screenshot. Confirm timer is counting down.\n  e. Save state: {phase: \"playing_video\", last_action: \"video playing\"}\n\nSUB-STEP 4.3 — WAIT FOR VIDEO TO END:\n  This is a POLLING LOOP. Run it continuously. Do NOT exit unless video is done.\n\n  LOOP (repeat every 30 seconds until video done):\n    a. Take screenshot\n    b. Read the countdown timer value\n    c. Check these 4 signals:\n\n       SIGNAL 1: Timer shows \"0:00\" → VIDEO DONE → EXIT LOOP\n       SIGNAL 2: Tick/checkmark appeared on this item → VIDEO DONE → EXIT LOOP\n       SIGNAL 3: \"Next\" button appeared and is clickable → VIDEO DONE → EXIT LOOP\n       SIGNAL 4: Items counter shows N/N (e.g. 2/2) → VIDEO DONE → EXIT LOOP\n\n    d. If none of the 4 signals:\n       → Check if video is paused → if yes: click play\n       → Check if page looks broken → if yes: run RECOVERY\n       → Check if session expired → if yes: ask user to re-login\n       → Otherwise: wait 30 more seconds, loop again\n\n    e. DO NOT exit this loop for any reason other than the 4 signals above\n    f. DO NOT message the user during this loop\n    g. DO NOT stop looping because the user is silent\n\n  AFTER LOOP EXIT (video done):\n    a. Take screenshot. Confirm tick visible on completed item.\n    b. Save state: {last_action: \"video complete\", item_index: N+1}\n\nSUB-STEP 4.4 — CLICK NEXT:\n  a. Find \"Next\" button at BOTTOM of player page (not sidebar)\n  b. Scroll down if needed\n  c. Wait 500ms after scroll\n  d. Click Next\n  e. Wait for URL change or new content (8s)\n  f. Take screenshot\n  g. Save state\n\nSUB-STEP 4.5 — DECIDE WHAT COMES NEXT:\n  Read the screen. Check the module checklist in state file.\n\n  If next item is another VIDEO:\n    → Update item_index → repeat Phase 4 from SUB-STEP 4.1\n\n  If next item is a QUIZ/TEST:\n    → All videos in this module are ticked? YES → Go to Phase 5\n    → Not all ticked? → Go back to next unticked video first\n\n  If all items in module are ticked:\n    → Are there more modules? YES → update module_index, item_index=0 → Phase 4\n    → No more modules? → Go to Phase 6 (Final Assessment)\n```\n\n---\n\n## PHASE 5 — PRACTICE TEST\n\n```\n1. Take screenshot. Confirm on quiz/test page OR navigate to it.\n2. Wait for questions to load (10s timeout)\n3. Read each question and all options\n4. Select the best answer for each question\n   → Use knowledge from the module just completed\n   → For factual government/rights questions: choose the most official/complete answer\n5. Before submitting: take screenshot, verify ALL questions have a selection\n6. Click Submit\n7. Wait for result screen (10s)\n8. Take screenshot. Read result.\n9. Save state: {last_action: \"practice test complete\"}\n10. Message user: \"[Course] > [Module]: Practice test ✅\"\n11. Update module_index, reset item_index = 0\n12. Go to Phase 4 (next module) OR Phase 6 (if all modules done)\n```\n\n---\n\n## PHASE 6 — FINAL ASSESSMENT\n\n```\n1. Verify: take screenshot of TOC, confirm ALL module items have tick marks\n   If any item unticked: go back to Phase 4 for that item first\n\n2. Navigate to Final Assessment item on TOC page\n3. Wait for questions to load (10s)\n4. Answer ALL questions carefully\n   → This is the certificate-qualifying test — be thorough\n   → Read every option before selecting\n5. Verify all questions answered → Submit\n6. Wait for result (10s)\n7. Take screenshot. Read score.\n\n   If PASSED:\n     → Message: \"[Course]: Final Assessment passed ✅ Downloading certificate...\"\n     → Save state → Go to Phase 7\n\n   If FAILED (retry available):\n     → Wait 5 seconds\n     → Re-enter assessment → retry once\n     → If passed on retry → Go to Phase 7\n     → If failed again → message user with score → pause loop\n\n   If FAILED (no retry):\n     → Message user: \"Final Assessment failed. Score: [X/10]. Manual review needed.\"\n     → Pause loop\n```\n\n---\n\n## PHASE 7 — DOWNLOAD CERTIFICATE\n\n```\n1. Navigate back to course TOC page\n2. Wait: networkidle + spinner gone + 3s buffer\n3. Take screenshot. Look for:\n   - \"View Certificate\" button\n   - \"Certificate\" tab\n   - Trophy/medal icon with download\n4. Click the certificate button/link\n5. Handle the result:\n   Download dialog appears:\n     → Save to: ~/Downloads/iGOT-Certificates/[CourseName]_Certificate.pdf\n   PDF opens in new tab:\n     → Switch to new tab → Ctrl+S → save as PDF to above path\n   Neither happens after 10s:\n     → Scroll down, look again → retry once → RECOVERY if still fails\n6. Take screenshot. Confirm file saved.\n7. Message user: \"✅ COMPLETE: [Course Name] — Certificate saved.\"\n8. Save state: remove completed course from queue\n\n9. If more courses in queue:\n   → Update current_course to next item\n   → Save state: {phase: \"enrolling\"}\n   → Go to Phase 2 immediately — do not wait\n\n10. If queue empty:\n    → Message: \"🎓 All [N] courses complete! Certs in ~/Downloads/iGOT-Certificates/\"\n    → Delete state file: ~/.openclaw/workspace/igot-state.json\n    → Close browser\n```\n\n---\n\n## RECOVERY — Run When Any Action Fails\n\n```\nSTEP R1: Take screenshot. Read the screen carefully.\n  What do you see?\n\n  Case \"login page\":\n    → Session expired → message user \"Session expired. Please log in and say 'go'.\"\n    → Wait for \"go\" → verify dashboard → resume from saved state\n\n  Case \"blank/white page\":\n    → Hard reload (navigate to same URL again)\n    → Wait: networkidle + 5s buffer\n    → Take screenshot → if page loaded: resume\n    → If still blank after 3 tries: message user\n\n  Case \"spinner running for more than 15s\":\n    → Hard reload → wait 5s → resume\n\n  Case \"correct page but target element missing\":\n    → Scroll up and down to find it\n    → Wait 3s (Angular may still be mounting)\n    → If still missing: hard reload → navigate back to this page\n\n  Case \"wrong page entirely\":\n    → Navigate directly to the correct URL for current phase\n    → Resume from saved state\n\nSTEP R2: After recovery action:\n  → Take screenshot to confirm page is correct\n  → Increment retry_count\n  → If retry_count > 3: message user with current URL + what went wrong\n  → If retry_count <= 3: resume action silently\n\nSTEP R3: On any success:\n  → Reset retry_count = 0\n  → Save state\n  → Continue\n```\n\n---\n\n## VIDEO WAIT — SPECIAL RULES FOR WEAK MODELS\n\nGemini Flash Lite may forget it is in the video polling loop.\nThese rules prevent that:\n\n```\nRULE V1: While waiting for a video, the ONLY valid actions are:\n  - Take screenshot\n  - Read timer value\n  - Click play if paused\n  - Run RECOVERY if page is broken\n  - Wait 30 seconds\n  NOTHING ELSE. Do not navigate away. Do not check other things.\n\nRULE V2: After every screenshot during video wait:\n  Write to state file: {last_action: \"polling video at [timer_value]\"}\n  This proves the model is still in the loop.\n\nRULE V3: If the model loses track of whether a video is done:\n  → Navigate to course TOC\n  → Check tick mark on the item\n  → If ticked: video is done, proceed to NEXT\n  → If not ticked: go back to video, play again from beginning\n\nRULE V4: Video duration reference for Human Rights in Governance:\n  Introduction: 4m 16s = wait ~260 seconds\n  Module 2 video: 5m 25s = wait ~325 seconds\n  Module 3 video: 5m 07s = wait ~307 seconds\n  Module 4 video: 5m 38s = wait ~338 seconds\n  Module 5 video: 5m 47s = wait ~347 seconds\n  Module 6 video: 5m 21s = wait ~321 seconds\n  Module 7 video: 5m 43s = wait ~343 seconds\n  Conclusion: 3m 05s = wait ~185 seconds\n  Use these as minimum wait times before checking for completion signals.\n```\n\n---\n\n## PORTAL URLS\n\n| Page | URL |\n|------|-----|\n| Dashboard | `https://portal.igotkarmayogi.gov.in/page/home` |\n| My Courses | `https://portal.igotkarmayogi.gov.in/app/my-dashboard` |\n| Course TOC | `https://portal.igotkarmayogi.gov.in/app/toc/<COURSE_ID>/overview` |\n| Video Player | `https://portal.igotkarmayogi.gov.in/viewer/video/<VIDEO_ID>?primaryCategory=Learning%20Resource&collectionId=<COURSE_ID>&collectionType=Course` |\n\nHuman Rights in Governance course ID: `do_114480908489883648`\n\n---\n\n## NOTIFICATIONS — Only These, Nothing Else\n\n```\nOn start:    \"Browser open. Please log in to iGOT and say 'go'.\"\nOn courses:  \"Found [N] courses. Starting: [Name] (due [date])\"\nOn video:    \"[Course] > [Module]: Video ✅\"\nOn test:     \"[Course] > [Module]: Practice test ✅\"\nOn final:    \"[Course]: Final Assessment passed. Downloading certificate...\"\nOn cert:     \"✅ COMPLETE: [Course] — Certificate saved.\"\nOn error:    \"⚠️ Stuck at [location] after 3 retries. [URL] [Error].\"\nOn finish:   \"🎓 All [N] courses complete!\"\n```\n\n---\n\n## USER COMMANDS\n\n| Command | Action |\n|---------|--------|\n| `status` | Read state file, report current phase/course/module/item |\n| `pause` | Finish current item, save state, stop |\n| `continue` | Read state file, resume from saved position |\n| `skip` | Skip current item, save state, move to next |\n| `stop` | Finish current item, save state, close browser |\n| `retry` | Reset retry_count, re-attempt last failed action |\n\n---\n\n## REFERENCES\n- `references/selectors.md` — CSS selectors for key UI elements\n- `references/course-ids.md` — Known course IDs for direct navigation\n","tags":{"latest":"1.0.3"},"stats":{"comments":0,"downloads":521,"installsAllTime":0,"installsCurrent":0,"stars":1,"versions":4},"createdAt":1774169582209,"updatedAt":1779078755879},"latestVersion":{"version":"1.0.3","createdAt":1774172442791,"changelog":"**No feature or logic updates; metadata/description only.**\n\n- Updated description to clarify autonomous use of OpenClaw's built-in Playwright browser\n- Description now states no Chrome extension or DevTools needed, and operation is self-contained\n- Emphasized that user is only contacted for login or irrecoverable errors\n- Internal execution flow, rules, and functional guidance unchanged","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"koppakanagaharsha-lang","userId":"s179arcw5t2qdt8sfbf6rbpnph83fnfv","displayName":"koppakanagaharsha-lang","image":"https://avatars.githubusercontent.com/u/253443124?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780090029537}}