michael-denyer/pstack-claude / plugins/pstack/skills/poteto-mode
poteto-mode
Verifiedpoteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.
scripts/watch-pr/shipping.test-helper.ts
View on GitHub// The slice of GitHub's GraphQL schema the shipping service depends on: the
// one required input field of each mutation, and the pull request field the
// mutation clears. Regenerate the input names with
// gh api graphql -f query='{ __type(name:"DequeuePullRequestInput") { inputFields { name } } }'
const MUTATIONS: Record<string, { input: string; clears: string }> = {
disablePullRequestAutoMerge: {
input: "pullRequestId",
clears: "autoMergeRequest",
},
dequeuePullRequest: { input: "id", clears: "mergeQueueEntry" },
};
const MUTATION =
/mutation\s*\w*\s*\(\s*\$id\s*:\s*ID!\s*\)\s*\{\s*(\w+)\(\s*input\s*:\s*\{\s*(\w+)\s*:\s*\$id\s*\}\s*\)/;
/**
* Answer one `gh api graphql` call the way GitHub would.
*
* A query returns only the pull request fields it selects. A mutation is
* refused unless it declares `$id` as `ID!`, names a known mutation and its
* required input field, and carries this pull request's node id.
*/
export function fakeGitHub(
pullRequest: Record<string, unknown>,
argv: readonly string[]
): { data: Record<string, unknown> } {
const query = argv.find((arg) => arg.startsWith("query=")) ?? "";
if (!query.includes("mutation")) {
// Drop nested selections, so `mergeQueueEntry { id }` does not count as
// selecting the pull request's own `id`.
const selection = query.replace(/\{[^{}]*\}/g, "");
const selected = Object.entries(pullRequest).filter(([field]) =>
new RegExp(`\\b${field}\\b`).test(selection)
);
return {
data: { repository: { pullRequest: Object.fromEntries(selected) } },
};
}
const [, name = "", input = ""] = MUTATION.exec(query) ?? [];
const contract = MUTATIONS[name];
if (!contract) throw new Error(`not a mutation GitHub accepts: ${query}`);
if (input !== contract.input)
throw new Error(`${name} input requires ${contract.input}, got ${input}`);
if (!argv.includes(`id=${pullRequest.id}`))
throw new Error("Could not resolve to a node with the given id");
pullRequest[contract.clears] = null;
return { data: { [name]: { clientMutationId: null } } };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |