一键导入
ai-commenting
AI-native code annotation protocol that encodes intent, risk, dependencies, constraints, and test expectations in machine-parseable comments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
AI-native code annotation protocol that encodes intent, risk, dependencies, constraints, and test expectations in machine-parseable comments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Professional Codex-native multi-agent code review with confidence scoring
架构规划专家 - 使用 Codex 本地上下文、仓库证据和只读 child agent 进行大型系统架构设计与规划。
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.
Imported from everything-codex command checkpoint
Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.
Use when the user explicitly asks for Conductor, wants track/spec/plan/review artifacts on disk, or needs long-lived project context management. Prefer start-dev for small or one-off tasks. If Conductor is not configured in the project, start with setup.
| name | ai-commenting |
| description | AI-native code annotation protocol that encodes intent, risk, dependencies, constraints, and test expectations in machine-parseable comments. |
| argument-hint | <goal or target files> |
| version | 0.1.0 |
| source | fork |
| checksum | ca16bb171ceaace27e13b28e28d344426fec1ee87291f4fba9c50e01ea2390bb |
| updated_at | "2026-02-26T01:42:09.000Z" |
| layer | utility |
Codex supports native subagents. Delegate with spawn_agent, coordinate with send_input, collect via wait_agent, and clean up with close_agent.
Execution preference:
[ANALYST]/[ARCHITECT]/[EXECUTOR]/[REVIEWER] structure in a single response.Minimal orchestration pattern:
spawn_agent -> send_input (optional) -> wait_agent -> close_agent
Create and maintain AI-native annotations so models can understand project intent quickly and safely, not just code syntax.
Traditional comments are optimized for human reading, but LLM coding agents need dense, structured context to avoid unsafe edits and repeated discovery work.
This skill defines a compact annotation protocol that turns files into a machine-readable context layer for:
Use these principles when writing AI annotations:
why and constraints, not obvious what.Canonical format (single line):
/*@ai:key=value|key=value|key=value*/
Rules:
|.=.AuthService, integration, p95<200ms).Core fields (recommended at file level):
risk=1-5: change risk (5 is highest)core=<domain>: core responsibility (UserCRUD, BillingLedger)deps=<A,B,C>: critical dependenciesintent=<why>: non-obvious business intenttest=<unit|integration|e2e|contract>: minimum test gateExtended fields (use when needed):
chain=<A->B->C>: business or data flow chainasync=<low|medium|complex>: async/concurrency complexityapi=<internal|external>: API boundary typeauth=<none|required|strict>: authorization levelinvariant=<must_hold>: critical invariantsidefx=<db,cache,queue,event>: side effectsperf=<budget>: performance constraint (p95<200ms)security=<pii|payment|secret|none>: security sensitivityowner=<team_or_module>: ownership hintrollback=<strategy>: safe fallback strategyticket=<id>: change traceabilityOptional maintenance fields:
lines=<N|500+>: file size hintupdated=<YYYY-MM-DD>: annotation freshnessrisk present)risk=1: isolated logic, low coupling, fast rollbackrisk=2: local impact, clear tests, low side effectsrisk=3: moderate coupling or external contract dependencyrisk=4: cross-module critical path, data/auth impactrisk=5: security/payment/core-state changes, high blast radiusEscalate risk by +1 when any condition applies:
For high-value modules, ensure annotations expose these context dimensions:
intent, core)invariant, perf, security)deps, chain, sidefx)api, auth)test)risk, rollback, owner)If the model can read these fields, it can plan edits with less guesswork.
Use a two-layer strategy:
risk, core, deps, intent, test.invariant, auth, sidefx, perf).Do not annotate every function. Keep density high-signal.
Example from your draft (fully valid):
/*@ai:risk=4|deps=UserModel,AuthService,Database|lines=500+|core=UserCRUD*/
/*@ai:chain=Auth->User->Permission->Audit|async=complex|test=integration*/
class UserManager {
// ...
}
Recommended enriched version:
/*@ai:risk=5|core=UserCRUD|intent=protect_user_consistency|deps=UserModel,AuthService,AuditService*/
/*@ai:chain=Auth->User->Permission->Audit|auth=strict|sidefx=db,event|test=integration|rollback=feature_flag*/
class UserManager {
/*@ai:risk=4|invariant=user_id_unique|security=pii|perf=p95<200ms*/
async deleteUser(userId: string) {
// ...
}
}
When asked to annotate a module:
/*@ai:...*/ format.test and rollback are present for risk>=4.Minimum acceptance:
risk>=4 files have file-level @ai annotations.risk>=4 block includes test or inherits explicit file-level test.security!=none implies auth!=none and a rollback strategy.updated= recommended).Density guidance:
Avoid:
auth=none and security=pii).intent.Use these regex patterns when extracting annotations:
const aiTagPattern = /\/\*@ai:([^*]+)\*\//g;
const fieldPattern = /(\w+)=([^|*]+)/g;
Normalize output to key-value JSON for downstream retrieval and risk maps.
When this skill completes, return:
Result summary: what annotation protocol was appliedFiles changed: absolute file pathsValidation evidence: parser/lint/check commands and outcomesRisks / next actions: unresolved safety/test gaps