learn
SolidScan codebase to discover coding patterns and update draft/guardrails.md. Learns conventions (skip in future) and anti-patterns (always flag). Supports migration from workflow.md and pattern promotion.
Code & Development 40 stars
6 forks Updated 2 days ago MIT
Install
Quality Score: 80/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Learn — Pattern Discovery & Guardrails Update
Scan the codebase to discover recurring coding patterns and update `draft/guardrails.md` with learned conventions and anti-patterns. This improves future quality command accuracy by reducing false positives and catching known-bad patterns.
## MANDATORY GRAPH LOOKUP (read before pattern scanning)
First resolve the bundled helpers:
```bash
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
# is not exported into skill Bash). See core/shared/tool-resolver.md.
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
```
When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-first lookup contract in [core/shared/graph-query.md](../../core/shared/graph-query.md) §Mandatory Lookup Contract. Use the graph to:
1. Enumerate a module's symbols/files via `"$DRAFT_TOOLS/graph-callers.sh"`/`"$DRAFT_TOOLS/graph-impact.sh"` and `"$DRAFT_TOOLS/graph-arch.sh" --repo .` (preferred over `find`).
2. Prioritize hotspots via `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` — patterns in high-fanIn files are more impactful when learned.
3. For TS/Python/Go/C/C...
Details
- Author
- drafthq
- Repository
- drafthq/draft
- Created
- 7 months ago
- Last Updated
- 2 days ago
- Language
- HTML
- License
- MIT
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Featured
init-workspace-patterns
Extract code patterns.
335 Updated today
griddynamics AI & Automation Listed
guardloop
/guardloop — Adaptive Learning Guardrail Engine
11 Updated 1 months ago
samibs Code & Development Listed
explore
Get familiar with any codebase. Deep-dive tech stack, architecture, features, conventions, issues. Multi-repo support. Keywords: explore, understand, onboard, what is this, how does it work, codebase, repo, project, analyze
2 Updated today
jvalin17