@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
@@ -0,0 +1,181 @@
1
+ import { readdir } from 'node:fs/promises';
2
+ import { basename, join, relative } from 'node:path';
3
+ import { compareStrings } from '../core/compare.js';
4
+ import { lstatOrNull, readTextFile } from '../core/fs-atomic.js';
5
+ import { toPosix } from '../core/paths.js';
6
+ import { pathProblemFrom, problemMessage } from '../core/practice-paths.js';
7
+ import { DiagnosticCodes } from './diagnostics-codes.js';
8
+ import { parseFrontmatter, unknownFrontmatterDiagnostic } from './frontmatter.js';
9
+ import { KEBAB_CASE, SkillFrontmatterSchema } from './schemas.js';
10
+ const SKILL_FRONTMATTER_FIELDS = Object.keys(SkillFrontmatterSchema.shape);
11
+ function zodMessage(error) {
12
+ return error.issues
13
+ .map((issue) => {
14
+ const path = issue.path.map(String).join('.');
15
+ return path.length === 0 ? issue.message : `${path}: ${issue.message}`;
16
+ })
17
+ .join('; ');
18
+ }
19
+ /**
20
+ * One unreadable skill directory must not erase the sibling facts. The error is
21
+ * governed per skill so discovery can continue and commands fail loudly on the
22
+ * reported path instead of claiming the skill set is empty.
23
+ */
24
+ function unreadableSkill(root, dir, error) {
25
+ const file = toPosix(relative(root, dir));
26
+ const problem = pathProblemFrom(error);
27
+ return {
28
+ code: DiagnosticCodes.skillUnreadable,
29
+ severity: 'error',
30
+ message: problem === undefined
31
+ ? `skill directory cannot be read: ${file}`
32
+ : `skill directory cannot be read: ${problemMessage(file, problem)}`,
33
+ file,
34
+ hint: 'Restore read and search permission for the skill directory; DAB never projects an unreadable skill.',
35
+ };
36
+ }
37
+ async function parseSkillSource(root, dir) {
38
+ const diagnostics = [];
39
+ const skillFile = join(dir, 'SKILL.md');
40
+ const file = toPosix(relative(root, skillFile));
41
+ let skillInfo;
42
+ try {
43
+ skillInfo = await lstatOrNull(skillFile);
44
+ }
45
+ catch (error) {
46
+ if (pathProblemFrom(error) === undefined) {
47
+ throw error;
48
+ }
49
+ diagnostics.push(unreadableSkill(root, dir, error));
50
+ return { diagnostics };
51
+ }
52
+ if (skillInfo === null) {
53
+ diagnostics.push({
54
+ code: DiagnosticCodes.skillMissing,
55
+ severity: 'warning',
56
+ message: `skill directory ${basename(dir)} has no SKILL.md`,
57
+ file: toPosix(relative(root, dir)),
58
+ });
59
+ return { diagnostics };
60
+ }
61
+ let parsed;
62
+ try {
63
+ parsed = parseFrontmatter(await readTextFile(skillFile), file);
64
+ }
65
+ catch (error) {
66
+ if (pathProblemFrom(error) !== undefined) {
67
+ diagnostics.push(unreadableSkill(root, dir, error));
68
+ return { diagnostics };
69
+ }
70
+ diagnostics.push({
71
+ code: DiagnosticCodes.skillInvalidFrontmatter,
72
+ severity: 'error',
73
+ message: `invalid skill frontmatter: ${error instanceof Error ? error.message : String(error)}`,
74
+ file,
75
+ line: 1,
76
+ });
77
+ return { diagnostics };
78
+ }
79
+ const validated = SkillFrontmatterSchema.safeParse(parsed.data);
80
+ if (!validated.success) {
81
+ diagnostics.push({
82
+ code: DiagnosticCodes.skillInvalidFrontmatter,
83
+ severity: 'error',
84
+ message: `invalid skill frontmatter: ${zodMessage(validated.error)}`,
85
+ file,
86
+ line: 1,
87
+ });
88
+ return { diagnostics };
89
+ }
90
+ const name = validated.data.name ?? basename(dir);
91
+ const unknown = unknownFrontmatterDiagnostic('skill', name, SKILL_FRONTMATTER_FIELDS, parsed.data, file);
92
+ if (unknown !== undefined) {
93
+ diagnostics.push(unknown);
94
+ }
95
+ if (!KEBAB_CASE.test(name)) {
96
+ diagnostics.push({
97
+ code: DiagnosticCodes.skillInvalidFrontmatter,
98
+ severity: 'error',
99
+ message: `skill name must be kebab-case: ${name}`,
100
+ file,
101
+ line: 1,
102
+ });
103
+ return { diagnostics };
104
+ }
105
+ return {
106
+ item: {
107
+ dir: toPosix(relative(root, dir)),
108
+ file,
109
+ name,
110
+ description: validated.data.description,
111
+ frontmatter: parsed.data,
112
+ },
113
+ diagnostics,
114
+ };
115
+ }
116
+ /**
117
+ * Validate one skill directory for adoption. Returns an item only when the source
118
+ * has no error diagnostics; warnings (such as unknown frontmatter) are preserved.
119
+ */
120
+ export async function validateSkillSource(root, dir) {
121
+ const result = await parseSkillSource(root, dir);
122
+ if (result.diagnostics.some((item) => item.severity === 'error')) {
123
+ return { diagnostics: result.diagnostics };
124
+ }
125
+ return result;
126
+ }
127
+ export async function discoverSkills(root, agentsDir) {
128
+ const sourceDir = join(agentsDir, 'skills');
129
+ let entries;
130
+ try {
131
+ entries = await readdir(sourceDir, { withFileTypes: true });
132
+ }
133
+ catch (error) {
134
+ if (error.code === 'ENOENT') {
135
+ return { items: [], diagnostics: [] };
136
+ }
137
+ throw error;
138
+ }
139
+ const items = [];
140
+ const diagnostics = [];
141
+ const names = new Map();
142
+ for (const entry of entries.sort((left, right) => compareStrings(left.name, right.name))) {
143
+ if (!entry.isDirectory() || entry.isSymbolicLink()) {
144
+ continue;
145
+ }
146
+ const dir = join(sourceDir, entry.name);
147
+ let source;
148
+ try {
149
+ source = await parseSkillSource(root, dir);
150
+ }
151
+ catch (error) {
152
+ // Keep sibling skills when one directory cannot be read. The practice
153
+ // parent check still owns an unreadable `.agents/skills` itself.
154
+ if (pathProblemFrom(error) === undefined) {
155
+ throw error;
156
+ }
157
+ diagnostics.push(unreadableSkill(root, dir, error));
158
+ continue;
159
+ }
160
+ diagnostics.push(...source.diagnostics);
161
+ if (source.item === undefined) {
162
+ continue;
163
+ }
164
+ const existing = names.get(source.item.name);
165
+ if (existing !== undefined) {
166
+ diagnostics.push({
167
+ code: DiagnosticCodes.skillDuplicateName,
168
+ severity: 'error',
169
+ message: `duplicate skill name ${source.item.name}`,
170
+ file: source.item.file,
171
+ hint: `The name is already used by ${existing}.`,
172
+ });
173
+ }
174
+ else {
175
+ names.set(source.item.name, source.item.file);
176
+ }
177
+ items.push(source.item);
178
+ }
179
+ return { items, diagnostics };
180
+ }
181
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/model/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC5E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jB,OAAO,EAAE,wBAAwB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;gBACnD,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;gBACtB,IAAI,EAAE,+BAA+B,QAAQ,GAAG;aACjD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { z } from 'zod';
2
+ import type { Diagnostic } from '../core/diagnostics.ts';
3
+ import type { AgentFrontmatterSchema, ClaudeCodePolicySchema, GeneratedManifestSchema, GeneratedTargetSchema, HookSpecSchema, LegacyProjectManifestSchema, MemoryEntrySchema, PolicySpecSchema, ProjectManifestSchema, ProjectionSchema, TargetConfigSchema } from './schemas.ts';
4
+ import type { Scope } from './scope.ts';
5
+ export type ProjectManifest = z.infer<typeof ProjectManifestSchema>;
6
+ export type LegacyProjectManifest = z.infer<typeof LegacyProjectManifestSchema>;
7
+ export type GeneratedManifest = z.infer<typeof GeneratedManifestSchema>;
8
+ export type TargetProvider = z.infer<typeof TargetConfigSchema>['provider'];
9
+ export type TargetConfig = z.infer<typeof TargetConfigSchema>;
10
+ export type GeneratedTarget = z.infer<typeof GeneratedTargetSchema>;
11
+ export type Projection = z.infer<typeof ProjectionSchema>;
12
+ export type PolicySpec = z.infer<typeof PolicySpecSchema>;
13
+ export type ClaudeCodePolicy = z.infer<typeof ClaudeCodePolicySchema>;
14
+ export type HookSpec = z.infer<typeof HookSpecSchema>;
15
+ export type AgentFrontmatter = z.infer<typeof AgentFrontmatterSchema>;
16
+ export type MemoryEntryFrontmatter = z.infer<typeof MemoryEntrySchema>;
17
+ export interface ProjectPaths {
18
+ root: string;
19
+ scope: Scope;
20
+ agents: string;
21
+ claude: string;
22
+ manifest: string;
23
+ instructions: string;
24
+ }
25
+ export interface DiscoveryResult<T> {
26
+ items: T[];
27
+ diagnostics: Diagnostic[];
28
+ }
29
+ export interface AgentHookDefinition {
30
+ id: string;
31
+ event: string;
32
+ matcher?: string;
33
+ command: string;
34
+ timeout?: number;
35
+ source: string;
36
+ }
37
+ export type AgentToolsSpec = {
38
+ mode: 'all';
39
+ explicit: boolean;
40
+ } | {
41
+ mode: 'none';
42
+ } | {
43
+ mode: 'list';
44
+ tools: string[];
45
+ };
46
+ export interface AgentDefinition {
47
+ file: string;
48
+ name: string;
49
+ description: string;
50
+ tools: string[];
51
+ toolsSpec: AgentToolsSpec;
52
+ disallowedTools: string[];
53
+ model?: string;
54
+ permissionMode?: string;
55
+ memory?: string;
56
+ hooks: AgentHookDefinition[];
57
+ body: string;
58
+ frontmatter: AgentFrontmatter;
59
+ }
60
+ export interface SkillDefinition {
61
+ dir: string;
62
+ file: string;
63
+ name: string;
64
+ description: string;
65
+ frontmatter: Record<string, unknown>;
66
+ }
67
+ export interface RuleDefinition {
68
+ file: string;
69
+ name: string;
70
+ paths: string[];
71
+ body: string;
72
+ }
73
+ export interface LoadedHook {
74
+ spec: HookSpec;
75
+ dir: string;
76
+ entryPath: string;
77
+ metadataPath: string;
78
+ }
79
+ export interface MemoryEntry {
80
+ file: string;
81
+ title: string;
82
+ source: string;
83
+ reviewBy: string;
84
+ updated?: string;
85
+ status?: string;
86
+ body: string;
87
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@saydone/dab",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.2",
4
+ "description": "DAB turns AGENTS.md and .agents/ into governed Claude Code configuration.",
5
+ "type": "module",
6
+ "bin": {
7
+ "dab": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "skills",
12
+ "LICENSE",
13
+ "README.md",
14
+ "README.zh.md",
15
+ "CHANGELOG.md",
16
+ "CHANGELOG.zh.md",
17
+ "AGENTS.md"
18
+ ],
19
+ "engines": {
20
+ "node": ">=24.9"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "license": "MIT",
26
+ "homepage": "https://github.com/pzsoftchen/drive-agent-build#readme",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/pzsoftchen/drive-agent-build.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/pzsoftchen/drive-agent-build/issues"
33
+ },
34
+ "keywords": [
35
+ "agents",
36
+ "claude-code",
37
+ "agent-builder",
38
+ "configuration"
39
+ ],
40
+ "packageManager": "pnpm@11.9.0",
41
+ "scripts": {
42
+ "prepack": "pnpm build",
43
+ "build": "tsc -p tsconfig.json",
44
+ "test": "vitest run",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit",
46
+ "verify-translation-pairing": "node dist/docs/cli.js pairing",
47
+ "verify-md-links": "node dist/docs/cli.js links",
48
+ "verify-md-wrap": "node dist/docs/cli.js wrap",
49
+ "verify-doc-budgets": "node dist/docs/cli.js budgets",
50
+ "verify-agent-note-format": "node dist/docs/cli.js notes",
51
+ "doc-sync": "pnpm build && node dist/docs/cli.js all"
52
+ },
53
+ "dependencies": {
54
+ "yaml": "2.9.1",
55
+ "zod": "4.6.7"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "26.6.6",
59
+ "typescript": "7.0.2",
60
+ "vitest": "5.1.0"
61
+ }
62
+ }
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: dab-architecture-writing
3
+ description: Use when filling docs/architecture.md with evidence about layout, components, runtime flow, seams and invariants.
4
+ ---
5
+ # Architecture writing
6
+
7
+ ## When to use
8
+
9
+ Use this skill to fill, restructure or review `docs/architecture.md`, or when a component, entry point, runtime flow, seam or invariant changes.
10
+
11
+ Write only what the repository proves. Leave an owner question when the design intent is not verifiable.
12
+
13
+ ## Workflow
14
+
15
+ 1. Top-level inventory: list source directories, entry points and external boundaries from the repository. Each entry names its evidence.
16
+ 2. Composition: describe the primary components and how they relate. Do not invent layers, call chains or responsibilities.
17
+ 3. Runtime flow: trace each main entry point end to end and name the files, tests or commands that prove the flow.
18
+ 4. Seams: record module boundaries, extension points and invariants where new behavior plugs in or must not break.
19
+ 5. Write current-state prose. Describe what exists now, not history, plans or implementation progress.
20
+ 6. Link owners: keep summaries in the architecture document and link detailed behavior to its owner document or source file instead of copying it.
21
+ 7. Fill TODOs: replace every skeleton TODO with an evidence-backed statement or `TODO(owner): question`.
22
+ 8. Verify each section against the code and the project commands below before handing the document to review.
23
+
24
+ ## Inputs
25
+
26
+ - When `docs/AGENTS.md` exists, it is the documentation authority; follow its placement, writing and verification rules before this skill.
27
+ - When `docs/AGENTS.md` does not exist, read the root `AGENTS.md` and the project rules under `.agents/rules/`. Project rules always win over this skill.
28
+ - The code, tests, configuration and executed commands that can evidence each claim.
29
+ - The owner documents and the links that the change touches.
30
+ - The project documentation language. Write in that one language; create translations or pairing records only when project rules require them.
31
+
32
+ ## Evidence and fact-check
33
+
34
+ - Every command, behavior, default, path or flow claim needs evidence: a source file, a test, a configuration value or an executed command.
35
+ - Read the evidence before writing the claim. A file name alone is not proof that the described behavior exists.
36
+ - This skill does not invent components, flows, boundaries, commands or history; if the repository does not show it, do not write it.
37
+ - Unverifiable content stays as `TODO(owner): question`. Never fill a TODO from memory, another project or this skill.
38
+
39
+ ## TODO rules
40
+
41
+ - Use `TODO(owner): question` when a statement cannot be verified from code, tests, configuration or an executed command. Write the open question, not a guessed answer.
42
+ - Name the question so the owner can answer it without re-reading this skill.
43
+ - Replace the TODO with current-state prose and its evidence once the evidence exists.
44
+ - Keep each TODO marker at the start of its line so the project's documentation checks can find it.
45
+ - Do not delete a TODO just to make a check pass; answer it or leave it with the question.
46
+
47
+ ## Project commands
48
+
49
+ - Read commands from `AGENTS.md`, `docs/AGENTS.md`, or the `scripts` field in `package.json`; use the commands the project documents.
50
+ - Use the package manager the repository already uses. Do not hardcode a package manager, test runner or documentation gate.
51
+ - Run only commands that exist. When a command is missing, write `TODO(owner): question` instead of inventing one.
52
+
53
+ ## Verification
54
+
55
+ - Run the project commands discovered above, including the documentation gate or `dab detect` when the project defines them.
56
+ - Confirm that every changed claim has evidence and that remaining TODOs are owner questions rather than missing guesses.
57
+ - Confirm that links point to files that exist and that headings, lists, tables and fenced code stay structurally stable.
58
+ - Semantic correctness still needs a review by a person or a review pass; this skill cannot prove meaning.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: dab-decision-notes
3
+ description: Use when recording a durable project decision, its alternatives, consequences, verification or supersession.
4
+ ---
5
+ # Decision notes
6
+
7
+ ## When to use
8
+
9
+ Use this skill to write or maintain an Agent Note for a durable, non-obvious decision.
10
+
11
+ When to write: the choice affects future code, architecture, process or tooling, and the reasoning will not be obvious from the result. Do not write a note for routine edits, reversible local choices or facts that already have an owner document.
12
+
13
+ ## Workflow
14
+
15
+ 1. Place one note per decision under the project's notes directory, following the note format the repository already uses.
16
+ 2. Choose a status: proposed for a decision under consideration, implemented for a decision in effect, rejected for an option that was considered and not adopted.
17
+ 3. Record Context, Decision, Alternatives, Consequences and Verification. Name each alternative that was seriously considered and explain why it lost.
18
+ 4. Consequences and Verification must be concrete. Verification names the tests, commands or manual checks that confirm the decision still holds.
19
+ 5. Supersession: when a new note replaces an older one, link the new note to the old and mark the old note as superseded by the new one. Do not rewrite the older decision's history.
20
+ 6. Do not archive, move or delete notes; supersession links preserve the history that later readers need.
21
+ 7. Verify the note against the code and the project commands below before handing it to review.
22
+
23
+ ## Inputs
24
+
25
+ - When `docs/AGENTS.md` exists, it is the documentation authority; follow its placement, writing and verification rules before this skill.
26
+ - When `docs/AGENTS.md` does not exist, read the root `AGENTS.md` and the project rules under `.agents/rules/`. Project rules always win over this skill.
27
+ - The code, tests, configuration and executed commands that can evidence each claim.
28
+ - The owner documents and the links that the change touches.
29
+ - The project documentation language. Write in that one language; create translations or pairing records only when project rules require them.
30
+
31
+ ## Evidence and fact-check
32
+
33
+ - Every command, behavior, default, path or flow claim needs evidence: a source file, a test, a configuration value or an executed command.
34
+ - Read the evidence before writing the claim. A file name alone is not proof that the described behavior exists.
35
+ - This skill does not invent components, flows, boundaries, commands or history; if the repository does not show it, do not write it.
36
+ - Unverifiable content stays as `TODO(owner): question`. Never fill a TODO from memory, another project or this skill.
37
+
38
+ ## TODO rules
39
+
40
+ - Use `TODO(owner): question` when a statement cannot be verified from code, tests, configuration or an executed command. Write the open question, not a guessed answer.
41
+ - Name the question so the owner can answer it without re-reading this skill.
42
+ - Replace the TODO with current-state prose and its evidence once the evidence exists.
43
+ - Keep each TODO marker at the start of its line so the project's documentation checks can find it.
44
+ - Do not delete a TODO just to make a check pass; answer it or leave it with the question.
45
+
46
+ ## Project commands
47
+
48
+ - Read commands from `AGENTS.md`, `docs/AGENTS.md`, or the `scripts` field in `package.json`; use the commands the project documents.
49
+ - Use the package manager the repository already uses. Do not hardcode a package manager, test runner or documentation gate.
50
+ - Run only commands that exist. When a command is missing, write `TODO(owner): question` instead of inventing one.
51
+
52
+ ## Verification
53
+
54
+ - Run the project commands discovered above, including the documentation gate or `dab detect` when the project defines them.
55
+ - Confirm that every changed claim has evidence and that remaining TODOs are owner questions rather than missing guesses.
56
+ - Confirm that links point to files that exist and that headings, lists, tables and fenced code stay structurally stable.
57
+ - Semantic correctness still needs a review by a person or a review pass; this skill cannot prove meaning.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: dab-doc-writing
3
+ description: Use when writing, restructuring or reviewing project documentation; covers placement, fact-check, slop audit and verification.
4
+ ---
5
+ # Documentation writing
6
+
7
+ ## When to use
8
+
9
+ Use this skill to write a new project document, restructure existing documentation, or review and fact-check a documentation change.
10
+
11
+ This skill owns the general workflow only. Project-specific placement and writing rules stay in the project's authority files; do not fork them here.
12
+
13
+ ## Workflow
14
+
15
+ 1. Read the authority files from Inputs and identify the owner document for every fact you plan to touch.
16
+ 2. Placement: every fact has exactly one home. Keep detail in its owner document and link to it from summaries instead of copying it.
17
+ 3. Fact-check: open the code, test or configuration that proves each claim before writing it.
18
+ 4. Write current-state prose in the project's single language. Describe what exists now; do not narrate history, planned work or implementation progress.
19
+ 5. Slop audit: apply the project's checklist and remove repeated rules, reasoning traces, hand-copied directory trees, emphasis inflation and paragraph walls.
20
+ 6. Check that every relative link points to a file that exists and that headings, lists, tables and fenced code stay stable unless the change is about structure.
21
+ 7. Do not generate translations or pairing records unless project rules require them; the project documentation uses one language.
22
+ 8. Verify with the project commands below and record what you checked.
23
+
24
+ ## Inputs
25
+
26
+ - When `docs/AGENTS.md` exists, it is the documentation authority; follow its placement, writing and verification rules before this skill.
27
+ - When `docs/AGENTS.md` does not exist, read the root `AGENTS.md` and the project rules under `.agents/rules/`. Project rules always win over this skill.
28
+ - The code, tests, configuration and executed commands that can evidence each claim.
29
+ - The owner documents and the links that the change touches.
30
+ - The project documentation language. Write in that one language; create translations or pairing records only when project rules require them.
31
+
32
+ ## Evidence and fact-check
33
+
34
+ - Every command, behavior, default, path or flow claim needs evidence: a source file, a test, a configuration value or an executed command.
35
+ - Read the evidence before writing the claim. A file name alone is not proof that the described behavior exists.
36
+ - This skill does not invent components, flows, boundaries, commands or history; if the repository does not show it, do not write it.
37
+ - Unverifiable content stays as `TODO(owner): question`. Never fill a TODO from memory, another project or this skill.
38
+
39
+ ## TODO rules
40
+
41
+ - Use `TODO(owner): question` when a statement cannot be verified from code, tests, configuration or an executed command. Write the open question, not a guessed answer.
42
+ - Name the question so the owner can answer it without re-reading this skill.
43
+ - Replace the TODO with current-state prose and its evidence once the evidence exists.
44
+ - Keep each TODO marker at the start of its line so the project's documentation checks can find it.
45
+ - Do not delete a TODO just to make a check pass; answer it or leave it with the question.
46
+
47
+ ## Project commands
48
+
49
+ - Read commands from `AGENTS.md`, `docs/AGENTS.md`, or the `scripts` field in `package.json`; use the commands the project documents.
50
+ - Use the package manager the repository already uses. Do not hardcode a package manager, test runner or documentation gate.
51
+ - Run only commands that exist. When a command is missing, write `TODO(owner): question` instead of inventing one.
52
+
53
+ ## Verification
54
+
55
+ - Run the project commands discovered above, including the documentation gate or `dab detect` when the project defines them.
56
+ - Confirm that every changed claim has evidence and that remaining TODOs are owner questions rather than missing guesses.
57
+ - Confirm that links point to files that exist and that headings, lists, tables and fenced code stay structurally stable.
58
+ - Semantic correctness still needs a review by a person or a review pass; this skill cannot prove meaning.