Skip to content

Instantly share code, notes, and snippets.

@harsh183
Last active March 31, 2026 21:35
Show Gist options
  • Select an option

  • Save harsh183/a4aa0dba41773796a3517547cdd4ac49 to your computer and use it in GitHub Desktop.

Select an option

Save harsh183/a4aa0dba41773796a3517547cdd4ac49 to your computer and use it in GitHub Desktop.
When using Devin on Github PRs I keep forgetting to prefix my comments with "aside -" which causes accidental changes. Vibe coded some a quick user script after a lot of iterations to add it by default
// ==UserScript==
// @name GitHub Comment "aside -" Prefix
// @namespace http://tampermonkey.net/
// @version 28.0
// @description Auto-prefixes GitHub PR comments with "aside -" for Devin
// @match https://github.com/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const PREFIX = 'aside - ';
const DEBUG = true;
const log = (...args) => DEBUG && console.log('[aside]', ...args);
function insertPrefix(ta) {
if (ta.value.startsWith(PREFIX)) return;
ta.focus();
document.execCommand('insertText', false, PREFIX);
log('inserted prefix into', ta.id || ta.className);
}
function prefixTextarea(ta) {
if (ta.dataset.asidePrefixed) return;
ta.dataset.asidePrefixed = 'true';
log('attaching to', ta.id || ta.className);
ta.addEventListener('focus', () => insertPrefix(ta));
ta.addEventListener('input', () => {
if (!ta.value.startsWith(PREFIX)) {
const pos = ta.selectionStart;
const cur = ta.value;
ta.value = cur.length < PREFIX.length ? PREFIX : PREFIX + cur.replace(/^(aside - ?)?/, '');
ta.dispatchEvent(new Event('input', { bubbles: true }));
ta.setSelectionRange(Math.max(PREFIX.length, pos), Math.max(PREFIX.length, pos));
}
});
}
const observer = new MutationObserver(() =>
document.querySelectorAll(
'textarea.js-comment-field, textarea[name="comment[body]"], textarea[name="pull_request_review[body]"], textarea.prc-Textarea-TextArea-snlco'
).forEach(prefixTextarea)
);
observer.observe(document.body, { childList: true, subtree: true });
})();
@harsh183
Copy link
Copy Markdown
Author

Use Tampermonkey to install on your browser

On a thread, it activates when you click in

Before:

image

After:

image

Also works on diff view when you open a thread:

image

And it autofills the default comment box when you go for that

image

@harsh183
Copy link
Copy Markdown
Author

Also works for Submit review
image

@harsh183
Copy link
Copy Markdown
Author

After posting one comment, the new one already fills up with aside -
image

@harsh183
Copy link
Copy Markdown
Author

downside, it always adds aside even if I delete it, but I'm fine with this right now since I don't like using Devin this way anyway. This should be fixed but I'll figure that out later. For now I can just disable if it gets too annoying

@harsh183
Copy link
Copy Markdown
Author

sometimes it doesn't work, but a page refresh seems to fix it. not sure what's up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment