list-and-count-directories
यह क्या करती है
यह स्किल AI एजेंट को किसी डायरेक्टरी के भीतर केवल फ़ोल्डर सूचीबद्ध करने और उनकी गिनती करने का तरीका बताती है। यह उन लोगों के लिए है जिन्हें किसी प्रोजेक्ट के मॉड्यूल, स्किल या रिपॉज़िटरी की सूची चाहिए।
कब इस्तेमाल करें
- ✓जब आप किसी प्रोजेक्ट या स्किल्स डायरेक्टरी के भीतर फ़ोल्डरों की गिनती चाहते हों।
- ✓जब दस्तावेज़ या समीक्षा के लिए सब-फ़ोल्डरों की क्रमांकित सूची चाहिए।
- ✓जब आप किसी रिपॉज़िटरी को देख रहे हों और उसकी संरचना का त्वरित सार चाहते हों।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/list-and-count-directories/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी स्किल्स डायरेक्टरी के सभी फ़ोल्डर सूचीबद्ध कीजिए, छिपे हुए छोड़ दीजिए, और बताइए कि कुल कितने हैं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट डायरेक्टरी की सामग्री लेता है, केवल फ़ोल्डर के रूप में चिह्नित प्रविष्टियां रखता है, और dot files जैसी छिपी प्रविष्टियां हटा देता है। फिर वह बचे फ़ोल्डरों की क्रमांकित सूची दिखाता है और कुल संख्या बताता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
List and Count Directories
This skill provides a systematic workflow for listing and counting directories within a given path using the list_dir tool. It filters results to identify directories, excludes hidden and system entries, and presents both an enumerated list and a total count.
Use Cases
- Project structure analysis
- Skill or module inventory
- Repository exploration
- Directory auditing and documentation
Workflow
Step 1: Get Directory Contents
Use list_dir to retrieve the contents of the target path:
list_dir(path="/path/to/target")
Step 2: Identify Directories
Filter the results to identify directory entries. Directories are marked by permissions starting with d in Unix ls format (e.g., drwxr-xr-x).
Recognition pattern:
- Look for entries where the permissions field starts with
d - Common directory permission patterns:
drwxr-xr-x,drwxrwxr-x,drwx------, etc.
Step 3: Exclude Hidden and System Entries
Filter out entries that should not be counted:
.(current directory)..(parent directory).DS_Store(macOS metadata)- Other hidden files starting with
.(optional, depending on requirements)
Step 4: Create Enumerated List
Present the directories as a numbered list for easy reference:
1. directory-name-1
2. directory-name-2
3. directory-name-3
...
Step 5: Provide Total Count
Calculate and report the total number of directories found:
Total: N directories
Implementation Example
When implementing this workflow programmatically, use the following approach:
# Pseudo-code for filtering directories
directories = []
for entry in dir_listing:
# Check if entry is a directory (starts with 'd')
if entry['permissions'].startswith('d'):
name = entry['name']
# Exclude hidden/system entries
if name not in ['.', '..', '.DS_Store']:
directories.append(name)
# Sort for consistent ordering
directories.sort()
# Present enumerated list
for i, dirname in enumerate(directories, 1):
print(f"{i}. {dirname}")
# Provide total count
print(f"\nTotal: {len(directories)} directories")
Tips
- Sorting: Always sort directory names alphabetically for consistent, predictable output
- Context: Mention the path being analyzed for clarity
- Validation: If the count is zero, verify the path exists and contains directories
- Extensions: This pattern can be adapted to filter for files, specific extensions, or other criteria
Common Patterns
Basic directory listing with count:
Directories in /skills:
1. authentication-helpers
2. data-processing
3. workflow-automation
Total: 3 directories
With additional context:
Found 3 skill directories in /skills:
1. authentication-helpers
2. data-processing
3. workflow-automation
Including path context:
Directory inventory for /path/to/modules:
- module-a
- module-b
- module-c
Count: 3 directories
Related Techniques
- Use similar filtering logic to count files instead of directories (permissions starting with
-) - Extend to filter by modification date, size, or naming patterns
- Combine with recursive directory traversal for deep structure analysis
अक्सर पूछे जाने वाले सवाल
एजेंट कैसे जानता है कि प्रविष्टि फ़ोल्डर है?
Unix-शैली की सूचियों में फ़ोल्डरों की अनुमति का पहला अक्षर d होता है।
क्या छिपे फ़ोल्डर गिने जाते हैं?
स्किल dot files जैसी छिपी और सिस्टम प्रविष्टियां बाहर रखती है, हालांकि इसे बदला जा सकता है।
क्या फ़ाइलें भी सूचीबद्ध होती हैं?
नहीं, स्किल सूची और गिनती के लिए केवल डायरेक्टरी प्रविष्टियां रखती है।
जानकारी
लेखक का मूल विवरण
List and count directories in a path by filtering list_dir results for directory entries and excluding hidden/system files
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #13060
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।