openplanr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +168 -0
  3. package/bin/planr.js +2 -0
  4. package/dist/cli/commands/checklist.d.ts +3 -0
  5. package/dist/cli/commands/checklist.d.ts.map +1 -0
  6. package/dist/cli/commands/checklist.js +34 -0
  7. package/dist/cli/commands/checklist.js.map +1 -0
  8. package/dist/cli/commands/epic.d.ts +3 -0
  9. package/dist/cli/commands/epic.d.ts.map +1 -0
  10. package/dist/cli/commands/epic.js +61 -0
  11. package/dist/cli/commands/epic.js.map +1 -0
  12. package/dist/cli/commands/feature.d.ts +3 -0
  13. package/dist/cli/commands/feature.d.ts.map +1 -0
  14. package/dist/cli/commands/feature.js +65 -0
  15. package/dist/cli/commands/feature.js.map +1 -0
  16. package/dist/cli/commands/init.d.ts +3 -0
  17. package/dist/cli/commands/init.d.ts.map +1 -0
  18. package/dist/cli/commands/init.js +49 -0
  19. package/dist/cli/commands/init.js.map +1 -0
  20. package/dist/cli/commands/rules.d.ts +3 -0
  21. package/dist/cli/commands/rules.d.ts.map +1 -0
  22. package/dist/cli/commands/rules.js +48 -0
  23. package/dist/cli/commands/rules.js.map +1 -0
  24. package/dist/cli/commands/status.d.ts +3 -0
  25. package/dist/cli/commands/status.d.ts.map +1 -0
  26. package/dist/cli/commands/status.js +38 -0
  27. package/dist/cli/commands/status.js.map +1 -0
  28. package/dist/cli/commands/story.d.ts +3 -0
  29. package/dist/cli/commands/story.d.ts.map +1 -0
  30. package/dist/cli/commands/story.js +81 -0
  31. package/dist/cli/commands/story.js.map +1 -0
  32. package/dist/cli/commands/task.d.ts +3 -0
  33. package/dist/cli/commands/task.d.ts.map +1 -0
  34. package/dist/cli/commands/task.js +76 -0
  35. package/dist/cli/commands/task.js.map +1 -0
  36. package/dist/cli/index.d.ts +2 -0
  37. package/dist/cli/index.d.ts.map +1 -0
  38. package/dist/cli/index.js +27 -0
  39. package/dist/cli/index.js.map +1 -0
  40. package/dist/generators/base-generator.d.ts +9 -0
  41. package/dist/generators/base-generator.d.ts.map +1 -0
  42. package/dist/generators/base-generator.js +9 -0
  43. package/dist/generators/base-generator.js.map +1 -0
  44. package/dist/generators/claude-generator.d.ts +7 -0
  45. package/dist/generators/claude-generator.d.ts.map +1 -0
  46. package/dist/generators/claude-generator.js +27 -0
  47. package/dist/generators/claude-generator.js.map +1 -0
  48. package/dist/generators/codex-generator.d.ts +7 -0
  49. package/dist/generators/codex-generator.d.ts.map +1 -0
  50. package/dist/generators/codex-generator.js +22 -0
  51. package/dist/generators/codex-generator.js.map +1 -0
  52. package/dist/generators/cursor-generator.d.ts +7 -0
  53. package/dist/generators/cursor-generator.d.ts.map +1 -0
  54. package/dist/generators/cursor-generator.js +37 -0
  55. package/dist/generators/cursor-generator.js.map +1 -0
  56. package/dist/generators/generator-factory.d.ts +5 -0
  57. package/dist/generators/generator-factory.d.ts.map +1 -0
  58. package/dist/generators/generator-factory.js +19 -0
  59. package/dist/generators/generator-factory.js.map +1 -0
  60. package/dist/generators/generator-types.d.ts +4 -0
  61. package/dist/generators/generator-types.d.ts.map +1 -0
  62. package/dist/generators/generator-types.js +2 -0
  63. package/dist/generators/generator-types.js.map +1 -0
  64. package/dist/models/schema.d.ts +79 -0
  65. package/dist/models/schema.d.ts.map +1 -0
  66. package/dist/models/schema.js +22 -0
  67. package/dist/models/schema.js.map +1 -0
  68. package/dist/models/types.d.ts +78 -0
  69. package/dist/models/types.d.ts.map +1 -0
  70. package/dist/models/types.js +2 -0
  71. package/dist/models/types.js.map +1 -0
  72. package/dist/services/artifact-service.d.ts +17 -0
  73. package/dist/services/artifact-service.d.ts.map +1 -0
  74. package/dist/services/artifact-service.js +63 -0
  75. package/dist/services/artifact-service.js.map +1 -0
  76. package/dist/services/checklist-service.d.ts +6 -0
  77. package/dist/services/checklist-service.d.ts.map +1 -0
  78. package/dist/services/checklist-service.js +26 -0
  79. package/dist/services/checklist-service.js.map +1 -0
  80. package/dist/services/config-service.d.ts +5 -0
  81. package/dist/services/config-service.d.ts.map +1 -0
  82. package/dist/services/config-service.js +38 -0
  83. package/dist/services/config-service.js.map +1 -0
  84. package/dist/services/id-service.d.ts +6 -0
  85. package/dist/services/id-service.d.ts.map +1 -0
  86. package/dist/services/id-service.js +22 -0
  87. package/dist/services/id-service.js.map +1 -0
  88. package/dist/services/prompt-service.d.ts +9 -0
  89. package/dist/services/prompt-service.d.ts.map +1 -0
  90. package/dist/services/prompt-service.js +23 -0
  91. package/dist/services/prompt-service.js.map +1 -0
  92. package/dist/services/template-service.d.ts +2 -0
  93. package/dist/services/template-service.d.ts.map +1 -0
  94. package/dist/services/template-service.js +32 -0
  95. package/dist/services/template-service.js.map +1 -0
  96. package/dist/templates/adrs/adr-general.md.hbs +46 -0
  97. package/dist/templates/checklists/agile-checklist.md.hbs +49 -0
  98. package/dist/templates/epics/epic.md.hbs +46 -0
  99. package/dist/templates/features/feature.md.hbs +42 -0
  100. package/dist/templates/rules/claude/CLAUDE.md.hbs +63 -0
  101. package/dist/templates/rules/codex/AGENTS.md.hbs +28 -0
  102. package/dist/templates/rules/cursor/2000-agile-checklist.mdc.hbs +33 -0
  103. package/dist/templates/rules/cursor/2001-agile-create-epic.mdc.hbs +35 -0
  104. package/dist/templates/rules/cursor/2002-agile-create-features.mdc.hbs +35 -0
  105. package/dist/templates/rules/cursor/2003-agile-create-user-story.mdc.hbs +31 -0
  106. package/dist/templates/rules/cursor/2100-create-task-list.mdc.hbs +36 -0
  107. package/dist/templates/rules/cursor/2101-implement-task-list.mdc.hbs +28 -0
  108. package/dist/templates/stories/gherkin.feature.hbs +13 -0
  109. package/dist/templates/stories/user-story.md.hbs +28 -0
  110. package/dist/templates/tasks/task-list.md.hbs +24 -0
  111. package/dist/templates/templates/adrs/adr-general.md.hbs +46 -0
  112. package/dist/templates/templates/checklists/agile-checklist.md.hbs +49 -0
  113. package/dist/templates/templates/epics/epic.md.hbs +46 -0
  114. package/dist/templates/templates/features/feature.md.hbs +42 -0
  115. package/dist/templates/templates/rules/claude/CLAUDE.md.hbs +63 -0
  116. package/dist/templates/templates/rules/codex/AGENTS.md.hbs +28 -0
  117. package/dist/templates/templates/rules/cursor/2000-agile-checklist.mdc.hbs +33 -0
  118. package/dist/templates/templates/rules/cursor/2001-agile-create-epic.mdc.hbs +35 -0
  119. package/dist/templates/templates/rules/cursor/2002-agile-create-features.mdc.hbs +35 -0
  120. package/dist/templates/templates/rules/cursor/2003-agile-create-user-story.mdc.hbs +31 -0
  121. package/dist/templates/templates/rules/cursor/2100-create-task-list.mdc.hbs +36 -0
  122. package/dist/templates/templates/rules/cursor/2101-implement-task-list.mdc.hbs +28 -0
  123. package/dist/templates/templates/stories/gherkin.feature.hbs +13 -0
  124. package/dist/templates/templates/stories/user-story.md.hbs +28 -0
  125. package/dist/templates/templates/tasks/task-list.md.hbs +24 -0
  126. package/dist/utils/constants.d.ts +20 -0
  127. package/dist/utils/constants.d.ts.map +1 -0
  128. package/dist/utils/constants.js +26 -0
  129. package/dist/utils/constants.js.map +1 -0
  130. package/dist/utils/fs.d.ts +6 -0
  131. package/dist/utils/fs.d.ts.map +1 -0
  132. package/dist/utils/fs.js +26 -0
  133. package/dist/utils/fs.js.map +1 -0
  134. package/dist/utils/logger.d.ts +9 -0
  135. package/dist/utils/logger.d.ts.map +1 -0
  136. package/dist/utils/logger.js +22 -0
  137. package/dist/utils/logger.js.map +1 -0
  138. package/dist/utils/markdown.d.ts +7 -0
  139. package/dist/utils/markdown.d.ts.map +1 -0
  140. package/dist/utils/markdown.js +9 -0
  141. package/dist/utils/markdown.js.map +1 -0
  142. package/dist/utils/slugify.d.ts +2 -0
  143. package/dist/utils/slugify.d.ts.map +1 -0
  144. package/dist/utils/slugify.js +10 -0
  145. package/dist/utils/slugify.js.map +1 -0
  146. package/package.json +68 -0
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: "Create an Epic — conversational epic creation for {{projectName}}"
3
+ globs: ""
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Create an Epic
8
+
9
+ You are an agile planning assistant. Help the user create a well-structured epic.
10
+
11
+ ## Process
12
+
13
+ ### Phase 1: Information Gathering
14
+ Ask these questions one at a time:
15
+ 1. What is the epic title?
16
+ 2. Who owns this epic?
17
+ 3. What is the business value?
18
+ 4. Who are the target users?
19
+ 5. What problem does this solve?
20
+ 6. What is the proposed solution?
21
+ 7. What are the success criteria?
22
+ 8. What are the key features (list)?
23
+ 9. What dependencies exist?
24
+ 10. What are the risks?
25
+
26
+ ### Phase 2: Document Generation
27
+ Generate the epic document at `{{agilePath}}/epics/` using this structure:
28
+ - YAML frontmatter with id, title, owner, dates, status
29
+ - Sections: Business Value, Target Users, Problem Statement, Solution Overview, Success Criteria, Key Features, Dependencies, Risks
30
+
31
+ ### Phase 3: Next Steps
32
+ Recommend creating features from this epic using `planr feature create --epic <ID>`.
33
+
34
+ ## Existing Epics
35
+ Check `{{agilePath}}/epics/` for existing epics to avoid duplication.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: "Create Features from Epic — break down an epic into features for {{projectName}}"
3
+ globs: ""
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Create Features from Epic
8
+
9
+ You are an agile planning assistant. Help the user break an epic into well-defined features.
10
+
11
+ ## Process
12
+
13
+ ### Phase 1: Epic Analysis
14
+ 1. Read the specified epic from `{{agilePath}}/epics/`
15
+ 2. Analyze the key features and scope listed in the epic
16
+ 3. Propose a feature breakdown
17
+
18
+ ### Phase 2: Feature Definition
19
+ For each feature, gather:
20
+ 1. Feature title
21
+ 2. Owner
22
+ 3. Overview/description
23
+ 4. Functional requirements (list)
24
+ 5. Dependencies
25
+ 6. Technical considerations
26
+ 7. Risks
27
+ 8. Success metrics
28
+
29
+ ### Phase 3: Document Generation
30
+ Generate feature documents at `{{agilePath}}/features/` with:
31
+ - YAML frontmatter linking back to the parent epic
32
+ - Cross-references to the epic document
33
+
34
+ ### Phase 4: Next Steps
35
+ Recommend creating user stories with `planr story create --feature <ID>`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: "Create User Stories — generate user stories with Gherkin acceptance criteria for {{projectName}}"
3
+ globs: ""
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Create User Stories
8
+
9
+ You are an agile planning assistant. Help create user stories with Gherkin acceptance criteria.
10
+
11
+ ## Process
12
+
13
+ ### Phase 1: Feature Analysis
14
+ 1. Read the specified feature from `{{agilePath}}/features/`
15
+ 2. Analyze functional requirements
16
+ 3. Propose user story breakdown
17
+
18
+ ### Phase 2: Story Definition
19
+ For each story, gather:
20
+ 1. Role (As a...)
21
+ 2. Goal (I want to...)
22
+ 3. Benefit (So that...)
23
+ 4. Acceptance criteria as Gherkin scenarios
24
+
25
+ ### Phase 3: Document Generation
26
+ Generate two files per story:
27
+ 1. User story markdown at `{{agilePath}}/stories/US-XXX-title.md`
28
+ 2. Gherkin feature file at `{{agilePath}}/stories/US-XXX-gherkin.feature`
29
+
30
+ ### Phase 4: Next Steps
31
+ Recommend creating tasks with `planr task create --story <ID>`.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: "Create Task List — generate implementation tasks from user stories for {{projectName}}"
3
+ globs: ""
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Create Task List
8
+
9
+ You are a technical planning assistant. Generate implementation tasks from user stories.
10
+
11
+ ## Process
12
+
13
+ ### Phase 1: Artifact Analysis
14
+ Read all relevant artifacts:
15
+ - User stories at `{{agilePath}}/stories/`
16
+ - Gherkin files for acceptance criteria
17
+ - Any existing ADRs at `{{agilePath}}/adrs/`
18
+
19
+ ### Phase 2: High-Level Tasks
20
+ Generate parent tasks that cover:
21
+ - Setup and configuration
22
+ - Core implementation
23
+ - Testing
24
+ - Documentation
25
+ - Integration
26
+
27
+ Wait for user confirmation before proceeding.
28
+
29
+ ### Phase 3: Subtask Breakdown
30
+ For each parent task, generate subtasks with:
31
+ - Clear acceptance criteria mapped to Gherkin scenarios
32
+ - Estimated complexity
33
+ - Dependencies on other tasks
34
+
35
+ ### Output
36
+ Generate task list at `{{agilePath}}/tasks/` with checkbox format for tracking.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: "Implement Task List — manage task-by-task implementation for {{projectName}}"
3
+ globs: ""
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Implement Task List
8
+
9
+ You are an implementation assistant. Guide one-task-at-a-time implementation.
10
+
11
+ ## Rules
12
+
13
+ 1. Only work on ONE subtask at a time
14
+ 2. Wait for user approval before moving to the next subtask
15
+ 3. After completing a subtask, update the task list by checking the box
16
+ 4. Reference acceptance criteria from the linked user story's Gherkin file
17
+
18
+ ## Process
19
+
20
+ 1. Read the task list from `{{agilePath}}/tasks/`
21
+ 2. Find the first unchecked subtask
22
+ 3. Implement it
23
+ 4. Mark it complete in the task file
24
+ 5. Ask the user to review before proceeding
25
+
26
+ ## Task Locations
27
+ - Task lists: `{{agilePath}}/tasks/`
28
+ - User stories: `{{agilePath}}/stories/`
@@ -0,0 +1,13 @@
1
+ Feature: {{title}}
2
+ {{id}} - As a {{role}}, I want to {{goal}} so that {{benefit}}
3
+
4
+ Background:
5
+ Given the system is initialized
6
+
7
+ {{#each scenarios}}
8
+ Scenario: {{this.name}}
9
+ Given {{this.given}}
10
+ When {{this.when}}
11
+ Then {{this.then}}
12
+
13
+ {{/each}}
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: "{{id}}"
3
+ title: "{{title}}"
4
+ featureId: "{{featureId}}"
5
+ created: "{{date}}"
6
+ updated: "{{date}}"
7
+ status: "planning"
8
+ ---
9
+
10
+ # {{id}}: {{title}}
11
+
12
+ **Feature:** [{{featureId}}](../features/{{featureId}}.md)
13
+
14
+ ## User Story
15
+ **As a** {{role}}
16
+ **I want to** {{goal}}
17
+ **So that** {{benefit}}
18
+
19
+ ## Acceptance Criteria
20
+ See [{{id}}-gherkin.feature](./{{id}}-gherkin.feature) for detailed Gherkin scenarios.
21
+
22
+ {{#if additionalNotes}}
23
+ ## Additional Notes
24
+ {{additionalNotes}}
25
+ {{/if}}
26
+
27
+ ## Tasks
28
+ _Run `planr task create --story {{id}}` to generate tasks._
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: "{{id}}"
3
+ title: "{{title}}"
4
+ storyId: "{{storyId}}"
5
+ created: "{{date}}"
6
+ updated: "{{date}}"
7
+ status: "pending"
8
+ ---
9
+
10
+ # {{id}}: {{title}}
11
+
12
+ **User Story:** [{{storyId}}](../stories/{{storyId}}.md)
13
+
14
+ ## Tasks
15
+
16
+ {{#each tasks}}
17
+ - [ ] **{{this.id}}** {{this.title}}
18
+ {{#each this.subtasks}}
19
+ - [ ] {{this.id}} {{this.title}}
20
+ {{/each}}
21
+ {{/each}}
22
+
23
+ ## Notes
24
+ _Mark tasks complete by checking the boxes above, or run `planr task implement {{id}}`._
@@ -0,0 +1,20 @@
1
+ export declare const CONFIG_FILENAME = "planr.config.json";
2
+ export declare const DEFAULT_AGILE_DIR = "docs/agile";
3
+ export declare const DEFAULT_CURSOR_RULES_DIR = ".cursor/rules";
4
+ export declare const ARTIFACT_DIRS: {
5
+ readonly epics: "epics";
6
+ readonly features: "features";
7
+ readonly stories: "stories";
8
+ readonly tasks: "tasks";
9
+ readonly adrs: "adrs";
10
+ readonly checklists: "checklists";
11
+ };
12
+ export declare const ID_PREFIXES: {
13
+ readonly epic: "EPIC";
14
+ readonly feature: "FEAT";
15
+ readonly story: "US";
16
+ readonly task: "TASK";
17
+ readonly adr: "ADR";
18
+ };
19
+ export declare function getTemplatesDir(): string;
20
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC;AAEX,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
@@ -0,0 +1,26 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ const __filename = fileURLToPath(import.meta.url);
4
+ const __dirname = path.dirname(__filename);
5
+ export const CONFIG_FILENAME = 'planr.config.json';
6
+ export const DEFAULT_AGILE_DIR = 'docs/agile';
7
+ export const DEFAULT_CURSOR_RULES_DIR = '.cursor/rules';
8
+ export const ARTIFACT_DIRS = {
9
+ epics: 'epics',
10
+ features: 'features',
11
+ stories: 'stories',
12
+ tasks: 'tasks',
13
+ adrs: 'adrs',
14
+ checklists: 'checklists',
15
+ };
16
+ export const ID_PREFIXES = {
17
+ epic: 'EPIC',
18
+ feature: 'FEAT',
19
+ story: 'US',
20
+ task: 'TASK',
21
+ adr: 'ADR',
22
+ };
23
+ export function getTemplatesDir() {
24
+ return path.resolve(__dirname, '..', 'templates');
25
+ }
26
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;CAChB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAEX,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function ensureDir(dirPath: string): Promise<void>;
2
+ export declare function writeFile(filePath: string, content: string): Promise<void>;
3
+ export declare function readFile(filePath: string): Promise<string>;
4
+ export declare function fileExists(filePath: string): Promise<boolean>;
5
+ export declare function listFiles(dirPath: string, pattern?: RegExp): Promise<string[]>;
6
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":"AAGA,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhE;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnE;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASpF"}
@@ -0,0 +1,26 @@
1
+ import fse from 'fs-extra';
2
+ import path from 'node:path';
3
+ export async function ensureDir(dirPath) {
4
+ await fse.ensureDir(dirPath);
5
+ }
6
+ export async function writeFile(filePath, content) {
7
+ await fse.ensureDir(path.dirname(filePath));
8
+ await fse.writeFile(filePath, content, 'utf-8');
9
+ }
10
+ export async function readFile(filePath) {
11
+ return fse.readFile(filePath, 'utf-8');
12
+ }
13
+ export async function fileExists(filePath) {
14
+ return fse.pathExists(filePath);
15
+ }
16
+ export async function listFiles(dirPath, pattern) {
17
+ const exists = await fse.pathExists(dirPath);
18
+ if (!exists)
19
+ return [];
20
+ const entries = await fse.readdir(dirPath);
21
+ if (pattern) {
22
+ return entries.filter((e) => pattern.test(e));
23
+ }
24
+ return entries;
25
+ }
26
+ //# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IAC/D,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5C,MAAM,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,OAAgB;IAC/D,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvB,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const logger: {
2
+ info(msg: string): void;
3
+ success(msg: string): void;
4
+ warn(msg: string): void;
5
+ error(msg: string): void;
6
+ heading(msg: string): void;
7
+ dim(msg: string): void;
8
+ };
9
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;cACP,MAAM;iBAGH,MAAM;cAGT,MAAM;eAGL,MAAM;iBAGJ,MAAM;aAGV,MAAM;CAGhB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import chalk from 'chalk';
2
+ export const logger = {
3
+ info(msg) {
4
+ console.log(chalk.blue('ℹ'), msg);
5
+ },
6
+ success(msg) {
7
+ console.log(chalk.green('✓'), msg);
8
+ },
9
+ warn(msg) {
10
+ console.log(chalk.yellow('⚠'), msg);
11
+ },
12
+ error(msg) {
13
+ console.error(chalk.red('✗'), msg);
14
+ },
15
+ heading(msg) {
16
+ console.log(chalk.bold.cyan(`\n${msg}`));
17
+ },
18
+ dim(msg) {
19
+ console.log(chalk.dim(msg));
20
+ },
21
+ };
22
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,CAAC,GAAW;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,CAAC,GAAW;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,GAAW;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IACD,KAAK,CAAC,GAAW;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,CAAC,GAAW;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,GAAG,CAAC,GAAW;QACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface ParsedMarkdown {
2
+ data: Record<string, unknown>;
3
+ content: string;
4
+ }
5
+ export declare function parseMarkdown(raw: string): ParsedMarkdown;
6
+ export declare function toMarkdownWithFrontmatter(data: Record<string, unknown>, content: string): string;
7
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAGzD;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhG"}
@@ -0,0 +1,9 @@
1
+ import matter from 'gray-matter';
2
+ export function parseMarkdown(raw) {
3
+ const { data, content } = matter(raw);
4
+ return { data, content };
5
+ }
6
+ export function toMarkdownWithFrontmatter(data, content) {
7
+ return matter.stringify(content, data);
8
+ }
9
+ //# sourceMappingURL=markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAOjC,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAA6B,EAAE,OAAe;IACtF,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function slugify(text: string): string;
2
+ //# sourceMappingURL=slugify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../src/utils/slugify.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ5C"}
@@ -0,0 +1,10 @@
1
+ export function slugify(text) {
2
+ return text
3
+ .toLowerCase()
4
+ .trim()
5
+ .replace(/[^\w\s-]/g, '')
6
+ .replace(/[\s_]+/g, '-')
7
+ .replace(/-+/g, '-')
8
+ .replace(/^-+|-+$/g, '');
9
+ }
10
+ //# sourceMappingURL=slugify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slugify.js","sourceRoot":"","sources":["../../src/utils/slugify.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI;SACR,WAAW,EAAE;SACb,IAAI,EAAE;SACN,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "openplanr",
3
+ "version": "0.1.0",
4
+ "description": "CLI tool for agile planning with AI agents — generates epics, features, stories, tasks, and AI rule files for Cursor, Claude Code, and Codex",
5
+ "type": "module",
6
+ "main": "./dist/cli/index.js",
7
+ "types": "./dist/cli/index.d.ts",
8
+ "bin": {
9
+ "planr": "./bin/planr.js",
10
+ "opr": "./bin/planr.js"
11
+ },
12
+ "files": [
13
+ "dist/",
14
+ "bin/",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc && cp -r src/templates dist/templates",
20
+ "dev": "tsx src/cli/index.ts",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "lint": "eslint src/",
24
+ "prepublishOnly": "npm run build"
25
+ },
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "keywords": [
30
+ "agile",
31
+ "planning",
32
+ "cli",
33
+ "cursor",
34
+ "claude",
35
+ "codex",
36
+ "ai",
37
+ "epic",
38
+ "user-story",
39
+ "scrum"
40
+ ],
41
+ "author": "OpenPlanr Contributors",
42
+ "license": "MIT",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/TechArc-io/OpenPlanr.git"
46
+ },
47
+ "homepage": "https://github.com/TechArc-io/OpenPlanr#readme",
48
+ "bugs": {
49
+ "url": "https://github.com/TechArc-io/OpenPlanr/issues"
50
+ },
51
+ "dependencies": {
52
+ "@inquirer/prompts": "^7.0.0",
53
+ "chalk": "^5.3.0",
54
+ "commander": "^12.1.0",
55
+ "fs-extra": "^11.2.0",
56
+ "gray-matter": "^4.0.3",
57
+ "handlebars": "^4.7.8",
58
+ "ora": "^8.1.0",
59
+ "zod": "^3.23.0"
60
+ },
61
+ "devDependencies": {
62
+ "@types/fs-extra": "^11.0.4",
63
+ "@types/node": "^22.0.0",
64
+ "tsx": "^4.19.0",
65
+ "typescript": "^5.6.0",
66
+ "vitest": "^2.1.0"
67
+ }
68
+ }