Skip to content

Instantly share code, notes, and snippets.

@electricessence
electricessence / sub-agent-guidance.md
Created October 21, 2026 14:23
Sub Agent Guidance

Sub-agents

  • Dispatch: before spawning a sub-agent, read the dispatch skill and use the Dispatch agent (paired). Zero context by default; leaking context on purpose is the rare exception. For read-only fact gathering, read the scout skill and use the scout agent (paired).
  • Model (every sub-agent, Dispatch included): always pass model, the cheapest that can do the job: haiku for read-only lookups (Explore, scout), sonnet for most work, opus only for planning, design or hard judgment, with a reason. Use Fable as a consultant only when directed by the operator. Never let a sub-agent silently inherit the session's model.
@electricessence
electricessence / laws.md
Created October 17, 2026 16:53
Laws of Agent Behavior

Laws of Agent Behavior

Priority order. Higher-numbered law MUST NEVER override lower. Fulfill Law 1 before 2, 2 before 3, etc.

Operator: human or host agent in charge of agent's work; party whose interests agent serves.

Law 1 — Alignment

Always ensure deep understanding of operator's intent.

@electricessence
electricessence / TrackedTaskScheduler.cs
Last active September 30, 2025 02:13
TrackedTaskScheduler
using System.Collections.Concurrent;
using System.Diagnostics;
namespace TrackingTaskScheduler;
/// <summary>
/// A custom TaskScheduler that tracks active tasks and provides completion notification
/// when all tasks have finished executing.
/// </summary>
/// <remarks>
@electricessence
electricessence / universal-websocket.ts
Last active August 22, 2025 05:57
Universal Web-Socket
// universal-websocket-base.ts
// Minimal WebSocket base with state-aware, timeoutable async connect()
// Built on @tsdotnet/disposable's AsyncDisposableBase.
//
// Deps:
// npm i rxjs @tsdotnet/disposable
//
// Implement in a subclass (Browser/Node/K6):
// protected _open(url: string, opts?: OpenOptions): void
// protected _send(data: WsMessage): void
@electricessence
electricessence / copilot-instructions.md
Created June 11, 2025 22:02
Style and Design Guide for AI-Generated TypeScript

Copilot Instructions: TypeScript Style and Design Guide

This file guides AI and human contributors in writing clean, modern TypeScript code. It reflects best practices as of 2025, aligned with our team’s priorities.


🧠 Core Principles

  • Readability above all else: Code must be easy to follow, even by new contributors or AI tools.
  • Concise and clean: Prefer clarity over cleverness. Avoid unnecessary abstraction.
@electricessence
electricessence / copilot-instructions.md
Last active June 11, 2025 15:21
Default .NET/C# Project AI Directives

.NET/C# AI Coding Guidelines

Purpose: Comprehensive, non-project-specific guide for AI-assisted .NET development.


🎯 CRITICAL RULES (Always Follow)

  1. Test-Driven Development: Interface → Test → Implementation
  2. LINE BREAKS AFTER CLOSING BRACES - AI models frequently break this rule!
@electricessence
electricessence / Git-Worktree.ps1
Last active January 16, 2025 16:39
Git-Worktree Function for Powershell (add to $PROFILE)
function Git-Worktree-List {
git worktree list
}
function Copy-UntrackedFiles {
param (
[string]$SourcePath,
[string]$TargetPath
)
@electricessence
electricessence / SmartCookie.cs
Created June 11, 2024 21:51
SmartCookie.cs: Legacy WebForms Cookie Management
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Collections.Specialized;
using System.Diagnostics.Contracts;
using System.Threading;
using Utilities.Threading;
@electricessence
electricessence / SymmetricAlgorithmExtensions.cs
Last active February 26, 2023 08:29
Some basic extensions for encrypting and decrypting JSON.
using System;
using System.Buffers;
using System.IO;
using System.Security.Cryptography;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
public static class SymmetricAlgorithmExtensions
{
@electricessence
electricessence / 1 - Intel i7-7500U.md
Last active October 4, 2021 18:01
FileStream & PipeReader Benchmarks
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1237 (21H1/May2021Update)
Intel Core i7-7500U CPU 2.70GHz (Kaby Lake), 1 CPU, 4 logical and 2 physical cores
.NET SDK=6.0.100-rc.1.21463.6
  [Host]     : .NET 6.0.0 (6.0.21.45113), X64 RyuJIT  [AttachedDebugger]
  Job-CKZXSH : .NET 6.0.0 (6.0.21.45113), X64 RyuJIT

InvocationCount=1  UnrollFactor=1