Token导航 LogoToken导航TokenDH.com
开发权限需确认github未标认证来源可访问clear审计通过

polyglot-c-py多语言 c py

Agent Skill

polyglot-c-py 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

808

周安装

34

GitHub Stars

93

下载量

283
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:polyglot-c-py(多语言 c py)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/polyglot-c-py
安装命令:
npx skills add https://github.com/letta-ai/skills --skill polyglot-c-py
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill polyglot-c-py

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装命令:npx skills add https://github.com/letta-ai/skills --skill polyglot-c-py
  • 建议确认权限范围及是否触发联网或文件读写。

SKILL.md

Polyglot C-Python File Creation

This skill provides guidance for creating single source files that function correctly as both Python and C programs.

When to Use

This skill applies when:

  • Creating a file that must be valid syntax for both Python and C
  • The file needs to execute correctly under both python filename and gcc filename &&./output
  • Building polyglot programs that produce equivalent output in both languages

Polyglot Structure Approach

Core Technique

Use preprocessor directives and string literals to hide language-specific code:

  1. Hide C code from Python: Wrap C-specific code in triple-quoted strings that Python ignores
  2. Hide Python code from C: Use #if 0...#endif preprocessor blocks that C ignores but Python sees as comments

Typical File Structure

[Shared/polyglot preamble]
#if 0
[Python code block - C preprocessor skips this]
#endif
"""
[C code block - Python treats as string literal]
"""

Key Syntax Considerations

  • C-style // comments cause Python syntax errors - avoid in shared sections
  • Use #if 0 instead of /* */ comments for hiding Python code from C
  • Triple-quoted strings (""") effectively hide C code from Python
  • The file extension (e.g., .py.c) should indicate dual-language nature

Verification Strategy

Functional Testing

  1. Test Python execution: python <filename>
  2. Test C compilation and execution: gcc <filename> -o <output> &&./<output>
  3. Verify both produce identical or equivalent output
  4. Test multiple input cases including edge cases (e.g., boundary values, zero, negative inputs if applicable)

Environmental Verification (Critical)

Before declaring the task complete, verify the final directory state:

  1. List all files in the target directory: Ensure only the required source file(s) exist
  2. Check for leftover artifacts: Compiled binaries, object files (.o), temporary files
  3. Compare against requirements: Match the exact expected file structure

Common Pitfalls

Artifact Cleanup (Most Critical)

Problem: Leaving compiled binaries or test artifacts in the working directory.

Prevention:

  • Compile test binaries to /tmp or a separate test directory: gcc file.py.c -o /tmp/test_binary
  • If compiling in the working directory, delete binaries after testing: rm <binary_name>
  • Never leave .o files, executables, or other build artifacts in the final directory

Incomplete Task Analysis

Problem: Focusing only on functional correctness while ignoring implicit requirements like directory cleanliness.

Prevention:

  • Before starting, explicitly identify all success criteria:

- What files should exist when done? - What files should NOT exist? - What state should the environment be in?

  • After completing functional work, verify the end state matches all requirements

Syntax Conflicts

Problem: Using syntax valid in one language but not the other in shared sections.

Prevention:

  • Avoid C-style // comments in any section Python will parse
  • Test both interpreters after each significant change
  • Keep shared sections minimal

Untested Edge Cases

Problem: Only testing happy-path inputs.

Prevention:

  • Test boundary values (0, 1, max values)
  • Test error conditions if the program should handle them
  • Compare outputs between Python and C for all test cases

Verification Checklist

Before declaring the task complete:

  1. Python execution produces correct output
  2. C compilation succeeds without warnings
  3. C execution produces correct output
  4. Multiple test inputs verified
  5. Target directory contains ONLY the required file(s)
  6. No compiled binaries left behind
  7. No temporary or intermediate files present
  8. File naming matches requirements exactly

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

32.18%
按下载量换算91

Gemini CLI

23.39%
按下载量换算66

Codex

16.44%
按下载量换算47

Antigravity

11.95%
按下载量换算34

OpenCode

8.23%
按下载量换算23

windsurf

3.14%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills