Rick Intel
burp Before you write a line of code, you read the dossier, Morty. This skill reads the ADO work item, climbs to the parent epic, sweeps vexis-docs and ADRs, and writes a story-scoped intel file at docs/rick/<folder>/intel/current.md.
Sister of rick-plan. Plan tells you what to build. Intel tells you what's already known. Run intel first.
Argument
Required. The ADO work item id. Accepts AB16289, 16289, or ab16289. Normalize to AB<digits>.
If $ARGUMENTS is empty or no AB-id can be parsed, print one line and stop:
Fine, Morty, which story. Pass an ADO id.
Optional --refresh anywhere in $ARGUMENTS triggers re-gather (see Refresh).
Intro
Pick one line at random from INTROS.md, substitute <AB-id>, print it. Then proceed.
Pre-flight
- Normalize the AB-id.
- Resolve the folder. Intel is almost always run pre-branch (the whole point is research before you build), so the folder name should match the branch the user will create after reading. Priority order, first that produces a value:
- Branch-already-cut override.
git branch --show-currentreturns a feature branch (not in{main, master, develop}and non-empty) AND the branch name contains the AB-id digits (e.g. branchfeat/15920-data-gapfor AB15920) → sanitize (/and spaces →-) and use it. The digit-substring check is mandatory — without it, running/rick-intel AB15920while sitting onfeature/WP-FE7-Template-Managementlands the dossier inside the unrelated feature's folder. If you're on a feature branch for a different story, priority 1 doesn't fire. - Predict the branch name. Fetch ADO title cheaply:
Slugify peraz boards work-item show --id <digits> --org https://dev.azure.com/VizyFintech --query 'fields."System.Title"' -o tsvrick-plan/PICK-FOLDER.mdstep 2: truncate at the first em-dash / en-dash /-; lowercase; replace non-[a-z0-9]runs with-; trim trailing hyphens; cap at 40 chars without cutting mid-segment. Result:<digits>-<title-slug>(e.g.16289-rotate-share-link-ui). - ADO title fetch failed → fall back to
ab<digits>(e.g.ab16289) and record an open question.
- Branch-already-cut override.
- Compute paths:
- Folder:
docs/rick/<folder>/intel/ - Canonical:
docs/rick/<folder>/intel/current.md
- Folder:
- Glob check for prior intel at this AB-id (handles the case where intel was written before but the folder name has since drifted, e.g. a different branch was created later):
find docs/rick -type f -path '*/intel/current.md' -exec grep -l '<AB-id>' {} \;. If a single match exists at a different path, treat it as the canonical instead (don't write a second copy under the predicted name). If multiple match, print them and stop — Morty resolves. - Check if canonical exists:
- Exists, no
--refresh→ print path + the file'sLast gathered:line + the one-line summary footer, stop. Do not re-fetch. - Exists,
--refresh→ load existing findings into memory for diff (see Refresh). - Does not exist → fresh gather. Cache the title from step 2 so the gather phase doesn't re-fetch it.
- Exists, no
- Create
docs/rick/<folder>/intel/if missing.
Gather (no code, info only)
Source order: ADO → vexis-docs → ADRs. Record any failure as an open question and keep going.
1. ADO work item
az boards work-item show --id <digits> --org https://dev.azure.com/VizyFintech
Extract:
fields.System.Title→ story titlefields.System.Description→ raw description (HTML — strip tags for Scope prose, keep plaintext for AC parsing)fields.Microsoft.VSTS.Common.AcceptanceCriteria→ AC field if presentfields.System.State,fields.System.IterationPath,fields.System.AssignedTo.displayNamerelations[?attributes.name=='Parent']→ parent work item URL → parent idrelations[?attributes.name=='GitHub Pull Request']→ PR refs (extract last URL segment as PR number)
If az fails or unauthenticated, record open question "ADO unauthenticated — run az login and --refresh" and continue with whatever else is reachable.
2. ADO parent epic
For the parent id from step 1, run az boards work-item show again. Extract title and AC. Use to derive the domain anchor and to quote parent AC text when the story Backs AC-N of parent.
3. AC parsing
Try each source in order, stop at first that yields ACs:
fields.Microsoft.VSTS.Common.AcceptanceCriteriafield on the story.- Story description body — scan the HTML-stripped description for AC content:
- "Acceptance Criteria" heading (any level, case-insensitive; also "AC", "Criteria") followed by a list.
AC-?\d+[:.\)]markers with the prose that follows.- Gherkin-style
Given … When … Then …blocks.
- Parent epic's AC field — when story description references AC-N (regex
AC-?\d+orBacks AC: (AC-?\d+(?:, AC-?\d+)*)), pull the referenced text from parent.
No AC parseable → file uses one ## Findings flat section instead of per-AC sections. Everything else is unchanged.
4. Domain anchor
Derive candidate tokens from parent title + story title:
- Lowercase, tokenize on spaces,
|,-,/. - Drop noise:
BE,FE,WP, digits,service,module,task,bug,epic,story, generic verbs.
Find docs root, first that exists wins:
vexis-docs/in current repo../vexis-docs/sibling repodocs/fallback
For each token: find <docs-root> -type d -iname '*<token>*'. First directory match wins. Full read of that subtree.
No match → record open question "No domain anchor matched for tokens: …". Continue with sweep only.
5. Keyword sweep
Extract sweep terms from story title + Scope text + AC titles. Drop noise tokens.
For each term: grep -rli --include='*.md' <term> <docs-root> docs/adr/ 2>/dev/null.
Dedupe hits against the domain-anchor read. For each unique hit: open the file, find the first paragraph containing the term, summarize in ≤2 sentences. Finding text = that summary. Source = <path>:<line> of the matched paragraph.
Terms with zero hits → open question "No vexis-docs match for <term>".
6. ADRs
docs/adr/ (or vexis-docs/adr/ if exists). Same sweep over titles and bodies. Same finding format.
Write the file
Path: docs/rick/<folder>/intel/current.md. See OUTPUT.md for the full section order, finding format, and refresh stale-line format.
Refresh
When --refresh is passed and the file exists:
- Read
current.md, parse every- … — Source: <S> — Found: <D>line into a map keyed by source. - Run the full gather phase fresh.
- For each gathered finding:
- Same source, summary matches → keep existing line untouched.
- Same source, summary differs → strike old, append new with today.
- New source → append new with today.
- For each existing source not present in fresh gather → strike old with today as Stale.
- Update
Last gathered:to today. - Rewrite the file.
Never delete a finding line. Stale markers are history.
ADO writeback
After writing the file, post an HTML comment to the ADO work item. Body shape + idempotency rule live in ADO-COMMENT.md. Substitute <AB-id>, <N>, and <YYYY-MM-DD> before posting.
Failure → don't block file write. Print:
Warning: ADO writeback failed: <reason>
Run manually: az boards work-item update --id <digits> --discussion '<html-body>'
bd writeback
After writing the file, attempt bd linkage.
bd list --json 2>/dev/null— bd absent → skip silently.- Find issue where
metadata.ado == <id-numeric>. - Exactly one match →
bd update <bd-id> --set-metadata research=docs/rick/<folder>/intel/current.md. - Zero matches → print:
No bd issue linked. Once claimed: bd update <bd-id> --set-metadata research=docs/rick/<folder>/intel/current.md. Continue. - Multiple matches → print candidate ids, do nothing, ask Morty to resolve.
Confirm and stop
Fresh write:
Intel filed for <AB-id>: docs/rick/<folder>/intel/current.md
<N> ACs, <N> findings, <N> open questions
Domain anchor: <path> (<N> hits) | Keyword sweep: <N> cross-cutting hits
If the folder was predicted (Pre-flight step 2 priority 2 — no feature branch was checked out) AND the predicted name differs from the current branch, follow up with one line so Morty can branch into the dossier:
Next: git checkout -b <folder>
Refresh:
Intel refreshed for <AB-id>: docs/rick/<folder>/intel/current.md
<N> carried, <M> updated/stale-marked, <K> new
If ADO writeback warned, print the warning line first.
Rules
- No code. No implementation suggestions. Pure research synthesis.
- Cite every finding. Path-line or URL. No bare claims.
- Verbatim ADO description in Scope — strip HTML, don't paraphrase.
- Stale-mark, never delete.
- Idempotent. Two runs without
--refreshshould be free: read, print, exit. Don't re-fetch ADO unprompted. - burp Don't suit up twice for the same dimension, Morty.