Temp
Make quick, reversible code changes for local testing. Every change is marked with a TEMP: comment so it can be found and undone later.
Modes
1. Make a temporary change (default)
Usage: temp always show questionnaire
- Search the codebase for code related to the user's description.
- Make the minimal change needed — flip a boolean, comment out a guard, force a condition, hardcode a value. Prefer the smallest diff possible.
- Mark every modified line with a comment containing
TEMP:and the reason. Use the appropriate comment syntax for the language.
Marking rules:
- Add
// TEMP: <reason>(or# TEMP:,/* TEMP: */,-- TEMP:, etc.) at the end of each changed line, or on the line above if end-of-line isn't practical. - If commenting out code, wrap it like:
// TEMP: always show questionnaire — commented out guard // if (!hasSeenQuestionnaire) { - If changing a value:
const showOnboarding = true; // TEMP: always show onboarding (was: false) - Always include what the original value was when replacing a value, using
(was: ...).
- Tell the user what was changed and how to undo (
temp undo).
2. Undo all temporary changes
Usage: temp undo
- Grep the project for
TEMP:markers. - If no markers found, tell the user there are no temporary changes.
- For each file with markers, use
git checkoutorgit restoreto revert the file. If the file has other unstaged changes mixed in, restore only the TEMP-marked lines manually by reading the original from git and editing surgically. - Confirm what was reverted.
3. List current temporary changes
Usage: temp list
- Grep the project for
TEMP:markers. - Display each one with file path, line number, and the marker text.
- If none found, say "No temporary changes active."
Examples
Example 1: Force a questionnaire to always show
User says: temp always show questionnaire
Actions:
- Search for questionnaire-related display logic (e.g.,
hasSeenQuestionnaire,showQuestionnaire,questionnaire+ conditional). - Find:
if (!user.hasCompletedQuestionnaire) { showQuestionnaire(); } - Change to:
if (true) { showQuestionnaire(); } // TEMP: always show questionnaire (was: !user.hasCompletedQuestionnaire) - Report the change.
Example 2: Disable auth check
User says: temp skip auth
Actions:
- Find auth middleware or guard.
- Comment out or force-pass the check, marking with
// TEMP: skip auth.
Example 3: Undo
User says: temp undo
Actions:
- Search the codebase for
TEMP:markers. - Found markers in
src/components/Questionnaire.tsx:42andsrc/middleware/auth.ts:15. - Restore original code for each marked line (read original from git or use the
(was: ...)hint). - Confirm: "Reverted 2 files, removed all TEMP markers."
Troubleshooting
Can't find relevant code
Cause: The description is too vague or uses different terminology than the codebase. Solution: Ask the user for more specific terms, file names, or feature names to search for.
Undo reverts more than TEMP changes
Cause: The file had other unstaged modifications mixed with TEMP changes.
Solution: Instead of reverting the whole file, surgically restore only the TEMP-marked lines by reading the original from git show HEAD:<file> and editing just those lines back.