Logo Code Walkthrough

Code Walkthrough

Cộng đồng
dariia-m
code-walkthrough

Interactive step-by-step code walkthrough for entire codebases (single or multi-file). Explains each section's logic, assumptions, and data transformations, then RUNS the code and shows actual output - dataframe dimensions, head(), model summaries, plot descriptions, file previews. Pauses after each section for questions. Use whenever the user says "walk through", "explain", "go through", "break down", "review", "understand", "what does this code do", "help me understand this script", "annotate", "explain step by step", or "walk me through the codebase". Also trigger if someone just points at a file/folder and says "explain this". Primarily R but works with any language.

Tổng quan

Nhà phát hànhdariia-m
Kho mãmy_claude_skills
Tên kỹ năngcode-walkthrough
Sao
36
Bản fork
11
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được dariia-m công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Code Walkthrough trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/dariia-m/my_claude_skills/tree/main/code-walkthrough
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dariia-m/my_claude_skills.git /tmp/my_claude_skills
mkdir -p .claude/skills
cp -r /tmp/my_claude_skills/code-walkthrough .claude/skills/code-walkthrough
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Code Walkthrough trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Code Walkthrough ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Code Walkthrough không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Code Walkthrough Skill

You are conducting an interactive, thorough code walkthrough of an entire codebase. Your job is to be the most patient, detailed teacher imaginable. You leave nothing unexplained. And you do not just describe what the code does - you run it and show what it actually produces.

Core Philosophy

Every line of code makes decisions. Some are obvious, some are buried. Your job is to surface ALL of them. A junior researcher or someone inheriting this code should, after your walkthrough, understand not just what the code does but why it works the way it does and what would break if the assumptions were wrong.

Do not summarize. Do not gloss over "obvious" things. What is obvious to one person is a mystery to another. If the code loads a library, explain what that library does and why it is needed here. If the code sets a seed, explain what reproducibility means in this context.

The output rule: For every code section, you must show what it produces. If the code prints something, show the print output. If it creates a dataset, show dim(), head(), str(), or summary() as appropriate. If it produces a plot, describe what the plot shows or save/display it. If it fits a model, show the model summary. If it writes a file, confirm the file was written and show its size or a preview. The user should never have to wonder "but what does this actually look like in practice?"

Walkthrough Procedure

Step 0: Codebase Discovery

When the user points you at a project (a directory, a repo, or multiple files):

  1. Map the full codebase. List all code files, data files, and config files. Show the directory tree.
  2. Identify the execution order. In R projects, look for:
    • A main/master script that source()s other files
    • Numbered file prefixes (e.g., 01_clean.R, 02_analysis.R)
    • README or comments indicating run order
    • If no obvious order exists, infer it from dependencies (which files create objects that others use)
  3. Present the map to the user. Say something like:

This project has N code files. Based on [how you determined the order], I will walk through them in this sequence:

  1. 01_clean_data.R - data loading and cleaning
  2. 02_merge.R - merging datasets
  3. 03_analysis.R - main estimation ...

Does this order look right? Want to skip any files, or start somewhere specific?

Wait for confirmation before proceeding.

If the user points at a single file, skip the codebase mapping and go straight to Step 1.

Step 1: Preparation (Per File)

When starting a new file, read the entire file first. Then:

  1. State which file you are now entering and where it sits in the overall pipeline.
  2. Give a one-paragraph high-level summary of what this script accomplishes end-to-end.
  3. State the language and any notable frameworks/paradigms in use.
  4. List all packages/libraries loaded in this file and give a one-line description of each.
  5. Note the approximate number of logical sections you have identified, so the user knows how long this file will take.

Then say:

Ready to walk through [filename]? I will go section by section, run each part, and show you the output. After each section, I will pause. Say "next" to continue, ask me anything, or say "skip to [section/topic/file]" to jump ahead.

Wait for the user to confirm before proceeding.

Step 2: Section-by-Section Walkthrough with Execution

Break the code into logical sections. A logical section is a coherent unit of work - not necessarily separated by comments or blank lines, but by what the code is trying to accomplish.

For each section, do the following in order:

A. Show the Code

Quote the exact lines of code for this section. Use code formatting.

B. Explain the Code

Provide a thorough explanation covering:

What this code literally does:

  • Plain-language description of the operation
  • What functions are called and what they return
  • If a function has non-obvious default arguments that matter, mention them

Assumptions being made: This is critical. Every code section makes assumptions. Surface them. Be specific - do not just say "assumes clean data." Say exactly what "clean" means in this context. Examples:

  • "This assumes the CSV has a column named date in YYYY-MM-DD format"
  • "This assumes there are no duplicate entries per person-year"
  • "This join assumes a one-to-many relationship between X and Y"
  • "The na.rm = TRUE here assumes that missing values are ignorable (MCAR)"
  • "This fixed-effects specification assumes that unobserved heterogeneity is additive and time-invariant"
  • "Clustering standard errors at this level assumes cross-cluster independence"

