Research checklist discipline

From CarlosCaPe/octorato · View interactive version

Research checklist discipline is an AI agent skill from the GitHub repository CarlosCaPe/octorato. Research Checklist Discipline

How to use this skill

Skill file

Research Checklist Discipline

Scope: This skill is the pre-build step — run BEFORE writing SQL.

Skill #08 (Deep Grep Code Review) is the verification step run DURING

code review to confirm this checklist was done correctly.

What

A mandatory pre-build verification process that ensures ALL affected database

objects have been identified before writing a single line of SQL.

Why

Assumptions and ticket descriptions are unreliable. The only trustworthy source

is the database itself (via DDL snapshots and catalog queries). This checklist

forces the author to mechanically verify scope before building, not after.

When this step was skipped in DA-102, a 4th procedure (GetNewApplicants) was

missed and only caught later during code review (Skill #08).

How

Before building any DDL script:

1. List ALL related procedures -- not just the ones with obvious names:

Get-ChildItem -Recurse -Filter "*.sql" -Path database/postgresql/**/Procedures/ |
    Select-String -Pattern 'Applicant' |
    Select-Object -Property Filename -Unique

2. Search with QUOTED column names -- catches actual SQL references:

Get-ChildItem -Recurse -Filter "*.sql" -Path database/postgresql/**/Procedures/ |
    Select-String -Pattern '"VertirnaryTechOrAssistant"'

3. Count and verify -- if you expect N procedures, verify you found N:

Expected: 3 procedures (from Jira)
Found:    4 procedures (from grep)
Action:   Investigate the extra one!

4. Cross-check environments -- DEV and QA should have the same procedures:

# List procedure files in both environments
$dev = Get-ChildItem database/postgresql/dev/**/Procedures/*.sql | Select-Object Name
$qa  = Get-ChildItem database/postgresql/qa/**/Procedures/*.sql | Select-Object Name
Compare-Object $dev $qa -Property Name

5. Document the full list in the script header:

/*
 * Affected procedures:
 *   - AddApplicant       (INSERT column list)
 *   - GetApplicant       (SELECT lists, 4 branches)
 *   - GetAllApplicants   (SELECT via CTE)
 *   - GetNewApplicants   (SELECT via CTE)   <-- found in deep grep
 */

The Root Cause

| Search Pattern | What It Catches | What It Misses |

|---|---|---|

| VertirnaryTechOrAssistant (unquoted) | Everything, including parameter names | May truncate in noisy output |

| "VertirnaryTechOrAssistant" (quoted) | Only SQL column references | Nothing -- this is the correct pattern |

When to Use

Where We Used It

GetNewApplicants miss was caught in Round 2 code review

Lesson

Trust grep, not memory. Trust quoted patterns, not unquoted ones.

Trust your count, not the ticket description.


Category: Process | Origin: DA-102

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.