project-structure
Fungsinya
Skill ini membuat satu berkas peta terkompresi dari proyek kode, yang mencantumkan berkas, nama yang diekspor, dan tanda tangan. Skill ini untuk pengembang yang ingin agent bernalar tentang seluruh basis kode sekaligus.
Kapan dipakai
- βSaat Anda menginginkan gambaran besar dari proyek TypeScript atau Swift yang besar.
- βKetika Anda mencari kode yang duplikat atau merencanakan refaktor.
- βSaat Anda ingin memberikan peta lengkap proyek kepada agent lain.
Link skill
https://github.com/steipete/agent-scripts/blob/main/skills/project-structure/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat peta padat proyek TypeScript ini supaya kita bisa mencari kode yang duplikat di seluruh proyek.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menjalankan skrip yang disertakan pada folder proyek. Agent menulis satu berkas peta yang berisi berkas, simbol, dan tanda tangan, lalu melaporkan seberapa besar hasilnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
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
Pertanyaan umum
Bahasa apa yang ditangani?
TypeScript dan Swift, termasuk repositori yang memuat keduanya.
Apakah skill ini memeriksa tipe?
Tidak. Bagian TypeScript hanya melakukan parsing dan tidak menjalankan pemeriksaan tipe.
Apa yang perlu dipasang?
Node versi 23.6 atau lebih baru, atau alat bernama tsx.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 7.4k
- Peringkat
- #13242
- Lisensi
- MIT
- Diperbarui
- 30/10/2026
Komentar
- β¦
Skill lain dari repositori ini
beeper
7.4kMembantu agent Anda mencari riwayat obrolan Beeper lokal untuk menemukan pesan dan mengetahui obrolan atau kontak mana yang dimaksud oleh petunjuk yang samar.
cloudflare-registrar
7.4kMembantu agent Anda memeriksa harga dan ketersediaan domain Cloudflare Registrar, serta mendaftarkan atau mencantumkan domain dengan langkah konfirmasi.
codexbar
7.4kMembantu agent Anda memeriksa sisa penggunaan layanan AI seperti Codex, Claude, dan Kimi, termasuk batas, kredit, dan waktu reset.
create-cli
7.4kMembantu agent Anda merancang perintah, flag, teks bantuan, keluaran, dan error sebuah alat baris perintah agar berfungsi untuk orang maupun skrip.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.