Skip to content

code-yeongyu/oh-my-openagent / packages/shared-skills/skills/programming

programming

Flagged

Applies strict, modern language practice (typed errors, exhaustive match, tests that can fail) for Python, Rust, TypeScript, JavaScript, and Go. Use for work on .py, .rs, .ts, .js, or .go files, and whenever a test or spec file is written, reshaped, reviewed, or deleted: the four-question test authoring gate and the junk-test classes live here.

FileKindSize
SKILL.mdskill md33.3 KB
references/code-smells.mdmarkdown13.9 KB
references/go/README.mdmarkdown7.7 KB
references/go/backend-stack.mdmarkdown16.6 KB
references/go/bootstrap.mdmarkdown8.9 KB
references/go/bubbletea-v2.mdmarkdown11.3 KB
references/go/cobra-stack.mdmarkdown11.5 KB
references/go/concurrency.mdmarkdown10.9 KB
references/go/data-modeling.mdmarkdown12.0 KB
references/go/error-handling.mdmarkdown10.1 KB
references/go/golangci-strict.mdmarkdown10.0 KB
references/go/grpc-connect.mdmarkdown10.3 KB
references/go/libraries.mdmarkdown13.7 KB
references/go/one-liners.mdmarkdown5.5 KB
references/go/sqlc-pgx.mdmarkdown12.7 KB
references/go/testing.mdmarkdown14.2 KB
references/go/type-patterns.mdmarkdown9.5 KB
references/logging.mdmarkdown10.5 KB
references/python/README.mdmarkdown15.7 KB
references/python/async-anyio.mdmarkdown14.2 KB
references/python/data-modeling.mdmarkdown6.6 KB
references/python/data-processing.mdmarkdown4.2 KB
references/python/error-handling.mdmarkdown6.0 KB
references/python/fastapi-stack.mdmarkdown9.2 KB
references/python/httpx2-optimization.mdmarkdown12.0 KB
references/python/libraries.mdmarkdown10.6 KB
references/python/one-liners.mdmarkdown7.9 KB
references/python/orjson-stack.mdmarkdown13.3 KB
references/python/pydantic-ai.mdmarkdown8.2 KB
references/python/pyproject-strict.mdmarkdown9.0 KB
references/python/textual-tui.mdmarkdown5.1 KB
references/python/type-patterns.mdmarkdown4.1 KB
references/rust-ub/README.mdmarkdown9.9 KB
references/rust-ub/miri-sanitizers-loom.mdmarkdown11.5 KB
references/rust-ub/ub-taxonomy.mdmarkdown13.3 KB
references/rust/README.mdmarkdown16.6 KB
references/rust/api-design.mdmarkdown6.5 KB
references/rust/async-tokio.mdmarkdown12.6 KB
references/rust/axum-stack.mdmarkdown14.2 KB
references/rust/cargo-strict.mdmarkdown10.0 KB
references/rust/clap-stack.mdmarkdown12.1 KB
references/rust/concurrency.mdmarkdown14.3 KB
references/rust/libraries.mdmarkdown17.4 KB
references/rust/macros.mdmarkdown3.3 KB
references/rust/one-liners.mdmarkdown7.5 KB
references/rust/proptest-insta.mdmarkdown13.9 KB
references/rust/type-state.mdmarkdown13.1 KB
references/rust/unsafe-discipline.mdmarkdown12.9 KB
references/rust/zero-cost-safety.mdmarkdown16.9 KB
references/testing/README.mdmarkdown10.3 KB
references/testing/junk-classes.mdmarkdown6.2 KB
references/typescript/README.mdmarkdown10.6 KB
references/typescript/backend-hono.mdmarkdown21.2 KB
references/typescript/bootstrap.mdmarkdown6.9 KB
references/typescript/data-modeling.mdmarkdown5.0 KB
references/typescript/error-handling.mdmarkdown4.7 KB
references/typescript/oxc-lint.mdmarkdown7.6 KB
references/typescript/tsconfig-strict.mdmarkdown3.9 KB
references/typescript/type-patterns.mdmarkdown5.2 KB
scripts/go/check-no-excuse-rules.shexecutablescript7.1 KB
scripts/go/new-project.tsscript6.8 KB
scripts/go/templates/.editorconfigother206 B
scripts/go/templates/.golangci.ymlconfig1.5 KB
scripts/go/templates/AGENTS.md.tmplother845 B
scripts/go/templates/README.md.tmplother207 B
scripts/go/templates/Taskfile.ymlconfig706 B
scripts/go/templates/ci.ymlconfig863 B
scripts/go/templates/config.goscript643 B
scripts/go/templates/gitignoreother99 B
scripts/go/templates/main.go.tmplother329 B
scripts/go/templates/run.goscript350 B
scripts/python/check-no-excuse-rules.pyscript24.9 KB
scripts/python/new-project.tsscript6.7 KB
scripts/python/new-script.tsscript4.2 KB
scripts/rust/check-no-excuse-rules.shexecutablescript7.5 KB
scripts/rust/check-no-excuse-rules.test.tsscript3.4 KB
scripts/rust/new-project.tsscript6.1 KB
scripts/scaffolders.test.tsscript4.9 KB
scripts/shared/run-tool.tsscript855 B
scripts/typescript/check-no-excuse-rules.test.tsscript4.0 KB
scripts/typescript/check-no-excuse-rules.tsscript13.1 KB
scripts/typescript/check-test-junk-rules.tsscript5.5 KB
scripts/typescript/check-test-junk.test.tsscript4.9 KB
scripts/typescript/check-test-junk.tsscript5.4 KB
scripts/typescript/mutation-proof.test.tsscript1.9 KB
scripts/typescript/mutation-proof.tsscript6.4 KB
scripts/typescript/new-project.test.tsscript6.8 KB
scripts/typescript/new-project.tsscript3.1 KB
scripts/typescript/oxc/.oxfmtrc.jsonconfig256 B
scripts/typescript/oxc/.oxlintrc.jsonconfig1.7 KB
scripts/typescript/oxc/lint/oxlint-plugin/LICENSEother1.0 KB
scripts/typescript/oxc/lint/oxlint-plugin/index.jsscript288 B
scripts/typescript/oxc/lint/oxlint-plugin/no-em-dash-copy.jsscript785 B
scripts/typescript/oxc/lint/oxlint-plugin/require-suppression-reason.jsscript2.3 KB
scripts/typescript/oxc/tsconfig.jsonconfig794 B