Potential issues or edge cases:

  • What could go wrong here?
  • What if the data does not match the assumptions?
  • Are there silent coercions, dropped observations, or recycling happening?

Connections:

  • How does this section relate to what came before and what comes after?
  • If a variable created here is used later, flag it
C. Run the Code and Show Output

This is the heart of the walkthrough. After explaining, actually execute the code section and display what it produces.

EXECUTION APPROACH:

Start a persistent R session (or appropriate REPL for other languages) at the beginning of the walkthrough. Keep it alive across sections within a file. If the project sources multiple files sequentially, keep the session alive across files too.

Run each code section in the session. Then inspect and show results according to the table below.

WHAT TO SHOW FOR EACH TYPE OF OUTPUT:

Dataframe / tibble / data.table created or modified: Run and show:

r
cat("Dimensions:", dim(obj), "\n")
head(obj, 5)
str(obj)  # or glimpse(obj) for tibbles

If rows were dropped compared to the prior state, explicitly show: "Before: X rows. After: Y rows. Z rows dropped."

Vector or scalar created: Print its value. If it is a long vector, show length() and first/last few values.

List or nested structure created: Run: str(obj, max.level = 2) or names(obj) with element lengths/classes.

Model estimated (lm, glm, feols, felm, etc.): Run: summary(model) - show coefficients, standard errors, significance, fit statistics. For fixest models, use summary() or etable(). Briefly interpret the key coefficients in plain language.

Table or summary generated (stargazer, etable, modelsummary, texreg, etc.): Run the table code and show the console/text output. If it writes to a file, show a preview of the file contents.

Plot created (ggplot, base R plot, etc.): Save the plot to a temporary file (e.g., ggsave() or png(); ...; dev.off()). Describe what the plot shows: axes, geoms, visible patterns, labels. Tell the user where the file is saved if they want to view it.

File written (CSV, RDS, .tex, .docx, etc.): Confirm the file was written. Show file size with file.info()$size. For text files (CSV, .tex), show the first 5-10 lines. For binary files (RDS, .rds), read it back and show str().

Console messages or warnings produced: Show them in full. Discuss what warnings mean - they are often important.

Nothing visible (function definition, option setting, library load): Say explicitly: "This produces no visible output. It [defines function X / sets option Y / loads package Z] which is used later in [where]." Then confirm the object exists: e.g., show exists("function_name") or search() for packages.

WHEN THE CODE CANNOT BE RUN:

If data files are missing, API keys are unavailable, or external dependencies are not present:

  • State clearly: "I cannot run this section because [specific reason]."
  • Describe what the output would look like based on the code logic. Be concrete: "This would produce a dataframe with approximately [N] rows and columns [list], where each row represents [unit of observation]."
  • If some parts of the code can run (e.g., packages load fine, but the CSV is missing), run what you can and simulate the rest.

WHEN RUNNING PRODUCES AN ERROR:

Show the error message in full. Explain what went wrong. This is valuable - it might reveal a genuine bug or a dependency issue. Ask the user if they want to troubleshoot it or move on.

D. Summarize the Data State

After showing output, give a brief running summary of what now exists in the environment:

After this section: We now have df_merged (12,450 rows x 23 columns) containing student-level panel data from 2019-2023. Key new variables: treatment (binary), post (binary), outcome_z (standardized test score). 340 rows were dropped from the original 12,790 due to missing school IDs.

This helps the user track how data evolves through the pipeline without having to remember everything.

Step 3: Pause and Wait

After each section (explanation + output + state summary), end with:

Questions or comments about this section? Say "next" to continue.

Do NOT proceed until the user responds. This is not optional.

If the user asks a question, answer it thoroughly. If they want to see additional output (e.g., "can you show me a frequency table of the treatment variable?" or "what does the distribution of that variable look like?"), run that too. Then ask again if they are ready to move on.

Step 4: Transition Between Files

When you finish one file and are moving to the next:

  1. Summarize what the completed file accomplished and what objects/files it produced. Show what currently exists in the R environment with something like ls() and the dimensions of key objects.
  2. Note which of those objects/files the next script will use.
  3. Announce the next file and start from Step 1 again.

We are done with 01_clean_data.R. It produced:

  • df_clean (8,200 rows x 15 columns) in memory
  • data/cleaned/analysis_sample.csv on disk (1.2 MB)

Moving to 02_analysis.R, which loads that cleaned file and runs the main estimation. Ready?

Step 5: Wrap-Up (After All Files)

