一键导入
feature
Add new features to Copex. Use this when asked to implement new functionality, add CLI commands, or extend the client.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add new features to Copex. Use this when asked to implement new functionality, add CLI commands, or extend the client.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review code changes in Copex for bugs, style issues, and best practices. Use this when reviewing PRs or code changes.
Debug issues in Copex, especially streaming, content display, and event handling bugs. Use this when investigating bugs, unexpected behavior, or errors.
Release and publish Copex to PyPI. Use this when asked to release, publish, bump version, or create a new version.
Write and run tests for Copex. Use this when asked to write tests, fix tests, improve coverage, or debug test failures.
| name | feature |
| description | Add new features to Copex. Use this when asked to implement new functionality, add CLI commands, or extend the client. |
src/copex/
├── client.py # Core client with retry logic and streaming
├── cli.py # Typer CLI commands
├── config.py # CopexConfig and configuration
├── models.py # Model, ReasoningEffort, EventType enums
├── ralph.py # RalphWiggum loop implementation
├── checkpoint.py # CheckpointStore and CheckpointedRalph
├── persistence.py # SessionStore and PersistentSession
├── metrics.py # MetricsCollector for usage tracking
├── tools.py # ParallelToolExecutor
├── mcp.py # MCPManager and MCPServerConfig
├── ui.py # Rich UI components
└── __init__.py # Public API exports
cli.py:@app.command()
def mycommand(
arg: Annotated[str, typer.Argument(help="Description")],
option: Annotated[str, typer.Option("--opt", "-o", help="Description")] = "default",
) -> None:
"""Command description shown in help."""
# Implementation
asyncio.run(_mycommand_async(arg, option))
async def _mycommand_async(arg: str, option: str) -> None:
client = Copex(config)
await client.start()
try:
# Implementation
finally:
await client.stop()
models.py:class EventType(str, Enum):
# ... existing
NEW_EVENT = "new.event"
client.py on_event():elif event_type == EventType.NEW_EVENT.value:
# Handle the event
if on_chunk:
on_chunk(StreamChunk(type="new_type", delta=...))
CopexConfig in config.py:@dataclass
class CopexConfig:
# ... existing
new_option: str = "default"
Update to_client_options() or to_session_options() if needed.
Update default config in cli.py init command.
async def my_function() -> str:
result = await some_async_operation()
return result
def process(items: list[str], callback: Callable[[str], None] | None = None) -> dict[str, Any]:
...
@dataclass
class MyData:
field: str
optional: int | None = None
items: list[str] = field(default_factory=list)
from rich.console import Console
from rich.panel import Panel
console = Console()
console.print(Panel("Content", title="Title", border_style="blue"))
tests/test_*.pyFakeSession to mock SDKpython -m pytest tests/ -vAdd to src/copex/__init__.py:
from copex.newmodule import NewClass
__all__ = [
# ... existing
"NewClass",
]