Skip to content
Merged
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
20 changes: 15 additions & 5 deletions .agents/scripts/onboarding-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,13 @@
# Context7 is MCP-only, no auth needed
print_service "Context7" "ready" "MCP (no auth needed)"

# sqlite3 is required for memory system
# sqlite3 is required for memory system (FTS5 required for full-text search)
if is_installed "sqlite3"; then
print_service "sqlite3" "ready" "memory system ready"
if sqlite3 :memory: 'CREATE VIRTUAL TABLE t USING fts5(content);' &>/dev/null; then
print_service "sqlite3" "ready" "memory system ready"
else
print_service "sqlite3" "partial" "installed, missing FTS5 (required for memory)"
fi
else
print_service "sqlite3" "needs-setup" "required for memory system"
fi
Expand Down Expand Up @@ -1123,9 +1127,15 @@
is_installed "auggie" && json+='true' || json+='false'
json+=',"authenticated":'
is_cli_authenticated "auggie" && json+='true' || json+='false'
json+='},"sqlite3":{"installed":'
is_installed "sqlite3" && json+='true' || json+='false'
json+='}},'
local _sqlite3_installed=false _sqlite3_fts5=false
if is_installed "sqlite3"; then

Check warning on line 1131 in .agents/scripts/onboarding-helper.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of using the literal 'sqlite3' 5 times.

See more on https://sonarcloud.io/project/issues?id=marcusquinn_aidevops&issues=AZzrimaAt5t5DmIVmxn2&open=AZzrimaAt5t5DmIVmxn2&pullRequest=4730
_sqlite3_installed=true
sqlite3 :memory: 'CREATE VIRTUAL TABLE t USING fts5(content);' &>/dev/null && _sqlite3_fts5=true
fi
json+="},"
json+="$(jq -n --argjson inst "$_sqlite3_installed" --argjson fts5 "$_sqlite3_fts5" \
'"sqlite3":{"installed":$inst,"fts5":$fts5}')"
json+='},'

# Containers
json+='"containers":{'
Expand Down
10 changes: 2 additions & 8 deletions .agents/tools/build-agent/build-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,8 @@ Where agents reference `npm` or `npx`, consider if `bun` would be faster:
- Prefer `bunx` over `npx` for one-off executions

**Node.js-based helper scripts:**
If your helper script uses `node -e` with globally installed npm packages, add this near the top:

```bash
# Set NODE_PATH so Node.js can find globally installed modules
export NODE_PATH="$(npm root -g):$NODE_PATH"
```

This is required because Node.js doesn't automatically search the global npm prefix when using inline evaluation (`node -e`).
If your helper script uses `node -e` with globally installed npm packages, set `NODE_PATH` near the top of the script.
See `tools/build-agent/node-helpers.md:13` for the snippet and explanation.

### Information Quality (All Domains)

Expand Down
30 changes: 30 additions & 0 deletions .agents/tools/build-agent/node-helpers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Node.js Helper Script Patterns

Reference for common patterns used in Node.js-based helper scripts.

## NODE_PATH for globally installed npm packages

When a helper script uses `node -e` with globally installed npm packages, Node.js
does not automatically search the global npm prefix for inline evaluation. Set
`NODE_PATH` near the top of the script so CommonJS `require()` can resolve global
modules:

```bash
# Set NODE_PATH so Node.js can find globally installed modules
export NODE_PATH="$(npm root -g):$NODE_PATH"
```

This is required because `node -e` evaluates code in CommonJS mode, and without
`NODE_PATH` pointing at the global prefix, `require('some-global-package')` will
fail with `MODULE_NOT_FOUND` even when the package is installed globally.

> **Note:** `NODE_PATH` only affects CommonJS `require()`. ESM `import` specifiers
> are not resolved via `NODE_PATH` — use explicit paths or local installs for ESM.

## Prefer bun for performance

Where scripts reference `npm` or `npx`, consider `bun` for faster execution:

- `bun` is significantly faster for package operations
- Compatible with most npm packages
- Prefer `bunx` over `npx` for one-off executions
Loading