idStrategySpecSection returns a markdown section documenting the chosen ID strategy.
(cfg idStrategyConfig)
| 506 | |
| 507 | // idStrategySpecSection returns a markdown section documenting the chosen ID strategy. |
| 508 | func idStrategySpecSection(cfg idStrategyConfig) string { |
| 509 | switch cfg.strategy { |
| 510 | case "prefixed": |
| 511 | return fmt.Sprintf(` |
| 512 | |
| 513 | ## ID Generation |
| 514 | |
| 515 | This project uses **prefixed sequential** IDs with the prefix **%q**. |
| 516 | |
| 517 | - Format: `+"`%s-NNN`"+` |
| 518 | - IDs are zero-padded sequential numbers with a prefix (e.g., `+"`%s-001`"+`, `+"`%s-002`"+`) |
| 519 | - The prefix groups tasks by team, area, or project |
| 520 | `, cfg.prefix, cfg.prefix, cfg.prefix, cfg.prefix) |
| 521 | case "random": |
| 522 | return ` |
| 523 | |
| 524 | ## ID Generation |
| 525 | |
| 526 | This project uses **random** IDs. |
| 527 | |
| 528 | - Format: alphanumeric strings (e.g., ` + "`a3f9x2`" + `, ` + "`b7k2m1`" + `) |
| 529 | - Generated automatically by ` + "`taskmd add`" + ` |
| 530 | - Default length: 6 characters |
| 531 | ` |
| 532 | case "ulid": |
| 533 | return ` |
| 534 | |
| 535 | ## ID Generation |
| 536 | |
| 537 | This project uses **ULID** (Universally Unique Lexicographically Sortable Identifier) IDs. |
| 538 | |
| 539 | - Format: lowercase ULID strings (e.g., ` + "`01h5a3mpk`" + `) |
| 540 | - Generated automatically by ` + "`taskmd add`" + ` |
| 541 | - ULIDs are time-ordered, so tasks sort chronologically by creation |
| 542 | - Default length: 9 characters |
| 543 | ` |
| 544 | default: // sequential |
| 545 | return "" // sequential is the default, no extra section needed |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | // collectInitFiles returns files split into root and task dir. |
| 550 | // Agent configs and spec are both placed in the task directory. |