@lhi/tdd-audit 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/index.js +15 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ node index.js
|
|
|
34
34
|
| `--claude` | Use `.claude/` instead of `.agents/` as the skill directory |
|
|
35
35
|
| `--with-hooks` | Install a pre-commit hook that blocks commits if security tests fail |
|
|
36
36
|
| `--skip-scan` | Skip the automatic vulnerability scan on install |
|
|
37
|
+
| `--scan-only` | Run the vulnerability scan without installing anything |
|
|
37
38
|
|
|
38
39
|
**Install to a Claude Code project with pre-commit protection:**
|
|
39
40
|
```bash
|
package/index.js
CHANGED
|
@@ -9,13 +9,16 @@ const isLocal = args.includes('--local');
|
|
|
9
9
|
const isClaude = args.includes('--claude');
|
|
10
10
|
const withHooks = args.includes('--with-hooks');
|
|
11
11
|
const skipScan = args.includes('--skip-scan');
|
|
12
|
+
const scanOnly = args.includes('--scan-only');
|
|
12
13
|
|
|
13
14
|
const agentBaseDir = isLocal ? process.cwd() : os.homedir();
|
|
14
15
|
const agentDirName = isClaude ? '.claude' : '.agents';
|
|
15
16
|
const projectDir = process.cwd();
|
|
16
17
|
|
|
17
18
|
const targetSkillDir = path.join(agentBaseDir, agentDirName, 'skills', 'tdd-remediation');
|
|
18
|
-
const targetWorkflowDir =
|
|
19
|
+
const targetWorkflowDir = isClaude
|
|
20
|
+
? path.join(agentBaseDir, agentDirName, 'commands')
|
|
21
|
+
: path.join(agentBaseDir, agentDirName, 'workflows');
|
|
19
22
|
|
|
20
23
|
// ─── 1. Framework Detection ──────────────────────────────────────────────────
|
|
21
24
|
|
|
@@ -127,7 +130,17 @@ function printFindings(findings) {
|
|
|
127
130
|
console.log('\n Run /tdd-audit in your agent to remediate.\n');
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
// ─── 4.
|
|
133
|
+
// ─── 4. Scan-only early exit ──────────────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
if (scanOnly) {
|
|
136
|
+
process.stdout.write('\n🔍 Scanning for vulnerability patterns...');
|
|
137
|
+
const findings = quickScan();
|
|
138
|
+
process.stdout.write('\n');
|
|
139
|
+
printFindings(findings);
|
|
140
|
+
process.exit(0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ─── 5. Install Skill Files ───────────────────────────────────────────────────
|
|
131
144
|
|
|
132
145
|
console.log(`\nInstalling TDD Remediation Skill (${isLocal ? 'local' : 'global'}, framework: ${framework}, test dir: ${testBaseDir}/)...\n`);
|
|
133
146
|
|
package/package.json
CHANGED