Repository navigation
feat(agents): 首批项目技能(任务包/还原度门禁/迁移纪律)+ 技能格式门禁 - #46
Conversation
P1.2 of docs/agent-workflow.md. Adds task-package, ui-fidelity-gate and db-migration-discipline under .agents/skills as operational manuals (they point at the authoritative rules rather than restating them), plus scripts/check-skills.mjs and the pure rules in scripts/lib/skill-rules.mjs: a skill must be <root>/<name>/SKILL.md with matching name/description frontmatter and must not be nested, because a skill that fails those rules loads silently not at all. Consolidates the repository-level checks into pnpm check:repo so CI runs one step. Records in section 1 that gates can also fail spuriously and that the remedy is segment-wise re-runs plus CI, never re-running until green.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: debc8698e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…vade the gate Codex (PR #46, P2): the traversal skipped references/scripts/assets, so a nested SKILL.md inside a bundle was never seen and pnpm skills:validate passed even though nested skills are not loaded - the gate advertised an enforcement it did not perform. Only node_modules and .git are skipped now, the roots are overridable via WORK_SKILL_ROOTS, and scripts/check-skills.spec.mjs exercises the traversal end to end (including the exact nested case).
|
按 Codex 审查修复( P2 · 跳过列表让嵌套技能逃过门禁 — 采纳,而且这条正好打在我这道门禁的核心职责上。 我为了避免遍历重目录,把
实测: (脚本级测试从 85 → 89,新增 4 条正是门禁遍历的端到端用例。) |
Summary
P1.2:把本仓自己的可复用操作手册做成技能,并给技能格式加一道会红的门禁。此前仓里只有 1 个借用来的
code-simplifier。.agents/skills/)——只放操作手册,规则仍留在 constitution / ADR / RFC:task-package:任务包骨架、执行纪律(不静默增删文件、匹配失败就停、必读要真读)、交付要求;ui-fidelity-gate:L1/L2 边界、A 类机器校验(pnpm fidelity的 A1/A2/A4 与未覆盖边界)、B 类人工并排比对(必须覆盖交互态);db-migration-discipline:迁移只前向、一 schema 一入口、Drizzle 与实际 DDL 对齐、seed 幂等、env-gated 测试的假绿陷阱。scripts/check-skills.mjs+scripts/lib/skill-rules.mjs(pnpm skills:validate):必须是<root>/<name>/SKILL.md、frontmatter 有name/description、name与目录名一致、拒绝嵌套。理由是技能加载失败是静默的——缺 frontmatter 或目录名不一致时技能只是"不出现",没有任何报错。pnpm check:repo(fidelity / evidence / goal:validate / skills:validate),CI 由 4 步变 1 步;单独调试仍可跑各自 script。docs/agent-workflow.md§1 新增第 4 条:门禁也会"假红",处置是分段复跑 + CI 最终确认,不是反复重跑到绿(后者与假绿是同一个病的两面)。Verification
pnpm check:repoexit 0(三个门禁全过)pnpm vitest run --config vitest.config.mts scripts→ 85 通过(27 A 类 + 25 goal + 14 证据 + 10 hook + 9 技能)pnpm build单独 exit 0SKILL.md后,当前会话的可用技能目录当场更新并列出它们——即.agents/skills扫描确认生效(这解决了长期挂账的"挂载是否真被调用"的一半;hook 挂载仍未验证)pnpm verify本次未一次跑绿:它的test:e2e段触发了已知的 vitest 偶发 flake(workerERR_IPC_CHANNEL_CLOSED,紧跟pnpm test之后运行时出现)。该 flake 在本仓verification-log里已有 5 次历史记录(如 M9-1、M6-3 条目)。按仓库既有先例做分段复跑:pnpm test单独通过(55 文件/355 测试 + 39 文件/136 测试)、pnpm test:e2e单独 4/4 通过(11 文件/63 测试)、pnpm build单独通过。CI(Node 22 完整链路)是最终确认。Review Focus
description≥20 字符、name必须等于目录名、拒绝嵌套)是否合适pnpm check:repo是否认可(CI 步骤更少,失败时日志里仍能看到是哪一项)备注
「门禁假红」这条纪律是本 PR 顺带产出的:仓库历史里这个 flake 被反复遇到,但没有一条处置约定,于是每次都要重新判断一次。现在写进了 §1。