@trespies-source/dojo-genesis-plugin 1.0.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 (209) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +204 -0
  4. package/dist/hooks/after-tool-call/handler.d.ts +4 -0
  5. package/dist/hooks/after-tool-call/handler.d.ts.map +1 -0
  6. package/dist/hooks/after-tool-call/handler.js +37 -0
  7. package/dist/hooks/after-tool-call/handler.js.map +1 -0
  8. package/dist/hooks/agent-end/handler.d.ts +4 -0
  9. package/dist/hooks/agent-end/handler.d.ts.map +1 -0
  10. package/dist/hooks/agent-end/handler.js +16 -0
  11. package/dist/hooks/agent-end/handler.js.map +1 -0
  12. package/dist/hooks/before-agent-start/handler.d.ts +4 -0
  13. package/dist/hooks/before-agent-start/handler.d.ts.map +1 -0
  14. package/dist/hooks/before-agent-start/handler.js +81 -0
  15. package/dist/hooks/before-agent-start/handler.js.map +1 -0
  16. package/dist/index.d.ts +18 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +35 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/src/commands/archive.d.ts +4 -0
  21. package/dist/src/commands/archive.d.ts.map +1 -0
  22. package/dist/src/commands/archive.js +20 -0
  23. package/dist/src/commands/archive.js.map +1 -0
  24. package/dist/src/commands/init.d.ts +4 -0
  25. package/dist/src/commands/init.d.ts.map +1 -0
  26. package/dist/src/commands/init.js +57 -0
  27. package/dist/src/commands/init.js.map +1 -0
  28. package/dist/src/commands/list.d.ts +4 -0
  29. package/dist/src/commands/list.d.ts.map +1 -0
  30. package/dist/src/commands/list.js +9 -0
  31. package/dist/src/commands/list.js.map +1 -0
  32. package/dist/src/commands/router.d.ts +3 -0
  33. package/dist/src/commands/router.d.ts.map +1 -0
  34. package/dist/src/commands/router.js +83 -0
  35. package/dist/src/commands/router.js.map +1 -0
  36. package/dist/src/commands/skill-invoke.d.ts +4 -0
  37. package/dist/src/commands/skill-invoke.d.ts.map +1 -0
  38. package/dist/src/commands/skill-invoke.js +26 -0
  39. package/dist/src/commands/skill-invoke.js.map +1 -0
  40. package/dist/src/commands/status.d.ts +4 -0
  41. package/dist/src/commands/status.d.ts.map +1 -0
  42. package/dist/src/commands/status.js +42 -0
  43. package/dist/src/commands/status.js.map +1 -0
  44. package/dist/src/commands/switch.d.ts +4 -0
  45. package/dist/src/commands/switch.d.ts.map +1 -0
  46. package/dist/src/commands/switch.js +20 -0
  47. package/dist/src/commands/switch.js.map +1 -0
  48. package/dist/src/orchestration/tool-registry.d.ts +18 -0
  49. package/dist/src/orchestration/tool-registry.d.ts.map +1 -0
  50. package/dist/src/orchestration/tool-registry.js +153 -0
  51. package/dist/src/orchestration/tool-registry.js.map +1 -0
  52. package/dist/src/skills/catalog.d.ts +9 -0
  53. package/dist/src/skills/catalog.d.ts.map +1 -0
  54. package/dist/src/skills/catalog.js +251 -0
  55. package/dist/src/skills/catalog.js.map +1 -0
  56. package/dist/src/state/manager.d.ts +19 -0
  57. package/dist/src/state/manager.d.ts.map +1 -0
  58. package/dist/src/state/manager.js +114 -0
  59. package/dist/src/state/manager.js.map +1 -0
  60. package/dist/src/state/migrations.d.ts +3 -0
  61. package/dist/src/state/migrations.d.ts.map +1 -0
  62. package/dist/src/state/migrations.js +8 -0
  63. package/dist/src/state/migrations.js.map +1 -0
  64. package/dist/src/state/types.d.ts +62 -0
  65. package/dist/src/state/types.d.ts.map +1 -0
  66. package/dist/src/state/types.js +2 -0
  67. package/dist/src/state/types.js.map +1 -0
  68. package/dist/src/ui/chat-formatter.d.ts +11 -0
  69. package/dist/src/ui/chat-formatter.d.ts.map +1 -0
  70. package/dist/src/ui/chat-formatter.js +39 -0
  71. package/dist/src/ui/chat-formatter.js.map +1 -0
  72. package/dist/src/utils/file-ops.d.ts +6 -0
  73. package/dist/src/utils/file-ops.d.ts.map +1 -0
  74. package/dist/src/utils/file-ops.js +38 -0
  75. package/dist/src/utils/file-ops.js.map +1 -0
  76. package/dist/src/utils/markdown.d.ts +2 -0
  77. package/dist/src/utils/markdown.d.ts.map +1 -0
  78. package/dist/src/utils/markdown.js +11 -0
  79. package/dist/src/utils/markdown.js.map +1 -0
  80. package/dist/src/utils/validation.d.ts +7 -0
  81. package/dist/src/utils/validation.d.ts.map +1 -0
  82. package/dist/src/utils/validation.js +29 -0
  83. package/dist/src/utils/validation.js.map +1 -0
  84. package/dist/tests/__mocks__/openclaw-types.d.ts +54 -0
  85. package/dist/tests/__mocks__/openclaw-types.d.ts.map +1 -0
  86. package/dist/tests/__mocks__/openclaw-types.js +29 -0
  87. package/dist/tests/__mocks__/openclaw-types.js.map +1 -0
  88. package/hooks/after-tool-call/HOOK.md +7 -0
  89. package/hooks/after-tool-call/handler.ts +41 -0
  90. package/hooks/agent-end/HOOK.md +7 -0
  91. package/hooks/agent-end/handler.ts +18 -0
  92. package/hooks/before-agent-start/HOOK.md +7 -0
  93. package/hooks/before-agent-start/handler.ts +133 -0
  94. package/openclaw.plugin.json +19 -0
  95. package/package.json +61 -0
  96. package/skills/agent-teaching/SKILL.md +583 -0
  97. package/skills/agent-teaching/claw.json +12 -0
  98. package/skills/compression-ritual/SKILL.md +136 -0
  99. package/skills/compression-ritual/claw.json +12 -0
  100. package/skills/context-ingestion/SKILL.md +109 -0
  101. package/skills/context-ingestion/claw.json +12 -0
  102. package/skills/decision-propagation/SKILL.md +130 -0
  103. package/skills/decision-propagation/claw.json +12 -0
  104. package/skills/documentation-audit/SKILL.md +146 -0
  105. package/skills/documentation-audit/claw.json +12 -0
  106. package/skills/era-architecture/SKILL.md +166 -0
  107. package/skills/era-architecture/claw.json +12 -0
  108. package/skills/file-management/SKILL.md +127 -0
  109. package/skills/file-management/claw.json +12 -0
  110. package/skills/frontend-from-backend/SKILL.md +127 -0
  111. package/skills/frontend-from-backend/claw.json +12 -0
  112. package/skills/handoff-protocol/SKILL.md +168 -0
  113. package/skills/handoff-protocol/claw.json +12 -0
  114. package/skills/health-audit/SKILL.md +123 -0
  115. package/skills/health-audit/claw.json +12 -0
  116. package/skills/implementation-prompt/SKILL.md +361 -0
  117. package/skills/implementation-prompt/claw.json +12 -0
  118. package/skills/iterative-scouting/SKILL.md +106 -0
  119. package/skills/iterative-scouting/claw.json +12 -0
  120. package/skills/memory-garden/SKILL.md +470 -0
  121. package/skills/memory-garden/claw.json +12 -0
  122. package/skills/multi-surface-strategy/SKILL.md +288 -0
  123. package/skills/multi-surface-strategy/claw.json +12 -0
  124. package/skills/parallel-tracks/SKILL.md +152 -0
  125. package/skills/parallel-tracks/claw.json +12 -0
  126. package/skills/patient-learning-protocol/SKILL.md +438 -0
  127. package/skills/patient-learning-protocol/claw.json +12 -0
  128. package/skills/planning-with-files/SKILL.md +139 -0
  129. package/skills/planning-with-files/claw.json +12 -0
  130. package/skills/pre-implementation-checklist/SKILL.md +156 -0
  131. package/skills/pre-implementation-checklist/claw.json +12 -0
  132. package/skills/process-extraction/SKILL.md +148 -0
  133. package/skills/process-extraction/claw.json +12 -0
  134. package/skills/process-extraction/references/process_example_template.md +40 -0
  135. package/skills/product-positioning/SKILL.md +293 -0
  136. package/skills/product-positioning/claw.json +12 -0
  137. package/skills/project-exploration/SKILL.md +168 -0
  138. package/skills/project-exploration/claw.json +12 -0
  139. package/skills/release-specification/SKILL.md +645 -0
  140. package/skills/release-specification/claw.json +12 -0
  141. package/skills/repo-context-sync/SKILL.md +362 -0
  142. package/skills/repo-context-sync/claw.json +12 -0
  143. package/skills/repo-context-sync/references/file_hierarchy_patterns.md +186 -0
  144. package/skills/repo-context-sync/references/zenflow_repo_patterns.md +328 -0
  145. package/skills/repo-context-sync/scripts/context_mapper.py +251 -0
  146. package/skills/repo-context-sync/scripts/diff_tracker.py +187 -0
  147. package/skills/repo-context-sync/scripts/smart_clone.sh +52 -0
  148. package/skills/repo-context-sync/templates/context_summary.md +58 -0
  149. package/skills/repo-status/SKILL.md +240 -0
  150. package/skills/repo-status/claw.json +12 -0
  151. package/skills/repo-status/references/semantic-clusters.md +159 -0
  152. package/skills/repo-status/references/status-template.md +214 -0
  153. package/skills/research-modes/SKILL.md +515 -0
  154. package/skills/research-modes/claw.json +12 -0
  155. package/skills/research-synthesis/SKILL.md +110 -0
  156. package/skills/research-synthesis/claw.json +12 -0
  157. package/skills/retrospective/SKILL.md +152 -0
  158. package/skills/retrospective/claw.json +12 -0
  159. package/skills/seed-extraction/SKILL.md +419 -0
  160. package/skills/seed-extraction/claw.json +12 -0
  161. package/skills/seed-library/SKILL.md +424 -0
  162. package/skills/seed-library/claw.json +12 -0
  163. package/skills/seed-library/references/seed_catalog.md +171 -0
  164. package/skills/seed-library/scripts/apply_seed.py +129 -0
  165. package/skills/seed-library/scripts/suggest_seeds.py +183 -0
  166. package/skills/seed-library/seeds/01_three_tiered_governance.md +90 -0
  167. package/skills/seed-library/seeds/02_harness_trace.md +135 -0
  168. package/skills/seed-library/seeds/03_context_iceberg.md +120 -0
  169. package/skills/seed-library/seeds/04_agent_connect.md +106 -0
  170. package/skills/seed-library/seeds/05_go_live_bundles.md +40 -0
  171. package/skills/seed-library/seeds/06_cost_guard.md +40 -0
  172. package/skills/seed-library/seeds/07_safety_switch.md +41 -0
  173. package/skills/seed-library/seeds/08_implicit_perspective_extraction.md +41 -0
  174. package/skills/seed-library/seeds/09_mode_based_complexity_gating.md +46 -0
  175. package/skills/seed-library/seeds/10_shared_infrastructure.md +75 -0
  176. package/skills/seed-library/seeds/11_voice_before_structure.md +74 -0
  177. package/skills/seed-library/seeds/12_pointer_directories.md +81 -0
  178. package/skills/seed-library/seeds/13_granular_visibility.md +82 -0
  179. package/skills/seed-library/seeds/meta_governance_multiplies_velocity.md +43 -0
  180. package/skills/seed-to-skill-converter/SKILL.md +113 -0
  181. package/skills/seed-to-skill-converter/claw.json +12 -0
  182. package/skills/semantic-clusters/SKILL.md +246 -0
  183. package/skills/semantic-clusters/claw.json +12 -0
  184. package/skills/semantic-clusters/references/verb-catalog.md +267 -0
  185. package/skills/skill-audit-upgrade/SKILL.md +427 -0
  186. package/skills/skill-audit-upgrade/claw.json +12 -0
  187. package/skills/skill-creation/LICENSE.txt +202 -0
  188. package/skills/skill-creation/SKILL.md +252 -0
  189. package/skills/skill-creation/claw.json +12 -0
  190. package/skills/skill-creation/references/output-patterns.md +82 -0
  191. package/skills/skill-creation/references/progressive-disclosure-patterns.md +79 -0
  192. package/skills/skill-creation/references/workflows.md +28 -0
  193. package/skills/skill-creation/scripts/init_skill.py +305 -0
  194. package/skills/skill-creation/scripts/quick_validate.py +134 -0
  195. package/skills/skill-maintenance/SKILL.md +413 -0
  196. package/skills/skill-maintenance/claw.json +12 -0
  197. package/skills/spec-constellation-to-prompt-suite/SKILL.md +174 -0
  198. package/skills/spec-constellation-to-prompt-suite/claw.json +12 -0
  199. package/skills/status-template/SKILL.md +211 -0
  200. package/skills/status-template/claw.json +12 -0
  201. package/skills/status-template/references/complete-template.md +191 -0
  202. package/skills/status-writing/SKILL.md +161 -0
  203. package/skills/status-writing/claw.json +12 -0
  204. package/skills/strategic-scout/SKILL.md +163 -0
  205. package/skills/strategic-scout/claw.json +12 -0
  206. package/skills/strategic-to-tactical-workflow/SKILL.md +391 -0
  207. package/skills/strategic-to-tactical-workflow/claw.json +12 -0
  208. package/skills/workspace-navigation/SKILL.md +622 -0
  209. package/skills/workspace-navigation/claw.json +12 -0
