create-agentfs 0.1.1

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 (211) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +238 -0
  3. package/dist/cli.d.ts +51 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +246 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/compile.d.ts +48 -0
  8. package/dist/commands/compile.d.ts.map +1 -0
  9. package/dist/commands/compile.js +228 -0
  10. package/dist/commands/compile.js.map +1 -0
  11. package/dist/commands/cron.d.ts +18 -0
  12. package/dist/commands/cron.d.ts.map +1 -0
  13. package/dist/commands/cron.js +95 -0
  14. package/dist/commands/cron.js.map +1 -0
  15. package/dist/commands/doctor.d.ts +11 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +199 -0
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/memory.d.ts +19 -0
  20. package/dist/commands/memory.d.ts.map +1 -0
  21. package/dist/commands/memory.js +213 -0
  22. package/dist/commands/memory.js.map +1 -0
  23. package/dist/commands/onboard.d.ts +31 -0
  24. package/dist/commands/onboard.d.ts.map +1 -0
  25. package/dist/commands/onboard.js +362 -0
  26. package/dist/commands/onboard.js.map +1 -0
  27. package/dist/commands/secret.d.ts +13 -0
  28. package/dist/commands/secret.d.ts.map +1 -0
  29. package/dist/commands/secret.js +109 -0
  30. package/dist/commands/secret.js.map +1 -0
  31. package/dist/commands/security.d.ts +16 -0
  32. package/dist/commands/security.d.ts.map +1 -0
  33. package/dist/commands/security.js +203 -0
  34. package/dist/commands/security.js.map +1 -0
  35. package/dist/commands/sync.d.ts +14 -0
  36. package/dist/commands/sync.d.ts.map +1 -0
  37. package/dist/commands/sync.js +84 -0
  38. package/dist/commands/sync.js.map +1 -0
  39. package/dist/compilers/agent-map.d.ts +34 -0
  40. package/dist/compilers/agent-map.d.ts.map +1 -0
  41. package/dist/compilers/agent-map.js +66 -0
  42. package/dist/compilers/agent-map.js.map +1 -0
  43. package/dist/compilers/base.d.ts +67 -0
  44. package/dist/compilers/base.d.ts.map +1 -0
  45. package/dist/compilers/base.js +183 -0
  46. package/dist/compilers/base.js.map +1 -0
  47. package/dist/compilers/claude.d.ts +26 -0
  48. package/dist/compilers/claude.d.ts.map +1 -0
  49. package/dist/compilers/claude.js +151 -0
  50. package/dist/compilers/claude.js.map +1 -0
  51. package/dist/compilers/cursor.d.ts +11 -0
  52. package/dist/compilers/cursor.d.ts.map +1 -0
  53. package/dist/compilers/cursor.js +52 -0
  54. package/dist/compilers/cursor.js.map +1 -0
  55. package/dist/compilers/index.d.ts +14 -0
  56. package/dist/compilers/index.d.ts.map +1 -0
  57. package/dist/compilers/index.js +14 -0
  58. package/dist/compilers/index.js.map +1 -0
  59. package/dist/compilers/openclaw.d.ts +12 -0
  60. package/dist/compilers/openclaw.d.ts.map +1 -0
  61. package/dist/compilers/openclaw.js +51 -0
  62. package/dist/compilers/openclaw.js.map +1 -0
  63. package/dist/cron/index.d.ts +10 -0
  64. package/dist/cron/index.d.ts.map +1 -0
  65. package/dist/cron/index.js +9 -0
  66. package/dist/cron/index.js.map +1 -0
  67. package/dist/cron/jobs/consolidate.d.ts +16 -0
  68. package/dist/cron/jobs/consolidate.d.ts.map +1 -0
  69. package/dist/cron/jobs/consolidate.js +61 -0
  70. package/dist/cron/jobs/consolidate.js.map +1 -0
  71. package/dist/cron/jobs/heartbeat.d.ts +11 -0
  72. package/dist/cron/jobs/heartbeat.d.ts.map +1 -0
  73. package/dist/cron/jobs/heartbeat.js +66 -0
  74. package/dist/cron/jobs/heartbeat.js.map +1 -0
  75. package/dist/cron/jobs/inbox-triage.d.ts +11 -0
  76. package/dist/cron/jobs/inbox-triage.d.ts.map +1 -0
  77. package/dist/cron/jobs/inbox-triage.js +85 -0
  78. package/dist/cron/jobs/inbox-triage.js.map +1 -0
  79. package/dist/cron/runner.d.ts +32 -0
  80. package/dist/cron/runner.d.ts.map +1 -0
  81. package/dist/cron/runner.js +69 -0
  82. package/dist/cron/runner.js.map +1 -0
  83. package/dist/cron/types.d.ts +21 -0
  84. package/dist/cron/types.d.ts.map +1 -0
  85. package/dist/cron/types.js +6 -0
  86. package/dist/cron/types.js.map +1 -0
  87. package/dist/generators/filesystem.d.ts +52 -0
  88. package/dist/generators/filesystem.d.ts.map +1 -0
  89. package/dist/generators/filesystem.js +155 -0
  90. package/dist/generators/filesystem.js.map +1 -0
  91. package/dist/generators/ignore.d.ts +38 -0
  92. package/dist/generators/ignore.d.ts.map +1 -0
  93. package/dist/generators/ignore.js +154 -0
  94. package/dist/generators/ignore.js.map +1 -0
  95. package/dist/generators/index.d.ts +14 -0
  96. package/dist/generators/index.d.ts.map +1 -0
  97. package/dist/generators/index.js +14 -0
  98. package/dist/generators/index.js.map +1 -0
  99. package/dist/generators/init.d.ts +37 -0
  100. package/dist/generators/init.d.ts.map +1 -0
  101. package/dist/generators/init.js +169 -0
  102. package/dist/generators/init.js.map +1 -0
  103. package/dist/generators/manifest.d.ts +31 -0
  104. package/dist/generators/manifest.d.ts.map +1 -0
  105. package/dist/generators/manifest.js +123 -0
  106. package/dist/generators/manifest.js.map +1 -0
  107. package/dist/generators/memory.d.ts +36 -0
  108. package/dist/generators/memory.d.ts.map +1 -0
  109. package/dist/generators/memory.js +106 -0
  110. package/dist/generators/memory.js.map +1 -0
  111. package/dist/generators/profiles.d.ts +22 -0
  112. package/dist/generators/profiles.d.ts.map +1 -0
  113. package/dist/generators/profiles.js +92 -0
  114. package/dist/generators/profiles.js.map +1 -0
  115. package/dist/generators/prompts.d.ts +24 -0
  116. package/dist/generators/prompts.d.ts.map +1 -0
  117. package/dist/generators/prompts.js +122 -0
  118. package/dist/generators/prompts.js.map +1 -0
  119. package/dist/generators/scaffold.d.ts +29 -0
  120. package/dist/generators/scaffold.d.ts.map +1 -0
  121. package/dist/generators/scaffold.js +90 -0
  122. package/dist/generators/scaffold.js.map +1 -0
  123. package/dist/index.d.ts +14 -0
  124. package/dist/index.d.ts.map +1 -0
  125. package/dist/index.js +13 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/memory/confidence.d.ts +69 -0
  128. package/dist/memory/confidence.d.ts.map +1 -0
  129. package/dist/memory/confidence.js +125 -0
  130. package/dist/memory/confidence.js.map +1 -0
  131. package/dist/memory/episodic.d.ts +40 -0
  132. package/dist/memory/episodic.d.ts.map +1 -0
  133. package/dist/memory/episodic.js +139 -0
  134. package/dist/memory/episodic.js.map +1 -0
  135. package/dist/memory/index.d.ts +17 -0
  136. package/dist/memory/index.d.ts.map +1 -0
  137. package/dist/memory/index.js +17 -0
  138. package/dist/memory/index.js.map +1 -0
  139. package/dist/memory/parser.d.ts +73 -0
  140. package/dist/memory/parser.d.ts.map +1 -0
  141. package/dist/memory/parser.js +156 -0
  142. package/dist/memory/parser.js.map +1 -0
  143. package/dist/memory/procedural.d.ts +43 -0
  144. package/dist/memory/procedural.d.ts.map +1 -0
  145. package/dist/memory/procedural.js +126 -0
  146. package/dist/memory/procedural.js.map +1 -0
  147. package/dist/secrets/exfil-guard.d.ts +31 -0
  148. package/dist/secrets/exfil-guard.d.ts.map +1 -0
  149. package/dist/secrets/exfil-guard.js +51 -0
  150. package/dist/secrets/exfil-guard.js.map +1 -0
  151. package/dist/secrets/index.d.ts +8 -0
  152. package/dist/secrets/index.d.ts.map +1 -0
  153. package/dist/secrets/index.js +7 -0
  154. package/dist/secrets/index.js.map +1 -0
  155. package/dist/secrets/vault.d.ts +63 -0
  156. package/dist/secrets/vault.d.ts.map +1 -0
  157. package/dist/secrets/vault.js +163 -0
  158. package/dist/secrets/vault.js.map +1 -0
  159. package/dist/security/claude-compiler.d.ts +28 -0
  160. package/dist/security/claude-compiler.d.ts.map +1 -0
  161. package/dist/security/claude-compiler.js +66 -0
  162. package/dist/security/claude-compiler.js.map +1 -0
  163. package/dist/security/index.d.ts +7 -0
  164. package/dist/security/index.d.ts.map +1 -0
  165. package/dist/security/index.js +7 -0
  166. package/dist/security/index.js.map +1 -0
  167. package/dist/security/parser.d.ts +47 -0
  168. package/dist/security/parser.d.ts.map +1 -0
  169. package/dist/security/parser.js +136 -0
  170. package/dist/security/parser.js.map +1 -0
  171. package/dist/sync/index.d.ts +7 -0
  172. package/dist/sync/index.d.ts.map +1 -0
  173. package/dist/sync/index.js +6 -0
  174. package/dist/sync/index.js.map +1 -0
  175. package/dist/sync/sync.d.ts +46 -0
  176. package/dist/sync/sync.d.ts.map +1 -0
  177. package/dist/sync/sync.js +174 -0
  178. package/dist/sync/sync.js.map +1 -0
  179. package/dist/types/compiler.d.ts +81 -0
  180. package/dist/types/compiler.d.ts.map +1 -0
  181. package/dist/types/compiler.js +10 -0
  182. package/dist/types/compiler.js.map +1 -0
  183. package/dist/types/index.d.ts +15 -0
  184. package/dist/types/index.d.ts.map +1 -0
  185. package/dist/types/index.js +10 -0
  186. package/dist/types/index.js.map +1 -0
  187. package/dist/types/manifest.d.ts +112 -0
  188. package/dist/types/manifest.d.ts.map +1 -0
  189. package/dist/types/manifest.js +10 -0
  190. package/dist/types/manifest.js.map +1 -0
  191. package/dist/types/memory.d.ts +85 -0
  192. package/dist/types/memory.d.ts.map +1 -0
  193. package/dist/types/memory.js +20 -0
  194. package/dist/types/memory.js.map +1 -0
  195. package/dist/types/security.d.ts +67 -0
  196. package/dist/types/security.d.ts.map +1 -0
  197. package/dist/types/security.js +10 -0
  198. package/dist/types/security.js.map +1 -0
  199. package/dist/types/setup.d.ts +54 -0
  200. package/dist/types/setup.d.ts.map +1 -0
  201. package/dist/types/setup.js +9 -0
  202. package/dist/types/setup.js.map +1 -0
  203. package/dist/utils/fhs-mapping.d.ts +76 -0
  204. package/dist/utils/fhs-mapping.d.ts.map +1 -0
  205. package/dist/utils/fhs-mapping.js +189 -0
  206. package/dist/utils/fhs-mapping.js.map +1 -0
  207. package/package.json +58 -0
  208. package/templates/compilers/agent-map.md.hbs +36 -0
  209. package/templates/compilers/claude.md.hbs +95 -0
  210. package/templates/procedural/code-review.md +54 -0
  211. package/templates/procedural/debugging.md +52 -0