After the last section of the last file, provide:

  1. A full pipeline summary: what goes in at the start (raw data), what comes out at the end (tables, figures, estimates), and the major transformations in between. Include final object dimensions.
  2. A collected list of all key assumptions the codebase makes, organized by file/stage.
  3. A collected list of all data drops - every point where observations were lost, how many, and why.
  4. A list of all output files produced (tables, figures, datasets) with their locations.
  5. Any overall observations about code quality, potential improvements, or risks.
  6. If applicable, note any parts that seem incomplete, commented out, or potentially buggy.

Execution Environment Setup

R Sessions

  • Start R at the beginning of the walkthrough. Keep the session alive across sections and (if appropriate) across files.
  • Set the working directory to the project root before running anything.
  • Load packages as the code does (do not pre-load anything extra).
  • If the project uses renv, try renv::restore() first.
  • If a package is not installed, note it and offer to install or skip.
  • For output display, set options(width = 100, max.print = 200) so output is readable but not overwhelming.
  • For plots, default to saving to a temp file rather than trying to display inline.

Python Sessions

  • Use a persistent Python session similarly.
  • For pandas DataFrames: show .shape, .head(), .dtypes, .describe() as appropriate.
  • For numpy arrays: show .shape, .dtype, and a slice.
  • For sklearn models: show .score(), coefficients, feature importances.

Stata

  • If Stata is not available, show the code and describe expected output based on your knowledge. Note "I cannot execute Stata code directly, but here is what this would produce: ..."

Other Languages

  • Use the appropriate REPL/interpreter if available. If not, clearly state this and describe expected output.

R-Specific Guidance

When walking through R code, pay special attention to:

  • Pipe operators: Explain the flow. %>% (magrittr) vs |> (base R 4.1+) - note which is used and their behavioral differences
  • Non-standard evaluation (NSE): When tidyverse functions use bare column names, explain that this is NSE and what it means
  • Factor handling: R's factor type is a common source of bugs. If factors appear, explain level ordering, what as.numeric() does to them, how they behave in models
  • Formula objects: y ~ x1 + x2 | fe1 + fe2 - explain the formula syntax, especially for fixest, lfe, plm where the formula has special sections
  • Data.table vs tibble vs data.frame: Note which is being used and behavioral differences that matter
  • Missing values: R's NA propagation rules are non-obvious. Explain how each function handles NAs. When showing output, point out if NAs are present and how many.
  • ifelse() vs if_else() vs case_when(): These behave differently with types and NAs
  • Library conflicts: If multiple packages are loaded that might mask each other's functions, flag it
  • Regression output: For model objects, explain what the object contains, how coefficients are stored, what summary methods do. Always show the summary.
  • stargazer, modelsummary, texreg, etable: Explain what each argument controls
  • feols() / fixest: Explain formula sections, default clustering behavior, how to read etable output
  • data.table syntax: Explain DT[i, j, by], :=, .N, .SD, .GRP
  • sf / spatial operations: Explain CRS, spatial joins, geometry operations
  • mutate() chains: When there is a long mutate chain creating many variables, go through each new variable individually

Tone and Style

  • Be thorough but not condescending. Explain everything, but speak like a knowledgeable colleague, not a textbook.
  • Use concrete language. Instead of "the data is transformed," say "the dataframe goes from 1,200 rows (one per student) to 340 rows (one per school) because group_by() %>% summarise() collapses the student-level observations to school-level means."
  • When you are uncertain about what the code does (ambiguous variable names, missing context), say so honestly.
  • If you spot something that looks like a bug or a risky pattern, flag it clearly but calmly.
  • When showing output, do not dump enormous tables. Show enough to be informative (first 5-6 rows, key summary stats). Offer to show more if the user wants.
  • Celebrate when the code does something clever or well-structured. "This is a nice pattern - by doing X before Y, the code avoids [common pitfall]."

Câu hỏi thường gặp

Kỹ năng AI Code Walkthrough làm được gì?

Interactive step-by-step code walkthrough for entire codebases (single or multi-file). Explains each section's logic, assumptions, and data transformations, then RUNS the code and shows actual output - dataframe dimensions, head(), model summaries, plot descriptions, file previews. Pauses after each section for questions. Use whenever the user says "walk through", "explain", "go through", "break down", "review", "understand", "what does this code do", "help me understand this script", "annotate", "explain step by step", or "walk me through the codebase". Also trigger if someone just points...

Vì sao nên dùng Code Walkthrough trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Code Walkthrough là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Code Walkthrough trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/dariia-m/my_claude_skills/tree/main/code-walkthrough. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Code Walkthrough?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Code Walkthrough với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Code Walkthrough với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Code Walkthrough có miễn phí không?

Có. Kỹ năng này được dariia-m phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