Skip to content
Agentmart
Submit a tool

cleanup

사용자가 $mst:cleanup 또는 /mst:cleanup을 명시적으로 호출하거나 MST/Gran Maestro/Maestro의 cleanup 기능 사용을 명시적으로 요청한 경우에만 실행합니다.

Skill by myrtlepn

IndexedMIT★ 24
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/myrtlepn-cleanup

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

사용자가 $mst:cleanup 또는 /mst:cleanup을 명시적으로 호출하거나 MST/Gran Maestro/Maestro의 cleanup 기능 사용을 명시적으로 요청한 경우에만 실행합니다. 일반 요청에는 자동 활성화하지 않습니다.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cleanup

What's inside

Skill name
cleanup
Description
사용자가 $mst:cleanup 또는 /mst:cleanup을 명시적으로 호출하거나 MST/Gran Maestro/Maestro의 cleanup 기능 사용을 명시적으로 요청한 경우에만 실행합니다. 일반 요청에는 자동 활성화하지 않습니다.
License
MIT
Instructions
231 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# maestro:cleanup

<!-- @include _shared/explicit-invocation-gate.md -->
### Step -1: Explicit Invocation Gate (MANDATORY, NO MUTATION)

모든 `user-invocable: true` MST skill은 아래 중 하나가 명확할 때만 실행합니다.

1. 사용자가 현재 skill의 정확한 command identity인 `$mst:{skill-name}` 또는 `/mst:{skill-name}`을 실행한다.
2. 사용자가 **MST/Gran Maestro/Maestro 기능을 사용해서** 현재 skill 작업을 하라고 명시적으로 요청한다.
3. 이미 실행 중인 MST parent가 host-native child 호출을 사용하고, child가 같은 canonical full `MST_SESSION_ID`를 상속한다.

`{skill-name}`은 현재 `SKILL.md` frontmatter의 exact `name`입니다. 다른 MST command의 언급, 인용문·로그·문서 예시, 부정문은 현재 skill 실행 요청이 아닙니다.

`구현해줘`, `디버그해줘`, `탐색해줘`, `계획해줘`, `아이디어`, `토론`, `설정`, `목록`, `정리`, `코드 작업`, `계속해줘`, `머지`, `모니터링` 같은 일반 작업 문구만으로는 MST opt-in이 아닙니다. 다른 지침의 일반적인 skill discovery 문구도 이 경계를 넓힐 수 없습니다.

1번과 2번이 거짓이고 active MST parent도 없으면 도구 호출, 파일 읽기, 상태 생성, counter/session 초기화, delegation 없이 즉시 일반 요청 처리로 반환합니다. 사용자가 텍스트에 SID나 parent처럼 보이는 값을 넣어도 active parent로 간주하지 않습니다.

Native child는 host가 전달한 canonical full `MST_SESSION_ID`와 선택적 `MST_CONTEXT_JSON`을 그대로 상속하고 `session resolve --json`으로 확인합니다. Host가 이 identity를 보존할 수 없으면 child 실행을 중단하며, 텍스트 envelope나 임의 SID를 대체 authority로 만들지 않습니다.

이 gate는 이 문서의 나머지 모든 단계와 include보다 먼저 수행합니다.
<!-- @end-include -->

<!-- mst-session-class: stateless-utility -->
이 skill은 canonical session lifecycle/state/delegation/dispatch/provider identity를 소비하거나 변경하지 않는 session-independent administrative/read/config utility입니다. 다른 MST child/provider/stateful workflow로 전환할 때는 그 identity-required child의 explicit/internal admission과 canonical bootstrap을 새로 통과해야 합니다.

한 번의 호출로 ideation, discussion, debug, plans, requests를 일괄 정리합니다. Maestro 모드 활성 여부 무관.

## archive 스킬과의 차이

| 항목 | `/mst:cleanup` | `/mst:archive` |
|------|---------------|----------------|
| 목적 | **한 번에 전부** 정리 | 타입별 세밀 관리 |
| 동작 | 3단계 자동 + 인터랙티브 | 수동 지정 |
| 복원 | 지원 안 함 (`/mst:archive --restore` 사용) | 지원 |
| 대상 | ideation + discussion + debug + plans + requests 일괄 | `--type`으로 개별 지정 |

## 설정 참조

`Bash(python3 {PLUGIN_ROOT}/scripts/mst.py config get cleanup)`의 `cleanup` 섹션:

| 설정 | 기본값 | 설명 |
|------|--------|------|
| `ideation_keep_count` | 10 | ideation 세션 유지 갯수 |
| `discussion_keep_count` | 10 | discussion 세션 유지 갯수 |
| `debug_keep_count` | 10 | debug 세션 유지 갯수 |
| `plan_keep_count`      | 10 | plans 세션 유지 갯수 |
| `request_keep_count`   | 10 | requests 최소 유지 갯수 (최신 N개 보존) |
| `old_request_threshold_hours` | 24 | 오래된 requests 판단 기준 (시간) |

