Skip to content

Commit 7155be1

Browse files
committed
fix: update README and GUIDE with correct CLI usage and new features
- Correct md command usage examples (was mdflow in some places) - Document new features: _inputs typed forms, md explain, --_edit, --_context - Add context dashboard and rich output rendering docs - Document frecency-based file picker
1 parent 15203d0 commit 7155be1

File tree

2 files changed

+320
-22
lines changed

2 files changed

+320
-22
lines changed

GUIDE.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,3 +618,195 @@ md 20-agent-smith.claude.md --_goal "Review my rust code" > review-rust.claude.m
618618
```
619619

620620
*UX Benefit: The tool helps you build the tool.*
621+
622+
---
623+
624+
# Part 3: New Features Tour
625+
626+
These examples demonstrate the latest features added to mdflow.
627+
628+
---
629+
630+
## 21. The Form Builder
631+
632+
**Concept:** *Typed Interactive Inputs*
633+
**UX Problem:** You want a proper form with different input types, not just text prompts.
634+
**Solution:** Use the new `_inputs` object format with typed fields.
635+
636+
**File:** `21-deploy-wizard.claude.md`
637+
638+
```markdown
639+
---
640+
model: sonnet
641+
_inputs:
642+
_service:
643+
type: text
644+
description: "Service name"
645+
default: "api"
646+
_environment:
647+
type: select
648+
options: [development, staging, production]
649+
_replicas:
650+
type: number
651+
description: "Number of replicas"
652+
_dry_run:
653+
type: confirm
654+
description: "Dry run only?"
655+
---
656+
Generate a deployment manifest for {{ _service }} in {{ _environment }}.
657+
{% if _replicas > 1 %}Use {{ _replicas }} replicas for high availability.{% endif %}
658+
{% if _dry_run %}This is a dry run - just show what would happen.{% endif %}
659+
```
660+
661+
**Run it:**
662+
663+
```bash
664+
md 21-deploy-wizard.claude.md
665+
```
666+
667+
*UX Benefit: Type-safe forms with select dropdowns, number inputs, and confirmations.*
668+
669+
---
670+
671+
## 22. The Inspector
672+
673+
**Concept:** *Configuration Debugging*
674+
**UX Problem:** Your agent isn't running as expected, and you need to see what's actually being sent.
675+
**Solution:** Use `md explain` to see the fully resolved configuration.
676+
677+
**Run it:**
678+
679+
```bash
680+
md explain review.claude.md
681+
```
682+
683+
**Output:**
684+
685+
```text
686+
╭─ Agent Analysis ──────────────────────────────────────────────╮
687+
│ Command: claude (from filename: review.claude.md) │
688+
│ Interactive: false (default: print mode) │
689+
│ │
690+
│ Config Chain: │
691+
│ ✓ Built-in defaults │
692+
│ ✓ ~/.mdflow/config.yaml │
693+
│ ✗ ./mdflow.config.yaml (not found) │
694+
│ ✓ Frontmatter │
695+
│ │
696+
│ Final Flags: --model opus --print │
697+
│ Token Usage: ~12,450 / 100,000 (12.4%) │
698+
╰───────────────────────────────────────────────────────────────╯
699+
```
700+
701+
*UX Benefit: Understand exactly what md will do before running it.*
702+
703+
---
704+
705+
## 23. The Preflight Check
706+
707+
**Concept:** *Context Visualization*
708+
**UX Problem:** You're importing many files and want to verify the context before sending to the LLM.
709+
**Solution:** Use `--_context` to see the context tree and exit.
710+
711+
**File:** `23-review-all.claude.md`
712+
713+
```markdown
714+
---
715+
model: opus
716+
---
717+
Review this entire codebase:
718+
@./src/**/*.ts
719+
@./tests/**/*.ts
720+
```
721+
722+
**Run it:**
723+
724+
```bash
725+
md 23-review-all.claude.md --_context
726+
```
727+
728+
**Output:**
729+
730+
```text
731+
┌─ Pre-Flight ──────────────────────────────────────────────────┐
732+
│ 📄 23-review-all.claude.md 0.2 KB │
733+
│ ├── 📁 @./src/**/*.ts (24 files) 48.3 KB │
734+
│ └── 📁 @./tests/**/*.ts (12 files) 22.1 KB │
735+
│ │
736+
│ Total: 70.6 KB (~17,650 tokens) │
737+
└───────────────────────────────────────────────────────────────┘
738+
```
739+
740+
*UX Benefit: Know your token budget before committing to an expensive API call.*
741+
742+
---
743+
744+
## 24. The Editor's Cut
745+
746+
**Concept:** *Edit Before Execute*
747+
**UX Problem:** You want to tweak the final prompt after all imports are resolved.
748+
**Solution:** Use `--_edit` to open the fully resolved prompt in your editor.
749+
750+
**File:** `24-summarize.claude.md`
751+
752+
```markdown
753+
---
754+
model: haiku
755+
---
756+
Summarize this code:
757+
@./src/main.ts
758+
```
759+
760+
**Run it:**
761+
762+
```bash
763+
md 24-summarize.claude.md --_edit
764+
```
765+
766+
Your `$EDITOR` opens with the fully expanded prompt. Make any changes, save, and close. The edited version is then sent to the LLM.
767+
768+
*UX Benefit: Last-chance editing for context-sensitive adjustments.*
769+
770+
---
771+
772+
## 25. The Pretty Printer
773+
774+
**Concept:** *Rich Terminal Output*
775+
**UX Problem:** LLM output with code blocks looks ugly in the terminal.
776+
**Solution:** mdflow now renders markdown with syntax highlighting by default.
777+
778+
**Run it:**
779+
780+
```bash
781+
md explain-code.claude.md # Beautiful syntax-highlighted output
782+
```
783+
784+
For piping to other tools, use `--raw`:
785+
786+
```bash
787+
md generate-json.claude.md --raw | jq .
788+
```
789+
790+
*UX Benefit: Professional-looking output that's easy to read.*
791+
792+
---
793+
794+
## 26. The History Buff
795+
796+
**Concept:** *Frecency-Based File Picker*
797+
**UX Problem:** You have many agents and finding the right one takes time.
798+
**Solution:** The interactive picker now sorts by frecency (frequency + recency).
799+
800+
**Run it:**
801+
802+
```bash
803+
md # No arguments - opens the picker
804+
```
805+
806+
Files you use often and recently appear at the top. The algorithm uses Mozilla/z-style recency buckets:
807+
- Used in last 4 hours: 4x multiplier
808+
- Used in last 24 hours: 2x multiplier
809+
- Used in last week: 0.5x multiplier
810+
- Older: 0.25x multiplier
811+
812+
*UX Benefit: Your most-used agents are always a keystroke away.*

0 commit comments

Comments
 (0)