You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GUIDE.md
+318Lines changed: 318 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,3 +282,321 @@ Output ONLY the raw bash script.
282
282
# 2. We pipe the script to sh to execute the swarm immediately
283
283
ma 10-architect.claude.md "Build a login page with a fastify backend"| sh
284
284
```
285
+
286
+
---
287
+
288
+
# Part 2: The UX Tour
289
+
290
+
While Part 1 focused on power and complexity, Part 2 focuses on **User Experience (UX)**. These examples demonstrate features designed to make working with AI agents safe, interactive, and easy to understand for your team.
291
+
292
+
---
293
+
294
+
## 11. The Interactive Wizard
295
+
296
+
**Concept:***Variable Recovery*
297
+
**UX Problem:** You wrote a prompt with variables, but you don't want to memorize the argument order.
298
+
**Solution:** If you forget to provide variables, `ma` detects them and turns the CLI into an interactive form.
299
+
300
+
**File:**`11-onboarding.claude.md`
301
+
302
+
```markdown
303
+
---
304
+
model: sonnet
305
+
---
306
+
Welcome to the team, {{ name }}!
307
+
308
+
Please generate a warm onboarding email for a new engineer joining the {{ department }} team.
309
+
Mention that their manager is {{ manager }}.
310
+
```
311
+
312
+
**Run it (without arguments):**
313
+
314
+
```bash
315
+
ma 11-onboarding.claude.md
316
+
```
317
+
318
+
**`ma` responds:**
319
+
320
+
```text
321
+
Missing required variables. Please provide values:
322
+
? name: Alice
323
+
? department: Platform
324
+
? manager: Bob
325
+
```
326
+
327
+
*UX Benefit: Turns static scripts into interactive tools automatically.*
328
+
329
+
---
330
+
331
+
## 12. The Safety Net (Dry Run)
332
+
333
+
**Concept:***Trust & Verification*
334
+
**UX Problem:** You are about to run an agent on your entire codebase, but you're nervous about token costs or context size.
335
+
**Solution:** Use `--dry-run` to see exactly what *would* happen—the command, the expanded files, and the token count—without executing anything.
336
+
337
+
**File:**`12-refactor.gemini.md`
338
+
339
+
```markdown
340
+
---
341
+
model: gemini-1.5-pro
342
+
---
343
+
Refactor every file in this directory:
344
+
@./src/**/*.ts
345
+
```
346
+
347
+
**Run it:**
348
+
349
+
```bash
350
+
ma 12-refactor.gemini.md --dry-run
351
+
```
352
+
353
+
**Output:**
354
+
355
+
```text
356
+
DRY RUN - Command will NOT be executed
357
+
Command: gemini --model gemini-1.5-pro ...
358
+
Final Prompt: (Shows full expanded content of all files)
359
+
Estimated tokens: ~15,420
360
+
```
361
+
362
+
*UX Benefit: Verify expensive operations before spending money.*
363
+
364
+
---
365
+
366
+
## 13. The Native Binary
367
+
368
+
**Concept:***Shebang Support*
369
+
**UX Problem:** Typing `ma filename.md` feels like running a script. You want it to feel like a native system command.
370
+
**Solution:** Add a standard Unix shebang line.
371
+
372
+
**File:**`daily-report` (no extension needed)
373
+
374
+
```markdown
375
+
#!/usr/bin/env ma
376
+
---
377
+
command: claude
378
+
model: haiku
379
+
---
380
+
Generate a "Daily Standup" update based on my git activity:
381
+
!`git log --since="24 hours ago" --oneline`
382
+
```
383
+
384
+
**Run it:**
385
+
386
+
```bash
387
+
chmod +x daily-report
388
+
./daily-report
389
+
```
390
+
391
+
*UX Benefit: Abstracts away the tool entirely. It just behaves like a binary.*
392
+
393
+
---
394
+
395
+
## 14. The "Knobs & Dials" Interface
396
+
397
+
**Concept:***Hijacked Configuration ($vars)*
398
+
**UX Problem:** You want to expose configuration settings (defaults) that users can easily override via flags.
399
+
**Solution:** Variables starting with `$` in the frontmatter define defaults that are "hijacked" (consumed) by the template system.
400
+
401
+
**File:**`14-translator.gpt.md`
402
+
403
+
```markdown
404
+
---
405
+
command: openai
406
+
model: gpt-4o
407
+
# Default configuration
408
+
$lang: Spanish
409
+
$tone: Professional
410
+
---
411
+
Translate the following text into {{ lang }}. Keep the tone {{ tone }}.
412
+
413
+
<text>
414
+
{{ $1 }}
415
+
</text>
416
+
```
417
+
418
+
**Run it:**
419
+
420
+
```bash
421
+
# Use defaults
422
+
ma 14-translator.gpt.md "Hello World"
423
+
424
+
# Tweak the knobs via flags
425
+
ma 14-translator.gpt.md "Hello World" --lang "Pirate" --tone "Aggressive"
426
+
```
427
+
428
+
*UX Benefit: Creates a stable CLI interface for your prompts.*
429
+
430
+
---
431
+
432
+
## 15. The Context Surgeon
433
+
434
+
**Concept:***Symbol Extraction*
435
+
**UX Problem:** Importing entire files is wasteful and distracting when you only need one specific interface.
436
+
**Solution:** Use the `#Symbol` syntax to extract specific code blocks (Functions, Classes, Interfaces).
437
+
438
+
**File:**`15-test-gen.claude.md`
439
+
440
+
```markdown
441
+
---
442
+
model: sonnet
443
+
---
444
+
Write a unit test for this specific function:
445
+
446
+
@./src/utils.ts#calculateTax
447
+
448
+
Ensure it returns a type matching:
449
+
450
+
@./src/types.ts#TaxResult
451
+
```
452
+
453
+
*UX Benefit: Precision context reduces hallucinations and token costs.*
454
+
455
+
---
456
+
457
+
## 16. The "Context Pack"
458
+
459
+
**Concept:***Recursive Imports*
460
+
**UX Problem:** You constantly have to import the same 5 files (auth, database, types) for every task.
461
+
**Solution:** Create a "Context Pack"—a markdown file that just imports other files—and import *that*.
462
+
463
+
**File:**`_context-auth.md`
464
+
465
+
```markdown
466
+
# Auth System Context
467
+
@./src/auth/session.ts
468
+
@./src/auth/types.ts
469
+
@./src/auth/login.ts
470
+
```
471
+
472
+
**File:**`16-security-audit.claude.md`
473
+
474
+
```markdown
475
+
---
476
+
model: opus
477
+
---
478
+
Review the authentication flow for security holes.
479
+
@./_context-auth.md
480
+
```
481
+
482
+
*UX Benefit: Build a library of "mental models" that are easy to drop into any agent.*
483
+
484
+
---
485
+
486
+
## 17. The Secret Keeper
487
+
488
+
**Concept:***Environment Isolation*
489
+
**UX Problem:** You need API keys in your prompts but can't commit them to Git.
490
+
**Solution:**`ma` automatically loads `.env` files from the markdown file's directory.
0 commit comments