@saydone/dab 0.0.0-stage → 0.1.2

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.
Files changed (242) hide show
  1. package/AGENTS.md +62 -0
  2. package/CHANGELOG.md +52 -0
  3. package/CHANGELOG.zh.md +52 -0
  4. package/LICENSE +21 -0
  5. package/README.i18n.yaml +55 -0
  6. package/README.md +157 -2
  7. package/README.zh.md +158 -0
  8. package/dist/adapter/claude-code/adapter.d.ts +10 -0
  9. package/dist/adapter/claude-code/adapter.js +226 -0
  10. package/dist/adapter/claude-code/adapter.js.map +1 -0
  11. package/dist/adapter/claude-code/adoption.d.ts +58 -0
  12. package/dist/adapter/claude-code/adoption.js +749 -0
  13. package/dist/adapter/claude-code/adoption.js.map +1 -0
  14. package/dist/adapter/claude-code/hooks.d.ts +10 -0
  15. package/dist/adapter/claude-code/hooks.js +58 -0
  16. package/dist/adapter/claude-code/hooks.js.map +1 -0
  17. package/dist/adapter/claude-code/instructions.d.ts +26 -0
  18. package/dist/adapter/claude-code/instructions.js +235 -0
  19. package/dist/adapter/claude-code/instructions.js.map +1 -0
  20. package/dist/adapter/claude-code/options.d.ts +12 -0
  21. package/dist/adapter/claude-code/options.js +27 -0
  22. package/dist/adapter/claude-code/options.js.map +1 -0
  23. package/dist/adapter/claude-code/policy-compile.d.ts +30 -0
  24. package/dist/adapter/claude-code/policy-compile.js +293 -0
  25. package/dist/adapter/claude-code/policy-compile.js.map +1 -0
  26. package/dist/adapter/claude-code/projection.d.ts +36 -0
  27. package/dist/adapter/claude-code/projection.js +272 -0
  28. package/dist/adapter/claude-code/projection.js.map +1 -0
  29. package/dist/adapter/claude-code/settings-plan.d.ts +12 -0
  30. package/dist/adapter/claude-code/settings-plan.js +64 -0
  31. package/dist/adapter/claude-code/settings-plan.js.map +1 -0
  32. package/dist/adapter/claude-code/settings.d.ts +21 -0
  33. package/dist/adapter/claude-code/settings.js +58 -0
  34. package/dist/adapter/claude-code/settings.js.map +1 -0
  35. package/dist/adapter/claude-code/version.d.ts +8 -0
  36. package/dist/adapter/claude-code/version.js +32 -0
  37. package/dist/adapter/claude-code/version.js.map +1 -0
  38. package/dist/adapter/registry.d.ts +3 -0
  39. package/dist/adapter/registry.js +8 -0
  40. package/dist/adapter/registry.js.map +1 -0
  41. package/dist/adapter/types.d.ts +70 -0
  42. package/dist/adapter/types.js +2 -0
  43. package/dist/adapter/types.js.map +1 -0
  44. package/dist/cli.d.ts +12 -0
  45. package/dist/cli.js +260 -0
  46. package/dist/cli.js.map +1 -0
  47. package/dist/commands/detect.d.ts +44 -0
  48. package/dist/commands/detect.js +543 -0
  49. package/dist/commands/detect.js.map +1 -0
  50. package/dist/commands/init.d.ts +48 -0
  51. package/dist/commands/init.js +727 -0
  52. package/dist/commands/init.js.map +1 -0
  53. package/dist/commands/normalize.d.ts +106 -0
  54. package/dist/commands/normalize.js +715 -0
  55. package/dist/commands/normalize.js.map +1 -0
  56. package/dist/commands/policy-explain.d.ts +47 -0
  57. package/dist/commands/policy-explain.js +283 -0
  58. package/dist/commands/policy-explain.js.map +1 -0
  59. package/dist/core/command.d.ts +13 -0
  60. package/dist/core/command.js +68 -0
  61. package/dist/core/command.js.map +1 -0
  62. package/dist/core/compare.d.ts +7 -0
  63. package/dist/core/compare.js +16 -0
  64. package/dist/core/compare.js.map +1 -0
  65. package/dist/core/diagnostics.d.ts +15 -0
  66. package/dist/core/diagnostics.js +65 -0
  67. package/dist/core/diagnostics.js.map +1 -0
  68. package/dist/core/errors.d.ts +25 -0
  69. package/dist/core/errors.js +45 -0
  70. package/dist/core/errors.js.map +1 -0
  71. package/dist/core/exit-codes.d.ts +8 -0
  72. package/dist/core/exit-codes.js +8 -0
  73. package/dist/core/exit-codes.js.map +1 -0
  74. package/dist/core/fs-atomic.d.ts +13 -0
  75. package/dist/core/fs-atomic.js +113 -0
  76. package/dist/core/fs-atomic.js.map +1 -0
  77. package/dist/core/gitignore.d.ts +6 -0
  78. package/dist/core/gitignore.js +54 -0
  79. package/dist/core/gitignore.js.map +1 -0
  80. package/dist/core/hash.d.ts +1 -0
  81. package/dist/core/hash.js +5 -0
  82. package/dist/core/hash.js.map +1 -0
  83. package/dist/core/json.d.ts +3 -0
  84. package/dist/core/json.js +21 -0
  85. package/dist/core/json.js.map +1 -0
  86. package/dist/core/markdown-links.d.ts +5 -0
  87. package/dist/core/markdown-links.js +37 -0
  88. package/dist/core/markdown-links.js.map +1 -0
  89. package/dist/core/paths.d.ts +12 -0
  90. package/dist/core/paths.js +152 -0
  91. package/dist/core/paths.js.map +1 -0
  92. package/dist/core/platform.d.ts +1 -0
  93. package/dist/core/platform.js +7 -0
  94. package/dist/core/platform.js.map +1 -0
  95. package/dist/core/practice-paths.d.ts +73 -0
  96. package/dist/core/practice-paths.js +310 -0
  97. package/dist/core/practice-paths.js.map +1 -0
  98. package/dist/core/security.d.ts +2 -0
  99. package/dist/core/security.js +101 -0
  100. package/dist/core/security.js.map +1 -0
  101. package/dist/core/semver.d.ts +9 -0
  102. package/dist/core/semver.js +32 -0
  103. package/dist/core/semver.js.map +1 -0
  104. package/dist/core/skill-marker.d.ts +28 -0
  105. package/dist/core/skill-marker.js +57 -0
  106. package/dist/core/skill-marker.js.map +1 -0
  107. package/dist/core/version-check.d.ts +10 -0
  108. package/dist/core/version-check.js +28 -0
  109. package/dist/core/version-check.js.map +1 -0
  110. package/dist/core/version-compare.d.ts +8 -0
  111. package/dist/core/version-compare.js +23 -0
  112. package/dist/core/version-compare.js.map +1 -0
  113. package/dist/core/version.d.ts +2 -0
  114. package/dist/core/version.js +13 -0
  115. package/dist/core/version.js.map +1 -0
  116. package/dist/core/yaml.d.ts +4 -0
  117. package/dist/core/yaml.js +24 -0
  118. package/dist/core/yaml.js.map +1 -0
  119. package/dist/detect/ancestor-claude-md.d.ts +1 -0
  120. package/dist/detect/ancestor-claude-md.js +33 -0
  121. package/dist/detect/ancestor-claude-md.js.map +1 -0
  122. package/dist/detect/checklist.d.ts +42 -0
  123. package/dist/detect/checklist.js +137 -0
  124. package/dist/detect/checklist.js.map +1 -0
  125. package/dist/detect/checks.d.ts +13 -0
  126. package/dist/detect/checks.js +537 -0
  127. package/dist/detect/checks.js.map +1 -0
  128. package/dist/detect/practice.d.ts +43 -0
  129. package/dist/detect/practice.js +782 -0
  130. package/dist/detect/practice.js.map +1 -0
  131. package/dist/detect/preflight.d.ts +21 -0
  132. package/dist/detect/preflight.js +408 -0
  133. package/dist/detect/preflight.js.map +1 -0
  134. package/dist/docs/budgets.d.ts +2 -0
  135. package/dist/docs/budgets.js +57 -0
  136. package/dist/docs/budgets.js.map +1 -0
  137. package/dist/docs/cli.d.ts +7 -0
  138. package/dist/docs/cli.js +102 -0
  139. package/dist/docs/cli.js.map +1 -0
  140. package/dist/docs/config.d.ts +8 -0
  141. package/dist/docs/config.js +82 -0
  142. package/dist/docs/config.js.map +1 -0
  143. package/dist/docs/doc-sync.d.ts +10 -0
  144. package/dist/docs/doc-sync.js +33 -0
  145. package/dist/docs/doc-sync.js.map +1 -0
  146. package/dist/docs/files.d.ts +1 -0
  147. package/dist/docs/files.js +42 -0
  148. package/dist/docs/files.js.map +1 -0
  149. package/dist/docs/links.d.ts +3 -0
  150. package/dist/docs/links.js +90 -0
  151. package/dist/docs/links.js.map +1 -0
  152. package/dist/docs/markdown.d.ts +55 -0
  153. package/dist/docs/markdown.js +227 -0
  154. package/dist/docs/markdown.js.map +1 -0
  155. package/dist/docs/notes.d.ts +2 -0
  156. package/dist/docs/notes.js +175 -0
  157. package/dist/docs/notes.js.map +1 -0
  158. package/dist/docs/pairing.d.ts +45 -0
  159. package/dist/docs/pairing.js +472 -0
  160. package/dist/docs/pairing.js.map +1 -0
  161. package/dist/docs/wrap.d.ts +2 -0
  162. package/dist/docs/wrap.js +98 -0
  163. package/dist/docs/wrap.js.map +1 -0
  164. package/dist/init/adoption.d.ts +138 -0
  165. package/dist/init/adoption.js +747 -0
  166. package/dist/init/adoption.js.map +1 -0
  167. package/dist/init/ai-proposal.d.ts +15 -0
  168. package/dist/init/ai-proposal.js +164 -0
  169. package/dist/init/ai-proposal.js.map +1 -0
  170. package/dist/init/docs-language.d.ts +12 -0
  171. package/dist/init/docs-language.js +110 -0
  172. package/dist/init/docs-language.js.map +1 -0
  173. package/dist/init/managed-skills.d.ts +81 -0
  174. package/dist/init/managed-skills.js +407 -0
  175. package/dist/init/managed-skills.js.map +1 -0
  176. package/dist/init/minimal-source.d.ts +14 -0
  177. package/dist/init/minimal-source.js +42 -0
  178. package/dist/init/minimal-source.js.map +1 -0
  179. package/dist/init/practice-authoring.d.ts +5 -0
  180. package/dist/init/practice-authoring.js +36 -0
  181. package/dist/init/practice-authoring.js.map +1 -0
  182. package/dist/init/practice-docs.d.ts +13 -0
  183. package/dist/init/practice-docs.js +278 -0
  184. package/dist/init/practice-docs.js.map +1 -0
  185. package/dist/init/practice.d.ts +78 -0
  186. package/dist/init/practice.js +528 -0
  187. package/dist/init/practice.js.map +1 -0
  188. package/dist/init/scanner.d.ts +22 -0
  189. package/dist/init/scanner.js +190 -0
  190. package/dist/init/scanner.js.map +1 -0
  191. package/dist/init/skill-templates.d.ts +7 -0
  192. package/dist/init/skill-templates.js +25 -0
  193. package/dist/init/skill-templates.js.map +1 -0
  194. package/dist/init/templates.d.ts +53 -0
  195. package/dist/init/templates.js +254 -0
  196. package/dist/init/templates.js.map +1 -0
  197. package/dist/model/agents-md.d.ts +6 -0
  198. package/dist/model/agents-md.js +41 -0
  199. package/dist/model/agents-md.js.map +1 -0
  200. package/dist/model/agents.d.ts +12 -0
  201. package/dist/model/agents.js +346 -0
  202. package/dist/model/agents.js.map +1 -0
  203. package/dist/model/diagnostics-codes.d.ts +34 -0
  204. package/dist/model/diagnostics-codes.js +35 -0
  205. package/dist/model/diagnostics-codes.js.map +1 -0
  206. package/dist/model/facts.d.ts +10 -0
  207. package/dist/model/facts.js +36 -0
  208. package/dist/model/facts.js.map +1 -0
  209. package/dist/model/frontmatter.d.ts +17 -0
  210. package/dist/model/frontmatter.js +97 -0
  211. package/dist/model/frontmatter.js.map +1 -0
  212. package/dist/model/hooks.d.ts +2 -0
  213. package/dist/model/hooks.js +175 -0
  214. package/dist/model/hooks.js.map +1 -0
  215. package/dist/model/memory.d.ts +3 -0
  216. package/dist/model/memory.js +165 -0
  217. package/dist/model/memory.js.map +1 -0
  218. package/dist/model/policy.d.ts +8 -0
  219. package/dist/model/policy.js +46 -0
  220. package/dist/model/policy.js.map +1 -0
  221. package/dist/model/project-manifest.d.ts +26 -0
  222. package/dist/model/project-manifest.js +210 -0
  223. package/dist/model/project-manifest.js.map +1 -0
  224. package/dist/model/rules.d.ts +2 -0
  225. package/dist/model/rules.js +98 -0
  226. package/dist/model/rules.js.map +1 -0
  227. package/dist/model/schemas.d.ts +379 -0
  228. package/dist/model/schemas.js +310 -0
  229. package/dist/model/schemas.js.map +1 -0
  230. package/dist/model/scope.d.ts +29 -0
  231. package/dist/model/scope.js +204 -0
  232. package/dist/model/scope.js.map +1 -0
  233. package/dist/model/skills.d.ts +12 -0
  234. package/dist/model/skills.js +181 -0
  235. package/dist/model/skills.js.map +1 -0
  236. package/dist/model/types.d.ts +87 -0
  237. package/dist/model/types.js +2 -0
  238. package/dist/model/types.js.map +1 -0
  239. package/package.json +60 -4
  240. package/skills/dab-architecture-writing/SKILL.md +58 -0
  241. package/skills/dab-decision-notes/SKILL.md +57 -0
  242. package/skills/dab-doc-writing/SKILL.md +58 -0
package/AGENTS.md ADDED
@@ -0,0 +1,62 @@
1
+ # DAB — Drive Agent as Builder
2
+
3
+ DAB turns `AGENTS.md` and `.agents/` into governed Claude Code configuration.
4
+ `.claude/` is generated; never edit it by hand.
5
+
6
+ ## Project map
7
+
8
+ - `src/cli.ts`: command dispatch and exit codes.
9
+ - `src/commands/`: `init`, `detect`, `normalize`, `policy explain`.
10
+ - `src/model/`: authored source schemas and discovery.
11
+ - `src/model/scope.ts`: scope and source-root resolution.
12
+ - `src/model/facts.ts`: common source-fact discovery.
13
+ - `src/core/skill-marker.ts`: managed skill marker parsing, insertion and body hashing.
14
+ - `src/adapter/types.ts`: target adapter contract.
15
+ - `src/adapter/claude-code/adapter.ts`: Claude target adapter.
16
+ - `src/adapter/claude-code/instructions.ts`: instruction artifact.
17
+ - `src/adapter/claude-code/`: policy compilation, projections and settings.
18
+ - `src/detect/`: drift checks.
19
+ - `src/init/`: repository scan and templates.
20
+ - `src/init/skill-templates.ts`: canonical authoring-skill loader and renderer.
21
+ - `src/init/managed-skills.ts`: managed authoring-skill planning, update and apply-time revalidation.
22
+ - `skills/`: canonical authoring-skill templates published with the package.
23
+ - `src/docs/`: bilingual documentation gates.
24
+ - `docs/`: architecture, development and user documentation.
25
+ - `docs/superpowers/`: Chinese-only specs and plans for the superpowers workflow.
26
+ - `.agents/`: agents, skills, rules, policies, hooks and shared memory.
27
+
28
+ ## Commands
29
+
30
+ - Install: `pnpm install`
31
+ - Build: `pnpm build`
32
+ - Test: `pnpm test`
33
+ - Typecheck: `pnpm typecheck`
34
+ - Docs gate: `pnpm doc-sync`
35
+ - Normalize generated config: `node dist/cli.js normalize`
36
+ - Detect drift: `node dist/cli.js detect`
37
+
38
+ ## Rules
39
+
40
+ 1. `AGENTS.md` and `.agents/` are the only authored agent configuration. Never edit `.claude/` by hand.
41
+ 2. Write a failing test before production code. Run the focused test, then the full suite.
42
+ 3. Keep TypeScript ESM, Node `>=24.9`, and the public `dab` command stable.
43
+ 4. Fail loud: no silent fallback, no silent permission widening, no deletion of unmanaged files.
44
+ 5. Update English and Chinese documentation in the same change. The pairing record is part of the change. Chinese-only artifacts under `docs/superpowers/` are exempt unless explicitly requested.
45
+ 6. Run `pnpm doc-sync` before committing documentation changes.
46
+ 7. Record important decisions in `.agents/notes/` with alternatives, consequences and verification.
47
+ 8. Use `feature-delivery` for scoped work and `doc-sync` when changing paired docs.
48
+
49
+ ## Documentation
50
+
51
+ - [Documentation guide](docs/AGENTS.md)
52
+ - [Why DAB exists](docs/concepts/why-dab.md)
53
+ - [Roadmap](docs/roadmap.md)
54
+ - [Architecture](docs/architecture.md)
55
+ - [Development](docs/development.md)
56
+ - [CLI](docs/user/cli.md)
57
+ - [Claude Code integration](docs/user/claude-code.md)
58
+ - [Superpowers docs](docs/superpowers/README.md)
59
+ - [Agent Note 0001](.agents/notes/implemented/architecture/2026-11-16-agents-source-tree.md)
60
+ - [Agent Note 0002](.agents/notes/implemented/architecture/2026-11-16-claude-md-compat-shim.md)
61
+ - [Agent Note 0003](.agents/notes/implemented/architecture/2026-11-23-practice-layer.md)
62
+ - [Agent Note 0004](.agents/notes/implemented/architecture/2026-11-24-managed-skills.md)
package/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ English | [中文](CHANGELOG.zh.md)
2
+
3
+ # Changelog
4
+
5
+ ## 0.1.2 — 2026-11-24
6
+
7
+ - `dab init` now writes `profile: generic` and `docs.language: auto` by default. `--profile generic|feature` selects the manifest profile; `feature` is a compatibility alias with the same practice behavior. `docs.language` accepts `auto`, `en` or `zh`, is resolved from project content and locale when `auto`, and reports `{ value, source }` in human output and JSON.
8
+ - `dab init` and `dab normalize` adoption no longer scaffold advanced `.agents/hooks/` or `.agents/memory/` files; the generic profile focuses on drift detection/repair and the documentation, notes and skills discipline. Existing authored hooks and shared memory are untouched: hooks are still validated and compiled where applicable, memory is still preserved and validated, and `dab detect` omits their checklist groups when absent.
9
+ - `dab init` and `dab normalize` scaffold single-language `docs/AGENTS.md` and `docs/architecture.md` without `.zh.md` or `.i18n.yaml` pairs, plus the `dab-doc-writing`, `dab-architecture-writing` and `dab-decision-notes` authoring skills. Existing docs and skill directories are never overwritten; managed `dab-*` skills are updated only when their marker hash proves they are unmodified.
10
+ - Authoring skills now come from canonical `skills/<name>/SKILL.md` templates shipped in the npm package. Installed `.agents/skills/dab-*` copies carry a `<!-- dab-skill: <name>@<version> sha256=<hash> -->` marker whose hash covers the marker-stripped body; DAB reads the package templates directly and never calls `npx skills` or a network installer.
11
+ - `dab normalize` now manages installed `dab-*` skills before target planning: it creates missing skills, updates an unmodified copy whose marker version is older, and migrates a legacy marker without a hash when the body matches the current template. It preserves and warns about modified bodies, newer or uncomparable versions, differing legacy bodies, missing markers and markers naming another skill, and managed updates create no backups. `dab detect` reports the corresponding states: `practice.skill-stale` remains strict, while the preserved states do not fail `--strict`. `normalize --json` adds `practices.skills.updated`, `migrated`, `modified`, `newer`, `legacy`, `unversioned`, `markerMismatch` and `concurrent`.
12
+ - Managed skill writes re-read the target immediately before writing and verify the planned marker, version and body hash. A file changed, removed or created after planning is preserved with a `practice.skill-concurrent-change` warning, and a missing skill uses an exclusive create so a concurrent file is never replaced.
13
+ - An in-root symlink at `.agents/skills/dab-*/SKILL.md` is now a governed `practice.skill-path` error; only the containing skill directory may be an in-root symlink. Managed updates require stable numeric DAB versions, so a prerelease DAB version preserves installed skills instead of updating them.
14
+ - `dab init` now leaves an importable physical `.claude/skills/dab-*` directory pending, skips that authoring template and leaves the import to `dab normalize`; a non-directory entry is reported as a warning pending with `practice.skill-import-conflict` and no import hint. It never writes or replaces the physical entry.
15
+ - The generic skeleton no longer generates `.agents/rules/docs-bilingual.md`; an existing authored rule is preserved and policy-skips missing single-language docs with `practice.docs-bilingual-policy`. Existing docs are preserved as skipped and never blocked by a dangling docs path. Authoring skills and target writes continue.
16
+ - `dab normalize` fills missing practice files in uninitialized, partial and initialized project scopes before target planning. `--json` adds project-scope `practices` with `profile`, `mode`, `language`, `created`, `skipped`, `policySkipped`, `directories`, `skills` and `diagnostics`; a dry run and a run blocked before practice writes keep planned entries, a run blocked by a later target failure reports the files it wrote, and global scope omits the object.
17
+ - Practice path validation rejects escaping symlinks, special files and unreadable targets. Existing docs must be regular readable files or in-root symlinks to one; skill directories must be real directories or in-root symlinks to a directory with read and search permission. A regular file at `.agents/rules` or `.agents/skills` is a governed diagnostic in `init`, `normalize` and `detect` instead of an internal error. A regular file, dangling link, denied access or symlink loop at `.agents/agents`, `.agents/hooks`, `.agents/memory`, `.agents/notes`, `.agents/policies` or `.agents/adapters` is a governed `path.conflict`, and project and global runs block before writes or discovery. A source parent without read and search permission is governed the same way; the best-effort secret scan may skip unreadable subtrees, but access errors come from the parent probe.
18
+ - An unreadable nested skill directory is reported as `skill.unreadable` instead of silently emptying every skill fact. Sibling skills still validate and project, and `init`, `normalize` and `detect` never report the project healthy; `normalize` writes no Claude target output in that run.
19
+ - `dab normalize` converge links an existing root `AGENTS.md` from generated `docs/AGENTS.md` and omits the link when `AGENTS.md` is absent.
20
+ - `dab detect` adds a `Documentation` group and authoring skill entries in `Skills`, checking links, line-start TODO markers, empty architecture sections and skill version markers. Missing practice files, TODOs, empty sections and stale skills fail `--strict`; bilingual policy skips and preserved skill states stay informational.
21
+ - DAB now dogfoods the practice layer: its own `docs/AGENTS.md` guide and `dab-*` authoring skills live in the authored source tree and are checked by `dab detect`.
22
+ - `dab detect` prints a read-only checklist for uninitialized, partial and initialized project and global scopes, with `[OK]`, `[MISSING]`, `[WARN]`, `[ERROR]` and `[IMPORTABLE]` states, a score and next actions; JSON adds `scope`, `root`, `phase`, `profile`, `checklist`, `score` and `nextActions`. Initialized scopes also report importable physical entries instead of unmanaged or physical-copy drift.
23
+ - Uninitialized and partial `dab detect --json` results are now the full checklist object with `ok: false` and `exitCode: 2` instead of the error envelope; `schemaVersion` stays `1`.
24
+ - `dab normalize` adopts missing minimal source and imports physical `.claude/agents` and `.claude/skills` entries into `.agents`, backing up originals under `.dab/backups/` and replacing them with per-entry symlinks. Invalid imports block every write, and `--fix` still covers non-import conflicts only.
25
+ - `dab normalize --dry-run` lists import, backup and symlink actions and planned backup paths; human output also shows adoption source actions, import actions and backups on real runs.
26
+ - Managed projection symlink drift is repaired without `--fix`; an unmanaged entry symlink with an authored source is repaired by `--fix`, while a link with no authored source needs manual removal. `dab init` never imports existing `.claude` entries.
27
+ - Global scope gets the same checklist and adoption/import behavior; `~/.claude/settings.json` and `$HOME/.gitignore` remain read-only and `dab init ~/.agents` is still the explicit entry point for a missing global source.
28
+ - `dab init` remains the one-time full-profile initializer; existing projects use `dab detect` and `dab normalize`.
29
+
30
+ ## 0.1.1 — 2026-11-23
31
+
32
+ - Published the CLI as `@saydone/dab` with a GitHub Actions release workflow, npm provenance and a GitHub Release for each tag.
33
+ - Added `schemaVersion: 1` to every `--json` result and rejected `--json` with `--help` or `--version`.
34
+ - Agent, skill and rule frontmatter now preserves unknown top-level fields and warns with a did-you-mean hint, including transposed letters; DAB-owned YAML remains strict.
35
+ - Added `dab detect --strict` to fail CI on project and configuration warnings.
36
+ - `dab normalize --json` includes an absolute `root`; `dab init --json` includes `root` and `scopeRoot`, with generated and backup paths relative to them.
37
+ - Unified the Windows platform guard across all commands and reduced normalize to one Claude Code version check.
38
+ - Made file and diagnostic ordering locale-independent so hashes and JSON stay stable across machines.
39
+ - `dab --version` now reads the version from `package.json`.
40
+ - Added independent project and global scopes with v2 manifests and per-target generated records.
41
+ - Added the target adapter foundation and symlink-first Claude Code instruction artifacts.
42
+ - Added the bilingual conceptual model for DAB, DAD and their nested delivery levels.
43
+ - Clarified the boundary between implemented governance and planned evidence work.
44
+ - Reordered the roadmap around DAD first, with DAB gated on observed goal-level delivery failures.
45
+
46
+ ## 0.1.0 — 2026-11-16
47
+
48
+ - Initial `dab` CLI with `init`, `detect`, `normalize` and `policy explain`.
49
+ - Claude Code-first adapter with deterministic `.claude/settings.json` and per-entry symlinks.
50
+ - Generated `.claude/CLAUDE.md` import shim for AGENTS.md compatibility.
51
+ - Bilingual documentation gates for pairing, links, wrap, budgets and Agent Notes.
52
+ - Shared policy and Claude Code adapter layers with deny-first compilation.
@@ -0,0 +1,52 @@
1
+ [English](CHANGELOG.md) | 中文
2
+
3
+ # 变更日志
4
+
5
+ ## 0.1.2 — 2026-11-24
6
+
7
+ - `dab init` 默认写入 `profile: generic` 和 `docs.language: auto`。`--profile generic|feature` 选择 manifest profile;`feature` 是行为相同的兼容别名。`docs.language` 接受 `auto`、`en` 或 `zh`;`auto` 从项目内容和 locale 解析,并在人类输出和 JSON 中报告 `{ value, source }`。
8
+ - `dab init` 和 `dab normalize` adoption 不再生成高级 `.agents/hooks/` 或 `.agents/memory/` 文件;generic profile 聚焦漂移检测/修复,以及 docs、notes 和 skills 纪律。已有的 authored hooks 和共享记忆保持不变:hooks 仍会被校验并在适用时编译,记忆仍会被保留和校验;缺失时 `dab detect` 会省略它们的 checklist 组。
9
+ - `dab init` 和 `dab normalize` 生成单语 `docs/AGENTS.md` 和 `docs/architecture.md`,不生成 `.zh.md` 或 `.i18n.yaml` 配对,并安装 `dab-doc-writing`、`dab-architecture-writing` 和 `dab-decision-notes` authoring skills。已有 docs 和 skill 目录永不被覆盖;受管 `dab-*` skills 仅在 marker hash 证明其未被修改时更新。
10
+ - Authoring skills 现在来自 npm 包内发布的 canonical `skills/<name>/SKILL.md` 模板。已安装的 `.agents/skills/dab-*` 副本带 `<!-- dab-skill: <name>@<version> sha256=<hash> -->` 标记,其 hash 覆盖移除 marker 后的 body;DAB 直接读取包内模板,从不调用 `npx skills` 或网络安装器。
11
+ - `dab normalize` 现在在 target planning 之前管理已安装的 `dab-*` skills:创建缺失 skills,更新 marker 版本较旧且未修改的副本,并在无 hash 的 legacy marker 去掉后 body 与当前模板一致时迁移它。它会保留并警告已修改 body、较新或无法比较的版本、不同的 legacy body、缺失 marker 和指向其他 skill 的 marker,且受管更新不创建备份。`dab detect` 报告对应状态:`practice.skill-stale` 仍为 strict,保留类状态不会让 `--strict` 失败。`normalize --json` 新增 `practices.skills.updated`、`migrated`、`modified`、`newer`、`legacy`、`unversioned`、`markerMismatch` 和 `concurrent`。
12
+ - 受管 skill 写入会在写入前立即重新读取目标并校验计划的 marker、版本和 body hash。planning 之后被修改、删除或新建的文件会以 `practice.skill-concurrent-change` warning 保留;缺失 skill 使用独占创建,因此并发文件不会被替换。
13
+ - `.agents/skills/dab-*/SKILL.md` 上的 root 内符号链接现在是受管的 `practice.skill-path` 错误;只有所在 skill 目录可以是 root 内符号链接。受管更新要求稳定的数字 DAB 版本,因此 prerelease DAB 版本会保留已安装 skills 而不是更新它们。
14
+ - `dab init` 现在会把可导入的物理 `.claude/skills/dab-*` 目录标记为 pending,跳过对应的 authoring 模板,并把 import 留给 `dab normalize`;非目录条目以 warning pending 报告为 `practice.skill-import-conflict`,不提供 import 提示。它从不写入或替换该物理条目。
15
+ - Generic skeleton 不再生成 `.agents/rules/docs-bilingual.md`;已有的 authored 规则会保留,并以 `practice.docs-bilingual-policy` 对缺失的单语 docs 做 policy skip。已有 docs 作为 skipped 保留,悬空的 docs 路径不会阻断它们。Authoring skills 和 target 写入继续。
16
+ - `dab normalize` 在 target planning 之前为未初始化、partial 和已初始化 project scope 补齐缺失的实践文件。`--json` 为 project scope 追加 `practices`,包含 `profile`、`mode`、`language`、`created`、`skipped`、`policySkipped`、`directories`、`skills` 和 `diagnostics`;dry run 和 practice 写入前被阻断的运行保留计划条目,被后续 target 失败阻断的运行报告已写入的文件,global scope 省略该对象。
17
+ - Practice 路径校验拒绝逃逸符号链接、特殊文件和不可读 target。已有 docs 必须是可读普通文件或指向它的仓库内符号链接;skill 目录必须是真实目录或指向具备读与搜索权限目录的仓库内符号链接。`.agents/rules` 或 `.agents/skills` 处的普通文件在 `init`、`normalize` 和 `detect` 中是受治理的诊断,而不是内部错误。`.agents/agents`、`.agents/hooks`、`.agents/memory`、`.agents/notes`、`.agents/policies` 或 `.agents/adapters` 处的普通文件、悬空链接、访问拒绝或符号链接循环是受治理的 `path.conflict`,project 和 global 运行都会在写入或发现之前阻断。缺少读与搜索权限的 source parent 同样受治理;best-effort secret scan 可能跳过不可读子树,但访问错误由 parent probe 报告。
18
+ - 不可读的嵌套 skill 目录会报告为 `skill.unreadable`,而不是静默清空所有 skill 事实。同级 skills 仍会被校验和投影,`init`、`normalize` 和 `detect` 绝不会把项目报告为健康;该次 `normalize` 不会写入任何 Claude target 输出。
19
+ - `dab normalize` converge 在 `AGENTS.md` 存在时从生成的 `docs/AGENTS.md` 链接它,缺失时省略 `AGENTS.md` 链接。
20
+ - `dab detect` 增加 `Documentation` 组和 `Skills` 中的 authoring skill 条目,检查链接、行首 TODO 标记、空架构章节和 skill 版本标记。缺失的实践文件、TODO、空章节和落后 skills 会让 `--strict` 失败;双语 policy skip 和保留类 skill 状态保持信息性。
21
+ - DAB 现在 dogfood 实践层:自身的 `docs/AGENTS.md` 指南和 `dab-*` authoring skills 位于 authored source tree,并由 `dab detect` 检查。
22
+ - `dab detect` 为未初始化、partial 和已初始化的 project/global scope 输出只读 checklist,包含 `[OK]`、`[MISSING]`、`[WARN]`、`[ERROR]` 和 `[IMPORTABLE]` 状态、score 和 next actions;JSON 追加 `scope`、`root`、`phase`、`profile`、`checklist`、`score` 和 `nextActions`。已初始化 scope 也会把可导入的物理条目报告为 importable,而不是 unmanaged 或 physical-copy 漂移。
23
+ - 未初始化和 partial 的 `dab detect --json` 结果现在是完整 checklist 对象,包含 `ok: false` 和 `exitCode: 2`,不再使用错误信封;`schemaVersion` 仍为 `1`。
24
+ - `dab normalize` 采用缺失的最小 source,并把物理 `.claude/agents` 和 `.claude/skills` 条目导入 `.agents`,将原文件备份到 `.dab/backups/` 后替换为逐项符号链接。非法 import 会阻止所有写入,`--fix` 仍只处理非 import 冲突。
25
+ - `dab normalize --dry-run` 列出 import、backup 和 symlink 动作以及计划备份路径;真实运行时人类输出也会显示 adoption source 动作、import 动作和备份。
26
+ - Managed projection 符号链接漂移无需 `--fix` 即可修复;有 authored source 的 unmanaged 条目符号链接由 `--fix` 修复,没有 authored source 的链接需要手动移除。`dab init` 从不导入现有 `.claude` 条目。
27
+ - Global scope 获得相同的 checklist 和 adoption/import 行为;`~/.claude/settings.json` 和 `$HOME/.gitignore` 保持只读,Global source 完全缺失时仍以 `dab init ~/.agents` 作为显式入口。
28
+ - `dab init` 仍是一次性 full profile 初始化入口;已有项目使用 `dab detect` 和 `dab normalize`。
29
+
30
+ ## 0.1.1 — 2026-11-23
31
+
32
+ - 以 `@saydone/dab` 发布 CLI,并增加 GitHub Actions release workflow、npm provenance 和逐 tag 的 GitHub Release。
33
+ - `schemaVersion: 1` 已加入每个 `--json` 结果,并拒绝 `--json` 与 `--help` 或 `--version` 组合使用。
34
+ - Agent、skill 和 rule frontmatter 现在保留未知顶层字段,并以 did-you-mean 提示发出警告(包含字母转置);DAB 自有 YAML 仍然严格。
35
+ - 增加 `dab detect --strict`,在项目/配置类 warning 时让 CI 失败。
36
+ - `dab normalize --json` 包含绝对 `root`;`dab init --json` 包含 `root` 和 `scopeRoot`,生成与 backup 路径相对于它们。
37
+ - 统一所有命令的 Windows 平台守卫,并将 normalize 的 Claude Code 版本检查减少为一次。
38
+ - 文件与诊断排序不再依赖 locale,使哈希和 JSON 在不同机器上保持稳定。
39
+ - `dab --version` 现在从 `package.json` 读取版本。
40
+ - 增加相互独立的 project/global scope、v2 manifest 和逐 target 生成记录。
41
+ - 增加 target adapter 基础层和 symlink 优先的 Claude Code 指令产物。
42
+ - 增加 DAB、DAD 及其嵌套交付层级的中英文概念模型。
43
+ - 明确区分已实现的治理能力与计划中的证据能力。
44
+ - 将 Roadmap 重排为 DAD 优先,并以真实目标级交付失败作为 DAB 的研究门槛。
45
+
46
+ ## 0.1.0 — 2026-11-16
47
+
48
+ - 初始 `dab` CLI,包含 `init`、`detect`、`normalize` 和 `policy explain`。
49
+ - Claude Code-first adapter,生成确定性的 `.claude/settings.json` 和逐项符号链接。
50
+ - 生成 `.claude/CLAUDE.md` 导入垫片,兼容 AGENTS.md。
51
+ - 双语文档门禁,覆盖配对、链接、排版、预算和 Agent 决策记录。
52
+ - 共享策略与 Claude Code adapter 分层,采用 deny 优先编译。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DAB contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,55 @@
1
+ version: 1
2
+ source: README.md
3
+ translation: README.zh.md
4
+ frontmatter:
5
+ source: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
6
+ translation: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
7
+ sections:
8
+ - index: 0
9
+ level: 0
10
+ source: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
11
+ translation: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
12
+ - index: 1
13
+ level: 1
14
+ source: d7f8fe9e8582cc22e7cf0aab17534df3b344f8a3c40debe6a5008cc2141002bb
15
+ translation: 3cc7fe20c7cc7a2f8c0f6e3c86f353fc796aa5ed12daa71e624846fa153849b3
16
+ - index: 2
17
+ level: 2
18
+ source: f3ed1fffec70326edfdfb14bcfb8c2aff0f611c52f6d040ff3b7f833b5379146
19
+ translation: 6b4daa93e70cde4f4d1a84e92d81b048e47b2136f57bf54ecae858828ea31fb0
20
+ - index: 3
21
+ level: 3
22
+ source: f6b8c87b286ebc04dd339346848ee6f83be71b0ee722bf80494f68803fe3a999
23
+ translation: ddc3986f6439fe4688471825ac95a56e453bc43970b8d73217c2e67c2ad4cc28
24
+ - index: 4
25
+ level: 2
26
+ source: 6c034db467c5532be52fdbe4472a828b1f6ce2a01d532aa1b215ccdd3990b0c0
27
+ translation: 3215d6f54fd6a11267fe4fab1cec7924daba4926d7cb2c39ff5d78bc6ecbb599
28
+ - index: 5
29
+ level: 2
30
+ source: b5df923effd691fbdef2abd96ebc15dae28275d51d460f9e9d9e1dcc5be2a5d0
31
+ translation: 9075b4e3fa78f97901e212789116953b7fe028556161944841bca92322e4cfa2
32
+ - index: 6
33
+ level: 2
34
+ source: 971465fe62688a667fea87ced7cfbd240d1ca81ab444e5777882d7b3e52af0dc
35
+ translation: 13305a71e864f4c1049c18e347d260d498b4612734665faad680fc4408ad4a49
36
+ - index: 7
37
+ level: 2
38
+ source: e49fba0ae2b5c46361a6e05b445f6964012e33eeb5b8d93701de12af50360d0d
39
+ translation: e6c7783cf37a4f20be9782b7908ba3a3464a96d697befc103f8e2485b7d87afc
40
+ - index: 8
41
+ level: 2
42
+ source: beccf7655dbadb5720623d972593f90576aa346f0abf81e1c8c7de8111d5827e
43
+ translation: 55cf08493684d9fc90c58f85beff38b3a6877689a885068e3e1582a4eb674c32
44
+ - index: 9
45
+ level: 2
46
+ source: d0f65bd3ef43259a301d244c07061c3da61f75124a63d442c42b1e351f4ba8eb
47
+ translation: 33331c29e0532744c866c0169e05989527f3de8352d6dec7bdf1c5492df6bfd3
48
+ - index: 10
49
+ level: 2
50
+ source: 13184b5950e519c0f922cba751f80ff88313644956b9fe5d4bf6092278542074
51
+ translation: bd286f8f5cb9e10ac766f0753db5150cc38f6e06bcbf08a95677241570202251
52
+ - index: 11
53
+ level: 2
54
+ source: f20ebe6476df3c73e9ae121c1497ecfd29740dad06c28864d9e9903bbabf0100
55
+ translation: e1e4dea8d186e41a71d3271f25fda29b6cd8351ad7e4c0371d8b43f86d925704
package/README.md CHANGED
@@ -1,3 +1,158 @@
1
- # Temporary Holding Version
1
+ English | [中文](README.zh.md)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # DAB — Drive Agent as Builder
4
+
5
+ DAB is the long-term direction: driving agents as Builders. The current implementation path is DAD (Drive Agent Development): making agents reliably drivable through governed project configuration, then proving that a single development task can be completed and accepted.
6
+
7
+ ## How DAB fits
8
+
9
+ The working model is `Agent = Model + Harness`. DAB is not a third term in that equation; it drives how the harness is configured and how the resulting work converges into a deliverable.
10
+
11
+ ```text
12
+ Builder
13
+ intent / constraints / acceptance
14
+ |
15
+ v
16
+ +------------------- DAB direction (research) --------------+
17
+ | Goal loop |
18
+ | Frame goal -> Decompose -> Integrate -> Accept -> Learn |
19
+ | | |
20
+ | v |
21
+ | DAD path (current) |
22
+ | facts / roles / tools / permissions / verification |
23
+ | Task loop: Frame -> Drive -> Inspect -> Recover |
24
+ | accepted -> Complete Task |
25
+ +------------------------------+---------------------------+
26
+ | configures + directs
27
+ v
28
+ Harness loop: think -> act -> observe
29
+ |
30
+ v
31
+ Model + Project
32
+ | evidence
33
+ +--------------> DAD / DAB
34
+ ```
35
+
36
+ The actors have distinct responsibilities:
37
+
38
+ - A Builder is the person accountable for intent, constraints, judgment and acceptance.
39
+ - An Agent is the execution actor that performs building work inside the harness.
40
+ - DAB is conceptually a driving system; this repository implements its control plane.
41
+ - The Harness is the execution engine: loop, tools, context, permissions and sessions.
42
+
43
+ ### Nested loops
44
+
45
+ - The harness loop handles local execution: `think -> act -> observe -> continue`.
46
+ - The DAD task loop drives one development task to completion and acceptance evidence.
47
+ - The DAB goal loop is a research direction for decomposing and integrating multiple tasks into one accepted goal.
48
+
49
+ Single-task closure belongs to DAD. DAB begins when multiple tasks must converge into a larger goal.
50
+
51
+ [Read the full conceptual model](docs/concepts/why-dab.md).
52
+
53
+ ## Current status
54
+
55
+ The diagram describes the combined target model. The DAD configuration-governance foundation is released as `@saydone/dab@0.1.2`, including the practice layer and managed authoring skills. Single-task evidence is next; DAB is not yet scheduled.
56
+
57
+ | Capability | Status |
58
+ |---|---|
59
+ | DAD authored facts, projections, drift checks and policy explanation | Released in 0.1.1 |
60
+ | DAD independent project/global scopes and v2 manifests | Released in 0.1.1 |
61
+ | DAD practice layer: generic profile, single-language docs and authoring skills | Released in 0.1.2 |
62
+ | DAD managed authoring skills: packaged templates, marker hashes and managed updates | Released in 0.1.2 |
63
+ | DAD advanced hooks and shared memory | Optional; not scaffolded by default |
64
+ | DAD evidence for one development task | Planned for v0.2; next |
65
+ | DAD memory and operational hardening | Planned for v0.3 |
66
+ | DAD Codex and DSH adapters | After single-task evidence |
67
+ | DAB goal decomposition and cross-task convergence | Research; gated by DAD evidence |
68
+
69
+ Release: [npm](https://www.npmjs.com/package/@saydone/dab) · [GitHub Release v0.1.2](https://github.com/pzsoftchen/drive-agent-build/releases/tag/v0.1.2)
70
+
71
+ ## Quick start
72
+
73
+ Requirements: Node.js `>=24.9`, Claude Code `>=2.1.277`, macOS or Linux.
74
+
75
+ Run the CLI without installing:
76
+
77
+ ```bash
78
+ npx @saydone/dab init /path/to/project
79
+ cd /path/to/project
80
+ npx @saydone/dab normalize --dry-run
81
+ npx @saydone/dab detect
82
+ ```
83
+
84
+ Install globally to use the shorter `dab` command:
85
+
86
+ ```bash
87
+ npm install -g @saydone/dab
88
+ dab --version
89
+ ```
90
+
91
+ The npm package is `@saydone/dab`; `npx dab` resolves to a different package.
92
+
93
+ For source development:
94
+
95
+ ```bash
96
+ pnpm install
97
+ pnpm build
98
+ pnpm link --global
99
+ ```
100
+
101
+ Use `dab init ~/.agents` to initialize the independent global scope.
102
+
103
+ ## What the commands do
104
+
105
+ - `dab init` writes the authored project skeleton, including `docs/AGENTS.md`, `docs/architecture.md` and the `dab-*` authoring skills, and runs normalize when it is safe. It does not scaffold advanced hooks or shared memory.
106
+ - `dab normalize` compiles policy, materializes instruction and projection artifacts, fills missing docs and authoring skills, updates unmodified managed authoring skills, and records hashes.
107
+ - `dab detect` checks authored facts, generated output, ownership and scope without writing.
108
+ - `dab policy explain` shows the effective rules and hooks for a selected target.
109
+
110
+ The generic profile focuses on configuration drift and the documentation, notes and skills discipline. Hooks and shared memory stay advanced and opt-in: existing hooks are still validated and compiled where applicable, and existing memory is still preserved and validated.
111
+
112
+ ## Why DAB exists
113
+
114
+ I started DAB from a change in where leverage lives. As agents take on more execution, I believe the Builder's advantage moves from completing every step by hand to designing the conditions under which agents can build reliably.
115
+
116
+ Two observations shaped my thinking:
117
+
118
+ - A DeepSeek operator developer described a likely shift from designing, writing and optimizing operators to driving agents that perform that work.
119
+ - Robin Li's Builder framing broadens the creator role beyond people who write code.
120
+
121
+ I first explored a narrower practice, DAD (Drive Agent Development): defining how agents should carry out development work and driving them through that process. DAB keeps DAD's authored facts, projections, drift detection and decisions, plus optional shared memory, then adds the delivery-oriented convergence described above. Development is the first scope because I am the first Builder, not because it is the endpoint.
122
+
123
+ ## Design principles
124
+
125
+ - DAB is a control plane, not an agent runtime.
126
+ - The Builder retains intent, constraints, acceptance and judgment; agents execute.
127
+ - Harnesses are replaceable. Claude Code is the first target, not the definition of DAB.
128
+ - Knowledge that should survive a session belongs in reviewable files, not hidden prompts.
129
+ - Repeatability beats one-off prompting; authored facts and generated configuration must remain comparable.
130
+
131
+ ## What DAB does not guarantee
132
+
133
+ - v0.1 is currently a single-developer, macOS and Linux, Claude Code-first implementation.
134
+ - It does not implement the DAB goal loop, a task graph, cross-task learning or automatic memory promotion.
135
+ - v0.2 will validate one development task at a time; it will not by itself prove DAB.
136
+ - Path deny rules are tool-level guardrails, not a sandbox.
137
+ - Hooks are trusted executable code; DAB checks metadata and static safety, not runtime behavior.
138
+ - Windows junctions, a GUI, a plugin marketplace and automatic DAD migration are out of scope.
139
+
140
+ ## Documentation
141
+
142
+ Full documentation: [docs](https://github.com/pzsoftchen/drive-agent-build/tree/main/docs)
143
+
144
+ - [Documentation guide](docs/AGENTS.md)
145
+ - [Why DAB exists](docs/concepts/why-dab.md)
146
+ - [Roadmap](docs/roadmap.md)
147
+ - [Architecture](docs/architecture.md)
148
+ - [Development](docs/development.md)
149
+ - [CLI](docs/user/cli.md)
150
+ - [Claude Code integration](docs/user/claude-code.md)
151
+ - [Agent Note 0001](.agents/notes/implemented/architecture/2026-11-16-agents-source-tree.md)
152
+ - [Agent Note 0002](.agents/notes/implemented/architecture/2026-11-16-claude-md-compat-shim.md)
153
+ - [Agent Note 0003](.agents/notes/implemented/architecture/2026-11-23-practice-layer.md)
154
+ - [Agent Note 0004](.agents/notes/implemented/architecture/2026-11-24-managed-skills.md)
155
+
156
+ ## License
157
+
158
+ MIT.
package/README.zh.md ADDED
@@ -0,0 +1,158 @@
1
+ [English](README.md) | 中文
2
+
3
+ # DAB:驱动 Agent 成为构建者
4
+
5
+ DAB 是长期方向:驱动 Agent 成为构建者。当前实现路径是 DAD(Drive Agent Development):先让 Agent 通过受治理的项目配置变得可可靠驾驶,再证明单个开发任务能够完成并通过验收。
6
+
7
+ ## DAB 位于哪里
8
+
9
+ 工作模型是 `Agent = Model + Harness`。DAB 不是这个等式中的第三项;它负责驾驶 Harness 如何被配置,以及工作如何收敛为可交付结果。
10
+
11
+ ```text
12
+ Builder
13
+ intent / constraints / acceptance
14
+ |
15
+ v
16
+ +------------------- DAB direction (research) --------------+
17
+ | Goal loop |
18
+ | Frame goal -> Decompose -> Integrate -> Accept -> Learn |
19
+ | | |
20
+ | v |
21
+ | DAD path (current) |
22
+ | facts / roles / tools / permissions / verification |
23
+ | Task loop: Frame -> Drive -> Inspect -> Recover |
24
+ | accepted -> Complete Task |
25
+ +------------------------------+---------------------------+
26
+ | configures + directs
27
+ v
28
+ Harness loop: think -> act -> observe
29
+ |
30
+ v
31
+ Model + Project
32
+ | evidence
33
+ +--------------> DAD / DAB
34
+ ```
35
+
36
+ 不同角色承担不同责任:
37
+
38
+ - Builder 是对意图、约束、判断和验收负责的人。
39
+ - Agent 是在 Harness 中执行构建工作的执行主体。
40
+ - DAB 在产品概念上是驾驶系统;本仓库实现的是它的控制面。
41
+ - Harness 是执行引擎,提供循环、工具、上下文、权限和会话。
42
+
43
+ ### 嵌套 Loop
44
+
45
+ - Harness Loop 负责局部执行:`think -> act -> observe -> continue`。
46
+ - DAD 任务循环负责把一个开发任务驾驶到完成,并产生验收证据。
47
+ - DAB 目标循环是研究方向,负责把多个任务分解、集成并收敛为一个通过验收的整体目标。
48
+
49
+ 单任务闭包属于 DAD。只有当多个任务必须共同收敛到一个更大目标时,DAB 才真正开始。
50
+
51
+ [阅读完整概念说明](docs/concepts/why-dab.zh.md)。
52
+
53
+ ## 当前状态
54
+
55
+ 图中的方式是 DAB/DAD 的组合目标模型。DAD 配置治理基础已发布为 `@saydone/dab@0.1.2`,包含实践层和受管 authoring skills。下一步是单任务证据;DAB 尚未排期。
56
+
57
+ | 能力 | 状态 |
58
+ |---|---|
59
+ | DAD 编写事实、投影、漂移检测和策略解释 | 已在 0.1.1 发布 |
60
+ | DAD 独立的 project/global scope 与 v2 manifest | 已在 0.1.1 发布 |
61
+ | DAD 实践层:generic profile、单语 docs 和 authoring skills | 已在 0.1.2 发布 |
62
+ | DAD 受管 authoring skills:包内模板、marker hash 和受管更新 | 已在 0.1.2 发布 |
63
+ | DAD 高级 hooks 与共享记忆 | 可选;默认不生成 |
64
+ | DAD 单开发任务证据 | 计划在 v0.2 提供,这是下一步 |
65
+ | DAD 记忆与运行加固 | 计划在 v0.3 提供 |
66
+ | DAD Codex 与 DSH adapter | 在单任务证据之后 |
67
+ | DAB 目标拆解与跨任务收敛 | 研究阶段,以 DAD 证据为前置条件 |
68
+
69
+ 发布:[npm](https://www.npmjs.com/package/@saydone/dab) · [GitHub Release v0.1.2](https://github.com/pzsoftchen/drive-agent-build/releases/tag/v0.1.2)
70
+
71
+ ## 快速开始
72
+
73
+ 前置条件:Node.js `>=24.9`、Claude Code `>=2.1.277`、macOS 或 Linux。
74
+
75
+ 无需安装,直接运行 CLI:
76
+
77
+ ```bash
78
+ npx @saydone/dab init /path/to/project
79
+ cd /path/to/project
80
+ npx @saydone/dab normalize --dry-run
81
+ npx @saydone/dab detect
82
+ ```
83
+
84
+ 全局安装后可使用更短的 `dab` 命令:
85
+
86
+ ```bash
87
+ npm install -g @saydone/dab
88
+ dab --version
89
+ ```
90
+
91
+ npm 包名是 `@saydone/dab`;`npx dab` 会解析到另一个包。
92
+
93
+ 从源码开发:
94
+
95
+ ```bash
96
+ pnpm install
97
+ pnpm build
98
+ pnpm link --global
99
+ ```
100
+
101
+ 使用 `dab init ~/.agents` 初始化独立的 global scope。
102
+
103
+ ## 命令做什么
104
+
105
+ - `dab init` 写入项目编写骨架,包括 `docs/AGENTS.md`、`docs/architecture.md` 和 `dab-*` authoring skills,并在安全时运行 normalize。它不生成高级 hooks 或共享记忆。
106
+ - `dab normalize` 编译策略、生成指令和投影产物、补齐缺失的 docs 和 authoring skills、更新未修改的受管 authoring skills,并记录哈希。
107
+ - `dab detect` 在不写入的情况下检查编写事实、生成输出、所有权和作用域。
108
+ - `dab policy explain` 展示选定 target 的最终规则和 hooks。
109
+
110
+ Generic profile 聚焦配置漂移,以及 docs、notes 和 skills 纪律。Hooks 与共享记忆保持高级、可选:已有 hooks 仍会被校验并在适用时编译,已有记忆仍会被保留和校验。
111
+
112
+ ## DAB 为什么存在
113
+
114
+ 我从个人杠杆正在发生变化这一点开始思考 DAB。当 Agent 承担越来越多执行工作时,我相信构建者的优势不再是亲手完成每一步,而是设计让 Agent 可靠构建的条件。
115
+
116
+ 两个判断影响了我的想法:
117
+
118
+ - 一位 DeepSeek 算子开发者判断,工作重心可能从设计、编写和优化算子,转向驾驶 Agent 完成这些工作。
119
+ - 李彦宏提出的 Builder,把创造者的范围从编写代码的人扩展到更广泛的人群。
120
+
121
+ 我最早实践的是一个更窄的做法:DAD(Drive Agent Development,驱动 Agent 开发),即定义 Agent 应如何开展开发工作,并驾驶 Agent 按这个过程执行。DAB 保留 DAD 的编写事实、投影、漂移检测和决策,以及可选的共享记忆,再增加前面描述的面向交付的收敛。开发是第一个范围,因为我自己就是第一位构建者,而不是因为开发就是终点。
122
+
123
+ ## 设计原则
124
+
125
+ - DAB 是控制面,不是 Agent runtime。
126
+ - 构建者保留意图、约束、验收和判断;Agent 负责执行。
127
+ - Harness 可以替换。Claude Code 是第一个目标,不是 DAB 的定义。
128
+ - 应当跨会话保留的知识放在可评审文件中,而不是隐藏在提示词里。
129
+ - 可重复性优先于一次性提示;编写事实和生成配置必须始终可比较。
130
+
131
+ ## DAB 不保证什么
132
+
133
+ - v0.1 当前是单开发者、macOS 和 Linux、Claude Code 优先的实现。
134
+ - 它不实现 DAB 目标循环、任务图、跨任务学习或自动记忆提升。
135
+ - v0.2 将验证单个开发任务,不代表 DAB 已被证明。
136
+ - 路径 deny 规则是工具级护栏,不是沙箱。
137
+ - Hooks 是可信的可执行代码;DAB 只检查元数据和静态安全,不检查运行时行为。
138
+ - Windows junction、GUI、插件市场和自动 DAD 迁移不在范围内。
139
+
140
+ ## 文档
141
+
142
+ 完整文档:[docs](https://github.com/pzsoftchen/drive-agent-build/tree/main/docs)
143
+
144
+ - [文档指南](docs/AGENTS.md)
145
+ - [DAB 为什么存在](docs/concepts/why-dab.zh.md)
146
+ - [路线图](docs/roadmap.zh.md)
147
+ - [架构](docs/architecture.zh.md)
148
+ - [开发](docs/development.zh.md)
149
+ - [CLI](docs/user/cli.zh.md)
150
+ - [Claude Code 集成](docs/user/claude-code.zh.md)
151
+ - [Agent 决策记录 0001](.agents/notes/implemented/architecture/2026-11-16-agents-source-tree.zh.md)
152
+ - [Agent 决策记录 0002](.agents/notes/implemented/architecture/2026-11-16-claude-md-compat-shim.zh.md)
153
+ - [Agent 决策记录 0003](.agents/notes/implemented/architecture/2026-11-23-practice-layer.zh.md)
154
+ - [Agent 决策记录 0004](.agents/notes/implemented/architecture/2026-11-24-managed-skills.zh.md)
155
+
156
+ ## 许可证
157
+
158
+ MIT。
@@ -0,0 +1,10 @@
1
+ import type { TargetProvider } from '../../model/types.ts';
2
+ import type { TargetContext, TargetDetectOutcome, TargetNormalizeInput, TargetNormalizePlan } from '../types.ts';
3
+ declare function normalize(input: TargetNormalizeInput): Promise<TargetNormalizePlan>;
4
+ declare function detect(input: TargetContext): Promise<TargetDetectOutcome>;
5
+ export declare const claudeCodeAdapter: {
6
+ provider: TargetProvider;
7
+ normalize: typeof normalize;
8
+ detect: typeof detect;
9
+ };
10
+ export {};