planning-with-files

작성자: microsoft

**복잡한 작업에 사용하세요.** Manus 스타일의 파일 기반 계획을 구현하여 다단계 작업을 수행합니다. task_plan.md, findings.md, progress.md를 생성하여…

npx skills add https://github.com/microsoft/semantic-link-labs --skill planning-with-files

Planning with Files

Work like Manus: Use persistent markdown files as your "working memory on disk." This skill helps you plan, track, and checkpoint complex tasks that span multiple files, APIs, or sessions.

WHEN TO USE THIS SKILL

ALWAYS use this skill when:

  • Task involves 3+ phases or steps
  • Implementing wrappers for multiple REST APIs
  • Migrating or refactoring code across multiple files
  • Research tasks requiring exploration
  • Any task requiring >5 tool calls
  • Work that may span multiple sessions
  • Tasks with dependencies between components

Skip this skill for:

  • Simple questions or quick lookups
  • Single-file edits
  • Tasks completable in 1-2 tool calls

The Core Principle

Context Window = RAM (volatile, limited)
Filesystem = Disk (persistent, unlimited)

-> Anything important gets written to disk.
-> After ~50 tool calls, you FORGET original goals.
-> Re-reading plan files keeps goals in your attention window.

File Structure

All planning files go in .agent_cache/<task-name>/:

.agent_cache/
└── <task-name>/
    ├── task_plan.md    # Phases, progress, decisions (YOUR ROADMAP)
    ├── findings.md     # Research, discoveries, technical decisions
    └── progress.md     # Session log, test results, files modified

Naming Convention

  • Use lowercase with hyphens for <task-name>
  • Be descriptive but concise
  • Examples:
    • .agent_cache/add-admin-apis/
    • .agent_cache/migrate-lakehouse-module/
    • .agent_cache/add-direct-lake-functions/

The 3-File Pattern

FilePurposeWhen to Update
task_plan.mdPhases, progress, current statusAfter each phase completes
findings.mdResearch, discoveries, decisionsAfter ANY discovery
progress.mdSession log, test results, errorsThroughout session

Quick Start: Before ANY Complex Task

# 1. Create the planning directory
mkdir -p .agent_cache/<task-name>

# 2. Create all 3 files using templates below
# 3. Re-read plan before major decisions
# 4. Update after each phase completes

Critical Rules

Rule 1: Create Plan FIRST

Never start a complex task without task_plan.md. Non-negotiable.

Rule 2: The 2-Action Rule

"After every 2 view/search/explore operations, IMMEDIATELY save key findings to files."

This prevents information from being lost as context grows.

Rule 3: Read Before Decide

Before major decisions, read the plan file. This pushes goals into your attention window.

Rule 4: Update After Act

After completing any phase:

  • Mark phase status: in_progress -> complete
  • Log files created/modified
  • Note any errors encountered

Rule 5: Log ALL Errors

Every error goes in the plan file. This builds knowledge and prevents repetition.

Rule 6: Never Repeat Failures

if action_failed:
    next_action != same_action

Track what you tried. Mutate the approach.


The 3-Strike Error Protocol

ATTEMPT 1: Diagnose & Fix
  -> Read error carefully
  -> Identify root cause
  -> Apply targeted fix

ATTEMPT 2: Alternative Approach
  -> Same error? Try different method
  -> Different tool? Different pattern?
  -> NEVER repeat exact same failing action

ATTEMPT 3: Broader Rethink
  -> Question assumptions
  -> Search for solutions (use github-repo-explore skill)
  -> Consider updating the plan

AFTER 3 FAILURES: Escalate to User
  -> Explain what you tried
  -> Share the specific error
  -> Ask for guidance

Workflow: The Agent Loop

+--------------------------------------------+
|  1. READ PLAN                              |
|     - cat .agent_cache/<task>/task_plan.md |
|     - Understand current phase             |
|     - Review goals                         |
+--------------------------------------------+
|  2. ANALYZE                                |
|     - What's the next task?                |
|     - Are there blockers?                  |
|     - Do I have what I need?               |
+--------------------------------------------+
|  3. EXECUTE                                |
|     - Perform ONE logical action           |
|     - Write code to files                  |
|     - Run tests                            |
+--------------------------------------------+
|  4. UPDATE FILES                           |
|     - Log progress in progress.md          |
|     - Save discoveries in findings.md      |
|     - Update status in task_plan.md        |
+--------------------------------------------+
|  5. REPEAT                                 |
|     - Read plan again before next phase    |
+--------------------------------------------+

