Create DevTrail documentation. Analyzes context to suggest document type or accepts explicit type parameter. Always confirms before creating.
Create DevTrail documentation based on recent changes.
When invoked, follow these steps:
If the user specified a document type (e.g., /devtrail-new ailog), skip to step 4 using that type.
Valid types: ailog, aidec, adr, eth, req, tes, inc, tde
Gather information about recent changes:
# Get current date
date +%Y-%m-%d
# Get modified files (staged and unstaged)
git status --porcelain
# Get recent changes summary
git diff --stat HEAD~1 2>/dev/null || git diff --stat
# Count lines changed
git diff --numstat HEAD~1 2>/dev/null || git diff --numstat
Based on the analysis, suggest a document type:
| Pattern | Suggested Type |
|---|---|
New code in src/, lib/, app/ (>10 lines) | AILOG |
| Multiple implementation alternatives discussed | AIDEC |
| Structural/architectural changes, new modules | ADR |
Files with auth, user, privacy, gdpr | ETH (draft) |
Test files (*.test.*, *.spec.*) | TES |
| Bug fixes, hotfixes | INC |
TODO, FIXME, HACK comments added | TDE |
| Requirements or spec files | REQ |
Always display this confirmation before creating:
╔══════════════════════════════════════════════════════════════════╗
║ DevTrail New ║
╠══════════════════════════════════════════════════════════════════╣
║ ║
║ 📊 Analysis: ║
║ • Files modified: [N] ║
║ • Lines changed: [+X / -Y] ║
║ • Area: [detected area or "general"] ║
║ ║
║ 🎯 Suggested type: [TYPE] ([Full Name]) ║
║ Reason: [Brief explanation] ║
║ ║
║ 📝 Proposed filename: ║
║ [TYPE]-YYYY-MM-DD-NNN-[description].md ║
║ ║
╚══════════════════════════════════════════════════════════════════╝
Confirm creation? [Y/n/other type]:
Wait for user confirmation before proceeding.
Read .devtrail/config.yml to determine language: