Skip to content

michael-denyer/pstack-claude / plugins/pstack/skills/poteto-mode

poteto-mode

Verified

poteto'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.

FileKindSize
SKILL.mdskill md18.1 KB
playbooks/authoring-a-skill.mdmarkdown852 B
playbooks/autonomous-run.mdmarkdown1.9 KB
playbooks/autopilot-full.mdmarkdown8.3 KB
playbooks/autopilot-stack.mdmarkdown1.3 KB
playbooks/babysit.mdmarkdown2.3 KB
playbooks/bug-fix.mdmarkdown4.8 KB
playbooks/eval.mdmarkdown2.8 KB
playbooks/feature.mdmarkdown3.4 KB
playbooks/hillclimb.mdmarkdown4.4 KB
playbooks/investigation.mdmarkdown920 B
playbooks/multi-phase-plan.mdmarkdown1.6 KB
playbooks/opening-a-pr.mdmarkdown1.0 KB
playbooks/pause-safely.mdmarkdown1.9 KB
playbooks/perf-issue.mdmarkdown1.5 KB
playbooks/prototype.mdmarkdown2.1 KB
playbooks/refactoring.mdmarkdown3.3 KB
playbooks/runtime-forensics.mdmarkdown1.3 KB
playbooks/session-pickup.mdmarkdown2.7 KB
playbooks/shipping.mdmarkdown7.2 KB
playbooks/trace-forensics.mdmarkdown1.8 KB
playbooks/visual-parity.mdmarkdown1.2 KB
playbooks/worktree-cleanup.mdmarkdown4.5 KB
references/agents/comment-sicko.mdmarkdown2.9 KB
references/agy-tools.mdmarkdown10.3 KB
references/bugbot-triage.mdmarkdown9.4 KB
references/codex-tools.mdmarkdown13.6 KB
references/copilot-tools.mdmarkdown20.6 KB
references/grok.mdmarkdown3.9 KB
references/kimi-tools.mdmarkdown4.6 KB
references/licenses/LICENSEother1.1 KB
references/licenses/LICENSE-cursor-team-kitother1.0 KB
references/licenses/LICENSE-thermosother1.0 KB
references/licenses/NOTICE.mdmarkdown1.9 KB
references/merge-safety.mdmarkdown5.2 KB
references/minimax-tools.mdmarkdown10.2 KB
references/muse-tools.mdmarkdown12.5 KB
references/omp-tools.mdmarkdown5.7 KB
references/opencode-tools.mdmarkdown3.3 KB
references/pi-tools.mdmarkdown23.5 KB
references/resume-storage.mdmarkdown3.6 KB
scripts/.prettierignoreother652 B
scripts/.prettierrc.jsonconfig29 B
scripts/bootstrap.tsscript2.0 KB
scripts/bun.lockother6.5 KB
scripts/check-playbooks.mjsscript6.8 KB
scripts/codex-session-effort.mjsscript3.9 KB
scripts/package.jsonmanifest320 B
scripts/resume.mjsscript7.2 KB
scripts/tsconfig.jsonconfig304 B
scripts/watch-pr/check-suites.tsscript1.6 KB
scripts/watch-pr/cli.test.tsscript11.2 KB
scripts/watch-pr/cli.tsscript8.1 KB
scripts/watch-pr/deadline.tsscript522 B
scripts/watch-pr/fakes.test-helper.tsscript4.2 KB
scripts/watch-pr/fresh-install.test.tsscript1.3 KB
scripts/watch-pr/github.port.test.tsscript19.0 KB
scripts/watch-pr/github.test.tsscript16.6 KB
scripts/watch-pr/github.tsscript34.0 KB
scripts/watch-pr/head-checks.tsscript986 B
scripts/watch-pr/integrity.test.tsscript24.3 KB
scripts/watch-pr/landing.tsscript3.0 KB
scripts/watch-pr/live-merge-safety.mjsscript7.4 KB
scripts/watch-pr/policy.port.test.tsscript25.3 KB
scripts/watch-pr/policy.test.tsscript14.8 KB
scripts/watch-pr/policy.tsscript29.2 KB
scripts/watch-pr/render.tsscript9.0 KB
scripts/watch-pr/ship-prexecutablescript220 B
scripts/watch-pr/shipping-cli.test.tsscript5.3 KB
scripts/watch-pr/shipping-cli.tsscript2.3 KB
scripts/watch-pr/shipping.test-helper.tsscript2.1 KB
scripts/watch-pr/shipping.test.tsscript11.0 KB
scripts/watch-pr/shipping.tsscript6.7 KB
scripts/watch-pr/transport.test.tsscript13.4 KB
scripts/watch-pr/tsconfig.jsonconfig270 B
scripts/watch-pr/types.compile.tsscript2.6 KB
scripts/watch-pr/types.tsscript14.4 KB
scripts/watch-pr/watch-prexecutablescript211 B
scripts/watch-pr/wrapper.test.tsscript587 B
scripts/worktree-audit.mjsexecutablescript22.4 KB
worker.mdmarkdown1.3 KB

