Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ src/collectors/config.js — Firebase env key presence check (never exposes val
## V1 scope (what's done)
Detect framework → prompt for error → collect build/git/config → format → clipboard.

## V2 scope (from plan + security docs)
- `--no-build` flag to skip npm run build
- Confirmation prompt before build check (opt-in instead of auto)
- `--no-primer` flag to omit the embedded `<!-- Claude: ... -->` comment
- Hardened input validation (graceful failures, not crashes)
## V2 scope (complete as of 2026-03-25)
- `--no-build` flag to skip npm run build
- Confirmation prompt before build check (opt-in instead of auto)
- `--no-primer` flag to omit the embedded `<!-- Claude: ... -->` comment
- Hardened input validation (graceful failures, not crashes)

## V3 parking lot (explicitly not V1 or V2)
- Code-level context: read actual file lines from stack trace references
Expand Down
12 changes: 12 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SKILL.md — devdump session state

## V2 status (as of 2026-03-25)
All V2 scope items complete:
- ✅ `--no-build` flag (bin/index.js)
- ✅ Confirmation prompt before build check — "Run build check? (~30s) [Y/n]:" (bin/index.js); `--no-build` bypasses prompt entirely
- ✅ `--no-primer` flag — omits `<!-- Claude: ... -->` comment from output (bin/index.js + src/format.js)
- ✅ Hardened input validation — try/catch on all collectors, 2-attempt retry in prompt.js

## Ready for
- V3 features (parking lot in CLAUDE.md)
- Pre-publish checklist (remove PLAN.md, SECURITY.md before going public)
18 changes: 16 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import readline from 'readline';
import { execSync } from 'child_process';
import { existsSync } from 'fs';
import { join } from 'path';
Expand Down Expand Up @@ -29,7 +30,20 @@ console.log(`Detected: ${framework}${firebase ? ' + Firebase' : ''}`);
// Step 2: Prompt for console error (highest value — ask first)
const { error, filePaths } = await promptForError();

const skipBuild = process.argv.includes('--no-build');
let skipBuild = process.argv.includes('--no-build');
const skipPrimer = process.argv.includes('--no-primer');

// Confirmation prompt before slow build check
if (!skipBuild) {
const runBuild = await new Promise(resolve => {
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.question('Run build check? (~30s) [Y/n]: ', answer => {
rl.close();
resolve(answer === '' || answer.toLowerCase() === 'y');
});
});
if (!runBuild) skipBuild = true;
}

// Step 3: Auto-collect (runs after user input)
console.log('\n⏳ Collecting diagnostics...');
Expand All @@ -54,7 +68,7 @@ try {
} catch {}

// Step 4: Format
const output = formatOutput({ error, filePaths, build, git, configCommits, config, env: envLine });
const output = formatOutput({ error, filePaths, build, git, configCommits, config, env: envLine, primer: !skipPrimer });

// Step 5: Copy to clipboard + print
console.log('\n' + '─'.repeat(50));
Expand Down
4 changes: 2 additions & 2 deletions src/format.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function formatOutput({ error, filePaths, build, git, configCommits, config, env }) {
export function formatOutput({ error, filePaths, build, git, configCommits, config, env, primer = true }) {
const lines = [];

lines.push('## devdump');
Expand Down Expand Up @@ -73,7 +73,7 @@ export function formatOutput({ error, filePaths, build, git, configCommits, conf
lines.push('');

// Embedded instruction (invisible to most readers, visible to Claude)
lines.push('<!-- Claude: read every file before editing. No exceptions. -->');
if (primer) lines.push('<!-- Claude: read every file before editing. No exceptions. -->');

return lines.join('\n');
}