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/run-scope.test.ts

View on GitHub
import '../../../test/no-real-gh.preload.ts';
import { describe, expect, it, spyOn } from 'bun:test';
import { RunScope } from './run-scope.ts';
import { Carving } from './carving.ts';
import { placeByFacts } from './board-writer.ts';
import { selectForAppraisal } from '../../appraise-github-issues/lib/appraise.ts';
import { FakeTracker, fakeIssue } from '../../carve-github-issue/lib/fake-tracker.ts';
import { CARVE_DEFAULTS } from '../../carve-github-issue/lib/carve.ts';
import { readTree } from '../../carve-github-issue/lib/tree.ts';
import { refusal } from '../../carve-github-issue/lib/claims.ts';
import type { Context } from '../../fix-github-issue/lib/context.ts';

// Children precede their parents, and a selected leaf belongs to an unrelated tree.
function tree() {
  return new FakeTracker('bot', [
    fakeIssue(12, { parentNumber: 11 }),
    fakeIssue(11, { parentNumber: 10, subIssues: [12], labels: [{ name: 'size: 8' }] }),
    fakeIssue(13, { parentNumber: 10, labels: [{ name: 'needs-human' }] }),
    fakeIssue(14, { parentNumber: 10, labels: [{ name: 'size: 2' }], blockedBy: { nodes: [{ number: 20, state: 'OPEN', stateReason: null }] } }),
    fakeIssue(10, { subIssues: [11, 13, 14], labels: [{ name: 'size: 8' }] }),
    fakeIssue(21, { parentNumber: 20 }),
    fakeIssue(22, { parentNumber: 20 }),
    fakeIssue(20, { subIssues: [21, 22], labels: [{ name: 'size: 8' }] }),
  ]);
}
const facts = (io: FakeTracker) => [...io.issues.keys()].map(n => io.view(n)!);
const numbers = (items: { number: number }[]) => items.map(i => i.number).sort((a, b) => a - b);

describe('restricted descendant scope', () => {
  it('retains roots, deduplicates refreshes, and admits new descendants independently of ordering', () => {
    const io = tree();
    const roots = new Set([10, 21]);
    const scope = new RunScope(roots);
    const shared = scope.effective;
    roots.add(20);
    expect(scope.refresh(facts(io)).sort((a, b) => a - b)).toEqual([11, 12, 13, 14]);
    expect([...scope.roots!]).toEqual([10, 21]);
    expect(scope.refresh(facts(io))).toEqual([]);
    io.issues.set(15, fakeIssue(15, { parentNumber: 12 }));
    io.issues.set(23, fakeIssue(23, { parentNumber: 22 }));
    expect(scope.refresh(facts(io))).toEqual([15]);
    expect(scope.refresh(facts(io).reverse())).toEqual([]);
    expect(scope.effective).toBe(shared);
    expect([...shared!].sort((a, b) => a - b)).toEqual([10, 11, 12, 13, 14, 15, 21]);
  });

  it('terminates on cycles and does not admit disconnected cycles', () => {
    const scope = new RunScope([1]);
    expect(scope.refresh([{ number: 1, parent: { number: 2 } }, { number: 2, parent: { number: 1 } }, { number: 3, parent: { number: 4 } }, { number: 4, parent: { number: 3 } }])).toEqual([2]);
  });

  it('leaves unrestricted mode and its age filter unchanged', () => {
    const scope = new RunScope(null);
    expect(scope.refresh(facts(tree()))).toEqual([]);
    expect(scope.roots).toBeNull();
    expect(scope.effective).toBeNull();
    const old = [{ number: 30, title: 'old', labels: [], createdAt: '2000-01-01' }];
    expect(selectForAppraisal(old, { ageDays: 1, skipLabels: [] }, { allAges: scope.effective !== null })).toEqual([]);
  });

  it('shares placement and appraisal membership without lifting holds or dependencies', () => {
    const io = tree();
    const scope = new RunScope([10, 21]);
    scope.refresh(facts(io));
    const scoped = facts(io).filter(i => scope.effective!.has(i.number));
    expect(numbers(scoped)).toEqual([10, 11, 12, 13, 14, 21]);
    const placement = scoped.map(issue => ({ issue, ...placeByFacts({
      state: 'OPEN', labels: issue.labels.map(l => l.name), pulls: [], ceiling: 3,
      points: issue.number === 14 ? 2 : undefined,
      openChildren: issue.subIssuesSummary!.total > issue.subIssuesSummary!.completed,
      blocked: Boolean(issue.blockedBy?.nodes.length),
    }) }));
    const inbox = placement.filter(p => p.lane === 'A1').map(p => p.issue);
    expect(numbers(selectForAppraisal(inbox, { ageDays: 1, skipLabels: ['needs-human'] }, { allAges: scope.effective !== null }))).toEqual([12, 21]);
    expect(placement.find(p => p.issue.number === 13)!.lane).toBe('H2');
    expect(placement.find(p => p.issue.number === 14)!.lane).not.toBe('B1');
    const ctx = { botLogin: 'bot' } as Context;
    expect(refusal(readTree(ctx, 13, io), 3)).toContain('needs-human');
    expect(refusal(readTree(ctx, 14, io), 3)).toContain('blocked by #20');
  });

  it('uses the shared effective set in the real carving sweep', async () => {
    const io = tree();
    const scope = new RunScope([10, 21]);
    const ctx = { botLogin: 'bot', runId: 'scope-test', io, dryRun: true } as unknown as Context;
    const driver = new Carving({
      ctx, only: scope.effective, ageDays: 1,
      knobs: { ...CARVE_DEFAULTS, ceiling: 3, callbacksDir: '', seats: { carver: { engine: 'fixture' }, confirmer: { engine: 'fixture2' } } },
      appraisal: { seats: { appraiser: { engine: 'fixture' }, confirmer: { engine: 'fixture2' } }, confirmCloses: true, skipLabels: [], maxAppraiseAttempts: 1, sizeCallbackTimeoutMinutes: 1 },
      mark: () => {}, log: () => {},
    });
    const visits: number[] = [];
    const visit = spyOn(driver, 'revisit').mockImplementation(async n => { visits.push(n); });
    try {
      scope.refresh(facts(io));
      await driver.sweep(facts(io));
      expect(visits.sort((a, b) => a - b)).toEqual([10, 11]);
      expect(io.writes).toEqual([]);
    } finally { visit.mockRestore(); }
  });
});
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: 471kUpdated 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