Skip to content

BuilderIO/agent-native / .agents/skills/github-refactor-findings

github-refactor-findings

Verified

The GitHub issues tracker for refactor findings: issues labeled refactor-findings in the fragility repo, with the plan in the body. Read when fragility-common/config.json sets tracker to github and you need to know how findings map onto issues, or when changing that mapping.

FileKindSize
SKILL.mdskill md2.2 KB
config.jsonconfig92 B
scripts/github.tsscript11.4 KB
scripts/tracker.tsscript2.7 KB

scripts/tracker.ts

View on GitHub
// The GitHub tracker for fragility-common's findings scripts: gh auth, write
// access to the repo, and the label.
import { commonConfig } from "../../fragility-common/lib/cli.ts";
import type { Check } from "../../fragility-common/lib/doctor.ts";
import type { Tracker } from "../../fragility-common/lib/findings.ts";
import {
  APPROVAL_LABEL,
  gh,
  GitHubIssues,
  loadGitHubConfig,
  parseIssueKey,
} from "./github.ts";

export function createTracker(): Tracker {
  return new GitHubIssues();
}

export function ticketUrl(key: string): string {
  return `https://github.com/${commonConfig().repo}/issues/${key.replace(/^#/, "")}`;
}

export const parseKey = parseIssueKey;

export function doctorChecks(): Check[] {
  const { repo } = commonConfig();
  const { label } = loadGitHubConfig();
  return [
    {
      name: "github-auth",
      run: () => `authenticated as ${gh(["user", "--jq", ".login"]).trim()}`,
    },
    {
      name: "github-issues-access",
      run: () => {
        const out = gh([
          `repos/${repo}`,
          "--jq",
          "[.has_issues, (.permissions.triage // false), (.permissions.push // false)] | @csv",
        ]).trim();
        const [hasIssues, triage, push] = out.split(",");
        if (hasIssues !== "true")
          throw new Error(`${repo} has issues turned off`);
        if (triage !== "true" && push !== "true")
          throw new Error(
            `this token can't label or close issues in ${repo} (needs triage or write)`,
          );
        return `can file and label issues in ${repo}`;
      },
    },
    {
      name: "github-label",
      run: () => {
        try {
          gh([`repos/${repo}/labels/${encodeURIComponent(label)}`, "--silent"]);
        } catch (error) {
          if (/HTTP 404/.test((error as Error).message))
            throw new Error(
              `label ${label} doesn't exist; create it with: gh label create ${label} -R ${repo} --description "Fragile-systems refactor plans"`,
            );
          throw error;
        }
        return `label ${label} exists in ${repo}`;
      },
    },
    {
      name: "github-approval-label",
      run: () => {
        try {
          gh([
            `repos/${repo}/labels/${encodeURIComponent(APPROVAL_LABEL)}`,
            "--silent",
          ]);
        } catch (error) {
          if (/HTTP 404/.test((error as Error).message))
            throw new Error(
              `label ${APPROVAL_LABEL} doesn't exist; bug-derived plans can't be filed without it. Create it with: gh label create ${APPROVAL_LABEL} -R ${repo} --description "Bug-derived plan awaiting member approval"`,
            );
          throw error;
        }
        return `label ${APPROVAL_LABEL} exists in ${repo}`;
      },
    },
  ];
}
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall