Skip to content

Commit 61d2a98

Browse files
author
catlog22
committed
refactor: move date to front in session ID naming convention
Change format from `{prefix}-{slug}-{date}` to `{prefix}-{date}-{slug}` across all workflow/skill session generators, so sessions sort chronologically by default within each prefix group. Scope: 73 docs/templates + 1 parser (analysis-routes.ts). Parser retains backward-compatible fallback for legacy `ANL-{slug}-{date}` folders already on disk. WFS sessions unchanged.
1 parent 53ed240 commit 61d2a98

74 files changed

Lines changed: 176 additions & 171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/issue/from-brainstorm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ brainstorm-with-file
349349
### Input Files
350350

351351
```
352-
.workflow/.brainstorm/BS-{slug}-{date}/
352+
.workflow/.brainstorm/BS-{date}-{slug}/
353353
├── synthesis.json # REQUIRED - Top ideas with scores
354354
├── perspectives.json # OPTIONAL - Multi-CLI insights
355355
├── brainstorm.md # Reference only

.claude/commands/workflow/analyze-with-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ All `AskUserQuestion` calls MUST comply:
102102
**Initialize session and create progress tracking.**
103103

104104
1. Extract topic/question from `$ARGUMENTS`
105-
2. Generate session ID: `ANL-{slug}-{date}` (slug: lowercase alphanumeric+Chinese, max 40 chars; date: YYYY-MM-DD UTC+8)
105+
2. Generate session ID: `ANL-{date}-{slug}` (date: YYYY-MM-DD UTC+8; slug: lowercase alphanumeric+Chinese, max 40 chars)
106106
3. Define session folder: `.workflow/.analysis/{session-id}`
107107
4. Parse options: `-c`/`--continue` for continuation, `-y`/`--yes` for auto-approval
108108
5. Auto-detect: If session folder + discussion.md exist -> continue mode

.claude/commands/workflow/brainstorm-with-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ When `--yes` or `-y`: Auto-confirm decisions, use recommended roles, balanced ex
4444
## Output Structure
4545

4646
```
47-
.workflow/.brainstorm/BS-{slug}-{date}/
47+
.workflow/.brainstorm/BS-{date}-{slug}/
4848
├── brainstorm.md # ⭐ Complete thought evolution timeline
4949
├── exploration-codebase.json # Phase 2: Codebase context
5050
├── perspectives.json # Phase 2: Multi-CLI findings
@@ -98,7 +98,7 @@ When `--yes` or `-y`: Auto-confirm decisions, use recommended roles, balanced ex
9898
### Session Initialization
9999

100100
1. Extract idea/topic from `$ARGUMENTS`
101-
2. Generate session ID: `BS-{slug}-{date}` (slug: lowercase, alphanumeric + Chinese, max 40 chars; date: YYYY-MM-DD UTC+8)
101+
2. Generate session ID: `BS-{date}-{slug}` (date: YYYY-MM-DD UTC+8; slug: lowercase, alphanumeric + Chinese, max 40 chars)
102102
3. Define session folder: `.workflow/.brainstorm/{session-id}`
103103
4. Parse command options:
104104
- `-c` or `--continue` for session continuation

.claude/commands/workflow/debug-with-file.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOSt
7979
const bugSlug = bug_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 30)
8080
const dateStr = getUtc8ISOString().substring(0, 10)
8181

82-
const sessionId = `DBG-${bugSlug}-${dateStr}`
82+
const sessionId = `DBG-${dateStr}-${bugSlug}`
8383
const sessionFolder = `.workflow/.debug/${sessionId}`
8484
const debugLogPath = `${sessionFolder}/debug.log`
8585
const understandingPath = `${sessionFolder}/understanding.md`
@@ -450,7 +450,7 @@ Remove all temporary debug logging statements added during investigation. Verify
450450
## Session Folder Structure
451451