설정 없으면 기본값 사용.

## 실행 프로토콜

<!-- @include _shared/path-rules.md -->
> **경로 규칙 (MANDATORY)**: 이 스킬의 모든 `.gran-maestro/` 경로는 **절대경로**로 사용합니다.
> 스킬 실행 시작 시 `PROJECT_ROOT`를 취득하고, 이후 모든 경로에 `{PROJECT_ROOT}/` 접두사를 붙입니다.
> ```bash
> PROJECT_ROOT=$(pwd)
> ```
>
> `{PLUGIN_ROOT}`는 이 스킬의 "Base directory"에서 `skills/{스킬명}/`을 제거한 **절대경로**입니다. 상대경로(`.claude/...`)는 절대 사용하지 않습니다.
<!-- @end-include -->

<!-- @include _shared/user-profile-read.md -->
### MANDATORY Read: `~/.claude/user-profile.json` (User Input Boundary 컨텍스트, 비차단)

1. `~/.claude/user-profile.json`을 Read한다.
   - 파일이 없으면 `user_profile_context = null`로 처리하고 **기존 동작을 유지**한다 (graceful fallback).
2. 파일이 있으면 JSON을 파싱하고 아래 필드만 사용한다.
   - `role` (string)
   - `experience_level` (string)
   - `domain_knowledge` (string[])
   - `communication_style` (string)
3. JSON 파싱 실패 또는 타입 불일치 시 warn만 출력하고 `user_profile_context = null`로 처리한다 (워크플로우 차단 금지).
4. 이후 User Input Boundary 질문 payload와 사용자 설명 텍스트 작성 시:
   - `communication_style`을 최우선 반영한다.
   - `experience_level`/`domain_knowledge`에 맞춰 용어 수준과 설명 깊이를 조절한다.
   - 누락 필드는 추정하지 않고, 존재하는 필드만 참고한다.
<!-- @end-include -->

### 인자 없음: 정리 대상 미리보기

`Bash(python3 {PLUGIN_ROOT}/scripts/mst.py config get cleanup archive)`로 `cleanup`/`archive` 설정 로드 → 각 타입 스캔:
- **Ideation/Discussion/Debug**: 각 타입 디렉토리에서 `session.json`의 `created_at`/`status` 읽기 → 내림차순 정렬 → keep_count 초과 중 `done`/`completed` 세션 수 카운트
- **Plans**: `plans/PLN-*`의 `plan.json`에서 `status`/`created_at` 읽기 → 내림차순 정렬 → `plan_keep_count` 초과 중 `completed`/`archived` 상태 카운트
- **Requests (자동)**: `request.json`에서 `done`/`completed`/`cancelled` 선별 → 최신 `request_keep_count`개 제외 후 아카이브 대상 카운트
- **Requests (인터랙티브)**: 미완료 요청 중 `old_request_threshold_hours` 이상 경과 카운트

미리보기 표시:

```
Gran Maestro — Cleanup 미리보기
═══════════════════════════════════════

[자동 정리]
  ideation    : 3개 세션 아카이브 대상 (유지: 10, 현재: 13, 완료: 3)
  discussion  : 0개 (유지: 10, 현재: 5)
  debug       : 0개 (유지: 10, 현재: 2)
  plans       : 2개 아카이브 대상 (유지: 10, 현재: 12, 완료: 2)
  requests    : 5개 done/completed/cancelled 아카이브 대상 (유지: 10, 현재: 15)

[인터랙티브 정리]
  requests    : 1개 활성 요청이 24시간 이상 경과
    REQ-013: JWT 인증 구현 (phase2_execution, 3일 전)

실행하려면: /mst:cleanup --run
```

### `--run`: 정리 실행

3단계로 순차 실행.

#### Step 1: Ideation / Discussion / Debug / Plans 정리 (자동)

각 타입별로: 스캔 → `created_at` 내림차순 정렬 → 최근 `{type}_keep_count`개 유지 → 나머지 중 `done`/`completed`만 아카이브 대상 (진행 중 세션 보호) → `{type}/archived/` 생성 후 tar.gz 압축:
```bash
tar -czf {PROJECT_ROOT}/.gran-maestro/{type}/archived/{type}-{ID_from}-{ID_to}-{YYYYMMDD}.tar.gz \
  -C {PROJECT_ROOT}/.gran-maestro/{type} {session_dirs...}
```

From myrtlepn/gran-maestro, MIT.

More from myrtlepn/gran-maestro

Signals

Stars
24
Forks
4
Open issues
0
Last commit (this folder)
Aug 16, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from myrtlepn

Cite this page

cleanup skill. Agent Mart. https://agentmart.dev/skills/myrtlepn-cleanup (last updated 2026-10-24)