plan-flow-skill 1.0.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 (124) hide show
  1. package/.claude/commands/create-contract.md +468 -0
  2. package/.claude/commands/create-plan.md +512 -0
  3. package/.claude/commands/discovery-plan.md +561 -0
  4. package/.claude/commands/execute-plan.md +682 -0
  5. package/.claude/commands/review-code.md +459 -0
  6. package/.claude/commands/review-pr.md +651 -0
  7. package/.claude/commands/setup.md +1609 -0
  8. package/.claude/commands/write-tests.md +543 -0
  9. package/.claude/rules/core/allowed-patterns.md +175 -0
  10. package/.claude/rules/core/complexity-scoring.md +225 -0
  11. package/.claude/rules/core/forbidden-patterns.md +253 -0
  12. package/.claude/rules/languages/python-patterns.md +6 -0
  13. package/.claude/rules/languages/typescript-patterns.md +7 -0
  14. package/.claude/rules/patterns/contract-patterns.md +332 -0
  15. package/.claude/rules/patterns/discovery-patterns.md +342 -0
  16. package/.claude/rules/patterns/discovery-templates.md +319 -0
  17. package/.claude/rules/patterns/jest-patterns.md +482 -0
  18. package/.claude/rules/patterns/plans-patterns.md +225 -0
  19. package/.claude/rules/patterns/plans-templates.md +227 -0
  20. package/.claude/rules/patterns/pytest-patterns.md +457 -0
  21. package/.claude/rules/patterns/review-code-templates.md +305 -0
  22. package/.claude/rules/patterns/review-pr-patterns.md +360 -0
  23. package/.claude/rules/tools/auth-pr-tool.md +30 -0
  24. package/.claude/rules/tools/interactive-questions-tool.md +235 -0
  25. package/.claude/rules/tools/jest-testing-tool.md +73 -0
  26. package/.claude/rules/tools/plan-mode-tool.md +164 -0
  27. package/.claude/rules/tools/pytest-testing-tool.md +121 -0
  28. package/.claude/rules/tools/reference-expansion-tool.md +326 -0
  29. package/LICENSE +21 -0
  30. package/README.md +167 -0
  31. package/dist/cli/commands/init.d.ts +6 -0
  32. package/dist/cli/commands/init.d.ts.map +1 -0
  33. package/dist/cli/commands/init.js +139 -0
  34. package/dist/cli/commands/init.js.map +1 -0
  35. package/dist/cli/handlers/claude.d.ts +9 -0
  36. package/dist/cli/handlers/claude.d.ts.map +1 -0
  37. package/dist/cli/handlers/claude.js +119 -0
  38. package/dist/cli/handlers/claude.js.map +1 -0
  39. package/dist/cli/handlers/codex.d.ts +9 -0
  40. package/dist/cli/handlers/codex.d.ts.map +1 -0
  41. package/dist/cli/handlers/codex.js +100 -0
  42. package/dist/cli/handlers/codex.js.map +1 -0
  43. package/dist/cli/handlers/cursor.d.ts +8 -0
  44. package/dist/cli/handlers/cursor.d.ts.map +1 -0
  45. package/dist/cli/handlers/cursor.js +34 -0
  46. package/dist/cli/handlers/cursor.js.map +1 -0
  47. package/dist/cli/handlers/openclaw.d.ts +8 -0
  48. package/dist/cli/handlers/openclaw.d.ts.map +1 -0
  49. package/dist/cli/handlers/openclaw.js +34 -0
  50. package/dist/cli/handlers/openclaw.js.map +1 -0
  51. package/dist/cli/handlers/shared.d.ts +9 -0
  52. package/dist/cli/handlers/shared.d.ts.map +1 -0
  53. package/dist/cli/handlers/shared.js +44 -0
  54. package/dist/cli/handlers/shared.js.map +1 -0
  55. package/dist/cli/index.d.ts +8 -0
  56. package/dist/cli/index.d.ts.map +1 -0
  57. package/dist/cli/index.js +43 -0
  58. package/dist/cli/index.js.map +1 -0
  59. package/dist/cli/types.d.ts +26 -0
  60. package/dist/cli/types.d.ts.map +1 -0
  61. package/dist/cli/types.js +5 -0
  62. package/dist/cli/types.js.map +1 -0
  63. package/dist/cli/utils/files.d.ts +37 -0
  64. package/dist/cli/utils/files.d.ts.map +1 -0
  65. package/dist/cli/utils/files.js +122 -0
  66. package/dist/cli/utils/files.js.map +1 -0
  67. package/dist/cli/utils/logger.d.ts +11 -0
  68. package/dist/cli/utils/logger.d.ts.map +1 -0
  69. package/dist/cli/utils/logger.js +34 -0
  70. package/dist/cli/utils/logger.js.map +1 -0
  71. package/dist/cli/utils/prompts.d.ts +10 -0
  72. package/dist/cli/utils/prompts.d.ts.map +1 -0
  73. package/dist/cli/utils/prompts.js +65 -0
  74. package/dist/cli/utils/prompts.js.map +1 -0
  75. package/dist/test/setup.d.ts +5 -0
  76. package/dist/test/setup.d.ts.map +1 -0
  77. package/dist/test/setup.js +7 -0
  78. package/dist/test/setup.js.map +1 -0
  79. package/package.json +63 -0
  80. package/rules/core/_index.mdc +89 -0
  81. package/rules/core/allowed-patterns.mdc +185 -0
  82. package/rules/core/complexity-scoring.mdc +235 -0
  83. package/rules/core/forbidden-patterns.mdc +263 -0
  84. package/rules/languages/_index.mdc +80 -0
  85. package/rules/languages/python-patterns.mdc +188 -0
  86. package/rules/languages/typescript-patterns.mdc +128 -0
  87. package/rules/patterns/_index.mdc +185 -0
  88. package/rules/patterns/contract-patterns.mdc +344 -0
  89. package/rules/patterns/discovery-patterns.mdc +354 -0
  90. package/rules/patterns/discovery-templates.mdc +329 -0
  91. package/rules/patterns/jest-patterns.mdc +492 -0
  92. package/rules/patterns/plans-patterns.mdc +237 -0
  93. package/rules/patterns/plans-templates.mdc +237 -0
  94. package/rules/patterns/pytest-patterns.mdc +467 -0
  95. package/rules/patterns/review-code-templates.mdc +315 -0
  96. package/rules/patterns/review-pr-patterns.mdc +370 -0
  97. package/rules/skills/_index.mdc +174 -0
  98. package/rules/skills/create-contract-skill.mdc +239 -0
  99. package/rules/skills/create-plan-skill.mdc +271 -0
  100. package/rules/skills/discovery-skill.mdc +295 -0
  101. package/rules/skills/execute-plan-skill.mdc +388 -0
  102. package/rules/skills/review-code-skill.mdc +308 -0
  103. package/rules/skills/review-pr-skill.mdc +496 -0
  104. package/rules/skills/setup-skill.mdc +923 -0
  105. package/rules/skills/write-tests-skill.mdc +294 -0
  106. package/rules/templates/index-template.mdc +126 -0
  107. package/rules/tools/_index.mdc +114 -0
  108. package/rules/tools/auth-pr-tool.mdc +362 -0
  109. package/rules/tools/interactive-questions-tool.mdc +337 -0
  110. package/rules/tools/jest-testing-tool.mdc +96 -0
  111. package/rules/tools/plan-mode-tool.mdc +229 -0
  112. package/rules/tools/pytest-testing-tool.mdc +144 -0
  113. package/rules/tools/reference-expansion-tool.mdc +338 -0
  114. package/skills/plan-flow/SKILL.md +109 -0
  115. package/skills/plan-flow/create-contract/SKILL.md +139 -0
  116. package/skills/plan-flow/create-plan/SKILL.md +93 -0
  117. package/skills/plan-flow/discovery/SKILL.md +85 -0
  118. package/skills/plan-flow/execute-plan/SKILL.md +89 -0
  119. package/skills/plan-flow/review-code/SKILL.md +100 -0
  120. package/skills/plan-flow/review-pr/SKILL.md +122 -0
  121. package/skills/plan-flow/setup/SKILL.md +73 -0
  122. package/skills/plan-flow/write-tests/SKILL.md +115 -0
  123. package/templates/shared/AGENTS.md.template +60 -0
  124. package/templates/shared/CLAUDE.md.template +62 -0
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: discovery
3
+ description: Create a discovery document to gather and clarify requirements
4
+ metadata: {"openclaw":{"requires":{"bins":["git"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Discovery
9
+
10
+ Create a discovery document for gathering and clarifying requirements before creating an implementation plan.
11
+
12
+ ## What It Does
13
+
14
+ 1. Gathers functional and non-functional requirements
15
+ 2. Documents constraints and dependencies
16
+ 3. Identifies open questions that need answers
17
+ 4. Proposes a high-level approach
18
+ 5. Documents risks and unknowns
19
+
20
+ ## Usage
21
+
22
+ ```
23
+ /discovery <topic>
24
+ ```
25
+
26
+ **Arguments:**
27
+ - `topic` (required): The feature or topic to discover requirements for
28
+
29
+ ## Output
30
+
31
+ Creates: `flow/discovery/discovery_<topic>_v<version>.md`
32
+
33
+ ## Document Structure
34
+
35
+ ```markdown
36
+ # Discovery: [Topic]
37
+
38
+ ## Context
39
+ Why this discovery is needed
40
+
41
+ ## Requirements Gathered
42
+ ### Functional Requirements
43
+ - [FR-1]: Description
44
+
45
+ ### Non-Functional Requirements
46
+ - [NFR-1]: Description
47
+
48
+ ### Constraints
49
+ - [C-1]: Description
50
+
51
+ ## Open Questions
52
+ | # | Question | Status | Answer |
53
+ |---|----------|--------|--------|
54
+ | 1 | Question | Open | - |
55
+
56
+ ## Technical Considerations
57
+ Architecture, dependencies, patterns
58
+
59
+ ## Proposed Approach
60
+ High-level recommendation
61
+
62
+ ## Risks and Unknowns
63
+ Identified risks with mitigation strategies
64
+
65
+ ## Next Steps
66
+ Follow-up actions
67
+ ```
68
+
69
+ ## Example
70
+
71
+ ```
72
+ /discovery user authentication with OAuth
73
+ ```
74
+
75
+ **Creates:** `flow/discovery/discovery_user_authentication_with_oauth_v1.md`
76
+
77
+ ## Critical Rules
78
+
79
+ - **No Code**: Discovery is for gathering requirements only. No implementation.
80
+ - **Ask Questions**: Use interactive questions to clarify unclear requirements.
81
+ - **Mark Assumptions**: Always explicitly mark assumptions for validation.
82
+
83
+ ## Next Command
84
+
85
+ After discovery, run `/create-plan @flow/discovery/discovery_<topic>_v1.md` to create an implementation plan.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: execute-plan
3
+ description: Execute phases from an implementation plan
4
+ metadata: {"openclaw":{"requires":{"bins":["git"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Execute Plan
9
+
10
+ Execute phases from an implementation plan, following complexity-based grouping.
11
+
12
+ ## What It Does
13
+
14
+ 1. Reads the plan file and identifies phases
15
+ 2. Groups phases based on complexity scores
16
+ 3. Presents phase details before implementation
17
+ 4. Implements each phase following project patterns
18
+ 5. Marks tasks as complete
19
+ 6. Runs build verification
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ /execute-plan <plan_file> [phase]
25
+ ```
26
+
27
+ **Arguments:**
28
+ - `plan_file` (required): Path to the plan file
29
+ - `phase` (optional): Phase number, range, or "next". Default: next incomplete phase
30
+
31
+ **Phase Options:**
32
+ - `1` - Execute phase 1
33
+ - `1-3` - Execute phases 1 through 3
34
+ - `next` - Execute next incomplete phase
35
+ - `all` - Execute all remaining phases
36
+
37
+ ## Execution Strategy
38
+
39
+ Based on combined complexity scores:
40
+
41
+ | Combined Score | Strategy |
42
+ |----------------|----------|
43
+ | ≤ 6 | **Aggregate**: Execute multiple phases together |
44
+ | 7-10 | **Cautious**: Execute 1-2 phases, then verify |
45
+ | > 10 | **Sequential**: Execute one phase at a time |
46
+
47
+ ## Phase Execution Flow
48
+
49
+ For each phase:
50
+
51
+ 1. **Present**: Show phase details and approach
52
+ 2. **Implement**: Write code following project patterns
53
+ 3. **Update**: Mark tasks complete in plan file
54
+ 4. **Verify**: Run build verification
55
+
56
+ ## Example
57
+
58
+ ```
59
+ /execute-plan @flow/plans/plan_user_auth_v1.md phase:1
60
+ ```
61
+
62
+ **Output:**
63
+ ```
64
+ Executing Phase 1: Types and Schemas
65
+ Complexity: 3/10
66
+
67
+ Tasks:
68
+ - [ ] Create User type definitions
69
+ - [ ] Create Zod validation schemas
70
+
71
+ Implementing...
72
+
73
+ ✓ Phase 1 Complete
74
+ - Created src/types/user.ts
75
+ - Created src/schemas/user.ts
76
+
77
+ Build verification: npm run build ✓
78
+ ```
79
+
80
+ ## Critical Rules
81
+
82
+ - **Follow Patterns**: Always follow existing project patterns
83
+ - **Build After Each Phase**: Verify build passes before proceeding
84
+ - **Update Plan**: Mark completed tasks in the plan file
85
+ - **Tests Last**: Execute test phase only after all other phases complete
86
+
87
+ ## Next Command
88
+
89
+ After executing all phases, run `/review-code` to review your changes before committing.
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: review-code
3
+ description: Review local uncommitted code changes
4
+ metadata: {"openclaw":{"requires":{"bins":["git"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Review Code
9
+
10
+ Review local uncommitted changes in the repository.
11
+
12
+ ## What It Does
13
+
14
+ 1. Gets git diff of changes (staged, unstaged, or all)
15
+ 2. Identifies changed files and their patterns
16
+ 3. Finds similar implementations in the codebase
17
+ 4. Reviews against project patterns and rules
18
+ 5. Provides findings with severity and fix suggestions
19
+ 6. Generates a review document
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ /review-code [path] [scope]
25
+ ```
26
+
27
+ **Arguments:**
28
+ - `path` (optional): Specific file or directory to review
29
+ - `scope` (optional): `staged`, `unstaged`, or `all` (default: all)
30
+
31
+ ## Output
32
+
33
+ Creates: `flow/reviewed-code/review_<scope>.md`
34
+
35
+ ## Review Categories
36
+
37
+ | Severity | Description | Action Required |
38
+ |----------|-------------|-----------------|
39
+ | Critical | Security issues, major bugs | Must fix before commit |
40
+ | Major | Significant problems | Should fix |
41
+ | Minor | Code quality issues | Consider fixing |
42
+ | Suggestion | Improvements | Optional |
43
+
44
+ ## Review Document Structure
45
+
46
+ ```markdown
47
+ # Code Review: [Scope]
48
+
49
+ ## Review Information
50
+ | Field | Value |
51
+ |-------|-------|
52
+ | Date | YYYY-MM-DD |
53
+ | Files Reviewed | N |
54
+ | Scope | all/staged/unstaged |
55
+
56
+ ## Changed Files
57
+ | File | Status | Lines Changed |
58
+ |------|--------|---------------|
59
+ | path/to/file | modified | +10/-5 |
60
+
61
+ ## Findings
62
+
63
+ ### Finding 1: [Name]
64
+ | Field | Value |
65
+ |-------|-------|
66
+ | File | path/to/file |
67
+ | Line | 42 |
68
+ | Severity | Major |
69
+ | Fix Complexity | 3/10 |
70
+
71
+ **Description**: What's wrong
72
+ **Suggested Fix**: How to fix it
73
+
74
+ ## Commit Readiness
75
+ | Status | Ready to Commit / Needs Changes |
76
+ ```
77
+
78
+ ## Example
79
+
80
+ ```
81
+ /review-code
82
+ ```
83
+
84
+ **Scoped review:**
85
+ ```
86
+ /review-code src/components staged
87
+ ```
88
+
89
+ ## What It Checks
90
+
91
+ - Pattern consistency with existing codebase
92
+ - Error handling completeness
93
+ - Type safety (for TypeScript)
94
+ - Security concerns (hardcoded secrets, injection risks)
95
+ - Performance considerations
96
+ - Code organization and naming
97
+
98
+ ## Next Command
99
+
100
+ After fixing issues, commit your changes or run `/review-pr` after creating a PR.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: review-pr
3
+ description: Review a Pull Request
4
+ metadata: {"openclaw":{"requires":{"bins":["git","gh"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Review PR
9
+
10
+ Review a Pull Request by its number using the GitHub CLI.
11
+
12
+ ## What It Does
13
+
14
+ 1. Fetches PR information using `gh pr view`
15
+ 2. Gets PR diff using `gh pr diff`
16
+ 3. Analyzes changes against project patterns
17
+ 4. Checks for security and performance issues
18
+ 5. Provides detailed findings and recommendations
19
+ 6. Generates a review document
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ /review-pr <pr_number>
25
+ ```
26
+
27
+ **Arguments:**
28
+ - `pr_number` (required): The PR number to review
29
+
30
+ ## Prerequisites
31
+
32
+ - `gh` CLI must be installed and authenticated
33
+ - Run `gh auth login` if not authenticated
34
+
35
+ ## Output
36
+
37
+ Creates: `flow/reviewed-pr/pr_<number>.md`
38
+
39
+ ## Review Focus Areas
40
+
41
+ | Area | What's Checked |
42
+ |------|----------------|
43
+ | Code Quality | Pattern consistency, naming, organization |
44
+ | Security | Secrets, injection, authentication |
45
+ | Performance | N+1 queries, unnecessary loops, caching |
46
+ | Testing | Test coverage, edge cases |
47
+ | Documentation | Comments, README updates |
48
+
49
+ ## Review Document Structure
50
+
51
+ ```markdown
52
+ # PR Review: #<number>
53
+
54
+ ## PR Information
55
+ | Field | Value |
56
+ |-------|-------|
57
+ | Title | PR title |
58
+ | Author | username |
59
+ | Branch | feature -> main |
60
+ | Files Changed | N |
61
+
62
+ ## Summary
63
+ What this PR does
64
+
65
+ ## Findings
66
+
67
+ ### Finding 1: [Name]
68
+ | Field | Value |
69
+ |-------|-------|
70
+ | File | path/to/file |
71
+ | Severity | Major |
72
+
73
+ **Description**: What's wrong
74
+ **Suggested Fix**: How to fix it
75
+
76
+ ## Security Considerations
77
+ Any security concerns
78
+
79
+ ## Performance Considerations
80
+ Any performance concerns
81
+
82
+ ## Recommendation
83
+ | Status | Approve / Request Changes / Comment |
84
+ ```
85
+
86
+ ## Example
87
+
88
+ ```
89
+ /review-pr 123
90
+ ```
91
+
92
+ **Output:**
93
+ ```
94
+ Reviewing PR #123...
95
+
96
+ Fetching PR information...
97
+ Fetching PR diff...
98
+ Analyzing changes...
99
+
100
+ PR #123 Review Complete!
101
+
102
+ Summary: Adds user authentication with OAuth
103
+ Files Changed: 12
104
+ Findings: 2 Major, 3 Minor
105
+
106
+ Review saved to: flow/reviewed-pr/pr_123.md
107
+
108
+ Recommendation: Request Changes
109
+ - Fix the 2 major issues before merging
110
+ ```
111
+
112
+ ## Authentication
113
+
114
+ If you get authentication errors:
115
+
116
+ ```bash
117
+ # Authenticate with GitHub
118
+ gh auth login
119
+
120
+ # Verify authentication
121
+ gh auth status
122
+ ```
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: setup
3
+ description: Analyze project structure and create Plan-Flow configuration
4
+ metadata: {"openclaw":{"requires":{"bins":["git"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Setup
9
+
10
+ Analyze the current repository and generate Plan-Flow configuration files.
11
+
12
+ ## What It Does
13
+
14
+ 1. Scans project structure to detect languages and frameworks
15
+ 2. Creates the `flow/` directory structure
16
+ 3. Identifies existing patterns in the codebase
17
+ 4. Generates initial configuration
18
+
19
+ ## Usage
20
+
21
+ ```
22
+ /setup [path]
23
+ ```
24
+
25
+ **Arguments:**
26
+ - `path` (optional): Directory to analyze. Defaults to current directory.
27
+
28
+ ## Output
29
+
30
+ Creates the following structure:
31
+
32
+ ```
33
+ flow/
34
+ ├── archive/ # Completed/abandoned plans
35
+ ├── contracts/ # Integration contracts
36
+ ├── discovery/ # Discovery documents
37
+ ├── plans/ # Active implementation plans
38
+ ├── references/ # Reference materials
39
+ ├── reviewed-code/ # Code review documents
40
+ └── reviewed-pr/ # PR review documents
41
+ ```
42
+
43
+ ## Example
44
+
45
+ ```
46
+ /setup
47
+ ```
48
+
49
+ **Output:**
50
+ ```
51
+ Setup Complete!
52
+
53
+ Analyzed: /path/to/project
54
+ Files found: 156
55
+ Languages detected: TypeScript, JavaScript
56
+ Frameworks detected: Next.js, Jest
57
+
58
+ Created Directories:
59
+ - flow/discovery/
60
+ - flow/plans/
61
+ - flow/contracts/
62
+ - flow/references/
63
+ - flow/archive/
64
+
65
+ Next Steps:
66
+ 1. Create .plan-flow.yml with your AI API key
67
+ 2. Run /discovery to gather requirements for a feature
68
+ 3. Run /create-plan to create an implementation plan
69
+ ```
70
+
71
+ ## Next Command
72
+
73
+ After setup, run `/discovery` to start gathering requirements for a new feature.
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: write-tests
3
+ description: Generate tests to achieve coverage targets
4
+ metadata: {"openclaw":{"requires":{"bins":["git"]}}}
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Write Tests
9
+
10
+ Generate tests for specified code to achieve coverage targets.
11
+
12
+ ## What It Does
13
+
14
+ 1. Reads the target file(s)
15
+ 2. Analyzes functions and classes to test
16
+ 3. Identifies edge cases and error scenarios
17
+ 4. Generates comprehensive test file(s)
18
+ 5. Follows project testing patterns
19
+
20
+ ## Usage
21
+
22
+ ```
23
+ /write-tests <path> [coverage]
24
+ ```
25
+
26
+ **Arguments:**
27
+ - `path` (required): File or directory to generate tests for
28
+ - `coverage` (optional): Target coverage percentage (default: 80)
29
+
30
+ ## Output
31
+
32
+ Creates test files following project conventions:
33
+ - `*.test.ts` for TypeScript
34
+ - `*.test.js` for JavaScript
35
+ - `test_*.py` for Python
36
+
37
+ ## Test Coverage
38
+
39
+ | Coverage | Description |
40
+ |----------|-------------|
41
+ | 80% | Standard target (default) |
42
+ | 90% | High coverage for critical code |
43
+ | 100% | Complete coverage (edge cases included) |
44
+
45
+ ## What Gets Tested
46
+
47
+ - **Exported Functions**: All public functions
48
+ - **Classes**: Constructor, public methods
49
+ - **Edge Cases**: Null, undefined, empty, boundary values
50
+ - **Error Scenarios**: Exception handling, validation errors
51
+ - **Async Code**: Promise resolution/rejection
52
+
53
+ ## Test Structure (TypeScript/Jest)
54
+
55
+ ```typescript
56
+ describe('FunctionName', () => {
57
+ beforeEach(() => {
58
+ // Setup
59
+ });
60
+
61
+ it('should handle normal input', () => {
62
+ // Arrange
63
+ // Act
64
+ // Assert
65
+ });
66
+
67
+ it('should handle edge case', () => {
68
+ // Test edge case
69
+ });
70
+
71
+ it('should throw error for invalid input', () => {
72
+ expect(() => fn(invalid)).toThrow();
73
+ });
74
+ });
75
+ ```
76
+
77
+ ## Example
78
+
79
+ ```
80
+ /write-tests src/utils/validator.ts 90
81
+ ```
82
+
83
+ **Output:**
84
+ ```
85
+ Generating tests for src/utils/validator.ts
86
+ Target coverage: 90%
87
+
88
+ Analyzing functions:
89
+ - validateEmail() - 3 test cases
90
+ - validatePassword() - 5 test cases
91
+ - validateUsername() - 4 test cases
92
+
93
+ Generated: src/utils/validator.test.ts
94
+
95
+ Test Summary:
96
+ - 12 test cases generated
97
+ - Estimated coverage: 92%
98
+
99
+ Run tests with: npm run test src/utils/validator.test.ts
100
+ ```
101
+
102
+ ## Test Patterns
103
+
104
+ The skill follows testing patterns from your project:
105
+
106
+ - **Jest** for JavaScript/TypeScript
107
+ - **Pytest** for Python
108
+ - Uses existing mock factories if available
109
+ - Follows AAA pattern (Arrange, Act, Assert)
110
+
111
+ ## Next Command
112
+
113
+ After generating tests, run them with your test runner:
114
+ - `npm run test` for Jest
115
+ - `pytest` for Python
@@ -0,0 +1,60 @@
1
+ # Plan-Flow: Structured AI-Assisted Development
2
+
3
+ ## Quick Start
4
+
5
+ | Command | Purpose |
6
+ |---------|---------|
7
+ | `/setup` | Analyze project and generate pattern files |
8
+ | `/discovery-plan` | Create discovery document for requirements gathering |
9
+ | `/create-plan` | Create implementation plan with phases and complexity scores |
10
+ | `/execute-plan` | Execute plan phases with verification |
11
+ | `/create-contract` | Create integration contract from API docs |
12
+ | `/review-code` | Review local uncommitted changes |
13
+ | `/review-pr` | Review a Pull Request |
14
+ | `/write-tests` | Write tests to achieve coverage target |
15
+
16
+ ## Recommended Workflow
17
+
18
+ 1. `/setup` - Run once to index project patterns
19
+ 2. `/discovery-plan` - Gather requirements for a new feature
20
+ 3. `/create-plan` - Create structured implementation plan
21
+ 4. `/execute-plan` - Execute the plan phase by phase
22
+ 5. `/review-code` or `/review-pr` - Review changes before merging
23
+
24
+ ## Critical Rules
25
+
26
+ 1. **No Auto-Chaining**: Never auto-invoke the next command. Wait for user.
27
+ 2. **Discovery First**: Recommend `/discovery-plan` before `/create-plan` for new features.
28
+ 3. **Tests Last**: Tests are always the last phase of any implementation plan.
29
+ 4. **Build at End Only**: Run `npm run build` only after ALL phases complete.
30
+
31
+ ## Flow Directory Structure
32
+
33
+ ```
34
+ flow/
35
+ ├── archive/ # Completed/abandoned plans
36
+ ├── contracts/ # Integration contracts
37
+ ├── discovery/ # Discovery documents
38
+ ├── plans/ # Active implementation plans
39
+ ├── references/ # Reference materials
40
+ ├── reviewed-code/ # Code review documents
41
+ └── reviewed-pr/ # PR review documents
42
+ ```
43
+
44
+ ## Complexity Scoring
45
+
46
+ Every plan phase has a complexity score (0-10):
47
+
48
+ | Score | Level | Description |
49
+ |-------|-------|-------------|
50
+ | 0-2 | Trivial | Simple, mechanical changes |
51
+ | 3-4 | Low | Straightforward implementation |
52
+ | 5-6 | Medium | Moderate complexity, some decisions |
53
+ | 7-8 | High | Complex, multiple considerations |
54
+ | 9-10 | Very High | Significant complexity/risk |
55
+
56
+ ## Skills
57
+
58
+ Plan-flow skills are in `.agents/skills/plan-flow/`:
59
+ - Each skill has a `SKILL.md` with frontmatter and instructions
60
+ - Use the skill names as slash commands
@@ -0,0 +1,62 @@
1
+ # Plan-Flow: Structured AI-Assisted Development
2
+
3
+ ## Quick Start
4
+
5
+ | Command | Purpose |
6
+ |---------|---------|
7
+ | `/setup` | Analyze project and generate pattern files |
8
+ | `/discovery-plan` | Create discovery document for requirements gathering |
9
+ | `/create-plan` | Create implementation plan with phases and complexity scores |
10
+ | `/execute-plan` | Execute plan phases with verification |
11
+ | `/create-contract` | Create integration contract from API docs |
12
+ | `/review-code` | Review local uncommitted changes |
13
+ | `/review-pr` | Review a Pull Request |
14
+ | `/write-tests` | Write tests to achieve coverage target |
15
+
16
+ ## Recommended Workflow
17
+
18
+ 1. `/setup` - Run once to index project patterns
19
+ 2. `/discovery-plan` - Gather requirements for a new feature
20
+ 3. `/create-plan` - Create structured implementation plan
21
+ 4. `/execute-plan` - Execute the plan phase by phase
22
+ 5. `/review-code` or `/review-pr` - Review changes before merging
23
+
24
+ ## Critical Rules
25
+
26
+ 1. **No Auto-Chaining**: Never auto-invoke the next command. Wait for user.
27
+ 2. **Discovery First**: Recommend `/discovery-plan` before `/create-plan` for new features.
28
+ 3. **Tests Last**: Tests are always the last phase of any implementation plan.
29
+ 4. **Build at End Only**: Run `npm run build` only after ALL phases complete.
30
+
31
+ ## Flow Directory Structure
32
+
33
+ ```
34
+ flow/
35
+ ├── archive/ # Completed/abandoned plans
36
+ ├── contracts/ # Integration contracts
37
+ ├── discovery/ # Discovery documents
38
+ ├── plans/ # Active implementation plans
39
+ ├── references/ # Reference materials
40
+ ├── reviewed-code/ # Code review documents
41
+ └── reviewed-pr/ # PR review documents
42
+ ```
43
+
44
+ ## Complexity Scoring
45
+
46
+ Every plan phase has a complexity score (0-10):
47
+
48
+ | Score | Level | Description |
49
+ |-------|-------|-------------|
50
+ | 0-2 | Trivial | Simple, mechanical changes |
51
+ | 3-4 | Low | Straightforward implementation |
52
+ | 5-6 | Medium | Moderate complexity, some decisions |
53
+ | 7-8 | High | Complex, multiple considerations |
54
+ | 9-10 | Very High | Significant complexity/risk |
55
+
56
+ ## Rules
57
+
58
+ Pattern rules are in `.claude/rules/`:
59
+ - `core/` - Allowed patterns, forbidden patterns, complexity scoring
60
+ - `patterns/` - Templates and patterns for plans, discovery, contracts
61
+ - `languages/` - Language-specific patterns (TypeScript, Python)
62
+ - `tools/` - Tool-specific patterns (Jest, Pytest, auth)