Skip to content

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

programming

Unverified

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/python/new-script.ts

View on GitHub
#!/usr/bin/env bun
/**
 * Generate a PEP 723 Python script with all boilerplate pre-filled: uv shebang,
 * inline metadata (requires-python + dependencies), the mandatory "How to run"
 * block, `from __future__ import annotations`, and a main() guard.
 *
 * ─── How to run ───
 * 1. Install Bun: curl -fsSL https://bun.sh/install | bash
 * 2. Run:
 *      bun run new-script.ts my_tool
 *      bun run new-script.ts my_tool --output ./scripts/my_tool.py
 *      bun run new-script.ts my_tool --deps 'httpx2[http2,brotli,zstd]' --deps rich --deps polars
 *      bun run new-script.ts my_tool --py 3.13
 * ──────────────────
 *
 * Writes to <os tmpdir>/uv-scripts/<name>.py unless --output is given.
 * Exit codes: 0 written, 2 usage error.
 */

import { chmodSync, mkdirSync, statSync, writeFileSync } from "node:fs"
import { tmpdir } from "node:os"
import { dirname, join } from "node:path"
import { parseArgs } from "node:util"
import { assertNever } from "../shared/run-tool.ts"

const USAGE = `Usage: bun run new-script.ts <name> [--output <path>] [--deps <dep>]... [--py <version>]

Arguments:
  name          Script name (without .py extension)

Options:
  -o, --output  Output path (default: OS temp directory)
  -d, --deps    Dependency to include (repeat --deps for each)
  --py          Minimum Python version (default: 3.13)
  -h, --help    Show this help`

type ScriptOptions = {
  readonly name: string
  readonly output: string | undefined
  readonly deps: readonly string[]
  readonly py: string
}

type Cli =
  | { readonly kind: "run"; readonly options: ScriptOptions }
  | { readonly kind: "help" }
  | { readonly kind: "usage"; readonly problem: string }

function parseCli(): Cli {
  try {
    const { values, positionals } = parseArgs({
      args: Bun.argv.slice(2),
      options: {
        output: { type: "string", short: "o" },
        deps: { type: "string", short: "d", multiple: true, default: [] },
        py: { type: "string", default: "3.13" },
        help: { type: "boolean", short: "h", default: false },
      },
      allowPositionals: true,
      strict: true,
    })
    if (values.help) return { kind: "help" }
    const [name, ...extra] = positionals
    if (name === undefined || extra.length > 0) return { kind: "usage", problem: "expected exactly one script name" }
    return { kind: "run", options: { name, output: values.output, deps: values.deps, py: values.py } }
  } catch (error) {
    if (error instanceof TypeError) return { kind: "usage", problem: error.message }
    throw error
  }
}

function renderScript(pythonVersion: string, deps: readonly string[], filename: string): string {
  const depsBlock =
    deps.length > 0
      ? deps.map((dep) => `#     "${dep}",\n`).join("")
      : '#     # add deps here, e.g.: "httpx2[http2,brotli,zstd]"\n'
  const argsHint = ""
  return `#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=${pythonVersion}"
# dependencies = [
${depsBlock}# ]
# ///

# ─── How to run ───
# 1. Install uv (if not installed):
#      curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Run directly (no venv, no pip install needed):
#      uv run ${filename} ${argsHint}
# 3. Or make executable and run:
#      chmod +x ${filename} && ./${filename}
# ──────────────────

from __future__ import annotations


def main() -> None:
    """TODO: implement."""


if __name__ == "__main__":
    main()
`
}

function writeScript({ name, output, deps, py }: ScriptOptions): void {
  const filename = name.endsWith(".py") ? name : `${name}.py`
  const dest = output ?? join(tmpdir(), "uv-scripts", filename)
  mkdirSync(dirname(dest), { recursive: true })
  writeFileSync(dest, renderScript(py, deps, filename))
  if (process.platform !== "win32") chmodSync(dest, statSync(dest).mode | 0o111)

  console.log(`✓ Created: ${dest}`)
  console.log(`  Run: uv run ${dest}`)
}

function main(): number {
  const cli = parseCli()
  switch (cli.kind) {
    case "help":
      console.log(USAGE)
      return 0
    case "usage":
      console.error(`Error: ${cli.problem}\n\n${USAGE}`)
      return 2
    case "run":
      writeScript(cli.options)
      return 0
    default:
      return assertNever(cli)
  }
}

process.exit(main())
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 318kUpdated Claude CodeCodexUnverifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 318kUpdated Claude CodeCodexUnverifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 318kUpdated Claude CodeCodexUnverifiedInstall
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: 196kUpdated Claude CodeCodexVerifiedInstall