AGENT SKILL

project-tree

Generate a visual directory tree of the ~/projects folder and update MEMORY.md with the result. Use when the user wants to view, update, or generate a project tree structure, or when they mention "project tree", "tree view", "folder structure", or "show me my projects".

License 许可
MIT
最近更新
2026-08-23
Stars
★ 1
Forks
0

01 前言 Front Matter

name
project-tree
description
Generate a visual directory tree of the ~/projects folder and update MEMORY.md with the result. Use when the user wants to view, update, or generate a project tree structure, or when they mention "project tree", "tree view", "folder structure", or "show me my projects".

02 资源文件 2

03 SKILL.md 正文

Project Tree

Overview

Generate a visual tree structure of the ~/projects directory and automatically update MEMORY.md with the current project organization. The tree shows folders and .md files only, with smart grouping for consecutive numbered items.

Usage

Run the tree generation script:

node ~/clawd/skills/project-tree/scripts/project-tree.js

Or use the convenience wrapper:

~/clawd/scripts/update-tree

Features

  • Folder-only + .md files: Only displays directories and markdown files, hiding code files and dependencies
  • Smart grouping: Detects consecutive numbered sequences (e.g., script1-video, script2-video...) and collapses them into script[1-28]-video/ (28 items)
  • Auto-updates MEMORY.md: The tree is automatically inserted into the PROJECT_TREE section of MEMORY.md
  • Configurable depth: Default is 3 levels deep (adjustable in script)

Configuration

Edit these values in scripts/project-tree.js:

  • MAX_DEPTH: Number of directory levels to display (default: 3)
  • EXCLUDE_DIRS: Directories to skip (node_modules, .git, etc.)
  • ROOT_DIR: Base directory to scan (default: ~/projects)

Automation (Hook)

You can automate project tree updates to run on every session /reset.

1. Enable Internal Hooks

Add to your clawdbot.json:

{
  "hooks": {
    "internal": {
      "enabled": true
    }
  }
}

2. Create the Hook

Create ~/.clawdbot/hooks/reset-project-tree/HOOK.md:

---
name: reset-project-tree
description: "Generate project tree on session reset"
metadata: {"clawdbot":{"emoji":"?","events":["command:reset"],"requires":{"bins":["node"]}}}
---

Generates project tree when /reset is issued.

Create ~/.clawdbot/hooks/reset-project-tree/handler.ts:

import { execSync } from 'child_process';
import type { HookHandler } from '../../../src/hooks/hooks.js';

const handler: HookHandler = async (event) => {
  if (event.type !== 'command' || event.action !== 'reset') return;

  try {
    const scriptPath = `${event.context.workspaceDir}/skills/project-tree/scripts/project-tree.js`;
    execSync(`node ${scriptPath}`, { cwd: event.context.workspaceDir, stdio: 'pipe' });
    console.log('[reset-project-tree] Updated');
  } catch (err) {
    console.error('[reset-project-tree] Failed:', err instanceof Error ? err.message : String(err));
  }
};

export default handler;

3. Enable and Restart

clawdbot hooks enable reset-project-tree
clawdbot gateway restart

Resources

scripts/

  • project-tree.js - Main tree generation script with smart grouping logic

04 同仓库更多 Skills

kbarbel640-del
kbarbel640-del/skills

crowd-prompting

A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.

内容创作者
★ 1
kbarbel640-del
kbarbel640-del/skills

dilemm-ai

Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).

Skill与智能体开发
★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

资料检索与研究
★ 1
kbarbel640-del
kbarbel640-del/skills

arxiv-paper-reviews

Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.

资料检索与研究
★ 1
kbarbel640-del
kbarbel640-del/skills

git-summary

Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.

★ 1
kbarbel640-del
kbarbel640-del/skills

agent-constitution

Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.

律师与法务Skill与智能体开发
★ 1