Skip to content

simiancraft/simiancraft-skills / skills/burn-down-github-issues

burn-down-github-issues

Unverified

Run an unattended burndown of a GitHub issue backlog as cards on a per-operator GitHub Projects board whose lanes are an explicit state machine: appraise and size the inbox, carve what is over the ceiling, fix the ready ones in parallel git worktrees, prove each fix on a draft pull request, have an isolated second-engine reviewer judge it, land one branch at a time with freshness checks, and dead-letter per phase whatever a machine cannot finish. Use when the task is "work the backlog unattended", "triage and fix recent issues", "run the issue loop", "burn down issues", or "where is issue N on the board". Requires a per-repository burn-down-github-issues.config.ts at the target repo's root (the loop refuses to start without it), the prove-work-on-github skill, the codex and claude CLIs for the default seats, and a gh token with the project scope for the board. Skip for one-off fixes to a known issue you are already working interactively, and for backlogs whose issues are mostly product decisions rather than code.

FileKindSize
SKILL.mdskill md17.0 KB
board.tsscript6.5 KB
callbacks/README.mdmarkdown1.1 KB
callbacks/on-size-over-ceilingother843 B
card.tsscript4.3 KB
chart-machine.tsscript3.9 KB
claim-race.tsscript6.1 KB
export-machine.tsscript1.8 KB
lanes.tsscript5.2 KB
lib/admission.test.tsscript7.6 KB
lib/admission.tsscript5.5 KB
lib/board-writer.test.tsscript3.6 KB
lib/board-writer.tsscript11.8 KB
lib/carving-revisit.test.tsscript7.5 KB
lib/carving.tsscript26.9 KB
lib/floor/config.test.tsscript456 B
lib/floor/config.tsscript8.1 KB
lib/floor/floor.test.tsscript9.9 KB
lib/floor/floor.tsscript28.7 KB
lib/floor/incident.tsscript11.2 KB
lib/floor/ledger.tsscript5.6 KB
lib/floor/probe.tsscript3.6 KB
lib/lanes.tsscript4.4 KB
lib/machine.test.tsscript11.2 KB
lib/machine.tsscript52.4 KB
lib/place-callbacks.test.tsscript2.5 KB
lib/place-callbacks.tsscript3.0 KB
lib/preflight.test.tsscript4.5 KB
lib/preflight.tsscript1.2 KB
lib/pressure.test.tsscript56.9 KB
lib/refs.test.tsscript1010 B
lib/refs.tsscript1.9 KB
lib/run-scope.test.tsscript5.4 KB
lib/run-scope.tsscript1.2 KB
lib/scenarios.test.tsscript17.1 KB
lib/simulate.test.tsscript7.3 KB
lib/simulate.tsscript7.0 KB
lib/world-sweep.test.tsscript21.4 KB
loop.source.test.tsscript4.8 KB
loop.tsscript66.2 KB
prompts/diagnose.mdmarkdown2.1 KB
prompts/walk.mdmarkdown3.6 KB
references/adopting.mdmarkdown26.3 KB
references/architecture.mdmarkdown20.7 KB
references/floor.mdmarkdown14.6 KB
references/operating.mdmarkdown19.6 KB
references/state-machine.mdmarkdown31.1 KB
status.tsscript4.9 KB
watch.tsscript6.4 KB

lib/simulate.test.ts

View on GitHub
import { describe, expect, it } from 'bun:test';
import { LANES } from './lanes.ts';
import { MACHINE, transitions, walk } from './machine.ts';
import { atoms, fire, laneKey, laneState, Leak, settle, successors } from './simulate.ts';

/**
 * Lane sequences the real driver wrote to its logs, per issue, from real runs; issue numbers are
 * renumbered. They were recorded while one worker turn both coded and proved, so the driver logged
 * Coding or Sent back and then Ready for review; D2 is written in where the prover's own turn now sits.
 */
const RECORDED: Array<{ run: string; issue: number; lanes: string }> = [
  { run: 'stage 1, one issue', issue: 101, lanes: 'D1 D2 E1 E2 F1 F3 F4 F5 T1' },
  { run: 'stage 2, loop', issue: 102, lanes: 'D1 D2 E1 E2 F1 F3 F4 F5 T1' },
  { run: 'stage 2, fix.ts, boundary park', issue: 103, lanes: 'A1 D1 D2 E1 E2 F1 H3' },
  { run: 'stage 3, boundary park', issue: 104, lanes: 'D1 D2 E1 E2 F1 H3' },
  { run: 'stage 3, base moved into the work', issue: 105, lanes: 'D1 D2 E1 E2 F1 F2 E1 E2 F1 F3 F4 F5 T1' },
  { run: 'stage 3, appraised then worked', issue: 106, lanes: 'A2 B1 D1 D2 E1 E2 F1 F3 F4 F5 T1' },
  { run: 'redrive from the review dead letters', issue: 107, lanes: 'Q4 D4 D2 E1 E2 F1 F2 E1 E2 F1 F3 F4 F5 T1' },
  { run: 'redrive from parked, base moved', issue: 104, lanes: 'H3 F2 D4 D2 E1 E2 F1 F3 F4 F5 T1' },
];

