Skip to content

Commit 6f66420

Browse files
montfortclaude
andauthored
fix: use devtrail analyze instead of line-count heuristic in devtrail-status skill (#42)
The skill was using an outdated >10 lines rule to trigger AILOG documentation. Now uses `devtrail analyze --output json` (cognitive complexity, threshold 8) as the primary method, with >20 lines fallback when CLI is unavailable, matching the canonical rule in AGENT-RULES.md and the devtrail-new skill. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9a2bcb9 commit 6f66420

3 files changed

Lines changed: 34 additions & 10 deletions

File tree

dist/.agent/workflows/devtrail-status.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ Filter to show only files that might need documentation:
5050
- Exclude: `*.md`, `*.json`, `*.yml`, `*.yaml`, `*.lock`, `package-lock.json`
5151
- Include: `*.ts`, `*.js`, `*.tsx`, `*.jsx`, `*.py`, `*.go`, `*.rs`, `*.java`, `*.cs`, `*.rb`, `*.php`
5252

53+
Run complexity analysis on modified source files:
54+
55+
```bash
56+
# Analyze complexity of changed files (primary method for AILOG trigger)
57+
devtrail analyze --output json 2>/dev/null
58+
# If CLI unavailable, fall back to line count heuristic in step 3
59+
```
60+
5361
### 3. Analyze Documentation Gaps
5462

5563
For each modified source file, check if there's a corresponding DevTrail document:
56-
- Files with >10 lines of changes in business logic folders should have an AILOG
64+
- Complex code (`devtrail analyze` reports `summary.above_threshold > 0`; **fallback** if CLI unavailable: >20 lines of business logic) should have an AILOG
5765
- Security-related files (auth, crypto, secrets) should have a SEC assessment
5866
- Architecture/structural changes should have an ADR
5967
- AI/ML model changes should have a MCARD
@@ -75,8 +83,8 @@ Recent Documents (last hour):
7583
✅ AIDEC-2025-01-27-001-auth-strategy.md
7684
7785
Modified Files Without Documentation:
78-
⚠️ src/auth/login.ts (47 lines changed)
79-
⚠️ src/api/users.ts (23 lines changed)
86+
⚠️ src/auth/login.ts (cognitive: 12, threshold: 8)
87+
⚠️ src/api/users.ts (cognitive: 9, threshold: 8)
8088
8189
Summary:
8290
Documents created: 2

dist/.claude/skills/devtrail-status/SKILL.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: devtrail-status
33
description: Show DevTrail documentation status. Use to verify if AI agents properly documented their changes.
4-
allowed-tools: Read, Glob, Bash(git diff *, git log *, git status *, date *)
4+
allowed-tools: Read, Glob, Bash(git diff *, git log *, git status *, date *, devtrail analyze *)
55
---
66

77
# DevTrail Status Skill
@@ -52,10 +52,18 @@ Filter to show only files that might need documentation:
5252
- Exclude: `*.md`, `*.json`, `*.yml`, `*.yaml`, `*.lock`, `package-lock.json`
5353
- Include: `*.ts`, `*.js`, `*.tsx`, `*.jsx`, `*.py`, `*.go`, `*.rs`, `*.java`, `*.cs`, `*.rb`, `*.php`
5454

55+
Run complexity analysis on modified source files:
56+
57+
```bash
58+
# Analyze complexity of changed files (primary method for AILOG trigger)
59+
devtrail analyze --output json 2>/dev/null
60+
# If CLI unavailable, fall back to line count heuristic in step 3
61+
```
62+
5563
### 3. Analyze Documentation Gaps
5664

5765
For each modified source file, check if there's a corresponding DevTrail document:
58-
- Files with >10 lines of changes in business logic folders should have an AILOG
66+
- Complex code (`devtrail analyze` reports `summary.above_threshold > 0`; **fallback** if CLI unavailable: >20 lines of business logic) should have an AILOG
5967
- Security-related files (auth, crypto, secrets) should have a SEC assessment
6068
- Architecture/structural changes should have an ADR
6169
- AI/ML model changes should have a MCARD
@@ -77,8 +85,8 @@ Recent Documents (last hour):
7785
[checkmark] AIDEC-2025-01-27-001-auth-strategy.md
7886
7987
Modified Files Without Documentation:
80-
[warning] src/auth/login.ts (47 lines changed)
81-
[warning] src/api/users.ts (23 lines changed)
88+
[warning] src/auth/login.ts (cognitive: 12, threshold: 8)
89+
[warning] src/api/users.ts (cognitive: 9, threshold: 8)
8290
8391
Summary:
8492
Documents created: 2

dist/.gemini/skills/devtrail-status/SKILL.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,18 @@ Filter to show only files that might need documentation:
5151
- Exclude: `*.md`, `*.json`, `*.yml`, `*.yaml`, `*.lock`, `package-lock.json`
5252
- Include: `*.ts`, `*.js`, `*.tsx`, `*.jsx`, `*.py`, `*.go`, `*.rs`, `*.java`, `*.cs`, `*.rb`, `*.php`
5353

54+
Run complexity analysis on modified source files:
55+
56+
```bash
57+
# Analyze complexity of changed files (primary method for AILOG trigger)
58+
devtrail analyze --output json 2>/dev/null
59+
# If CLI unavailable, fall back to line count heuristic in step 3
60+
```
61+
5462
### 3. Analyze Documentation Gaps
5563

5664
For each modified source file, check if there's a corresponding DevTrail document:
57-
- Files with >10 lines of changes in business logic folders should have an AILOG
65+
- Complex code (`devtrail analyze` reports `summary.above_threshold > 0`; **fallback** if CLI unavailable: >20 lines of business logic) should have an AILOG
5866
- Security-related files (auth, crypto, secrets) should have a SEC assessment
5967
- Architecture/structural changes should have an ADR
6068
- AI/ML model changes should have a MCARD
@@ -76,8 +84,8 @@ Recent Documents (last hour):
7684
✅ AIDEC-2025-01-27-001-auth-strategy.md
7785
7886
Modified Files Without Documentation:
79-
⚠️ src/auth/login.ts (47 lines changed)
80-
⚠️ src/api/users.ts (23 lines changed)
87+
⚠️ src/auth/login.ts (cognitive: 12, threshold: 8)
88+
⚠️ src/api/users.ts (cognitive: 9, threshold: 8)
8189
8290
Summary:
8391
Documents created: 2

0 commit comments

Comments
 (0)