소스 정보
- 저장소
- jmagly/aiwg
- 최근 소스 활동
- 2026년 7월 20일 16:54
- 감지된 SKILL.md 언어
- 영어
- 스타
- 178
- 포크
- 26
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/jmagly/aiwg --skill rlm-query명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
WCAG accessibility analysis for color palettes including contrast ratios, compliance checking, and remediation suggestions. Use when user needs to verify colors meet accessibility standards.
Generate, analyze, compare, export, and suggest color palettes using color theory. Use when user asks about colors, palettes, color schemes, or needs help choosing colors for a project.
Research current color trends from Pantone, architecture, film, and design. Use when user asks about trending colors, popular palettes, or wants research-backed color inspiration.
SOC 직업 분류 기준
SKILL.md 표시 중
| namespace | aiwg |
| name | rlm-query |
| platforms | ["all"] |
| description | Spawn sub-agent to process focused context and return structured result |
| commandHint | {"argumentHint":"\"<context-file> <sub-prompt>\" [--model <model>] [--output <file>] [--depth <n>] [--neighbors-of <id>] [--direction <in|out|both>] [--graph <name>] [--no-cache] [--cache-only]","allowedTools":"Read, Write, Grep, Glob, Bash","model":"haiku","category":"rlm","modelRole":"efficiency","modelTier":"economy"} |
Spawn a focused sub-agent to process a specific portion of context and return a structured result. This is the command equivalent of RLM's llm_query() function.
Sub-agents receive ONLY the specified context, not the full conversation history. This prevents context overload and improves output quality by enforcing focused, single-purpose queries.
/rlm-query <context-file> <sub-prompt>
/rlm-query <glob-pattern> <sub-prompt> --output result.txt
/rlm-query file.ts "extract all function names" --model haiku
/rlm-query "src/**/*.test.js" "count total assertions" --depth 2
File path or glob pattern specifying the context source.
Valid patterns:
src/auth/login.tssrc/**/*.test.tssrc/auth/*.tsContext loading:
The specific task for the sub-agent. Should be:
Good sub-prompts:
Poor sub-prompts (avoid):
Override the default model for the sub-agent.
Available models:
opus - Highest capability (expensive, for complex analysis)sonnet - Balanced (default for most queries)haiku - Fast and cheap (for simple extraction)Model selection guidance (per REF-089 Appendix B; GRADE: LOW, peer-review pending):
haiku for: counting, extracting simple patterns, yes/no questionssonnet for: summarization, moderate analysis, code reviewopus for: complex reasoning, architectural decisions, multi-step analysisRLM root vs sub-agent: When rlm-query itself dispatches sub-calls (recursion via --depth >1), the root agent should be coding-capable (sonnet or opus). Per REF-089, "Qwen3-8B (non-coder) struggled without sufficient coding capabilities." Sub-agents performing simple extraction can safely be haiku; sub-agents performing analysis or synthesis should be sonnet or higher.
Output token limits: RLM root agents emit code, which can be verbose. Models with output token limits below 4k will underperform. Surface a warning when the configured model has lower limits.
Save the sub-agent's response to a file instead of returning inline.
Use cases:
Behavior:
rlm-query callsResolve the context source from the artifact index's dependency graph instead of from a glob pattern. Pass an artifact ID (path or REF-XXX identifier) — the skill resolves its neighbors and dispatches the sub-prompt over them.
Requires: aiwg index capability available (built and reachable). When the index is unavailable, the skill errors with a remediation pointer.
Resolution:
# At depth=1 (default), maps directly to the index CLI:
aiwg index neighbors --graph <graph> --node <id> --direction <dir> --json
# At depth >1, the skill expands recursively by calling neighbors on each
# result up to <N> hops, deduplicating along the way.
Restrict which side of the dependency graph to traverse. Defaults to both. Aligns with the aiwg index neighbors CLI direction flag.
in — upstream (artifacts that depend on the node)out — downstream (artifacts the node depends on)both — both directions (default)Which dependency graph to query. Defaults to project. Valid values match the aiwg index neighbors --graph flag (e.g., framework, project, codebase, or a user-defined graph name).
Bypass the result cache: do not read existing cache entries, but still write the result for future calls. Use to force a re-run when you suspect external state has changed in a way the cache key would not capture.
Read-only audit: error out if the call would not be a cache hit. Useful to verify reproducibility before committing or to gauge what re-running would cost.
When --neighbors-of is set, controls graph traversal depth (default: 1). Otherwise tracks current recursion depth (internal use).
Purpose:
Recursion limit: Maximum depth of 3 levels
These flags are reserved in the design but not yet implemented. Tracked in Gitea #1201.
--save-trajectory <path> — Persist a structured trajectory of the dispatch + sub-agent result suitable for offline analysis or future fine-tuning. Format: JSON Lines with one entry per call. REF-089 (p. 5) reports a 28.3% performance improvement from 1,000 trajectory samples for fine-tuning RLM-specialized models. When implemented, this flag will be added to argumentHint and become enforceable by the canonical command surface contract test.Argument resolution — pick the context-source axis from the parsed flags:
If --neighbors-of <id> is present (graph-bounded; #1206):
aiwg index is available. Run aiwg index stats --json once; on failure, error with "neighbors-of requires aiwg index — run aiwg index build first".aiwg index neighbors --graph "${graph:-project}" \
--node "<id>" \
--direction "${direction:-both}" \
--json
--depth N (N > 1): expand iteratively. For each new neighbor, run the same aiwg index neighbors call; deduplicate by node id; stop after N hops or when the frontier is empty.aiwg index query --id <id> --json (or use the path field returned by neighbors directly when present).aiwg index query "<id>".Else if a glob pattern or single path is supplied:
find / glob semanticsRead all resolved files into memory.
Cache lookup (#1203, unless --no-cache):
aiwg index query --id <id> --json)CacheKey = { inputs[], query, subPrompt, model, aggregateStrategy } and call computeHash(key) (src/rlm/cache/hash.ts)aiwg rlm-cache reports a hit (get(root, hash) succeeds): return the cached result.json immediately and log cache_hit=true in the cost report. Skip dispatch.--cache-only: error with the hash and exit non-zero.Communication:
Context source: {neighbors-of <id> @ depth N | pattern}
Matched files: {count}
Total size: {size} tokens
Spawning sub-agent with {model}...
Sub-agent receives:
Context:
{file contents}
Task:
{sub-prompt}
Instructions:
- Focus only on the provided context
- Output in the requested format
- Do not reference external information
- Be concise and specific
If --output specified:
Otherwise:
Communication:
Sub-agent completed.
Model: {model}
Duration: {time}
Result:
{response}
OR
Result saved to: {output-file}
/rlm-query works seamlessly with /rlm-batch for parallel fan-out:
# Fan-out: Query multiple files in parallel
/rlm-batch "src/components/*.tsx" "/rlm-query {file} 'extract props interface'"
# Fan-in: Aggregate results
/rlm-query "results/*.json" "combine all JSON arrays into single array"
See @$AIWG_ROOT/agentic/code/addons/rlm/commands/rlm-batch.md for batch processing patterns.
Error: Context exceeds safe limit
Pattern: src/**/*.ts
Matched files: 87
Total size: 120k tokens (60% of window)
Suggestion:
1. Use more specific glob: src/auth/**/*.ts
2. Split into multiple queries: /rlm-batch
3. Use haiku model (larger window)
Error: No files matched pattern
Pattern: src/**/*.test.ts
Matches: 0
Verify:
1. Pattern syntax is correct
2. Files exist at specified path
3. Working directory is correct
Error: Maximum recursion depth exceeded
Current depth: 3
Limit: 3
A sub-agent cannot spawn more sub-queries at this depth.
Consider restructuring query chain to be less nested.
Error: Sub-agent failed to complete query
Model: sonnet
Error: {error message}
Options:
1. Retry with different model: --model opus
2. Simplify sub-prompt
3. Reduce context size
At start:
RLM Query: Spawning sub-agent
Context: {pattern} ({count} files, {size} tokens)
Prompt: {sub-prompt}
Model: {model}
Depth: {depth}
Processing...
On completion:
─────────────────────────────────────────
RLM Query: Complete
─────────────────────────────────────────
Duration: {time}
Model: {model} ({tokens} tokens)
{response OR "Result saved to: {file}"}
On error:
─────────────────────────────────────────
RLM Query: Failed
─────────────────────────────────────────
Error: {error summary}
Context: {pattern}
Model: {model}
{Suggestions for resolution}
Good:
# Focused single file
/rlm-query src/auth/login.ts "extract exported functions"
# Specific subset
/rlm-query "src/auth/*.ts" "list all interfaces"
Bad:
# Too broad (hundreds of files)
/rlm-query "src/**/*" "analyze everything"
# Unfocused multi-file
/rlm-query "**/*.{ts,js,tsx,jsx,json,md}" "find issues"
Good:
# Clear output format
"extract function names as JSON array"
# Specific task
"count total test cases and return integer"
# Bounded scope
"summarize function purpose in one sentence"
Bad:
# Vague
"look at this code"
# Multi-task
"analyze, refactor, and document this code"
# Unbounded
"tell me everything about this"
| Query Type | Model | Rationale |
|---|---|---|
| Count items | haiku | Fast extraction |
| Extract pattern | haiku | Simple regex/parsing |
| Summarize | sonnet | Balanced quality/cost |
| Analyze complexity | sonnet | Moderate reasoning |
| Architectural review | opus | Complex reasoning |
| Security audit | opus | High-stakes analysis |
Return inline (default):
Use --output:
Task: Extract all exported function names from an auth module.
/rlm-query src/auth/helpers.ts "extract all exported function names as JSON array" --model haiku
Sub-agent receives:
Context:
// src/auth/helpers.ts
export function validateEmail(email: string): boolean { ... }
export function hashPassword(pwd: string): string { ... }
function internalHelper() { ... } // not exported
Task:
extract all exported function names as JSON array
Sub-agent returns:
["validateEmail", "hashPassword"]
Duration: ~2 seconds
Task: Review test file for missing edge cases, save to intermediate file.
/rlm-query test/auth/login.test.ts "identify missing edge cases and list in bullet format" --output .aiwg/working/edge-cases.md
Sub-agent receives:
Context:
// test/auth/login.test.ts
describe('login', () => {
it('should accept valid credentials', () => { ... });
it('should reject invalid password', () => { ... });
});
Task:
identify missing edge cases and list in bullet format
Sub-agent returns (saved to .aiwg/working/edge-cases.md):
Missing edge cases:
- Null/empty username input
- Null/empty password input
- Account lockout after N failed attempts
- Session expiration handling
- Concurrent login from multiple devices
Command returns:
Result saved to: .aiwg/working/edge-cases.md
Duration: ~8 seconds
Task: Multi-level analysis where sub-agent spawns its own sub-query.
# Top-level query (depth 0)
/rlm-query src/api/ "for each endpoint file, extract security checks" --depth 0
Sub-agent at depth 1 decides to spawn sub-query:
# Sub-agent internally runs (depth 1):
/rlm-query src/api/auth.ts "extract middleware chain" --depth 1
Sub-sub-agent at depth 2 processes single file:
# Depth 2: Simple extraction
Context: src/api/auth.ts
Result: ["authenticate", "rateLimit", "validateInput"]
Depth 1 sub-agent aggregates:
Endpoint: /api/auth
Security checks: authenticate, rateLimit, validateInput
Parent receives:
Security Analysis:
- /api/auth: authenticate, rateLimit, validateInput
- /api/users: authenticate, authorize
- /api/admin: authenticate, authorize, auditLog
Duration: ~30 seconds (depth 0→1→2, sequential)
Note: This is acceptable because depth stays within limit (≤3). If depth 2 tried to spawn another query, it would be blocked.
This command succeeds when:
{result, manifest, metadata}put(root, entry)Validate total context size (<50% of model window).
If too large, error and suggest filtering (--neighbors-of with smaller --depth, narrower glob, or --use-index with stricter query).