ecoportal-api-graphql 1.3.13 → 1.3.16

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 (275) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +87 -0
  3. data/lib/ecoportal/api/common/graphql/client.rb +0 -2
  4. data/lib/ecoportal/api/common/graphql/http_client.rb +6 -0
  5. data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -17
  6. data/lib/ecoportal/api/graphql/base/file_container.rb +14 -14
  7. data/lib/ecoportal/api/graphql/base/location_classification_type.rb +15 -15
  8. data/lib/ecoportal/api/graphql/base/location_structure.rb +27 -27
  9. data/lib/ecoportal/api/graphql/base/organization.rb +15 -15
  10. data/lib/ecoportal/api/graphql/base/page/task.rb +24 -0
  11. data/lib/ecoportal/api/graphql/base/page.rb +17 -16
  12. data/lib/ecoportal/api/graphql/base/template.rb +35 -0
  13. data/lib/ecoportal/api/graphql/base.rb +37 -35
  14. data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +41 -41
  15. data/lib/ecoportal/api/graphql/compat/response.rb +35 -35
  16. data/lib/ecoportal/api/graphql/connection/action.rb +11 -11
  17. data/lib/ecoportal/api/graphql/connection/action_category.rb +11 -11
  18. data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +11 -11
  19. data/lib/ecoportal/api/graphql/connection/page.rb +11 -11
  20. data/lib/ecoportal/api/graphql/connection/person_member.rb +11 -11
  21. data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -11
  22. data/lib/ecoportal/api/graphql/connection.rb +17 -17
  23. data/lib/ecoportal/api/graphql/file_upload/client.rb +21 -10
  24. data/lib/ecoportal/api/graphql/fragment/field_configuration.rb +38 -0
  25. data/lib/ecoportal/api/graphql/fragment/force.rb +14 -10
  26. data/lib/ecoportal/api/graphql/fragment/location_node.rb +26 -26
  27. data/lib/ecoportal/api/graphql/fragment/page_task.rb +39 -0
  28. data/lib/ecoportal/api/graphql/fragment/template.rb +51 -0
  29. data/lib/ecoportal/api/graphql/fragment.rb +3 -0
  30. data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -14
  31. data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -16
  32. data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -18
  33. data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -21
  34. data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -28
  35. data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -18
  36. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -23
  37. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -20
  38. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -20
  39. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +24 -24
  40. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -20
  41. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -20
  42. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -20
  43. data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -18
  44. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -18
  45. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -18
  46. data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -251
  47. data/lib/ecoportal/api/graphql/input.rb +24 -24
  48. data/lib/ecoportal/api/graphql/logic/connection.rb +34 -34
  49. data/lib/ecoportal/api/graphql/model/page/task.rb +16 -0
  50. data/lib/ecoportal/api/graphql/model/page.rb +16 -15
  51. data/lib/ecoportal/api/graphql/model/person_member.rb +15 -15
  52. data/lib/ecoportal/api/graphql/model/template.rb +15 -0
  53. data/lib/ecoportal/api/graphql/model.rb +32 -30
  54. data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -45
  55. data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -40
  56. data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -14
  57. data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -40
  58. data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +38 -40
  59. data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +38 -40
  60. data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +38 -40
  61. data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +7 -7
  62. data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +8 -7
  63. data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +38 -40
  64. data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -40
  65. data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -40
  66. data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -40
  67. data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +34 -35
  68. data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -35
  69. data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -36
  70. data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -40
  71. data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -13
  72. data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -46
  73. data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +1 -1
  74. data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +1 -1
  75. data/lib/ecoportal/api/graphql/mutation.rb +20 -20
  76. data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -14
  77. data/lib/ecoportal/api/graphql/payload/ok_payload.rb +36 -21
  78. data/lib/ecoportal/api/graphql/payload/page/draft.rb +26 -13
  79. data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -13
  80. data/lib/ecoportal/api/graphql/payload/page/review_task_batch.rb +23 -0
  81. data/lib/ecoportal/api/graphql/payload/page.rb +20 -19
  82. data/lib/ecoportal/api/graphql/payload/preset_view.rb +15 -11
  83. data/lib/ecoportal/api/graphql/payload/register.rb +15 -11
  84. data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +1 -1
  85. data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +1 -1
  86. data/lib/ecoportal/api/graphql/payload/template/update_information.rb +1 -1
  87. data/lib/ecoportal/api/graphql/payload.rb +23 -23
  88. data/lib/ecoportal/api/graphql/query/location_structures.rb +57 -57
  89. data/lib/ecoportal/api/graphql/query/page.rb +45 -45
  90. data/lib/ecoportal/api/graphql/query/page_with_forces.rb +9 -3
  91. data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +9 -3
  92. data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -78
  93. data/lib/ecoportal/api/graphql/query.rb +27 -27
  94. data/lib/ecoportal/api/graphql.rb +9 -5
  95. data/lib/ecoportal/api/graphql_version.rb +1 -1
  96. metadata +9 -180
  97. data/.ai-assistance/bridge/CLAUDE.md +0 -338
  98. data/.ai-assistance/bridge/archive/.gitkeep +0 -0
  99. data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.inbox.md +0 -29
  100. data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.outbox.md +0 -18
  101. data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.inbox.md +0 -42
  102. data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.outbox.md +0 -115
  103. data/.ai-assistance/bridge/context/gemini-review-prompt.txt +0 -48
  104. data/.ai-assistance/bridge/context/gemini-review-response.md +0 -104
  105. data/.ai-assistance/bridge/context/project.md +0 -42
  106. data/.ai-assistance/bridge/inbox/.gitkeep +0 -0
  107. data/.ai-assistance/bridge/outbox/.gitkeep +0 -0
  108. data/.ai-assistance/bridge/outbox/request-for-standards-discovery.md +0 -48
  109. data/.ai-assistance/bridge/queue/.gitkeep +0 -1
  110. data/.ai-assistance/capabilities/CLAUDE.md +0 -27
  111. data/.ai-assistance/capabilities/assumptions-log.md +0 -80
  112. data/.ai-assistance/capabilities/code.md +0 -47
  113. data/.ai-assistance/capabilities/connectors.md +0 -37
  114. data/.ai-assistance/capabilities/cowork.md +0 -55
  115. data/.ai-assistance/code/OVERVIEW.md +0 -155
  116. data/.ai-assistance/code/data_fields.md +0 -242
  117. data/.ai-assistance/code/dependencies.md +0 -151
  118. data/.ai-assistance/code/diff_as_input.md +0 -234
  119. data/.ai-assistance/code/diff_pairing_engine.md +0 -243
  120. data/.ai-assistance/code/diff_service_deep_dive.md +0 -192
  121. data/.ai-assistance/code/ecoPortal_architecture/00_overview_and_index.md +0 -55
  122. data/.ai-assistance/code/ecoPortal_architecture/01_terminology_dictionary.md +0 -181
  123. data/.ai-assistance/code/ecoPortal_architecture/02_data_model.md +0 -192
  124. data/.ai-assistance/code/ecoPortal_architecture/03_api_layers.md +0 -147
  125. data/.ai-assistance/code/ecoPortal_architecture/04_graphql_queries_mutations.md +0 -277
  126. data/.ai-assistance/code/ecoPortal_architecture/05_page_workflows.md +0 -200
  127. data/.ai-assistance/code/ecoPortal_architecture/06_search_and_filters.md +0 -228
  128. data/.ai-assistance/code/ecoPortal_architecture/07_data_fields.md +0 -197
  129. data/.ai-assistance/code/ecoPortal_architecture/08_stages_sections.md +0 -243
  130. data/.ai-assistance/code/ecoPortal_architecture/09_people_contractors_locations.md +0 -196
  131. data/.ai-assistance/code/ecoPortal_architecture/10_forces_workflow_builder.md +0 -132
  132. data/.ai-assistance/code/ecoPortal_architecture/11_integration_gems.md +0 -187
  133. data/.ai-assistance/code/ecoPortal_architecture/12_ai_documentation_sources_gaps.md +0 -236
  134. data/.ai-assistance/code/ecoPortal_architecture/13_ai_infrastructure.md +0 -183
  135. data/.ai-assistance/code/ecoportal_schema_reference.md +0 -240
  136. data/.ai-assistance/code/filter_contract_matrix.md +0 -177
  137. data/.ai-assistance/code/graphql_domain_knowledge.md +0 -240
  138. data/.ai-assistance/code/refactoring/datafield-readwrite-shape-asymmetry.md +0 -71
  139. data/.ai-assistance/code/refactoring/opportunities.md +0 -251
  140. data/.ai-assistance/code/schema_analysis.md +0 -321
  141. data/.ai-assistance/code/search_filters.md +0 -868
  142. data/.ai-assistance/code/spec_coverage.md +0 -73
  143. data/.ai-assistance/code/template_diff_pairing_domain.md +0 -175
  144. data/.ai-assistance/code/workflow-command-guide.md +0 -466
  145. data/.ai-assistance/code/workflow-space.md +0 -353
  146. data/.ai-assistance/conventions/CLAUDE.md +0 -30
  147. data/.ai-assistance/conventions/code-working-tree-protocol.md +0 -199
  148. data/.ai-assistance/conventions/gitignore-rules.md +0 -42
  149. data/.ai-assistance/conventions/permission-guidance.md +0 -120
  150. data/.ai-assistance/integrations/README.md +0 -70
  151. data/.ai-assistance/integrations/gitkraken-mcp.md +0 -107
  152. data/.ai-assistance/integrations/gitlab-mcp.md +0 -123
  153. data/.ai-assistance/integrations/local-git.md +0 -60
  154. data/.ai-assistance/local_paths.example.md +0 -17
  155. data/.ai-assistance/projects/TODO.md +0 -118
  156. data/.ai-assistance/projects/api-v2-to-graphql-migration/DECISIONS.md +0 -168
  157. data/.ai-assistance/projects/api-v2-to-graphql-migration/INTENT.md +0 -60
  158. data/.ai-assistance/projects/api-v2-to-graphql-migration/TODO.md +0 -267
  159. data/.ai-assistance/projects/api-v2-to-graphql-migration/UPSTREAM.md +0 -53
  160. data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/csv-template-pipeline-design.md +0 -102
  161. data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/cutover-usecase-gap-audit.md +0 -139
  162. data/.ai-assistance/projects/compat-layer-audit/COMPAT_AUDIT.md +0 -244
  163. data/.ai-assistance/projects/dynamic-model-generation/INTENT.md +0 -93
  164. data/.ai-assistance/projects/eco-helpers-compat/INTENT.md +0 -244
  165. data/.ai-assistance/projects/eco-helpers-compat/MIGRATION_GUIDE.md +0 -266
  166. data/.ai-assistance/projects/eco-helpers-compat/TODO.md +0 -86
  167. data/.ai-assistance/projects/ecoportal-api-v2-doublemodel-review/INTENT.md +0 -101
  168. data/.ai-assistance/projects/graphql-agent/GAP_ANALYSIS.md +0 -177
  169. data/.ai-assistance/projects/ooze-graphql-native-migration/DECISIONS.md +0 -161
  170. data/.ai-assistance/projects/ooze-graphql-native-migration/INTENT.md +0 -125
  171. data/.ai-assistance/projects/ooze-graphql-native-migration/INVENTORY.md +0 -136
  172. data/.ai-assistance/projects/ooze-graphql-native-migration/RISKS.md +0 -126
  173. data/.ai-assistance/projects/ooze-graphql-native-migration/TODO.md +0 -261
  174. data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-06-30-cutover-workflow-deep-review.md +0 -122
  175. data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-07-01-forces-via-workflow-commands-miss-rca.md +0 -148
  176. data/.ai-assistance/projects/page-model/DECISIONS.md +0 -245
  177. data/.ai-assistance/projects/page-model/TODO.md +0 -190
  178. data/.ai-assistance/projects/qa-services-delivery/DECISIONS.md +0 -93
  179. data/.ai-assistance/projects/qa-services-delivery/INTENT.md +0 -76
  180. data/.ai-assistance/projects/qa-services-delivery/PHASE3-SCOPE.md +0 -115
  181. data/.ai-assistance/projects/qa-services-delivery/ROADMAP.md +0 -99
  182. data/.ai-assistance/projects/qa-services-delivery/TODO.md +0 -81
  183. data/.ai-assistance/projects/search-filter-builder/INTENT.md +0 -107
  184. data/.ai-assistance/projects/search-filter-builder/TODO.md +0 -131
  185. data/.ai-assistance/projects/template-automatic-build-maintenance/INTENT.md +0 -87
  186. data/.ai-assistance/projects/template-automatic-build-maintenance/TODO.md +0 -108
  187. data/.ai-assistance/projects/template-diff-deploy/INTENT.md +0 -12
  188. data/.ai-assistance/projects/template-diff-deploy/TODO.md +0 -9
  189. data/.ai-assistance/projects/template-maintenance/DESIGN.md +0 -134
  190. data/.ai-assistance/projects/template-maintenance/PHASE0-FINDINGS.md +0 -93
  191. data/.ai-assistance/projects/template-maintenance/README.md +0 -14
  192. data/.ai-assistance/projects/template-model-logic/CATEGORY_CATALOG.md +0 -236
  193. data/.ai-assistance/projects/template-model-logic/CLASSIFICATION_SPIKE.md +0 -243
  194. data/.ai-assistance/projects/template-model-logic/DESIGN_NOTE.md +0 -154
  195. data/.ai-assistance/projects/workflow-space/TODO.md +0 -213
  196. data/.ai-assistance/reinstall-claude-desktop-windows.md +0 -136
  197. data/.ai-assistance/scripts/CLAUDE.md +0 -150
  198. data/.ai-assistance/scripts/bridge-inbox-check.sh +0 -75
  199. data/.ai-assistance/scripts/bridge-init.sh +0 -86
  200. data/.ai-assistance/scripts/bridge-status.sh +0 -44
  201. data/.ai-assistance/scripts/capabilities-check.ts +0 -104
  202. data/.ai-assistance/scripts/check-outbox.sh +0 -43
  203. data/.ai-assistance/scripts/dep_graph.rb +0 -91
  204. data/.ai-assistance/scripts/lock-acquire.sh +0 -103
  205. data/.ai-assistance/scripts/lock-multi.sh +0 -124
  206. data/.ai-assistance/scripts/lock-queue.sh +0 -94
  207. data/.ai-assistance/scripts/setup-mcps.test.ts +0 -188
  208. data/.ai-assistance/scripts/setup-mcps.ts +0 -234
  209. data/.ai-assistance/scripts/task-complete.ts +0 -74
  210. data/.ai-assistance/scripts/task-create.ts +0 -75
  211. data/.ai-assistance/scripts/task-read.ts +0 -125
  212. data/.ai-assistance/scripts/token-logger.js +0 -220
  213. data/.ai-assistance/scripts/token-report.ts +0 -158
  214. data/.ai-assistance/scripts/token-session-start.js +0 -66
  215. data/.ai-assistance/skills/ai-instructions/SKILL.md +0 -48
  216. data/.ai-assistance/skills/code-specs/SKILL.md +0 -69
  217. data/.ai-assistance/skills/corporate-policies/SKILL.md +0 -201
  218. data/.ai-assistance/skills/dep-graph/SKILL.md +0 -139
  219. data/.ai-assistance/skills/ep-ai-manager/SKILL.md +0 -417
  220. data/.ai-assistance/skills/gemini-assist/SKILL.md +0 -63
  221. data/.ai-assistance/skills/gemini-assist/gemini-mcp-server.js +0 -205
  222. data/.ai-assistance/skills/gemini-assist/gemini_ask.py +0 -1
  223. data/.ai-assistance/skills/gemini-assist/gemini_ask.rb +0 -240
  224. data/.ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt +0 -25
  225. data/.ai-assistance/skills/graphql-schema-analysis/SKILL.md +0 -261
  226. data/.ai-assistance/skills/procedural-memory/SKILL.md +0 -319
  227. data/.ai-assistance/skills/project-cycle/SKILL.md +0 -177
  228. data/.ai-assistance/skills/project-self-docs/SKILL.md +0 -181
  229. data/.ai-assistance/skills/project-self-docs/scripts/self_docs_scan.py +0 -378
  230. data/.ai-assistance/skills/refactor/SKILL.md +0 -62
  231. data/.ai-assistance/skills/rubocop/SKILL.md +0 -93
  232. data/.ai-assistance/skills/ruby-scripting/SKILL.md +0 -215
  233. data/.ai-assistance/skills/spec-generation/SKILL.md +0 -72
  234. data/.ai-assistance/standards-version.json +0 -22
  235. data/.ai-assistance/token-budget.json +0 -32
  236. data/.ai-assistance/version.json +0 -39
  237. data/.claude/settings.json +0 -150
  238. data/.env.example +0 -18
  239. data/.gitattributes +0 -15
  240. data/.gitignore +0 -37
  241. data/.gitlab-ci.yml +0 -45
  242. data/.markdownlint.json +0 -4
  243. data/.rspec +0 -3
  244. data/.rubocop.yml +0 -121
  245. data/.ruby-version +0 -1
  246. data/.yardopts +0 -10
  247. data/CLAUDE.md +0 -243
  248. data/Gemfile +0 -30
  249. data/Rakefile +0 -90
  250. data/bin/console +0 -14
  251. data/bin/setup +0 -8
  252. data/bin/setup.ps1 +0 -6
  253. data/docs/self-docs/ARCHITECTURE.md +0 -88
  254. data/docs/self-docs/CHANGES.jsonl +0 -12
  255. data/docs/self-docs/COMPLIANCE.md +0 -79
  256. data/docs/self-docs/CONVENTIONS.md +0 -74
  257. data/docs/self-docs/INTEGRATIONS.md +0 -65
  258. data/docs/self-docs/OPERATIONS.md +0 -76
  259. data/docs/self-docs/OVERVIEW.md +0 -64
  260. data/docs/self-docs/STATUS.md +0 -73
  261. data/docs/self-docs/self-docs-index.json +0 -51
  262. data/docs/worklog.md +0 -977
  263. data/ecoportal-api-graphql.gemspec +0 -40
  264. data/scripts/auto-worker-scheduler.sh +0 -386
  265. data/tests/actions_get.rb +0 -7
  266. data/tests/contractor_entities_get.rb +0 -20
  267. data/tests/contractor_entity_create.rb +0 -19
  268. data/tests/contractor_entity_udpate.rb +0 -20
  269. data/tests/dump_page_model.rb +0 -74
  270. data/tests/dump_template_model.rb +0 -90
  271. data/tests/loc_structure_get.rb +0 -10
  272. data/tests/loc_structure_update.rb +0 -51
  273. data/tests/loc_structures_get.rb +0 -15
  274. data/tests/local_libs.rb +0 -20
  275. data/tests/validate_queries.rb +0 -127
