Skip to content

neerajgrg/PromptChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptChain

Run multi-step AI workflows on ChatGPT and Gemini — hands-free.

PromptChain is a free, open-source Chrome extension that queues your prompts and runs them one at a time. It types each instruction, hits send, waits for the full response, then moves to the next step automatically.

Perfect for research pipelines, content workflows, code reviews, tutoring sequences, and any task where you’d normally copy-paste prompts manually.


Why PromptChain?

Without PromptChain With PromptChain
Copy prompt → paste → wait → repeat Queue all steps once → walk away
Lose track of which step you’re on Live progress overlay on the page
Same prompts for ChatGPT and Gemini in different tabs Separate saved lists per platform
No signal when a long run finishes Optional completion chime

Features

  • Multi-step queue — Add as many instructions as you need
  • Auto-submit & wait — Detects when the AI finishes generating before continuing
  • ChatGPT & Gemini — Platform tabs with separate instruction sets
  • Progress overlay — Floating panel on the chat page with step count and stop button
  • Completion sound — Optional 3-note chime when all steps finish
  • Configurable delay — Pause between steps (0–60 seconds)
  • Persistent storage — Instructions and settings saved locally in your browser
  • Stop anytime — Cancel mid-run from the popup or the on-page overlay
  • Privacy-first — No accounts, no analytics, no data leaves your browser

Supported platforms

Platform URL Status
ChatGPT chatgpt.com Supported
ChatGPT (legacy) chat.openai.com Supported
Google Gemini gemini.google.com Supported

Note: PromptChain is not affiliated with, endorsed by, or sponsored by OpenAI or Google.


Installation

From source (recommended for now)

  1. Clone this repository

    git clone https://github.com/neerajgrg/AiInstructions.git
    cd AiInstructions
  2. Open Chrome extensions

    • Navigate to chrome://extensions
    • Enable Developer mode (top-right toggle)
  3. Load the extension

    • Click Load unpacked
    • Select the project folder
  4. Pin the extension (optional)

    • Click the puzzle icon in Chrome’s toolbar → pin PromptChain

Chrome Web Store

Coming soon.


How to use

  1. Open ChatGPT or Gemini in a browser tab and sign in.
  2. Click the PromptChain icon in your toolbar.
  3. Select the matching platform tab (ChatGPT or Gemini).
  4. Add your instructions — one prompt per step.
  5. Adjust settings if needed:
    • Delay between steps — seconds to wait after each response (default: 1s)
    • Play sound when done — completion chime (on by default)
  6. Click Run on ChatGPT or Run on Gemini.
  7. Watch the overlay on the chat page, or switch tabs — the run continues in the background.

Example workflow

Step 1: Summarize this article in 5 bullet points: [paste article]
Step 2: Turn the summary into a LinkedIn post under 200 words
Step 3: Suggest 5 hashtags for the post
Step 4: Rewrite in a more casual tone

PromptChain runs each step only after the previous response is fully complete.


How it works

flowchart LR
    A[You queue steps] --> B[Extension fills prompt]
    B --> C[Clicks Send]
    C --> D[Waits for response]
    D --> E{More steps?}
    E -->|Yes| F[Delay if configured]
    F --> B
    E -->|No| G[Sound + Done overlay]
Loading

Under the hood:

  1. A content script runs on supported chat pages
  2. It finds the composer input and send button using resilient DOM selectors
  3. It monitors generation state (stop button / streaming indicators)
  4. The popup stores your instruction lists per platform in chrome.storage.local

Project structure

AiInstructions/
├── manifest.json          # Extension manifest (MV3)
├── background.js          # Service worker
├── content/
│   ├── content.js         # Automation logic (ChatGPT + Gemini)
│   └── overlay.css        # On-page progress overlay
├── popup/
│   ├── popup.html         # Extension popup UI
│   ├── popup.css
│   └── popup.js
├── icons/                 # Extension icons
└── test/                  # Automated tests (Playwright + mock page)

Development

Prerequisites

  • Node.js 18+
  • Google Chrome or Chromium

Run tests

Tests use Playwright with a local mock chat page (no API keys or login required).

npm install
npm test

This launches Chromium with the extension loaded and verifies the full two-step run flow.

Reload after changes

  1. Go to chrome://extensions
  2. Click the reload icon on PromptChain
  3. Refresh any open ChatGPT/Gemini tabs

Permissions explained

Permission Why it's needed
storage Save your instruction lists and settings locally
activeTab Interact with the current chat tab when you click Run
scripting Inject the content script if it hasn't loaded yet
Host access (chatgpt.com, gemini.google.com) Run automation only on supported AI chat pages

PromptChain does not request access to all websites, <all_urls>, or your browsing history.


Roadmap

  • Chrome Web Store release
  • Claude.ai support
  • Named instruction presets (save/load workflows)
  • {{previous_response}} variable in steps
  • Browser notification on completion
  • Import / export instruction sets
  • Start from step N

Contributions and feature requests are welcome — see Contributing.


Troubleshooting

Extension doesn't appear after loading

Make sure you selected the folder containing manifest.json, not a parent directory. Reload the extension from chrome://extensions.

"Open ChatGPT/Gemini in a tab first"

You need an open, logged-in tab on the matching platform. Switch to the correct tab in the popup before running.

Prompt not sending / stuck on a step

The AI site may have updated its UI. Try refreshing the page. If the issue persists, open an issue with your browser version and platform.

No completion sound

Ensure Play sound when done is checked and the tab isn't muted. Chrome may block audio on background tabs — the overlay will still show completion.


Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

Please keep PRs focused and include test updates when changing automation logic.


License

MIT License — free to use, modify, and distribute.


Author

Built by neerajgrg

If PromptChain saves you time, consider starring the repo — it helps others discover it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages