project-structure
Skill này làm gì
Skill này tạo một file bản đồ nén của một dự án code, liệt kê các file, tên được xuất và chữ ký hàm. Dành cho lập trình viên muốn agent suy luận về toàn bộ codebase cùng lúc.
Khi nào nên dùng
- ✓Khi bạn muốn tổng quan về một dự án TypeScript hoặc Swift lớn.
- ✓Khi bạn đang tìm code trùng lặp hoặc lên kế hoạch refactor.
- ✓Khi bạn muốn giao cho một agent khác bản đồ đầy đủ của dự án.
Liên kết skill
https://github.com/steipete/agent-scripts/blob/main/skills/project-structure/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một bản đồ gọn của dự án TypeScript này để chúng ta tìm code trùng lặp trong toàn bộ dự án.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chạy một script đi kèm trên thư mục dự án. Nó ghi một file bản đồ chứa các file, ký hiệu và chữ ký, rồi báo cáo kích thước kết quả.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Project Structure
Compress a TS or Swift repo into one map file an agent can load whole. Backed by map.ts next to this file. TS: parse-only TS compiler, no type-check; ~8k files in ~5s; resolves the typescript package from the target repo, falling back to this skill dir. Swift: zero-dependency regex/brace-depth scanner built into map.ts (no typescript needed for pure-Swift repos). Requires Node >= 23.6 (native type stripping) or npx tsx. .ts/.tsx and .swift files are detected by extension; a repo may mix both.
Run
node <this-skill-dir>/map.ts <repoRoot> [flags]
<this-skill-dir> is the base directory of this skill as announced when the skill loads (canonical: ~/Projects/agent-scripts/skills/project-structure).
Output: one map file (default project-structure-map.txt in cwd) plus a JSON stats line (files, symbols, bytes, approxTokens) on stdout.
Flags
--out <file>— output path.--mode dense|skeleton|exports|sigs|full— defaultdense.dense: dir-grouped, one line per file:file fn:a,b ty:T cl:C c:x re:./y. Recon tier. File extensions are stripped for compactness, so a same-basename TS and Swift file in one dir share a line prefix (theoretical in practice; grep the repo to disambiguate).skeleton: one symbol per line, names only.exports: exported symbols with full typed signatures, type bodies, first doc-comment line. Refactor-decision tier. TS-only — Swift files fall back to their dense-style line (no fabricated signatures).sigs: exports but type/interface bodies collapsed to member names (only ~10% smaller than exports; rarely worth it). TS-only, same Swift fallback.full: exports + non-exported top-level symbols (markedinternal; internal consts appear only when function-valued or explicitly typed — untyped internal consts are filtered as noise). TS-only, same Swift fallback.
--include a,b,c— paths to map, relative to repoRoot (default: all top-level dirs, minus skips/boundaries). Accepts nested paths, not just top-level dirs:--include src/channels/turnmaps exactly that subtree. Headers stay repoRoot-relative, so running from repo root with--include <subsystem>is the recommended way to map a subsection.--boundary x,y— dirs listed as boundary index only: child module names + one-linepackage.jsondescriptions, no symbol content. Use for plugin/extension trees.--include-tests— keep test files and test-support infra (default: both excluded; Swift test detection is path-based:Tests?/dirs and*Tests.swift).--no-docs— strip doc comments (saves ~13% on typed modes).--fn-consts-only— drop non-function const exports (on Swift files: drops every let/var symbol — closure-valued consts are indistinguishable without type info). Caution: silently drops files whose only exports are consts (plugin definition objects, schemas, registries). Prefer keeping consts indense(names are cheap).--re-counts— collapse re-export path lists to a count (dense; saves ~10%).--max-per-kind N— cap each symbol-kind list per file with+noverflow marker (dense; 10–12 is safe).--members— Swift only (ignored for TS files): additionally emit one-level-deep methods/properties asType.member; extension members appear under their target type.--public-only— Swift only (ignored for TS files): keep only symbols whose written access isopen/public.
When --include is absent, source files sitting directly in repoRoot are scanned too (so pointing repoRoot at a leaf source dir works); with --include, only the listed paths are walked.
Swift specifics
Zero-dependency line scanner (lexical masking of comments/strings + brace-depth tracking), validated 1:1 against SourceKitten on 1,850 files across two real repos (100% top-level symbol agreement) at ~100× SourceKitten's speed. Known limitations (accepted tradeoffs of the parserless design): one declaration per line is assumed — a member on the same line as its type (struct Box { var v = 1 }) or a second semicolon-separated declaration is not emitted; bare /…/ regex literals are not masked (lexically ambiguous with division), so a brace inside one can desync depth for the rest of that file — extended #/…/# literals are masked correctly; comments or raw/multiline literals nested inside string interpolations, emoji identifiers, and #if branches whose alternative headers declare differently named containers are best-effort (sam
Câu hỏi thường gặp
Nó xử lý những ngôn ngữ nào?
TypeScript và Swift, kể cả các repo có cả hai.
Nó có kiểm tra kiểu không?
Không. Phần TypeScript chỉ là một lượt phân tích cú pháp và không chạy kiểm tra kiểu.
Cần cài gì?
Node phiên bản 23.6 trở lên, hoặc một công cụ tên là tsx.
Chi tiết
Mô tả gốc của tác giả
Generate a single-file compressed symbol map of a TypeScript or Swift repository — files, exported symbols, typed signatures, plugin boundaries — sized to fit an LLM context window. Use for whole-project reasoning: duplication hunting, refactor planning, architecture recon, or feeding another agent a full-project map.
repo: steipete/agent-scripts
Độ phổ biến
- Sao GitHub
- 7.4k
- Vị trí xếp hạng
- #13242
- Giấy phép
- MIT
- Cập nhật
- 30/10/2026
Bình luận
- …
Thêm skill từ kho mã này
beeper
7.4kGiúp agent của bạn tìm trong lịch sử chat Beeper cục bộ để tìm tin nhắn và xác định chat hoặc liên hệ nào mà một gợi ý mơ hồ đang nhắc đến.
cloudflare-registrar
7.4kGiúp agent của bạn kiểm tra giá và tình trạng khả dụng của tên miền trên Cloudflare Registrar, và đăng ký hoặc liệt kê tên miền với bước xác nhận.
codexbar
7.4kGiúp agent của bạn kiểm tra còn bao nhiêu hạn mức sử dụng các dịch vụ AI như Codex, Claude và Kimi, gồm giới hạn, tín dụng và thời gian đặt lại.
create-cli
7.4kGiúp agent của bạn thiết kế lệnh, cờ, văn bản trợ giúp, đầu ra và lỗi của một công cụ dòng lệnh, để nó hoạt động tốt cho cả người lẫn script.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.