452452
```
453-
.workflow/.debug/DBG-{slug}-{date}/
453+
.workflow/.debug/DBG-{date}-{slug}/
454454
├── debug.log # NDJSON log (execution evidence)
455455
├── understanding.md # NEW: Exploration timeline + consolidated understanding
456456
├── hypotheses.json # NEW: Hypothesis history with verdicts
@@ -535,9 +535,9 @@ After Reproduction (/workflow:debug-with-file "error"):
535535
└─ All rejected → Gemini-assisted new hypotheses
536536
537537
Output:
538-
├─ .workflow/.debug/DBG-{slug}-{date}/debug.log
539-
├─ .workflow/.debug/DBG-{slug}-{date}/understanding.md (evolving document)
540-
└─ .workflow/.debug/DBG-{slug}-{date}/hypotheses.json (history)
538+
├─ .workflow/.debug/DBG-{date}-{slug}/debug.log
539+
├─ .workflow/.debug/DBG-{date}-{slug}/understanding.md (evolving document)
540+
└─ .workflow/.debug/DBG-{date}-{slug}/hypotheses.json (history)
541541
```
542542

543543
## Gemini Integration Points

.claude/commands/workflow/integration-test-cycle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Unified integration test workflow: **Explore → Design → Develop → Test →
5959
| `.trace/` | 原始日志 | CLI 输出和测试日志,仅调试用:`cli-{N}.txt``test-output.log` |
6060

6161
```
62-
.workflow/.integration-test/ITG-{slug}-{date}/
62+
.workflow/.integration-test/ITG-{date}-{slug}/
6363
├── reflection-log.md # ⭐ 唯一人类可读文档 (exploration + design + iterations + conclusions)
6464
├── state.json # 唯一机器状态 (exploration + design + inventory + iterations + results + summary)
6565
└── .trace/ # 原始日志 (仅调试参考)
@@ -130,9 +130,9 @@ Unified integration test workflow: **Explore → Design → Develop → Test →
130130

131131
**Required Actions**:
132132
1. Extract module/feature description from `$ARGUMENTS`
133-
2. Generate session ID: `ITG-{slug}-{date}`
134-
- slug: lowercase, alphanumeric + Chinese, max 40 chars
133+
2. Generate session ID: `ITG-{date}-{slug}`
135134
- date: YYYY-MM-DD (UTC+8)
135+
- slug: lowercase, alphanumeric + Chinese, max 40 chars
136136
3. Define session folder: `.workflow/.integration-test/{session-id}`
137137
4. Parse command options:
138138
- `-c` or `--continue` for session continuation

.claude/commands/workflow/refactor-cycle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Closed-loop tech debt lifecycle: **Discover → Assess → Plan → Refactor →
5959
| `.trace/` | Raw logs | CLI analysis outputs, test outputs, diagnostics snapshots |
6060

6161
```
62-
.workflow/.refactor/RFT-{slug}-{date}/
62+
.workflow/.refactor/RFT-{date}-{slug}/
6363
├── reflection-log.md # ⭐ Debt discovery + prioritization + per-item reflections + conclusions
6464
├── state.json # Debt inventory + queue + plans + validation + iteration state
6565
└── .trace/ # Raw logs (CLI outputs, test results, diagnostics)
@@ -129,9 +129,9 @@ Closed-loop tech debt lifecycle: **Discover → Assess → Plan → Refactor →
129129

130130
**Required Actions**:
131131
1. Extract module/goal from `$ARGUMENTS`
132-
2. Generate session ID: `RFT-{slug}-{date}`
133-
- slug: lowercase, alphanumeric + Chinese, max 40 chars
132+
2. Generate session ID: `RFT-{date}-{slug}`
134133
- date: YYYY-MM-DD (UTC+8)
134+
- slug: lowercase, alphanumeric + Chinese, max 40 chars
135135
3. Session folder: `.workflow/.refactor/{session-id}`
136136
4. Parse options:
137137
- `-c` / `--continue`: Resume existing session

