Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fb0b87d
Add codex-harness-patterns plugin
antianqi Aug 23, 2026
8a6c180
Expand codex-harness-patterns: add review-mode, delegate-with-context…
antianqi Aug 23, 2026
fdbffcc
v0.3.0: add 2 Skills (goal-persistence, model-router) — 10 Skills total
antianqi Aug 23, 2026
c2422f2
v0.4.0: 12 Skills total — add completion-audit + fork-context-decisio…
antianqi Aug 23, 2026
21afb47
v0.5.0: 14 Skills — add subagent-family-tracking + goal-token-budgeti…
antianqi Aug 23, 2026
3cfbb2a
v0.6.0: 18 Skills total — add error-recovery-strategy, retry-with-bac…
antianqi Aug 24, 2026
f6d18a9
v0.6.1: rewrite all 18 Skill frontmatter descriptions for LLM matching
antianqi Aug 24, 2026
4a7b838
v0.6.2: catalog corrections (6 misjudgments) + 2-3 month roadmap
Aug 24, 2026
901e2a1
v0.6.3: research milestone — Phase 1 Week 1 (memories/ deep-dive)
Aug 24, 2026
3616b16
v0.6.4: research milestone — Phase 1 Week 2 (skills/ deep-dive)
Aug 24, 2026
cfadb53
v0.6.5: research milestone — Phase 1 Week 3 (thread-store/ deep-dive)
Aug 24, 2026
ab97ec7
v0.7.0: research milestone — Phase 1 completion (5 core crates)
Aug 24, 2026
15f4d41
v0.7.1: research milestone — Phase 2 Week 5 (agent + session deep-dive)
Aug 24, 2026
2d8fed0
v0.7.2: research milestone — Phase 2 Week 6 (tools/ deep-dive)
Aug 24, 2026
00ffed5
v0.7.3: research milestone — Phase 2 Week 7 (rollout + models-manager)
Aug 24, 2026
1f9d574
v0.7.4: research milestone — Phase 2 Week 8 (protocol layer)
Aug 24, 2026
d2da1ea
v0.7.5: research milestone — Phase 3 (edge crates)
Aug 24, 2026
e2ec486
v1.0.0: MAJOR — 5 new Skills (23 total), full agent lifecycle coverage
Aug 24, 2026
5f41ba3
v1.0.1: documentation refresh — OVERVIEW.md / STATUS.md / PR #18 title
Aug 24, 2026
5b7f1a8
v1.0.2: README 4-section disclosure (mcode plugin convention)
Aug 25, 2026
1f4530c
fix: remove Codex-only tool params from 5 Skills (reviewer feedback)
Aug 25, 2026
6f1a615
fix: add Host runtime requirements sections to plugin-author-helper a…
Aug 25, 2026
72952c9
fix: replace Codex-only tool param names with mcode actual API (v1.0.3)
Aug 25, 2026
a9f80c3
docs: align version references to v1.0.3 across plugin metadata
antianqi Aug 26, 2026
aa77b1c
fix: clean up hardcoded path and stale frontmatter reference missed i…
antianqi Aug 26, 2026
155f0ad
fix(mcode-schema): rewrite 5 Skills against mcode 0.2.4 actual task /…
antianqi Aug 26, 2026
020c43c
fix(mcode-schema): error-recovery-strategy 0.1.1 -> 0.1.2 (subagent -…
antianqi Aug 26, 2026
61ae6f4
test(codex-harness-patterns): close round-4 false-green holes in stat…
antianqi Aug 27, 2026
659b606
fix(codex-harness-patterns): align Skills with current mcode 0.2.4 ta…
antianqi Aug 29, 2026
fe3b3bb
fix(codex-harness-patterns): close 5 self-contradictions + CRLF guard…
antianqi Aug 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 201 additions & 0 deletions plugins/antianqi/codex-harness-patterns/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of tracking or otherwise improving the Work,
but excludes communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for describing the origin of the Work and
reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may accept and charge a
fee for, acceptance of support, warranty, indemnity, or other
liability obligations and/or rights consistent with this License.
However, in accepting such obligations, You may act only on Your
own behalf and on Your sole responsibility, not on behalf of any
other Contributor, and only if You agree to indemnify, defend,
and hold each Contributor harmless for any liability incurred by,
or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2026 antianqi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
117 changes: 117 additions & 0 deletions plugins/antianqi/codex-harness-patterns/OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# codex-harness-patterns — Plugin 总览

> 最后更新:2026-08-26 · **v1.0.4** · **23 Skills**
> Plugin 覆盖率 ~90%+

## 一句话

> **23 个 skill** 把 mcode 从"灵机一动"的工作流,变成 Codex 团队在生产环境验证过的、**完整 agent 生命周期**的工程化体系:
> planning → decomposition → sub-agent parallelism → execution → state tracking → tool discovery → skill/plugin authoring → memory persistence → session branching

## 23 Skill 一览(按生命周期)

| # | Skill | 触发条件 | 一句话 |
|---|---|---|---|
| **规划与拆解** | | | |
| 1 | `plan-stream-emit` | 复杂任务 | 先出 `todowrite` 计划,等 ack 再动 |
| 2 | `parallel-fanout` | 任务可拆 2+ 独立子任务 | 显式 spawn,opt-in,fan-out + 聚合 |
| **子代理派发** | | | |
| 3 | `delegate-with-context` | 调 `task` 派发子 agent | 4-part 信封写进 `prompt`,`agent_name` 三选一 |
| 4 | `fork-context-decision` | 调 `task` 派发 | 选 `all`/`N`/`none`,把对应内容内联到 `prompt` |
| 5 | `subagent-family-tracking` | 派发了 sub-agent | 跟踪父子线程树 Open/Closed 状态 |
| **执行与状态** | | | |
| 6 | `background-task` | 命令预期 > 30s | `task(run_in_background)` + `task_query`/`task_output`/`task_stop`,或 `bash(run_in_background)` |
| 7 | `streaming-output-reader` | 长流式输出 | bounded chunk + summary,最多 3 次读 |
| 8 | `tool-output-budget` | 工具输出过大 | token-aware head/tail/marker 截断 |
| 9 | `world-state-tracking` | 任务长到丢线索 | 持久化 world state 文件,挺过 compact |
| 10 | `context-pressure-compact` | 多步长任务,context 满 | structured snapshot,64K retention |
| **目标与成本** | | | |
| 11 | `goal-persistence` | 非平凡任务开始 | 设 goal + drift-check + 跟到 compact |
| 12 | `goal-token-budgeting` | 设了 token_budget | 50%/80%/100% 报告,跑超就停 |
| 13 | `model-router` | 子任务 / 重复任务 | cheap/medium/main 思考框架 + session-level 路由 |
| **质量保证** | | | |
| 14 | `review-mode` | 子任务完成 | 切 critic,PASS / FIX / REDO 判决 |
| 15 | `completion-audit` | 说 "done" 前 | 派生需求 + 找证据 + 逐项验 |
| **容错与接力** | | | |
| 16 | `error-recovery-strategy` | 任何失败 | retry / switch / fallback / ask / skip |
| 17 | `retry-with-backoff` | 准备重试 | 显式策略:max/base/max/jitter/budget |
| 18 | `session-handoff` | 会话结束 | 写 handoff 文件,下次 30 秒接上 |
| **新(v1.0.0)·持久化与发现** | | | |
| 19 | `long-term-memory` | 设计跨 session 记忆 | Phase 1/2 extract+consolidate+citation,git baseline |
| 20 | `skill-auto-select` | 设计可被 agent 选择的 skill | 3 层匹配 + `$name` mention + 防歧义 |
| 21 | `plugin-author-helper` | 写 marketplace plugin | manifest 格式 + 3-layer sync + idempotency |
| 22 | `tool-discovery-pattern` | 设计可被 agent 发现的 tool | defer_loading + 7-type schema + tool_suggestion |
| 23 | `session-branch-fork` | 设计 session 分支/回滚/恢复 | paginated + lineage + CAS + bounded replay |

## 完整生命周期图

```
┌──────────────────────────────────────────────────────┐
│ 完整 agent 生命周期 │
└──────────────────────────────────────────────────────┘

输入
├─→ 【1. plan-stream-emit】 规划:出计划
├─→ 【2. parallel-fanout】 拆解:fork 多个子任务
│ │
│ ├─→ 【3. delegate-with-context】 写简报 + 信封
│ ├─→ 【4. fork-context-decision】 选 fork_turns
│ └─→ 【5. subagent-family-tracking】 跟踪父子树
├─→ 【6. background-task】 后台化长命令
├─→ 【7. streaming-output-reader】 bounded chunk 读流
├─→ 【8. tool-output-budget】 截断大输出
├─→ 【9. world-state-tracking】 持久化世界状态
├─→ 【10. context-pressure-compact】 context 满时 snapshot
├─→ 【11. goal-persistence】 设 goal,drift check
├─→ 【12. goal-token-budgeting】 50/80/100% 报告
├─→ 【13. model-router】 选 model,分 cheap/medium/main
├─→ 【14. review-mode】 切 critic,出 verdict
├─→ 【15. completion-audit】 派生需求 + 验证
├─→ 【16. error-recovery-strategy】 失败:retry/switch/ask
├─→ 【17. retry-with-backoff】 显式重试策略
├─→ 【18. session-handoff】 写 handoff
├─→ 【19. long-term-memory】 跨 session 记忆
│ │
│ ├─→ 【20. skill-auto-select】 选 skill
│ ├─→ 【21. plugin-author-helper】 写 plugin
│ └─→ 【22. tool-discovery-pattern】 选 tool
└─→ 【23. session-branch-fork】 分支 / 回滚 / 恢复
```

## 与 Codex 源码的对应

每个 Skill 的 frontmatter `metadata.inspired-by` 字段指向具体的 Codex 源文件。
Plugin 覆盖率 ~90%+ — 还有 ~12 个模式因安全/UI/voice/横向对比等原因被排除。

详见 `codex-harness-engineering/CATALOG.md`。

## 版本与里程碑

| 版本 | 阶段 | 发布 |
|---|---|---|
| v0.1.0 - v0.5.0 | 0 | 4→14 skills |
| v0.6.0 | 0 | 18 skills |
| v0.6.2 - v0.7.5 | 1-3 | 30+ 知识笔记 + 路线图 |
| **v1.0.0** | 4 | **23 skills(当前)** |

## 设计原则

每个 Skill 都遵循同一结构:
- `description` 用 4 行格式(`USE WHEN / TRIGGER PHRASES / SKIP WHEN`,EN+中文)
- "When to use" + "When NOT to use" 显式声明
- Process 编号步骤
- Output contract 给出契约
- Common pitfalls 列出反模式
- Verification checklist 供自检

这一致性让 LLM 能可靠选择 Skill,让维护者能审计 Skill 质量。
Loading