Commit 73c7589
fix: auto-detect newest docs/security run directory in tachi commands
When invoked without an input/target directory argument, the four
downstream tachi commands (tachi.risk-score, tachi.compensating-controls,
tachi.infographic, tachi.security-report) defaulted to current working
directory. Users running these from a project root with multiple
timestamped runs in docs/security/ would silently miss their data.
New behavior — applied consistently across all four commands:
- If ./docs/security/ exists in cwd: glob docs/security/*/, sort
directory names descending (ISO-like YYYY-MM-DDTHH-MM-SS timestamps
sort correctly as strings), and select the newest directory containing
the required artifact:
* tachi.risk-score → threats.md or threats.sarif
* tachi.compensating-controls → risk-scores.md or risk-scores.sarif
* tachi.infographic → compensating-controls.md, risk-scores.md, or threats.md
* tachi.security-report → threats.md (minimum required)
- Display: "Auto-detected input/target: {path}"
- Otherwise: fall back to cwd (existing default preserved)
Backward compatible — explicit path argument continues to override.
The tachi.infographic change also fixes a redundant "Set
data_source_dir to current working directory" line that ran after
the per-file path resolution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 31e775a commit 73c7589
File tree
4 files changed
+18
-10
lines changed- .claude/commands
4 files changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | | - | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
0 commit comments