Skip to content

Instantly share code, notes, and snippets.

View mrosata's full-sized avatar
🦁
Roar

Michael Rosata mrosata

🦁
Roar
  • Quincy, MA USA
View GitHub Profile
@mrosata
mrosata / 00 - Cursor AI Prompting Rules.md
Created October 17, 2025 17:57 — forked from aashari/00 - Cursor AI Prompting Rules.md
Cursor AI Prompting Rules - This gist provides structured prompting rules for optimizing Cursor AI interactions. It includes three key files to streamline AI behavior for different tasks.

The Autonomous Agent Prompting Framework

This repository contains a disciplined, evidence-first prompting framework designed to elevate an Agentic AI from a simple command executor to an Autonomous Principal Engineer.

The philosophy is simple: Autonomy through discipline. Trust through verification.

This framework is not just a collection of prompts; it is a complete operational system for managing AI agents. It enforces a rigorous workflow of reconnaissance, planning, safe execution, and self-improvement, ensuring every action the agent takes is deliberate, verifiable, and aligned with senior engineering best practices.

I also have Claude Code prompting for your reference: https://gist.github.com/aashari/1c38e8c7766b5ba81c3a0d4d124a2f58

@mrosata
mrosata / fp-either-monad.js
Last active October 28, 2024 15:09
Functional JavaScript Monad Classes - (Maybe Just Nothing) - (Either Left Right) (IOMonad) and my type checking utils
import is from './is-util';
/**
* Either Monad class (from Functional Programming in JavaScript)
*/
class Either {
constructor(value) {
this._value = value;
}
get value () {
@mrosata
mrosata / flower-power.py
Last active October 7, 2023 11:08
Python Turtle Flower... Stack like recursion
#!/usr/bin/python
# Udacity exercise. Just posted the code here to help anyone who wanted to see the work behind my posted result.
__author__ = 'Michael Rosata mrosata1984@gmail.com'
__package__ = ''
from random import random
import turtle
class TurtleArtist(turtle.Turtle):
_origin = (0, 0)
@mrosata
mrosata / la-ramda.js
Last active January 15, 2023 01:47
A subset of the Ramda library written using arrow functions, "lamda-ramda". The purpose of this is fun and to use in environments where importing 3rd party libs isn't allowed. Feel free to add to this.
const R = new LaRamda()
/**
* A subset of custom implementations of functions from
* the Ramda library. (all in Lamda form)
* - thanks to @xgrommx for uniq, intersection, where, evolve,
* applySpec, defaultTo, both, either, cond, zipWith
*/
function LaRamda () {
const I = x => x
@mrosata
mrosata / jsbin-functional-program.js
Created November 16, 2016 04:50
Functional Programming with IO, Maybe, Just, Nothing -- Touch of Reactive
console.clear()
// The Ramda Library functions you need to breathe.
const Maybe = iJustMetYouThisIsCrazyImAMonadSoCallMeMaybe()
const {
map, chain, compose, reduce, filter, prop, curry
} = R
// fromEvent :: Str -> Elem -> Obs
const fromEvent = curry((eventType, elem) => {
return Rx.Observable.fromEvent(elem, eventType)
@mrosata
mrosata / map-functional-args.js
Created April 23, 2017 00:45
A better order for the arguments to the map function
// One suggestion I have on the way I wrote map in this video:
// https://www.youtube.com/watch?v=qTeeVd8hOFY
// Instead of passing the transform function as the last param
// and the array as the first... it would be better to pass the
// transformFn first and the array as the last parameter to map.
function map (transformFn, array) {
const rv = []
for (let i = 0; i < array.length; i++) {
@mrosata
mrosata / memioze-with-ttl.js
Created February 12, 2019 18:37
Cache functions that return promises with a TTL
/**
* Memioze a function with a TTL
* @param func {function} The function to memioze (can return promise)
* @param ttl {number?} milliseconds to cache results (default = 30000)
* @param ttlError {number?} milliseconds to cache errors (default = ttl = 30000)
* @param initialValue {*} an optional value to return before initial func() result
* @return {{get: (function(...[*]=): Promise<*>), clear: (function(): void)}}
*/
export function memoizeWithTTL ({ func, ttl = 30000, ttlError = ttl, initialValue }) {
Verifying my Blockstack ID is secured with the address 15TypPzhtG7tupJbtybU8p7oxjrYHsGkwf https://explorer.blockstack.org/address/15TypPzhtG7tupJbtybU8p7oxjrYHsGkwf
@mrosata
mrosata / denode-aws-service-code.js
Last active January 8, 2018 17:11
Generates code to wrap entire AWS service apis as functions or methods returning Promises. Setup: `yarn add ramda yargs`
#!/usr/bin/node
////////////////////////////////////////////////////////////////////////////////
//// Create AWS Service Promisified Functions
//// @author Michael Rosata
////
//// @dependencies ramda, yargs
////
//// @desc
//// Returns the code that would wrap every method from one AWS Service into
//// functions that return Promises rather than those returning Node style
@mrosata
mrosata / .env.local
Created December 19, 2017 16:53
The React Starter Kit public/index.html template with Facebook Account Kit
REACT_APP_FB_APP_ID="12345-abcde"
REACT_APP_FB_ACCOUNT_KIT_VERSION="v1.2"
REACT_APP_META_THEME_COLOR="#FAFEFA"
REACT_APP_HTML_TITLE="React/Redux/Reselect Starter"