scripts/resume.mjs

View on GitHub
#!/usr/bin/env node
import { execFileSync } from 'node:child_process';
import { createHash, randomUUID } from 'node:crypto';
import { lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
import { parseArgs } from 'node:util';

function git(project, ...args) {
  return execFileSync('git', ['-C', project, ...args], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
}
function identity(project) {
  return {
    worktree: realpathSync(git(project, 'rev-parse', '--show-toplevel')),
    gitDir: realpathSync(git(project, 'rev-parse', '--path-format=absolute', '--git-common-dir')),
  };
}
function inside(root, file) {
  const path = relative(root, file);
  return path === '' || (!isAbsolute(path) && path !== '..' && !path.startsWith(`..${sep}`));
}
function string(value, name) {
  if (typeof value !== 'string' || !value) throw new Error(`missing ${name}`);
  return value;
}
function object(value, name) {
  if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`invalid ${name}`);
  return value;
}
function fileInfo(path, roots) {
  const canonical = realpathSync(path);
  if (!roots.some(root => inside(root, canonical)) || !statSync(canonical).isFile())
    throw new Error(`checkpoint file must belong to this project: ${path}`);
  return { path: canonical, sha256: createHash('sha256').update(readFileSync(canonical)).digest('hex') };
}
function verifyFile(value, roots) {
  const record = object(value, 'file record');
  const file = fileInfo(string(record.path, 'file path'), roots);
  if (file.sha256 !== string(record.sha256, 'file digest')) throw new Error(`checkpoint file changed: ${file.path}`);
  return file;
}
const linkRule = 'Link each local file with an inline Markdown link whose destination is the path, written bare or as `<path>`, with no square brackets in the link text and no title after the path. Reference-style links are not read. The path is relative to the note or absolute, and it is percent-decoded, so write a literal `%` as `%25`. Wrap a path that contains spaces or parentheses in angle brackets, or percent-encode it. Links inside code spans and fenced code blocks are ignored.';
function resolveLink(note, link, target) {
  let decoded;
  try { decoded = decodeURIComponent(target.split('#')[0]); }
  catch { throw new Error(`link ${link} has malformed percent-encoding. ${linkRule}`); }
  try { return realpathSync(resolve(dirname(note.path), decoded)); }
  catch (error) { throw new Error(`link ${link} does not resolve (${error.code}). ${linkRule}`); }
}
function verifyLinks(note, artifacts) {
  const prose = readFileSync(note.path, 'utf8')
    .replace(/^\uFEFF/, '')
    .replaceAll('\r\n', '\n')
    .replace(/^ {0,3}((`|~)\2{2,}).*\n[\s\S]*?(?:^ {0,3}\1\2*[ \t]*$|(?![\s\S]))/gm, ' ')
    .replace(/(?<!`)(`+)(?!`)[\s\S]*?(?<!`)\1(?!`)/g, ' ');
  const links = [...prose.matchAll(/\[[^\]]*\]\((?:<([^<>]+)>|([^)]+))\)/g)]
    .filter(([, angled, bare]) => !/^(?:[a-z]{2,}:|#)/i.test(angled ?? bare))
    .map(([link, angled, bare]) => ({ link, path: resolveLink(note, link, angled ?? bare) }));
  for (const artifact of artifacts)
    if (!links.some(({ path }) => path === artifact.path))
      throw new Error(`note must link requested artifact: ${artifact.path}. ${linkRule}`);
  for (const { link, path } of links)
    if (path !== note.path && !artifacts.some(artifact => artifact.path === path))
      throw new Error(`register every local note link with --artifact: ${link} resolves to ${path}. ${linkRule}`);
}
function load(store, project) {
  const pointer = join(store, 'latest.json');
  fileInfo(pointer, [store]);
  const record = object(JSON.parse(readFileSync(pointer, 'utf8')), 'checkpoint');
  if (record.schemaVersion !== 1 || record.gitDir !== project.gitDir) throw new Error('checkpoint project mismatch');
  const worktree = string(record.worktree, 'worktree');
  const roots = [store, project.worktree];
  if (worktree !== project.worktree) {
    try {
      if (identity(worktree).gitDir === project.gitDir) roots.push(realpathSync(worktree));
    } catch { /* Removed worktrees cannot supply artifacts; store files remain readable. */ }
  }
  const note = verifyFile(record.note, [store]);
  if (!Array.isArray(record.artifacts)) throw new Error('invalid artifact list');
  const artifacts = record.artifacts.map(value => verifyFile(value, roots));
  const branch = record.branch === null ? null : string(record.branch, 'branch');
  const createdAt = string(record.createdAt, 'timestamp');
  if (!Number.isFinite(Date.parse(createdAt))) throw new Error('invalid checkpoint timestamp');
  verifyLinks(note, artifacts);
  return { schemaVersion: 1, gitDir: project.gitDir, worktree, branch, createdAt, note, artifacts };
}

try {
  const { values, positionals } = parseArgs({
    allowPositionals: true,
    options: {
      project: { type: 'string', default: '.' },
      note: { type: 'string' },
      artifact: { type: 'string', multiple: true, default: [] },
    },
  });
  const [operation] = positionals;
  if (positionals.length !== 1 || !['begin', 'publish', 'read'].includes(operation))
    throw new Error('usage: resume.mjs begin|publish|read --project <directory> [--note <file> --artifact <file> ...]');
  if (operation !== 'publish' && (values.note || values.artifact.length)) throw new Error('only publish accepts files');
  const project = identity(values.project);
  const store = join(project.gitDir, 'pstack', 'resume');
  if (operation === 'read') {
    try {
      lstatSync(join(store, 'latest.json'));
    } catch (error) {
      if (error.code !== 'ENOENT') throw error;
      console.log(JSON.stringify({ kind: 'missing' }));
      process.exit(2);
    }
    console.log(JSON.stringify({ kind: 'checkpoint', checkpoint: load(store, project) }));
  } else {
    mkdirSync(store, { recursive: true, mode: 0o700 });
    if (!inside(project.gitDir, realpathSync(store))) throw new Error('resume store escapes the Git directory');
    if (operation === 'begin') {
      const directory = join(store, randomUUID());
      mkdirSync(directory, { mode: 0o700 });
      console.log(JSON.stringify({ kind: 'directory', directory }));
    } else {
      const note = fileInfo(string(values.note, '--note'), [store]);
      const artifacts = values.artifact.map(path => fileInfo(path, [store, project.worktree]));
      if (new Set(artifacts.map(file => file.path)).size !== artifacts.length) throw new Error('duplicate artifact');
      verifyLinks(note, artifacts);
      const checkpoint = {
        schemaVersion: 1, ...project,
        branch: git(project.worktree, 'branch', '--show-current') || null,
        createdAt: new Date().toISOString(), note, artifacts,
      };
      const temporary = join(store, `.latest-${randomUUID()}.json`);
      try {
        writeFileSync(temporary, JSON.stringify(checkpoint) + '\n', { flag: 'wx', mode: 0o600 });
        renameSync(temporary, join(store, 'latest.json'));
      } finally { rmSync(temporary, { force: true }); }
      console.log(JSON.stringify({ kind: 'checkpoint', checkpoint: load(store, project) }));
    }
  }
} catch (error) {
  console.log(JSON.stringify({ kind: 'unavailable', detail: error.message }));
  process.exitCode = 1;
}
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