@latysh-development/monolith 0.0.0-stage → 0.1.0-alpha.0

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 (291) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -2
  3. package/dist/brief/cli.d.ts +30 -0
  4. package/dist/brief/cli.d.ts.map +1 -0
  5. package/dist/brief/cli.js +85 -0
  6. package/dist/brief/collect.d.ts +17 -0
  7. package/dist/brief/collect.d.ts.map +1 -0
  8. package/dist/brief/collect.js +302 -0
  9. package/dist/brief/config.d.ts +40 -0
  10. package/dist/brief/config.d.ts.map +1 -0
  11. package/dist/brief/config.js +85 -0
  12. package/dist/brief/constants.d.ts +10 -0
  13. package/dist/brief/constants.d.ts.map +1 -0
  14. package/dist/brief/constants.js +9 -0
  15. package/dist/brief/docs.d.ts +53 -0
  16. package/dist/brief/docs.d.ts.map +1 -0
  17. package/dist/brief/docs.js +229 -0
  18. package/dist/brief/freshness.d.ts +104 -0
  19. package/dist/brief/freshness.d.ts.map +1 -0
  20. package/dist/brief/freshness.js +263 -0
  21. package/dist/brief/git-signals.d.ts +17 -0
  22. package/dist/brief/git-signals.d.ts.map +1 -0
  23. package/dist/brief/git-signals.js +101 -0
  24. package/dist/brief/index.d.ts +11 -0
  25. package/dist/brief/index.d.ts.map +1 -0
  26. package/dist/brief/index.js +5 -0
  27. package/dist/brief/reconcile.d.ts +75 -0
  28. package/dist/brief/reconcile.d.ts.map +1 -0
  29. package/dist/brief/reconcile.js +259 -0
  30. package/dist/brief/render.d.ts +60 -0
  31. package/dist/brief/render.d.ts.map +1 -0
  32. package/dist/brief/render.js +407 -0
  33. package/dist/brief/sanitize.d.ts +38 -0
  34. package/dist/brief/sanitize.d.ts.map +1 -0
  35. package/dist/brief/sanitize.js +48 -0
  36. package/dist/brief/selectors.d.ts +36 -0
  37. package/dist/brief/selectors.d.ts.map +1 -0
  38. package/dist/brief/selectors.js +75 -0
  39. package/dist/brief/story.d.ts +18 -0
  40. package/dist/brief/story.d.ts.map +1 -0
  41. package/dist/brief/story.js +59 -0
  42. package/dist/brief/types.d.ts +110 -0
  43. package/dist/brief/types.d.ts.map +1 -0
  44. package/dist/brief/types.js +11 -0
  45. package/dist/cli/index.d.ts +3 -0
  46. package/dist/cli/index.d.ts.map +1 -0
  47. package/dist/cli/index.js +166 -0
  48. package/dist/cli/init-args.d.ts +16 -0
  49. package/dist/cli/init-args.d.ts.map +1 -0
  50. package/dist/cli/init-args.js +24 -0
  51. package/dist/cli/ui-args.d.ts +23 -0
  52. package/dist/cli/ui-args.d.ts.map +1 -0
  53. package/dist/cli/ui-args.js +66 -0
  54. package/dist/cli/ui.d.ts +40 -0
  55. package/dist/cli/ui.d.ts.map +1 -0
  56. package/dist/cli/ui.js +180 -0
  57. package/dist/coordinatorium/checkpoint.d.ts +44 -0
  58. package/dist/coordinatorium/checkpoint.d.ts.map +1 -0
  59. package/dist/coordinatorium/checkpoint.js +124 -0
  60. package/dist/coordinatorium/cli.d.ts +39 -0
  61. package/dist/coordinatorium/cli.d.ts.map +1 -0
  62. package/dist/coordinatorium/cli.js +203 -0
  63. package/dist/coordinatorium/errors.d.ts +112 -0
  64. package/dist/coordinatorium/errors.d.ts.map +1 -0
  65. package/dist/coordinatorium/errors.js +145 -0
  66. package/dist/coordinatorium/index.d.ts +11 -0
  67. package/dist/coordinatorium/index.d.ts.map +1 -0
  68. package/dist/coordinatorium/index.js +5 -0
  69. package/dist/coordinatorium/lock.d.ts +187 -0
  70. package/dist/coordinatorium/lock.d.ts.map +1 -0
  71. package/dist/coordinatorium/lock.js +659 -0
  72. package/dist/coordinatorium/mission.d.ts +32 -0
  73. package/dist/coordinatorium/mission.d.ts.map +1 -0
  74. package/dist/coordinatorium/mission.js +87 -0
  75. package/dist/coordinatorium/state-keeper.d.ts +115 -0
  76. package/dist/coordinatorium/state-keeper.d.ts.map +1 -0
  77. package/dist/coordinatorium/state-keeper.js +396 -0
  78. package/dist/coordinatorium/types.d.ts +69 -0
  79. package/dist/coordinatorium/types.d.ts.map +1 -0
  80. package/dist/coordinatorium/types.js +27 -0
  81. package/dist/durable/assess.d.ts +105 -0
  82. package/dist/durable/assess.d.ts.map +1 -0
  83. package/dist/durable/assess.js +239 -0
  84. package/dist/durable/canonical.d.ts +25 -0
  85. package/dist/durable/canonical.d.ts.map +1 -0
  86. package/dist/durable/canonical.js +78 -0
  87. package/dist/durable/cli.d.ts +37 -0
  88. package/dist/durable/cli.d.ts.map +1 -0
  89. package/dist/durable/cli.js +141 -0
  90. package/dist/durable/errors.d.ts +188 -0
  91. package/dist/durable/errors.d.ts.map +1 -0
  92. package/dist/durable/errors.js +317 -0
  93. package/dist/durable/fs-store.d.ts +233 -0
  94. package/dist/durable/fs-store.d.ts.map +1 -0
  95. package/dist/durable/fs-store.js +1393 -0
  96. package/dist/durable/index.d.ts +20 -0
  97. package/dist/durable/index.d.ts.map +1 -0
  98. package/dist/durable/index.js +13 -0
  99. package/dist/durable/log.d.ts +33 -0
  100. package/dist/durable/log.d.ts.map +1 -0
  101. package/dist/durable/log.js +157 -0
  102. package/dist/durable/memory-store.d.ts +51 -0
  103. package/dist/durable/memory-store.d.ts.map +1 -0
  104. package/dist/durable/memory-store.js +302 -0
  105. package/dist/durable/projection.d.ts +35 -0
  106. package/dist/durable/projection.d.ts.map +1 -0
  107. package/dist/durable/projection.js +328 -0
  108. package/dist/durable/prune-check.d.ts +17 -0
  109. package/dist/durable/prune-check.d.ts.map +1 -0
  110. package/dist/durable/prune-check.js +45 -0
  111. package/dist/durable/register.d.ts +100 -0
  112. package/dist/durable/register.d.ts.map +1 -0
  113. package/dist/durable/register.js +532 -0
  114. package/dist/durable/retention.d.ts +49 -0
  115. package/dist/durable/retention.d.ts.map +1 -0
  116. package/dist/durable/retention.js +59 -0
  117. package/dist/durable/runtime.d.ts +497 -0
  118. package/dist/durable/runtime.d.ts.map +1 -0
  119. package/dist/durable/runtime.js +1271 -0
  120. package/dist/durable/seams.d.ts +40 -0
  121. package/dist/durable/seams.d.ts.map +1 -0
  122. package/dist/durable/seams.js +21 -0
  123. package/dist/durable/testing.d.ts +11 -0
  124. package/dist/durable/testing.d.ts.map +1 -0
  125. package/dist/durable/testing.js +25 -0
  126. package/dist/durable/types.d.ts +442 -0
  127. package/dist/durable/types.d.ts.map +1 -0
  128. package/dist/durable/types.js +75 -0
  129. package/dist/graph/builder.d.ts +11 -0
  130. package/dist/graph/builder.d.ts.map +1 -0
  131. package/dist/graph/builder.js +153 -0
  132. package/dist/graph/identity.d.ts +37 -0
  133. package/dist/graph/identity.d.ts.map +1 -0
  134. package/dist/graph/identity.js +46 -0
  135. package/dist/graph/index.d.ts +7 -0
  136. package/dist/graph/index.d.ts.map +1 -0
  137. package/dist/graph/index.js +3 -0
  138. package/dist/graph/resolver.d.ts +41 -0
  139. package/dist/graph/resolver.d.ts.map +1 -0
  140. package/dist/graph/resolver.js +36 -0
  141. package/dist/graph/types.d.ts +42 -0
  142. package/dist/graph/types.d.ts.map +1 -0
  143. package/dist/graph/types.js +1 -0
  144. package/dist/http/index.d.ts +5 -0
  145. package/dist/http/index.d.ts.map +1 -0
  146. package/dist/http/index.js +2 -0
  147. package/dist/http/server.d.ts +76 -0
  148. package/dist/http/server.d.ts.map +1 -0
  149. package/dist/http/server.js +195 -0
  150. package/dist/http/ui-assets.d.ts +22 -0
  151. package/dist/http/ui-assets.d.ts.map +1 -0
  152. package/dist/http/ui-assets.js +100 -0
  153. package/dist/index.d.ts +31 -0
  154. package/dist/index.d.ts.map +1 -0
  155. package/dist/index.js +26 -0
  156. package/dist/init/index.d.ts +12 -0
  157. package/dist/init/index.d.ts.map +1 -0
  158. package/dist/init/index.js +90 -0
  159. package/dist/init/prompts.d.ts +3 -0
  160. package/dist/init/prompts.d.ts.map +1 -0
  161. package/dist/init/prompts.js +47 -0
  162. package/dist/init/scaffold.d.ts +25 -0
  163. package/dist/init/scaffold.d.ts.map +1 -0
  164. package/dist/init/scaffold.js +204 -0
  165. package/dist/init/types.d.ts +14 -0
  166. package/dist/init/types.d.ts.map +1 -0
  167. package/dist/init/types.js +1 -0
  168. package/dist/readmodel/dashboard.d.ts +40 -0
  169. package/dist/readmodel/dashboard.d.ts.map +1 -0
  170. package/dist/readmodel/dashboard.js +236 -0
  171. package/dist/readmodel/index.d.ts +3 -0
  172. package/dist/readmodel/index.d.ts.map +1 -0
  173. package/dist/readmodel/index.js +1 -0
  174. package/dist/readmodel/types.d.ts +104 -0
  175. package/dist/readmodel/types.d.ts.map +1 -0
  176. package/dist/readmodel/types.js +15 -0
  177. package/dist/root/index.d.ts +179 -0
  178. package/dist/root/index.d.ts.map +1 -0
  179. package/dist/root/index.js +418 -0
  180. package/dist/root/safe-write.d.ts +268 -0
  181. package/dist/root/safe-write.d.ts.map +1 -0
  182. package/dist/root/safe-write.js +966 -0
  183. package/dist/root/write-artifacts.d.ts +20 -0
  184. package/dist/root/write-artifacts.d.ts.map +1 -0
  185. package/dist/root/write-artifacts.js +42 -0
  186. package/dist/scriptorium/compile.d.ts +4 -0
  187. package/dist/scriptorium/compile.d.ts.map +1 -0
  188. package/dist/scriptorium/compile.js +185 -0
  189. package/dist/scriptorium/frontmatter.d.ts +13 -0
  190. package/dist/scriptorium/frontmatter.d.ts.map +1 -0
  191. package/dist/scriptorium/frontmatter.js +90 -0
  192. package/dist/scriptorium/index.d.ts +3 -0
  193. package/dist/scriptorium/index.d.ts.map +1 -0
  194. package/dist/scriptorium/index.js +1 -0
  195. package/dist/scriptorium/markdown.d.ts +31 -0
  196. package/dist/scriptorium/markdown.d.ts.map +1 -0
  197. package/dist/scriptorium/markdown.js +88 -0
  198. package/dist/scriptorium/types.d.ts +78 -0
  199. package/dist/scriptorium/types.d.ts.map +1 -0
  200. package/dist/scriptorium/types.js +1 -0
  201. package/dist/types/enforcement.d.ts +11 -0
  202. package/dist/types/enforcement.d.ts.map +1 -0
  203. package/dist/types/enforcement.js +1 -0
  204. package/dist/types/integrity.d.ts +33 -0
  205. package/dist/types/integrity.d.ts.map +1 -0
  206. package/dist/types/integrity.js +1 -0
  207. package/dist/types/project-definition.d.ts +30 -0
  208. package/dist/types/project-definition.d.ts.map +1 -0
  209. package/dist/types/project-definition.js +1 -0
  210. package/dist/ui/assets/cosmic-glass-bg-Dwx47zPu.webp +0 -0
  211. package/dist/ui/assets/index-C4NhMaq7.js +28 -0
  212. package/dist/ui/assets/index-DMZ7ZvZY.css +1 -0
  213. package/dist/ui/index.html +13 -0
  214. package/dist/validate/index.d.ts +6 -0
  215. package/dist/validate/index.d.ts.map +1 -0
  216. package/dist/validate/index.js +214 -0
  217. package/dist/version.d.ts +2 -0
  218. package/dist/version.d.ts.map +1 -0
  219. package/dist/version.js +1 -0
  220. package/package.json +67 -4
  221. package/templates/.gitkeep +0 -0
  222. package/templates/default-instance/instruction/.cursorrules +53 -0
  223. package/templates/default-instance/instruction/.windsurfrules +53 -0
  224. package/templates/default-instance/instruction/CLAUDE.md +53 -0
  225. package/templates/default-instance/monolith/context/boot/HANDOFF.md +49 -0
  226. package/templates/default-instance/monolith/context/boot/WORK_SESSION.md +30 -0
  227. package/templates/default-instance/monolith/context/execution/current-state.md +30 -0
  228. package/templates/default-instance/monolith/context/maps/dependency-map.md +38 -0
  229. package/templates/default-instance/monolith/context/maps/project-map.md +85 -0
  230. package/templates/default-instance/monolith/context/maps/roadmap-index.md +41 -0
  231. package/templates/default-instance/monolith/context/maps/routing-map.md +147 -0
  232. package/templates/default-instance/monolith/context/maps/semantic-map.md +73 -0
  233. package/templates/default-instance/monolith/context/models/model-registry.md +37 -0
  234. package/templates/default-instance/monolith/context/models/privacy-classification.md +35 -0
  235. package/templates/default-instance/monolith/context/templates/plan-template.md +56 -0
  236. package/templates/default-instance/monolith/governance/README.md +29 -0
  237. package/templates/default-instance/monolith/governance/RULE_SCHEMA.md +58 -0
  238. package/templates/default-instance/monolith/learning/INDEX.md +48 -0
  239. package/templates/default-instance/monolith/learning/injection-map.md +49 -0
  240. package/templates/default-instance/monolith/learning/taxonomy.md +30 -0
  241. package/templates/default-instance/monolith/memory/errors/README.md +26 -0
  242. package/templates/default-instance/monolith/memory/errors/SCHEMA.md +47 -0
  243. package/templates/default-instance/monolith/memory/errors/TAXONOMY.md +27 -0
  244. package/templates/default-instance/monolith/memory/long-term/architecture-principles.md +31 -0
  245. package/templates/default-instance/monolith/memory/long-term/decisions.md +36 -0
  246. package/templates/default-instance/monolith/memory/long-term/execution-history.md +20 -0
  247. package/templates/default-instance/monolith/memory/long-term/tech-debt.md +25 -0
  248. package/templates/default-instance/monolith/memory/working/active.md +41 -0
  249. package/templates/default-instance/monolith/memory/working/governance-result.md +0 -0
  250. package/templates/default-instance/monolith/memory/working/integrity-result.md +0 -0
  251. package/templates/default-instance/monolith/memory/working/story-index.md +28 -0
  252. package/templates/default-instance/monolith/protocols/boot/boot-sequence.md +59 -0
  253. package/templates/default-instance/monolith/protocols/cognition/cognitive-modes.md +90 -0
  254. package/templates/default-instance/monolith/protocols/cognition/dry-run.md +56 -0
  255. package/templates/default-instance/monolith/protocols/cognition/execution-trace-format.md +52 -0
  256. package/templates/default-instance/monolith/protocols/cognition/semantic-planning.md +51 -0
  257. package/templates/default-instance/monolith/protocols/execution/hybrid-execution.md +37 -0
  258. package/templates/default-instance/monolith/protocols/execution/local-llm-governance.md +42 -0
  259. package/templates/default-instance/monolith/protocols/governance/command-policy.md +51 -0
  260. package/templates/default-instance/monolith/protocols/governance/core-invariants.md +40 -0
  261. package/templates/default-instance/monolith/protocols/governance/memory-governance.md +54 -0
  262. package/templates/default-instance/monolith/protocols/governance/metadata-schema.md +62 -0
  263. package/templates/default-instance/monolith/protocols/governance/skills.md +53 -0
  264. package/templates/default-instance/monolith/protocols/governance/work-session.md +46 -0
  265. package/templates/default-instance/monolith/skills/INDEX.md +28 -0
  266. package/templates/default-instance/monolith/skills/current-status/SKILL.md +47 -0
  267. package/templates/default-instance/monolith/skills/finalize-story/SKILL.md +86 -0
  268. package/templates/default-instance/monolith/skills/global-status/SKILL.md +56 -0
  269. package/templates/default-instance/monolith/skills/self-improvement/SKILL.md +77 -0
  270. package/templates/default-instance/monolith/state.json +11 -0
  271. package/templates/default-instance/monolith/tests/INDEX.md +57 -0
  272. package/templates/default-instance/monolith/tests/scenarios/architecture-review.md +32 -0
  273. package/templates/default-instance/monolith/tests/scenarios/debug-failure.md +32 -0
  274. package/templates/default-instance/monolith/tests/scenarios/dry-run-activation.md +33 -0
  275. package/templates/default-instance/monolith/tests/scenarios/execution-trace-verification.md +31 -0
  276. package/templates/default-instance/monolith/tests/scenarios/finalize-story.md +35 -0
  277. package/templates/default-instance/monolith/tests/scenarios/implement-feature.md +36 -0
  278. package/templates/default-instance/monolith/tests/scenarios/local-llm-delegation.md +31 -0
  279. package/templates/default-instance/monolith/tests/scenarios/planning-request.md +32 -0
  280. package/templates/default-instance/monolith/tests/scenarios/sensitive-context-task.md +30 -0
  281. package/templates/default-instance/monolith/tests/scenarios/validator-verification.md +33 -0
  282. package/templates/default-instance/monolith/tests/validation/expected-behavior.md +70 -0
  283. package/templates/default-instance/monolith/tests/validators/INDEX.md +17 -0
  284. package/templates/default-instance/monolith/tests/validators/delegation-semantics.md +22 -0
  285. package/templates/default-instance/monolith/tests/validators/mode-consistency.md +25 -0
  286. package/templates/default-instance/monolith/tests/validators/privacy-routing.md +23 -0
  287. package/templates/default-instance/monolith/tests/validators/protocol-references.md +27 -0
  288. package/templates/default-instance/monolith/tests/validators/routing-integrity.md +30 -0
  289. package/templates/default-instance/projectroot/AGENTS.md +107 -0
  290. package/templates/default-instance/projectroot/monolith.config.json +32 -0
  291. package/templates/default-instance/projectroot/project.definition.mjs.template +41 -0
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@latysh-development/monolith",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "MONOLITH: Cognitive Infrastructure for AI. An open-source toolkit for observable project state, structured knowledge, and explicit execution governance.",
5
+ "author": "Dmytro Latysh",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/Demion-L/the_monolith#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Demion-L/the_monolith.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/Demion-L/the_monolith/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "files": [
19
+ "dist",
20
+ "!dist/scripts",
21
+ "templates"
22
+ ],
23
+ "bin": {
24
+ "monolith": "dist/cli/index.js"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ }
31
+ },
32
+ "scripts": {
33
+ "build": "tsc -p tsconfig.json",
34
+ "typecheck": "tsc -p tsconfig.json --noEmit",
35
+ "dev": "tsc -p tsconfig.json --watch",
36
+ "test": "vitest run",
37
+ "dogfood-graph": "node dist/scripts/dogfood-graph.js",
38
+ "prepublishOnly": "npm run build",
39
+ "dev:api": "node dist/scripts/dev-api.js",
40
+ "dev:ui": "vite --config ui/vite.config.ts",
41
+ "typecheck:ui": "vue-tsc -p ui/tsconfig.json --noEmit",
42
+ "build:ui": "vite build --config ui/vite.config.ts",
43
+ "test:ui": "vitest run --config ui/vitest.config.ts"
44
+ },
45
+ "keywords": [
46
+ "monolith",
47
+ "knowledge-toolkit",
48
+ "ai-assistant",
49
+ "enforcement",
50
+ "protocol"
51
+ ],
52
+ "devDependencies": {
53
+ "@types/node": "^20.0.0",
54
+ "@vitejs/plugin-vue": "^5",
55
+ "@vue/test-utils": "^2",
56
+ "jsdom": "^25",
57
+ "typescript": "^5.6.3",
58
+ "vite": "^6",
59
+ "vitest": "^2.0.0",
60
+ "vue": "^3.5",
61
+ "vue-tsc": "^2"
62
+ },
63
+ "engines": {
64
+ "node": ">=20.0.0"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ }
69
+ }
File without changes
@@ -0,0 +1,53 @@
1
+ # {{PROJECT_NAME}} — Cursor Instructions
2
+
3
+ This repository runs MONOLITH, a portable project knowledge and governance toolkit for AI-assisted development.
4
+ Before acting on any skill-triggering request, read the corresponding skill file.
5
+
6
+ ---
7
+
8
+ ## Session Start (every session)
9
+
10
+ Before starting any task, read in order:
11
+
12
+ 1. `AGENTS.md` — project overview, architecture principles, current scope
13
+ 2. `{{MONOLITH_ROOT}}/memory/working/active.md` — what story is active (or confirm none)
14
+ 3. `{{MONOLITH_ROOT}}/context/maps/routing-map.md` — classify the task type
15
+ 4. `{{MONOLITH_ROOT}}/learning/injection-map.md` — load lesson categories relevant to the task type
16
+ 5. `{{MONOLITH_ROOT}}/protocols/cognition/cognitive-modes.md` — declare the behavioral mode for this task
17
+
18
+ Declare the cognitive mode before starting work. State it explicitly: "Mode: implementation" or "Mode: exploration". This constrains what mutations are allowed.
19
+
20
+ ---
21
+
22
+ ## Skill Activation
23
+
24
+ When the user's request matches a trigger phrase, read the skill file before taking any action.
25
+
26
+ | Trigger phrases | Skill |
27
+ |---|---|
28
+ | "finalize story", "finalize X.Y", "complete story", "mark story done" | `{{MONOLITH_ROOT}}/skills/finalize-story/SKILL.md` |
29
+ | "status", "what are we working on", "current status" | `{{MONOLITH_ROOT}}/skills/current-status/SKILL.md` |
30
+ | "global overview", "project status", "global status" | `{{MONOLITH_ROOT}}/skills/global-status/SKILL.md` |
31
+ | "analyze mistake", "learn from error", "self-improvement" | `{{MONOLITH_ROOT}}/skills/self-improvement/SKILL.md` |
32
+
33
+ Full skill index: `{{MONOLITH_ROOT}}/skills/INDEX.md`
34
+ Routing map: `{{MONOLITH_ROOT}}/context/maps/routing-map.md`
35
+
36
+ ---
37
+
38
+ ## Key Protocols
39
+
40
+ - Memory governance: `{{MONOLITH_ROOT}}/protocols/governance/memory-governance.md`
41
+ - Command policy: `{{MONOLITH_ROOT}}/protocols/governance/command-policy.md`
42
+ - Core invariants: `{{MONOLITH_ROOT}}/protocols/governance/core-invariants.md`
43
+ - Skills governance: `{{MONOLITH_ROOT}}/protocols/governance/skills.md`
44
+
45
+ ---
46
+
47
+ ## Project Structure (quick reference)
48
+
49
+ | Layer | Path | Purpose |
50
+ |---|---|---|
51
+ | Working memory | `{{MONOLITH_ROOT}}/memory/working/` | Active story, story index |
52
+ | Long-term memory | `{{MONOLITH_ROOT}}/memory/long-term/` | Decisions, execution history |
53
+ | Skills | `{{MONOLITH_ROOT}}/skills/` | Workflow procedures |
@@ -0,0 +1,53 @@
1
+ # {{PROJECT_NAME}} — Windsurf Instructions
2
+
3
+ This repository runs MONOLITH, a portable project knowledge and governance toolkit for AI-assisted development.
4
+ Before acting on any skill-triggering request, read the corresponding skill file.
5
+
6
+ ---
7
+
8
+ ## Session Start (every session)
9
+
10
+ Before starting any task, read in order:
11
+
12
+ 1. `AGENTS.md` — project overview, architecture principles, current scope
13
+ 2. `{{MONOLITH_ROOT}}/memory/working/active.md` — what story is active (or confirm none)
14
+ 3. `{{MONOLITH_ROOT}}/context/maps/routing-map.md` — classify the task type
15
+ 4. `{{MONOLITH_ROOT}}/learning/injection-map.md` — load lesson categories relevant to the task type
16
+ 5. `{{MONOLITH_ROOT}}/protocols/cognition/cognitive-modes.md` — declare the behavioral mode for this task
17
+
18
+ Declare the cognitive mode before starting work. State it explicitly: "Mode: implementation" or "Mode: exploration". This constrains what mutations are allowed.
19
+
20
+ ---
21
+
22
+ ## Skill Activation
23
+
24
+ When the user's request matches a trigger phrase, read the skill file before taking any action.
25
+
26
+ | Trigger phrases | Skill |
27
+ |---|---|
28
+ | "finalize story", "finalize X.Y", "complete story", "mark story done" | `{{MONOLITH_ROOT}}/skills/finalize-story/SKILL.md` |
29
+ | "status", "what are we working on", "current status" | `{{MONOLITH_ROOT}}/skills/current-status/SKILL.md` |
30
+ | "global overview", "project status", "global status" | `{{MONOLITH_ROOT}}/skills/global-status/SKILL.md` |
31
+ | "analyze mistake", "learn from error", "self-improvement" | `{{MONOLITH_ROOT}}/skills/self-improvement/SKILL.md` |
32
+
33
+ Full skill index: `{{MONOLITH_ROOT}}/skills/INDEX.md`
34
+ Routing map: `{{MONOLITH_ROOT}}/context/maps/routing-map.md`
35
+
36
+ ---
37
+
38
+ ## Key Protocols
39
+
40
+ - Memory governance: `{{MONOLITH_ROOT}}/protocols/governance/memory-governance.md`
41
+ - Command policy: `{{MONOLITH_ROOT}}/protocols/governance/command-policy.md`
42
+ - Core invariants: `{{MONOLITH_ROOT}}/protocols/governance/core-invariants.md`
43
+ - Skills governance: `{{MONOLITH_ROOT}}/protocols/governance/skills.md`
44
+
45
+ ---
46
+
47
+ ## Project Structure (quick reference)
48
+
49
+ | Layer | Path | Purpose |
50
+ |---|---|---|
51
+ | Working memory | `{{MONOLITH_ROOT}}/memory/working/` | Active story, story index |
52
+ | Long-term memory | `{{MONOLITH_ROOT}}/memory/long-term/` | Decisions, execution history |
53
+ | Skills | `{{MONOLITH_ROOT}}/skills/` | Workflow procedures |
@@ -0,0 +1,53 @@
1
+ # {{PROJECT_NAME}} — Claude Code Instructions
2
+
3
+ This repository runs MONOLITH, a portable project knowledge and governance toolkit for AI-assisted development.
4
+ Before acting on any skill-triggering request, read the corresponding skill file.
5
+
6
+ ---
7
+
8
+ ## Session Start (every session)
9
+
10
+ Before starting any task, read in order:
11
+
12
+ 1. `AGENTS.md` — project overview, architecture principles, current scope
13
+ 2. `{{MONOLITH_ROOT}}/memory/working/active.md` — what story is active (or confirm none)
14
+ 3. `{{MONOLITH_ROOT}}/context/maps/routing-map.md` — classify the task type
15
+ 4. `{{MONOLITH_ROOT}}/learning/injection-map.md` — load lesson categories relevant to the task type
16
+ 5. `{{MONOLITH_ROOT}}/protocols/cognition/cognitive-modes.md` — declare the behavioral mode for this task
17
+
18
+ **Declare the cognitive mode before starting work.** State it explicitly: "Mode: implementation" or "Mode: exploration". This constrains what mutations are allowed.
19
+
20
+ ---
21
+
22
+ ## Skill Activation
23
+
24
+ When the user's request matches a trigger phrase, **read the skill file before taking any action**.
25
+
26
+ | Trigger phrases | Skill |
27
+ |---|---|
28
+ | "finalize story", "finalize X.Y", "complete story", "mark story done" | `{{MONOLITH_ROOT}}/skills/finalize-story/SKILL.md` |
29
+ | "status", "what are we working on", "current status" | `{{MONOLITH_ROOT}}/skills/current-status/SKILL.md` |
30
+ | "global overview", "project status", "global status" | `{{MONOLITH_ROOT}}/skills/global-status/SKILL.md` |
31
+ | "analyze mistake", "learn from error", "self-improvement" | `{{MONOLITH_ROOT}}/skills/self-improvement/SKILL.md` |
32
+
33
+ Full skill index: `{{MONOLITH_ROOT}}/skills/INDEX.md`
34
+ Routing map: `{{MONOLITH_ROOT}}/context/maps/routing-map.md`
35
+
36
+ ---
37
+
38
+ ## Key Protocols
39
+
40
+ - Memory governance: `{{MONOLITH_ROOT}}/protocols/governance/memory-governance.md`
41
+ - Command policy: `{{MONOLITH_ROOT}}/protocols/governance/command-policy.md`
42
+ - Core invariants: `{{MONOLITH_ROOT}}/protocols/governance/core-invariants.md`
43
+ - Skills governance: `{{MONOLITH_ROOT}}/protocols/governance/skills.md`
44
+
45
+ ---
46
+
47
+ ## Project Structure (quick reference)
48
+
49
+ | Layer | Path | Purpose |
50
+ |---|---|---|
51
+ | Working memory | `{{MONOLITH_ROOT}}/memory/working/` | Active story, story index |
52
+ | Long-term memory | `{{MONOLITH_ROOT}}/memory/long-term/` | Decisions, execution history |
53
+ | Skills | `{{MONOLITH_ROOT}}/skills/` | Workflow procedures |
@@ -0,0 +1,49 @@
1
+ ---
2
+ type: context
3
+ id: context-boot-handoff
4
+ category: boot
5
+ stability: volatile
6
+ authority: authoritative
7
+ ---
8
+
9
+ # Session Handoff
10
+
11
+ Transfer capsule for the next AI session.
12
+
13
+ Update this file at the end of each work session before closing.
14
+
15
+ ---
16
+
17
+ ## Active Story
18
+
19
+ <!-- STORY X.Y — Story Name -->
20
+
21
+ ---
22
+
23
+ ## Objective
24
+
25
+ <!-- What was being worked on? What is the goal of this story? -->
26
+
27
+ ---
28
+
29
+ ## Completed This Session
30
+
31
+ <!-- Bullet list of what was done. -->
32
+
33
+ ---
34
+
35
+ ## Constraints
36
+
37
+ <!-- Any constraints or decisions made that the next session must respect. -->
38
+
39
+ ---
40
+
41
+ ## Next Step
42
+
43
+ <!-- Exactly what to do first in the next session. Be specific. -->
44
+
45
+ ---
46
+
47
+ ## Files in Flight
48
+
49
+ <!-- Files that were being edited but may not be complete. -->
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: context
3
+ id: context-boot-work-session
4
+ category: boot
5
+ stability: volatile
6
+ ---
7
+
8
+ # Work Session
9
+
10
+ Active work session context.
11
+
12
+ Updated by the finalize-story skill at story completion.
13
+
14
+ ---
15
+
16
+ ## Story
17
+
18
+ <!-- STORY X.Y — Story Name -->
19
+
20
+ ## Phase
21
+
22
+ <!-- Phase N — Phase Name -->
23
+
24
+ ## Status
25
+
26
+ <!-- IN PROGRESS | COMPLETE -->
27
+
28
+ ## Session Log
29
+
30
+ <!-- Brief log of actions taken this session. -->
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: context
3
+ id: context-execution-current-state
4
+ category: execution
5
+ stability: volatile
6
+ ---
7
+
8
+ # Current State
9
+
10
+ Global navigation state. Legacy fallback for Full Recovery Mode.
11
+
12
+ For primary navigation use: `memory/working/active.md`
13
+
14
+ ---
15
+
16
+ ## Active Phase
17
+
18
+ <!-- Phase N — Phase Name -->
19
+
20
+ ## Active Story
21
+
22
+ <!-- STORY X.Y — Story Name -->
23
+
24
+ ## Last Update
25
+
26
+ <!-- YYYY-MM-DD -->
27
+
28
+ ## Notes
29
+
30
+ <!-- Any context needed for recovery that isn't in active.md -->
@@ -0,0 +1,38 @@
1
+ ---
2
+ type: context
3
+ id: dependency-map
4
+ topology_role: root
5
+ authority: authoritative
6
+ ---
7
+
8
+ # Dependency Map
9
+
10
+ Tracks dependencies between stories, skills, protocols, and memory.
11
+
12
+ ---
13
+
14
+ ## Story Dependencies
15
+
16
+ <!-- Added as stories are created. -->
17
+ <!-- Format: STORY X.Y depends on STORY X.Z (reason) -->
18
+
19
+ ---
20
+
21
+ ## Skill Dependencies
22
+
23
+ | Skill | Depends On |
24
+ | ---------------- | ------------------------------------------------------------ |
25
+ | finalize-story | memory-governance, integrity-verification |
26
+ | current-status | memory/working/active.md |
27
+ | global-status | docs/adr/README.md, memory/long-term/decisions.md, context/maps/roadmap-index.md |
28
+ | self-improvement | memory/errors/, learning/taxonomy.md |
29
+
30
+ ---
31
+
32
+ ## Protocol Dependencies
33
+
34
+ | Protocol | Depends On |
35
+ | ---------------------- | --------------------------------- |
36
+ | finalize-story | memory-governance |
37
+ | integrity-verification | memory-governance |
38
+ | failure-memory-logging | memory-governance, error-taxonomy |
@@ -0,0 +1,85 @@
1
+ ---
2
+ type: context
3
+ id: project-map
4
+ topology_role: root
5
+ authority: authoritative
6
+ ---
7
+
8
+ # Project Map — {{PROJECT_NAME}}
9
+
10
+ Navigation guide for the cognitive architecture of this project.
11
+
12
+ ---
13
+
14
+ ## Memory
15
+
16
+ | Location | Purpose |
17
+ | --------------------------------------------------------------- | ----------------------- |
18
+ | `{{MONOLITH_ROOT}}/memory/working/active.md` | Active phase and story |
19
+ | `{{MONOLITH_ROOT}}/memory/working/story-index.md` | Implementation history |
20
+ | `{{MONOLITH_ROOT}}/memory/long-term/decisions.md` | Non-ADR decisions (`DEC-…`) |
21
+ | `{{MONOLITH_ROOT}}/memory/long-term/architecture-principles.md` | Core principles |
22
+ | `{{MONOLITH_ROOT}}/memory/long-term/tech-debt.md` | Tech debt registry |
23
+ | `{{MONOLITH_ROOT}}/memory/long-term/execution-history.md` | Finalization log |
24
+
25
+ ---
26
+
27
+ ## Context
28
+
29
+ | Location | Purpose |
30
+ | -------------------------------------------------- | ---------------------- |
31
+ | `{{MONOLITH_ROOT}}/context/maps/routing-map.md` | Task type → activation |
32
+ | `{{MONOLITH_ROOT}}/context/maps/roadmap-index.md` | Phases and progress |
33
+ | `{{MONOLITH_ROOT}}/context/maps/semantic-map.md` | Where truth lives |
34
+ | `{{MONOLITH_ROOT}}/context/maps/dependency-map.md` | Artifact dependencies |
35
+ | `{{MONOLITH_ROOT}}/context/boot/HANDOFF.md` | Session transfer |
36
+
37
+ ---
38
+
39
+ ## Skills
40
+
41
+ | Skill | Trigger |
42
+ | ---------------------------------------------------- | ---------------- |
43
+ | `{{MONOLITH_ROOT}}/skills/finalize-story/SKILL.md` | finalize story |
44
+ | `{{MONOLITH_ROOT}}/skills/current-status/SKILL.md` | status check |
45
+ | `{{MONOLITH_ROOT}}/skills/global-status/SKILL.md` | global overview |
46
+ | `{{MONOLITH_ROOT}}/skills/self-improvement/SKILL.md` | self improvement |
47
+
48
+ ---
49
+
50
+ ## Protocols
51
+
52
+ | Protocol | Purpose |
53
+ | ------------------------------------------------------------- | --------------------- |
54
+ | `{{MONOLITH_ROOT}}/protocols/boot/boot-sequence.md` | Session startup order |
55
+ | `{{MONOLITH_ROOT}}/protocols/cognition/cognitive-modes.md` | Behavioral modes |
56
+ | `{{MONOLITH_ROOT}}/protocols/governance/memory-governance.md` | Memory rules |
57
+ | `{{MONOLITH_ROOT}}/protocols/governance/core-invariants.md` | Always-on rules |
58
+
59
+ ---
60
+
61
+ ## Knowledge Base
62
+
63
+ | Location | Purpose |
64
+ | ------------------------------------- | ---------------------------------------------------- |
65
+ | `MANIFESTO.md` | Engineering foundation — why this project exists |
66
+ | `docs/README.md` | Knowledge base navigation index |
67
+ | `docs/DOCUMENTATION_PRINCIPLES.md` | Documentation rules and layer hierarchy |
68
+ | `docs/adr/` | Architecture Decision Records |
69
+ | `docs/adr/README.md` | The only ADR index (created with the first ADR) |
70
+ | `docs/architecture/` | Current system description |
71
+
72
+ Add `docs/research/` and `docs/vision/` layers if this project's own
73
+ knowledge base needs them — they are not provisioned by default.
74
+
75
+ ---
76
+
77
+ ## Project Structure
78
+
79
+ <!-- Describe your project's source code structure here. -->
80
+ <!-- Example: -->
81
+ <!-- | Directory | Purpose | -->
82
+ <!-- |-----------|---------| -->
83
+ <!-- | `src/` | Application source code | -->
84
+ <!-- | `packages/` | Shared packages | -->
85
+ <!-- | `apps/` | Application entry points | -->
@@ -0,0 +1,41 @@
1
+ ---
2
+ type: context
3
+ id: roadmap-index
4
+ topology_role: root
5
+ authority: authoritative
6
+ ---
7
+
8
+ # Roadmap Index — {{PROJECT_NAME}}
9
+
10
+ Navigable index of project phases and their status.
11
+
12
+ ---
13
+
14
+ ## Phases
15
+
16
+ <!-- Add phases below. Status: PLANNED | IN PROGRESS | COMPLETE -->
17
+
18
+ ### Phase 1 — (Add phase name)
19
+
20
+ **Status:** PLANNED
21
+
22
+ Stories:
23
+
24
+ - STORY 1.1 — (Add story name)
25
+
26
+ ---
27
+
28
+ ## Current Focus
29
+
30
+ <!-- Keep this in sync with memory/working/active.md -->
31
+
32
+ Active Phase: —
33
+ Active Story: —
34
+
35
+ ---
36
+
37
+ ## Completion Summary
38
+
39
+ | Phase | Stories | Status |
40
+ | ----- | ------- | ------ |
41
+ | — | — | — |
@@ -0,0 +1,147 @@
1
+ ---
2
+ type: context
3
+ id: routing-map
4
+ topology_role: root
5
+ ---
6
+
7
+ # Routing Map
8
+
9
+ ## Purpose
10
+
11
+ Declarative activation map. Given a task type, resolves:
12
+
13
+ - which cognitive mode to apply
14
+ - which skill to activate
15
+ - which protocols to enforce
16
+ - which memory regions to load
17
+ - which learning categories to inject
18
+ - what model tier to use
19
+
20
+ ---
21
+
22
+ ## Table 1 — Task Type → Cognitive Mode
23
+
24
+ | Task Type | Cognitive Mode |
25
+ | -------------------- | -------------- |
26
+ | finalize-story | finalization |
27
+ | implementation-task | implementation |
28
+ | new-feature | implementation |
29
+ | bug-investigation | debugging |
30
+ | architecture-review | review |
31
+ | code-review | review |
32
+ | planning-request | planning |
33
+ | exploration-request | exploration |
34
+ | status-check | exploration |
35
+ | global-overview | exploration |
36
+ | learning-update | reflection |
37
+ | self-improvement | reflection |
38
+ | story-transition | finalization |
39
+ | documentation-update | implementation |
40
+
41
+ Reference: `{{MONOLITH_ROOT}}/protocols/cognition/cognitive-modes.md`
42
+
43
+ ---
44
+
45
+ ## Table 2 — Task Type → Skills
46
+
47
+ | Task Type | Primary Skill |
48
+ | -------------------- | -------------------- |
49
+ | finalize-story | finalize-story |
50
+ | status-check | current-status |
51
+ | global-overview | global-status |
52
+ | self-improvement | self-improvement |
53
+ | implementation-task | (no dedicated skill) |
54
+ | new-feature | (no dedicated skill) |
55
+ | bug-investigation | (no dedicated skill) |
56
+ | architecture-review | (no dedicated skill) |
57
+ | code-review | (no dedicated skill) |
58
+ | planning-request | (no dedicated skill) |
59
+ | exploration-request | (no dedicated skill) |
60
+ | learning-update | self-improvement |
61
+ | story-transition | finalize-story |
62
+ | documentation-update | (no dedicated skill) |
63
+
64
+ Skill files: `{{MONOLITH_ROOT}}/skills/`
65
+
66
+ ---
67
+
68
+ ## Table 3 — Task Type → Protocols
69
+
70
+ | Task Type | Protocols |
71
+ | -------------------- | --------------------------------------------------------- |
72
+ | finalize-story | finalize-story, memory-governance, integrity-verification |
73
+ | implementation-task | memory-governance, command-policy |
74
+ | new-feature | memory-governance, command-policy |
75
+ | bug-investigation | memory-governance, command-policy |
76
+ | architecture-review | memory-governance, core-invariants |
77
+ | code-review | memory-governance, command-policy |
78
+ | planning-request | memory-governance, semantic-planning |
79
+ | exploration-request | memory-governance |
80
+ | status-check | memory-governance |
81
+ | global-overview | memory-governance |
82
+ | learning-update | memory-governance, failure-memory-logging |
83
+ | self-improvement | memory-governance, failure-memory-logging |
84
+ | story-transition | memory-governance, finalize-story |
85
+ | documentation-update | memory-governance |
86
+
87
+ ---
88
+
89
+ ## Table 4 — Task Type → Memory Regions
90
+
91
+ | Task Type | Memory Regions |
92
+ | ------------------- | ---------------------------------------------------------------------- |
93
+ | finalize-story | working/active, working/story-index, long-term/execution-history |
94
+ | implementation-task | working/active, long-term/architecture-principles |
95
+ | new-feature | working/active, long-term/decisions, long-term/architecture-principles |
96
+ | bug-investigation | working/active, long-term/tech-debt |
97
+ | architecture-review | working/active, long-term/decisions, long-term/architecture-principles |
98
+ | planning-request | working/active, context/maps/roadmap-index |
99
+ | status-check | working/active, context/maps/roadmap-index |
100
+ | global-overview | working/active, long-term/decisions, context/maps/roadmap-index |
101
+ | self-improvement | learning/mistakes, memory/errors |
102
+
103
+ ---
104
+
105
+ ## Table 5 — Task Type → Learning Hooks
106
+
107
+ | Task Type | Learning Categories |
108
+ | ------------------- | ------------------------------------------- |
109
+ | finalize-story | workflow, architecture |
110
+ | implementation-task | architecture, typescript, dependencies |
111
+ | new-feature | architecture, dependencies |
112
+ | bug-investigation | architecture, nonexistent-api, context-sync |
113
+ | code-review | architecture, typescript |
114
+ | self-improvement | all categories |
115
+
116
+ ---
117
+
118
+ ## Table 6 — Task Type → Model Tier
119
+
120
+ | Task Type | Model Tier |
121
+ | -------------------- | ---------- |
122
+ | implementation-task | default |
123
+ | new-feature | default |
124
+ | architecture-review | default |
125
+ | planning-request | default |
126
+ | finalize-story | default |
127
+ | bug-investigation | default |
128
+ | code-review | default |
129
+ | exploration-request | default |
130
+ | status-check | default |
131
+ | global-overview | default |
132
+ | self-improvement | default |
133
+ | documentation-update | default |
134
+
135
+ Model registry: `{{MONOLITH_ROOT}}/context/models/model-registry.md`
136
+ Privacy rules: `{{MONOLITH_ROOT}}/context/models/privacy-classification.md`
137
+
138
+ ---
139
+
140
+ ## Table 7 — Fallback Routing Rules
141
+
142
+ | Condition | Resolution |
143
+ | ------------------------------ | --------------------------------------------- |
144
+ | Task type unclear | Use exploration mode. Ask for clarification. |
145
+ | Multiple task types applicable | Use the most restrictive cognitive mode. |
146
+ | No matching skill | Execute task inline without a skill template. |
147
+ | Sensitive data in context | Override to local model tier. |