T09 · Insecure Skill Coding Practices
- Location
migration.md:81- Finding
Contradictory migration procedure can cause destructive loss or duplication of user data
- Content
View full analysis
Vulnerability Details
File Location:
migration.md, lines 81–92
Vulnerability Type: Unsafe and internally contradictory filesystem migration
Risk Level: MediumVulnerable Code Snippet
The following is a faithful English rendering of the affected migration instructions:
markdown 2. Migrate files: - `someday/ideas.md` → `commitments/0_dream/ideas.md` - `goals/active.md` → `commitments/1_intent/active.md` - `projects/active.md` → `commitments/2_queued/active.md` - `tasks/next-actions.md` → `commitments/3_committed/next-actions.md` - `tasks/this-week.md` → `commitments/3_committed/this-week.md` - `tasks/waiting.md` → `commitments/3_committed/waiting.md` - `tasks/done.md` → `commitments/4_done/achievements.md` - `projects/waiting.md` → `commitments/5_archived/waiting-projects.md` - `tasks/waiting.md` → `commitments/5_archived/waiting-tasks.md` (merge if it already exists) 3. Delete the old directories: `goals/`, `projects/`, `tasks/`, and `someday/`The post-migration checklist at
migration.md:226-230also contains conflicting requirements:markdown - No legacy file was deleted without explicit user approval. - `goals/someday.md`, `planning/`, and `reviews/` are fully removed.Technical Analysis
The migration maps the same source file,
tasks/waiting.md, to two different destinations. A move operation cannot safely satisfy both mappings unless the source is first copied or its contents are parsed and deterministically divided. The guide does not define such a procedure.The instructions then direct the agent to delete all legacy directories without requiring:
- A timestamped backup
- Destination collision detection
- A defined merge algorithm
- Verification that every source item reached its intended destination
- Explicit confirmation immediately before deletion
- A rollback procedure
This conflicts with the safeguards in ` ...[truncated 2013 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace the ambiguous dual mapping with a deterministic operation:
- Copy
tasks/waiting.mdto a temporary staging file. - Parse or merge its entries into both destinations according to documented classification rules.
- Preserve source identifiers to prevent duplicates.
- Copy
-
Require a timestamped backup before migration, for example:
text ~/productivity-backup-YYYYMMDD-HHMMSS/ -
Add destination safety checks:
- Detect whether each destination already exists.
- Never overwrite an existing file implicitly.
- Use an item-level merge with duplicate detection.
- Record merge conflicts for user review.
-
Add migration verification:
- Compare source and destination item counts.
- Confirm that every source entry has a destination.
- Validate that expected files and directories exist.
- Produce a migration summary before cleanup.
-
Separate migration from deletion:
- Complete and verify all copy or merge operations first.
- Keep legacy directories in a clearly marked backup state.
- Request explicit user confirmation immediately before deleting them.
-
Define a rollback process that restores the backup if verification fails.
-
Reconcile the contradictory instructions in
migration.mdandSKILL.mdso that all sections consistently prohibit automatic legacy deletion before verification and explicit approval.
-
