adalundhe/astack
Run a program of work as lanes. A lead gives each lane one deliverable and a worker subagent a hard time limit to build it, holds workers to work, then robust, then fast, verifies every merge itself, and brings the person only real decisions, in plain words.
Settle design, implementation, or config choices by benchmarking variants in separate worktrees (including combinations) across extreme workloads, grafting any winning ideas before deleting losers. Use whenever measurement can settle a choice.
Resolve every review finding and PR comment from humans or agents by fixing, answering, or disproving it, blockers first, replying on every thread. Use when review findings or PR comments arrive.
Review a change by reproducing the original bug, confirming acceptance criteria, trying to break it in its real environment, checking coding rules, and reporting proven blockers first. Use when reviewing a fix, feature, branch, or PR.
Inspect the machine, repo configs/infra/env-var names, installed CLIs, MCP servers, APIs, and services, run safe read-only/dry-run and auth-status probes, install user-space tooling when authorized (unattended), and publish a shared TOOLS.md catalog for all agents—isolating only human-only auth steps. Use for researcher, worker, reviewer, or lead environment and system-access discovery.
Single entry point for astack—ALWAYS load this skill before doing any code review, PR review, PR comment drafting, bug diagnosis, refactor, implementation, plan, test, benchmark, research, or catch-up task; routes on demand by path to all 72 hidden engineering workflows and coding-rule skills so only one skill sits in context.
Execute a reviewed dagify task graph (or multi-step program) with parallel time-boxed astack-worker, reviewer, and researcher subagents in isolated git worktrees, verified merges, and durable logs. Use for $astack-lead, coordinating parallel work, or verifying worker branches before merge.
Run vectored adversarial reviews from an approved reviewer_pool in separate worktrees, gather PR/issue/doc context first, enforce coding rules, prove blocking bugs with runnable failing reproductions, merge overlaps by fix-equivalence, stop on observable-class saturation or empirically calibrated clean sweeps via astack-review-ledger, and report only proven high-signal findings plainly without leaking internal status. Use before merging or whenever asked to review a branch, diff, code, or PR.
Configure per-role provider/model/effort (lead, worker, researcher), approved reviewer_pool across detected harnesses, autonomy grant (supervised vs unattended allow/deny), worker/reviewer/researcher timers, Claude skill permissions, CLI PATH links, and optional uv/Python automation stack (or pure-agentic default). Use for $astack-setup.
Show an astack program's active workers, reviewers, and researchers, their timers, latest commits, lane states, and open questions. Use for $astack-status or when asked how a program is progressing.
Replace repeated manual commands, polling, and noisy searches with scripts, watchers, or subagents (using taskex, orchestral, or werkflow + werkflow-modules for Python automation) to keep bulk output out of context. Use when repeating commands, watching CI or agents, or flooding context.
Keep cross-system benchmarks and baselines fair: identical client, platform, and concurrency, release/production tuning on all sides (no untuned caps), verified real work, error checking, and alternating runs. Use before running or trusting competitor benchmarks or baseline comparisons.
Design, run, and verify rigorous benchmarks with baseline median and standard deviation (sigma), variance reduction, Amdahl hard-limit checks, proof the work actually ran, and untuned-config checks. Use when measuring performance, checking regressions, or comparing systems.
Identify what a change could break outside its diff and verify the core safety assumption by running real code. Use before refactoring or removing shared code, or when reviewing a risky change.
Lead-only multi-reviewer bug workflow: gather full bug/linked context, swarm read-only reviewers split by reproduction method with find-it, converge via peer challenge logging rejected theories (decided:), route fixes to workers (fix-it) who resubmit to post-fix reviewers (prove-it + PR proof), and run make-it-stick (dispatching workers + review for structural guards). Use for complex, subtle, or high-impact bugs.
Peer-to-peer adversarial challenge between any agents (or against your own reasoning) to stress-test hypotheses, repeated fixes, diagnoses, designs, and implementations until every assumption is proven or conceded. Use whenever an approach, diagnosis, or choice needs rigorous pushback.
Parse and validate external data into domain types once at the boundary, then trust those types inside. Use when writing or reviewing code handling requests, CLI args, config, env vars, files, DB rows, or API replies.
Instrument, save, inspect, and verify durable checkpoints for taskex tasks and orchestral workflows using SQLiteCheckpointStore and ContextVar helpers (checkpoint, checkpoint_sync, last_checkpoint, pause_point). Use when making long-running automation crash-resumable or inspecting saved progress.
Iteratively improve performance and minimize variance (sigma) in small measured steps: baseline median and standard deviation, hill-climb by >=1 sigma per step while tightening variance, sanity-check against Amdahl bounds, enforce a minimum attempt floor, commit gains, and revert regressions. Use when significant optimization is needed.
Remove temporary files, debug logs/captures (<file>_DEBUG_<shorthash>.<type>), build artifacts, caches, test data, and processes created by your work without touching anything else or still needed. Always invoke post-review, when finishing/handing off, and during or right after debugging.
Strip comments that narrate or excuse the code, keeping only what code can't express (API contracts, external constraints, legal headers, issue links). Use when writing, reviewing, or cleaning up comments.
Work through an architecture decision with the person one evidenced question at a time and write it up as the next AD-N document. Use when asked to draft, review, or grill an architecture decision (ADC/AD).
Break a large request into a dependency graph of small, parallelizable tasks with acceptance criteria and tests, avoiding overlapping file edits. Use before building multi-task work or re-planning a program.
Design data representations, invariants, ownership, and access patterns before writing algorithms or control flow. Use when designing new features, schemas, core modules, or refactoring tangled logic.
Settle choices between designs, implementations, or configs by measuring them instead of arguing. Use when comparing approaches or before escalating a design question.
Resolve what you can yourself, log every decision, and only escalate genuine human choices as plain options with a recommendation. Use before asking the person anything or writing a report.
Tighten a task brief before starting so it uses primary sources, domain tools, and external proof instead of taking shortcuts, without expanding scope. Use before briefing or starting work.
Design and audit work from the consumer's side (end user, API caller, operator, or maintainer): clear feedback, actionable errors, complete states, good defaults, and ergonomic APIs. Use when designing, building, or reviewing user-facing work.
Wake work on the event that unblocks it instead of timers, sleeps, or polling loops. Use when writing or reviewing waiting, retry, refresh, or polling code, or agent wait loops.
Replicate bugs deterministically from provided or correlated real data (logs, traces, metrics, monitoring, usage analytics) and full failure-environment conditions across the end-to-end path, collect runtime evidence (<file>_DEBUG_<shorthash>.<type>) preferring built-in language debuggers then astack tools then third-party tools, shrink the repro before narrowing root causes (binary search/bisect, live dumps, profile pairs), and clean all debug artifacts once fixed. Use for suspected bugs, failing tests, flakes, hangs, leaks, or slowdowns.
Apply minimal, behavior-proven bug fixes: classify behavior on the desired/expected matrix, prove with failing behavior tests, fix root causes without arbitrary locks, state hacks, or rearchitectures, check broader system and performance impact when relevant, harden tests against lead vectored review, and verify before/after proof. Use whenever fixing a confirmed bug, failure, or regression.
Set up and maintain formal verification (TLA+, code verifiers, or generated checks) for concurrency, state machines, protocols, parsers, or unsafe code, and replay counterexamples on real code. Use when tests can't cover dangerous orderings or inputs, or after verified code changes.
Write acceptance-driven tests across the test diamond (unit, integration, end-to-end) covering failure modes, edge cases, concurrency, fuzzing, and injected faults. Use when writing or auditing a task's tests.
Give a read-only, file-and-line-cited walkthrough of part of a codebase (mental model, components, flow, state, gotchas), marking claims as run vs. read. Use before editing unfamiliar code or answering 'how does X work' / 'where should this live'.
Draft, independently audit via a second reviewer agent, and post clear, concise, actionable human-facing PR comments (e.g. GitHub): verifies surrounding PR/issue/doc context was inspected and blocks cryptic SHAs, awkward/stilted/rambling prose, missing actions, or leaked internal thinking before posting. Use before posting any PR review comment or human review feedback.
Fix unrelated broken tests, builds, CI, or security/dependency checks at their root cause in a separate PR instead of working around them. Use when preexisting breakage blocks your work.
Review a session transcript, log scoped lessons in LESSONS.md, and make repeated mistakes impossible using the structural fix ladder (architecture, types, lint, test, docs last). Use after long runs or recurring corrections.
Keep one source of truth for each piece of data; add caches, copies, or long-lived state only when measurements justify them. Use when writing or reviewing caching, denormalization, or stateful code.
Split monolithic packages, files, or functions into single-purpose modules behind narrow interfaces via a reviewed smallest-behavior proof of concept, dagify-batched parallel migration, and simplify-me/yagni scope reduction—validated at every stage with vectored review. Use when code is too large or tangled to change safely.
Ensure optimizations keep exact results, freshness, durability, error visibility, and features—researching compliant approaches before claiming any trade-off is unavoidable. Use when optimizing or proposing approximate/deferred variants.
Integrate new requirements cleanly into the existing design instead of adding special-case flags, parallel copies, or wrapper patches. Use when adding features to existing code or reviewing special-case changes.
Parse all settings in one place, keep each option single-purpose, document and test every value, and isolate internal switches behind proper feature flags. Use when writing or reviewing options, flags, or env vars.
Handle specific failures where they happen or return typed error values; avoid broad catch-alls, swallowed errors, or exceptions used as control flow. Use when writing or reviewing error handling.
Model state machines explicitly with named states in one type, centralized transitions, and exhaustive handling. Use when writing or reviewing code whose behavior depends on prior state.
Sweep code, diffs, configs, logs, errors, telemetry, tests, and debug artifacts for leaked secrets, tokens, credentials, unneeded personal data (PII), or excessive logging. Use when writing or reviewing code touching auth, config, logging, errors, telemetry, APIs, or before shipping.
Avoid hardcoded arbitrary limits, timeouts, batch sizes, or thresholds; derive them from cited specs/OS limits or adapt them at runtime. Use when writing, reviewing, or proposing behavioral constants.
Keep concurrent threads, processes, services, and agents from mutating the same state: isolate per writer, merge on read, and serialize structurally only for true invariants. Use when writing concurrent/parallel code or adding locks.
Author, run, pause, resume, and recover dependency-graph (DAG) wave and multi-stage concurrent Python/shell workflows with durable SQLite checkpointing using orchestral (Orchestral, dependencies, execution_order, pause/resume, workflow_id, branch-aware skipping, fail_fast, streaming waves). Use for parallel build/test/benchmark DAGs and resumable automation.
Build a small throwaway mockup, script, or demo so the person can try a design or idea before full implementation, proactively. Use whenever showing beats describing.
Verify claims against the real artifact (not proxies) with deterministic reproduction, empirically measured occurrence frequency (from logs, traces, telemetry, monitoring, metrics, or usage analytics), trust-ladder ranking, and runnable proof. Use before calling work done or reporting/challenging any claim.
Identify structural friction in a codebase (starting where code changes most), propose ranked restructurings with before-and-after diagrams, and execute the top pick via dagify. Use when code is getting harder to change or test, or when improving architecture.
Research a question across internal sources (code, logs, data, docs) and external sources (specs, papers, official docs, web), verify quotes against their citations, and grade each finding A–F. Use before unsettled decisions, before accepting a functionality trade-off, or when claims need graded evidence.
Resume suspended (PAUSED) taskex runs/schedules and orchestral workflows/steps in place, or recover failed, cancelled, or crashed taskex and orchestral runs from durable SQLite checkpoints without duplicating completed work. Use when unpausing or restarting interrupted automation.
Check the user's message, repo docs/code/history, local environment, and official tool docs before asking questions or claiming to be blocked. Use before asking the person anything.
Restate the goal, problem, user-visible done-when, exclusions, and assumptions in short checkable lines before starting. Use before planning or whenever a request is ambiguous.
Make state-changing operations idempotent and crash-recoverable so rerunning or stopping halfway still ends in the right state. Use when writing or reviewing commands, migrations, deploy steps, jobs, or retries.
Diagram a system's states, triggers, conditions, failure paths, and observed probabilities in Mermaid stateDiagram-v2. Use for debugging, onboarding, design, planning, or reviews.
Trim unnecessary code and complexity from recent changes or code under review while keeping correctness, edge cases, and performance intact. Use after implementation, before review, or during review.
Provision, mount, snapshot, clone, merge, land, and clean up isolated in-memory VFS workspaces using Slates (https://github.com/hyper-light/slates)—preferred over git worktrees when available for concurrent worker implementation lanes, parallel variants, and read-only reviewer verification workspaces. Use whenever isolating agent workspaces or checking whether Slates is available.
Cleanly suspend (pause) running taskex callables, POSIX shell process groups, recurring schedules, or orchestral workflows and individual DAG steps without losing progress or tripping timeouts. Use when pausing active automation for maintenance, backpressure, or human review.
Research prior art, build competing implementations in parallel isolated Slates VFS volumes (preferred when available) or git worktrees, benchmark them, graft winning parts from losing variants into the winner, and delete the rest. Use when no single best design is obvious.
Explain an unfamiliar concept, design, or result clearly on the first read using proper domain terms, a Mermaid diagram, a worked example, and a short analogy. Use when introducing unfamiliar concepts or translating everyday descriptions into field terms.
Author, run, and manage tracked async/sync Python callables, shell commands, background watchers, recurring schedules, durable SQLite checkpoints, and live/crash-resumable pause-resume jobs using taskex (TaskRunner). Use for async tasks, watchers, or resumable Python automation.
Write clear, concrete, verified technical documentation (READMEs, guides, API refs, ADs, runbooks) with real examples and zero fluff. Use when writing or revising docs.
Create or update a project-local drive-<app> skill that launches the real app, exercises user flows, and captures proof (screenshots, transcripts, logs). Use to verify real user behavior or fix a stale drive skill.
Keep tests asserting user-observable behavior with independent oracles, typed error checks (not error prose), determinism, red-first checks, and no bad tests. Use when writing, reviewing, or fixing flaky tests.
Create and maintain issues for lanes in the project's tracker (GitHub, Jira, Linear, etc.) without duplicates, updating states on events and closing with proof. Run by the lead when tracking is requested.
Rewrite the last message so it leads with the bottom line and cuts jargon, internal state, and meta-commentary while preserving facts and numbers. Use when someone says /wat.
Take reviewed code through its PR/MR on GitHub, GitLab, or Bitbucket using the shipped good-citizen watchers (astack-watch-pr, astack-watch-github, astack-watch-gitlab, astack-watch-bitbucket): monitor CI, review comments/change requests, rebase needs, and 24h reminders; dispatch workers with vectored review and /leave-feedback audited replies; never self-merge. Use once review clears or when taking over a PR/MR.
Author, configure, run, and manage modular DAG workflows with werkflow and werkflow-modules (Workflow, WorkflowGroup, @step, @requires, CLI flags, and all 15 modules). Use for sophisticated scripted pipelines and multi-system automation.
Single-pane-of-glass catch-up and context rebuild after a break, restart, or compaction: waiting decisions, bugs/regressions, features/fixes/milestones, hypotheses/experiments/research proved or disproved, and active work. Use for $whatsup or when catching up on a project.
Turn a /dagify task graph into a self-running, crash-resumable workflow (using taskex, orchestral, werkflow + werkflow-modules, CI, or native runners) with explicit task states and typed outcomes. Use when planned work should run or recur unattended.
Push back with solid evidence on a review comment that is unproven, unreproducible, already handled by surrounding systems, or not worth its cost. Use before changing code for a questionable review point.
Keep one code path per job: migrate callers and delete legacy paths, shims, adapters, aliases, and dead flags together unless explicitly requested. Use when replacing code, reviewing changes, or cleaning up.