Skip to content

Instantly share code, notes, and snippets.

Meta-Prompt for Refining AI Prompt for Model-Specific Use

You are an AI LLM tasked with refining the provided input prompt to optimize it for your own specific capabilities and knowledge. The input prompt describes a software engineering environment with tools, modes, rules, and objectives for task execution. Your goal is to create a streamlined version of the prompt that retains all critical information necessary for effective task execution while removing redundant or obvious content based on your understanding. The refined prompt must remain compatible with the original structure and be usable by you for tasks in the specified environment.

The prompt you refine will be accompanied by other details about your role that will be filed separately. It is expected that you will be able to perform your role perfectly with the supplemental role and rules, alongside this prompt you will refine for yourself.

Instructions

  1. Analyze the Input Prompt:
  • Review the input prompt for sections: Tool Us
@evelant
evelant / ElectricSyncService.ts
Created April 8, 2025 16:50
effect-ts streams for up-to-date with electric sql
export class ElectricSyncService extends Effect.Service<ElectricSyncService>()(
"ElectricSyncService",
{
scoped: Effect.gen(function* () {
yield* Effect.logInfo(`creating ElectricSyncService`)
const clockService = yield* ClockService
const syncService = yield* SyncService
const config = yield* SynchrotronClientConfig
const pgLiteClient = yield* PgLiteSyncTag
/**
* @since 1.0.0
*/
import * as Reactivity from "@effect/experimental/Reactivity"
import * as Client from "@effect/sql/SqlClient"
import type { Connection } from "@effect/sql/SqlConnection"
import { SqlError } from "@effect/sql/SqlError"
import type { Custom, Fragment, Primitive } from "@effect/sql/Statement"
import * as Statement from "@effect/sql/Statement"
import { PGlite, types, type Results, type Transaction } from "@electric-sql/pglite"
@evelant
evelant / textdecoder.js
Created May 7, 2024 19:24
fastestsmallesttextencoderdecoder TextDecoder polyfill fixed for react-native 0.74
(function(window){
"use strict";
var log = Math.log;
var LN2 = Math.LN2;
var clz32 = Math.clz32 || function(x) {return 31 - log(x >>> 0) / LN2 | 0};
var fromCharCode = String.fromCharCode;
var Object_prototype_toString = ({}).toString;
var NativeSharedArrayBuffer = window["SharedArrayBuffer"];
var sharedArrayBufferString = NativeSharedArrayBuffer ? Object_prototype_toString.call(NativeSharedArrayBuffer) : "";
var NativeUint8Array = window.Uint8Array;
import {
Span as SentrySpan,
SpanStatusType,
getActiveSpan,
getActiveTransaction,
getCurrentHub,
startSpanManual,
startTransaction,
} from "@sentry/core"
import type * as Sentry from "@sentry/types"
@evelant
evelant / gist:c7d2b79af62a3864771d63c4d53a1d9a
Last active December 18, 2023 19:02
Frame aware scheduler for Effect
class FrameAwareReactScheduler implements Scheduler.Scheduler {
tasks: Array<Scheduler.Task> = []
scheduledRaf: number | undefined = undefined
constructor(readonly maxMsBeforeFrame: number) {}
isRunning = false
scheduleFrame() {
if (this.scheduledRaf === undefined && !this.isRunning) {
this.scheduledRaf = requestAnimationFrame(() => {
this.isRunning = true
@evelant
evelant / DateUtils.ts
Created September 6, 2023 15:02
DateUtils
import { closestTo } from "date-fns"
import _ from "lodash"
const SECONDS = 1000
const MINUTES = SECONDS * 60
const HOURS = MINUTES * 60
const DAYS = HOURS * 24
const YEARS = DAYS * 365
/**
This file has been truncated, but you can view the full file.
imagio  …/rn072-pnpm-monorepo-ios-frameworks-static-bug/apps/testproj   main   v18.16.0  ♥ 10:38  pnpm react-native run-ios
info Found Xcode workspace "testproj.xcworkspace"
info Found booted iPhone SE (3rd generation)
info Launching iPhone SE (3rd generation)
info Building (using "xcodebuild -workspace testproj.xcworkspace -configuration Debug -scheme testproj -destination id=E0322BB3-B552-4E9E-8E9A-F31C896CA903")
info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening testproj.xcworkspace.
Command line invocation:
@evelant
evelant / managed_runtime.ts
Created January 31, 2023 22:06
Global effect runtime for use with react(-native)
/**
* Example of a "global managed runtime" for use with react(-native)
* React isn't a traditional zio/effect app that has one entry point
* There may be many effects run but we don't want to reconstruct all our app services each
* time we want to run an effect.
*
* This code builds app services layers just once then provides a global runtime object that can
* be used to run as many effects as you want all with access to the same service instances.
*
* ex:
Object {
"_id": RuntimeFiberId {
"_tag": "Runtime",
"id": 51,
"startTimeSeconds": 1661444456,
Symbol(@effect/core/io/FiberId): Symbol(@effect/core/io/FiberId),
},
"state": AtomicReference {
"current": Executing {
"_tag": "Executing",