@@ -1,319 +0,0 @@
1
- ---
2
- name: procedural-memory
3
- category: governance
4
- version: 0.2.0
5
- status: draft
6
- description: >
7
- Distills accumulated session signals into stored `procedural` memory entries
8
- (recurring routines: a trigger condition + the action that reliably follows) and
9
- surfaces them as likely next steps. Invoke on a periodic distill pass or when a
10
- developer asks what patterns you have noticed in how they work.
11
- triggers:
12
- - what patterns have you noticed
13
- - distill my routines
14
- - procedural memory
15
- - how do I work
16
- - learn my routines
17
- - weekly distill
18
- - modus operandi
19
- applicable_to:
20
- - any
21
- ---
22
-
23
- # procedural-memory
24
-
25
- ## Purpose
26
-
27
- Turn the substrate of accumulated session history into stored **`procedural`** memory --
28
- recurring routines, each expressed as a **trigger condition** and the **inferred action**
29
- that reliably follows it -- and surface those routines (plus a short "likely next steps"
30
- list) so the next session starts proactively shaped instead of from scratch.
31
-
32
- This skill operationalizes the **Distill** stage of the Observe -> Distill -> Act loop, plus
33
- the human-facing part of the **Act** stage (surfacing). It implements
34
- `standards/workflows/procedural-memory.md`. Observation (the `Stop`/`SessionEnd` logging
35
- substrate) and autonomous execution (the auto-worker) are out of scope here -- this skill
36
- reads the Observe substrate and writes the inferred routines; it never acts on them itself.
37
-
38
- > **v0.2.0 -- draft-aligned, blockers resolved.** This skill tracks
39
- > `standards/workflows/procedural-memory.md` at v0.2.0 (`status: draft`, ready for consolidation
40
- > review). It implements the now-decided **decay/retirement lifecycle** (D1) and **Observe-stage
41
- > privacy policy** (D2). The distill cadence, the minimum-observation threshold, the promotion
42
- > rule, and the lifecycle numbers (confidence steps, retirement floor, staleness/cool-off
43
- > windows) are all **provisional** and will firm up when the standard reaches `status: reviewed`.
44
- > Treat the numbers below as conservative defaults, not settled policy.
45
-
46
- ---
47
-
48
- ## When to invoke
49
-
50
- - **On a periodic distill pass** -- e.g. weekly, or as part of an end-of-week wrap-up. This is
51
- the primary mode: a scheduled mining pass over accumulated session history.
52
- - **On demand** -- when a developer asks "what patterns have you noticed in how I work?",
53
- "distill my routines", or similar. Run the same procedure, scoped to the data available.
54
-
55
- Do not invoke this skill to *perform* a routine -- it only distils and surfaces. Acting on a
56
- surfaced routine is gated separately (see HARD CONSTRAINTS).
57
-
58
- ---
59
-
60
- ## On invocation
61
-
62
- Before any other output, do both of the following:
63
-
64
- 1. Print to the user:
65
- `[skill: procedural-memory] <one-line description of what you are about to do>`
66
- Examples:
67
- - Periodic pass: `[skill: procedural-memory] weekly distill — mining usage log for recurring routines`
68
- - On demand: `[skill: procedural-memory] reviewing session history for patterns in how you work`
69
-
70
- 2. Append a usage record to `.ai-assistance/local/kpi/usage-<YYYY-WNN>.jsonl`
71
- (ISO week format, e.g. `2026-W26`):
72
- ```json
73
- {"component": "skill/procedural-memory", "action": "invoked", "detail": "<same one-liner>", "ts": "<ISO timestamp>", "session_id": "<if known>"}
74
- ```
75
- Before writing, run the scrub/redaction pass (see Privacy below) over the record. If the file
76
- or directory does not exist, create it. If writing fails, continue silently.
77
-
78
- ### Consent check (do this first)
79
-
80
- The Observe log is **opt-in**. Before reading any `usage-*.jsonl` to mine routines, confirm the
81
- developer has enabled Observe (`procedural_memory.observe: true` in local settings, or the
82
- equivalent Observe-hook entry). If consent is not set, report that the Observe stage is not
83
- enabled, do NOT read the log, and stop. (Writing this skill's own invoked/completed usage
84
- records is the skill announcing itself and is unaffected by the Observe consent flag.)
85
-
86
- ---
87
-
88
- ## The procedure
89
-
90
- ### Step 1 -- Read the Observe substrate
91
-
92
- The Observe stage is append-only and machine-local; this skill only reads it. Read only after
93
- the consent check above has passed.
94
-
95
- - Read `.ai-assistance/local/kpi/usage-<YYYY-WNN>.jsonl` across the distill window (default: the
96
- current and previous 3 ISO weeks). These records carry only low-sensitivity signal: command/
97
- tool names (not arguments), file paths/types touched, components invoked, event types and
98
- `action` values, and coarse durations/counts -- never full arguments, file contents, or
99
- prompt/response text (see Privacy below). Parse defensively: skip malformed/corrupt JSON lines
100
- rather than failing the whole pass.
101
- - Optionally read `docs/worklog.md` for `<!-- LEARNING: ... -->` markers. These are the
102
- human-authored analogue of a `procedural` entry and may seed the distill pass
103
- (`standards/workflows/session-handoff.md`).
104
-
105
- If no usage log exists, report that the Observe substrate is not yet populated and stop --
106
- there is nothing to distil. Do not invent routines from a single session.
107
-
108
- ### Step 2 -- Mine for recurring patterns
109
-
110
- A pattern is a **trigger condition** plus the **action that reliably follows it** within the
111
- same or the next session. Look for:
112
-
113
- - An action that consistently follows a specific event (e.g. a code-spec regeneration that
114
- follows every merge to `main`).
115
- - A consistent ordering of actions (e.g. tests -> lint -> commit).
116
- - A deferral that is consistently picked up at a predictable later point.
117
-
118
- **Minimum-observation threshold.** A pattern is only written if it was **observed in >= 3
119
- distinct sessions** in the window. This default is deliberately conservative to stop a one-off
120
- coincidence becoming a stored routine; the standard leaves the exact number open, so treat
121
- this as **provisional**. Below threshold: note it as a *candidate* in the report, but do not
122
- write a memory entry.
123
-
124
- ### Step 3 -- Write each confirmed pattern as a `procedural` memory entry
125
-
126
- Write each pattern at or above threshold into the repo-scoped memory directory
127
- `~/.claude/projects/<project>/memory/` (auto memory -- repo-scoped and machine-local), as a
128
- memory entry of **type `procedural`**. The body carries **Trigger:** and **Inferred action:**
129
- lines, mirroring how `feedback` entries use **Why:** / **How to apply:**:
130
-
131
- ```markdown
132
- ## [Short routine name]
133
-
134
- **Trigger:** [the observed condition that recurs]
135
- **Inferred action:** [what the developer reliably does next]
136
- **Confidence:** 0.6
137
- **First-observed:** [YYYY-MM-DD]
138
- **Last-observed:** [YYYY-MM-DD]
139
-
140
- Observed in X of Y opportunities across N sessions (source: usage-<YYYY-WNN> ... usage-<YYYY-WNN>).
141
- ```
142
-
143
- New entries start at **Confidence: 0.6** (provisional) -- above the retirement floor, below full
144
- trust, so a freshly inferred routine starts on probation. **First-observed** and **Last-observed**
145
- are both set to the current distill-pass date on first write. These three lines are required: they
146
- drive the decay/retirement lifecycle in Step 3b.
147
-
148
- Then add the index pointer line to `~/.claude/projects/<project>/memory/MEMORY.md`, matching
149
- the existing index style:
150
-
151
- ```markdown
152
- - [Procedural: <short routine name>](<filename>.md) — <one-line trigger → action summary>
153
- ```
154
-
155
- Mark the entry clearly as `procedural` so it stays distinguishable from `user`/`project`
156
- memory (see HARD CONSTRAINTS).
157
-
158
- ### Step 3b -- Re-evaluate, decay, and retire existing routines
159
-
160
- On every distill pass, before reporting, walk each existing `procedural` entry and update its
161
- lifecycle metadata (standard D1). Honour forced markers first, then apply the arithmetic.
162
-
163
- 1. **Forced markers (one-shot, applied first).** Scan `docs/worklog.md` and the memory files for:
164
- - `<!-- RETIRE: <short routine name> -->` -- retire that routine immediately (see step 4
165
- below), regardless of confidence or recency.
166
- - `<!-- CONFIRM: <short routine name> -->` -- set its **Confidence** to `1.0` and refresh
167
- **Last-observed** to today.
168
- Record that the marker was applied so it is not re-applied on the next pass.
169
-
170
- 2. **Re-evaluate against this window.** For each routine whose **Trigger** occurred at least once
171
- in the window:
172
- - trigger fired AND inferred action followed: refresh **Last-observed** to today and
173
- **increment Confidence by +0.1**, capped at `1.0`;
174
- - trigger fired but action did NOT follow: **decrement Confidence by -0.2** (contradiction
175
- costs more than a single confirmation earns -- intentional asymmetry);
176
- - trigger did not fire at all: leave Confidence unchanged; do NOT refresh Last-observed.
177
-
178
- 3. **Retire** a routine when EITHER its **Confidence < 0.3** (floor) OR its **Last-observed** is
179
- **older than 90 days** (staleness window). All thresholds provisional.
180
-
181
- 4. **Archive on retirement -- never silent-delete.** Move the entry file to
182
- `~/.claude/projects/<project>/memory/retired/`, appending the retirement date and reason
183
- (`confidence floor` / `staleness` / `forced`). Remove its line from `MEMORY.md`. Keep a
184
- tombstone (routine name + retirement date + reason). When mining (Step 2), if a re-detected
185
- Trigger/Inferred-action pair matches a tombstone retired **within the last 30 days**
186
- (cool-off, provisional), do NOT auto-write it -- surface it as a *candidate* for the developer
187
- to re-confirm. After the cool-off it may be written fresh at the initial confidence.
188
-
189
- ### Step 4 -- Promotion (propose only)
190
-
191
- A routine observed consistently **across multiple repos** is a candidate cross-project trait
192
- for user-global memory in `~/.claude/CLAUDE.md`. **Propose it -- do not auto-promote.** Present
193
- the candidate and the evidence; the developer decides. The exact promotion threshold is an
194
- open question in the standard and is provisional here.
195
-
196
- ### Step 5 -- Act / surface
197
-
198
- Present the result to the developer:
199
-
200
- 1. The distilled routines (newly written and pre-existing) for this repo.
201
- 2. A short **"likely next steps"** list inferred from the current state and the routines.
202
- 3. For routines whose inferred action is mechanically actionable, **PROPOSE** (never auto-add)
203
- an `[auto]` tag so the auto-worker could pre-stage it -- subject to the developer confirming
204
- the tag. The `[auto]` tag is the authorization boundary; eligibility rules in
205
- `standards/tooling/auto-worker-eligibility.md` still apply, and this skill never tags
206
- anything itself.
207
-
208
- After surfacing, append a completion usage record:
209
- ```json
210
- {"component": "skill/procedural-memory", "action": "completed", "detail": "<N routines written, M candidates, K promotions proposed>", "ts": "<ISO timestamp>", "session_id": "<if known>"}
211
- ```
212
-
213
- ---
214
-
215
- ## HARD CONSTRAINTS
216
-
217
- From `standards/workflows/procedural-memory.md` -- these are not optional:
218
-
219
- - **A `procedural` entry is an inference, not an asserted fact.** It must remain visibly
220
- distinguishable from `user`/`project` memory (which record things the developer stated), so
221
- a wrong inference can be retired without eroding trust in asserted facts.
222
- - **Suggest, never act.** A distilled routine may *suggest* a next step or an `[auto]` tag, but
223
- it must not drive an autonomous action without a human-in-the-loop confirmation. Any routine
224
- that would trigger an irreversible or shared-system action is subject to
225
- `standards/workflows/hitl-gates.md` -- inference grants no authority to act.
226
- - **Observe logging is opt-in, scrubbed, and machine-local (standard D2).** The Observe hook is
227
- off by default; do not read the usage log to mine routines unless consent is set (see Consent
228
- check). Capture only the documented allow-list -- command/tool names, file paths/types, event
229
- types, durations -- and NEVER full arguments, file contents, diffs, or prompt/response text.
230
- Run the scrub/redaction pass (regex for tokens/keys, emails, obvious PII; replace with typed
231
- placeholders; drop a record that cannot be confidently scrubbed) BEFORE writing any record.
232
- Never copy the log off the machine, into a versioned file, or into a `procedural`/promoted
233
- entry -- entries store only the distilled Trigger/Inferred-action plus aggregate evidence.
234
- - **Decay and retirement are mandatory (standard D1).** Every `procedural` entry carries
235
- **Confidence**, **First-observed**, and **Last-observed**. Each pass re-evaluates them, retires
236
- entries below the floor or past the staleness window, honours `<!-- RETIRE: -->` /
237
- `<!-- CONFIRM: -->` markers, and archives (never silently deletes) retired entries with a
238
- cool-off tombstone so a retired routine does not silently reappear.
239
- - **Repo-relative paths only** in any versioned output. Use `~/.claude/...` solely as the
240
- canonical memory location, never a developer's absolute filesystem path.
241
-
242
- ### Privacy -- what the Observe log captures, redacts, and where it lives
243
-
244
- - **Captured:** command/tool names; file paths/types touched (repo-relative); event types and
245
- `action` values; coarse durations and counts; timestamps, ISO-week, session id.
246
- - **Never captured:** full command arguments; file contents or diffs; prompt/response text; the
247
- literal text of corrections/redirects (only that one occurred, and its coarse type); secrets,
248
- tokens, credentials, env values.
249
- - **Redaction:** scrub-before-write -- regex detectors for tokens/keys (high-entropy strings,
250
- `sk-`/`ghp_`/AWS-style prefixes), emails, obvious PII; matches replaced with `<REDACTED:...>`;
251
- unscrubabble records dropped.
252
- - **Storage/consent:** lives only at `.ai-assistance/local/kpi/usage-<YYYY-WNN>.jsonl`
253
- (machine-local, gitignored, never committed). Enable via `procedural_memory.observe: true` in
254
- local settings; disable by removing it; the developer may delete the log at any time.
255
-
256
- ---
257
-
258
- ## Example -- one mined pattern -> resulting `procedural` entry
259
-
260
- **Observed.** Over four ISO weeks the usage log shows that in 4 of 4 sessions ending with a
261
- merge to `main`, the same or next session regenerates code-specs and bumps the changelog
262
- before any new branch is opened. 4 sessions >= the threshold of 3, so it is written.
263
-
264
- Resulting file `~/.claude/projects/<project>/memory/procedural-merge-followup.md`:
265
-
266
- ```markdown
267
- ## Post-merge spec + changelog routine
268
-
269
- **Trigger:** a feature branch is merged to `main`.
270
- **Inferred action:** regenerate code-specs and bump the changelog before opening the next branch.
271
- **Confidence:** 0.6
272
- **First-observed:** 2026-06-28
273
- **Last-observed:** 2026-06-28
274
-
275
- Observed in 4 of 4 opportunities across 4 sessions (source: usage-2026-W22 ... usage-2026-W25).
276
- ```
277
-
278
- On a later pass, if a merge to `main` is NOT followed by the spec+changelog action, Confidence
279
- drops by 0.2; sustained contradiction (or a `<!-- RETIRE: Post-merge spec + changelog routine -->`
280
- marker, or 90 days without observation) retires it to `memory/retired/`.
281
-
282
- Index line added to `MEMORY.md`:
283
-
284
- ```markdown
285
- - [Procedural: Post-merge spec + changelog routine](procedural-merge-followup.md) — merge to main → regenerate code-specs + bump changelog
286
- ```
287
-
288
- Surfaced at the next post-merge session as a likely next step, with a *proposal* (awaiting
289
- confirmation) to tag "regenerate code-specs `[auto]`".
290
-
291
- ---
292
-
293
- ## What this skill does NOT do
294
-
295
- - Does not run the Observe stage -- it reads the usage log; it does not write session signals.
296
- - Does not execute any routine, autonomously or otherwise -- surfacing only.
297
- - Does not add an `[auto]` tag -- it proposes; the developer confirms.
298
- - Does not auto-promote a routine to `~/.claude/CLAUDE.md` -- it proposes; the developer decides.
299
- - Does not write a routine below the minimum-observation threshold.
300
- - Does not read the Observe log without consent set (Observe is opt-in, off by default).
301
- - Does not write any record to the usage log without first running the scrub/redaction pass.
302
- - Does not capture command arguments, file contents, diffs, or prompt/response text.
303
- - Does not copy machine-local log contents into any versioned or promoted file.
304
- - Does not silently delete a retired routine -- it archives to `memory/retired/` with a tombstone.
305
- - Does not re-write a routine retired within the cool-off window -- it surfaces it as a candidate.
306
- - Does not modify `user`/`project`/`feedback`/`reference` memory entries -- it only adds and
307
- maintains `procedural` entries.
308
-
309
- ---
310
-
311
- ## Version note
312
-
313
- v0.2.0 is aligned with `standards/workflows/procedural-memory.md` at v0.2.0 (`status: draft`,
314
- ready for consolidation review). It implements the now-decided decay/retirement lifecycle (D1)
315
- and Observe-stage privacy policy (D2). The distill cadence (weekly placeholder), the
316
- minimum-observation threshold (`>= 3 sessions`), the cross-repo promotion rule, and the lifecycle
317
- numbers (initial confidence 0.6, +0.1/-0.2 steps, 0.3 floor, 90-day staleness, 30-day cool-off)
318
- are all provisional. They will be revisited and firmed up when the standard reaches
319
- `status: reviewed`; this skill should be re-versioned to match.
@@ -1,177 +0,0 @@
1
- # SKILL: Project Preparation, Maintenance & Cycle
2
-
3
- **Purpose:** Capture, organise, and track a development project from intent through completion, including upstream dependency decisions and cycle-end review.
4
-
5
- ---
6
-
7
- ## When to Use
8
-
9
- - A developer describes a new piece of work.
10
- - Picking up an existing project after a gap.
11
- - A cycle of changes is complete and needs a closing review.
12
-
13
- ---
14
-
15
- ## Folder Structure
16
-
17
- ```
18
- .ai-assistance/projects/<project-slug>/
19
- INTENT.md What we're trying to achieve and why
20
- TODO.md Ordered task list, ticked off as done
21
- DECISIONS.md Key decisions made and why
22
- UPSTREAM.md Upstream dependency changes needed (if any)
23
- ```
24
-
25
- Project folders are **not git-ignored** — they should be committed so other developers can pick up context.
26
-
27
- ---
28
-
29
- ## Starting a Project
30
-
31
- 1. Ask the developer: "What are we trying to change and why?"
32
- 2. Capture the answer in `INTENT.md` (see template below).
33
- 3. Present it back: "Here's my understanding — does this capture it?" Iterate until confirmed.
34
- 4. Break the intent into an ordered TODO list in `TODO.md`.
35
- 5. If upstream deps are involved, create `UPSTREAM.md` and present options (patch, fork, new version).
36
-
37
- ### INTENT.md template
38
-
39
- ```markdown
40
- # Project: <Name>
41
-
42
- **Created:** YYYY-MM-DD
43
- **Status:** [active | paused | complete]
44
- **Branch:** feature/<slug>
45
- **Target branch:** main
46
-
47
- ## Goal
48
- One paragraph: what we want to achieve.
49
-
50
- ## Motivation
51
- Why now? What problem does this solve?
52
-
53
- ## Scope
54
- What's in scope. What's explicitly out of scope.
55
-
56
- ## Success Criteria
57
- How we'll know it's done.
58
- ```
59
-
60
- ---
61
-
62
- ## TODO.md format
63
-
64
- ```markdown
65
- # TODOs — <Project Name>
66
-
67
- - [ ] Task description <!-- add detail as needed -->
68
- - [x] Completed task
69
- ```
70
-
71
- Tick items off as they're completed. Never delete items — the history matters.
72
-
73
- ---
74
-
75
- ## DECISIONS.md format
76
-
77
- ```markdown
78
- # Decisions — <Project Name>
79
-
80
- ## [DATE] <Decision title>
81
-
82
- **Context:** What made this decision necessary.
83
- **Options considered:** Brief list.
84
- **Decision:** What was chosen.
85
- **Reason:** Why.
86
- **Consequences:** What this means going forward.
87
- ```
88
-
89
- ---
90
-
91
- ## Session Start — Git Orientation (Always Do This)
92
-
93
- Before any other work, run:
94
-
95
- ```bash
96
- # 1. Confirm current branch
97
- git branch --show-current
98
-
99
- # 2. Check how far ahead of target branch
100
- git rev-list --count main..HEAD
101
-
102
- # 3. Get a cheap summary of what's changed
103
- git diff main...HEAD --stat
104
- ```
105
-
106
- Cross-reference the diff stat against the active project's `TODO.md`:
107
- - Changed files should map to ticked TODO items.
108
- - Unticked TODOs with no corresponding changed files = work not yet started.
109
- - Changed files with no corresponding TODO = untracked work, worth noting.
110
-
111
- If **GitKraken MCP** is connected, use it instead — it returns the same information as structured data without a bash call.
112
-
113
- If the branch in `INTENT.md` doesn't match the current branch, flag it to the developer before proceeding.
114
-
115
- ---
116
-
117
- ## Cycle-End Review
118
-
119
- When all TODOs are ticked:
120
-
121
- 1. **Git summary:** Run `git diff main...HEAD --name-only` to get the exact file list.
122
- 2. **Gemini review:** Pass changed files to `gemini-assist` using the `cycle_end_review.txt` prompt:
123
- ```bash
124
- ruby .ai-assistance/skills/gemini-assist/gemini_ask.rb \
125
- --prompt-file .ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt \
126
- --output .ai-assistance/projects/<slug>/gemini_review.txt \
127
- --files $(git diff main...HEAD --name-only | tr '\n' ' ')
128
- ```
129
- 3. Review Gemini's output — verify each claim against actual code before acting.
130
- 4. Propose fixes for genuine issues — confirm with developer.
131
- 5. **If GitLab MCP is connected:** Check `get_merge_request_pipelines` to confirm CI is green.
132
- 6. Update `INTENT.md` status to `complete`.
133
- 7. Prompt: "Ready to open the MR / start the next project?"
134
-
135
- ---
136
-
137
- ## Upstream Dependency Changes
138
-
139
- If changes require modifying an upstream gem:
140
-
141
- Options (present all three to developer):
142
-
143
- 1. **Local patch** — monkey-patch from this gem. Fast, messy, temporary.
144
- 2. **Fork change** — commit to our fork (for `graphlient` or `graphql-client`). Appropriate for lasting fixes we own.
145
- 3. **New version** — for `ecoportal-api` or `ecoportal-api-v2` (team-owned), cut a new version. For external forks, optionally contribute back upstream.
146
-
147
- Document the decision in `UPSTREAM.md` and `DECISIONS.md`.
148
-
149
- ---
150
-
151
- ## Session / Collaborator Setup (First Time on a Machine)
152
-
153
- When starting a session and `.ai-assistance/local_paths.md` does not exist, run this setup flow **before** any project work:
154
-
155
- 1. Tell the developer: "I don't see a `local_paths.md` for your machine yet. This helps me cross-reference upstream and downstream gem code without fetching from remotes every time."
156
-
157
- 2. For each dependency in the table below, ask: "Do you have `<gem>` cloned locally?"
158
-
159
- | Gem | Remote |
160
- |-----|--------|
161
- | `ecoportal-api` | https://gitlab.ecoportal.co.nz/ecoportal/ecoportal-api.git |
162
- | `ecoportal-api-v2` | https://gitlab.ecoportal.co.nz/oscar/ecoportal-api-v2.git |
163
- | `graphlient` | https://github.com/rellampec/graphlient.git |
164
- | `graphql-client` | https://github.com/rellampec/graphql-client.git |
165
- | `eco-helpers` | https://gitlab.ecoportal.co.nz/oscar/script_api_helpers.git |
166
-
167
- 3. For each one they have locally:
168
- - In **Cowork**: ask them to connect the folder (via the folder picker), then record the confirmed path.
169
- - In **Claude Code**: ask them to provide the path, or run `find ~ -name "<gemspec>" -maxdepth 6 2>/dev/null` to locate it.
170
-
171
- 4. Once all available paths are collected, create `.ai-assistance/local_paths.md` from `.ai-assistance/local_paths.example.md`, filling in only the repos they confirmed.
172
-
173
- 5. Also ask: "Do you have GitKraken MCP or GitLab MCP set up?" — if not, point them to `.ai-assistance/integrations/`.
174
-
175
- 6. Confirm: "Done — I've saved your local paths. You can update `.ai-assistance/local_paths.md` any time if your setup changes."
176
-
177
- If a developer doesn't have a repo locally and the task requires reading it, offer: "I can fetch the relevant files from the remote — just note it'll be slower. Want me to proceed that way?"
@@ -1,181 +0,0 @@
1
- ---
2
- name: project-self-docs
3
- category: knowledge
4
- version: 0.2.0
5
- description: >
6
- Generate and maintain a project's own committed self-documentation set (a stable-schema
7
- OVERVIEW/ARCHITECTURE/CONVENTIONS/INTEGRATIONS/STATUS/COMPLIANCE/OPERATIONS) plus a machine-readable index and
8
- changelog, so the project can later feed a central coordination hub. A thin orchestrator:
9
- it reuses ai-discovery/code-specs/discovery-manifest findings and a deterministic scanner,
10
- and never invents a documentation format. Invoke to create, refresh, or verify self-docs.
11
- triggers:
12
- - self docs
13
- - self-documenting
14
- - project-self-docs
15
- - generate project docs
16
- - refresh self docs
17
- - self document this project
18
- - hub docs
19
- applicable_to:
20
- - any
21
- ---
22
-
23
- # project-self-docs
24
-
25
- ## Role
26
-
27
- You maintain a project's SELF-DOCUMENTATION set: a small, stable set of committed markdown docs
28
- that describe what the project is and how it is built, plus a machine-readable index and changelog
29
- that a central coordination hub can consume. You are a THIN ORCHESTRATOR -- you compose facts that
30
- `ai-discovery`, `code-specs`, and the deterministic scanner already produce; you do NOT re-analyse
31
- the codebase from scratch, and you do NOT invent a new documentation format. Everything you write
32
- is idempotent and re-runnable: running twice on an unchanged repo changes nothing.
33
-
34
- This capability is the per-project half of the synergy hub (ADR-015, Section 8; and ADR-014). It exists
35
- to detune the fleet by making reuse possible -- a project that documents itself against a shared
36
- schema is a project others can find and build on instead of duplicating.
37
-
38
- ---
39
-
40
- ## On invocation
41
-
42
- Before any other output, do both of the following:
43
-
44
- 1. Print to the user:
45
- `[skill: project-self-docs] <one-line description of what you are about to do>`
46
- For example:
47
- - `[skill: project-self-docs] scanning repo and reporting self-doc status`
48
- - `[skill: project-self-docs] refreshing STATUS.md and ARCHITECTURE.md from current state`
49
- - `[skill: project-self-docs] creating the self-doc set for the first time`
50
-
51
- 2. Append a usage record to `.ai-assistance/local/kpi/usage-<YYYY-WNN>.jsonl`
52
- (ISO week format: `YYYY-WNN`, e.g. `2026-W24`):
53
- ```json
54
- {"component": "skill/project-self-docs", "action": "invoked", "detail": "<same one-liner>", "ts": "<ISO timestamp>", "session_id": "<if known from token-budget session>"}
55
- ```
56
- Use `action` values: `invoked`, `completed`, `skipped`. If the file or directory does not
57
- exist, create it. If writing fails, continue silently.
58
-
59
- ---
60
-
61
- ## Before answering -- run the deterministic scan FIRST
62
-
63
- The deterministic scanner does the zero-LLM half. ALWAYS run it before writing any prose, so you
64
- spend interactive tokens only on the semantic gaps it cannot fill:
65
-
66
- ```bash
67
- python .ai-assistance/skills/project-self-docs/scripts/self_docs_scan.py --json
68
- ```
69
-
70
- (From ep-ai-standards itself, the script lives at
71
- `skills-library/project-self-docs/scripts/self_docs_scan.py`.)
72
-
73
- The observation tells you deterministically: repo type, real repo name (from the remote), git
74
- head/branch, top-level structure, key config + CI files, activity clusters (hot paths), which
75
- existing inputs you can REUSE (`ai-discovery` `repo-context.md`/`conventions.md`, `code-specs`
76
- under `.ai-assistance/code/`), and which self-docs already exist with their current content hash.
77
-
78
- **Reuse before you write.** If `repo-context.md`, `conventions.md`, or code-specs exist, compose
79
- the self-docs from them -- do not re-derive the same facts. If they do NOT exist, propose running
80
- `ai-discovery` (first-time) or `code-specs` (per-area) first, rather than duplicating their work
81
- here.
82
-
83
- ---
84
-
85
- ## The self-doc set (stable schema -- do not change filenames)
86
-
87
- Copy the templates from `templates/project-self-docs/` into the project's self-docs directory
88
- (default `docs/self-docs/`; configurable). The set is intentionally small and fixed:
89
-
90
- | File | Covers |
91
- |---|---|
92
- | `OVERVIEW.md` | What the project is, who it serves, current priority (one screen) |
93
- | `ARCHITECTURE.md` | Top-level structure, key components, how they fit, entry points |
94
- | `CONVENTIONS.md` | Coding style, branch naming, commit style, test conventions |
95
- | `INTEGRATIONS.md` | External services + data + permissions, upstream/downstream repos, dependencies |
96
- | `STATUS.md` | Active work, migration state, known risks, open questions |
97
- | `COMPLIANCE.md` | ISO-27001/audit, data classes + PII, third-party vendors, AI content, leak controls |
98
- | `OPERATIONS.md` | Infrastructure, public exposure + Cloudflare, DevOps audit runbook, usage KPIs/ROI |
99
-
100
- The set is the ROVO audit/compliance/discovery surface once mirrored into the EP Projects Register
101
- (`docs/strategy/self-docs-audit-schema.md`). Schema is `1.1`. Each file carries YAML frontmatter
102
- (`schema_version`, `repo`, `doc`, `last_generated`,
103
- `source_head`, `review_status`) so the hub can parse it and so a human review gate is explicit.
104
- Do NOT add, rename, or drop files without bumping the template `schema_version` and the scanner's
105
- `SELF_DOC_SET` together (they are checked as a pair).
106
-
107
- These docs are COMMITTED (not gitignored) -- they are the shareable artefact, unlike the
108
- gitignored `.ai-assistance/local/` context that `ai-discovery` writes.
109
-
110
- ---
111
-
112
- ## Workflow
113
-
114
- 1. **Scan.** Run `self_docs_scan.py --json`. Read the observation.
115
- 2. **Reuse.** Pull facts from the existing inputs it lists. Only genuinely-missing semantic content
116
- is yours to write.
117
- 3. **Fill / refresh.** For each self-doc: if missing, copy the template and fill it; if present,
118
- update only the sections whose underlying facts changed (structure, hot paths, status). Keep
119
- `review_status: draft` on anything a human has not confirmed.
120
- 4. **Batch heavy semantic work to Gemini.** For a large or unfamiliar repo, draft
121
- ARCHITECTURE/OVERVIEW via the `gemini-assist` skill (no-training tier) rather than on
122
- interactive Claude tokens -- per the token-frugality rule. Verify Gemini's output against the
123
- scanner facts before writing.
124
- 5. **Write the index + changelog (deterministic).** Run:
125
- ```bash
126
- python .ai-assistance/skills/project-self-docs/scripts/self_docs_scan.py --write
127
- ```
128
- This rewrites `docs/self-docs/self-docs-index.json` (the machine surface the hub reads) and
129
- APPENDS one line per changed doc to `docs/self-docs/CHANGES.jsonl`. A no-op re-run appends
130
- nothing -- this is what makes the capability idempotent.
131
- 6. **Human review before any egress.** Leave publishing to a human-reviewed step (see below).
132
-
133
- ---
134
-
135
- ## Publish / egress -- CONFIGURABLE, default local-only (OPEN DECISION)
136
-
137
- The Confluence publish destination is an OPEN DECISION being made separately (existing EPAI space
138
- vs a new dedicated hub space vs the private EP-AI-MGMT space). Therefore:
139
-
140
- - **Default: write to the repo/local filesystem ONLY.** This skill does not push to Confluence.
141
- - The publish target is a PARAMETER, not a hardcoded value. When the decision is made, the egress
142
- step becomes a call to the existing seed pipeline (`scripts/seed-epai-project-docs.py` pattern)
143
- pointed at the chosen space, gated by human review.
144
- - <!-- TODO(hub-target): wire egress to the chosen Confluence space once the publish-target
145
- decision lands. Until then, self-docs live in docs/self-docs/ and are consumed from git. -->
146
-
147
- Never emit `r` (a result) straight to a shared surface: a human review gate sits between the
148
- generated self-docs and any hub publish. This is a damping control -- keep it.
149
-
150
- ---
151
-
152
- ## Actuation
153
-
154
- - **Actor:** a developer (or `ai-discovery`/`project-cycle` calling this skill) IN THE REPO THAT
155
- DOCUMENTS ITSELF, never an unattended agent -- and NEVER an ep-ai-standards session reaching into
156
- another repo to generate that repo's self-docs. ep-ai-standards AUTHORS + DEPLOYS this skill and
157
- AGGREGATES/publishes results; each repo RUNS it in its own session. (Running it on ep-ai-standards
158
- ITSELF is fine -- that is why `docs/self-docs/` exists here.)
159
- - **Trigger / clock:** on demand; recommended at project cycle-end (`project-cycle`) and after a
160
- structural change. There is no autonomous fleet-wide trigger yet -- that depends on the unbuilt
161
- ADR-014 upkeep loop; note this rather than inventing an actuator.
162
- - **Coverage on neglect:** if self-docs are never refreshed, the scanner's `content_hash` +
163
- `source_head` in the index let the hub (and `project-review`) flag them as stale. The doc is
164
- never silently trusted; staleness is detectable.
165
- - **Write authority:** writes ONLY under the self-docs directory (default `docs/self-docs/`), plus
166
- the KPI usage line. It does not touch source code, `.ai-assistance/local/`, git remotes, or any
167
- network target.
168
-
169
- ---
170
-
171
- ## What you do not do
172
-
173
- - Do not invent a documentation format -- use the fixed self-doc set and templates.
174
- - Do not re-analyse the codebase from scratch -- reuse `ai-discovery`, `code-specs`, and the
175
- scanner; propose running those skills if their inputs are missing.
176
- - Do not publish to Confluence or any network target -- egress is a separate, human-gated,
177
- as-yet-undecided step.
178
- - Do not write outside `docs/self-docs/` (or the configured self-docs dir).
179
- - Do not run heavy semantic drafting on interactive Claude tokens for large repos -- batch to
180
- Gemini (no-training tier).
181
- - Do not mark a doc `review_status: reviewed` -- only a human does that.