youmd 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/commands/chat.d.ts.map +1 -1
  2. package/dist/commands/chat.js +3 -2
  3. package/dist/commands/chat.js.map +1 -1
  4. package/dist/commands/env.d.ts +2 -0
  5. package/dist/commands/env.d.ts.map +1 -1
  6. package/dist/commands/env.js +7 -3
  7. package/dist/commands/env.js.map +1 -1
  8. package/dist/commands/login.d.ts +1 -0
  9. package/dist/commands/login.d.ts.map +1 -1
  10. package/dist/commands/login.js +20 -4
  11. package/dist/commands/login.js.map +1 -1
  12. package/dist/commands/machine.d.ts +28 -1
  13. package/dist/commands/machine.d.ts.map +1 -1
  14. package/dist/commands/machine.js +529 -4
  15. package/dist/commands/machine.js.map +1 -1
  16. package/dist/commands/project.d.ts.map +1 -1
  17. package/dist/commands/project.js +862 -17
  18. package/dist/commands/project.js.map +1 -1
  19. package/dist/commands/prompts.d.ts +19 -0
  20. package/dist/commands/prompts.d.ts.map +1 -1
  21. package/dist/commands/prompts.js +304 -1
  22. package/dist/commands/prompts.js.map +1 -1
  23. package/dist/commands/pull.d.ts.map +1 -1
  24. package/dist/commands/pull.js +28 -8
  25. package/dist/commands/pull.js.map +1 -1
  26. package/dist/commands/push.d.ts +3 -1
  27. package/dist/commands/push.d.ts.map +1 -1
  28. package/dist/commands/push.js +26 -12
  29. package/dist/commands/push.js.map +1 -1
  30. package/dist/commands/skill.d.ts.map +1 -1
  31. package/dist/commands/skill.js +19 -15
  32. package/dist/commands/skill.js.map +1 -1
  33. package/dist/commands/stack.d.ts.map +1 -1
  34. package/dist/commands/stack.js +14 -17
  35. package/dist/commands/stack.js.map +1 -1
  36. package/dist/commands/status.d.ts.map +1 -1
  37. package/dist/commands/status.js +31 -0
  38. package/dist/commands/status.js.map +1 -1
  39. package/dist/commands/sync.d.ts +1 -0
  40. package/dist/commands/sync.d.ts.map +1 -1
  41. package/dist/commands/sync.js +51 -2
  42. package/dist/commands/sync.js.map +1 -1
  43. package/dist/index.js +119 -29
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/api.d.ts +324 -0
  46. package/dist/lib/api.d.ts.map +1 -1
  47. package/dist/lib/api.js +68 -0
  48. package/dist/lib/api.js.map +1 -1
  49. package/dist/lib/daemon.d.ts +23 -0
  50. package/dist/lib/daemon.d.ts.map +1 -0
  51. package/dist/lib/daemon.js +166 -0
  52. package/dist/lib/daemon.js.map +1 -0
  53. package/dist/lib/first-run.d.ts +1 -1
  54. package/dist/lib/first-run.d.ts.map +1 -1
  55. package/dist/lib/first-run.js +8 -0
  56. package/dist/lib/first-run.js.map +1 -1
  57. package/dist/lib/machine-bootstrap-prompt.d.ts +17 -0
  58. package/dist/lib/machine-bootstrap-prompt.d.ts.map +1 -0
  59. package/dist/lib/machine-bootstrap-prompt.js +305 -0
  60. package/dist/lib/machine-bootstrap-prompt.js.map +1 -0
  61. package/dist/lib/machine-projects.d.ts +71 -0
  62. package/dist/lib/machine-projects.d.ts.map +1 -0
  63. package/dist/lib/machine-projects.js +510 -0
  64. package/dist/lib/machine-projects.js.map +1 -0
  65. package/dist/lib/machine-verify.d.ts +175 -0
  66. package/dist/lib/machine-verify.d.ts.map +1 -0
  67. package/dist/lib/machine-verify.js +684 -0
  68. package/dist/lib/machine-verify.js.map +1 -0
  69. package/dist/lib/portfolio-audit.d.ts +34 -0
  70. package/dist/lib/portfolio-audit.d.ts.map +1 -0
  71. package/dist/lib/portfolio-audit.js +254 -0
  72. package/dist/lib/portfolio-audit.js.map +1 -0
  73. package/dist/lib/portfolio-graph.d.ts +104 -0
  74. package/dist/lib/portfolio-graph.d.ts.map +1 -0
  75. package/dist/lib/portfolio-graph.js +281 -0
  76. package/dist/lib/portfolio-graph.js.map +1 -0
  77. package/dist/lib/project-strategy.d.ts +45 -0
  78. package/dist/lib/project-strategy.d.ts.map +1 -0
  79. package/dist/lib/project-strategy.js +234 -0
  80. package/dist/lib/project-strategy.js.map +1 -0
  81. package/dist/lib/reusable-patterns.d.ts +30 -0
  82. package/dist/lib/reusable-patterns.d.ts.map +1 -0
  83. package/dist/lib/reusable-patterns.js +375 -0
  84. package/dist/lib/reusable-patterns.js.map +1 -0
  85. package/dist/lib/skill-catalog.d.ts.map +1 -1
  86. package/dist/lib/skill-catalog.js +20 -0
  87. package/dist/lib/skill-catalog.js.map +1 -1
  88. package/dist/lib/skills.d.ts +1 -0
  89. package/dist/lib/skills.d.ts.map +1 -1
  90. package/dist/lib/skills.js +43 -13
  91. package/dist/lib/skills.js.map +1 -1
  92. package/dist/lib/version.d.ts +2 -0
  93. package/dist/lib/version.d.ts.map +1 -0
  94. package/dist/lib/version.js +63 -0
  95. package/dist/lib/version.js.map +1 -0
  96. package/dist/mcp/registry.d.ts +5 -1
  97. package/dist/mcp/registry.d.ts.map +1 -1
  98. package/dist/mcp/registry.js +426 -2
  99. package/dist/mcp/registry.js.map +1 -1
  100. package/dist/mcp/server.d.ts +2 -0
  101. package/dist/mcp/server.d.ts.map +1 -1
  102. package/dist/mcp/server.js +50 -5
  103. package/dist/mcp/server.js.map +1 -1
  104. package/package.json +1 -1
  105. package/scripts/env-vault/README.md +12 -2
  106. package/scripts/env-vault/backup.sh +24 -1
  107. package/scripts/env-vault/restore.sh +45 -3
  108. package/scripts/skillstack-sync/README.md +13 -6
  109. package/scripts/skillstack-sync/capture-agent-config.sh +1 -0
  110. package/scripts/skillstack-sync/com.youmd.context-sync.plist +38 -0
  111. package/scripts/skillstack-sync/com.youmd.identity-sync.plist +3 -1
  112. package/scripts/skillstack-sync/com.youmd.skillstack-sync.plist +1 -1
  113. package/scripts/skillstack-sync/context-sync.sh +69 -1
  114. package/scripts/skillstack-sync/install-daemons.sh +7 -3
  115. package/skills/machine-bootstrap.md +243 -0
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: machine-bootstrap
3
+ description: Set up a fresh computer with You.md identity, agent skills, stack sync, and active project repositories.
4
+ version: 1.0.0
5
+ scope: shared
6
+ identity_fields:
7
+ - profile.about
8
+ - profile.projects
9
+ - preferences.agent
10
+ - directives.agent
11
+ ---
12
+
13
+ # machine-bootstrap
14
+
15
+ Use this skill when the user is on a new Mac, Mac mini, laptop, virtual computer, cloud workstation, or agent host and wants their You.md identity, projects, skills, stacks, and local code workspace restored.
16
+
17
+ You.md is the brain. The new machine should become a runnable local agent workstation, not just a copied folder.
18
+
19
+ ## Identity Context
20
+
21
+ - **About:** {{profile.about}}
22
+ - **Projects:** {{profile.projects}}
23
+ - **Agent preferences:** {{preferences.agent}}
24
+ - **Directives:** {{directives.agent}}
25
+
26
+ ## Default Flow
27
+
28
+ 1. Confirm whether this looks like a fresh machine:
29
+ - `youmd status`
30
+ - `test -d ~/Desktop/CODE_YOU && find ~/Desktop/CODE_YOU -maxdepth 1 -type d | wc -l`
31
+ - `git config user.name && git config user.email`
32
+ - `gh auth status`
33
+ 2. If the user is still on the old/source machine and wants a copy/paste handoff
34
+ for Claude Code or Codex on the new machine, generate it first:
35
+
36
+ ```bash
37
+ youmd machine prompt --root ~/Desktop/CODE_YOU --days 90
38
+ ```
39
+
40
+ If the web dashboard minted a scoped bootstrap key, the generated prompt may
41
+ include `YOUMD_API_KEY`. Treat that prompt as secret-bearing local setup
42
+ material and do not paste it into public chats, tickets, or docs.
43
+ For bounded proof runs on a clean local root, add
44
+ `--max-clone-projects 2` or set `YOUMD_MAX_CLONE_PROJECTS=2`; omit that cap
45
+ on the real new machine.
46
+
47
+ 3. If You.md is not installed on the new machine, install it:
48
+
49
+ ```bash
50
+ curl -fsSL https://you.md/install.sh | bash
51
+ ```
52
+
53
+ 4. Authenticate and hydrate the local brain:
54
+
55
+ ```bash
56
+ youmd login --key "$YOUMD_API_KEY" # or: youmd login
57
+ youmd pull
58
+ youmd sync
59
+ ```
60
+
61
+ 5. Restore shared agent skills, stack config, and host adapters:
62
+
63
+ ```bash
64
+ youmd machine setup
65
+ youmd skill install all
66
+ youmd skill sync
67
+ youmd skill link codex
68
+ youmd skill link claude
69
+ ```
70
+
71
+ 6. Hydrate the portfolio graph from You.md/GitHub records before cloning, then
72
+ preview the graph-backed setup plan before creating the desktop code workspace
73
+ and syncing active projects:
74
+
75
+ ```bash
76
+ youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 90 --limit 80
77
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --dry-run
78
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90
79
+ ```
80
+
81
+ 7. If GitHub auth is missing, help the user log in and rerun only the project
82
+ clone step:
83
+
84
+ ```bash
85
+ gh auth login
86
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90
87
+ ```
88
+
89
+ 8. After projects are cloned and any encrypted env vault is restored, hydrate the
90
+ portfolio graph again so local README, project-context, git, PR, and env-key
91
+ evidence becomes visible to future agents:
92
+
93
+ ```bash
94
+ youmd project portfolio-hydrate --root ~/Desktop/CODE_YOU --days 90 --limit 80
95
+ ```
96
+
97
+ 9. Run the secret-safe readiness audit and sync the proof summary:
98
+
99
+ ```bash
100
+ youmd machine verify --root ~/Desktop/CODE_YOU --max-projects 80 --write-report --sync-report
101
+ ```
102
+
103
+ This checks cloned directories, git remotes, package managers, standard
104
+ scripts, `.env.local` presence, `.env.example` presence, root agent docs, and
105
+ `project-context/` presence. It writes a secret-safe JSON proof artifact to
106
+ `~/.youmd/machine-reports/latest.json` and syncs only the compact proof
107
+ summary to the You.md machine dashboard. It does not read secret values,
108
+ upload raw logs, or launch every dev server.
109
+
110
+ 10. Only when Houston explicitly wants deeper local proof or the clean host has
111
+ enough time/CPU, run bounded package checks and dev-server probes:
112
+
113
+ ```bash
114
+ youmd machine verify --root ~/Desktop/CODE_YOU --max-projects 80 --install-deps --run-checks --probe-servers --write-report --sync-report
115
+ ```
116
+
117
+ The default check scripts are `typecheck`, `lint`, `test`, and `build`.
118
+ Override with `--check-scripts lint,build` when needed. Dependency installs
119
+ and dev-server probes are capped by default; tune with
120
+ `--max-install-projects`, `--max-server-projects`, and timeout flags.
121
+
122
+ ## Project Bootstrap Rules
123
+
124
+ - Use repo directory names from GitHub URLs. `https://github.com/houstongolden/foldermd` becomes `foldermd`.
125
+ - Default to projects active in the last 90 days plus projects marked active/current in You.md.
126
+ - Ask before including older, archived, paused, or dormant projects.
127
+ - Create the workspace root on the Desktop if it is missing. `CODE_YOU` is the default fresh-machine root.
128
+ - Use the You.md Portfolio Graph as the strategic source of truth, then merge
129
+ authenticated GitHub recent-repo data and local bundle project records so repo
130
+ names and URLs stay cloneable.
131
+ - `youmd machine projects` should fetch the persisted owner graph through the
132
+ You.md API when authenticated. If that graph is unavailable, fall back to the
133
+ local bundle plus authenticated GitHub scan and say so.
134
+ - Clone with `gh repo clone owner/repo <target>` when `gh` is authenticated; otherwise fall back to `git clone`.
135
+ - Skip non-empty directories instead of overwriting them.
136
+ - Never print secrets. If `.env.local` files are needed, use the shared encrypted env backup/restore path or a password manager.
137
+ - After cloning, initialize missing per-repo agent context with `youmd skill init-project` from inside that repo.
138
+
139
+ ## Secret-Safe Env Transfer
140
+
141
+ Audit local project env coverage before backup:
142
+
143
+ ```bash
144
+ ~/.agent-shared/bin/env-key-audit.py --root ~/Desktop/CODE_2025
145
+ ~/.agent-shared/bin/env-secure-backup.sh --preflight
146
+ youmd env backup --root ~/Desktop/CODE_2025 --preflight
147
+ ```
148
+
149
+ Create an encrypted archive from the old machine in an interactive macOS terminal:
150
+
151
+ ```bash
152
+ open ~/.agent-shared/bin/env-backup-interactive.command
153
+ ```
154
+
155
+ On the new machine, list the encrypted archive by path only before restore:
156
+
157
+ ```bash
158
+ ~/.agent-shared/bin/env-secure-restore.sh --archive ~/Desktop/env-local-backup.tar.gz.gpg --list
159
+ youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU --list
160
+ youmd env restore ~/Desktop/env-local-backup.tar.gz.gpg --root ~/Desktop/CODE_YOU
161
+ ```
162
+
163
+ ## Useful Variants
164
+
165
+ Dry-run the project layout:
166
+
167
+ ```bash
168
+ youmd machine projects --root ~/Desktop/CODE_YOU --days 90 --dry-run
169
+ ```
170
+
171
+ Create directories only, without cloning:
172
+
173
+ ```bash
174
+ youmd machine projects --root ~/Desktop/CODE_YOU --no-clone
175
+ ```
176
+
177
+ Audit cloned readiness:
178
+
179
+ ```bash
180
+ youmd machine verify --root ~/Desktop/CODE_YOU --max-projects 80 --write-report --sync-report
181
+ ```
182
+
183
+ Run bounded package checks:
184
+
185
+ ```bash
186
+ youmd machine verify --root ~/Desktop/CODE_YOU --run-checks --max-check-projects 8 --check-timeout-ms 120000
187
+ ```
188
+
189
+ Run clean-host dependency installs and localhost dev-server probes:
190
+
191
+ ```bash
192
+ youmd machine verify --root ~/Desktop/CODE_YOU --install-deps --probe-servers --write-report --sync-report
193
+ ```
194
+
195
+ Include older projects without prompts:
196
+
197
+ ```bash
198
+ youmd machine projects --root ~/Desktop/CODE_YOU --yes
199
+ ```
200
+
201
+ Generate the copy/paste prompt for a new Claude Code or Codex terminal:
202
+
203
+ ```bash
204
+ youmd machine prompt --root ~/Desktop/CODE_YOU --days 90 --limit 80
205
+ ```
206
+
207
+ Generate the same prompt but cap clones for a clean-host proof run:
208
+
209
+ ```bash
210
+ youmd machine prompt --root /tmp/youmd-clean-host-CODE_YOU --days 90 --limit 80 --max-clone-projects 2
211
+ ```
212
+
213
+ Fetch the secret-safe project graph directly:
214
+
215
+ ```bash
216
+ curl -H "Authorization: Bearer $YOUMD_API_KEY" https://you.md/api/v1/me/portfolio/graph
217
+ ```
218
+
219
+ ## Done Means
220
+
221
+ - You.md CLI is installed and authenticated.
222
+ - The local bundle is pulled/synced.
223
+ - Shared skills/stacks/agent config are restored.
224
+ - A Desktop code root exists.
225
+ - Active GitHub-backed project repos are cloned into matching repo-name directories.
226
+ - The clone plan visibly used the persisted portfolio graph, authenticated
227
+ GitHub recent repos, and local bundle records with source counts.
228
+ - `youmd machine verify` reports git/package/env/agent-doc/project-context
229
+ readiness for the cloned workspace without reading `.env.local` values and
230
+ writes `~/.youmd/machine-reports/latest.json`.
231
+ - `--sync-report` creates or updates an owner-gated You.md machine proof row
232
+ that the dashboard can show across computers.
233
+ - If `--run-checks` was requested, bounded package checks ran with project and
234
+ timeout caps, and failures/timeouts were reported per project.
235
+ - If `--install-deps` or `--probe-servers` was requested, dependency installs
236
+ and localhost server probes ran with project and timeout caps, and the proof
237
+ report shows install/check/server pass counts.
238
+ - The portfolio graph is hydrated from both remote project records and local
239
+ code/project-context/env-key evidence.
240
+ - `.env.local` files, if restored, came from encrypted vault tooling without
241
+ printing raw values.
242
+ - Older projects are either explicitly included or intentionally skipped.
243
+ - The user can launch Claude Code or Codex inside the workspace and run `you`.