@@ -0,0 +1,362 @@
1
+ ---
2
+ name: repo-context-sync
3
+ description: Efficiently sync and extract context from GitHub repositories for grounding architectural, design, and orchestration work. Use when exploring codebases, starting refactoring or architecture conversations, tracking changes between sessions, or before writing implementation prompts. Trigger phrases: 'sync the repo', 'what changed in the codebase', 'clone this repository', 'extract context from', 'understand the repo structure'.
4
+ ---
5
+
6
+ > **OpenClaw Integration:** This skill is invoked by the Dojo Genesis plugin via `/dojo run repo-context-sync`.
7
+ > The agent receives project context automatically via the `before_agent_start` hook.
8
+ > Use `dojo_get_context` for full state, `dojo_save_artifact` to persist outputs,
9
+ > and `dojo_update_state` to record phase transitions and decisions.
10
+
11
+ # Repo Context Sync
12
+
13
+ Efficiently sync with relevant parts of GitHub repositories to ground reasoning in actual codebase state. This skill enables context-aware architectural decisions, refactoring, and implementation prompt writing by providing tools to clone, track changes, and extract patterns from repos.
14
+
15
+ ## I. The Philosophy: Grounding in Reality
16
+
17
+ Architectural decisions made in a vacuum are fragile. Implementation prompts written without understanding existing patterns create friction. The Repo Context Sync skill embodies **grounding in reality**—the practice of syncing with the actual codebase state before making decisions or writing specifications.
18
+
19
+ This is not about reading every file, but about **surgical context extraction**: identifying what matters for the task at hand, syncing only those parts, and integrating that context into reasoning. It transforms vague architectural discussions into grounded, actionable decisions.
20
+
21
+ ## II. When to Use This Skill
22
+
23
+ Trigger this skill when:
24
+ - User mentions "repo", "repository", "codebase", "sync", "what changed"
25
+ - Starting a conversation about refactoring, architecture, or design
26
+ - Writing implementation prompts that need to follow existing patterns
27
+ - User asks about specific repo directories (e.g., `/00_Roadmap/`, `/02_Specs/`)
28
+ - Need to understand current state of dojo-genesis or 11-11 repos
29
+
30
+ ## III. Core Workflow
31
+
32
+ ### 1. Identify Context Need
33
+
34
+ Parse the user's request to determine:
35
+ - Which repo(s) are relevant (dojo-genesis, 11-11, etc.)
36
+ - Which directories matter for the task
37
+ - What keywords indicate focus areas
38
+
39
+ **Common patterns:**
40
+ - "refactor the agent routing" → Need `/02_Specs/`, `/04_System/`
41
+ - "write implementation prompt for X" → Need existing code patterns
42
+ - "what changed in the backend" → Need diff since last sync
43
+
44
+ ### 2. Sync Repo State
45
+
46
+ Use the appropriate script based on repo state:
47
+
48
+ #### If repo not yet cloned:
49
+ ```bash
50
+ bash /home/ubuntu/skills/repo-context-sync/scripts/smart_clone.sh \
51
+ <repo_url> \
52
+ <local_path> \
53
+ [dir1] [dir2] ...
54
+ ```
55
+
56
+ **Example:**
57
+ ```bash
58
+ bash /home/ubuntu/skills/repo-context-sync/scripts/smart_clone.sh \
59
+ https://github.com/TresPies-source/dojo-genesis \
60
+ /home/ubuntu/repos/dojo-genesis \
61
+ /00_Roadmap/ /02_Specs/ /04_System/
62
+ ```
63
+
64
+ This uses sparse checkout to only pull specified directories, saving time and space.
65
+
66
+ #### If repo already cloned:
67
+ The script automatically detects existing repos and runs `git fetch && git pull` instead.
68
+
69
+ ### 3. Track Changes
70
+
71
+ Generate a diff summary to see what changed since last sync:
72
+
73
+ ```bash
74
+ python3.11 /home/ubuntu/skills/repo-context-sync/scripts/diff_tracker.py \
75
+ <repo_path> \
76
+ [last_commit_hash]
77
+ ```
78
+
79
+ **Example:**
80
+ ```bash
81
+ python3.11 /home/ubuntu/skills/repo-context-sync/scripts/diff_tracker.py \
82
+ /home/ubuntu/repos/dojo-genesis \
83
+ abc123
84
+ ```
85
+
86
+ This generates a markdown summary showing:
87
+ - Added, modified, deleted files
88
+ - Commit messages
89
+ - Summary statistics
90
+
91
+ The summary is both printed and saved to `.diff_summary.md` in the repo.
92
+
93
+ ### 4. Generate Context Map
94
+
95
+ Create a comprehensive overview of the codebase:
96
+
97
+ ```bash
98
+ python3.11 /home/ubuntu/skills/repo-context-sync/scripts/context_mapper.py \
99
+ <repo_path> \
100
+ [focus_keywords...]
101
+ ```
102
+
103
+ **Example:**
104
+ ```bash
105
+ python3.11 /home/ubuntu/skills/repo-context-sync/scripts/context_mapper.py \
106
+ /home/ubuntu/repos/dojo-genesis \
107
+ agent routing supervisor
108
+ ```
109
+
110
+ This generates:
111
+ - File tree structure
112
+ - Detected languages and frameworks
113
+ - Files matching focus keywords
114
+ - Summaries of relevant files
115
+ - Pattern extraction
116
+
117
+ The summary is saved to `.context_summary.md` in the repo.
118
+
119
+ ### 5. Integrate Context
120
+
121
+ Read the generated summaries and integrate into reasoning:
122
+
123
+ 1. **Read the context summary** to understand repo structure
124
+ 2. **Read relevant files** identified by the mapper
125
+ 3. **Check reference docs** for patterns:
126
+ - `/home/ubuntu/skills/repo-context-sync/references/file_hierarchy_patterns.md`
127
+ - `/home/ubuntu/skills/repo-context-sync/references/zenflow_repo_patterns.md`
128
+ 4. **Ground architectural decisions** in actual code state
129
+
130
+ ## IV. Script Reference
131
+
132
+ ### smart_clone.sh
133
+
134
+ **Purpose:** Efficient sparse checkout of relevant directories
135
+
136
+ **Usage:**
137
+ ```bash
138
+ bash smart_clone.sh <repo_url> <local_path> [dir1] [dir2] ...
139
+ ```
140
+
141
+ **Behavior:**
142
+ - If repo doesn't exist: Clone with sparse checkout
143
+ - If repo exists: Fetch and pull latest changes
144
+ - Only downloads specified directories (if provided)
145
+
146
+ **Storage location:** `/home/ubuntu/repos/{repo_name}/`
147
+
148
+ ### diff_tracker.py
149
+
150
+ **Purpose:** Track and summarize changes since last sync
151
+
152
+ **Usage:**
153
+ ```bash
154
+ python3.11 diff_tracker.py <repo_path> [last_commit_hash]
155
+ ```
156
+
157
+ **Output:**
158
+ - Markdown summary of changes
159
+ - List of modified/added/deleted files
160
+ - Commit messages
161
+ - Saved to `<repo_path>/.diff_summary.md`
162
+
163
+ **Default behavior:** If no commit hash provided, compares last 10 commits
164
+
165
+ ### context_mapper.py
166
+
167
+ **Purpose:** Generate codebase overview for task context
168
+
169
+ **Usage:**
170
+ ```bash
171
+ python3.11 context_mapper.py <repo_path> [focus_keywords...]
172
+ ```
173
+
174
+ **Output:**
175
+ - File tree structure (max depth 3)
176
+ - Detected languages and frameworks
177
+ - Files matching keywords (via git grep)
178
+ - Summaries of top 5 relevant files
179
+ - Saved to `<repo_path>/.context_summary.md`
180
+
181
+ **Pattern detection:**
182
+ - Languages by file extensions
183
+ - Frameworks by config files (package.json, requirements.txt, etc.)
184
+ - File hierarchy patterns (numbered directories like `/00_Roadmap/`)
185
+
186
+ ## V. Reference Documents
187
+
188
+ ### file_hierarchy_patterns.md
189
+
190
+ Describes the standard "Planning with Files" hierarchy used in 11-11 and Dojo Genesis:
191
+
192
+ - `/00_Roadmap/` - High-level goals and task_plan.md
193
+ - `/01_PRDs/` - Product Requirement Documents
194
+ - `/02_Specs/` - Technical specifications
195
+ - `/03_Prompts/` - Local prompt library
196
+ - `/04_System/` - AI Personas and system prompts
197
+ - `/05_Logs/` - Dev traces, JOURNAL.md, AUDIT_LOG.md
198
+
199
+ Read this when:
200
+ - Understanding repo structure
201
+ - Determining which directories to sync
202
+ - Writing files that follow conventions
203
+
204
+ ### implementation_agent_patterns.md
205
+
206
+ Describes how to work with implementation agents' workflows:
207
+
208
+ - Task artifact structure (e.g., `.zenflow/tasks/{task_id}/` for Zenflow)
209
+ - Built-in workflow types (Quick Change, Fix Bug, Spec and Build, Full SDD)
210
+ - Best practices for reading existing codebases
211
+ - Integration with standard file hierarchy
212
+
213
+ Read this when:
214
+ - Writing implementation prompts
215
+ - Understanding task artifacts
216
+ - Following existing codebase patterns
217
+
218
+ ## VI. Common Use Cases
219
+
220
+ ### Use Case 1: Starting a Refactoring Conversation
221
+
222
+ **User says:** "Let's refactor the agent routing logic"
223
+
224
+ **Workflow:**
225
+ 1. Identify relevant repo: dojo-genesis
226
+ 2. Identify relevant dirs: `/02_Specs/`, `/04_System/`
227
+ 3. Run smart_clone.sh with those dirs
228
+ 4. Run context_mapper.py with keywords: "agent", "routing", "supervisor"
229
+ 5. Read generated context summary
230
+ 6. Read relevant spec files
231
+ 7. Ground refactoring suggestions in actual code
232
+
233
+ ### Use Case 2: Writing an Implementation Prompt
234
+
235
+ **User says:** "Write an implementation prompt to implement the Trail of Thought visualization"
236
+
237
+ **Workflow:**
238
+ 1. Identify relevant repo: dojo-genesis
239
+ 2. Run smart_clone.sh to get latest code
240
+ 3. Run context_mapper.py with keywords: "visualization", "trace", "component"
241
+ 4. Read implementation_agent_patterns.md for best practices
242
+ 5. Extract existing patterns (naming, imports, structure)
243
+ 6. Write prompt that says "Follow existing patterns in /src/components/"
244
+ 7. Reference specific files and conventions
245
+
246
+ ### Use Case 3: Tracking Evolution
247
+
248
+ **User says:** "What changed in the backend since last session?"
249
+
250
+ **Workflow:**
251
+ 1. Identify relevant repo: dojo-genesis
252
+ 2. Load last sync commit hash from state (if available)
253
+ 3. Run diff_tracker.py with that commit
254
+ 4. Read generated diff summary
255
+ 5. Highlight architectural implications
256
+ 6. Summarize for user
257
+
258
+ ## VII. State Management
259
+
260
+ Track sync state in `/home/ubuntu/.repo-sync-state.json`:
261
+
262
+ ```json
263
+ {
264
+ "repos": {
265
+ "TresPies-source/dojo-genesis": {
266
+ "last_sync": "2026-01-28T17:48:00Z",
267
+ "commit_hash": "abc123",
268
+ "local_path": "/home/ubuntu/repos/dojo-genesis",
269
+ "tracked_dirs": ["/00_Roadmap/", "/02_Specs/"]
270
+ }
271
+ }
272
+ }
273
+ ```
274
+
275
+ Update this file after each sync to enable diff tracking.
276
+
277
+ ## VIII. Integration with Implementation Agents
278
+
279
+ When working with implementation agents (Zenflow, Claude Code, etc.):
280
+
281
+ 1. **Read existing codebase first** - Use context_mapper.py before generating code
282
+ 2. **Follow existing patterns** - Extract conventions from context summary
283
+ 3. **Reference standard hierarchy** - Use file_hierarchy_patterns.md as guide
284
+ 4. **Integrate cleanly** - Minimize refactoring, extend existing components
285
+
286
+ Implementation agents typically have full repo access, so prompts should leverage that:
287
+ - "Read /src/components/ to understand component patterns"
288
+ - "Follow the same naming conventions as existing files"
289
+ - "Integrate with existing state management in /src/store/"
290
+
291
+ ## IX. Best Practices
292
+
293
+ ### Efficiency
294
+ - Only sync directories relevant to the task
295
+ - Use sparse checkout for large repos
296
+ - Cache context summaries (invalidate on sync)
297
+
298
+ ### Accuracy
299
+ - Always fetch latest changes before generating context
300
+ - Verify commit hashes in diff tracking
301
+ - Cross-reference multiple files for patterns
302
+
303
+ ### Transparency
304
+ - Show user what's being synced and why
305
+ - Surface generated summaries for review
306
+ - Log sync operations to session
307
+
308
+ ### Integration
309
+ - Read reference docs to understand patterns
310
+ - Follow existing conventions in repos
311
+ - Update state file after each sync
312
+
313
+ ## X. Limitations
314
+
315
+ ### What This Skill Does
316
+ - Efficiently clone/sync relevant repo parts
317
+ - Track changes and generate diffs
318
+ - Extract patterns and conventions
319
+ - Provide grounded context for reasoning
320
+
321
+ ### What This Skill Doesn't Do
322
+ - Automatically modify code
323
+ - Make architectural decisions
324
+ - Execute implementation tasks
325
+ - Replace manual code review
326
+ - Store full repo history (only relevant parts)
327
+
328
+ ## XI. Troubleshooting
329
+
330
+ ### Issue: Sparse checkout not working
331
+ **Solution:** Ensure Git version is 2.25+ (sparse-checkout v2 feature)
332
+
333
+ ### Issue: Context mapper finds too many files
334
+ **Solution:** Use more specific keywords or limit to specific directories
335
+
336
+ ### Issue: Diff tracker shows no changes
337
+ **Solution:** Verify last_commit_hash is correct and repo has been fetched
338
+
339
+ ### Issue: Scripts fail with permission errors
340
+ **Solution:** Ensure scripts are executable (`chmod +x`)
341
+
342
+ ## XII. Quick Reference
343
+
344
+ | Task | Command |
345
+ |------|---------|
346
+ | Clone repo (sparse) | `bash smart_clone.sh <url> <path> [dirs]` |
347
+ | Update existing repo | `bash smart_clone.sh <url> <path>` (auto-detects) |
348
+ | Track changes | `python3.11 diff_tracker.py <path> [commit]` |
349
+ | Generate context | `python3.11 context_mapper.py <path> [keywords]` |
350
+ | Read hierarchy patterns | `file read references/file_hierarchy_patterns.md` |
351
+ | Read implementation patterns | `file read references/implementation_agent_patterns.md` |
352
+ ---
353
+
354
+ ## OpenClaw Tool Integration
355
+
356
+ When running inside the Dojo Genesis plugin:
357
+
358
+ 1. **Start** by calling `dojo_get_context` to retrieve full project state, history, and artifacts
359
+ 2. **During** the skill, follow the workflow steps documented above
360
+ 3. **Save** outputs using `dojo_save_artifact` with the `artifacts` output directory
361
+ 4. **Update** project state by calling `dojo_update_state` to record skill completion and any phase transitions
362
+
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "dojo-genesis-plugin-repo-context-sync",
3
+ "version": "1.0.0",
4
+ "description": "Sync and extract context from repositories",
5
+ "author": "dojo-genesis",
6
+ "license": "MIT",
7
+ "permissions": [],
8
+ "entry": "SKILL.md",
9
+ "tags": ["dojo-genesis", "orchestration", "research", "analysis"],
10
+ "models": ["claude-*", "gpt-*", "gemini-*"],
11
+ "minOpenClawVersion": "2026.1.0"
12
+ }
@@ -0,0 +1,186 @@
1
+ # File Hierarchy Patterns in 11-11 and Dojo Genesis Repos
2
+
3
+ This document describes the common file organization patterns found in the 11-11 and Dojo Genesis repositories, based on the "Planning with Files" philosophy.
4
+
5
+ ## Core Philosophy: Planning with Files
6
+
7
+ The filesystem is the absolute source of truth. All plans, specifications, prompts, logs, and artifacts are stored as human-readable files in a well-defined hierarchy. This ensures the system remains inspectable, debuggable, and version-controllable.
8
+
9
+ ## Standard Directory Structure
10
+
11
+ ### `/00_Roadmap/`
12
+ **Purpose:** High-level goals and strategic planning
13
+
14
+ **Common Files:**
15
+ - `task_plan.md` - Current task breakdown and priorities
16
+ - `vision.md` - Long-term vision and goals
17
+ - `milestones.md` - Key milestones and deadlines
18
+
19
+ **When to Read:** When understanding project direction, priorities, or long-term strategy
20
+
21
+ ### `/01_PRDs/`
22
+ **Purpose:** Product Requirement Documents
23
+
24
+ **Common Files:**
25
+ - `{feature_name}_prd.md` - Detailed product requirements for specific features
26
+ - `core_features.md` - Overview of core product features
27
+
28
+ **Naming Convention:** Lowercase with underscores, descriptive names
29
+ **When to Read:** When implementing new features or understanding product scope
30
+
31
+ ### `/02_Specs/`
32
+ **Purpose:** Technical specifications and architecture
33
+
34
+ **Common Files:**
35
+ - `architecture.md` - System architecture overview
36
+ - `api_spec.md` - API design and endpoints
37
+ - `database_schema.md` - Database structure
38
+ - `{component}_spec.md` - Component-specific technical specs
39
+
40
+ **When to Read:** When implementing technical features, refactoring, or understanding system design
41
+
42
+ ### `/03_Prompts/`
43
+ **Purpose:** Local prompt library (reusable AI prompts)
44
+
45
+ **Common Files:**
46
+ - Individual prompt files with `.md` extension
47
+ - `index.md` - Catalog of available prompts
48
+
49
+ **Metadata Pattern:**
50
+ ```markdown
51
+ ---
52
+ public: true/false
53
+ version: 1.0
54
+ tags: [tag1, tag2]
55
+ ---
56
+ ```
57
+
58
+ **When to Read:** When crafting new prompts or looking for reusable patterns
59
+
60
+ ### `/04_System/`
61
+ **Purpose:** AI Personas and system prompts
62
+
63
+ **Common Files:**
64
+ - `dojo_agent.md` - Dojo agent persona and instructions
65
+ - `supervisor_agent.md` - Supervisor routing logic
66
+ - `librarian_agent.md` - Librarian search and retrieval
67
+ - `builder_agent.md` - Code generation agent
68
+
69
+ **When to Read:** When understanding agent behavior, routing logic, or system-level instructions
70
+
71
+ ### `/05_Logs/`
72
+ **Purpose:** Development traces, journals, and audit logs
73
+
74
+ **Common Files:**
75
+ - `JOURNAL.md` - Development journal and notes
76
+ - `AUDIT_LOG.md` - Audit trail of key decisions
77
+ - `trace_{timestamp}.json` - Harness trace logs
78
+ - `session_{id}.md` - Session summaries
79
+
80
+ **When to Read:** When debugging, understanding historical decisions, or tracking changes
81
+
82
+ ## File Naming Conventions
83
+
84
+ ### General Rules
85
+ - **Lowercase with underscores:** `task_plan.md`, not `TaskPlan.md` or `task-plan.md`
86
+ - **Descriptive names:** `agent_routing_spec.md`, not `spec1.md`
87
+ - **Consistent extensions:** `.md` for documentation, `.json` for structured data
88
+
89
+ ### Versioning Pattern
90
+ - Append version to filename when maintaining multiple versions: `api_spec_v1.md`, `api_spec_v2.md`
91
+ - Use `_draft` suffix for work-in-progress: `architecture_draft.md`
92
+
93
+ ### Timestamps
94
+ - Use ISO 8601 format: `trace_2026-01-28T17-48-00.json`
95
+ - For logs and traces, timestamp in filename helps with chronological sorting
96
+
97
+ ## Metadata Patterns
98
+
99
+ ### Frontmatter (YAML)
100
+ Many markdown files include YAML frontmatter for metadata:
101
+
102
+ ```markdown
103
+ ---
104
+ title: "Feature Name"
105
+ author: "Manus AI"
106
+ date: "2026-01-28"
107
+ status: "draft" | "final" | "archived"
108
+ version: "1.0"
109
+ public: true | false
110
+ tags: ["tag1", "tag2"]
111
+ ---
112
+ ```
113
+
114
+ ### Public Flag
115
+ - `public: true` - Can be shared in Commons (Wikipedia of Prompts)
116
+ - `public: false` - Private to project
117
+
118
+ ## Integration with Hybrid Storage
119
+
120
+ ### Google Drive
121
+ - Used for personal, "calm" work
122
+ - Roadmaps, PRDs, documentation
123
+ - Synced via Google Drive API
124
+
125
+ ### GitHub
126
+ - Used for collaborative, version-controlled development
127
+ - Code, prompts, specs
128
+ - Synced via Octokit (GitHub API)
129
+
130
+ ## Common Patterns When Reading Repos
131
+
132
+ ### 1. Start with Roadmap
133
+ Always check `/00_Roadmap/task_plan.md` first to understand current priorities
134
+
135
+ ### 2. Check Specs for Technical Context
136
+ Read relevant files in `/02_Specs/` to understand architecture before making changes
137
+
138
+ ### 3. Review System Prompts for Agent Behavior
139
+ Check `/04_System/` to understand how agents should behave
140
+
141
+ ### 4. Look for Existing Patterns in Prompts
142
+ Browse `/03_Prompts/` to find reusable patterns before creating new ones
143
+
144
+ ### 5. Consult Logs for Historical Context
145
+ Check `/05_Logs/JOURNAL.md` to understand recent decisions and changes
146
+
147
+ ## Zenflow Integration
148
+
149
+ When working with Zenflow, these directories map to workflow artifacts:
150
+
151
+ - **Zenflow `plan.md`** → Similar to `/00_Roadmap/task_plan.md`
152
+ - **Zenflow `spec.md`** → Similar to `/02_Specs/{feature}_spec.md`
153
+ - **Zenflow `implementation.md`** → Detailed implementation notes
154
+
155
+ Zenflow tasks run in isolated worktrees under `.zenflow/tasks/{task_id}/`, but should follow the same file hierarchy patterns for consistency.
156
+
157
+ ## Best Practices
158
+
159
+ ### When Syncing Repos
160
+ 1. **Identify relevant directories first** - Don't clone everything
161
+ 2. **Check for numbered directories** (`00_`, `01_`, etc.) - These follow the standard pattern
162
+ 3. **Look for `index.md` or `README.md`** - Often provide navigation guides
163
+ 4. **Read frontmatter** - Metadata tells you status, version, and visibility
164
+
165
+ ### When Writing New Files
166
+ 1. **Follow the hierarchy** - Put files in the appropriate numbered directory
167
+ 2. **Use consistent naming** - Lowercase with underscores
168
+ 3. **Add frontmatter** - Include status, version, and public flag
169
+ 4. **Update indexes** - If there's an `index.md`, add your new file to it
170
+
171
+ ### When Refactoring
172
+ 1. **Preserve the hierarchy** - Don't break the numbered directory structure
173
+ 2. **Update related files** - If you change a spec, update the corresponding PRD
174
+ 3. **Archive, don't delete** - Move old versions to `/05_Logs/archived/` instead of deleting
175
+
176
+ ## Quick Reference: What to Read When
177
+
178
+ | Task | Directories to Check |
179
+ |------|---------------------|
180
+ | Understanding project goals | `/00_Roadmap/` |
181
+ | Implementing new feature | `/01_PRDs/`, `/02_Specs/` |
182
+ | Refactoring architecture | `/02_Specs/`, `/05_Logs/` |
183
+ | Writing Zenflow prompt | `/02_Specs/`, `/03_Prompts/` |
184
+ | Understanding agent behavior | `/04_System/` |
185
+ | Debugging issues | `/05_Logs/`, `/02_Specs/` |
186
+ | Finding reusable patterns | `/03_Prompts/` |