Template: task_plan.md

# Task Plan: [Brief Description]

## Goal
[One clear sentence describing the end state]

## Current Phase
Phase 1

## Guidelines
<!-- Project-specific constraints and references -->
- Follow numpydoc style for docstrings
- Use `@log` decorator for all public functions
- Use `_base_api` helper for REST calls
- Reference: [add-function skill](../../.claude/skills/add-function/SKILL.md)
- Reference: [rest-api-patterns skill](../../.claude/skills/rest-api-patterns/SKILL.md)

---

## Phases

### Phase 1: Requirements & Discovery
- [ ] Understand user intent and scope
- [ ] Identify files/APIs involved
- [ ] Document findings in findings.md
- **Status:** in_progress

### Phase 2: Dependency Analysis
- [ ] Map dependencies between components
- [ ] Determine implementation order
- [ ] Update plan with detailed tasks
- **Status:** pending

### Phase 3: Implementation
- [ ] Implement each component in order
- [ ] Write code following project conventions
- [ ] Document decisions in findings.md
- **Status:** pending

### Phase 4: Testing
- [ ] Write unit tests (see write-tests skill)
- [ ] Run tests with `pytest -sv tests/ -k <test_name>`
- [ ] Document results in progress.md
- **Status:** pending

### Phase 5: Completion
- [ ] Run code style checks: `black src/sempy_labs tests && flake8 src/sempy_labs tests`
- [ ] Verify all checkboxes complete
- [ ] Mark directory as done
- **Status:** pending

---

## Errors Encountered
| Error | Attempt | Resolution |
|-------|---------|------------|
|       |         |            |

---

## Decisions Made
| Decision | Rationale |
|----------|-----------|
|          |           |

Template: findings.md

# Findings & Decisions

## Task
[Brief description of the task]

---

## Requirements
<!-- Captured from user request -->
-

## Research Findings
<!-- Key discoveries during exploration -->
<!-- UPDATE AFTER EVERY 2 SEARCH/EXPLORE OPERATIONS -->
-

## Code Patterns Found
<!-- Existing patterns in codebase to follow -->
| Pattern | Location | Usage |
|---------|----------|-------|
|         |          |       |

## Technical Decisions
| Decision | Rationale |
|----------|-----------|
|          |           |

## Files to Modify
| File | Change |
|------|--------|
|      |        |

## API/Function Inventory
<!-- For API wrapper tasks -->
| Function | Source | Status |
|----------|--------|--------|
|          |        |        |

## Issues Encountered
| Issue | Resolution |
|-------|------------|
|       |            |

## External References
<!-- Links to docs, GitHub repos, etc. -->
-

Template: progress.md

# Progress Log

## Session: [DATE]

### Phase 1: [Title]
- **Status:** in_progress
- **Started:** [timestamp]
- Actions taken:
  -
- Files created/modified:
  -

### Phase 2: [Title]
- **Status:** pending
- Actions taken:
  -
- Files created/modified:
  -

---

## Test Results
| Test | Expected | Actual | Status |
|------|----------|--------|--------|
|      |          |        |        |

---

## Commands Run
```bash
# Useful commands executed during this session

Session Notes


---

## Project-Specific Patterns

### For Semantic Link Labs API Wrapper Tasks

When implementing REST API wrappers, include in findings.md:

```markdown
## API Analysis
| API | Fabric Path | Power BI Path | Notes |
|-----|-------------|---------------|-------|
| list_items | /v1/workspaces/{id}/items | /v1.0/myorg/groups/{id}/... | Paginated |

## Implementation Pattern
- Use `_base_api` helper for all REST calls
- Use `resolve_workspace_name_and_id` for workspace resolution
- Use `_create_dataframe` for empty DataFrame initialization
- Return `pandas.DataFrame` for list operations

## Required Decorator
- `@log` -- Enable logging and telemetry

## Function Naming
| Prefix | Use Case |
|--------|----------|
| `list_` | Retrieves a collection |
| `get_` | Retrieves a single item |
| `create_` | Creates a new resource |
| `update_` | Modifies existing resource |
| `delete_` | Removes a resource |

For Test Writing Tasks

Include in findings.md:

## Test Structure
| Type | Location |
|------|----------|
| Unit tests | tests/ |

## Key Patterns
- Use `pytest.mark.parametrize` for multiple inputs
- Mock `_base_api` for API wrapper tests
- Use `_create_dataframe` to verify empty DataFrame structure
- See write-tests skill for full patterns

Completion Workflow

After finishing all work:

# 1. Verify all checkboxes are marked complete
grep -c "\[x\]" .agent_cache/<task-name>/task_plan.md
grep -c "\[ \]" .agent_cache/<task-name>/task_plan.md

# 2. Rename directory with [done] suffix
mv .agent_cache/<task-name> .agent_cache/<task-name>-[done]

The 5-Question Reboot Test

When resuming work, verify you can answer:

QuestionAnswer Source
Where am I?Current phase in task_plan.md
Where am I going?Remaining phases
What's the goal?Goal statement in plan
What have I learned?findings.md
What have I done?progress.md

If you can't answer these, read all 3 planning files before continuing.


Read vs Write Decision Matrix

SituationActionReason
Just wrote a fileDON'T readContent still in context
After 2+ searchesWrite findings NOWBefore info is lost
Starting new phaseRead plan/findingsRe-orient context
Error occurredRead relevant fileNeed current state
Resuming after gapRead ALL planning filesRecover state
Before major decisionRead task_plan.mdRefresh goals

Anti-Patterns

Don'tDo Instead
Start executing immediatelyCreate plan file FIRST
State goals once and forgetRe-read plan before decisions
Hide errors and retry silentlyLog errors to plan file
Stuff everything in contextStore large content in files
Repeat failed actionsTrack attempts, mutate approach
Skip testingAlways include test tasks

Example: Adding Admin API Wrappers

task_plan.md

# Task Plan: Add Admin Workspace APIs

## Goal
Implement wrapper functions for Fabric Admin Workspace APIs in the sempy_labs.admin module.

## Current Phase
Phase 3

## Guidelines
- Use `@log` decorator on all public functions
- Use `_base_api` helper for REST calls
- Reference: add-function skill, rest-api-patterns skill

---

## Phases

### Phase 1: Requirements & Discovery
- [x] Read Fabric Admin API documentation
- [x] Identify workspace-related endpoints
- [x] Document in findings.md
- **Status:** complete

### Phase 2: Dependency Analysis
- [x] Check existing workspace implementations
- [x] Create function inventory
- **Status:** complete

### Phase 3: Implementation
- [x] `list_workspaces`
- [x] `get_workspace`
- [ ] `list_workspace_access_details`
- [ ] `update_workspace`
- **Status:** in_progress

### Phase 4: Testing
- [ ] Write unit tests with mocks
- [ ] Run tests
- **Status:** pending

### Phase 5: Completion
- [ ] Run black, flake8
- [ ] Verify all tests pass
- **Status:** pending

---

## Errors Encountered
| Error | Attempt | Resolution |
|-------|---------|------------|
| Pagination not working | 1 | Need uses_pagination=True in _base_api |

Related Skills

SkillWhen to Use
add-functionAdding new API wrapper functions
rest-api-patternsREST API implementation patterns
write-testsWriting unit tests
code-styleRunning linters and formatters
run-testsRunning pytest locally
github-repo-exploreFinding reference implementations

microsoft의 다른 스킬