describe('the machine leaks no card', () => {
  it('settles every transition under the facts that enable it', () => {
    const leaks: string[] = [];
    for (const { from, event, transition } of transitions()) {
      const enabling = new Set(atoms(transition.guard));
      try {
        settle(transition.target, enabling);
      } catch (error) {
        if (error instanceof Leak) leaks.push(`${from} on ${event}: ${error.message}`);
        else throw error;
      }
    }
    expect(leaks).toEqual([]);
  });

  it('rests every card in a lane or the final state, never in a compound or transient state', () => {
    const lanes = new Set(LANES.map((l) => l.state));
    const strays: string[] = [];
    for (const { from, event, transition } of transitions()) {
      const rest = settle(transition.target, new Set(atoms(transition.guard))).state;
      if (!lanes.has(rest) && rest !== 'ticket.offBoard' && !rest.startsWith('line.')) strays.push(`${from} on ${event} rests in ${rest}`);
    }
    expect(strays).toEqual([]);
  });

  it('has no orphan lane: every lane is some lane\'s successor, or a reconcile placement', () => {
    const reached = new Set<string>();
    for (const lane of LANES) for (const next of successors(lane.state).keys()) reached.add(next);
    const orphans = LANES.filter((l) => !reached.has(l.state)).map((l) => l.key);
    expect(orphans).toEqual([]);
  });
});

describe('every event, in every lane, under every combination of facts', () => {
  const NODES = new Map(walk(MACHINE));
  // Facts a transient state reads while a target settles; tried all false and all true.
  const settling = [...NODES.values()].flatMap((node) => (node.always ?? []).flatMap((t) => atoms(t.guard)));
  /** The events a lane answers, itself or through an ancestor, with every fact their guards read. */
  const eventsOf = (state: string) => {
    const events = new Map<string, Set<string>>();
    const parts = state.split('.');
    for (let depth = parts.length; depth >= 1; depth--) {
      for (const [event, raw] of Object.entries(NODES.get(parts.slice(0, depth).join('.'))?.on ?? {})) {
        const names = events.get(event) ?? new Set<string>();
        for (const t of Array.isArray(raw) ? raw : [raw]) for (const name of atoms(t.guard)) names.add(name);
        events.set(event, names);
      }
    }
    return events;
  };
  const valuations = (names: string[]) => Array.from({ length: 1 << names.length }, (_, mask) => names.filter((_, i) => mask & (1 << i)));

  it('never leaks a card', () => {
    const leaks: string[] = [];
    let fired = 0;
    for (const lane of LANES) {
      for (const [event, names] of eventsOf(lane.state)) {
        for (const facts of valuations([...names])) {
          for (const extra of [[], settling]) {
            fired += 1;
            try {
              fire(lane.state, event, new Set([...facts, ...extra]));
            } catch (error) {
              if (!(error instanceof Leak)) throw error;
              leaks.push(`${lane.key} on ${event} [${facts.join(', ')}]: ${error.message}`);
            }
          }
        }
      }
    }
    expect(leaks).toEqual([]);
    expect(fired).toBeGreaterThan(2000);
  });

  it('never drops what a machine reports: a result or a failure always moves the card or rests it on purpose', () => {
    // A dispatch may be refused (the line is paused) and the card waits where it is. A report
    // may not: an agent's verdict, a gate's result, and a failure each have a last branch with no
    // guard, so an answer nobody anticipated is settled as a failure instead of stranding the card.
    const REPORTS = ['APPRAISED', 'CONFIRMED', 'KNIFE_VERDICT', 'CUT_DISPUTED', 'REVISITED', 'WORKER_VERDICT', 'REVIEWED', 'CAUGHT_UP', 'CHECKS', 'SMOKE', 'BASE_MOVED_WHILE_WAITING', 'TRIAGED', 'AGENT_FAILED'];
    const dropped: string[] = [];
    for (const lane of LANES) {
      for (const [event, names] of eventsOf(lane.state)) {
        if (!REPORTS.includes(event)) continue;
        for (const facts of valuations([...names])) {
          if (fire(lane.state, event, new Set(facts)) === null) dropped.push(`${lane.key} drops ${event} under [${facts.join(', ')}]`);
        }
      }
    }
    expect(dropped).toEqual([]);
  });
});

describe('the landing is single file and checks upstream', () => {
  const predecessors = (key: string) =>
    LANES.filter((l) => l.key !== key && successors(l.state, { ownEventsOnly: true }).has(laneState(key)))
      .map((l) => l.key)
      .sort();

  it('reaches Merging only from Checks pending or Smoke', () => {
    expect(predecessors('F5')).toEqual(['F3', 'F4']);
  });
  it('reaches Checks pending only from Approved or Catching up', () => {
    expect(predecessors('F3')).toEqual(['F1', 'F2']);
  });
  it('starts a review only from Ready for review, and only on a lane that holds the base', () => {
    expect(predecessors('E2')).toEqual(['E1']);
    expect(laneKey(fire(laneState('E1'), 'REVIEWER_DISPATCHED', new Set(['behindBase']))?.state ?? '')).toBe('F2');
    expect(laneKey(fire(laneState('E1'), 'REVIEWER_DISPATCHED', new Set())?.state ?? '')).toBe('E2');
  });
  it('never takes an approved card to the merge while it is behind the base', () => {
    expect(laneKey(fire(laneState('F1'), 'FRONT_OF_QUEUE', new Set(['behindBase']))?.state ?? '')).toBe('F2');
  });
});

describe('the driver only makes moves the machine allows', () => {
  it('never takes a card from Coding or Sent back to review without a proving turn between', () => {
    for (const from of ['D1', 'D4']) expect(successors(laneState(from), { ownEventsOnly: true }).has(laneState('E1'))).toBe(false);
  });

  for (const { run, issue, lanes } of RECORDED) {
    it(`#${issue}, ${run}: ${lanes}`, () => {
      const keys = lanes.split(' ');
      const illegal: string[] = [];
      for (let i = 0; i + 1 < keys.length; i++) {
        const next = successors(laneState(keys[i]), { ownEventsOnly: true });
        if (!next.has(laneState(keys[i + 1]))) illegal.push(`${keys[i]} -> ${keys[i + 1]}`);
      }
      expect(illegal).toEqual([]);
    });
  }
});
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall