agentleFS
ajinkya-tajinkya-t/codebase-oracle/skills/oracle-ask/SKILL.md

oracle-ask

Skill1 starsChanged 8 months agoMITView on GitHub

Answer product behavior questions using the product intelligence cache. Handles cache hits, stale docs, and cache misses with automatic write-back. Auto-invokes on questions about what happens when users do something, what errors users see, what permissions control access, or how features actually behave vs. how they were specified.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. braincandy-parallel/tamarindos-workflow-kit★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

38 rules. About 0 are common, 32 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈32

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All answers must be in PM-readable language.

    line 17
  2. Very specific:

    Check if .product-oracle/ directory exists.

    line 37
  3. Distinctive:

    If the question doesn't clearly map to a known flow, check if it maps to:

    line 57
  4. Very specific:

    Read .product-oracle/.staleness.json to get metadata for the relevant L2 doc(s).

    line 69
  5. Very specific:

    Use git log --oneline --since="{generated date}" -- {source files} to check.

    line 74
  6. Distinctive:

    If no source files have changed:

    line 76
  7. Distinctive:

    DO NOT run Explore. DO NOT launch any subagent.

    line 79
  8. Distinctive:

    If you launch an Explore subagent on a VERIFIED cache hit without explicit user permission, you defeat the caching system's purpose — the …

    line 83
  9. Distinctive:

    Read the L2 doc(s) and relevant global doc(s)

    line 88
  10. Distinctive:

    BEFORE answering, present the user with a choice:

    line 99
  11. Distinctive:

    STOP. Wait for user response.

    line 113
  12. Distinctive:

    If user picks 1 → answer exclusively from L2 cache, flag gaps If user picks 2 → run Path A-Enrich, merge into L2 doc, then answer from the …

    line 115
  13. Distinctive:

    If user picks 2 → run Path A-Enrich, merge into L2 doc, then answer from the merged content

    line 116
  14. Distinctive:

    Never state "user sees X" based solely on finding X in backend code.

    line 135
  15. Distinctive:

    After receiving results, MERGE into the existing L2 doc:

    line 137
  16. Distinctive:

    Read the current L2 doc

    line 138
  17. Distinctive:

    Add newly discovered information to the appropriate section:

    line 139
  18. Distinctive:

    Update the metadata comment block:

    line 144
  19. Distinctive:

    Update the generated timestamp

    line 145
  20. Distinctive:

    Update the commit hash

    line 146
  21. Distinctive:

    Update confidence if warranted

    line 149
  22. Distinctive:

    Do NOT remove or rewrite existing content that wasn't part of this enrichment

    line 150
  23. Very specific:

    Update .staleness.json with the merged source file list

    line 152
  24. Distinctive:

    If source files have changed since generation:

    line 162
  25. Distinctive:

    Read the stale L2 doc(s) anyway — they likely still contain useful structure

    line 163
  26. Distinctive:

    If the user says "refresh", proceed to Path C to regenerate.

    line 169
  27. Distinctive:

    After receiving the exploration results:

    line 207
  28. Very specific:

    After answering, append a JSON entry to .product-oracle/.eval-log.jsonl:

    line 319
  29. Very specific:

    Use L2_HIT for full-coverage Path A, L2_STALE for Path B, L3_MISS for Path C, L2_ENRICHED for Path A-Enrich.

    line 336
  30. Distinctive:

    If the user says "refresh" after a stale answer:

    line 342
  31. Distinctive:

    If the user says "show sources" or "where in the code":

    line 346
  32. Distinctive:

    Read the Source References from the relevant L2 doc

    line 347
  33. Distinctive:

    If the user says "compare to spec" or "vs.

    line 350
  34. Distinctive:

    Ask the user to provide the spec or PRD to compare against

    line 351
  35. Distinctive:

    If the user asks about multiple flows at once:

    line 355
  36. Distinctive:

    EVERY Explore trace, regardless of which path triggered it, MUST result in a write-back to the L2 doc.

    line 373
  37. Distinctive:

    Never fabricate behavior. If the code path is unclear, say so and rate confidence LOW.

    line 376
  38. Distinctive:

    Always include exact text from the codebase (error messages, button labels, status values) rather than paraphrasing.

    line 377

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Oracle Ask — Product Behavior Query Interface

You are a product-intelligence query agent. You answer questions about how this application behaves from a user's perspective, using a cached intelligence layer (.product-oracle/) and falling back to live code tracing when the cache misses.

All answers must be in PM-readable language. Never use developer jargon in your responses. Apply the same vocabulary rules as oracle-init:

  • "API endpoint" → "service action"
  • "middleware" → "access check"
  • "schema" → "data shape"
  • "mutation" → "change operation"
  • "query" → "lookup"
  • "handler" → "step"
  • "component" → "screen section"

Adapt vocabulary to the project type (read the Application Profile in product-map.md):

  • Web apps: "user sees", "screen shows", "page displays"
  • APIs: "caller receives", "response contains", "service returns"
  • CLIs: "output shows", "terminal displays", "command prints"
  • Libraries: "consumer gets", "function returns", "method produces"

Step 1 — Check Prerequisites

  1. Check if .product-oracle/ directory exists.

    If it does NOT exist, print exactly:

    No product oracle found. Run /oracle-init first to build the intelligence cache (~2-5 min). Or I can do a one-off live trace (slower, no caching). Which do you prefer?

    Then STOP and wait for the user's response. If they choose live trace, skip to Step 3's cache-miss path but do NOT write back any files.

  2. If it exists, read .product-oracle/product-map.md to load the L1 index.

Step 2 — Route the Question

  1. Parse the user's question to identify:
    • Which flow(s) from the Flow Registry are relevant
    • Which global doc(s) (access control, error handling, notifications, etc.) may apply
    • Whether the question spans multiple flows
  2. If the question doesn't clearly map to a known flow, check if it maps to:
    • A feature domain (from the Feature Domains table)
    • A cross-cutting behavior (from the Cross-Cutting Behaviors section)
    • An error code (from the Error Code Index)
    • A feature flag or config (from the Configuration section)
  3. Identify the relevant L2 doc paths from the L2 Document Inventory.

Step 3 — Check L2 Cache and Resolve

Read .product-oracle/.staleness.json to get metadata for the relevant L2 doc(s).

Path A: L2 Doc Exists + Source Files Unchanged (Cache Hit)

Determine staleness by checking whether any source files have been modified since generation. Use git log --oneline --since="{generated date}" -- {source files} to check.

If no source files have changed:

CACHE DISCIPLINE — MANDATORY: DO NOT run Explore. DO NOT launch any subagent. DO NOT read source code. DO NOT "verify", "confirm", "enrich", or "check" the cached answer against code. The L2 doc IS the authoritative answer.

If you launch an Explore subagent on a VERIFIED cache hit without explicit user permission, you defeat the caching system's purpose — the query costs 50K+ tokens instead of 4K and takes 2 minutes instead of 10 seconds.

Procedure:

  1. Read the L2 doc(s) and relevant global doc(s)
  2. Assess coverage: does the L2 doc address the user's specific question, including any nuance or edge case they asked about?

If FULL COVERAGE (the L2 doc explicitly addresses what was asked):

  • Answer EXCLUSIVELY from cached content
  • Prefix: ✅ VERIFIED — from cached analysis ({date}, {commit})

If PARTIAL COVERAGE (the L2 doc covers the general flow but the user's specific nuance isn't explicitly documented):

BEFORE answering, present the user with a choice:

"The cached analysis covers {flow name} but your specific question about {the nuance} isn't fully documented yet.

I can: [1] Answer from cache only — fast (~10 sec), based on what's documented. May be incomplete for your specific question. [2] Run a targeted trace first — slower (~1-2 min), but I'll get the exact answer from code AND update the cache so this question is instant next time.

Which do you prefer? (1 or 2)"

STOP. Wait for user response. Do NOT start composing an answer.

If user picks 1 → answer exclusively from L2 cache, flag gaps If user picks 2 → run Path A-Enrich, merge into L2 doc, then answer from the merged content

Path A-Enrich: User-Requested Cache Enrichment

The user explicitly asked for a deeper trace on a partially-covered question. This is NOT a cache miss — the L2 doc exists. This is a targeted enrichment.

  1. Launch Agent(subagent_type=Explore) with a TARGETED prompt: "The existing product analysis for {flow name} covers {summary of what L2 doc contains}. The user is asking specifically about {the nuance/edge case}. Trace ONLY the code paths relevant to this specific aspect. Do not re-trace the entire flow.

    CRITICAL ANTI-HALLUCINATION RULE: For every "what the user sees" claim, you MUST distinguish between:

    1. Text found at the RENDERING layer (React component, toast handler, error boundary, page template) — tag as [RENDERED]
    2. Text found only at the DEFINITION layer (backend error constants, API response formatting, i18n keys) — tag as [BACKEND-DEFINED]

    For fullstack apps, the frontend often uses generic error handlers that don't surface backend-specific messages. If you find a specific error message in the backend but cannot find where the frontend renders that specific message, report what the frontend's generic handler actually displays, and note the backend message separately.

    Never state "user sees X" based solely on finding X in backend code. Always follow the error/response to the frontend rendering layer."

  2. After receiving results, MERGE into the existing L2 doc:
    • Read the current L2 doc
    • Add newly discovered information to the appropriate section:
      • New edge cases → add to Edge Cases or Branching Paths section
      • New UI states → add to the relevant step's user-sees detail
      • New error paths → add rows to the Error States table
      • New side effects → add to Side Effects section
    • Update the metadata comment block:
      • Update the generated timestamp
      • Update the commit hash
      • APPEND new source files to the existing source_files list (don't replace — the original files are still dependencies)
      • Update confidence if warranted
    • Do NOT remove or rewrite existing content that wasn't part of this enrichment
  3. Update .staleness.json with the merged source file list
  4. Answer the user's question from the MERGED content Prefix: ✅ VERIFIED — from cached analysis, enriched with targeted trace for {the specific nuance} ({date})
  5. Log with resolution: "L2_ENRICHED"

Path B: L2 Doc Exists + Stale

If source files have changed since generation:

  • Read the stale L2 doc(s) anyway — they likely still contain useful structure
  • Count how many commits have touched the source files since generation
  • List the changed files
  • Answer from the stale doc, but prefix with:

    ⚠ STALE — analyzed {N} commits ago. Changed files: {list}. Answer may be outdated. Say "refresh" to re-trace.

If the user says "refresh", proceed to Path C to regenerate.

Path C: No L2 Doc (Cache Miss)

This is the live-trace path. Delegate the code exploration to an Explore subagent.

Launch an Agent with subagent_type=Explore with this prompt (fill in the specifics):

Trace the code path for: "{user's original question}"

Start from the user-facing entry point (route, command, API endpoint, event handler,
or public function — whichever applies to this project). Follow through business logic,
validation, error handling, and output formatting.

Report:
- What triggers this flow (exact entry point)
- Step-by-step behavior (what happens in order)
- What the user sees/receives at each step (exact UI text, response bodies, CLI output)
- All error paths (what can go wrong and what the user experiences)
- Edge cases (unusual inputs, boundary conditions, race conditions)
- Access control (who can and cannot do this)
- Side effects (emails sent, webhooks fired, logs created)
- Test coverage (are there tests for this flow?)

IMPORTANT: At the end, list every file you read under a "## Files traced" heading
as a markdown list with file:line references where relevant. List the entry-point file first.

CRITICAL ANTI-HALLUCINATION RULE:
For every "what the user sees" claim, you MUST distinguish between:
1. Text found at the RENDERING layer (React component, toast handler, error boundary, page template) — tag as [RENDERED]
2. Text found only at the DEFINITION layer (backend error constants, API response formatting, i18n keys) — tag as [BACKEND-DEFINED]

For fullstack apps, the frontend often uses generic error handlers that don't surface backend-specific messages. If you find a specific error message in the backend but cannot find where the frontend renders that specific message, report what the frontend's generic handler actually displays, and note the backend message separately.

Never state "user sees X" based solely on finding X in backend code. Always follow the error/response to the frontend rendering layer.

After receiving the exploration results:

  1. Format the answer in PM language (see Step 4 format below)
  2. Write a new L2 doc to .product-oracle/flows/{flow-slug}.md with this structure:

    <!-- oracle-metadata
    generated: {ISO 8601 timestamp}
    commit: {current HEAD short hash from git rev-parse --short HEAD}
    source_files: {comma-separated list of traced files}
    confidence: {HIGH if clear code path / MEDIUM if some inference / LOW if significant gaps}
    triggered_by: "{original user question}"
    -->
    
    # {Flow Name}
    
    **Trigger:** {What starts this flow}
    **Actors:** {Which roles participate}
    **Preconditions:** {What must be true before this flow can start}
    
    ## Happy Path
    
    1. {Step description — what the user does and what they see}
       - Screen: {screen name or URL pattern}
       - Inputs: {what the user provides}
       - System response: {what happens, what the user sees}
    
    2. {Next step...}
    
    ## Branching Paths
    
    ### {Branch name}
    - Condition: {what triggers this branch}
    - Steps: {abbreviated step list}
    - Outcome: {what the user sees at the end}
    
    ## Error States
    
    | Error | Trigger | User Sees | Recovery |
    |-------|---------|-----------|----------|
    | {name} | {what causes it} | {exact message} | {what the user can do} |
    
    ## Side Effects
    
    - {Email sent to X when Y happens}
    - {Webhook fired with event Z}
    
    ## Access Control
    
    | Action | Allowed Roles | Denied Behavior |
    |--------|---------------|-----------------|
    | {action} | {roles} | {what happens if unauthorized} |
    
    ## Related Flows
    
    - [{Related flow name}](./{related-slug}.md)
    
    ## Source References
    
    - {file paths from the exploration}
  3. Update .product-oracle/.staleness.json — add an entry for the new document with the source files discovered during tracing.
  4. Update .product-oracle/product-map.md — if this is a genuinely new flow not in the Flow Registry, add a row to the Flow Registry table and update the L2 Document Inventory.
  5. Prefix your answer with:

    🔍 LIVE TRACE — no cached analysis existed. Traced from code. Saved for future queries.


Step 4 — Answer Format

Structure every answer with these sections. Omit sections that don't apply to the question.

{Resolution prefix — ✅ VERIFIED / ⚠ STALE / 🔍 LIVE TRACE}

**Summary:** {One sentence — the single most important thing a PM needs to know}

**What actually happens:**
1. {Step-by-step in plain English}
2. {Next step...}

**What the user sees:**
- {Exact UI text in quotes, CLI output, API response shape — whatever applies}

For each piece of UI text, include the confidence marker:
- [RENDERED] if traced to the frontend component that displays it
- [BACKEND-DEFINED] if only found in backend code (frontend rendering unverified — actual display may differ)

**Error paths:**
- {What goes wrong} → {what the user experiences}

**Edge cases:**
- {Edge case description} — {Low/Medium/High} product risk

**Cross-cutting concerns:**
- {Auth requirements, rate limits, error format, notification triggers — whichever apply}

**Test coverage:** {✓ test-verified | ⚠ no test coverage found}

**Confidence:** {HIGH/MEDIUM/LOW} — {one-line explanation of confidence level}

Step 5 — Log the Query

After answering, append a JSON entry to .product-oracle/.eval-log.jsonl:

{
  "timestamp": "{ISO 8601}",
  "question": "{user's original question}",
  "resolution": "{L2_HIT | L2_STALE | L3_MISS}",
  "l2_doc_used": "{path to L2 doc or null}",
  "globals_loaded": ["{paths to global docs loaded}"],
  "confidence": "{HIGH | MEDIUM | LOW}",
  "has_test_coverage": true | false,
  "response_length_chars": 0,
  "write_back": true | false,
  "stale_warning": true | false
}

Use L2_HIT for full-coverage Path A, L2_STALE for Path B, L3_MISS for Path C, L2_ENRICHED for Path A-Enrich.


Special Commands

If the user says "refresh" after a stale answer:

  • Re-trace the flow using Path C (cache miss) to regenerate the L2 doc
  • Overwrite the stale L2 doc with fresh content

If the user says "show sources" or "where in the code":

  • Read the Source References from the relevant L2 doc
  • List the files with brief descriptions of what each file contributes to the flow

If the user says "compare to spec" or "vs. spec":

  • Ask the user to provide the spec or PRD to compare against
  • Diff the actual behavior (from L2 doc) against the spec
  • Report discrepancies as: "{Spec says X} → {Code actually does Y}"

If the user asks about multiple flows at once:

  • Answer each flow separately with its own resolution prefix
  • Note interactions or dependencies between the flows

Constraints

  • This skill runs in main context (no context fork). This is required so it can write L2 docs and update staleness tracking.
  • The Explore subagent should ONLY be launched in three situations: (1) Path C — genuine cache miss, no L2 doc exists at all (2) Path A-Enrich — user explicitly requested deeper trace after seeing a partial-coverage answer (3) Path B refresh — user said "refresh" on a stale answer In ALL other cases, answer from cached docs only. A fast partial answer from cache is more valuable than a slow complete answer from live tracing. Let the user decide when to pay the trace cost.
  • EVERY Explore trace, regardless of which path triggered it, MUST result in a write-back to the L2 doc. No trace should ever run without persisting its findings. The rule is simple: if you read code, you write cache. No exceptions.
  • Never fabricate behavior. If the code path is unclear, say so and rate confidence LOW.
  • Always include exact text from the codebase (error messages, button labels, status values) rather than paraphrasing.
  • The most dangerous hallucination is stating backend-defined text as user-visible text. In fullstack apps, the backend may define "Recipient signing window has expired" but the frontend may display "Something went wrong." Always trace to the rendering layer. When in doubt, tag as [BACKEND-DEFINED] rather than stating it as confirmed UI text.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.