Verify Database
Check that the database directory and index file exist and are properly structured.
Use TaskCreate to create a task for each step below, then execute them in order. Mark each task in_progress when starting and completed when done using TaskUpdate.
Step 1: Check Database Directory
Use the Bash tool to check if the database/ directory exists:
bash
[ -d "database" ] && echo "EXISTS" || echo "MISSING"
If the output is "MISSING":
- •Report to the caller: "Database not initialized. Use the
db-initskill to create it." - •STOP execution. Do not proceed to further steps.
Step 2: Check Index File
Use the Read tool to read database/index.md.
If the file does not exist or returns an error:
- •Report to the caller: "Database index is missing. Use the
db-initskill to reinitialize." - •STOP execution. Do not proceed to further steps.
Step 3: Validate Index Structure
Verify the index file contains the expected structure:
- •Should have a
# Database Indexheading - •Should have a
## Documentssection
If the structure is malformed:
- •Report to the caller: "Database index is malformed. Consider reinitializing with
db-init." - •STOP execution.
Step 4: Report Success
If all checks pass, report to the caller: "Database verified and ready."