From customgpt-ai-rag
Ask a plain-language question to your CustomGPT.ai agent and get an AI-generated answer with listed sources. Warns if files have changed since last upload.
How this skill is triggered — by the user, by Claude, or both
Slash command
/customgpt-ai-rag:ask-agentThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ask a plain-language question about your project. Returns an AI-generated answer grounded in your files, with listed sources.
Ask a plain-language question about your project. Returns an AI-generated answer grounded in your files, with listed sources.
.customgpt-meta.json to get agent_id — never hardcode it/check-status firstFollow the lookup procedure in skills/_shared/api-key.md. Store the result as $API_KEY.
Walk up from $PWD toward /, looking for .customgpt-meta.json. Extract agent_id, indexed_folder, and included_paths.
If not found:
"No agent found in this directory tree. Run
/create-agentto set one up first."
Check whether any files in the included paths were modified after the meta file's timestamp. For each path in included_paths (resolved relative to indexed_folder):
find "${indexed_folder}/${path}" -newer "${META_FILE_PATH}" -type f -not -path "*/.git/*" -not -path "*/node_modules/*"
If included_paths is missing or ["."], check indexed_folder itself.
If any files are newer, inform the user before proceeding:
"Note: {N} file(s) have changed since the last upload. Results may not reflect the latest changes. Run
/update-agentto sync the changed files, or I'll continue with the current data."
Then continue regardless — do not stop.
If the user provided a question with the command, use it directly.
Otherwise ask:
"What would you like to search for?"
curl -s --request POST \
--url "https://app.customgpt.ai/api/v1/projects/${AGENT_ID}/conversations" \
--header "Authorization: Bearer ${API_KEY}" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data "name=Claude+Code+Query"
Read the response and extract data.session_id as $SESSION_ID.
If the response indicates the agent has no content or is not ready, tell the user:
"The agent has no processed content yet. Run
/check-statusto see processing progress."
curl -s --request POST \
--url "https://app.customgpt.ai/api/v1/projects/${AGENT_ID}/conversations/${SESSION_ID}/messages" \
--header "Authorization: Bearer ${API_KEY}" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "prompt=${QUESTION}" \
--data "stream=false"
Read the response and extract:
data.openai_response — the AI-generated answerIf openai_response is empty or null, the agent may still be processing. Tell the user:
"The agent returned an empty response. Your files may still be processing — run
/check-statusto verify, then try again."
Prepare the output:
Answer
Use the {openai_response} to build the response, depending on what user prompted.
Sources
Use files listed in {openai_response} to build the table of sources in this format:
| # | Source |
|---|---|
| 1 | {title or filename} |
| 2 | ... |
If sources are not present:
"No specific sources are provided. Agent either couldn't find the requested items, or it may still be processing your files. Run
/check-statusto confirm processing is complete."
After displaying results, consider whether any cited files are relevant to the current task. If so, use the Read tool to open them for full context before making code changes.
npx claudepluginhub poll-the-people/customgpt-for-claude-code --plugin customgpt-ai-ragGuides bootstrapping, updating, and reviewing AGENTS.md for effective agent memory: structure sections, signal vs noise filtering, prune stale entries.
Validates and evolves AGENTS.md to ensure AI agents have accurate project context. Use after code changes, onboarding, or periodically.