Skip to content

Instantly share code, notes, and snippets.

@cmstead
cmstead / gist:352703b8cfcf087b78c047a2917803d5
Created November 13, 2026 16:54
Elite Workflow Team Agent
---
name: Elite Workflow Team
description: Agentic team that follows a tight workflow
argument-hint: I want a team to build and execute a structured workflow for a given task
# tools: ['vscode', 'execute', 'read', 'agent', 'edit', 'search', 'web', 'todo'] # specify the tools this agent can use. If not set, all enabled tools are allowed.
---
You are a team of elite agents that build and execute structured workflows for given tasks. You collaborate efficiently, delegate responsibilities, and ensure that each step of the workflow is completed accurately and on time. You continuously monitor progress, adapt to changes, and provide updates to the user as necessary.
When given a task, you first break it down into manageable steps, assign roles to team members, and create a timeline for completion. You track progress, identify potential obstacles, and adjust the workflow as needed to achieve the desired outcome. You maintain clear communication with the user, providing regular status updates and seeking clarificat
@cmstead
cmstead / argCountValidator.js
Created February 2, 2024 19:55
Decorator to validate argument count
function validateAndCall(args, enforcedFunction, maxArgumentCount) {
if(args.length > maxCount) {
throw new Error(`Function '${fn.name}' cannot be called with more than ${maxCount} arguments, but was called with ${args.length}`);
}
return fn.apply(null, args);
}
function enforceCount({ enforcedFunction, maxArgumentCount }) {
return function () {
@cmstead
cmstead / DataAccess.py
Created March 17, 2021 18:26
Python DI with PyAutoDI
from ...Interfaces.LoggerInterface import LoggerInterface
class DataAccess:
def __init__(self, logger=LoggerInterface): # connection_string_factory
self.logger = logger
def query(self, user_data):
self.validate_request(user_data)
self.logger.log(f"User provided input: {user_data}")
@cmstead
cmstead / InnerHTML.html
Last active March 3, 2021 07:21
Examples from code questions
<!-- https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML -->
<div id="container">
<p>This is some text</p>
</div>
<script>
// innerHTML retrieves all HTML content inside of a selected element
// and returns it as a string
@cmstead
cmstead / to-do-list.disc
Last active August 12, 2020 02:59
To Do List written in disc lang
begin
# To Do List
let tasks be (newArray:)
declare function addATask
let newTask be prompt: "What do you want to do?"
appendTo: tasks newTask
call startToDoList
@cmstead
cmstead / gist:7ad64539d13dfdb5a2591bc3be3c8eeb
Last active July 17, 2025 20:13
VS Code snippet transform: convert camel case to Pascal case or vice versa
// If you want to convert a PascalCase variable to camelCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/downcase}${2}/}
// Example: ${1:This is my original} => ${1/^(.)(.*)$/${1:/downcase}${2}/}
// If you want to convert a camelCase variable to PascalCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/upcase}${2}/}
@cmstead
cmstead / post-importer.js
Created March 7, 2019 22:42
Converting WordPress blog posts to Jekyll
'use strict';
const fs = require('fs');
const xml2js = require('xml2js');
const moment = require('moment');
const importConfig = require('./postImporterConfig.json');
const { xmlPath, oldDomain, newDomain, wpContentLocation } = importConfig;
const postXML = fs.readFileSync(xmlPath, { encoding: 'utf8' });
promiseReturningService
.getUserData()
.then((userData) => {
// this only runs if there is no error getting user data
return userData.userName;
})
.then((userName) => {
// this only runs if there is no error in all previous calls
console.log(userName);
})
@cmstead
cmstead / App.js
Last active January 28, 2019 21:59
Proof of concept: Building a react app using Dject as an IoC container
import logo from './logo.svg';
import './App.css';
function AppFactory(React) {
const { Component } = React;
class App extends Component {
render() {
return (
@cmstead
cmstead / original-code.js
Created January 13, 2019 02:41
Eliminating conditional blocks with value selection and assignment
function async saveDataOrDefault(todoId, messageRecord) {
if(messageRecord !== null) {
await dbModel.saveData(todoId, messageRecord);
} else {
await dbModel.saveData(todoId, { message: null });
}
}