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/landing.ts
View on GitHubimport { WatcherQueryError } from "./github.ts";
import { parsePrNumber, type PrContext } from "./types.ts";
export interface LandingRevision {
readonly context: PrContext;
readonly headRefOid: string;
readonly baseRefName: string;
readonly baseRefOid: string;
}
function invalid(detail: string): never {
throw new WatcherQueryError({
kind: "missing-field",
retryable: true,
detail,
});
}
export function object(value: unknown, label: string): Record<string, unknown> {
if (typeof value !== "object" || value === null || Array.isArray(value))
invalid(`${label} must be an object`);
return value as Record<string, unknown>;
}
export function text(value: unknown, label: string): string {
if (typeof value !== "string" || value.length === 0)
invalid(`${label} must be a non-empty string`);
return value;
}
export const nullableText = (value: unknown, label: string): string | null =>
value === null ? null : text(value, label);
export function baseRefTargetOid(value: unknown): string | null {
if (value === null) return null;
const baseRef = object(value, "baseRef");
if (baseRef.target === null) return null;
const target = object(baseRef.target, "baseRef.target");
return nullableText(target.oid, "baseRef.target.oid");
}
export function oneOf<const V extends readonly string[]>(
value: unknown,
values: V,
label: string
): V[number] {
for (const candidate of values) if (candidate === value) return candidate;
return invalid(`missing or invalid ${label}`);
}
export function flag(value: unknown, label: string): boolean {
if (typeof value !== "boolean") invalid(`missing ${label}`);
return value;
}
export function parseContext(value: unknown): PrContext {
const fields = object(value, "PR context");
const owner = text(fields.owner, "owner");
const repo = text(fields.repo, "repo");
if (!/^[\w.-]+$/.test(owner) || !/^[\w.-]+$/.test(repo))
invalid("owner and repo must be individual repository names");
return { owner, repo, number: parsePrNumber(fields.number) };
}
export function parseLandingRevision(value: unknown): LandingRevision {
const fields = object(value, "landing revision");
return {
context: parseContext(fields.context),
headRefOid: text(fields.headRefOid, "headRefOid"),
baseRefName: text(fields.baseRefName, "baseRefName"),
baseRefOid: text(fields.baseRefOid, "baseRefOid"),
};
}
export function landingRevision(source: LandingRevision): LandingRevision {
const { context, headRefOid, baseRefName, baseRefOid } = source;
return { context, headRefOid, baseRefName, baseRefOid };
}
export function sameLandingRevision(
a: LandingRevision,
b: LandingRevision
): boolean {
return (
a.context.owner.toLowerCase() === b.context.owner.toLowerCase() &&
a.context.repo.toLowerCase() === b.context.repo.toLowerCase() &&
a.context.number === b.context.number &&
a.headRefOid === b.headRefOid &&
a.baseRefName === b.baseRefName &&
a.baseRefOid === b.baseRefOid
);
}
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 |