Jrecos/omp-pstack / skills/poteto-mode
poteto-mode
Unverifiedpoteto'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/check-plan.test.ts
View on GitHubimport { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { expect, test } from "bun:test";
const checker = join(import.meta.dir, "check-plan.mjs");
const rule =
"Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked.";
const validPlan = `# Demo
## How to read this
One box is one unit of work and names the evidence. Check a box only when its evidence exists. See playbooks/.
${rule}
## Program checklist
### Arm the program
### Spawn owners
### PR mechanics
### Verdict and merge
### Boot recipe
\`git show origin/main:\` native background task sentinel supervised 3600-second timer. Re-arm after each audit. Cancel on stand-down. status message
## PR 1
**Depends on.** None.
**Files.**
- [ ] Do the thing.
**Build.**
- [ ] Do the thing.
**You see.**
- [ ] Do the thing.
**Verify, unit.** ${rule}
- [ ] Check the thing.
**Verify, live.** ${rule} Ten lanes on the configured \`swarm workers\` role at the PR head
${Array.from({ length: 10 }, (_, i) => `- [ ] Lane ${i + 1}. Save \`lane-${i + 1}.png\`. Pass when evidence exists.`).join("\n")}
**Verify, perf.** ${rule}
- [ ] Metric. Recorded.
- [ ] Probe. Recorded.
- [ ] Baseline. Recorded.
- [ ] Rule. Recorded.
**Review gate.** None.
**Merge.**
- [ ] Merge when approved.
## Close the program
Close.
## Appendix Prototype evidence
Recorded.
`;
const runPlan = (example: string, expectedExit: number) => {
const directory = mkdtempSync(join(tmpdir(), "check-plan-test-"));
const file = join(directory, "plan.md");
writeFileSync(file, validPlan + example);
try {
const child = Bun.spawnSync([process.execPath, checker, file], { stdout: "pipe", stderr: "pipe" });
const result = { status: child.exitCode, stdout: child.stdout.toString(), stderr: child.stderr.toString() };
expect(result.status).toBe(expectedExit);
return result;
} finally {
rmSync(directory, { recursive: true, force: true });
}
};
test("accepts ordinary, indented, and longer closing fences", () => {
for (const indent of ["", " ", " ", " "])
runPlan(`${indent}\`\`\`markdown\n## Example only\n${indent}\`\`\`\n`, 0);
runPlan("```markdown\n## Example only\n````\n", 0);
});
test("accepts nested backticks and tilde info strings", () => {
runPlan("````markdown\n```markdown\n## Example only\n```\n````\n", 0);
runPlan("~~~markdown `info`\n## Example only\n ~~~\n", 0);
});
test("keeps mismatched, shorter, and suffixed closers inside the fence", () => {
runPlan("````markdown\n~~~\n## Example only\n````\n", 0);
runPlan("````markdown\n```\n## Example only\n````\n", 0);
runPlan("````markdown\n``` info\n## Example only\n````\n", 0);
});
test("rejects headings and prose outside a proper close", () => {
for (const suffix of [" ", "\t"]) {
const heading = runPlan(`\`\`\`markdown\n## Example only\n\`\`\`${suffix}\n## Example only\n`, 1);
expect(heading.stderr).toContain('"## Example only" after Close the program is not an appendix');
}
const prose = runPlan("```markdown\nThis prose has a mid-sentence colon: inside code\n```\nThis prose has a mid-sentence colon: bad.\n", 1);
expect(prose.stderr).toContain("mid-sentence colon");
});
test("rejects backtick info strings containing a backtick", () => {
const result = runPlan("```markdown `invalid`\n## Example only\n```\n", 1);
expect(result.stderr).toContain('"## Example only" after Close the program is not an appendix');
});
test("ignores prose punctuation inside matching multi-backtick code spans", () => {
for (const count of [2, 3, 4]) {
const delimiter = "`".repeat(count);
runPlan(`Use ${delimiter}echo \`x\`: “quoted” — example${delimiter}.\n`, 0);
}
});
test("checks prose following a multi-backtick span and unmatched delimiters", () => {
const outside = runPlan("Use ``echo `x`: y``. Bad: prose.\n", 1);
expect(outside.stderr).toContain("mid-sentence colon");
const unmatched = runPlan("Use ``unclosed: bad` here.\n", 1);
expect(unmatched.stderr).toContain("mid-sentence colon");
});
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: 469k | 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: 321k | 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: 321k | 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: 321k | Updated | Claude CodeCodex | Verified | Install |