add-coder 0.3.26 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +282 -155
- package/dist/index.js +481 -209
- package/package.json +15 -4
- package/templates/.add-coder-src-hash.json +186 -185
- package/templates/adapters/claude/hooks/doc-format-guard.ts +32 -0
- package/templates/adapters/claude/hooks/lib/claude-env.ts +7 -0
- package/templates/adapters/claude/hooks/notification.ts +24 -0
- package/templates/adapters/claude/hooks/permission-denied.ts +33 -0
- package/templates/adapters/claude/hooks/permission-gate.ts +12 -0
- package/templates/adapters/claude/hooks/post-tool-failure.ts +4 -0
- package/templates/adapters/claude/hooks/post-tool-use.ts +17 -0
- package/templates/adapters/claude/hooks/pre-compact.ts +10 -0
- package/templates/adapters/claude/hooks/pre-tool-use.ts +81 -0
- package/templates/adapters/claude/hooks/prompt-submit.ts +82 -0
- package/templates/adapters/claude/hooks/review-checklist.ts +4 -0
- package/templates/adapters/claude/hooks/session-end.ts +10 -0
- package/templates/adapters/claude/hooks/session-start.ts +24 -0
- package/templates/adapters/claude/hooks/stop-check.ts +15 -0
- package/templates/adapters/claude/hooks/stop-failure.ts +34 -0
- package/templates/adapters/claude/hooks/subagent-guard.ts +25 -0
- package/templates/adapters/claude/hooks/subagent-stop.ts +12 -0
- package/templates/adapters/claude/settings.json +13 -13
- package/templates/adapters/codex/config.toml.example +12 -0
- package/templates/adapters/codex/hooks/doc-format-guard.ts +30 -0
- package/templates/adapters/codex/hooks/notification.ts +26 -0
- package/templates/adapters/codex/hooks/permission-gate.ts +15 -0
- package/templates/adapters/codex/hooks/post-tool-failure.ts +14 -0
- package/templates/adapters/codex/hooks/post-tool-use.ts +85 -0
- package/templates/adapters/codex/hooks/pre-compact.ts +20 -0
- package/templates/adapters/codex/hooks/pre-tool-use.ts +141 -0
- package/templates/adapters/codex/hooks/prompt-submit.ts +38 -0
- package/templates/adapters/codex/hooks/review-checklist.ts +5 -0
- package/templates/adapters/codex/hooks/session-end.ts +19 -0
- package/templates/adapters/codex/hooks/session-start.ts +45 -0
- package/templates/adapters/codex/hooks/stop-check.ts +59 -0
- package/templates/adapters/codex/hooks/subagent-guard.ts +22 -0
- package/templates/adapters/codex/hooks/subagent-stop.ts +20 -0
- package/templates/adapters/codex/hooks.json +67 -1
- package/templates/adapters/qoder/hooks/doc-format-guard.ts +34 -0
- package/templates/adapters/qoder/hooks/lib/context-inject.ts +61 -0
- package/templates/adapters/qoder/hooks/lib/qoder-env.ts +23 -0
- package/templates/adapters/qoder/hooks/lib/review-checklist.ts +5 -0
- package/templates/adapters/qoder/hooks/notification.ts +34 -0
- package/templates/adapters/qoder/hooks/permission-gate.ts +26 -0
- package/templates/adapters/qoder/hooks/post-tool-failure.ts +30 -0
- package/templates/adapters/qoder/hooks/post-tool-use.ts +32 -0
- package/templates/adapters/qoder/hooks/pre-compact.ts +16 -0
- package/templates/adapters/qoder/hooks/pre-tool-use.ts +112 -0
- package/templates/adapters/qoder/hooks/prompt-submit.ts +66 -0
- package/templates/adapters/qoder/hooks/review-checklist.ts +24 -0
- package/templates/adapters/qoder/hooks/session-end.ts +27 -0
- package/templates/adapters/qoder/hooks/session-start.ts +83 -0
- package/templates/adapters/qoder/hooks/stop-check.ts +69 -0
- package/templates/adapters/qoder/hooks/subagent-guard.ts +16 -0
- package/templates/adapters/qoder/hooks/subagent-stop.ts +33 -0
- package/templates/adapters/qoder/settings.json +13 -13
- package/templates/adapters/trae/hooks/doc-format-guard.ts +30 -0
- package/templates/adapters/trae/hooks/notification.ts +22 -0
- package/templates/adapters/trae/hooks/permission-gate.ts +15 -0
- package/templates/adapters/trae/hooks/post-tool-failure.ts +14 -0
- package/templates/adapters/trae/hooks/post-tool-use.ts +24 -0
- package/templates/adapters/trae/hooks/pre-compact.ts +15 -0
- package/templates/adapters/trae/hooks/pre-tool-use.ts +40 -0
- package/templates/adapters/trae/hooks/prompt-submit.ts +29 -0
- package/templates/adapters/trae/hooks/review-checklist.ts +5 -0
- package/templates/adapters/trae/hooks/session-end.ts +16 -0
- package/templates/adapters/trae/hooks/session-start.ts +15 -0
- package/templates/adapters/trae/hooks/stop-check.ts +20 -0
- package/templates/adapters/trae/hooks/subagent-guard.ts +22 -0
- package/templates/adapters/trae/hooks/subagent-stop.ts +15 -0
- package/templates/adapters/trae/hooks.json +1 -1
- package/templates/adapters/vscode/hooks/doc-format-guard.ts +27 -0
- package/templates/adapters/vscode/hooks/notification.ts +22 -0
- package/templates/adapters/vscode/hooks/permission-gate.ts +15 -0
- package/templates/adapters/vscode/hooks/post-tool-failure.ts +32 -0
- package/templates/adapters/vscode/hooks/post-tool-use.ts +25 -0
- package/templates/adapters/vscode/hooks/pre-compact.ts +15 -0
- package/templates/adapters/vscode/hooks/pre-tool-use.ts +78 -0
- package/templates/adapters/vscode/hooks/prompt-submit.ts +74 -0
- package/templates/adapters/vscode/hooks/review-checklist.ts +5 -0
- package/templates/adapters/vscode/hooks/session-end.ts +16 -0
- package/templates/adapters/vscode/hooks/session-start.ts +24 -0
- package/templates/adapters/vscode/hooks/stop-check.ts +21 -0
- package/templates/adapters/vscode/hooks/subagent-guard.ts +21 -0
- package/templates/adapters/vscode/hooks/subagent-stop.ts +15 -0
- package/templates/core/docs/ADD-governance-claude-code.md +4 -4
- package/templates/core/docs/ADD-governance-codex.md +6 -6
- package/templates/core/docs/ADD-governance-qoder-cn.md +5 -5
- package/templates/core/docs/ADD-governance-trae.md +3 -3
- package/templates/core/docs/ADD-governance-vscode-copilot.md +22 -23
- package/templates/core/governance/audit-bridge.ts +47 -0
- package/templates/core/governance/common.ts +299 -0
- package/templates/core/governance/context-inject.ts +53 -0
- package/templates/core/governance/doc-format-guard.ts +440 -0
- package/templates/core/governance/notification-router.ts +62 -0
- package/templates/core/governance/notify.ts +66 -0
- package/templates/core/governance/permission-gate-router.ts +42 -0
- package/templates/core/governance/post-tool-failure-router.ts +56 -0
- package/templates/core/governance/post-tool-router.ts +212 -0
- package/templates/core/governance/pre-compact-guard.ts +41 -0
- package/templates/core/governance/pre-tool-guard.ts +309 -0
- package/templates/core/governance/preload-templates.ts +241 -0
- package/templates/core/governance/prompt-router.ts +222 -0
- package/templates/core/governance/review-checklist-guard.ts +186 -0
- package/templates/core/governance/rules.ts +720 -0
- package/templates/core/governance/session-end.ts +88 -0
- package/templates/core/governance/session-start-guard.ts +99 -0
- package/templates/core/governance/state-detect.ts +6 -0
- package/templates/core/governance/stop-router.ts +140 -0
- package/templates/core/governance/subagent-guard-router.ts +35 -0
- package/templates/core/governance/subagent-stop-router.ts +93 -0
- package/templates/core/governance/subagent-stop.ts +75 -0
- package/templates/core/governance/vocabulary.ts +109 -0
- package/templates/core/hooks/doc-format-guard.ts +21 -0
- package/templates/core/hooks/notification.ts +11 -0
- package/templates/core/hooks/permission-gate.ts +7 -0
- package/templates/core/hooks/post-tool-failure.ts +7 -0
- package/templates/core/hooks/post-tool-use.ts +23 -0
- package/templates/core/hooks/pre-compact.ts +9 -0
- package/templates/core/hooks/pre-tool-use.ts +30 -0
- package/templates/core/hooks/prompt-submit.ts +11 -0
- package/templates/core/hooks/review-checklist.ts +4 -0
- package/templates/core/hooks/session-end.ts +10 -0
- package/templates/core/hooks/session-start.ts +9 -0
- package/templates/core/hooks/stop-check.ts +14 -0
- package/templates/core/hooks/subagent-guard.ts +8 -0
- package/templates/core/hooks/subagent-stop.ts +9 -0
- package/templates/core/prisma/add.prisma +140 -82
- package/templates/core/rules/project_rules.md +27 -24
- package/templates/core/scripts/db-ensure.sh +8 -0
- package/templates/core/scripts/gen-plan-index.sh +4 -15
- package/templates/core/scripts/mcp-server/notifications/hitl.ts +9 -1
- package/templates/core/scripts/mcp-server/notifications/hook.ts +25 -9
- package/templates/core/scripts/mcp-server/resources/hitl-approval-widget.ts +34 -0
- package/templates/core/scripts/mcp-server/resources/hook-events-report.ts +14 -2
- package/templates/core/scripts/mcp-server/resources/index.ts +2 -0
- package/templates/core/scripts/mcp-server/sampling/review.ts +25 -10
- package/templates/core/scripts/mcp-server/shared/db-types.ts +33 -8
- package/templates/core/scripts/mcp-server/shared/dps-scoring.strategy.ts +1 -1
- package/templates/core/scripts/mcp-server/shared/env.ts +28 -8
- package/templates/core/scripts/mcp-server/shared/fs.ts +3 -0
- package/templates/core/scripts/mcp-server/shared/hitl-interaction.strategy.ts +2 -3
- package/templates/core/scripts/mcp-server/shared/hitl-lifecycle-mutation.ts +129 -0
- package/templates/core/scripts/mcp-server/shared/hitl-proposal-mutation.ts +98 -0
- package/templates/core/scripts/mcp-server/shared/hitl-ui.ts +3 -0
- package/templates/core/scripts/mcp-server/shared/plan-lifecycle-events.ts +62 -0
- package/templates/core/scripts/mcp-server/shared/plan-lifecycle-mutation.ts +78 -0
- package/templates/core/scripts/mcp-server/shared/plan-lifecycle-subscriber.ts +145 -0
- package/templates/core/scripts/mcp-server/shared/plan-lifecycle.ts +153 -0
- package/templates/core/scripts/mcp-server/shared/plan-round-events.ts +56 -0
- package/templates/core/scripts/mcp-server/shared/plan-round-mutation.ts +143 -0
- package/templates/core/scripts/mcp-server/shared/plan-round-store.ts +47 -0
- package/templates/core/scripts/mcp-server/shared/plan-round-subscriber.ts +99 -0
- package/templates/core/scripts/mcp-server/shared/plan-status-store.ts +37 -0
- package/templates/core/scripts/mcp-server/shared/plan-tracking-mutation.ts +71 -0
- package/templates/core/scripts/mcp-server/shared/prisma.ts +12 -6
- package/templates/core/scripts/mcp-server/shared/project-root-strategy.ts +1 -2
- package/templates/core/scripts/mcp-server/shared/quant-recheck.strategy.ts +16 -0
- package/templates/core/scripts/mcp-server/shared/redact.ts +28 -0
- package/templates/core/scripts/mcp-server/shared/response.ts +3 -2
- package/templates/core/scripts/mcp-server/shared/runtime-context.ts +77 -0
- package/templates/core/scripts/mcp-server/shared/schema-topology.ts +159 -0
- package/templates/core/scripts/mcp-server/tools/audit.ts +49 -7
- package/templates/core/scripts/mcp-server/tools/context.ts +117 -121
- package/templates/core/scripts/mcp-server/tools/contract.ts +34 -9
- package/templates/core/scripts/mcp-server/tools/gateway/check_add_route_status.ts +50 -3
- package/templates/core/scripts/mcp-server/tools/gateway/check_doc_similarity.ts +218 -0
- package/templates/core/scripts/mcp-server/tools/gateway/check_dps.ts +22 -7
- package/templates/core/scripts/mcp-server/tools/gateway/check_rahs.ts +86 -4
- package/templates/core/scripts/mcp-server/tools/gateway/check_spec_sync.ts +19 -6
- package/templates/core/scripts/mcp-server/tools/gateway/index.ts +2 -0
- package/templates/core/scripts/mcp-server/tools/hitl.ts +160 -75
- package/templates/core/scripts/mcp-server/tools/hook-event-report.ts +9 -2
- package/templates/core/scripts/mcp-server/tools/index.ts +69 -3
- package/templates/core/scripts/mcp-server/tools/plan.ts +152 -17
- package/templates/core/scripts/mcp-server/tools/review.ts +44 -15
- package/templates/core/scripts/mcp-server.ts +60 -1
- package/templates/core/scripts/plan-status-bridge.ts +26 -0
- package/templates/core/skills/add-paradigm/SKILL.md +2 -2
- package/templates/core/templates/add-route-template.schema.json +24 -56
- package/templates/core/templates/collab-contract-template.md +1 -1
- package/templates/core/templates/handoff-multi-round-template.schema.json +48 -0
- package/templates/core/templates/handoff-single-round-template.schema.json +92 -0
- package/templates/core/templates/handoff-single-round.schema.json +1 -1
- package/templates/core/templates/hitl-approval-widget.html +222 -37
- package/templates/core/templates/spec-template.schema.json +9 -46
- package/templates/core/templates/standard-plan-template.schema.json +1 -1
- package/templates/core/templates/tasks-template.schema.json +13 -54
- package/templates/adapters/claude/hooks/doc-format-guard.sh +0 -202
- package/templates/adapters/claude/hooks/lib/common.sh +0 -261
- package/templates/adapters/claude/hooks/lib/context-inject.sh +0 -96
- package/templates/adapters/claude/hooks/lib/notify.sh +0 -34
- package/templates/adapters/claude/hooks/lib/preload-templates.sh +0 -187
- package/templates/adapters/claude/hooks/lib/session-end.sh +0 -76
- package/templates/adapters/claude/hooks/lib/state-detect.sh +0 -117
- package/templates/adapters/claude/hooks/lib/subagent-stop.sh +0 -90
- package/templates/adapters/claude/hooks/lib/vocabulary.sh +0 -56
- package/templates/adapters/claude/hooks/notification.sh +0 -45
- package/templates/adapters/claude/hooks/permission-denied.sh +0 -42
- package/templates/adapters/claude/hooks/permission-gate.sh +0 -18
- package/templates/adapters/claude/hooks/post-tool-failure.sh +0 -10
- package/templates/adapters/claude/hooks/post-tool-use.sh +0 -35
- package/templates/adapters/claude/hooks/pre-compact.sh +0 -37
- package/templates/adapters/claude/hooks/pre-tool-use.sh +0 -153
- package/templates/adapters/claude/hooks/prompt-submit.sh +0 -99
- package/templates/adapters/claude/hooks/review-checklist.sh +0 -10
- package/templates/adapters/claude/hooks/session-end.sh +0 -21
- package/templates/adapters/claude/hooks/session-start.sh +0 -36
- package/templates/adapters/claude/hooks/stop-check.sh +0 -45
- package/templates/adapters/claude/hooks/stop-failure.sh +0 -44
- package/templates/adapters/claude/hooks/subagent-guard.sh +0 -36
- package/templates/adapters/claude/hooks/subagent-stop.sh +0 -20
- package/templates/adapters/codex/hooks/doc-format-guard.sh +0 -261
- package/templates/adapters/codex/hooks/lib/common.sh +0 -261
- package/templates/adapters/codex/hooks/lib/context-inject.sh +0 -96
- package/templates/adapters/codex/hooks/lib/notify.sh +0 -34
- package/templates/adapters/codex/hooks/lib/preload-templates.sh +0 -187
- package/templates/adapters/codex/hooks/lib/session-end.sh +0 -76
- package/templates/adapters/codex/hooks/lib/state-detect.sh +0 -117
- package/templates/adapters/codex/hooks/lib/subagent-stop.sh +0 -90
- package/templates/adapters/codex/hooks/lib/vocabulary.sh +0 -56
- package/templates/adapters/codex/hooks/notification.sh +0 -45
- package/templates/adapters/codex/hooks/permission-gate.sh +0 -18
- package/templates/adapters/codex/hooks/post-tool-failure.sh +0 -10
- package/templates/adapters/codex/hooks/post-tool-use.sh +0 -138
- package/templates/adapters/codex/hooks/pre-compact.sh +0 -37
- package/templates/adapters/codex/hooks/pre-tool-use.sh +0 -217
- package/templates/adapters/codex/hooks/prompt-submit.sh +0 -87
- package/templates/adapters/codex/hooks/review-checklist.sh +0 -10
- package/templates/adapters/codex/hooks/session-end.sh +0 -38
- package/templates/adapters/codex/hooks/session-start.sh +0 -53
- package/templates/adapters/codex/hooks/stop-check.sh +0 -45
- package/templates/adapters/codex/hooks/subagent-guard.sh +0 -15
- package/templates/adapters/codex/hooks/subagent-stop.sh +0 -47
- package/templates/adapters/qoder/hooks/doc-format-guard.sh +0 -260
- package/templates/adapters/qoder/hooks/lib/common.sh +0 -261
- package/templates/adapters/qoder/hooks/lib/context-inject.sh +0 -96
- package/templates/adapters/qoder/hooks/lib/notify.sh +0 -34
- package/templates/adapters/qoder/hooks/lib/preload-templates.sh +0 -187
- package/templates/adapters/qoder/hooks/lib/session-end.sh +0 -76
- package/templates/adapters/qoder/hooks/lib/state-detect.sh +0 -117
- package/templates/adapters/qoder/hooks/lib/subagent-stop.sh +0 -90
- package/templates/adapters/qoder/hooks/lib/vocabulary.sh +0 -56
- package/templates/adapters/qoder/hooks/notification.sh +0 -25
- package/templates/adapters/qoder/hooks/permission-gate.sh +0 -8
- package/templates/adapters/qoder/hooks/post-tool-failure.sh +0 -8
- package/templates/adapters/qoder/hooks/post-tool-use.sh +0 -121
- package/templates/adapters/qoder/hooks/pre-compact.sh +0 -37
- package/templates/adapters/qoder/hooks/pre-tool-use.sh +0 -154
- package/templates/adapters/qoder/hooks/prompt-submit.sh +0 -96
- package/templates/adapters/qoder/hooks/review-checklist.sh +0 -157
- package/templates/adapters/qoder/hooks/session-end.sh +0 -24
- package/templates/adapters/qoder/hooks/session-start.sh +0 -45
- package/templates/adapters/qoder/hooks/stop-check.sh +0 -48
- package/templates/adapters/qoder/hooks/subagent-guard.sh +0 -27
- package/templates/adapters/qoder/hooks/subagent-stop.sh +0 -26
- package/templates/adapters/trae/hooks/doc-format-guard.sh +0 -261
- package/templates/adapters/trae/hooks/lib/common.sh +0 -261
- package/templates/adapters/trae/hooks/lib/context-inject.sh +0 -96
- package/templates/adapters/trae/hooks/lib/notify.sh +0 -34
- package/templates/adapters/trae/hooks/lib/preload-templates.sh +0 -187
- package/templates/adapters/trae/hooks/lib/session-end.sh +0 -76
- package/templates/adapters/trae/hooks/lib/state-detect.sh +0 -117
- package/templates/adapters/trae/hooks/lib/subagent-stop.sh +0 -90
- package/templates/adapters/trae/hooks/lib/vocabulary.sh +0 -56
- package/templates/adapters/trae/hooks/notification.sh +0 -45
- package/templates/adapters/trae/hooks/permission-gate.sh +0 -18
- package/templates/adapters/trae/hooks/post-tool-failure.sh +0 -10
- package/templates/adapters/trae/hooks/post-tool-use.sh +0 -138
- package/templates/adapters/trae/hooks/pre-compact.sh +0 -37
- package/templates/adapters/trae/hooks/pre-tool-use.sh +0 -217
- package/templates/adapters/trae/hooks/prompt-submit.sh +0 -87
- package/templates/adapters/trae/hooks/review-checklist.sh +0 -10
- package/templates/adapters/trae/hooks/session-end.sh +0 -38
- package/templates/adapters/trae/hooks/session-start.sh +0 -53
- package/templates/adapters/trae/hooks/stop-check.sh +0 -45
- package/templates/adapters/trae/hooks/subagent-guard.sh +0 -15
- package/templates/adapters/trae/hooks/subagent-stop.sh +0 -47
- package/templates/adapters/vscode/hooks/doc-format-guard.sh +0 -201
- package/templates/adapters/vscode/hooks/lib/common.sh +0 -261
- package/templates/adapters/vscode/hooks/lib/context-inject.sh +0 -96
- package/templates/adapters/vscode/hooks/lib/notify.sh +0 -34
- package/templates/adapters/vscode/hooks/lib/preload-templates.sh +0 -187
- package/templates/adapters/vscode/hooks/lib/session-end.sh +0 -76
- package/templates/adapters/vscode/hooks/lib/state-detect.sh +0 -117
- package/templates/adapters/vscode/hooks/lib/subagent-stop.sh +0 -90
- package/templates/adapters/vscode/hooks/lib/vocabulary.sh +0 -56
- package/templates/adapters/vscode/hooks/notification.sh +0 -45
- package/templates/adapters/vscode/hooks/permission-gate.sh +0 -18
- package/templates/adapters/vscode/hooks/post-tool-failure.sh +0 -28
- package/templates/adapters/vscode/hooks/post-tool-use.sh +0 -35
- package/templates/adapters/vscode/hooks/pre-compact.sh +0 -37
- package/templates/adapters/vscode/hooks/pre-tool-use.sh +0 -153
- package/templates/adapters/vscode/hooks/prompt-submit.sh +0 -99
- package/templates/adapters/vscode/hooks/review-checklist.sh +0 -10
- package/templates/adapters/vscode/hooks/session-end.sh +0 -13
- package/templates/adapters/vscode/hooks/session-start.sh +0 -35
- package/templates/adapters/vscode/hooks/stop-check.sh +0 -53
- package/templates/adapters/vscode/hooks/subagent-guard.sh +0 -37
- package/templates/adapters/vscode/hooks/subagent-stop.sh +0 -12
- package/templates/core/hooks/doc-format-guard.sh +0 -261
- package/templates/core/hooks/lib/common.sh +0 -261
- package/templates/core/hooks/lib/context-inject.sh +0 -96
- package/templates/core/hooks/lib/notify.sh +0 -34
- package/templates/core/hooks/lib/preload-templates.sh +0 -187
- package/templates/core/hooks/lib/session-end.sh +0 -76
- package/templates/core/hooks/lib/state-detect.sh +0 -117
- package/templates/core/hooks/lib/subagent-stop.sh +0 -90
- package/templates/core/hooks/lib/vocabulary.sh +0 -56
- package/templates/core/hooks/notification.sh +0 -45
- package/templates/core/hooks/permission-gate.sh +0 -18
- package/templates/core/hooks/post-tool-failure.sh +0 -10
- package/templates/core/hooks/post-tool-use.sh +0 -138
- package/templates/core/hooks/pre-compact.sh +0 -37
- package/templates/core/hooks/pre-tool-use.sh +0 -217
- package/templates/core/hooks/prompt-submit.sh +0 -87
- package/templates/core/hooks/review-checklist.sh +0 -10
- package/templates/core/hooks/session-end.sh +0 -38
- package/templates/core/hooks/session-start.sh +0 -53
- package/templates/core/hooks/stop-check.sh +0 -45
- package/templates/core/hooks/subagent-guard.sh +0 -15
- package/templates/core/hooks/subagent-stop.sh +0 -47
- package/templates/shared/hooks-lib/common.sh +0 -22
package/README.md
CHANGED
|
@@ -11,82 +11,20 @@ Make 0.75 into one.
|
|
|
11
11
|
> 👍 星星之火可以燎原,让我们一起点赞
|
|
12
12
|
[add-coder](https://github.com/xiaomingming92/add-coder)吧!
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
# 0.1.0 发布于2026-07-10 04:11 UTC(北京时间当天上午 12:11)至 2026-07-28 累计突破 5000 次下载,**首次过死亡谷耗时 19 天**。
|
|
16
|
-
~ $ curl -s https://api.npmjs.org/downloads/point/last-month/add-coder
|
|
17
|
-
{
|
|
18
|
-
"downloads": 5161,
|
|
19
|
-
"start": "2026-06-29",
|
|
20
|
-
"end": "2026-07-28",
|
|
21
|
-
"package": "add-coder"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
~ $ npm info add-coder@0.1.0
|
|
25
|
-
|
|
26
|
-
add-coder@0.1.0 | MIT | deps: 3 | versions: 35
|
|
27
|
-
Initialize ADD paradigm workflow templates for
|
|
28
|
-
Claude Code, Qoder, and VS Code.
|
|
29
|
-
|
|
30
|
-
keywords:
|
|
31
|
-
add, add-paradigm, claude, qoder, vscode, mcp,
|
|
32
|
-
workflow, codein2027, 集中裁决层, caijuehub
|
|
33
|
-
|
|
34
|
-
bin: add-coder
|
|
35
|
-
|
|
36
|
-
dist
|
|
37
|
-
.tarball: https://registry.npmjs.org/add-coder/-/add-coder-0.1.0.tgz
|
|
38
|
-
.shasum: 3266ddb5304d303705694edec7c2f41efc24881d
|
|
39
|
-
.integrity: sha512-MxFICLEoAgTVxnHaiIOli5eVyCXvB+xnSzpfmu0mrigEeM9NxzBOm2Auzjn1GKUTXSWelT0FecwwlYmsCf+TWQ==
|
|
40
|
-
.unpackedSize: 704.9 kB
|
|
41
|
-
|
|
42
|
-
dependencies:
|
|
43
|
-
zod: ^3.24.0
|
|
44
|
-
commander: ^13.1.0
|
|
45
|
-
smol-toml: ^1.7.0
|
|
46
|
-
|
|
47
|
-
maintainers:
|
|
48
|
-
- wujixmm <wujixmm@gmail.com>
|
|
49
|
-
|
|
50
|
-
dist-tags:
|
|
51
|
-
latest: 0.3.5
|
|
52
|
-
preview: 0.3.6-feature-hitl-enhance-v1.2
|
|
53
|
-
|
|
54
|
-
published 2 weeks ago by wujixmm <wujixmm@gmail.com>
|
|
55
|
-
```
|
|
14
|
+
> 🎉 **里程碑**:0.1.0 发布后 **19 天累计突破 5000 次下载**(首次过死亡谷)。完整 npm 实况数据(下载曲线、依赖、版本矩阵)见文末 [📊 npm 实况数据](#-npm-实况数据)。
|
|
56
15
|
|
|
57
16
|
|
|
58
17
|
---
|
|
59
18
|
|
|
60
|
-
> ## ⚠️
|
|
61
|
-
>
|
|
62
|
-
> add-coder 无意于搞各家厂商的对抗叙事。以下内容仅为**基于各家官方公开条款原文的事实摘录**,目的是让开发者在选择 AI 编程 IDE 前知情。条款可能随时变更,请以官方最新版本为准。
|
|
19
|
+
> ## ⚠️ 数据共享知情
|
|
63
20
|
>
|
|
64
|
-
>
|
|
65
|
-
> |------|---------|------------------------|---------------------|------|----------|
|
|
66
|
-
> | **Qoder** | BRIGHT ZENITH PTE. LTD.(新加坡) | 用户内容(含聊天、编程及智能体会话的输入/输出,即含代码)默认用于"研究、开发和改进我们的服务",保留期最长 5 年;条款文本称可关闭"共享与改进"(Share & Improve)退出,**但关闭前已为上述目的处理的数据仍保留和使用**;数据跨境存储于美国/新加坡/日本 | 实测为强制隐私共享模式,界面无有效切换入口 | [Qoder 隐私政策](https://qoder.com/zh/privacy-policy) | 2026-05-12 / 2026-08-04 |
|
|
67
|
-
> | **Qoder CN** | 阿里云(通义灵码系列) | 官方 FAQ 称:仅在用户点赞/点踩后,针对聊天记录(不包含代码)脱敏去标识化处理,用于算法升级与迭代 | **实测(v1.10.0):强制隐私共享模式,无切换功能**;官方 CLI 配置(`~/.qoder-cn/settings.json`)中亦无共享/改进开关项 | [阿里云帮助中心 FAQ](https://help.aliyun.com/zh/lingma/qoder-cn/support/faq) | 2026-07-15 / 2026-08-04 |
|
|
68
|
-
> | **Trae CN** | 北京引力弹弓科技有限公司(字节跳动) | 服务所收集的数据经加密、严格去标识化且无法重新识别个人后,**可能用于模型训练**以优化模型效果与产品体验;可通过隐私模式"限制"该数据使用;代码文件不提供给其他第三方 | — | [Trae 隐私协议](https://www.trae.cn/privacy-policy) | 现行版 / 2026-08-04 |
|
|
69
|
-
>
|
|
70
|
-
> **要点**:三家官方条款均为"**默认开启共享、需用户主动退出**"(opt-out)模式。**但产品实测层面**:Qoder / Qoder CN 的退出开关在实际产品中不可用(Qoder CN v1.10.0 无切换功能,CLI 配置亦无对应开关),条款上的退出承诺在 CN 产品中无落地入口,实际效果即强制共享。Qoder 明确将用户内容(含代码)用于改进服务并保留 5 年;Trae 明确将数据用于模型训练(可通过隐私模式限制);Qoder CN 官方条款范围最窄(仅反馈后的聊天记录、不含代码)。
|
|
71
|
-
>
|
|
72
|
-
> **建议**:涉及商业机密或个人数据的项目,使用前请逐项核对官方条款,并主动检查产品设置:Qoder(国际版)尝试关闭"共享与改进";Qoder CN(v1.10.0 实测无开关)与 Trae CN 请结合隐私模式与最小化输入策略使用;必要时改用数据完全本地化的替代方案。
|
|
21
|
+
> 主流 AI 编程 IDE(Qoder / Qoder CN / Trae CN)多为「**默认开启共享、需用户主动退出**」模式,部分 CN 产品实测**无退出入口**。涉及商业机密的项目请逐项核对官方条款——[完整知情清单](#-数据共享知情清单完整版)。
|
|
73
22
|
|
|
74
23
|
---
|
|
75
|
-
> ### 🔮 下一步:add-coder IDE 插件(实施中)
|
|
76
24
|
|
|
77
|
-
> add-coder
|
|
78
|
-
> 下一阶段会以 **IDE 插件** 形式落地,让治理能力直接嵌在编辑与 Agent 生命周期里。
|
|
79
|
-
>
|
|
80
|
-
> **为什么值得期待:**
|
|
81
|
-
>
|
|
82
|
-
> | 维度 | 说明 |
|
|
83
|
-
> |------|------|
|
|
84
|
-
> | **范式优势** | 不是「更好用的补全」,而是把规则、证据、审批、回溯做成一等公民。改规则不改代码,跨轮不靠聊天记忆。 |
|
|
85
|
-
> | **与 LLM 低耦合** | 核心是结构与门禁,不是绑死某一家模型。换模型不换治理逻辑;模型只负责生成,裁决与审计由范式层承担。 |
|
|
86
|
-
> | **与 IDE 低耦合** | 治理逻辑统一,适配层分离。今天支持 Claude Code / Qoder / VS Code / Trae / Codex,明天换宿主只需加适配,不必重写规则与审计链。 |
|
|
87
|
-
> | **不收集用户隐私** | 不上传代码、对话与项目数据。审计与裁决默认留在本地 / 你自己的基础设施里,不做「默认共享、事后退出」。 |
|
|
25
|
+
> ### 🔮 下一步:add-coder IDE 插件(实施中)
|
|
88
26
|
>
|
|
89
|
-
>
|
|
27
|
+
> 治理能力直接嵌入编辑与 Agent 生命周期:规则/证据/审批/回溯做成一等公民;不收集用户隐私,任意 IDE + 任意 LLM 同跑一套可审计、可收敛的 ADD——[完整预告](#-ide-插件预告完整版)。
|
|
90
28
|
|
|
91
29
|
---
|
|
92
30
|
|
|
@@ -121,15 +59,16 @@ npx add-coder init
|
|
|
121
59
|
| 审计靠开发者自觉记录 | **MCP 审计工具链** 自动记录每次操作,系统闸门强制检查 |
|
|
122
60
|
| 无关联性 | 审计事件天然关联 Plan → Spec → Task → Step → Tool Call,形成完整证据链 |
|
|
123
61
|
|
|
124
|
-
### ② Caijuehub
|
|
62
|
+
### ② Caijuehub 集中裁决层:规则供应链工厂
|
|
125
63
|
|
|
126
|
-
Caijuehub 是 add-coder
|
|
64
|
+
Caijuehub 是 add-coder 的集中裁决引擎:从 sync --patch 单域实验,到覆盖 HITL 审批和 DPS 评分的三域体系,再到**供应链工厂化**——整个 caijuehub 就是一条规则供应链:**TOML 原料 → 加工车间(transcribe 工厂链:统一 reader 校验 → factories → generators)→ 出厂质检(幂等自动化)→ 审批放行 → 分销消费**。新规则在 caijue.toml 登记即自动进产线(15 条产线零接线代码),扩展规则域不再复制粘贴样板。详见 [docs/caijuehub.md](./docs/caijuehub.md)。
|
|
127
65
|
|
|
128
66
|
| 裁决域 | 规则文件 | 消费者 | 说明 |
|
|
129
67
|
|--------|---------|--------|------|
|
|
130
68
|
| add-coder run sync --patch | `sync-rules.toml` | `sync.ts` | **npm 包史上首个集中裁决热更新案例**(eating my own dog food:add-coder 用 caijuehub 管理自己的模板同步) |
|
|
131
69
|
| HITL 审批 | `hitl-interaction-rules.toml` | `hitl.ts` | 每 IDE 独立声明交互模式 |
|
|
132
70
|
| DPS 评分 | `dps-scoring-rules.toml` | `gateway.ts` | 文档质量闸门:语义/熵/CPM/结构 四维权重+阈值,AI 调参不碰代码 |
|
|
71
|
+
| Hook 治理协议层 | `hook-{guard,doc-format,context,event,protocol}-rules.toml` ×5 | core governance | 拦截链/识别规则/象限文本/事件阈值/协议形态——五端共享单一真源,治理维护走控制面 |
|
|
133
72
|
|
|
134
73
|
> 📊 [sync-magic benchmark](./docs/sync-magic-benchmark-report.md):caijuehub 改造实测——4 组对比,TS vs bash,熵值 vs 速度的场景价值分析。
|
|
135
74
|
>
|
|
@@ -177,7 +116,7 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
|
|
|
177
116
|
- **Plan 索引** — 所有 Plan 通过 `index.md` 集中索引,支持模糊匹配快速定位
|
|
178
117
|
- **DevLog 时序记录** — 每一步操作写入 `{YYYY-MM}/{DD}/` 时间轴,可回溯任意历史状态
|
|
179
118
|
|
|
180
|
-
### ⑥ Policy-Update-Loop:治理自我进化
|
|
119
|
+
### ⑥ Policy-Update-Loop:治理自我进化
|
|
181
120
|
|
|
182
121
|
不是静态模板,而是**闭环自适应系统**:
|
|
183
122
|
|
|
@@ -185,21 +124,33 @@ AI 对话的致命缺陷:上次讨论的架构决策、已修复的 Bug、达
|
|
|
185
124
|
执行 → 审计 → 边界报告 → 规则调整 → 下一轮执行
|
|
186
125
|
```
|
|
187
126
|
|
|
188
|
-
|
|
127
|
+
**已落地的闭环环节**:
|
|
128
|
+
|
|
129
|
+
- **执行 → 审计(✓ 已接入)**:hook 拦截 / 文件写入事件 → jsonl → MCP 常驻消费 → DevOperation 落库(`HOOK_INTERCEPT`,幂等去重)——每个治理动作自动留痕,可回查可追溯
|
|
130
|
+
- **审计 → 规则调整(✓ 已接入)**:caijuehub 规则中心改规则不改代码——DPS 四维评分 **FFT 自适应权重**(随历史数据自动调权)、`check_doc_similarity` 量化复检(形似义异文档自动识别)——审计数据驱动治理规则演进
|
|
131
|
+
- **边界报告(Report 体系)**:Runtime 边界报告闭环待 DEMO 仓库演示——Policy-Update-Loop 与 Report 体系端到端实践
|
|
189
132
|
|
|
190
133
|
### ⑦ 多 IDE 的 Hook 即治理层
|
|
191
134
|
|
|
192
|
-
hook 不是「通知推送」,而是 **ADD 范式在 IDE agent 生命周期中的
|
|
135
|
+
hook 不是「通知推送」,而是 **ADD 范式在 IDE agent 生命周期中的 16 个确定性治理卡位**(14 通用 + 2 Claude 特有)。每个 IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)有各自的 hook 机制,但治理逻辑统一——架构一致,适配层不同。
|
|
136
|
+
|
|
137
|
+
**三层架构,能力可控可对齐可收敛**:
|
|
193
138
|
|
|
194
|
-
|
|
139
|
+
- **治理契约层**:16 个治理卡位的判定逻辑收敛为单一契约实现(生命周期裁决 / 本地治理隔离 / 命令精确判定 / 模板守卫 / 审计链路),六端共享,行为一致性由契约保证
|
|
140
|
+
- **Hook 独立实现**:各 IDE 事件机制差异(事件映射 / 输出形态 / 环境注入)由适配层隔离——IDE 能力演进只改适配层,治理语义零漂移,各端能力可随时对齐、可控收敛
|
|
141
|
+
- **控制面管理**:规则 / 阈值 / 提示文本由 caijuehub 规则中心声明式托管(hook-*.toml 真源 → 生成常量 → 产物内联)——改规则不改代码,治理维护走控制面,五端一致性由一致性矩阵持续验证
|
|
142
|
+
|
|
143
|
+
| IDE | 治理文档 | 注册事件 | Hook 配置(node 直调) |
|
|
195
144
|
|---|---|---|---|
|
|
196
|
-
| Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) |
|
|
197
|
-
| Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) |
|
|
198
|
-
| VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/
|
|
199
|
-
| Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/
|
|
200
|
-
| Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) |
|
|
145
|
+
| Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 11/16 | `.claude/hooks/*.mjs`(settings.json command) |
|
|
146
|
+
| Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 11/16 | `.qoder/hooks/*.mjs`(settings.json command) |
|
|
147
|
+
| VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/16 | `.vscode/hooks/*.mjs`(Agent Host 双通道) |
|
|
148
|
+
| Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/16 | `hooks.json` → `.trae/hooks/*.mjs` |
|
|
149
|
+
| Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 5/16 | `.codex/hooks.json` → `.codex/hooks/*.mjs` |
|
|
150
|
+
|
|
151
|
+
> **16 卡位六端占位已齐**:86 个 hook 入口产物全量分发到六端(14/16/14/14/14/14),治理契约层(core 基类)共享。「注册事件」为 IDE 原生事件模型可注册数——事件模型不足的端(Codex 5 / Trae 6)产物已占位,IDE 事件扩展后零代码启用。
|
|
201
152
|
|
|
202
|
-
> 实施 Plan: [add-coder-hook-full-alignment-plan-v1](./.qoder/plans/2026-07/17/add-coder-hook-full-alignment-plan-v1.md) | 触发源: [GitHub Issue #6](https://github.com/xiaomingming92/add-coder/issues/6)
|
|
153
|
+
> 实施 Plan: [add-coder-hook-node-refactor-plan-v1](./.qoder/plans/2026-08/14/add-coder-hook-node-refactor-plan-v1.md)(协议层 v2,已闭环)| 前序: [add-coder-hook-full-alignment-plan-v1](./.qoder/plans/2026-07/17/add-coder-hook-full-alignment-plan-v1.md) | 触发源: [GitHub Issue #6](https://github.com/xiaomingming92/add-coder/issues/6)
|
|
203
154
|
|
|
204
155
|
### ⑧ HITL 人机审核:审批即基础设施
|
|
205
156
|
|
|
@@ -220,21 +171,47 @@ Plan 里的 Task 不应该停留在文档里。add-coder 将 tasks.md 末尾的
|
|
|
220
171
|
tasks.md §IDE JSON → TodoWrite → IDE 面板
|
|
221
172
|
```
|
|
222
173
|
|
|
223
|
-
### ⑩
|
|
174
|
+
### ⑩ 并发契约体系:协作层 + 进程层双层
|
|
224
175
|
|
|
225
|
-
多个 Agent 同时改一个仓库,没有契约必然冲突——改同一批文件、审计归因混乱。add-coder
|
|
176
|
+
多个 Agent 同时改一个仓库,没有契约必然冲突——改同一批文件、审计归因混乱。add-coder 把并行协作变成**经 HITL 审批的契约体系**,分两层:
|
|
226
177
|
|
|
227
|
-
|
|
|
228
|
-
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
| **仲裁链路** | 跨边界修改走 BOUNDARY_REQUEST → Lead 裁决 → 落库可查 |
|
|
232
|
-
| **审计分桶** | 每个专家独立 planKeyword,query_audit_logs 各域各查 |
|
|
178
|
+
| 层 | 契约 | 版本 | 职责 |
|
|
179
|
+
|----|------|------|------|
|
|
180
|
+
| **协作层** | 并发协作契约(collab-contract) | v1(v0.3.18) | 多智能体协作秩序:总控 Plan + N 个子 Plan / 文件边界 / 仲裁链路 / 审计分桶 |
|
|
181
|
+
| **进程层** | [多 IDE 进程并发契约](./docs/multi-ide-concurrency-contract.md) | v2(v0.3.25) | MCP Server 并发行为承诺:连接模型 / 幂等键 / PROJECT_ID 校验 / 断开隔离四态 / 生命周期拆分 / client 编排差异矩阵 |
|
|
233
182
|
|
|
234
|
-
>
|
|
183
|
+
> 协作层模板:`templates/core/templates/collab-contract-template.md`(契约新建/重大变更走 `COLLAB_CONTRACT` 审批)。
|
|
184
|
+
> 进程层文档:`docs/multi-ide-concurrency-contract.md`(Codex Parallel MCP / TAgent / Claude Code 并发行为对齐基准)。
|
|
235
185
|
>
|
|
236
186
|
> 📜 溯源:并发契约原创时间戳 → [CHANGELOG v0.3.18「并发协作契约」](https://github.com/xiaomingming92/add-coder/blob/main/CHANGELOG.md#0318---2026-08-05);"酷"的工程学定义 → [what-makes-software-cool.md](https://github.com/xiaomingming92/add-coder/blob/main/docs/what-makes-software-cool.md)——契约的审计分桶与完成判定(DPS ≥ 80)正长在"熵值管控"四维上。
|
|
237
187
|
|
|
188
|
+
### ⑪ Codex MCP 原生接入(v0.3.25)
|
|
189
|
+
|
|
190
|
+
> **状态区分**:"已生成 Codex 模板" ≠ "Codex MCP 端到端已验证"——以下 6 步是**已验证闭环**,不写自定义脚本即可完成接入。
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# 1. 安装 add-coder(已安装可跳过)
|
|
194
|
+
npm i -g add-coder
|
|
195
|
+
|
|
196
|
+
# 2. 初始化 Codex 适配(hooks 模板 + config.toml 真源)
|
|
197
|
+
add-coder init --adapter=codex
|
|
198
|
+
|
|
199
|
+
# 3. 输出可直接使用的 config.toml 片段(不写盘,不初始化项目)
|
|
200
|
+
add-coder init --adapter=codex --print-mcp-config
|
|
201
|
+
|
|
202
|
+
# 4a. 粘贴片段到 ~/.codex/config.toml(Windows: %USERPROFILE%\.codex\config.toml)
|
|
203
|
+
# 4b. 或自动写入(显式确认 + 先备份 + 防重复)
|
|
204
|
+
add-coder init --adapter=codex --write-user-config
|
|
205
|
+
|
|
206
|
+
# 5. 重启 Codex(App/CLI/IDE 扩展通用,修改 config.toml 后需重启生效)
|
|
207
|
+
|
|
208
|
+
# 6. 验证:Codex 中发现 add_coder MCP Server,完整工具集可调用(29 tools)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Windows 分支**:`--print-mcp-config` 在 win32 平台自动输出 `cmd /c npx.cmd` 启动分支(原生 PowerShell 场景,不依赖 WSL)。
|
|
212
|
+
|
|
213
|
+
**命名兼容**:MCP Server ID 归一化为 `add_coder`(连字符→下划线,Codex 约束);`env.PROJECT_ROOT` 由渲染时注入,多项目粘贴错误配置时 mcp-server 启动即校验退出(进程层契约 §4)。
|
|
214
|
+
|
|
238
215
|
---
|
|
239
216
|
|
|
240
217
|
## 📖 案例示范:老安卓设备续命工程
|
|
@@ -292,6 +269,8 @@ npx add-coder init
|
|
|
292
269
|
| `init` | 初始化 ADD 模板,支持 `--adapter claude\|qoder\|vscode\|trae\|codex\|auto` |
|
|
293
270
|
| `sync` | 增量同步缺失文件(`--patch` 含 Atlas 能力检测:就绪 / 自动安装 / 降级文档) |
|
|
294
271
|
| `status` | 检查模板完整性 |
|
|
272
|
+
| `stack` | 技术栈约束 profile 管理(`list` 注册表 / `set <name>` 启用 / `show` 当前)——约束文件 `{magicDir}/rules/profiles/{stack}-profile.md`,AI 会话自动注入当前技术栈约束 |
|
|
273
|
+
| `model:download` | DPS 评分 embedding 模型预下载(`--force` 强制重下;`init` 自动预下载,`sync` 缓存缺失时提示) |
|
|
295
274
|
|
|
296
275
|
## Atlas 数据库同步能力
|
|
297
276
|
|
|
@@ -338,9 +317,31 @@ npx add-coder init
|
|
|
338
317
|
|------|------|
|
|
339
318
|
| `--adapter <type>` | 目标 IDE:claude / qoder / vscode / trae / codex / auto(自动检测,默认) |
|
|
340
319
|
| `--config <path>` | 指定配置文件 |
|
|
341
|
-
| `--yes` | 跳过交互,只创建新文件 |
|
|
342
320
|
| `--force` | 覆盖已有文件 |
|
|
343
321
|
| `--dry-run` | 预览模式,不写入 |
|
|
322
|
+
| `--stack <name>` | 技术栈约束 profile 名(如 machineserver,可选) |
|
|
323
|
+
| `--skip-model` | 跳过 embedding 模型预下载 |
|
|
324
|
+
| `--print-mcp-config` | Codex:stdout 输出 config.toml 片段(不写盘,不初始化项目) |
|
|
325
|
+
| `--write-user-config` | Codex:显式确认后写入 `~/.codex/config.toml`(先备份) |
|
|
326
|
+
|
|
327
|
+
### sync 选项
|
|
328
|
+
|
|
329
|
+
| 选项 | 说明 |
|
|
330
|
+
|------|------|
|
|
331
|
+
| `--adapter <type>` | 目标 IDE:claude / qoder / vscode / trae / codex |
|
|
332
|
+
| `--patch` | 覆盖已有模板文件(不碰 plans/specs/reviews) |
|
|
333
|
+
| `-i, --interactive` | 交互式选择要同步的文件 |
|
|
334
|
+
| `--model` | 检测到缺失时下载 embedding 模型 |
|
|
335
|
+
| `--yes` | 全部确认跳过询问 |
|
|
336
|
+
|
|
337
|
+
### stack 用法
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
npx add-coder stack list # 内置注册表 + 自定义 + 当前标记
|
|
341
|
+
npx add-coder stack set <name> # 启用技术栈约束 profile
|
|
342
|
+
npx add-coder stack show # 当前 stack + profile 路径
|
|
343
|
+
npx add-coder stack --clear # 清除技术栈设置(中性)
|
|
344
|
+
```
|
|
344
345
|
|
|
345
346
|
## 生成内容
|
|
346
347
|
|
|
@@ -351,7 +352,7 @@ npx add-coder init
|
|
|
351
352
|
| `.qoder/` | Qoder 适配(hooks、settings.json、mcp.json) |
|
|
352
353
|
| `.vscode/` | VS Code 适配(settings.json、tasks.json) |
|
|
353
354
|
| `.trae/` | Trae 适配(hooks.json、settings.json) |
|
|
354
|
-
| `.codex/` | Codex 适配(hooks.json、settings.json) |
|
|
355
|
+
| `.codex/` | Codex 适配(hooks.json、settings.json、config.toml.example) |
|
|
355
356
|
|
|
356
357
|
## MCP 审计工具链
|
|
357
358
|
|
|
@@ -369,20 +370,17 @@ Elicitation Server→Client ✅ 已实现 向用户请求 HITL
|
|
|
369
370
|
Tasks (实验性) 双向 ✅ 已实现 长任务持久化 + 状态追踪
|
|
370
371
|
```
|
|
371
372
|
|
|
372
|
-
**当前已实现的
|
|
373
|
+
**当前已实现的 33 个 Tools**(按域分组):
|
|
373
374
|
|
|
374
|
-
|
|
|
375
|
-
|
|
376
|
-
| `record_dev_operation`
|
|
377
|
-
|
|
|
378
|
-
|
|
|
379
|
-
|
|
|
380
|
-
| `check_dps`
|
|
381
|
-
|
|
|
382
|
-
|
|
|
383
|
-
| `check_spec_sync` | Spec 文档勾选状态与代码一致性 | Spec 执行后 |
|
|
384
|
-
| `find_related_docs` | 检索相关架构/规范文档 | 语境理解 |
|
|
385
|
-
| `get_hook_events` | 查询 Hook 拦截事件(planKeyword/hook/时间过滤+分组) | 治理审计、阈值告警 |
|
|
375
|
+
| 域 | 工具 |
|
|
376
|
+
|------|------|
|
|
377
|
+
| 审计闭环 | `record_dev_operation` `query_audit_logs` `generate_audit_logger` `get_audit_logger_pattern` `get_hook_events` |
|
|
378
|
+
| HITL 审批 | `create_hitl` `update_hitl` `status_hitl` `render_hitl_approval` |
|
|
379
|
+
| Plan 追踪 | `plan_track` `plan_status` `plan_sync` `plan_round_status` `plan_round_close` |
|
|
380
|
+
| Review 追踪 | `review_track` `review_status` `review_sync` |
|
|
381
|
+
| 质量闸门 | `check_dps` `check_rahs` `check_add_route_status` `check_add_route_completeness` `check_spec_sync` `check_doc_similarity` `check_phase_symmetry` `check_failure_path` `check_add_compliance` |
|
|
382
|
+
| 契约追踪 | `contract_track` `contract_status` |
|
|
383
|
+
| 上下文检索 | `get_project_context` `get_db_schema` `get_spec_context` `get_add_template` `find_related_docs` |
|
|
386
384
|
|
|
387
385
|
> 完整六能力架构设计见 [MCP 重构 Plan](.qoder/plans/2026-07/23/add-coder-mcp-restructure-plan-v1.md)。
|
|
388
386
|
|
|
@@ -393,36 +391,42 @@ Tasks (实验性) 双向 ✅ 已实现 长任务持久化
|
|
|
393
391
|
│ ADD 范式 │
|
|
394
392
|
│ Step 0-9 │
|
|
395
393
|
└──────┬──────┘
|
|
396
|
-
│
|
|
394
|
+
│ 算法门禁驱动
|
|
397
395
|
┌────────────┼────────────┐
|
|
398
396
|
▼ ▼ ▼
|
|
399
397
|
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
400
|
-
│ DPS 闸门 │
|
|
398
|
+
│ DPS 闸门 │ │ RAHS 闸门│ │ 合规检查 │
|
|
401
399
|
└────┬─────┘ └────┬─────┘ └────┬─────┘
|
|
402
400
|
│ │ │
|
|
403
401
|
▼ ▼ ▼
|
|
404
402
|
┌─────────────────────────────────────┐
|
|
405
403
|
│ 审计基础设施层 │
|
|
406
|
-
│ DevOperation / AuditLog 表
|
|
404
|
+
│ DevOperation / AuditLog 表 │
|
|
407
405
|
│ MCP 审计工具链 │
|
|
408
406
|
│ Handoff / DevLog 时序文档 │
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
└──────────────────┬──────────────────┘
|
|
408
|
+
│ 规则驱动
|
|
409
|
+
▼
|
|
410
|
+
┌─────────────────────────────────────┐
|
|
411
|
+
│ Caijuehub 集中裁决层 │
|
|
412
|
+
│ 规则供应链工厂 │
|
|
413
|
+
│ TOML 原料 → 加工车间 → 出厂质检 │
|
|
414
|
+
│ → 审批放行 → 分销消费 │
|
|
415
|
+
└──────────────────┬──────────────────┘
|
|
416
|
+
│ 生成常量 → 产物内联
|
|
417
|
+
▼
|
|
418
|
+
┌─────────────────────────────────────┐
|
|
419
|
+
│ 治理契约层(core 基类) │
|
|
420
|
+
│ 16 卡位判定逻辑收敛,六端共享 │
|
|
421
|
+
└──────────────────┬──────────────────┘
|
|
422
|
+
│ 受控适配
|
|
411
423
|
┌──────────┬───────────┼────────┬─────┐
|
|
412
424
|
▼ ▼ ▼ ▼ ▼
|
|
413
425
|
┌──────┐ ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐
|
|
414
426
|
│Claude│ │Qoder │ │ VS Code │ │ Trae │ │Codex │
|
|
415
|
-
│Hooks │ │Hooks │ │
|
|
416
|
-
│
|
|
427
|
+
│Hooks │ │Hooks │ │ Hooks │ │Hooks │ │Hooks │
|
|
428
|
+
│11/16 │ │11/16 │ │ 10/16 │ │ 6/16 │ │ 5/16 │
|
|
417
429
|
└──────┘ └──────┘ └──────────┘ └──────┘ └──────┘
|
|
418
|
-
│
|
|
419
|
-
|
|
|
420
|
-
▼
|
|
421
|
-
┌─────────────────────────────────────┐
|
|
422
|
-
│ Caijuehub 集中裁决层 │
|
|
423
|
-
│ TOML 驱动的策略体系 │
|
|
424
|
-
│ 检测/适配/Prisma/写入 全可配置 │
|
|
425
|
-
└─────────────────────────────────────┘
|
|
426
430
|
```
|
|
427
431
|
|
|
428
432
|
## 前置条件
|
|
@@ -457,6 +461,88 @@ Tasks (实验性) 双向 ✅ 已实现 长任务持久化
|
|
|
457
461
|
| ide插件 | 解耦ADD范式代码和被治理项目的代码 |在做了,大家拭目以待吧,让编程更有趣,我的目标其实不在于IDE,我的工作顺手的事情 |
|
|
458
462
|
| 对话记忆增强 | 长期项目知识记忆和plan级别的稀疏记忆 |--|
|
|
459
463
|
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## 📊 npm 实况数据
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
# 0.1.0 发布于2026-07-10 04:11 UTC(北京时间当天上午 12:11)至 2026-07-28 累计突破 5000 次下载,**首次过死亡谷耗时 19 天**。
|
|
470
|
+
~ $ curl -s https://api.npmjs.org/downloads/point/last-month/add-coder
|
|
471
|
+
{
|
|
472
|
+
"downloads": 5161,
|
|
473
|
+
"start": "2026-06-29",
|
|
474
|
+
"end": "2026-07-28",
|
|
475
|
+
"package": "add-coder"
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
~ $ npm info add-coder@0.1.0
|
|
479
|
+
|
|
480
|
+
add-coder@0.1.0 | MIT | deps: 3 | versions: 35
|
|
481
|
+
Initialize ADD paradigm workflow templates for
|
|
482
|
+
Claude Code, Qoder, and VS Code.
|
|
483
|
+
|
|
484
|
+
keywords:
|
|
485
|
+
add, add-paradigm, claude, qoder, vscode, mcp,
|
|
486
|
+
workflow, codein2027, 集中裁决层, caijuehub
|
|
487
|
+
|
|
488
|
+
bin: add-coder
|
|
489
|
+
|
|
490
|
+
dist
|
|
491
|
+
.tarball: https://registry.npmjs.org/add-coder/-/add-coder-0.1.0.tgz
|
|
492
|
+
.shasum: 3266ddb5304d303705694edec7c2f41efc24881d
|
|
493
|
+
.integrity: sha512-MxFICLEoAgTVxnHaiIOli5eVyCXvB+xnSzpfmu0mrigEeM9NxzBOm2Auzjn1GKUTXSWelT0FecwwlYmsCf+TWQ==
|
|
494
|
+
.unpackedSize: 704.9 kB
|
|
495
|
+
|
|
496
|
+
dependencies:
|
|
497
|
+
zod: ^3.24.0
|
|
498
|
+
commander: ^13.1.0
|
|
499
|
+
smol-toml: ^1.7.0
|
|
500
|
+
|
|
501
|
+
maintainers:
|
|
502
|
+
- wujixmm <wujixmm@gmail.com>
|
|
503
|
+
|
|
504
|
+
dist-tags:
|
|
505
|
+
latest: 0.3.5
|
|
506
|
+
preview: 0.3.6-feature-hitl-enhance-v1.2
|
|
507
|
+
|
|
508
|
+
published 2 weeks ago by wujixmm <wujixmm@gmail.com>
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## ⚠️ 数据共享知情清单(完整版)
|
|
514
|
+
|
|
515
|
+
> add-coder 无意于搞各家厂商的对抗叙事。以下内容仅为**基于各家官方公开条款原文的事实摘录**,目的是让开发者在选择 AI 编程 IDE 前知情。条款可能随时变更,请以官方最新版本为准。
|
|
516
|
+
|
|
517
|
+
| 产品 | 运营主体 | 官方条款要点(原文摘录) | 产品实测(用户反馈) | 出处 | 核实日期 |
|
|
518
|
+
|------|---------|------------------------|---------------------|------|----------|
|
|
519
|
+
| **Qoder** | BRIGHT ZENITH PTE. LTD.(新加坡) | 用户内容(含聊天、编程及智能体会话的输入/输出,即含代码)默认用于"研究、开发和改进我们的服务",保留期最长 5 年;条款文本称可关闭"共享与改进"(Share & Improve)退出,**但关闭前已为上述目的处理的数据仍保留和使用**;数据跨境存储于美国/新加坡/日本 | 实测为强制隐私共享模式,界面无有效切换入口 | [Qoder 隐私政策](https://qoder.com/zh/privacy-policy) | 2026-05-12 / 2026-08-04 |
|
|
520
|
+
| **Qoder CN** | 阿里云(通义灵码系列) | 官方 FAQ 称:仅在用户点赞/点踩后,针对聊天记录(不包含代码)脱敏去标识化处理,用于算法升级与迭代 | **实测(v1.10.0):强制隐私共享模式,无切换功能**;官方 CLI 配置(`~/.qoder-cn/settings.json`)中亦无共享/改进开关项 | [阿里云帮助中心 FAQ](https://help.aliyun.com/zh/lingma/qoder-cn/support/faq) | 2026-07-15 / 2026-08-04 |
|
|
521
|
+
| **Trae CN** | 北京引力弹弓科技有限公司(字节跳动) | 服务所收集的数据经加密、严格去标识化且无法重新识别个人后,**可能用于模型训练**以优化模型效果与产品体验;可通过隐私模式"限制"该数据使用;代码文件不提供给其他第三方 | — | [Trae 隐私协议](https://www.trae.cn/privacy-policy) | 现行版 / 2026-08-04 |
|
|
522
|
+
|
|
523
|
+
**要点**:三家官方条款均为"**默认开启共享、需用户主动退出**"(opt-out)模式。**但产品实测层面**:Qoder / Qoder CN 的退出开关在实际产品中不可用(Qoder CN v1.10.0 无切换功能,CLI 配置亦无对应开关),条款上的退出承诺在 CN 产品中无落地入口,实际效果即强制共享。Qoder 明确将用户内容(含代码)用于改进服务并保留 5 年;Trae 明确将数据用于模型训练(可通过隐私模式限制);Qoder CN 官方条款范围最窄(仅反馈后的聊天记录、不含代码)。
|
|
524
|
+
|
|
525
|
+
**建议**:涉及商业机密或个人数据的项目,使用前请逐项核对官方条款,并主动检查产品设置:Qoder(国际版)尝试关闭"共享与改进";Qoder CN(v1.10.0 实测无开关)与 Trae CN 请结合隐私模式与最小化输入策略使用;必要时改用数据完全本地化的替代方案。
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## 🔮 IDE 插件预告(完整版)
|
|
530
|
+
|
|
531
|
+
add-coder 当前是 **脚手架 + 治理层**:把 ADD 范式(裁决集中、审计即基础设施、门禁驱动)部署进你的项目。下一阶段会以 **IDE 插件** 形式落地,让治理能力直接嵌在编辑与 Agent 生命周期里。
|
|
532
|
+
|
|
533
|
+
**为什么值得期待:**
|
|
534
|
+
|
|
535
|
+
| 维度 | 说明 |
|
|
536
|
+
|------|------|
|
|
537
|
+
| **范式优势** | 不是「更好用的补全」,而是把规则、证据、审批、回溯做成一等公民。改规则不改代码,跨轮不靠聊天记忆。 |
|
|
538
|
+
| **与 LLM 低耦合** | 核心是结构与门禁,不是绑死某一家模型。换模型不换治理逻辑;模型只负责生成,裁决与审计由范式层承担。 |
|
|
539
|
+
| **与 IDE 低耦合** | 治理逻辑统一,适配层分离。今天支持 Claude Code / Qoder / VS Code / Trae / Codex,明天换宿主只需加适配,不必重写规则与审计链。 |
|
|
540
|
+
| **不收集用户隐私** | 不上传代码、对话与项目数据。审计与裁决默认留在本地 / 你自己的基础设施里,不做「默认共享、事后退出」。 |
|
|
541
|
+
|
|
542
|
+
目标不是再做一个「AI 编程 IDE」,而是让 **任意 IDE + 任意 LLM** 都能跑在同一套可审计、可收敛、且不拿你数据的 ADD 之上。
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
460
546
|
|
|
461
547
|
|
|
462
548
|
---
|
|
@@ -497,15 +583,16 @@ Traditional AI development: Chat → Generate code → Dig through chat history
|
|
|
497
583
|
| Auditing relies on developer discipline | The **MCP audit toolchain** automatically records every operation; system gateways enforce checks |
|
|
498
584
|
| No traceability | Audit events are naturally linked: Plan → Spec → Task → Step → Tool Call, forming a complete evidence chain |
|
|
499
585
|
|
|
500
|
-
### ② Caijuehub — The Centralized Adjudication Layer:
|
|
586
|
+
### ② Caijuehub — The Centralized Adjudication Layer: Rule Supply Chain Factory
|
|
501
587
|
|
|
502
|
-
Caijuehub is add-coder's
|
|
588
|
+
Caijuehub is add-coder's centralized adjudication engine: from the sync --patch single-domain experiment, to three-domain coverage spanning HITL approval and DPS scoring, to **supply-chain industrialization** — the whole caijuehub is a rule supply chain: **TOML raw material → fabrication plant (transcribe factory chain: unified reader validation → factories → generators) → factory QA (idempotent automation) → approval release → distribution & consumption**. New rules registered in caijue.toml automatically enter the production line (15 lines, zero wiring code) — extending rule domains no longer means copy-paste boilerplate. Details: [docs/caijuehub.md](./docs/caijuehub.md).
|
|
503
589
|
|
|
504
590
|
| Domain | Rules File | Consumer | Description |
|
|
505
591
|
|--------|---------|--------|------|
|
|
506
592
|
| sync --patch | `sync-rules.toml` | `sync.ts` | **First centralized adjudication hot-update in npm history** (eating my own dog food: add-coder manages its own template sync via caijuehub) |
|
|
507
593
|
| HITL Approval | `hitl-interaction-rules.toml` | `hitl.ts` | Per-IDE interaction mode declaration |
|
|
508
594
|
| DPS Scoring | `dps-scoring-rules.toml` | `gateway.ts` | Doc quality gateway: semantic/entropy/CPM/structure 4D weights+thresholds, AI self-tuning without touching code |
|
|
595
|
+
| Hook Governance Protocol | `hook-{guard,doc-format,context,event,protocol}-rules.toml` ×5 | core governance | Interception chains / recognition rules / quadrant text / event thresholds / protocol forms — single source of truth shared by all five IDEs |
|
|
509
596
|
|
|
510
597
|
> 📊 [sync-magic benchmark](./docs/sync-magic-benchmark-report.md): Caijuehub refactoring measured — 4-group comparison, TS vs bash, scenario-value analysis of entropy vs speed.
|
|
511
598
|
>
|
|
@@ -553,7 +640,7 @@ The fatal flaw of AI conversations: architectural decisions from last session, b
|
|
|
553
640
|
- **Plan Index** — All Plans are centrally indexed via `index.md`, supporting fuzzy-match quick lookup
|
|
554
641
|
- **DevLog Timeline** — Every operation is written to the `{YYYY-MM}/{DD}/` timeline, enabling full historical state traceability
|
|
555
642
|
|
|
556
|
-
### ⑥ Policy-Update-Loop: Self-Evolving Governance
|
|
643
|
+
### ⑥ Policy-Update-Loop: Self-Evolving Governance
|
|
557
644
|
|
|
558
645
|
Not a static template, but a **closed-loop adaptive system**:
|
|
559
646
|
|
|
@@ -561,7 +648,11 @@ Not a static template, but a **closed-loop adaptive system**:
|
|
|
561
648
|
Execute → Audit → Boundary Report → Rule Adjustment → Next Execution
|
|
562
649
|
```
|
|
563
650
|
|
|
564
|
-
|
|
651
|
+
**Closed-loop segments already in place**:
|
|
652
|
+
|
|
653
|
+
- **Execute → Audit (✓ live)**: hook interception / file-write events → jsonl → MCP resident consumer → DevOperation persistence (`HOOK_INTERCEPT`, idempotent dedup) — every governance action leaves an audit trail, queryable and traceable
|
|
654
|
+
- **Audit → Rule Adjustment (✓ live)**: caijuehub rule center — edit rules, not code: DPS 4-dimensional scoring with **FFT adaptive weights** (auto re-weighting from historical data), `check_doc_similarity` quantitative re-check (look-alike documents auto-detected) — audit data drives governance rule evolution
|
|
655
|
+
- **Boundary Report (Report system)**: runtime boundary report loop pending DEMO repo — end-to-end Policy-Update-Loop and Report system practice
|
|
565
656
|
|
|
566
657
|
### ⑦ Multi-IDE Hooks as the Governance Layer
|
|
567
658
|
|
|
@@ -576,13 +667,21 @@ Hooks are not "notification push" — they are the **IDE runtime interception la
|
|
|
576
667
|
|
|
577
668
|
Each IDE(Claude Code / Qoder CN / VS Code Copilot / Trae / Codex)has its own hook implementation, but the **governance logic is unified** — the architecture is consistent, only the adapter layer differs.
|
|
578
669
|
|
|
579
|
-
|
|
670
|
+
**Three-layer architecture — capabilities stay controllable, alignable, convergent**:
|
|
671
|
+
|
|
672
|
+
- **Governance contract layer**: the adjudication logic of the 16 governance checkpoints (14 common + 2 Claude-specific) converges into a single contract implementation (lifecycle arbitration / local governance isolation / precise command judgment / template guarding / audit chain), shared by all six ends — behavior consistency guaranteed by contract
|
|
673
|
+
- **Independent hook implementations**: each IDE's event mechanism differences (event mapping / output form / env injection) are isolated in the adapter layer — IDE capability evolution only touches adapters, governance semantics zero-drift, capabilities alignable and controllable at any time
|
|
674
|
+
- **Control plane management**: rules / thresholds / prompt texts are declaratively managed by the caijuehub rule center (hook-*.toml source of truth → generated constants → inlined artifacts) — edit rules, not code; governance maintenance goes through the control plane; five-end consistency continuously verified by the consistency matrix
|
|
675
|
+
|
|
676
|
+
| IDE | Governance Doc | Registered Events | Hook Config (node direct) |
|
|
580
677
|
|---|---|---|---|
|
|
581
|
-
| Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) |
|
|
582
|
-
| Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) |
|
|
583
|
-
| VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/
|
|
584
|
-
| Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/
|
|
585
|
-
| Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) |
|
|
678
|
+
| Claude Code | [ADD-governance-claude-code.md](./templates/core/docs/ADD-governance-claude-code.md) | 11/16 | `.claude/hooks/*.mjs` (settings.json command) |
|
|
679
|
+
| Qoder CN | [ADD-governance-qoder-cn.md](./templates/core/docs/ADD-governance-qoder-cn.md) | 11/16 | `.qoder/hooks/*.mjs` (settings.json command) |
|
|
680
|
+
| VS Code Copilot | [ADD-governance-vscode-copilot.md](./templates/core/docs/ADD-governance-vscode-copilot.md) | 10/16 | `.vscode/hooks/*.mjs` (Agent Host dual-channel) |
|
|
681
|
+
| Trae | [ADD-governance-trae.md](./templates/core/docs/ADD-governance-trae.md) | 6/16 | `hooks.json` → `.trae/hooks/*.mjs` |
|
|
682
|
+
| Codex | [ADD-governance-codex.md](./templates/core/docs/ADD-governance-codex.md) | 5/16 | `.codex/hooks.json` → `.codex/hooks/*.mjs` |
|
|
683
|
+
|
|
684
|
+
> **All 16 checkpoints pre-positioned across all six ends**: 86 hook entry artifacts fully distributed (14/16/14/14/14/14), sharing the governance contract layer (core base classes). "Registered Events" counts what each IDE's native event model can register — ends with fewer native events (Codex 5 / Trae 6) already have artifacts in place; zero-code activation once the IDE event model expands.
|
|
586
685
|
|
|
587
686
|
### ⑧ HITL Human-in-the-Loop: Approval as Infrastructure
|
|
588
687
|
|
|
@@ -675,6 +774,8 @@ npx add-coder init
|
|
|
675
774
|
| `init` | Initialize ADD templates, supports `--adapter claude\|qoder\|vscode\|trae\|codex\|auto` |
|
|
676
775
|
| `sync` | Incrementally sync missing files |
|
|
677
776
|
| `status` | Check template integrity |
|
|
777
|
+
| `stack` | Tech-stack constraint profile management (`list` registry / `set <name>` activate / `show` current) — profile file `{magicDir}/rules/profiles/{stack}-profile.md`, auto-injected into AI sessions |
|
|
778
|
+
| `model:download` | Pre-download the DPS scoring embedding model (`--force` re-download; `init` auto-downloads, `sync` prompts on cache miss) |
|
|
678
779
|
|
|
679
780
|
### init Internal Flow
|
|
680
781
|
|
|
@@ -694,9 +795,31 @@ npx add-coder init
|
|
|
694
795
|
|--------|-------------|
|
|
695
796
|
| `--adapter <type>` | Target IDE: claude / qoder / vscode / trae / codex / auto (default) |
|
|
696
797
|
| `--config <path>` | Specify config file |
|
|
697
|
-
| `--yes` | Skip interactions, create new files only |
|
|
698
798
|
| `--force` | Overwrite existing files |
|
|
699
799
|
| `--dry-run` | Preview mode, no writes |
|
|
800
|
+
| `--stack <name>` | Tech-stack constraint profile name (optional, e.g. machineserver) |
|
|
801
|
+
| `--skip-model` | Skip embedding model pre-download |
|
|
802
|
+
| `--print-mcp-config` | Codex: print config.toml snippet to stdout (no writes, no init) |
|
|
803
|
+
| `--write-user-config` | Codex: write `~/.codex/config.toml` after explicit confirm (backup first) |
|
|
804
|
+
|
|
805
|
+
### sync Options
|
|
806
|
+
|
|
807
|
+
| Option | Description |
|
|
808
|
+
|--------|-------------|
|
|
809
|
+
| `--adapter <type>` | Target IDE: claude / qoder / vscode / trae / codex |
|
|
810
|
+
| `--patch` | Overwrite existing template files (never touches plans/specs/reviews) |
|
|
811
|
+
| `-i, --interactive` | Interactively select files to sync |
|
|
812
|
+
| `--model` | Download embedding model when missing detected |
|
|
813
|
+
| `--yes` | Confirm all, skip prompts |
|
|
814
|
+
|
|
815
|
+
### stack Usage
|
|
816
|
+
|
|
817
|
+
```
|
|
818
|
+
npx add-coder stack list # builtin registry + custom + current marker
|
|
819
|
+
npx add-coder stack set <name> # activate a tech-stack constraint profile
|
|
820
|
+
npx add-coder stack show # current stack + profile path
|
|
821
|
+
npx add-coder stack --clear # clear tech-stack setting (neutral)
|
|
822
|
+
```
|
|
700
823
|
|
|
701
824
|
## Generated Content
|
|
702
825
|
|
|
@@ -711,19 +834,17 @@ npx add-coder init
|
|
|
711
834
|
|
|
712
835
|
## MCP Audit Toolchain
|
|
713
836
|
|
|
714
|
-
`init` automatically deploys the MCP server (`mcp-server.ts`) into the project, loaded by the IDE via `mcp.json`.
|
|
837
|
+
`init` automatically deploys the MCP server (`mcp-server.ts`) into the project, loaded by the IDE via `mcp.json`. **33 tools** across 7 domains:
|
|
715
838
|
|
|
716
|
-
|
|
|
717
|
-
|
|
718
|
-
|
|
|
719
|
-
|
|
|
720
|
-
|
|
|
721
|
-
|
|
|
722
|
-
| `check_dps`
|
|
723
|
-
|
|
|
724
|
-
|
|
|
725
|
-
| `check_spec_sync` | Spec doc checkbox status vs. code consistency | After Spec execution |
|
|
726
|
-
| `find_related_docs` | Search related architecture/spec documents | Context understanding |
|
|
839
|
+
| Domain | Tools |
|
|
840
|
+
|------|------|
|
|
841
|
+
| Audit Loop | `record_dev_operation` `query_audit_logs` `generate_audit_logger` `get_audit_logger_pattern` `get_hook_events` |
|
|
842
|
+
| HITL Approval | `create_hitl` `update_hitl` `status_hitl` `render_hitl_approval` |
|
|
843
|
+
| Plan Tracking | `plan_track` `plan_status` `plan_sync` `plan_round_status` `plan_round_close` |
|
|
844
|
+
| Review Tracking | `review_track` `review_status` `review_sync` |
|
|
845
|
+
| Quality Gateways | `check_dps` `check_rahs` `check_add_route_status` `check_add_route_completeness` `check_spec_sync` `check_doc_similarity` `check_phase_symmetry` `check_failure_path` `check_add_compliance` |
|
|
846
|
+
| Contract Tracking | `contract_track` `contract_status` |
|
|
847
|
+
| Context Retrieval | `get_project_context` `get_db_schema` `get_spec_context` `get_add_template` `find_related_docs` |
|
|
727
848
|
|
|
728
849
|
> Full tool list: [MCP Toolchain Specification](https://github.com/xiaomingming92/codein2027/blob/main/docs/大田精准耕播智能决策系统/knowledge/02-规范/%E3%80%8A%E5%BC%80%E5%8F%91%E6%93%8D%E4%BD%9C%E5%AE%A1%E8%AE%A1%E5%AD%98%E6%A1%A3%E8%A7%84%E8%8C%83%E3%80%8B.md).
|
|
729
850
|
|
|
@@ -747,25 +868,31 @@ npx add-coder init
|
|
|
747
868
|
│ DevOperation / AuditLog Tables │
|
|
748
869
|
│ MCP Audit Toolchain │
|
|
749
870
|
│ Handoff / DevLog Timeline Docs │
|
|
750
|
-
|
|
751
|
-
|
|
871
|
+
└──────────────────┬──────────────────┘
|
|
872
|
+
│ Rule-driven
|
|
873
|
+
▼
|
|
874
|
+
┌─────────────────────────────────────┐
|
|
875
|
+
│ Caijuehub — Centralized │
|
|
876
|
+
│ Adjudication Layer │
|
|
877
|
+
│ Rule Supply Chain Factory │
|
|
878
|
+
│ TOML raw → plant → QA → release → │
|
|
879
|
+
│ distribution & consumption │
|
|
880
|
+
└──────────────────┬──────────────────┘
|
|
881
|
+
│ Generated constants → inlined artifacts
|
|
882
|
+
▼
|
|
883
|
+
┌─────────────────────────────────────┐
|
|
884
|
+
│ Governance Contract Layer │
|
|
885
|
+
│ (core base classes) │
|
|
886
|
+
│ 16 checkpoints, shared by 6 ends │
|
|
887
|
+
└──────────────────┬──────────────────┘
|
|
888
|
+
│ Controlled adaptation
|
|
752
889
|
┌──────────┬───────────┼───────────┬──────────┐
|
|
753
890
|
▼ ▼ ▼ ▼ ▼
|
|
754
891
|
┌──────┐ ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐
|
|
755
892
|
│Claude│ │Qoder │ │ VS Code │ │ Trae │ │Codex │
|
|
756
|
-
│Hooks │ │Hooks │ │
|
|
757
|
-
│
|
|
893
|
+
│Hooks │ │Hooks │ │ Hooks │ │Hooks │ │Hooks │
|
|
894
|
+
│11/16 │ │11/16 │ │ 10/16 │ │ 6/16 │ │ 5/16 │
|
|
758
895
|
└──────┘ └──────┘ └──────────┘ └──────┘ └──────┘
|
|
759
|
-
│
|
|
760
|
-
┌────────────┘
|
|
761
|
-
▼
|
|
762
|
-
┌─────────────────────────────────────┐
|
|
763
|
-
│ Caijuehub — Centralized │
|
|
764
|
-
│ Adjudication Layer │
|
|
765
|
-
│ TOML-Driven Policy System │
|
|
766
|
-
│ Detect / Adapt / Prisma / Write — │
|
|
767
|
-
│ Fully Configurable │
|
|
768
|
-
└─────────────────────────────────────┘
|
|
769
896
|
```
|
|
770
897
|
|
|
771
898
|
## Prerequisites
|