Source profileQuality 93/100

JotJunior/cstk/plugins/cstk/skills/apply-insights/SKILL.md

apply-insights

Apply Claude Code usage insights to current project — improve CLAUDE.md, hooks, workflows. Triggers: "aplicar insights", "otimizar fluxo", "melhorar claude.md". This is the APPLY step that consumes /insights output, not the native /insights command itself.

Source repository stars
22
Declared platforms
1
Static risk flags
0
Last source update
2026-08-24
Source checked
2026-08-25

Decision brief

What it does: where it fits

Analyze the current project and apply relevant insights from usage patterns to improve Claude Code effectiveness.

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeDeclaredSource recordInstall path and trigger
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/JotJunior/cstk --skill "plugins/cstk/skills/apply-insights"
    Safe inspection promptEditorial

    Inspect the Agent Skill "apply-insights" from https://github.com/JotJunior/cstk/blob/d1b28a511642ec12e088ed01df11d8ee9eb8bc05/plugins/cstk/skills/apply-insights/SKILL.md at commit d1b28a511642ec12e088ed01df11d8ee9eb8bc05. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      Step 1: Load Insights (data-driven first)

      There are TWO possible sources. Prefer the facets digest — it reflects the user's ACTUAL recent sessions (current, structured, project-specific), whereas the curated .md is hand-written and often stale / from a different project.

      There are TWO possible sources. Prefer the facets digest — it reflects the user's ACTUAL recent sessions (current, structured, project-specific), whereas the curated .md is hand-written and often stale / from a differen…The native /insights command writes per-session analyses to /.claude/usage-data/facets/.json (fields: goalcategories, outcome, frictioncounts, frictiondetail, claudehelpfulness, usersatisfactioncounts, …). Aggregate the…
    2. 02

      Step 2: Analyze Current Project

      1. Read the project's CLAUDE.md (if exists) to understand current state 2. Check .claude/settings.json or .claude/settings.local.json for existing hooks 3. Check for project-level skills in .claude/skills/ 4. Identify project type by looking for signal files: - Go: go.mod, inter…

      Read the project's CLAUDE.md (if exists) to understand current stateCheck .claude/settings.json or .claude/settings.local.json for existing hooksCheck for project-level skills in .claude/skills/
    3. 03

      Step 3: Gap Analysis

      Compare what the project already has vs. what the insights recommend:

      [ ] Multi-service architecture awareness (if monorepo)[ ] Database migration safety rules (if has migrations/)[ ] Bug fix protocol
    4. 04

      Step 4: Generate Recommendations

      Based on the gap analysis, generate a prioritized list:

      Use the project's actual service namesReference the project's actual build commandsMatch the project's language and framework
    5. 05

      Priority 3: Workflow Improvements

      Based on the project's characteristics, suggest: - Parallel agent patterns for multi-service debugging - Test-driven fix workflows - Pre-deploy verification checklists

      Parallel agent patterns for multi-service debuggingTest-driven fix workflowsPre-deploy verification checklists

    Permission review

    Static risk signals and limitations

    No configured static risk pattern was detected

    This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score93/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars22SourceRepository attention, not individual Skill quality
    Compatibility1 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    JotJunior/cstk
    Skill path
    plugins/cstk/skills/apply-insights/SKILL.md
    Commit
    d1b28a511642ec12e088ed01df11d8ee9eb8bc05
    License
    MIT
    Collected
    2026-08-25
    Default branch
    main
    View the original SKILL.md

    Skill: Apply Usage Insights

    Analyze the current project and apply relevant insights from usage patterns to improve Claude Code effectiveness.

    Arguments

    $ARGUMENTS should optionally specify a focus area:

    • bugfix — Apply bug fix protocol and debugging improvements
    • migrations — Apply database migration safety guidelines
    • conventions — Apply code convention checks (enum/DTO matching)
    • hooks — Suggest hooks for automated quality gates
    • all — Full analysis and recommendations (default)

    Step 1: Load Insights (data-driven first)

    There are TWO possible sources. Prefer the facets digest — it reflects the user's ACTUAL recent sessions (current, structured, project-specific), whereas the curated .md is hand-written and often stale / from a different project.

    Primary: facets digest (native /insights output)

    The native /insights command writes per-session analyses to ~/.claude/usage-data/facets/*.json (fields: goal_categories, outcome, friction_counts, friction_detail, claude_helpfulness, user_satisfaction_counts, …). Aggregate them into a digest:

    # Resolve the skill dir: installed copy first, repo source when developing.
    DIGEST="$HOME/.claude/skills/apply-insights/scripts/digest-facets.sh"
    [ -x "$DIGEST" ] || DIGEST="$(git rev-parse --show-toplevel 2>/dev/null)/plugins/cstk/skills/apply-insights/scripts/digest-facets.sh"
    "$DIGEST"            # markdown digest on stdout; optional: --top N --samples N
    

    If it prints a digest (non-empty stdout), use it as the primary, data-driven input. The ranked friction_counts + concrete friction_detail samples are the key signal for recommendations (which friction recurs, with examples).

    Fallback chain (graceful)

    digest-facets.sh exits 0 with empty stdout when jq or the facets dir are absent — so branch on emptiness:

    1. Facets digest non-empty → use it (preferred).
    2. Else read ~/.claude/insights/usage-insights.md (curated; may be stale) — and say so to the user.
    3. Else neither exists → general best practices, explicitly labeled as generic / not data-driven.

    When both exist, prefer the digest (current data); you may cross-check the curated .md for narrative context. Tell the user WHICH source you used.

    Step 2: Analyze Current Project

    1. Read the project's CLAUDE.md (if exists) to understand current state
    2. Check .claude/settings.json or .claude/settings.local.json for existing hooks
    3. Check for project-level skills in .claude/skills/
    4. Identify project type by looking for signal files:
      • Go: go.mod, internal/, cmd/
      • Node/TypeScript: package.json, tsconfig.json, build config (vite/webpack/next)
      • Python: requirements.txt, pyproject.toml, setup.py
      • Rust: Cargo.toml, src/main.rs
      • Java/Kotlin: pom.xml, build.gradle, build.gradle.kts
      • .NET: *.csproj, *.sln
      • Monorepo: .gitmodules, pnpm-workspace.yaml, lerna.json, or multiple service dirs
    5. Map the project's build/test/lint commands (from Makefile, package.json scripts, README, or CI config)

    Step 3: Gap Analysis

    Compare what the project already has vs. what the insights recommend:

    3.1 CLAUDE.md Gaps

    Check if the project's CLAUDE.md includes:

    • Multi-service architecture awareness (if monorepo)
    • Database migration safety rules (if has migrations/)
    • Bug fix protocol
    • Fixing approach (residual references, backend-first)
    • Code conventions (enum/DTO matching)

    3.2 Hook Gaps

    Check if .claude/settings.json or .claude/settings.local.json has hooks for the project's stack. Common patterns (suggest only ones relevant to the detected stack):

    • PostToolUse: build/typecheck verification after editing source files
    • PreToolUse: guards against destructive operations (rm -rf, DROP TABLE, force-push)
    • PreToolUse: stack-specific safety checks (route ordering, schema prefixes, migration safety)
    • Stop: uncommitted changes warning (with snooze pattern)
    • Stop: missing test file warning for new source files

    3.3 Skill Gaps

    Check if the project has relevant skills in .claude/skills/ or referenced via global skills. Suggest gaps based on the project's workflow — not a fixed list:

    • /bugfix — structured multi-layer bug fix protocol
    • Task/backlog workflow skills (create-tasks, execute-task, review-task)
    • SDD pipeline skills if the project uses spec-driven development
    • Project-specific generators (migration scaffolds, component scaffolds, test scaffolds)

    Do not recommend skills by fixed name. Look at the project's actual workflow and propose skills that would remove friction the insights data documents (ranked friction_counts + friction_detail samples in the facets digest).

    3.4 Memory Gaps

    Check if ~/.claude/projects/*/memory/ has relevant memories:

    • Architecture patterns documented
    • Common gotchas captured
    • UX preferences recorded

    Step 4: Generate Recommendations

    Based on the gap analysis, generate a prioritized list:

    Priority 1: CLAUDE.md Additions

    For each missing section, propose the exact text to add, adapted to the project's specific stack and structure. Do NOT add generic text — tailor it:

    • Use the project's actual service names
    • Reference the project's actual build commands
    • Match the project's language and framework

    Priority 2: Hook Suggestions

    For each missing hook, propose the exact JSON to add to settings.json. Only suggest hooks relevant to the project's actual stack. Examples:

    • Source-file edits trigger the project's build/typecheck command
    • Destructive-command guards (requires confirmation for rm -rf, DROP TABLE, force-push, etc.)
    • Stack-specific safety hooks derived from the project's CI rules

    Priority 3: Workflow Improvements

    Based on the project's characteristics, suggest:

    • Parallel agent patterns for multi-service debugging
    • Test-driven fix workflows
    • Pre-deploy verification checklists

    Step 5: Apply (with confirmation)

    For each recommendation:

    1. Show the user what will be added/changed
    2. Wait for confirmation before applying
    3. Apply changes via Edit/Write tools
    4. Summarize what was applied

    Output Format

    # Insights Analysis: {project-name}
    
    ## Current State
    - Project type: {type}
    - CLAUDE.md: {exists/missing}
    - Hooks: {count} configured
    - Skills: {count} available
    
    ## Recommendations
    
    ### CLAUDE.md ({N} additions suggested)
    1. **{section name}** — {why it's relevant}
       > {proposed text preview}
    
    ### Hooks ({N} suggestions)
    1. **{hook name}** — {what it does}
       > {JSON preview}
    
    ### Workflows ({N} patterns)
    1. **{pattern name}** — {when to use}
    
    ## Apply?
    Reply with the numbers you want to apply, or "all" to apply everything.
    

    Important Notes

    • This skill is interactive — it proposes changes and waits for confirmation
    • Tailor all recommendations to the specific project (don't copy generic text)
    • Skip recommendations the project already implements
    • Focus on highest-impact items first (based on friction frequency in insights)
    • If the project already has comprehensive CLAUDE.md and hooks, say so

    Gotchas

    Never propose GENERIC recommendations

    Every suggestion must be tailored to the current project: real service names, real build commands, real language conventions. Generic boilerplate ("Add a bug fix section to CLAUDE.md") produces noise, not value.

    Interactive: propose and wait for confirmation

    Don't apply changes directly. Show the proposed diff, wait for "apply 1,2,4" or "all", and only then edit files. Auto-applying destroys trust in the skill.

    Skip recommendations the project already implements

    Duplicating existing CLAUDE.md sections or re-adding hooks the project has is ruido. Read the current state first, diff against insights, propose only the delta.

    If the project is already in good shape, say so

    Not every project needs recommendations. A project with comprehensive CLAUDE.md, relevant hooks, and appropriate skills should hear "your setup looks solid — nothing to add" instead of forced suggestions. Honesty > output volume.

    Data source: facets digest first, curated .md fallback, then generic

    Prefer scripts/digest-facets.sh (aggregates the native /insights facets — current and project-specific). Only when its stdout is empty (no jq, no facets dir) fall back to the curated ~/.claude/insights/usage-insights.md; when that too is missing, use general best practices but label them clearly as generic / not data-driven. Don't pretend insights exist when they don't, and don't lean on a stale curated .md when fresh facets are available — that was the original bug (April-era summary applied to a different stack).

    Skill gaps must be derived from actual friction, not a fixed list

    Do not assume every project needs /bugfix, /review-pr, etc. Look at the insights data (the facets digest's friction_counts / friction_detail, or the curated file): which tasks keep getting re-explained? Which workflows have friction logged? THOSE are the skill candidates — not a checklist copied from another project.

    Frequently asked questions

    What to verify before installation and use

    What does the apply-insights source document cover?

    Analyze the current project and apply relevant insights from usage patterns to improve Claude Code effectiveness.

    How do I install apply-insights?

    The source record exposes this install command: npx skills add https://github.com/JotJunior/cstk --skill "plugins/cstk/skills/apply-insights". Inspect the command and pinned source before running it.

    Which Agent platforms does the source record declare?

    The pinned source record declares support for: claude code.

    Alternatives

    Compare before choosing