Skip to content

Commit bccdd51

Browse files
committed
chore: harden export skill release quality
1 parent 92fa7ed commit bccdd51

14 files changed

Lines changed: 607 additions & 29 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Bug Report
2+
description: Report an export, selection, formatting, or privacy issue.
3+
title: "[Bug]: "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for reporting a problem. Please do not paste private session content, secrets, or full local paths unless they are necessary and already sanitized.
11+
- type: textarea
12+
id: summary
13+
attributes:
14+
label: Summary
15+
description: What went wrong?
16+
placeholder: The exporter selected the wrong session when...
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: expected
21+
attributes:
22+
label: Expected Behavior
23+
description: What did you expect to happen?
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: actual
28+
attributes:
29+
label: Actual Behavior
30+
description: What happened instead?
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: reproduction
35+
attributes:
36+
label: Reproduction
37+
description: Minimal steps or sanitized JSONL records that reproduce the issue.
38+
render: text
39+
validations:
40+
required: true
41+
- type: input
42+
id: python
43+
attributes:
44+
label: Python Version
45+
placeholder: "python3 --version"
46+
- type: input
47+
id: codex
48+
attributes:
49+
label: Codex Version
50+
placeholder: "Codex CLI/Desktop version, if known"
51+
- type: textarea
52+
id: notes
53+
attributes:
54+
label: Additional Notes
55+
description: Any extra context, sanitized logs, or related links.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Feature Request
2+
description: Suggest an improvement to export behavior, Skill usage, or transcript formatting.
3+
title: "[Feature]: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: Problem
11+
description: What workflow or limitation should this solve?
12+
placeholder: I want to export...
13+
validations:
14+
required: true
15+
- type: textarea
16+
id: proposal
17+
attributes:
18+
label: Proposed Solution
19+
description: Describe the behavior you want.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: alternatives
24+
attributes:
25+
label: Alternatives Considered
26+
description: Other approaches or workarounds you considered.
27+
- type: textarea
28+
id: privacy
29+
attributes:
30+
label: Privacy Impact
31+
description: Does this require exporting more session data, tool logs, or local paths?

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Python ${{ matrix.python-version }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version:
18+
- "3.10"
19+
- "3.11"
20+
- "3.12"
21+
- "3.13"
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: "22"
36+
37+
- name: Compile Python
38+
run: python3 -m py_compile skills/export/scripts/export_codex_session.py tests/test_export_codex_session.py
39+
40+
- name: Run unit tests
41+
run: python3 -m unittest discover -s tests -p 'test_*.py' -v
42+
43+
- name: Validate Skill package
44+
run: npx --yes skills add . --list

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## 0.1.0 - 2026-04-24
6+
7+
- Initial public Codex Skill for exporting local Codex sessions as Markdown transcripts.
8+
- Added current-session, cwd-aware, and global session selection fallback.
9+
- Added conservative privacy defaults that exclude system/developer context, reasoning records, and tool logs.
10+
- Added optional tool-log export for explicit debugging workflows.
11+
- Added path-redacted Markdown metadata by default.
12+
- Added machine-readable `--json` CLI output for Skill invocation.

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing
2+
3+
Thanks for improving `codex-export-skill`.
4+
5+
## Project Contract
6+
7+
Keep changes aligned with the core contract:
8+
9+
- `$export` should remain simple to invoke from Codex.
10+
- Markdown should remain the default transcript format.
11+
- Privacy defaults must stay conservative.
12+
- Tool logs, full local paths, and other sensitive execution details must require explicit opt-in.
13+
14+
## Development
15+
16+
Run the local verification suite before opening a pull request:
17+
18+
```bash
19+
python3 -m py_compile skills/export/scripts/export_codex_session.py tests/test_export_codex_session.py
20+
python3 -m unittest discover -s tests -p 'test_*.py' -v
21+
npx skills add . --list
22+
```
23+
24+
The exporter requires Python 3.10 or newer.
25+
26+
## Parser And Formatting Changes
27+
28+
Session JSONL and Markdown rendering changes are syntax-sensitive. Before changing parser, serializer, escaping, redaction, or selection behavior, define the invariant being changed and add regression tests for:
29+
30+
- positive cases that prove the bug is fixed
31+
- negative cases that prove nearby literal text is preserved
32+
- contextual cases that prove the rewrite only applies in the intended structure
33+
34+
For delimiter-sensitive changes, include near-miss examples such as literal Markdown fences, quoted context markers, and prose that only looks like injected context.
35+
36+
## Pull Requests
37+
38+
In pull request descriptions, include:
39+
40+
- root cause or motivation
41+
- behavior changed
42+
- privacy impact, if any
43+
- tests run

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright [yyyy] [name of copyright owner]
190+
Copyright 2026 GaoSSR
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<img alt="Codex Skill" src="https://img.shields.io/badge/Codex-Skill-111827?style=flat-square" />
1414
<img alt="Markdown" src="https://img.shields.io/badge/output-Markdown-2563EB?style=flat-square" />
1515
<img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-0F766E?style=flat-square" />
16+
<img alt="CI" src="https://github.com/GaoSSR/codex-export-skill/actions/workflows/ci.yml/badge.svg" />
1617
</p>
1718

1819
</div>
@@ -21,6 +22,12 @@
2122

2223
## Installation
2324

25+
Requirements:
26+
27+
- Codex with Skill support
28+
- Python 3.10 or newer available as `python3`
29+
- Node.js/npm for `npx skills`
30+
2431
```bash
2532
npx skills add GaoSSR/codex-export-skill --agent codex -g -y --copy
2633
```
@@ -72,6 +79,7 @@ Markdown is the default output because LLM conversations already use Markdown he
7279
- **Current-session selection**: prefers the active Codex conversation when available.
7380
- **Workspace-aware fallback**: falls back to the latest session for the current workspace, then latest globally.
7481
- **Privacy-conscious defaults**: excludes system prompts, developer instructions, AGENTS context injection, environment context injection, reasoning records, and tool logs by default.
82+
- **Path redaction by default**: Markdown metadata shows only local source basenames unless full source paths are explicitly requested.
7583
- **Optional tool-log export**: include tool logs only when you explicitly ask for them.
7684

7785
## Safety Boundaries
@@ -82,6 +90,8 @@ By default, the export includes:
8290
- visible assistant messages
8391
- session metadata such as session id, source file, cwd, timestamps, originator, and CLI version
8492

93+
Local source file paths and cwd metadata are redacted by default. The exported Markdown keeps only basenames such as `rollout-...jsonl` and the workspace folder name.
94+
8595
By default, the export excludes:
8696

8797
- system prompts
@@ -93,6 +103,8 @@ By default, the export excludes:
93103

94104
Tool calls and command output are exported only when you explicitly ask the Skill to include tool logs.
95105

106+
Advanced script users can pass `--json` for machine-readable output, or `--show-paths` when they intentionally need full local source paths in Markdown metadata.
107+
96108
## Session Selection
97109

98110
When you do not specify a session, the Skill tries to export the current Codex conversation first. If the current conversation id is unavailable, it falls back to the latest session recorded for the active workspace, then to the latest session globally.
@@ -115,4 +127,6 @@ Issues and pull requests are welcome. Please keep changes aligned with the core
115127

116128
Licensed under the [Apache License 2.0](LICENSE).
117129

130+
Copyright 2026 GaoSSR.
131+
118132
This is not an official OpenAI project.

README_zh.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<img alt="Codex Skill" src="https://img.shields.io/badge/Codex-Skill-111827?style=flat-square" />
1414
<img alt="Markdown" src="https://img.shields.io/badge/output-Markdown-2563EB?style=flat-square" />
1515
<img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-0F766E?style=flat-square" />
16+
<img alt="CI" src="https://github.com/GaoSSR/codex-export-skill/actions/workflows/ci.yml/badge.svg" />
1617
</p>
1718

1819
</div>
@@ -21,6 +22,12 @@
2122

2223
## 安装
2324

25+
运行要求:
26+
27+
- 支持 Skill 的 Codex
28+
- 可通过 `python3` 调用的 Python 3.10 或更新版本
29+
- 用于执行 `npx skills` 的 Node.js/npm
30+
2431
```bash
2532
npx skills add GaoSSR/codex-export-skill --agent codex -g -y --copy
2633
```
@@ -72,6 +79,7 @@ $export export this session with tool logs
7279
- **优先导出当前会话**:可用时优先选择当前 Codex conversation。
7380
- **工作区感知回退**:当前会话 id 不可用时,回退到当前工作区最近会话,再回退到全局最近会话。
7481
- **隐私友好的默认边界**:默认排除 system prompt、developer 指令、AGENTS 上下注入、环境上下文注入、reasoning 记录和工具日志。
82+
- **默认路径脱敏**:Markdown 元数据默认只保留本地源文件 basename 和工作区目录名,除非明确要求完整源路径。
7583
- **可选工具日志**:只有你明确要求包含 tool logs 时,才会导出工具调用和命令输出。
7684

7785
## 安全边界
@@ -82,6 +90,8 @@ $export export this session with tool logs
8290
- 可见的助手回复
8391
- 会话元数据,例如 session id、source file、cwd、时间戳、originator 和 CLI version
8492

93+
本地源文件路径和 cwd 元数据默认会脱敏。导出的 Markdown 只保留 `rollout-...jsonl` 这样的文件名和工作区目录名。
94+
8595
默认不会导出:
8696

8797
- system prompt
@@ -93,6 +103,8 @@ $export export this session with tool logs
93103

94104
只有你明确要求 Skill 包含 tool logs 时,工具调用和命令输出才会被导出。
95105

106+
如果直接调用脚本,可以使用 `--json` 获取机器可解析输出;只有在确实需要完整本地源路径时才使用 `--show-paths`
107+
96108
## 会话选择
97109

98110
当你不指定 session id 时,Skill 会优先尝试导出当前 Codex 会话。如果当前会话 id 不可用,则回退到当前工作区最近的会话,再回退到全局最近会话。
@@ -115,4 +127,6 @@ $export export session <session-id> to Markdown
115127

116128
本项目基于 [Apache License 2.0](LICENSE) 开源。
117129

130+
Copyright 2026 GaoSSR.
131+
118132
本项目不是 OpenAI 官方项目。

SECURITY.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security fixes target the current `main` branch and the latest tagged release.
6+
7+
## Reporting A Vulnerability
8+
9+
Please do not open a public issue for vulnerabilities that could expose private session content, local paths, secrets, or tool output.
10+
11+
Report security issues privately through GitHub Security Advisories for this repository. Include:
12+
13+
- affected version or commit
14+
- sanitized reproduction steps
15+
- whether the issue can expose hidden prompts, local paths, tool logs, or secrets
16+
- suggested fix, if known
17+
18+
## Privacy Boundary
19+
20+
The default export must not include:
21+
22+
- system prompts
23+
- developer instructions
24+
- AGENTS or project-doc context injection
25+
- environment context injection
26+
- encrypted or summarized reasoning records
27+
- tool calls or command output
28+
- full local source paths in Markdown metadata
29+
30+
Any change that expands exported data must require explicit user opt-in and dedicated regression tests.

0 commit comments

Comments
 (0)