scripts/scaffolders.test.ts

View on GitHub
import { afterAll, describe, expect, test } from "bun:test"
import {
  cpSync,
  existsSync,
  mkdirSync,
  mkdtempSync,
  readdirSync,
  readFileSync,
  rmSync,
  statSync,
  writeFileSync,
} from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"

const runRoot = mkdtempSync(join(process.env.RUN_TMP ?? tmpdir(), "programming-scaffolders-"))
const emptyBin = join(runRoot, "empty-bin")
mkdirSync(emptyBin)

afterAll(() => rmSync(runRoot, { recursive: true, force: true }))

async function scaffold(script: string, args: readonly string[]) {
  const child = Bun.spawn([process.execPath, join(import.meta.dir, script), ...args], {
    cwd: runRoot,
    env: { ...process.env, PATH: emptyBin },
    stdout: "ignore",
    stderr: "pipe",
  })
  const [stderr, code] = await Promise.all([new Response(child.stderr).text(), child.exited])
  return { stderr, code }
}

function pep723Metadata(source: string): unknown {
  const block = /^# \/\/\/ script\n((?:#.*\n)*?)# \/\/\/$/m.exec(source)?.[1] ?? ""
  return Bun.TOML.parse(block.replace(/^# ?/gm, ""))
}

describe("#given the Bun scaffolders run offline", () => {
  test("#when new-script gets --deps and --py #then it writes an executable PEP 723 script declaring them", async () => {
    const dest = join(runRoot, "scripts", "tool.py")

    const result = await scaffold("python/new-script.ts", [
      "tool",
      "--output",
      dest,
      "-d",
      "polars",
      "--deps",
      "duckdb",
      "--py",
      "3.12",
    ])

    expect(result.code).toBe(0)
    expect(pep723Metadata(readFileSync(dest, "utf8"))).toEqual({
      "requires-python": ">=3.12",
      dependencies: ["polars", "duckdb"],
    })
    expect(statSync(dest).mode & 0o111).toBe(process.platform === "win32" ? 0 : 0o111)
  })

  test("#when go is not on PATH #then go new-project writes the fallback go.mod and substitutes the templates", async () => {
    const project = join(runRoot, "svc")

    const result = await scaffold("go/new-project.ts", [
      "svc",
      "--path",
      runRoot,
      "--module",
      "example.com/acme/svc",
      "--purpose",
      "billing",
    ])

    expect(result.code).toBe(0)
    expect(readFileSync(join(project, "go.mod"), "utf8")).toBe("module example.com/acme/svc\n\ngo 1.23\n")
    expect(readFileSync(join(project, "cmd", "server", "main.go"), "utf8")).toContain(
      '"example.com/acme/svc/internal/cmd"',
    )
    const agents = readFileSync(join(project, "AGENTS.md"), "utf8")
    expect(agents).toContain(" billing ")
    expect(agents).not.toMatch(/\$\{?[_a-z]/i)
    expect(readFileSync(join(project, "README.md"), "utf8").split("\n")[0]).toBe("# svc")
  })

  test("#when the go templates were checked out with CRLF #then every generated file is LF", async () => {
    // A CRLF checkout (git autocrlf) must not leak into the scaffolded project: its own .editorconfig says end_of_line = lf.
    const scriptsCopy = join(runRoot, "crlf-scripts")
    for (const dir of ["go", "shared"]) cpSync(join(import.meta.dir, dir), join(scriptsCopy, dir), { recursive: true })
    const templatesDir = join(scriptsCopy, "go", "templates")
    for (const file of readdirSync(templatesDir)) {
      const path = join(templatesDir, file)
      writeFileSync(path, readFileSync(path, "utf8").replace(/\r?\n/g, "\r\n"))
    }
    const project = join(runRoot, "crlf-svc")

    const child = Bun.spawn(
      [
        process.execPath,
        join(scriptsCopy, "go", "new-project.ts"),
        "crlf-svc",
        "--path",
        runRoot,
        "--module",
        "example.com/acme/crlf",
        "--purpose",
        "billing",
      ],
      {
        cwd: runRoot,
        env: { ...process.env, PATH: emptyBin },
        stdout: "ignore",
        stderr: "pipe",
      },
    )
    const [stderr, code] = await Promise.all([new Response(child.stderr).text(), child.exited])

    expect(code, stderr).toBe(0)
    const generated = readdirSync(project, { recursive: true, withFileTypes: true })
      .filter((entry) => entry.isFile())
      .map((entry) => join(entry.parentPath, entry.name))
    expect(generated.length).toBe(11)
    const withCr = generated.filter((file) => readFileSync(file, "utf8").includes("\r"))
    expect(withCr).toEqual([])
    expect(readFileSync(join(project, "README.md"), "utf8").split("\n")[0]).toBe("# crlf-svc")
  })

  test("#when cargo is not on PATH #then rust new-project exits 1 naming cargo", async () => {
    const result = await scaffold("rust/new-project.ts", ["rsapp", "--path", runRoot])

    expect(result.code).toBe(1)
    expect(result.stderr).toMatch(/\bcargo\b/)
  })

  test("#when uv is not on PATH #then python new-project exits 1 naming uv and creates nothing", async () => {
    const result = await scaffold("python/new-project.ts", ["pyapp", "--path", runRoot])

    expect(result.code).toBe(1)
    expect(result.stderr).toMatch(/\buv\b/)
    expect(existsSync(join(runRoot, "pyapp"))).toBe(false)
  })
})
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall