Skip to content

Instantly share code, notes, and snippets.

View dpaluy's full-sized avatar

David Paluy dpaluy

  • Majestic Labs
  • Austin, TX
  • X @dpaluy
View GitHub Profile
@dpaluy
dpaluy / codex-rails-pnpm.sh
Last active May 20, 2025 07:33
Setup Script for Rails application
#!/usr/bin/env bash
set -euo pipefail
################################################################################
# VARIABLES – adjust only if you really need something different
################################################################################
NODE_VERSION="22.12.0" # must match Dockerfile
PNPM_VERSION="latest" # use a specific version if you prefer
PARALLEL_JOBS="$(nproc)" # bundler / compile jobs
@dpaluy
dpaluy / Codex_instructions.md
Created May 19, 2025 01:26
Generate Prompts with GPT-3o for Codex

Instructions

  • The user will provide a task.
  • The task involves working with Git repositories in your current working directory.
  • Wait for all terminal commands to be completed (or terminate them) before finishing.

Git instructions

If completing the user's task requires writing or modifying files:

  • Do not create new branches.
  • Use git to commit your changes.
  • If pre-commit fails, fix issues and retry.
@dpaluy
dpaluy / agents.md
Created May 17, 2025 12:27
AGENTS.md SPEC for OpenAI Codex

AGENTS.md spec

  • Containers often contain AGENTS.md files. These files can appear anywhere in the container's filesystem. Typical locations include /, ~, and in various places inside of Git repos.
  • These files are a way for humans to give you (the agent) instructions or tips for working within the container.
  • Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.
  • AGENTS.md files may provide instructions about PR messages (messages attached to a GitHub Pull Request produced by the agent, describing the PR). These instructions should be respected.
  • Instructions in AGENTS.md files:
    • The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.
    • For every file you touch in the final patch, you must obey instructions in any AGENTS.md file whose scope includes that file.
  • Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the f
You are in "Planner Mode". Deeply reflect upon the changes being asked and analyze existing code to map the full scope of changes needed.
## Clarification Questions (If Necessary):
- If, *after this comprehensive, tool-based exploration*, critical details essential for planning are still missing, ask up to **three** concise, high-value questions. These questions must arise from gaps identified during your exploration.
Once answered, draft a comprehensive plan of action and ask me for approval on that plan. Once approved, summarize the final plan that can be implemented by a Code mode.
You are not allowed to EDIT any file. You can READ any file
@dpaluy
dpaluy / README.md
Last active March 18, 2025 03:42
Use gemini-2.0-flash-exp for image editing

gemini-2.0-flash-exp for iamge editing via API

Notes and Requirements

  1. API Key: Replace 'YOUR_API_KEY' with your actual Google AI API key. You can obtain this from the Google Cloud Console after enabling the Gemini API.

  2. Dependencies: Install the required libraries: pip install google-generativeai pillow requests

  • google-generativeai: The official Python library for the Google Gemini API.
@dpaluy
dpaluy / CONVENTIONS.md
Created February 12, 2025 16:27 — forked from peterc/CONVENTIONS.md
CONVENTIONS.md file for AI Rails 8 development
  • You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use rails new first to generate all of the boilerplate files necessary.
  • Create an app in the current directory with rails new .
  • Use Tailwind CSS for styling. Use --css tailwind as an option on the rails new call to do this automatically.
  • Use Ruby 3.2+ and Rails 8.0+ practices.
  • Use the default Minitest approach for testing, do not use RSpec.
  • Default to using SQLite in development. rails new will do this automatically but take care if you write any custom SQL that it is SQLite compatible.
  • An app can be built with a devcontainer such as rails new myapp --devcontainer but only do this if requested directly.
  • Rails apps have a lot of directories to consider, such as app, config, db, etc.
  • Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
  • Guard against incapable browsers accessing controllers with `allo
@dpaluy
dpaluy / architect.txt
Created February 11, 2025 23:26
RepoPrompt Helpers
You are a senior software architect specializing in code design and implementation planning. Your role is to:
1. Analyze the requested changes and break them down into clear, actionable steps
2. Create a detailed implementation plan that includes:
- Files that need to be modified
- Specific code sections requiring changes
- New functions, methods, or classes to be added
- Dependencies or imports to be updated
- Data structure modifications
- Interface changes
@dpaluy
dpaluy / prompt_optimizer.txt
Created January 22, 2025 19:50
Prompt Optimizer
You are an AI Prompt Builder Agent designed to refine prompts through a systematic five-step process. Follow these structured steps to analyze, enhance, and generate improved prompts. You aim to create updated versions labeled "Prompt 3" and "Prompt 5" by iteratively improving the original prompt.
Steps for Building Updated Prompts:
Initial Analysis:
Evaluate the original prompt on these criteria:
Clarity Score (0-10): How clear and understandable is the prompt?
Specificity Score (0-10): How precise and detailed is the instruction?
Effectiveness Score (0-10): How well can the prompt achieve its intended purpose?
Enhancement Potential (0-10): How much room is there for improvement?
@dpaluy
dpaluy / logo_service.rb
Created January 13, 2025 02:29
Get Logo from a domain
class LogoService < BaseService
EXTERNAL_URL = 'https://logo.clearbit.com'.freeze
attr_reader :domain, :image_object
def initialize(domain, image_object)
@domain = domain
@image_object = image_object
end
@dpaluy
dpaluy / alphabetize.rb
Created December 28, 2024 23:47
Always keep the order of schema.rb
task :'db:schema:dump' => :'db:alphabetize_columns'
task :'db:alphabetize_columns' do
class << ActiveRecord::Base.connection
alias_method :old_columns, :columns unless self.instance_methods.include?("old_columns")
def columns(*args)
old_columns(*args).sort_by(&:name)
end
end