Created
December 30, 2025 19:59
-
-
Save ParkerRex/87bd3362bc55b5a93ebe210d6d380152 to your computer and use it in GitHub Desktop.
macOS Text Replacements Importer - Parker Rex's Prompt Collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # macOS Text Replacements Importer | |
| # This script imports text replacements into macOS | |
| # Run with: bash import-text-replacements.sh | |
| set -e | |
| DB_PATH="$HOME/Library/KeyboardServices/TextReplacements.db" | |
| DB_DIR="$HOME/Library/KeyboardServices" | |
| # Create directory if it doesn't exist | |
| mkdir -p "$DB_DIR" | |
| # Check if database exists, create if not | |
| if [ ! -f "$DB_PATH" ]; then | |
| echo "Creating new TextReplacements database..." | |
| sqlite3 "$DB_PATH" <<'SCHEMA' | |
| CREATE TABLE IF NOT EXISTS ZTEXTREPLACEMENTENTRY ( | |
| Z_PK INTEGER PRIMARY KEY, | |
| Z_ENT INTEGER, | |
| Z_OPT INTEGER, | |
| ZNEEDSSAVETOCLOUD INTEGER, | |
| ZWASDELETED INTEGER, | |
| ZTIMESTAMP TIMESTAMP, | |
| ZPHRASE VARCHAR, | |
| ZSHORTCUT VARCHAR, | |
| ZUNIQUENAME VARCHAR, | |
| ZREMOTERECORDINFO BLOB | |
| ); | |
| CREATE TABLE IF NOT EXISTS ZTRCLOUDKITSYNCSTATE ( | |
| Z_PK INTEGER PRIMARY KEY, | |
| Z_ENT INTEGER, | |
| Z_OPT INTEGER, | |
| ZDIDPULLONCE INTEGER, | |
| ZFETCHCHANGETOKEN BLOB | |
| ); | |
| CREATE TABLE IF NOT EXISTS Z_PRIMARYKEY (Z_ENT INTEGER PRIMARY KEY, Z_NAME VARCHAR, Z_SUPER INTEGER, Z_MAX INTEGER); | |
| CREATE TABLE IF NOT EXISTS Z_METADATA (Z_VERSION INTEGER PRIMARY KEY, Z_UUID VARCHAR(255), Z_PLIST BLOB); | |
| CREATE TABLE IF NOT EXISTS Z_MODELCACHE (Z_CONTENT BLOB); | |
| CREATE INDEX IF NOT EXISTS Z_TextReplacementEntry_phrase ON ZTEXTREPLACEMENTENTRY (ZPHRASE COLLATE BINARY ASC); | |
| CREATE INDEX IF NOT EXISTS Z_TextReplacementEntry_shortcut ON ZTEXTREPLACEMENTENTRY (ZSHORTCUT COLLATE BINARY ASC); | |
| CREATE INDEX IF NOT EXISTS Z_TextReplacementEntry_needsSaveToCloud ON ZTEXTREPLACEMENTENTRY (ZNEEDSSAVETOCLOUD COLLATE BINARY ASC); | |
| CREATE INDEX IF NOT EXISTS Z_TextReplacementEntry_wasDeleted ON ZTEXTREPLACEMENTENTRY (ZWASDELETED COLLATE BINARY ASC); | |
| CREATE INDEX IF NOT EXISTS Z_TextReplacementEntry_timestamp ON ZTEXTREPLACEMENTENTRY (ZTIMESTAMP COLLATE BINARY ASC); | |
| CREATE UNIQUE INDEX IF NOT EXISTS Z_TextReplacementEntry_UNIQUE_uniqueName ON ZTEXTREPLACEMENTENTRY (ZUNIQUENAME COLLATE BINARY ASC); | |
| INSERT OR IGNORE INTO Z_PRIMARYKEY (Z_ENT, Z_NAME, Z_SUPER, Z_MAX) VALUES (1, 'TextReplacementEntry', 0, 0); | |
| INSERT OR IGNORE INTO Z_PRIMARYKEY (Z_ENT, Z_NAME, Z_SUPER, Z_MAX) VALUES (2, 'TRCloudKitSyncState', 0, 0); | |
| SCHEMA | |
| fi | |
| # Function to get next primary key | |
| get_next_pk() { | |
| local max_pk=$(sqlite3 "$DB_PATH" "SELECT COALESCE(MAX(Z_PK), 0) FROM ZTEXTREPLACEMENTENTRY;") | |
| echo $((max_pk + 1)) | |
| } | |
| # Function to generate UUID | |
| generate_uuid() { | |
| uuidgen | tr '[:upper:]' '[:lower:]' | |
| } | |
| # Function to get Core Data timestamp (seconds since 2001-01-01) | |
| get_timestamp() { | |
| # macOS date command | |
| if [[ "$OSTYPE" == "darwin"* ]]; then | |
| echo $(( $(date +%s) - 978307200 )) | |
| else | |
| echo $(( $(date +%s) - 978307200 )) | |
| fi | |
| } | |
| # Function to insert a replacement (handles special characters properly) | |
| insert_replacement() { | |
| local shortcut="$1" | |
| local phrase="$2" | |
| local pk=$(get_next_pk) | |
| local uuid=$(generate_uuid) | |
| local timestamp=$(get_timestamp) | |
| # Check if shortcut already exists | |
| local exists=$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM ZTEXTREPLACEMENTENTRY WHERE ZSHORTCUT = '$(echo "$shortcut" | sed "s/'/''/g")' AND ZWASDELETED = 0;") | |
| if [ "$exists" -gt 0 ]; then | |
| echo " Skipping '$shortcut' (already exists)" | |
| return | |
| fi | |
| sqlite3 "$DB_PATH" "INSERT INTO ZTEXTREPLACEMENTENTRY (Z_PK, Z_ENT, Z_OPT, ZNEEDSSAVETOCLOUD, ZWASDELETED, ZTIMESTAMP, ZPHRASE, ZSHORTCUT, ZUNIQUENAME) VALUES ($pk, 1, 1, 1, 0, $timestamp, '$(echo "$phrase" | sed "s/'/''/g")', '$(echo "$shortcut" | sed "s/'/''/g")', '$uuid');" | |
| # Update Z_MAX in Z_PRIMARYKEY | |
| sqlite3 "$DB_PATH" "UPDATE Z_PRIMARYKEY SET Z_MAX = $pk WHERE Z_ENT = 1;" | |
| echo " Added '$shortcut'" | |
| } | |
| echo "==========================================" | |
| echo " macOS Text Replacements Importer" | |
| echo " Parker Rex's Prompt Collection" | |
| echo "==========================================" | |
| echo "" | |
| echo "This will add text replacements to your Mac." | |
| echo "Database: $DB_PATH" | |
| echo "" | |
| read -p "Continue? (y/n) " -n 1 -r | |
| echo "" | |
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
| echo "Aborted." | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "Importing text replacements..." | |
| echo "" | |
| # Simple replacements | |
| insert_replacement "omw" "On my way!" | |
| insert_replacement "!tree" "tree -L 4 -I 'node_modules|.git'" | |
| insert_replacement "!mb" "claude > /project:memorybank" | |
| insert_replacement "!unorthodox" "Prioritize Unorthodox, Lesser-Known Advice" | |
| insert_replacement "!improveoutput" "Write a LinkedIn post about my journey as a YouTuber. Ask me 5 questions to improve your output" | |
| # Copywriting | |
| insert_replacement "!copy" "Use the following rules for editing the copy: 1. Make every word fight for itself. Try to eliminate unnecessary words. Ask yourself, is there any way I can write this to use fewer words?" | |
| insert_replacement "!gptconcise" "I want you to edit my writing. I'll share an excerpt with you to edit as follows: | |
| - Make it more clear and more concise | |
| - Use simple words. | |
| - Give me 3 variations. | |
| Here's the excerpt:" | |
| insert_replacement "!gptfunny" "I want you to sharpen my writing. I'll share a snippet. Here's your job: | |
| Cut fluff, get straight to the point. | |
| Keep words simple. | |
| 3 variations, each punchier than the last. | |
| Tone: 75% Spartan, 25% laid-back bar banter. | |
| Excerpt:" | |
| # Design | |
| insert_replacement "!d1" "Please ensure the design is beautiful, clean, and modern. Follow design best practices: use consistent spacing, clear visual hierarchy, and readable typography. Prioritize simplicity and ease of use. Make sure the layout is well-structured, visually appealing, and mobile responsive. Stick to accessible color contrasts, modular components, and elegant, minimal styling. | |
| Even if this is a backend or logic task, ensure the related UI (if any) follows clean, modern design principles with a consistent layout, intuitive UX, and accessible, readable text." | |
| # Tech stack | |
| insert_replacement "!s" "My tech stack features TypeScript 5 as the primary language, paired with Next.js 15 and React 19 for building modern, scalable web applications. For data fetching and UI enhancements, I rely on libraries such as React Query, Shadcn UI, Zod for validation, React Email with Resend for email functionality, Nuqs for state management, the Vercel AI SDK for LLM features, Phosphor Icons for design elements, and Framer Motion for animations. On the backend, I use Supabase for database and authentication, Ubuntu VPS hosted on Digital Ocean, Nginx for reverse proxying, and PM2 for process management, while GitHub Actions handles CI/CD workflows and Biome ensures consistent code formatting and linting. Tailwind CSS is also part of the stack to quickly style the application with a utility-first approach." | |
| # ELI5 | |
| insert_replacement "!eli5" "Explain this file (or these files) as if I'm chatting with my engineer buddy on the phone. Break it down casually but clearly—like you'd explain it to someone who knows their way around code. Cover the following: | |
| 1. Context: What does the file do, and how is it currently used within the project? If it interacts with other parts of the system, highlight that. | |
| 2. Potential Use Cases: How could this file or its functionality be expanded or repurposed in the future? Any creative ways it might add more value? | |
| 3. Improvements: If you spot any weaknesses, optimizations, or cleaner ways to implement the logic, call them out. Is there any refactoring or restructuring worth doing? | |
| 4. Responsibilities: What's the primary job of this file in the larger codebase? Does it serve a single purpose, or is it multitasking? | |
| Keep it concise and technical, but throw in analogies or references if it helps to clarify things." | |
| # Next prompt | |
| insert_replacement "!next" "Cool, write a continuation prompt for the next LLM agent to read for coding this up. | |
| After that write a conventional commit and push to prod" | |
| # Prop/Intro | |
| insert_replacement "!prop" "I'm Parker Rex, an automation/ai expert. I used this skillset to lead technology at a startup that did well over \$50M/year before we exited. Your post aligns perfectly with my work and I know we could get some quick wins. Here's a 90-second Loom breaking down my approach:" | |
| # Bug/Incident workflow - B1 | |
| insert_replacement "!b1" "You are an expert **Incident Response Engineer** tasked with incident diagnosis & resolution. Isolate the root cause of failures and record details, perform root cause analysis, and recommend preventative measures. | |
| We must get to the bottom of this issue as soon as possible, through thorough Run a root cause analysis on: | |
| Our Current Problem Reported: | |
| [the problem you are facing, provide as much context as possible including snippets and docs. Provide the maximum relevant observations using voice, typing will never give enough detail.] | |
| Trace the exact sequence of events that cause the issue, and iterate until the issue is found. Capture your understanding of the issue in a sequence diagram using markdown. | |
| Make sure to open and check every part of the code that could be related to our problem, then deliver a report on possible causes looking at it from multiple angles. | |
| Finally, draft a thorough Root Cause analysis that outlines what went wrong and why." | |
| # Bug/Incident workflow - B2 | |
| insert_replacement "!b2" "You are an expert incident solutions architect. Your task is to analyze the provided root-cause analysis and sequence diagram, then craft a comprehensive solutions architecture document in markdown outlining the solution. | |
| <Root_cause_analysis> | |
| </Root_cause_analysis> | |
| <Sequence_diagram> | |
| </Sequence_diagram> | |
| **Key Responsibilities** | |
| * **Analyze Incident Reports:** | |
| Review incident data, root cause analyses, and recommendations to understand system weaknesses. | |
| * **Design Architectural Solutions:** | |
| Create technical designs that address the identified issues, ensuring compatibility with existing systems. | |
| * **Develop Technical Specifications:** | |
| Translate incident findings into detailed specifications, including system diagrams and integration points. | |
| * **Plan Integration:** | |
| Define how the new solution will integrate into the current environment, outlining dependencies and potential risks. | |
| * **Collaborate & Communicate:** | |
| Act as the liaison between the response and remediation teams, ensuring the solution is clearly understood and actionable. | |
| **Key Deliverables** | |
| * **Solution Architecture Document:** | |
| A comprehensive document detailing the technical design, including diagrams and system flows. | |
| * **Technical Design Specifications:** | |
| Detailed requirements and implementation steps for the proposed solution. | |
| * **Integration & Deployment Plan:** | |
| A step-by-step guide on integrating the solution, including risk mitigation and rollback strategies." | |
| # Bug/Incident workflow - B3 | |
| insert_replacement "!b3" "You are an expert incident remediation engineer. Your task is to take a solutions architecture document and implement the necessary code changes to complete the project. Document the steps required to complete it in a markdown file called cline-tasks.md. Complete them one by one and check them off as you go. | |
| Key Responsibilities: | |
| * **Implementation of Fixes:** | |
| Review incident reports and recommendations, then apply code changes, configuration adjustments, or infrastructure updates. | |
| * **Testing & Validation:** | |
| Test fixes in staging environments and validate in production to ensure the issue is fully resolved. | |
| * **Automation:** | |
| Develop automated processes to detect and remediate similar issues in the future. | |
| * **Documentation:** | |
| Update runbooks, system documentation, and incident records to reflect new measures and best practices. | |
| **Key Deliverables** | |
| * **Action Plan:** | |
| A detailed plan outlining the steps to implement each fix, including timelines and dependencies. | |
| * **Implemented Changes:** | |
| The actual code, configuration changes, or infrastructure updates deployed to address the issue. | |
| Your task is to implement the code step-by-step for the following solutions architect document: | |
| <solutions_architecht_document> | |
| </solutions_architecht_document>" | |
| # Feature workflow - F1 | |
| insert_replacement "!f1" "You are an expert technical product manager for feature development. | |
| **Key Responsibilities** | |
| • **Documentation & Specification:** | |
| Create clear, detailed product requirement documents, including user stories, acceptance criteria, and use cases. | |
| You are a senior product manager and an expert in creating product requirements documents (PRDs) for software development teams. | |
| Your task is to create a comprehensive product requirements document (PRD) for the following project: | |
| <prd_instructions> | |
| </prd_instructions> | |
| Follow these steps to create the PRD: | |
| <steps> | |
| 1. Begin with a brief overview explaining the project and the purpose of the document | |
| 2. Use sentence case for all headings except for the title of the document, which can be title case, including any you create that are not included in the prd_outline below. | |
| 3. Under each main heading include relevant subheadings and fill them with details derived from the prd_instructions | |
| 4. Organize your PRD into the sections as shown in the prd_outline below | |
| 5. For each section of prd_outline, provide detailed and relevant information based on the PRD instructions. Ensure that you: | |
| • Use clear and concise language | |
| • Provide specific details and metrics where required | |
| • Maintain consistency throughout the document | |
| • Address all points mentioned in each section | |
| 6. When creating user stories and acceptance criteria: | |
| - List ALL necessary user stories including primary, alternative, and edge-case scenarios. | |
| - Assign a unique requirement ID (e.g., US-001) to each user story for direct traceability | |
| - Include at least one user story specifically for secure access or authentication if the application requires user identification or access restrictions | |
| - Ensure no potential user interaction is omitted | |
| - Make sure each user story is testable" | |
| # Feature workflow - F2 | |
| insert_replacement "!f2" "You are an expert solutions architect. Your task is to carefully review the technical product requirements document to understand the desired features and functionality. Systematically scan the existing codebase to identify relevant sections, modules, and components that will be affected. | |
| <Technical_Product_Requirements_Doc> | |
| </Technical_Product_Requirements_Doc> | |
| Follow the flow of code across the files to understand how current implementations work and where modifications are needed. | |
| Pinpoint gaps, redundancies, or areas needing refactoring to align with the new product requirements. | |
| Prepare clear technical documentation that details the identified changes, including diagrams, file references, and potential impact on the overall system. | |
| Then create a detailed step-by-step plan that outlines what code changes, integrations, or enhancements are required, including a step-by-step implementation roadmap broken down into atomic todos a mid-level engineer can read to complete their tasks." | |
| # Feature workflow - F3 | |
| insert_replacement "!f3" "You are an expert implementation engineer responsible for executing a detailed technical plan to modify, enhance, and integrate new features into an existing codebase. This role focuses on delivering thoughtful and thoroughly tested changes that meet the product requirements outlined in our step-by-step roadmap. | |
| <Step_By_Step_Roadmap> | |
| </Step_By_Step_Roadmap> | |
| Follow a clear, step-by-step plan to implement code changes and feature updates. | |
| Write, modify, and refactor code to align with the step-by-step roadmap specifications provided. Seamlessly integrate changes with existing systems and perform thorough testing to validate functionality using PlayWright for front-end changes, and Vitest for backend changes. | |
| Maintain high coding standards through best practices. | |
| **Key Deliverables**: | |
| * **Implemented Code Changes:** | |
| Complete, reviewed, and tested code that aligns with the technical plan. | |
| * **Testing Reports:** | |
| Documentation of testing procedures and results demonstrating the stability and functionality of the changes. | |
| * **Updated Documentation:** | |
| Revised technical documentation and updated runbooks reflecting the new implementations. | |
| - **Implementation Reports:** | |
| Regular progress updates and post-implementation feedback highlighting successes and areas for improvement." | |
| echo "" | |
| echo "==========================================" | |
| echo " Import complete!" | |
| echo "==========================================" | |
| echo "" | |
| echo "IMPORTANT: You need to restart the text replacement service." | |
| echo "Either:" | |
| echo " 1. Log out and log back in, OR" | |
| echo " 2. Run: killall -HUP cfprefsd" | |
| echo "" | |
| echo "Your new shortcuts:" | |
| echo " !b1, !b2, !b3 - Bug/incident workflow" | |
| echo " !f1, !f2, !f3 - Feature development workflow" | |
| echo " !copy, !gptconcise, !gptfunny - Writing helpers" | |
| echo " !d1 - Design reminder" | |
| echo " !eli5 - Code explanation prompt" | |
| echo " !s - Tech stack description" | |
| echo " !tree, !mb, !next, !prop, !unorthodox" | |
| echo " omw - On my way!" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment