docs(skills): add ask skill with references for progressive disclosure#94
Merged
Conversation
Adds skills/ask/SKILL.md teaching agents the $(ask docs ...) / $(ask src ...) subshell idiom for resolving accurate doc paths at runtime. Three reference files under skills/ask/references/ provide on-demand depth: cache.md (store layout, ASK_HOME, gc/quarantine), declarative-workflow.md (ask.json schema, strict ref validation, install pipeline, intent-format), and skills-vendoring.md (ask skills install/remove, --agent flag, vendored dir layout). Modeled on vercel-labs/opensrc's skill; command surface verified against packages/cli/src/.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 4 files
Auto-approved: Docs-only change adding agent skill instructions and reference files for the 'ask' tool. No source code modified; zero risk of breaking production logic.
Architecture diagram
sequenceDiagram
participant Agent as Agent / User
participant CLI as ask CLI
participant FS as Local Project FS
participant Cache as Global Cache (~/.ask)
participant Remote as External (NPM/GitHub)
Note over Agent,Remote: Dynamic Discovery Flow (One-Shot)
Agent->>CLI: NEW: $(ask docs <spec>) or $(ask src <spec>)
CLI->>FS: Read lockfile (bun/npm/pnpm/yarn)
FS-->>CLI: Resolved Version/Ref
CLI->>Cache: Check for <spec>@version (v2 layout)
alt Cache Miss
CLI->>Remote: Fetch source/tarball
Remote-->>CLI: Source data
CLI->>Cache: NEW: Store in <ASK_HOME>/<kind>/<key>
end
CLI-->>Agent: NEW: Absolute path to stdout
Agent->>Cache: Access files via standard tools (cat, rg, fd)
Note over Agent,Remote: Declarative Workflow (ask install / add)
Agent->>CLI: ask install
CLI->>FS: Read ask.json
loop Every library in ask.json
alt NEW: Strict Ref Validation
CLI->>CLI: Reject mutable refs (main/latest) unless --allow-mutable-ref
end
CLI->>CLI: Resolve & Fetch (same as One-Shot)
CLI->>FS: NEW: Materialize .ask/docs/<name>
CLI->>FS: NEW: Generate .claude/skills/<name>-docs/SKILL.md
CLI->>FS: NEW: Update AGENTS.md auto-generated blocks
opt NEW: Intent-Format Package
CLI->>FS: Write to intent-skills block in AGENTS.md
end
end
Note over Agent,Remote: Skill Vendoring (ask skills install)
Agent->>CLI: NEW: ask skills install <spec>
CLI->>Cache: Locate skills/ directory in source
CLI->>FS: NEW: Vendor to .ask/skills/<specKey>/
alt Agent Detection
CLI->>FS: Check for .claude/, .cursor/, .opencode/, etc.
FS-->>CLI: Detected paths
else Explicit Agent
Agent->>CLI: --agent <names>
end
CLI->>FS: NEW: Symlink vendored skills into agent directories
CLI->>FS: Update .ask/skills-lock.json
Fix five inaccuracies caught by the documentation-analyzer review of PR #94 against packages/cli/src/: - ask install pipeline rewritten for the lazy-first orchestrator: only version resolution + SKILL.md + AGENTS.md, no doc fetching. - ask.json shape restricted to the strict spec-string array that AskJsonSchema actually accepts; object-form entries removed. - ask list --json example uses .entries[] (ListModelSchema), not the non-existent .libraries[]. - --allow-mutable-ref removed; the flag is not implemented. - .ask/resolved.json cache section replaced with an honest note that install no longer writes it in the lazy-first architecture. SKILL.md: drop the stale strict-ref-validation framing and the reference-list link to the resolved.json cache.
Contributor
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="skills/ask/SKILL.md">
<violation number="1" location="skills/ask/SKILL.md:55">
P3: "nothing is persisted" is misleading: one-shot commands do persist fetched data in the global ASK cache. Clarify that only project declarative state is not persisted.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| (no `@ref`) defaults to `main`. | ||
| - Any ref works with these one-shot reading commands — branches, tags, | ||
| or mutable refs like `main` / `master` are all accepted, since | ||
| nothing is persisted. |
Contributor
There was a problem hiding this comment.
P3: "nothing is persisted" is misleading: one-shot commands do persist fetched data in the global ASK cache. Clarify that only project declarative state is not persisted.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/ask/SKILL.md, line 55:
<comment>"nothing is persisted" is misleading: one-shot commands do persist fetched data in the global ASK cache. Clarify that only project declarative state is not persisted.</comment>
<file context>
@@ -49,10 +49,10 @@ github:owner/repo@main # pinned branch
+ (no `@ref`) defaults to `main`.
+- Any ref works with these one-shot reading commands — branches, tags,
+ or mutable refs like `main` / `master` are all accepted, since
+ nothing is persisted.
## One-Shot Reading Commands
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skills/ask/SKILL.md— teaches agents the$(ask docs <spec>)/$(ask src <spec>)subshell idiom so they resolve accurate, version-matched doc paths at runtime rather than relying on training-data guesses.skills/ask/references/files for progressive disclosure:cache.md(store layout,ASK_HOME, gc/quarantine),declarative-workflow.md(ask.jsonschema, strict ref validation, install pipeline, intent-format distinction), andskills-vendoring.md(ask skills install/remove,--agentflag, vendored dir layout).vercel-labs/opensrc'sskills/opensrc/SKILL.md; command surface verified againstpackages/cli/src/.Test plan
SKILL.mdfrontmatter is valid, one-shot command table matches live CLI, andreferences/relative links resolve correctly from the skill body.Summary by cubic
Adds a new
askskill that teaches agents to use$(ask docs <spec>),$(ask src <spec>), and$(ask skills <spec>)for version-accurate docs, source, and producer skills pinned to the project’s lockfile. Aligns the declarative workflow docs with the lazy-firstask installmodel and removes stale flags/examples.skills/ask/SKILL.mdwith the subshell pattern, spec grammar, and one-shot commands; clarifies output shapes (docsemits candidate dirs,srca single checkout root); drops strict-ref validation phrasing.skills/ask/references/for progressive disclosure: cache management (ASK_HOME,cache ls/gc/clean, v2 layout/quarantine), declarative workflow (strict spec-stringask.json, lazy-firstask install= version resolve +SKILL.md+AGENTS.md, correctask list --json.entries[], removed--allow-mutable-ref,.ask/resolved.jsonnot written), and skills vendoring (ask skills install/remove,--agent/--force/--no-fetch, vendored layout and lock behavior).Written for commit 877367e. Summary will update on new commits.