What
Add database migration tool detection to the scanner. When a repo uses Prisma, Drizzle, Alembic, Rails migrations, etc., report it in the scan results.
Why
Database tools are architecturally significant — they define the data model. Knowing "this project uses Prisma with 8 models" gives Claude important context for writing skills.
How
Edit src/lib/scanner.js. Add a detectDatabaseTools(repoPath) function that checks for these files:
| Tool |
Detection Signal |
| Prisma |
prisma/schema.prisma |
| Drizzle |
drizzle.config.ts or drizzle.config.js or drizzle/ directory |
| TypeORM |
ormconfig.json or ormconfig.ts or ormconfig.js |
| Sequelize |
.sequelizerc or config/config.json with Sequelize patterns |
| Knex |
knexfile.js or knexfile.ts |
| Alembic |
alembic.ini and alembic/versions/ directory |
| Django migrations |
Any */migrations/ directory inside a directory containing models.py |
| ActiveRecord (Rails) |
db/migrate/ directory |
| Flyway |
db/migration/ with files matching V*.sql |
| golang-migrate |
migrations/ with files matching *.up.sql |
All checks are existsSync() calls. For Prisma, you can optionally count models by grepping schema.prisma for lines matching ^model\s+\w+.
Implementation steps
-
Add detectDatabaseTools(repoPath) to src/lib/scanner.js:
function detectDatabaseTools(repoPath) {
const detected = [];
if (existsSync(join(repoPath, 'prisma', 'schema.prisma'))) {
detected.push('prisma');
}
if (existsSync(join(repoPath, 'drizzle.config.ts')) ||
existsSync(join(repoPath, 'drizzle.config.js'))) {
detected.push('drizzle');
}
if (existsSync(join(repoPath, 'alembic.ini'))) {
detected.push('alembic');
}
if (existsSync(join(repoPath, 'db', 'migrate'))) {
detected.push('activerecord');
}
// ... etc
return detected;
}
-
Call from scanRepo(): result.database = detectDatabaseTools(repoPath);
-
Display in src/commands/scan.js:
if (result.database && result.database.length > 0) {
console.log(pc.cyan(' Database: ') + result.database.join(', '));
}
-
Add tests in tests/scanner.test.js:
describe('database tool detection', () => {
it('detects Prisma', () => {
const dir = createFixture('db-prisma', {
'prisma/schema.prisma': 'model User { id Int @id }',
});
const scan = scanRepo(dir);
expect(scan.database).toContain('prisma');
});
it('detects Alembic', () => {
const dir = createFixture('db-alembic', {
'alembic.ini': '[alembic]',
});
const scan = scanRepo(dir);
expect(scan.database).toContain('alembic');
});
});
Files to change
src/lib/scanner.js — add detectDatabaseTools(), call from scanRepo()
src/commands/scan.js — display in output
tests/scanner.test.js — add tests
Acceptance criteria
What
Add database migration tool detection to the scanner. When a repo uses Prisma, Drizzle, Alembic, Rails migrations, etc., report it in the scan results.
Why
Database tools are architecturally significant — they define the data model. Knowing "this project uses Prisma with 8 models" gives Claude important context for writing skills.
How
Edit
src/lib/scanner.js. Add adetectDatabaseTools(repoPath)function that checks for these files:prisma/schema.prismadrizzle.config.tsordrizzle.config.jsordrizzle/directoryormconfig.jsonorormconfig.tsorormconfig.js.sequelizercorconfig/config.jsonwith Sequelize patternsknexfile.jsorknexfile.tsalembic.iniandalembic/versions/directory*/migrations/directory inside a directory containingmodels.pydb/migrate/directorydb/migration/with files matchingV*.sqlmigrations/with files matching*.up.sqlAll checks are
existsSync()calls. For Prisma, you can optionally count models by greppingschema.prismafor lines matching^model\s+\w+.Implementation steps
Add
detectDatabaseTools(repoPath)tosrc/lib/scanner.js:Call from
scanRepo():result.database = detectDatabaseTools(repoPath);Display in
src/commands/scan.js:Add tests in
tests/scanner.test.js:Files to change
src/lib/scanner.js— adddetectDatabaseTools(), call fromscanRepo()src/commands/scan.js— display in outputtests/scanner.test.js— add testsAcceptance criteria
npm testpassesaspens scandisplays detected database tools