task-external-repos-pattern
Skill2 starsChanged 45 days agoMITView on GitHub
Documentation for the repos/ directory pattern — cloning external git
- Deletes or force-pushes
In this repository15 other files it gives its agents.
- compact-directory-memorySkill
- task-archaeologySkill
- task-artifact-integritySkill
- task-aware-project-workSkill
- task-context-storageSkill
- task-cross-machine-syncSkill
- task-frameworkSkill
- task-lifecycle-disciplineSkill
- task-lifecycle-edge-casesSkill
- task-lifecycle-portabilitySkill
- task-nested-subtask-lifecycleSkill
- task-requirement-intakeSkill
- task-root-git-operationsSkill
- task-timestamp-conventionSkill
- task-trackerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
When a task needs to clone one or more external git repositories for analysis, auditing, or code extraction.
- Very specific: line 45
Place cloned repos in a top-level repos/ directory inside the task:
- Very specific: line 117
Add a ## 环境要求 note to TASK.md for large repos that consume significant disk space.
- Distinctive: line 135
When a task involves multiple independent external repos (e.g.
- Very specific: line 138
Create a single task-framework task with its own repos/ directory
- Distinctive: line 139
If using an external task manager (kanban board, issue tracker, etc.), create one card/issue for that task and link it via the task hash
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
External Repositories in Tasks (repos/ Pattern)
When to Use
When a task needs to clone one or more external git repositories for analysis, auditing, or code extraction. Common scenarios:
- Research task — clone a list of repos from an awesome-list to study their structure
- Audit task — clone a repo to analyze its codebase, commit history, or architecture
- Integration task — clone dependencies to understand their API surface
- Migration tasks — clone source repos as input material for migration scripts
Directory Convention
Place cloned repos in a top-level repos/ directory inside the task:
tasks/<ts>.<name>-<hash6>/
├── input/ ← declared source files (PDFs, REQUIREMENTS.md)
├── output/ ← generated files (reports, docs, logs)
│ ├── docs/
│ └── logs/
├── repos/ ← *** cloned external git repos ***
│ ├── repo-name-1/
│ ├── repo-name-2/
│ └── ...
├── scripts/
├── TASK.md
├── README.md
└── .hermes-task.jsonSemantics: repos/ vs input/ vs output/
| Directory | Nature | task_reset --hard | Example content |
input/ | Source materials (copied from external source) | ❌ Never deleted | PDFs, REQUIREMENTS.md, images |
output/ | Generated artifacts | ✅ Deleted | Reports, logs, compiled files |
repos/ | External git clones (not external source, not generated) | ❌ Never deleted | Cloned .git/ trees |
Key rule: repos/ is treated like input/ — never deleted by cleanup operations. When scripts/clean.sh exists in the task, it explicitly declares repos/ as PRESERVED. When no clean.sh exists, task_reset --hard still only touches output/, so repos/ survives regardless — but adding an explicit clean.sh makes the intent auditable.
How to Add repos/ to a Task
During task creation:
mkdir -p tasks/<ts>.<name>-<hash6>/{input,output/docs,output/logs,repos,scripts}Clone each target repo into repos/:
cd tasks/<ts>.<name>-<hash6>/repos
git clone https://github.com/owner/repo-name.gitFor large repos where full history isn't needed:
git clone --depth 1 https://github.com/owner/repo-name.gitHow to Reference repos in TASK.md
In the Data Flow table:
## Data Flow
| 文件 | 来源 | 用途 | 格式说明 |
|------|------|------|---------|
| `repos/owner-repo/README.md` | 外部克隆 | 分析项目结构 | 标准 markdown |In the checklist:
- [ ] Phase 2 — Clone repos to repos/
- [ ] Phase 3 — Analyze repos/ structureCleanup Considerations
repos/is NOT cleaned bytask_reset --hard. To reclone (stale repos), do so manually or via a dedicated Phase.- Cloned repos retain their
.git/directories —git pullis sufficient to update without a full reclone. - Add a
## 环境要求note to TASK.md for large repos that consume significant disk space.
Pitfalls
- Don't put cloned repos in
output/— they'd be wiped bytask_reset --hard, losing.git/history and requiring a full reclone. - Don't put them in
input/—input/is for declared source files (PDFs, REQUIREMENTS.md). Cloned repos are a different category. - Beware submodules — use
git clone --recursiveif the repo uses submodules; expect larger clones. - Disk space — for massive repos (OSSU CS at GBs, dotnet docs), consider
--depth 1shallow clone unless full history is needed. - Path length on Windows/WSL — very deep paths in cloned repos may cause issues under WSL. Keep task names short enough.
Relation to Task-Framework
This pattern extends the task-framework skill's directory structure. The task-framework SKILL.md now lists repos/ in its canonical directory tree and documents the scripts/clean.sh custom cleanup mechanism.
For task_reset --hard semantics: repos/ is never deleted by cleanup operations (same as input/). Custom clean.sh scripts can further refine which directories to protect.
Optional: Escalate to External Task Manager
When a task involves multiple independent external repos (e.g. cloning 5+ repos from an awesome-list for study), the work typically decomposes into parallel workstreams. The recommended convention is one tracking card per task-framework task (not one card per sub-operation):
Right approach:
- Create a single task-framework task with its own
repos/directory - If using an external task manager (kanban board, issue tracker, etc.), create one card/issue for that task and link it via the task hash
- Map the external card ID back to
.hermes-task.jsonif your workflow requires bidirectional linking
Wrong approach:
- Creating one tracking card per individual sub-repo
- Mixing unrelated work into one card
Custom Clean Methods (Implemented)
Each task can protect sensitive directories from cleanup via a scripts/clean.sh script:
查找顺序(由 task_reset --hard 执行):
- 检查
tasks/<ts>.<name>-<hash6>/scripts/clean.sh— 存在则执行它(替代默认行为) - 不存在 → 回退到默认
rm -rf output/
clean.sh 模板:
#!/usr/bin/env bash
set -euo pipefail
TASK_DIR="$(cd "$(dirname "$0")/.." && pwd)"
# 明确声明要保留的路径
echo "[clean] repos/ — PRESERVED (cloned repos)"
echo "[clean] input/ — PRESERVED (source materials)"
# 只清理 output/
rm -rf "$TASK_DIR/output"
mkdir -p "$TASK_DIR/output"/{docs,logs}
echo "[clean] output/ cleaned"设计原则:
- clean.sh 只控制"删什么不删什么",不修改 TASK.md 或状态
- 输出中列出保留路径方便审计
- 没有 clean.sh 时回退到默认行为,不破坏现有任务
本 task 的 clean.sh 示例路径:
tasks/<ts>.<task-name>-<hash6>/scripts/clean.sh
该脚本保护 repos/、input/,只清理 output/。
Framework 集成状态:
task-frameworkSKILL.md 已更新,记录了 clean.sh 查找顺序和模板analysistask-type 生命周期文档也加了自定义清理的提示
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

