name: semantic-slicing description: Build local semantic review slices by combining clawpatch feature maps, deepsec threat candidates, visual review maps, and optional gitcrawl/discrawl evidence for repos such as openclaw/openclaw. license: MIT metadata: source: "https://github.com/vincentkoc/dotskills"
Semantic Slicing
Purpose
Turn a large repo into reviewable semantic slices with evidence. Use code shape, threat candidates, issue clusters, and support chatter together so review budget lands on the right parts of the system.
Default stance: map locally first, rank second, spend agent/security-review budget last.
When to use
- Setting up or running
openclaw/clawpatchagainst a target repo. - Setting up or running
vercel-labs/deepsecagainst a target repo. - Producing a local visual map of feature slices, risky files, ownership clusters, or review targets.
- Cross-checking code slices against
gitcrawlissue/PR data ordiscrawlDiscord/support data. - Planning a focused security, regression, architecture, or maintainer-review pass for a large repo.
Workflow
- Create a scratch run directory outside the target checkout, usually
~/.semantic-slicing/<repo>/<timestamp>. - Read target repo instructions before scanning. For OpenClaw, read root
AGENTS.md; subtree guides matter when reviewing a slice. - Verify tool setup:
clawpatch: clone/buildopenclaw/clawpatch, then runclawpatch init,clawpatch map,clawpatch status.deepsec: clone/buildvercel-labs/deepsec, scaffold a scratch workspace, then rundeepsec scan.gitcrawl: rungitcrawl doctor --json, then pull clusters/threads for related issue evidence.discrawl: rundiscrawl doctor --jsonanddiscrawl status --json; use search/digest only when support chatter is relevant.
- Run deterministic maps before AI review:
- Clawpatch feature map for entrypoints/packages/config/test slices.
- Deepsec regex scan for candidate threat surfaces.
- Optional gitcrawl/discrawl lookups for historical pain around the same files, components, or symptoms.
- Run
scripts/semantic-map.mjsto merge the local artifacts intosemantic-map.htmlandsemantic-map.json. - Rank slices by combined signal:
- high-risk entrypoint or tool boundary,
- deepsec candidate density and slug quality,
- recent/open gitcrawl clusters,
- matching discrawl support terms,
- churn/ownership/test gaps if available.
- Choose a cost size before running AI stages:
low: deterministic maps only; nodeepsec processor realclawpatch review.medium: one to three explicit files/features with high-risk slugs, batch size 1, concurrency 1, and a turn cap.high: broader AI processing or multiple feature reviews; requires an explicit budget/time decision.
- Run AI only at the chosen size:
clawpatch review --feature <id>or a small--limit.deepsec process --files <csv>or tightly scoped--filterplus--only-slugs.
- Report exact artifact paths, run IDs, counts, cost size, exclusions, and skipped expensive stages.
Inputs
target_repo: local checkout path and/or GitHubowner/repo.scratch_root: local artifact directory, default~/.semantic-slicing/<repo>/<timestamp>.clawpatch_repo: local clone ofopenclaw/clawpatch, optional ifclawpatchis already on PATH.deepsec_repo: local clone ofvercel-labs/deepsec, optional ifdeepsecis already on PATH.focus: optional path prefixes, issue numbers, slugs, components, or channels to prioritize.cost_size:low,medium, orhigh; defaultlow.budget_mode:map-only,targeted-ai, orfull-ai; default followscost_size.
Outputs
- Tool setup status and blocker list.
- Clawpatch feature counts and contamination checks.
- Deepsec scan run ID, candidate counts, top slugs, and top files.
- Optional gitcrawl cluster/thread evidence and discrawl support evidence.
- Local visual map:
semantic-map.htmlplus machine-readablesemantic-map.json. - Ranked slice plan with recommended next commands and cost-size rationale.
Guardrails
- Keep generated artifacts out of the target repo unless the user explicitly wants checked-in config.
- Do not run full
deepsec processor broadclawpatch reviewwithout an explicit high-cost decision; these can be expensive and noisy. - Treat local nested worktrees and dot-agent folders as contamination unless intentionally in scope:
.claude/,.codex/,.agents/,.deepsec/,.semantic-slicing/. - If a tool maps contaminated paths, post-filter before ranking and call out the upstream limitation.
- Never paste secrets from scan outputs. Scrub absolute personal paths before external PRs/comments.
- For OpenClaw, use Testbox/Crabbox only when the task moves from mapping into validation.
References
- Read
references/workflow.mdfor concrete local setup and run commands. - Read
references/slicing-taxonomy.mdwhen choosing slice types or map layers. - Read
references/openclaw-profile.mdwhen the target isopenclaw/openclaw.