.claude/commands/workflow/roadmap-with-file.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Strategic requirement roadmap with **iterative decomposition**. Creates a single
102102
## Output Structure
103103

104104
```
105-
.workflow/.roadmap/RMAP-{slug}-{date}/
105+
.workflow/.roadmap/RMAP-{date}-{slug}/
106106
└── roadmap.md # ⭐ Single source of truth
107107
# - Strategy Assessment (embedded)
108108
# - Roadmap Table
@@ -120,7 +120,7 @@ Strategic requirement roadmap with **iterative decomposition**. Creates a single
120120
```markdown
121121
# Requirement Roadmap
122122

123-
**Session**: RMAP-{slug}-{date}
123+
**Session**: RMAP-{date}-{slug}
124124
**Requirement**: {requirement}
125125
**Strategy**: {progressive|direct}
126126
**Status**: {Planning|Refining|Ready}
@@ -253,7 +253,7 @@ Mode: Append-only (new issues appended to end)
253253
"tags": ["roadmap", "progressive|direct", "wave-N", "layer-name"],
254254
"extended_context": {
255255
"notes": {
256-
"session": "RMAP-{slug}-{date}",
256+
"session": "RMAP-{date}-{slug}",
257257
"strategy": "progressive|direct",
258258
"wave": 1,
259259
"depends_on_issues": []
@@ -321,7 +321,7 @@ const slug = requirement.toLowerCase()
321321
.replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
322322
.substring(0, 40)
323323
const dateStr = getUtc8ISOString().substring(0, 10)
324-
const sessionId = `RMAP-${slug}-${dateStr}`
324+
const sessionId = `RMAP-${dateStr}-${slug}`
325325
const sessionFolder = `.workflow/.roadmap/${sessionId}`
326326

327327
// Auto-detect continue
@@ -628,11 +628,11 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
628628
```markdown
629629
## Roadmap Complete
630630

631-
- **Session**: RMAP-{slug}-{date}
631+
- **Session**: RMAP-{date}-{slug}
632632
- **Strategy**: {progressive|direct}
633633
- **Issues Created**: {count} across {waves} waves
634634
- **Refinement Rounds**: {N}
635-
- **Roadmap**: .workflow/.roadmap/RMAP-{slug}-{date}/roadmap.md
635+
- **Roadmap**: .workflow/.roadmap/RMAP-{date}-{slug}/roadmap.md
636636

637637
| Wave | Issue Count | Layer/Type |
638638
|------|-------------|------------|
@@ -677,7 +677,7 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
677677
| `-c, --continue` | false | Continue existing session |
678678
| `-m, --mode` | auto | Strategy: progressive / direct / auto |
679679

680-
**Session ID format**: `RMAP-{slug}-{YYYY-MM-DD}`
680+
**Session ID format**: `RMAP-{YYYY-MM-DD}-{slug}`
681681

682682
## Error Handling
683683

.codex/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ ACE search_context (semantic) → smart_search (structured) → read_file (batch
110110
| Workflow | Directory | Summary File |
111111
|----------|-----------|-------------|
112112
| `workflow-plan` | `.workflow/active/WFS-*/` | `workflow-session.json` |
113-
| `workflow-lite-plan` | `.workflow/.lite-plan/{slug}-{date}/` | `plan.json` |
113+
| `workflow-lite-plan` | `.workflow/.lite-plan/{date}-{slug}/` | `plan.json` |
114114
| `analyze-with-file` | `.workflow/.analysis/ANL-*/` | `conclusions.json` |
115115
| `multi-cli-plan` | `.workflow/.multi-cli-plan/*/` | `session-state.json` |
116116
| `lite-fix` | `.workflow/.lite-fix/*/` | `fix-plan.json` |

.codex/agents/debug-explore-agent.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Phase 5: Fix & Verification
3939
```javascript
4040
const bugSlug = bug_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 30)
4141
const dateStr = new Date().toISOString().substring(0, 10)
42-
const sessionId = `DBG-${bugSlug}-${dateStr}`
42+
const sessionId = `DBG-${dateStr}-${bugSlug}`
4343
const sessionFolder = `.workflow/.debug/${sessionId}`
4444
const debugLogPath = `${sessionFolder}/debug.log`
4545
```
@@ -115,12 +115,12 @@ CONSTRAINTS: Focus on testable conditions
115115
116116
**NDJSON Log Format**:
117117
```json
118-
{"sid":"DBG-xxx-2025-01-06","hid":"H1","loc":"file.py:func:42","msg":"Check value","data":{"key":"value"},"ts":1736150400000}
118+
{"sid":"DBG-2025-01-06-xxx","hid":"H1","loc":"file.py:func:42","msg":"Check value","data":{"key":"value"},"ts":1736150400000}
119119
```
120120
121121
| Field | Description |
122122
|-------|-------------|
123-
| `sid` | Session ID (DBG-slug-date) |
123+
| `sid` | Session ID (DBG-date-slug) |
124124
| `hid` | Hypothesis ID (H1, H2, ...) |
125125
| `loc` | File:function:line |
126126
| `msg` | What's being tested |
@@ -315,7 +315,7 @@ Write(file_path, cleaned)
315315
## Session Structure
316316
317317
```
318-
.workflow/.debug/DBG-{slug}-{date}/
318+
.workflow/.debug/DBG-{date}-{slug}/
319319
├── debug.log # NDJSON log (primary artifact)
320320
├── hypotheses.json # Generated hypotheses (optional)
321321
└── resolution.md # Summary after fix (optional)

.codex/skills/analyze-with-file/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analys
5454
| `--continue` | false | Continue existing session |
5555
| `--depth` | standard | Analysis depth: quick / standard / deep |
5656

57-
**Session ID format**: `ANL-{slug}-{YYYY-MM-DD}`
57+
**Session ID format**: `ANL-{YYYY-MM-DD}-{slug}`
5858
- slug: lowercase, alphanumeric + CJK characters, max 40 chars
5959
- date: YYYY-MM-DD (UTC+8)
6060
- Auto-detect continue: session folder + discussion.md exists → continue mode
@@ -64,7 +64,7 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analys
6464
```
6565
Step 0: Session Setup
6666
├─ Parse topic, flags (--depth, --continue, -y)
67-
├─ Generate session ID: ANL-{slug}-{date}
67+
├─ Generate session ID: ANL-{date}-{slug}
6868
├─ Create session folder (or detect existing → continue mode)
6969
└─ Initialize progress tracking: functions.update_plan([...phases])
7070
@@ -208,7 +208,7 @@ const projectRoot = functions.exec_command('git rev-parse --show-toplevel 2>/dev
208208

209209
const slug = topic.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
210210
const dateStr = getUtc8ISOString().substring(0, 10)
211-
const sessionId = `ANL-${slug}-${dateStr}`
211+
const sessionId = `ANL-${dateStr}-${slug}`
212212
const sessionFolder = `${projectRoot}/.workflow/.analysis/${sessionId}`
213213

214214
// Auto-detect continue: session folder + discussion.md exists → continue mode
@@ -1031,7 +1031,7 @@ Remaining questions or areas for investigation
10311031
### Output Structure
10321032
10331033
```
1034-
{projectRoot}/.workflow/.analysis/ANL-{slug}-{date}/
1034+
{projectRoot}/.workflow/.analysis/ANL-{date}-{slug}/
10351035
├── discussion.md # Evolution of understanding & discussions
10361036
├── exploration-codebase.json # Phase 2: Codebase context
10371037
├── research.json # Phase 2: External research findings (if topic warrants)

0 commit comments

Comments
 (0)