Prompt file imported from rafeekpro/frontendTrading (
.claude/commands/pm:import.md). Fill in{{arguments}}before use. Copyright stays with the author.
Import
Import existing GitHub issues into the PM system.
Usage
/pm:import [--epic <epic_name>] [--label <label>]
Options:
--epic- Import into specific epic--label- Import only issues with specific label- No args - Import all untracked issues
Required Documentation Access
MANDATORY: Before project management workflows, query Context7 for best practices:
Documentation Queries:
mcp://context7/agile/epic-management- epic management best practicesmcp://context7/project-management/issue-tracking- issue tracking best practicesmcp://context7/agile/task-breakdown- task breakdown best practicesmcp://context7/project-management/workflow- workflow best practices
Why This is Required:
- Ensures adherence to current industry standards and best practices
- Prevents outdated or incorrect implementation patterns
- Provides access to latest framework/tool documentation
- Reduces errors from stale knowledge or assumptions
Instructions
1. Fetch GitHub Issues
# Get issues based on filters
if [[ "{{arguments}}" == *"--label"* ]]; then
gh issue list --label "{label}" --limit 1000 --json number,title,body,state,labels,createdAt,updatedAt
else
gh issue list --limit 1000 --json number,title,body,state,labels,createdAt,updatedAt
fi
2. Identify Untracked Issues
For each GitHub issue:
- Search local files for matching github URL
- If not found, it's untracked and needs import
3. Categorize Issues
Based on labels:
- Issues with "epic" label ā Create epic structure
- Issues with "task" label ā Create task in appropriate epic
- Issues with "epic:{name}" label ā Assign to that epic
- No PM labels ā Ask user or create in "imported" epic
4. Create Local Structure
For each issue to import:
If Epic:
mkdir -p .claude/epics/{epic_name}
# Create epic.md with GitHub content and frontmatter
If Task:
# Find next available number (001.md, 002.md, etc.)
# Create task file with GitHub content
Set frontmatter:
name: {issue_title}
status: {open|closed based on GitHub}
created: {GitHub createdAt}
updated: {GitHub updatedAt}
github: https://github.com/{org}/{repo}/issues/{number}
imported: true
5. Output
š„ Import Complete
Imported:
Epics: {count}
Tasks: {count}
Created structure:
{epic_1}/
- {count} tasks
{epic_2}/
- {count} tasks
Skipped (already tracked): {count}
Next steps:
Run /pm:status to see imported work
Run /pm:sync to ensure full synchronization
Important Notes
Preserve all GitHub metadata in frontmatter.
Mark imported files with imported: true flag.
Don't overwrite existing local files.