oss-growth
microsoft
OSS 성장 해커 페르소나
official
microsoft-foundry
microsoft
Foundry 에이전트를 엔드투엔드로 배포, 평가 및 관리: Docker 빌드, ACR 푸시, 호스팅/프롬프트 에이전트 생성, 컨테이너 시작, 배치 평가, 지속적 평가, 프롬프트 최적화 워크플로, agent.yaml, 트레이스에서 데이터셋 큐레이션. 용도: Foundry에 에이전트 배포, 호스팅 에이전트, 에이전트 생성, 에이전트 호출, 에이전트 평가, 배치 평가 실행, 지속적 평가, 지속적 모니터링, 지속적 평가 상태, 프롬프트 최적화, 프롬프트 개선, 프롬프트 최적화 도구, 에이전트 지침 최적화, 에이전트 개선...
officialdevelopmentdevops
azure-ai
microsoft
Azure AI: Search, Speech, OpenAI, Document Intelligence에 사용됩니다. 검색, 벡터/하이브리드 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR을 지원합니다. 사용 시점: AI Search, 쿼리 검색, 벡터 검색, 하이브리드 검색, 의미 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR, 텍스트를 음성으로 변환.
officialdevelopmentapi
azure-deploy
microsoft
이미 준비된 애플리케이션에 대해 기존 .azure/deployment-plan.md 및 인프라 파일이 있는 경우 Azure 배포를 실행합니다. 사용자가 새 애플리케이션 생성을 요청할 때는 이 스킬을 사용하지 말고 azure-prepare를 사용하세요. 이 스킬은 azd up, azd deploy, terraform apply, az deployment 명령을 내장된 오류 복구 기능과 함께 실행합니다. azure-prepare의 .azure/deployment-plan.md와 azure-validate의 검증 상태가 필요합니다. 사용 시점: "run azd up", "run azd deploy", "execute deployment",...
officialdevopsaws
azure-storage
microsoft
Azure Storage Services는 Blob Storage, File Shares, Queue Storage, Table Storage, Data Lake를 포함합니다. 스토리지 액세스 계층(hot, cool, cold, archive), 각 계층 사용 시기 및 계층 비교에 대한 질문에 답변합니다. 객체 스토리지, SMB 파일 공유, 비동기 메시징, NoSQL 키-값, 빅데이터 분석을 제공합니다. 수명 주기 관리를 포함합니다. 사용 용도: blob 스토리지, 파일 공유, 큐 스토리지, 테이블 스토리지, 데이터 레이크, 파일 업로드, blob 다운로드, 스토리지 계정, 액세스 계층,...
officialdevelopmentdatabase
azure-diagnostics
microsoft
Azure에서 AppLens, Azure Monitor, 리소스 상태 및 안전한 트라이지를 사용하여 Azure 프로덕션 문제를 디버그합니다. 사용 시기: 프로덕션 문제 디버그, 앱 서비스 문제 해결, 앱 서비스 높은 CPU, 앱 서비스 배포 실패, 컨테이너 앱 문제 해결, 함수 문제 해결, AKS 문제 해결, kubectl 연결 불가, kube-system/CoreDNS 오류, pod 보류 중, crashloop, 노드 준비 안 됨, 업그레이드 실패, 로그 분석, KQL, 인사이트, 이미지 풀 실패, 콜드 스타트 문제, 상태 프로브 실패,...
officialdevopsdevelopment
azure-prepare
microsoft
Azure 앱을 배포용으로 준비합니다(인프라 Bicep/Terraform, azure.yaml, Dockerfiles). 생성/현대화 또는 생성+배포에 사용하며, 크로스 클라우드 마이그레이션에는 사용하지 않습니다(azure-cloud-migrate 사용). 다음에는 사용하지 마십시오: copilot-sdk 앱(azure-hosted-copilot-sdk 사용). 사용 시점: "앱 생성", "웹 앱 빌드", "API 생성", "서버리스 HTTP API 생성", "프론트엔드 생성", "백엔드 생성", "서비스 빌드", "애플리케이션 현대화", "애플리케이션 업데이트", "인증 추가", "캐싱 추가", "Azure에 호스팅", "생성 및...
officialdevelopmentdevops
azure-validate
microsoft
Azure 배포 전 준비 상태 검증. 구성, 인프라(Bicep 또는 Terraform), RBAC 역할 할당, 관리 ID 권한, 사전 요구 사항에 대한 심층 점검을 실행합니다. 사용 시점: 내 앱 검증, 배포 준비 상태 확인, 사전 점검 실행, 구성 확인, 배포 가능 여부 확인, azure.yaml 검증, Bicep 검증, 배포 전 테스트, 배포 오류 문제 해결, Azure Functions 검증, 함수 앱 검증, 서버리스 검증...
officialdevopstesting