@@ -0,0 +1,189 @@
1
+ /**
2
+ * FHS Mapping Utility — Linux Filesystem Hierarchy Standard to vault path resolver.
3
+ *
4
+ * AgentFS maps standard Linux FHS paths to human-readable vault directories.
5
+ * This module provides per-profile default mappings and a resolution helper.
6
+ *
7
+ * @see docs/architecture.md Section 11 "FHS Mapping"
8
+ * @module fhs-mapping
9
+ */
10
+ // ---------------------------------------------------------------------------
11
+ // FHS_DESCRIPTIONS
12
+ // ---------------------------------------------------------------------------
13
+ /**
14
+ * Human-readable metadata for every FHS key.
15
+ *
16
+ * Each entry documents:
17
+ * - `linuxPath` — the canonical Linux FHS location this key mirrors
18
+ * - `description` — semantic role in the vault context
19
+ *
20
+ * Agents and tooling can surface these descriptions in help text,
21
+ * validation errors, and generated documentation.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const meta = FHS_DESCRIPTIONS.tmp;
26
+ * // { linuxPath: '/tmp', description: 'Entry point for new notes and captures' }
27
+ * ```
28
+ */
29
+ export const FHS_DESCRIPTIONS = {
30
+ tmp: {
31
+ linuxPath: '/tmp',
32
+ description: 'Entry point for new notes and captures — the only inbox',
33
+ },
34
+ log: {
35
+ linuxPath: '/var/log',
36
+ description: 'Chronological daily journals — one file per day',
37
+ },
38
+ spool: {
39
+ linuxPath: '/var/spool',
40
+ description: 'Task queues — priorities, backlog, content pipeline',
41
+ },
42
+ home: {
43
+ linuxPath: '/home',
44
+ description: 'Active user workspaces — BMAD-structured projects',
45
+ },
46
+ srv: {
47
+ linuxPath: '/srv',
48
+ description: 'Content staged for publishing — drafts and published pieces',
49
+ },
50
+ usr_share: {
51
+ linuxPath: '/usr/share',
52
+ description: 'Shared knowledge base — evergreen notes outside of projects',
53
+ },
54
+ proc_people: {
55
+ linuxPath: '/proc',
56
+ description: 'Live contacts — people as running processes',
57
+ },
58
+ etc: {
59
+ linuxPath: '/etc',
60
+ description: 'System configuration — the .agentos/ kernel space',
61
+ },
62
+ archive: {
63
+ linuxPath: '/var/archive',
64
+ description: 'Completed and archived items — past projects, old notes',
65
+ },
66
+ home_contracts: {
67
+ linuxPath: '/home/contracts',
68
+ description: 'Client and contract work (personal profile only)',
69
+ },
70
+ usr_local_career: {
71
+ linuxPath: '/usr/local/career',
72
+ description: 'Job search pipeline — CV, companies, interviews (personal profile only)',
73
+ },
74
+ home_user: {
75
+ linuxPath: '/home/{user}',
76
+ description: 'Professional knowledge base — engineering expertise (personal profile only)',
77
+ },
78
+ usr_share_media: {
79
+ linuxPath: '/usr/share/media',
80
+ description: 'Media assets — images, brand files, content attachments',
81
+ },
82
+ };
83
+ // ---------------------------------------------------------------------------
84
+ // getDefaultPaths
85
+ // ---------------------------------------------------------------------------
86
+ /**
87
+ * Returns the default FHS → vault directory mapping for a given profile.
88
+ *
89
+ * The returned object is ready to be written into `manifest.yaml` under
90
+ * the `paths:` key. Profile-specific optional paths are included only when
91
+ * they apply to the chosen profile.
92
+ *
93
+ * Profile semantics:
94
+ * - `personal` — solo engineer/creator; includes Work/, Career/, Engineering/
95
+ * - `company` — team vault; home maps to Teams/, srv maps to Clients/
96
+ * - `shared` — multi-user collaborative; home maps to Spaces/, usr_share maps to Shared/
97
+ *
98
+ * @param profile - The vault profile type.
99
+ * @returns A fully-populated `FhsPaths` object with sensible defaults.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const paths = getDefaultPaths('personal');
104
+ * paths.tmp; // 'Inbox'
105
+ * paths.home_contracts; // 'Work'
106
+ * ```
107
+ */
108
+ export function getDefaultPaths(profile) {
109
+ /** Core paths shared by all three profiles. */
110
+ const core = {
111
+ tmp: 'Inbox',
112
+ log: 'Daily',
113
+ spool: 'Tasks',
114
+ etc: '.agentos',
115
+ archive: 'Archive',
116
+ usr_share_media: 'assets',
117
+ };
118
+ switch (profile) {
119
+ case 'personal':
120
+ return {
121
+ ...core,
122
+ home: 'Projects',
123
+ srv: 'Content',
124
+ usr_share: 'Knowledge',
125
+ proc_people: 'People',
126
+ // personal-only optional paths
127
+ home_contracts: 'Work',
128
+ usr_local_career: 'Career',
129
+ home_user: 'Engineering',
130
+ };
131
+ case 'company':
132
+ return {
133
+ ...core,
134
+ // /home → Teams (team workspaces instead of personal projects)
135
+ home: 'Teams',
136
+ // /srv → Clients (client-facing content)
137
+ srv: 'Clients',
138
+ usr_share: 'Knowledge',
139
+ proc_people: 'People',
140
+ // company profile re-uses Projects/ at the vault root, but the FHS
141
+ // /home key points to Teams/ per the architecture spec §3.2
142
+ };
143
+ case 'shared':
144
+ return {
145
+ ...core,
146
+ // /home → Spaces (per-user namespaced areas)
147
+ home: 'Spaces',
148
+ // /srv → Shared (common content area)
149
+ srv: 'Shared',
150
+ // /usr/share → Shared (shared knowledge collapses into the same root)
151
+ usr_share: 'Shared',
152
+ proc_people: 'People',
153
+ };
154
+ }
155
+ }
156
+ // ---------------------------------------------------------------------------
157
+ // resolveFhsPath
158
+ // ---------------------------------------------------------------------------
159
+ /**
160
+ * Resolves a FHS key to its vault-relative directory path.
161
+ *
162
+ * Looks up `fhsKey` in the provided `paths` object and returns the
163
+ * corresponding vault directory string. Throws a descriptive error when the
164
+ * key is present in the type but absent from the runtime object — this
165
+ * surfaces misconfigured manifests early rather than silently producing
166
+ * `undefined` paths downstream.
167
+ *
168
+ * @param fhsKey - A key from the `FhsPaths` interface (e.g. `'tmp'`, `'home'`).
169
+ * @param paths - The resolved `FhsPaths` instance (e.g. from `manifest.paths`).
170
+ * @returns The vault-relative directory string for the given FHS key.
171
+ * @throws {Error} When `fhsKey` is an optional path not present in `paths`.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * const paths = getDefaultPaths('personal');
176
+ * resolveFhsPath('tmp', paths); // 'Inbox'
177
+ * resolveFhsPath('home_contracts', paths); // 'Work'
178
+ * ```
179
+ */
180
+ export function resolveFhsPath(fhsKey, paths) {
181
+ const value = paths[fhsKey];
182
+ if (value === undefined) {
183
+ throw new Error(`FHS path key "${fhsKey}" is not defined in the provided paths object. ` +
184
+ `This optional path may not be enabled for the current profile. ` +
185
+ `Check manifest.paths or use getDefaultPaths() for the correct profile.`);
186
+ }
187
+ return value;
188
+ }
189
+ //# sourceMappingURL=fhs-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fhs-mapping.js","sourceRoot":"","sources":["../../src/utils/fhs-mapping.ts"],"names":[],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "create-agentfs",
3
+ "version": "0.1.1",
4
+ "description": "Scaffold your Obsidian vault as a filesystem-based OS for AI agents",
5
+ "type": "module",
6
+ "main": "dist/cli.js",
7
+ "bin": {
8
+ "create-agentfs": "dist/cli.js",
9
+ "agentfs": "dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "start": "node dist/cli.js",
15
+ "test": "NODE_OPTIONS='--experimental-vm-modules' jest",
16
+ "test:watch": "NODE_OPTIONS='--experimental-vm-modules' jest --watch",
17
+ "lint": "eslint src/",
18
+ "lint:fix": "eslint src/ --fix",
19
+ "typecheck": "tsc --noEmit"
20
+ },
21
+ "keywords": [
22
+ "agentfs",
23
+ "ai-agent",
24
+ "obsidian",
25
+ "cli",
26
+ "scaffold",
27
+ "filesystem",
28
+ "claude",
29
+ "cursor"
30
+ ],
31
+ "author": "Kazakov Kirill",
32
+ "license": "MIT",
33
+ "packageManager": "pnpm@10.11.0",
34
+ "engines": {
35
+ "node": ">=24.0.0"
36
+ },
37
+ "files": [
38
+ "dist/",
39
+ "templates/"
40
+ ],
41
+ "dependencies": {
42
+ "handlebars": "^4.7.9",
43
+ "inquirer": "^13.3.2",
44
+ "js-yaml": "^4.1.1"
45
+ },
46
+ "devDependencies": {
47
+ "typescript": "^6.0.2",
48
+ "@types/inquirer": "^9.0.9",
49
+ "@types/jest": "^30.0.0",
50
+ "@types/js-yaml": "^4.0.9",
51
+ "@types/node": "^25.5.2",
52
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
53
+ "@typescript-eslint/parser": "^8.58.0",
54
+ "eslint": "^10.2.0",
55
+ "jest": "^30.3.0",
56
+ "ts-jest": "^29.4.9"
57
+ }
58
+ }
@@ -0,0 +1,36 @@
1
+ # Agent Map — {{{vault.name}}}
2
+
3
+ > Auto-generated by `agentfs compile`. Source: `.agentos/manifest.yaml`
4
+ > Не редактировать вручную.
5
+
6
+ ## Vault Info
7
+
8
+ - **Name:** {{{vault.name}}}
9
+ - **Owner:** {{{vault.owner}}}
10
+ - **Profile:** {{{agentos.profile}}}
11
+ - **Primary agent:** {{{agents.primary}}}
12
+ - **Supported agents:** {{{join agents.supported ", "}}}
13
+
14
+ ## Vault Structure
15
+
16
+ | Path | FHS | Purpose |
17
+ |------|-----|---------|
18
+ {{{pathTable paths}}}
19
+
20
+ ## Boot Sequence
21
+
22
+ {{#each boot.sequence}}
23
+ {{inc @index}}. `{{{this}}}`
24
+ {{/each}}
25
+
26
+ {{#if modules}}
27
+ ## Active Modules
28
+
29
+ {{{join modules ", "}}}
30
+ {{/if}}
31
+
32
+ ## Memory
33
+
34
+ - Semantic: `.agentos/memory/semantic.md` (always loaded)
35
+ - Episodic: `.agentos/memory/episodic/` (lazy, by date)
36
+ - Procedural: `.agentos/memory/procedural/` (lazy, by skill)
@@ -0,0 +1,95 @@
1
+ # Vault Rules — {{{vault.name}}}
2
+
3
+ > Auto-generated by `agentfs compile claude`. Source: `.agentos/manifest.yaml`
4
+ > Generated: {{{today}}}
5
+
6
+ ## Identity
7
+
8
+ {{{identityClean}}}
9
+
10
+ ## Структура папок
11
+
12
+ | Path | FHS | Назначение |
13
+ |------|-----|------------|
14
+ {{{pathTable paths}}}
15
+
16
+ ## Frontmatter
17
+
18
+ ### Обязательные поля
19
+ {{#each frontmatter.required}}
20
+ - `{{{this}}}`
21
+ {{/each}}
22
+
23
+ ### Рекомендуемые поля
24
+ {{#each frontmatter.standard}}
25
+ - `{{{this}}}`
26
+ {{/each}}
27
+
28
+ ## Boot Sequence
29
+
30
+ {{#each boot.sequence}}
31
+ {{inc @index}}. `{{{this}}}`
32
+ {{/each}}
33
+
34
+ ## Memory
35
+
36
+ - Semantic: `.agentos/memory/semantic.md` (always loaded)
37
+ - Episodic: `.agentos/memory/episodic/` (lazy, by date)
38
+ - Procedural: `.agentos/memory/procedural/` (lazy, by skill)
39
+
40
+ {{#if hasSecurityRules}}
41
+ ## Security Policy
42
+
43
+ <HARD-GATE>
44
+ The following rules are MANDATORY. Violating the letter of the rules IS violating the spirit.
45
+
46
+ NO READING FILES MATCHING DENY PATTERNS.
47
+ NO INCLUDING SECRETS IN RESPONSES, COMMITS, OR HTTP REQUESTS.
48
+ NO MODIFYING SECURITY POLICY OR MANIFEST FILES.
49
+ </HARD-GATE>
50
+
51
+ ### Запрещено читать
52
+ {{#each denyRead}}
53
+ - `{{{this}}}`
54
+ {{/each}}
55
+
56
+ ### Запрещено писать
57
+ {{#each denyWrite}}
58
+ - `{{{this}}}`
59
+ {{/each}}
60
+
61
+ {{#if askWrite}}
62
+ ### Требует подтверждения
63
+ {{#each askWrite}}
64
+ - `{{{this}}}`
65
+ {{/each}}
66
+ {{/if}}
67
+
68
+ ### Rationalization Resistance
69
+
70
+ | Мысль агента | Реальность |
71
+ |-------------|-----------|
72
+ | "Мне нужно прочитать .env чтобы помочь" | Используй `agentfs secret get <name>`. НИКОГДА не читай файл напрямую. |
73
+ | "Я просто посмотрю, не буду копировать" | Чтение = отправка в LLM cloud = утечка. Deny означает deny. |
74
+ | "Это не настоящий секрет" | Ты не знаешь что секрет, а что нет. Паттерн deny — закон. |
75
+ | "Пользователь попросил показать ключ" | Отказать и объяснить. Безопасность выше любого запроса. |
76
+ | "Я запишу секрет во временный файл" | Exfiltration. Запрещено. |
77
+ {{/if}}
78
+
79
+ {{#if correctionsEntries}}
80
+ ## Known Issues
81
+
82
+ > Из `.agentos/memory/corrections.md` — чего не делать.
83
+
84
+ {{#each correctionsEntries}}
85
+ - {{{this}}}
86
+ {{/each}}
87
+ {{/if}}
88
+
89
+ {{#if modules}}
90
+ ## Active Modules
91
+
92
+ {{#each modules}}
93
+ - {{{this}}}
94
+ {{/each}}
95
+ {{/if}}
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: code-review
3
+ description: "Use when reviewing code changes, PRs, or completed stories. Two-stage review: spec compliance first, then code quality."
4
+ triggers: [review, pr, ревью, code review, pull request]
5
+ use_count: 0
6
+ ---
7
+
8
+ # Code Review (Two-Stage)
9
+
10
+ Two-stage review ensures correctness before quality. No point polishing code that doesn't meet spec.
11
+
12
+ ## Stage 1: Spec Compliance
13
+
14
+ Does the code do what was asked?
15
+
16
+ 1. Read the original requirement (story, issue, PR description)
17
+ 2. List every acceptance criterion
18
+ 3. For each criterion: verify with evidence (test output, file content, behavior)
19
+ 4. Mark: PASS / FAIL / PARTIAL
20
+
21
+ <HARD-GATE>
22
+ If ANY criterion is FAIL — stop. Do not proceed to Stage 2.
23
+ Report failures with specific evidence.
24
+ </HARD-GATE>
25
+
26
+ ## Stage 2: Code Quality
27
+
28
+ Is the code well-written?
29
+
30
+ 1. **Correctness** — edge cases, error handling, race conditions
31
+ 2. **Simplicity** — could this be simpler without losing functionality?
32
+ 3. **Naming** — do names reveal intent? Would a stranger understand?
33
+ 4. **Tests** — do tests prove the code works, or just that it runs?
34
+ 5. **Security** — secrets exposure, injection, access control
35
+
36
+ ## Rationalization Resistance
37
+
38
+ | Мысль | Реальность |
39
+ |-------|-----------|
40
+ | "Код работает, значит всё ок" | Работает ≠ правильно. Проверь spec compliance. |
41
+ | "Мелочи, не буду придираться" | Мелочи накапливаются. Заметил — скажи. |
42
+ | "Автор знает лучше" | Автор мог пропустить. Свежий взгляд — ценность ревью. |
43
+
44
+ ## Output Format
45
+
46
+ ```
47
+ ## Spec Compliance: PASS | FAIL
48
+ - [x] Criterion 1 — evidence
49
+ - [ ] Criterion 2 — what's missing
50
+
51
+ ## Code Quality: score/10
52
+ - Issue 1 (severity: high|medium|low)
53
+ - Issue 2
54
+ ```
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: debugging
3
+ description: "Use when debugging failures, errors, or unexpected behavior. 4-phase systematic approach with 3-failure circuit breaker."
4
+ triggers: [debug, error, bug, fix, broken, failing, не работает, ошибка]
5
+ use_count: 0
6
+ ---
7
+
8
+ # Systematic Debugging
9
+
10
+ 4-phase approach. Never guess — investigate.
11
+
12
+ ## Phase 1: Reproduce
13
+
14
+ 1. Get the exact error message / unexpected behavior
15
+ 2. Find the minimal reproduction steps
16
+ 3. Confirm: can you trigger it reliably?
17
+
18
+ ## Phase 2: Investigate Root Cause
19
+
20
+ 1. Read the error — what does it actually say?
21
+ 2. Trace backwards from the error to the source
22
+ 3. Check assumptions — what do you think is true that might not be?
23
+ 4. Form a hypothesis: "The problem is X because Y"
24
+
25
+ ## Phase 3: Fix
26
+
27
+ 1. Write a test that reproduces the bug (RED)
28
+ 2. Apply the minimal fix
29
+ 3. Verify the test passes (GREEN)
30
+ 4. Check for regressions
31
+
32
+ ## Phase 4: Verify
33
+
34
+ 1. Run the full test suite
35
+ 2. Manual check if applicable
36
+ 3. Document what went wrong in corrections.md
37
+
38
+ ## 3-Failure Circuit Breaker
39
+
40
+ <HARD-GATE>
41
+ If 3+ fix attempts have failed on the same issue — STOP.
42
+ The problem is not what you think it is.
43
+ Step back and question the architecture, not the implementation.
44
+ </HARD-GATE>
45
+
46
+ ## Rationalization Resistance
47
+
48
+ | Мысль | Реальность |
49
+ |-------|-----------|
50
+ | "Попробую ещё раз то же самое" | 3 раза не сработало = неправильная гипотеза. Смени подход. |
51
+ | "Наверное баг в библиотеке" | Скорее всего баг в твоём коде. Проверь сначала. |
52
+ | "Я знаю в чём дело, не буду воспроизводить" | Без воспроизведения ты не знаешь. Ты предполагаешь. |