codingbuddy-rules 4.4.0 → 5.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 (122) hide show
  1. package/.ai-rules/adapters/antigravity.md +6 -6
  2. package/.ai-rules/adapters/claude-code.md +107 -4
  3. package/.ai-rules/adapters/codex.md +5 -5
  4. package/.ai-rules/adapters/cursor.md +2 -2
  5. package/.ai-rules/adapters/kiro.md +8 -8
  6. package/.ai-rules/adapters/opencode.md +7 -7
  7. package/.ai-rules/adapters/q.md +2 -2
  8. package/.ai-rules/agents/README.md +66 -16
  9. package/.ai-rules/agents/accessibility-specialist.json +2 -1
  10. package/.ai-rules/agents/act-mode.json +2 -1
  11. package/.ai-rules/agents/agent-architect.json +8 -7
  12. package/.ai-rules/agents/ai-ml-engineer.json +1 -0
  13. package/.ai-rules/agents/architecture-specialist.json +1 -0
  14. package/.ai-rules/agents/auto-mode.json +4 -2
  15. package/.ai-rules/agents/backend-developer.json +1 -0
  16. package/.ai-rules/agents/code-quality-specialist.json +1 -0
  17. package/.ai-rules/agents/code-reviewer.json +65 -64
  18. package/.ai-rules/agents/data-engineer.json +8 -7
  19. package/.ai-rules/agents/data-scientist.json +10 -9
  20. package/.ai-rules/agents/devops-engineer.json +1 -0
  21. package/.ai-rules/agents/documentation-specialist.json +1 -0
  22. package/.ai-rules/agents/eval-mode.json +20 -19
  23. package/.ai-rules/agents/event-architecture-specialist.json +1 -0
  24. package/.ai-rules/agents/frontend-developer.json +1 -0
  25. package/.ai-rules/agents/i18n-specialist.json +2 -1
  26. package/.ai-rules/agents/integration-specialist.json +1 -0
  27. package/.ai-rules/agents/migration-specialist.json +1 -0
  28. package/.ai-rules/agents/mobile-developer.json +8 -7
  29. package/.ai-rules/agents/observability-specialist.json +1 -0
  30. package/.ai-rules/agents/parallel-orchestrator.json +346 -0
  31. package/.ai-rules/agents/performance-specialist.json +1 -0
  32. package/.ai-rules/agents/plan-mode.json +3 -1
  33. package/.ai-rules/agents/plan-reviewer.json +208 -0
  34. package/.ai-rules/agents/platform-engineer.json +1 -0
  35. package/.ai-rules/agents/security-engineer.json +9 -8
  36. package/.ai-rules/agents/security-specialist.json +2 -1
  37. package/.ai-rules/agents/seo-specialist.json +1 -0
  38. package/.ai-rules/agents/software-engineer.json +1 -0
  39. package/.ai-rules/agents/solution-architect.json +11 -10
  40. package/.ai-rules/agents/systems-developer.json +9 -8
  41. package/.ai-rules/agents/technical-planner.json +11 -10
  42. package/.ai-rules/agents/test-engineer.json +7 -6
  43. package/.ai-rules/agents/test-strategy-specialist.json +1 -0
  44. package/.ai-rules/agents/tooling-engineer.json +4 -3
  45. package/.ai-rules/agents/ui-ux-designer.json +1 -0
  46. package/.ai-rules/keyword-modes.json +4 -4
  47. package/.ai-rules/rules/clarification-guide.md +14 -14
  48. package/.ai-rules/rules/core.md +90 -1
  49. package/.ai-rules/rules/parallel-execution.md +217 -0
  50. package/.ai-rules/skills/README.md +23 -1
  51. package/.ai-rules/skills/agent-design/SKILL.md +5 -0
  52. package/.ai-rules/skills/agent-design/examples/agent-template.json +58 -0
  53. package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
  54. package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
  55. package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
  56. package/.ai-rules/skills/api-design/SKILL.md +5 -0
  57. package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
  58. package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
  59. package/.ai-rules/skills/build-fix/SKILL.md +234 -0
  60. package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
  61. package/.ai-rules/skills/context-management/SKILL.md +1 -0
  62. package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
  63. package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
  64. package/.ai-rules/skills/database-migration/SKILL.md +1 -0
  65. package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
  66. package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
  67. package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
  68. package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
  69. package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
  70. package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
  71. package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
  72. package/.ai-rules/skills/git-master/SKILL.md +358 -0
  73. package/.ai-rules/skills/incident-response/SKILL.md +1 -0
  74. package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
  75. package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
  76. package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
  77. package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +203 -0
  78. package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
  79. package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
  80. package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
  81. package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
  82. package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
  83. package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
  84. package/.ai-rules/skills/pr-review/SKILL.md +4 -0
  85. package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
  86. package/.ai-rules/skills/refactoring/SKILL.md +1 -0
  87. package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
  88. package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
  89. package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
  90. package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
  91. package/.ai-rules/skills/security-audit/SKILL.md +4 -0
  92. package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
  93. package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
  94. package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
  95. package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
  96. package/.ai-rules/skills/skill-creator/assets/eval_review.html +289 -0
  97. package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
  98. package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
  99. package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
  100. package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
  101. package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
  102. package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
  103. package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
  104. package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
  105. package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
  106. package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
  107. package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
  108. package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
  109. package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
  110. package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
  111. package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
  112. package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
  113. package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
  114. package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
  115. package/bin/cli.js +178 -0
  116. package/lib/init/detect-stack.js +148 -0
  117. package/lib/init/generate-config.js +31 -0
  118. package/lib/init/index.js +86 -0
  119. package/lib/init/prompt.js +60 -0
  120. package/lib/init/scaffold.js +67 -0
  121. package/lib/init/suggest-agent.js +46 -0
  122. package/package.json +10 -2
@@ -0,0 +1,203 @@
1
+ /**
2
+ * MCP Tool Implementation Example
3
+ *
4
+ * Demonstrates a complete Tool handler following the MCP specification.
5
+ * Tools are functions the AI can call that may have side effects.
6
+ *
7
+ * Key patterns:
8
+ * - Schema-first design with JSON Schema validation
9
+ * - Structured error responses with isError flag
10
+ * - Input validation before processing
11
+ * - NestJS injectable service pattern
12
+ */
13
+
14
+ import { Injectable } from '@nestjs/common';
15
+
16
+ // --- 1. Define the Tool Schema (JSON Schema) ---
17
+
18
+ export const fileAnalyzerToolSchema = {
19
+ name: 'analyze_file',
20
+ description:
21
+ 'Analyze a source file for code quality metrics including complexity, ' +
22
+ 'line count, and dependency analysis. Use when reviewing code quality ' +
23
+ 'or planning refactoring.',
24
+ inputSchema: {
25
+ type: 'object' as const,
26
+ properties: {
27
+ filePath: {
28
+ type: 'string',
29
+ description: 'Relative path to the file from project root (e.g., "src/utils/parser.ts")',
30
+ minLength: 1,
31
+ maxLength: 500,
32
+ },
33
+ metrics: {
34
+ type: 'array',
35
+ description: 'Specific metrics to analyze (default: all)',
36
+ items: {
37
+ type: 'string',
38
+ enum: ['complexity', 'lines', 'dependencies', 'exports'],
39
+ },
40
+ default: ['complexity', 'lines', 'dependencies', 'exports'],
41
+ },
42
+ includeSource: {
43
+ type: 'boolean',
44
+ description: 'Whether to include the source code in the response (default: false)',
45
+ default: false,
46
+ },
47
+ },
48
+ required: ['filePath'],
49
+ },
50
+ };
51
+
52
+ // --- 2. Define Result Types ---
53
+
54
+ interface ToolResult {
55
+ content: Array<{ type: 'text'; text: string }>;
56
+ isError?: boolean;
57
+ }
58
+
59
+ interface FileAnalysis {
60
+ filePath: string;
61
+ lineCount: number;
62
+ complexity: number;
63
+ dependencies: string[];
64
+ exports: string[];
65
+ }
66
+
67
+ // --- 3. Implement the Tool Handler ---
68
+
69
+ @Injectable()
70
+ export class FileAnalyzerHandler {
71
+ constructor(private readonly fileService: FileService) {}
72
+
73
+ async handle(params: {
74
+ filePath: string;
75
+ metrics?: string[];
76
+ includeSource?: boolean;
77
+ }): Promise<ToolResult> {
78
+ // Step 1: Validate input
79
+ if (!params.filePath?.trim()) {
80
+ return this.errorResult('filePath is required and cannot be empty');
81
+ }
82
+
83
+ if (params.filePath.includes('..')) {
84
+ return this.errorResult('filePath cannot contain path traversal (..)');
85
+ }
86
+
87
+ // Step 2: Check file exists
88
+ const exists = await this.fileService.exists(params.filePath);
89
+ if (!exists) {
90
+ return this.errorResult(`File not found: ${params.filePath}`);
91
+ }
92
+
93
+ // Step 3: Perform analysis
94
+ try {
95
+ const analysis = await this.analyze(params.filePath, params.metrics);
96
+ const output = this.formatAnalysis(analysis, params.includeSource);
97
+
98
+ return {
99
+ content: [{ type: 'text', text: output }],
100
+ };
101
+ } catch (error) {
102
+ return this.errorResult(
103
+ `Analysis failed for ${params.filePath}: ${(error as Error).message}`,
104
+ );
105
+ }
106
+ }
107
+
108
+ private async analyze(
109
+ filePath: string,
110
+ metrics?: string[],
111
+ ): Promise<FileAnalysis> {
112
+ const content = await this.fileService.read(filePath);
113
+ const lines = content.split('\n');
114
+ const selected = new Set(metrics ?? ['complexity', 'lines', 'dependencies', 'exports']);
115
+
116
+ return {
117
+ filePath,
118
+ lineCount: selected.has('lines') ? lines.length : -1,
119
+ complexity: selected.has('complexity') ? this.calculateComplexity(lines) : -1,
120
+ dependencies: selected.has('dependencies') ? this.extractDependencies(lines) : [],
121
+ exports: selected.has('exports') ? this.extractExports(lines) : [],
122
+ };
123
+ }
124
+
125
+ private calculateComplexity(lines: string[]): number {
126
+ const complexityKeywords = /\b(if|else|for|while|switch|case|catch|&&|\|\||\?)\b/g;
127
+ return lines.reduce((sum, line) => {
128
+ const matches = line.match(complexityKeywords);
129
+ return sum + (matches?.length ?? 0);
130
+ }, 1); // Base complexity of 1
131
+ }
132
+
133
+ private extractDependencies(lines: string[]): string[] {
134
+ const importPattern = /^import\s+.*from\s+['"]([^'"]+)['"]/;
135
+ return lines
136
+ .map((line) => line.match(importPattern)?.[1])
137
+ .filter((dep): dep is string => dep !== undefined);
138
+ }
139
+
140
+ private extractExports(lines: string[]): string[] {
141
+ const exportPattern = /^export\s+(?:default\s+)?(?:class|function|const|interface|type|enum)\s+(\w+)/;
142
+ return lines
143
+ .map((line) => line.match(exportPattern)?.[1])
144
+ .filter((name): name is string => name !== undefined);
145
+ }
146
+
147
+ private formatAnalysis(analysis: FileAnalysis, includeSource?: boolean): string {
148
+ const sections: string[] = [
149
+ `## File Analysis: ${analysis.filePath}`,
150
+ '',
151
+ ];
152
+
153
+ if (analysis.lineCount >= 0) {
154
+ sections.push(`**Lines:** ${analysis.lineCount}`);
155
+ }
156
+ if (analysis.complexity >= 0) {
157
+ sections.push(`**Cyclomatic Complexity:** ${analysis.complexity}`);
158
+ }
159
+ if (analysis.dependencies.length > 0) {
160
+ sections.push('', '**Dependencies:**');
161
+ analysis.dependencies.forEach((dep) => sections.push(`- \`${dep}\``));
162
+ }
163
+ if (analysis.exports.length > 0) {
164
+ sections.push('', '**Exports:**');
165
+ analysis.exports.forEach((exp) => sections.push(`- \`${exp}\``));
166
+ }
167
+
168
+ return sections.join('\n');
169
+ }
170
+
171
+ private errorResult(message: string): ToolResult {
172
+ return {
173
+ content: [{ type: 'text', text: `Error: ${message}` }],
174
+ isError: true,
175
+ };
176
+ }
177
+ }
178
+
179
+ // --- 4. Register in MCP Service ---
180
+
181
+ /*
182
+ // In mcp.service.ts:
183
+ import { fileAnalyzerToolSchema, FileAnalyzerHandler } from './tools/file-analyzer';
184
+
185
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
186
+ tools: [fileAnalyzerToolSchema],
187
+ }));
188
+
189
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
190
+ switch (request.params.name) {
191
+ case 'analyze_file':
192
+ return this.fileAnalyzerHandler.handle(request.params.arguments);
193
+ default:
194
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
195
+ }
196
+ });
197
+ */
198
+
199
+ // Placeholder for dependency injection
200
+ interface FileService {
201
+ exists(path: string): Promise<boolean>;
202
+ read(path: string): Promise<string>;
203
+ }
@@ -0,0 +1,215 @@
1
+ # MCP Protocol Quick Reference
2
+
3
+ ## Protocol Overview
4
+
5
+ The Model Context Protocol (MCP) uses JSON-RPC 2.0 over stdio or HTTP+SSE transport. Servers expose three capability types: **Tools**, **Resources**, and **Prompts**.
6
+
7
+ ## JSON-RPC 2.0 Message Format
8
+
9
+ ### Request
10
+
11
+ ```json
12
+ {
13
+ "jsonrpc": "2.0",
14
+ "id": 1,
15
+ "method": "tools/call",
16
+ "params": {
17
+ "name": "search_rules",
18
+ "arguments": { "query": "TDD" }
19
+ }
20
+ }
21
+ ```
22
+
23
+ ### Response (Success)
24
+
25
+ ```json
26
+ {
27
+ "jsonrpc": "2.0",
28
+ "id": 1,
29
+ "result": {
30
+ "content": [{ "type": "text", "text": "..." }]
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### Response (Error)
36
+
37
+ ```json
38
+ {
39
+ "jsonrpc": "2.0",
40
+ "id": 1,
41
+ "error": {
42
+ "code": -32601,
43
+ "message": "Method not found"
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Capability Methods
49
+
50
+ ### Tools
51
+
52
+ | Method | Direction | Description |
53
+ |--------|-----------|-------------|
54
+ | `tools/list` | Client → Server | List available tools with schemas |
55
+ | `tools/call` | Client → Server | Execute a tool by name with arguments |
56
+
57
+ **Tool Result Shape:**
58
+
59
+ ```typescript
60
+ interface ToolResult {
61
+ content: ContentBlock[]; // text, image, or resource content
62
+ isError?: boolean; // true if the tool encountered an error
63
+ }
64
+
65
+ type ContentBlock =
66
+ | { type: 'text'; text: string }
67
+ | { type: 'image'; data: string; mimeType: string }
68
+ | { type: 'resource'; resource: ResourceContent };
69
+ ```
70
+
71
+ ### Resources
72
+
73
+ | Method | Direction | Description |
74
+ |--------|-----------|-------------|
75
+ | `resources/list` | Client → Server | List available resources |
76
+ | `resources/templates/list` | Client → Server | List URI templates for dynamic resources |
77
+ | `resources/read` | Client → Server | Read a resource by URI |
78
+ | `notifications/resources/list_changed` | Server → Client | Notify resource list changed |
79
+
80
+ **Resource Shape:**
81
+
82
+ ```typescript
83
+ interface Resource {
84
+ uri: string; // e.g., "rules://core"
85
+ name: string; // Human-readable name
86
+ description?: string; // What this resource contains
87
+ mimeType?: string; // e.g., "text/markdown", "application/json"
88
+ }
89
+
90
+ interface ResourceContent {
91
+ uri: string;
92
+ mimeType?: string;
93
+ text?: string; // For text content
94
+ blob?: string; // For binary content (base64)
95
+ }
96
+ ```
97
+
98
+ ### Prompts
99
+
100
+ | Method | Direction | Description |
101
+ |--------|-----------|-------------|
102
+ | `prompts/list` | Client → Server | List available prompt templates |
103
+ | `prompts/get` | Client → Server | Get a prompt with arguments filled in |
104
+
105
+ **Prompt Shape:**
106
+
107
+ ```typescript
108
+ interface Prompt {
109
+ name: string;
110
+ description?: string;
111
+ arguments?: PromptArgument[];
112
+ }
113
+
114
+ interface PromptArgument {
115
+ name: string;
116
+ description?: string;
117
+ required?: boolean;
118
+ }
119
+
120
+ interface GetPromptResult {
121
+ messages: Array<{
122
+ role: 'user' | 'assistant';
123
+ content: TextContent | ImageContent | EmbeddedResource;
124
+ }>;
125
+ }
126
+ ```
127
+
128
+ ## Initialization Handshake
129
+
130
+ ```
131
+ Client Server
132
+ | |
133
+ |-- initialize ----------------->| (capabilities, clientInfo)
134
+ |<-- initialize result ----------| (capabilities, serverInfo)
135
+ |-- notifications/initialized -->| (confirm ready)
136
+ | |
137
+ |-- tools/list ----------------->| (discover tools)
138
+ |-- resources/list ------------->| (discover resources)
139
+ |-- prompts/list --------------->| (discover prompts)
140
+ ```
141
+
142
+ ### Server Capabilities Declaration
143
+
144
+ ```typescript
145
+ const serverCapabilities = {
146
+ tools: {}, // Server provides tools
147
+ resources: {
148
+ subscribe: true, // Supports resource subscriptions
149
+ listChanged: true, // Sends list_changed notifications
150
+ },
151
+ prompts: {
152
+ listChanged: true, // Sends list_changed notifications
153
+ },
154
+ };
155
+ ```
156
+
157
+ ## Transport Modes
158
+
159
+ ### Stdio
160
+
161
+ - Server reads JSON-RPC from stdin, writes to stdout
162
+ - Logs MUST go to stderr (never stdout)
163
+ - One message per line (newline-delimited JSON)
164
+ - No HTTP overhead, fastest for local use
165
+
166
+ ### HTTP + SSE
167
+
168
+ - Client opens SSE connection at `GET /sse`
169
+ - Server sends `endpoint` event with message URL
170
+ - Client sends JSON-RPC via `POST /messages`
171
+ - Server streams responses via SSE
172
+
173
+ ```
174
+ Client Server
175
+ | |
176
+ |-- GET /sse ----------------------->| (open SSE stream)
177
+ |<-- event: endpoint ---------------| (data: /messages?sessionId=abc)
178
+ | |
179
+ |-- POST /messages?sessionId=abc --->| (JSON-RPC request)
180
+ |<-- event: message ----------------| (JSON-RPC response via SSE)
181
+ ```
182
+
183
+ ## Error Codes
184
+
185
+ | Code | Name | Description |
186
+ |------|------|-------------|
187
+ | `-32700` | Parse error | Invalid JSON |
188
+ | `-32600` | Invalid request | Missing required fields |
189
+ | `-32601` | Method not found | Unknown method |
190
+ | `-32602` | Invalid params | Wrong parameter types |
191
+ | `-32603` | Internal error | Server-side error |
192
+
193
+ ## Input Schema Best Practices
194
+
195
+ - Always set `type: 'object'` at the top level
196
+ - Mark required parameters in the `required` array
197
+ - Add `description` to every property (LLMs use these to decide how to call)
198
+ - Use `minLength`, `maximum`, `enum` constraints where applicable
199
+ - Set sensible `default` values for optional parameters
200
+
201
+ ## URI Scheme Conventions
202
+
203
+ ```
204
+ scheme://authority/path
205
+
206
+ rules://core → Core rules
207
+ rules://augmented-coding → Augmented coding rules
208
+ agents://solution-architect → Agent definition
209
+ config://project → Project config
210
+ skills://mcp-builder → Skill content
211
+ ```
212
+
213
+ - Use lowercase, hyphen-separated paths
214
+ - Scheme should indicate the resource domain
215
+ - Path should be human-readable and predictable
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: performance-optimization
3
3
  description: Use when optimizing code performance, addressing slowness complaints, or measuring application speed improvements
4
+ context: fork
5
+ agent: general-purpose
6
+ allowed-tools: Read, Grep, Glob, Bash
4
7
  ---
5
8
 
6
9
  # Performance Optimization
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: plan-and-review
3
+ description: Use when creating implementation plans that need quality review before execution — 4-phase workflow combining plan creation with automated plan-reviewer validation
4
+ ---
5
+
6
+ # Plan and Review
7
+
8
+ ## Overview
9
+
10
+ Create implementation plans and validate them through automated review before execution. This skill combines the writing-plans methodology with plan-reviewer agent dispatch to catch quality issues (missing file paths, vague acceptance criteria, scope gaps, TDD omissions) before any code is written.
11
+
12
+ **Announce at start:** "I'm using the plan-and-review skill to create and validate the implementation plan."
13
+
14
+ **Core principle:** No plan reaches execution without passing review. Critical/High findings must be resolved first.
15
+
16
+ ## The 4 Phases
17
+
18
+ ```
19
+ Phase 1: Create Plan → Phase 2: Review → Phase 3: Revise (if needed) → Phase 4: Approved
20
+ ```
21
+
22
+ ### Phase 1: Create Plan
23
+
24
+ Use the writing-plans methodology to create the implementation plan.
25
+
26
+ 1. **Invoke the writing-plans skill** (superpowers:writing-plans or equivalent)
27
+ 2. Follow all writing-plans requirements:
28
+ - Bite-sized tasks (2-5 minutes each)
29
+ - Exact file paths for all changes
30
+ - TDD structure (Red-Green-Refactor) for core logic
31
+ - Complete code in plan (no placeholders)
32
+ - Alternatives exploration for non-trivial decisions
33
+ 3. Save plan to `docs/plans/YYYY-MM-DD-<feature-name>.md`
34
+
35
+ ### Phase 2: Dispatch Plan Reviewer
36
+
37
+ Dispatch the plan-reviewer agent as a subAgent to review the plan.
38
+
39
+ 1. **Dispatch plan-reviewer** using the Agent tool:
40
+ ```
41
+ subagent_type: "general-purpose"
42
+ prompt: |
43
+ You are the Plan Reviewer agent. Review the implementation plan at
44
+ docs/plans/<plan-file>.md against the original spec/issue.
45
+
46
+ Review checklist:
47
+ - File paths: All paths valid (Modify files exist, Create paths have valid parents)
48
+ - Acceptance criteria: Specific, measurable, verifiable (no vague terms)
49
+ - Scope alignment: Plan matches spec — no scope creep, no missing items
50
+ - TDD compliance: Red-Green-Refactor for core logic tasks
51
+ - Backward compatibility: Breaking changes documented with migration steps
52
+
53
+ Output a severity-rated findings table:
54
+ | Finding | Location | Severity | Recommendation |
55
+
56
+ End with Review Summary showing counts per severity and verdict:
57
+ APPROVED (Critical=0 AND High=0) or REVISE REQUIRED.
58
+ ```
59
+ 2. Collect the review results
60
+
61
+ ### Phase 3: Revise Plan (if Critical/High findings)
62
+
63
+ If the review verdict is **REVISE REQUIRED**:
64
+
65
+ 1. Read each Critical and High finding
66
+ 2. Revise the plan to address each finding:
67
+ - Fix invalid file paths
68
+ - Make acceptance criteria specific and testable
69
+ - Add missing spec requirements as tasks
70
+ - Add TDD structure where missing
71
+ - Document breaking changes with migration steps
72
+ 3. Save the revised plan (overwrite the same file)
73
+ 4. **Re-dispatch plan-reviewer** (return to Phase 2)
74
+ 5. Repeat until verdict is **APPROVED**
75
+
76
+ **Maximum iterations:** 3 revision cycles. If still not approved after 3 cycles, present remaining findings to user for manual resolution.
77
+
78
+ ### Phase 4: Plan Approved
79
+
80
+ When the review verdict is **APPROVED**:
81
+
82
+ 1. Announce: "Plan approved by plan-reviewer — ready for execution."
83
+ 2. Present remaining Medium/Low findings as optional improvements
84
+ 3. Offer execution choice:
85
+ - **Subagent-Driven (this session):** Use superpowers:subagent-driven-development
86
+ - **Parallel Session (separate):** Use superpowers:executing-plans
87
+
88
+ ## When to Use This Skill
89
+
90
+ - Creating implementation plans for non-trivial features
91
+ - Plans that will be executed by other agents or in separate sessions
92
+ - When plan quality is critical (e.g., parallel execution with multiple workers)
93
+ - When the spec is complex and scope alignment matters
94
+
95
+ ## When NOT to Use This Skill
96
+
97
+ - Single-file changes or trivial fixes
98
+ - Plans you will execute yourself immediately in the same session
99
+ - Exploratory prototyping where the plan will evolve rapidly
100
+
101
+ ## Integration with Parallel Orchestrator
102
+
103
+ When used within parallel execution workflows:
104
+
105
+ - The conductor generates worker directives that include plan creation
106
+ - Each worker can use this skill to self-validate their plan before ACT mode
107
+ - The plan-reviewer findings feed into the conductor's quality gates
108
+
109
+ ## Key Principles
110
+
111
+ - **No plan without review** — every plan gets at least one review pass
112
+ - **Severity drives action** — Critical/High must be fixed, Medium/Low are optional
113
+ - **Evidence-based findings** — every finding references a specific plan section
114
+ - **Bounded iteration** — maximum 3 revision cycles to prevent infinite loops
115
+ - **Clear verdict** — APPROVED or REVISE REQUIRED, no ambiguity
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: pr-all-in-one
3
3
  description: Unified commit and PR workflow. Auto-commits changes, creates/updates PRs with smart issue linking and multi-language support.
4
+ disable-model-invocation: true
5
+ argument-hint: [target-branch] [issue-id]
4
6
  ---
5
7
 
6
8
  # PR All-in-One
@@ -92,7 +94,7 @@ Step 7: Update existing PR (if exists)
92
94
  │ └── "bilingual" → Bilingual Template
93
95
  ├── Generate title:
94
96
  │ ├── "en"/"bilingual" → English title
95
- │ └── "ko" → 한국어 title
97
+ │ └── "ko" → Korean title
96
98
  ├── Generate body with selected template
97
99
  ├── Merge with .github/pull_request_template.md (if exists)
98
100
  ├── NO AI signature
@@ -107,7 +109,7 @@ Step 8: Create new PR (if not exists)
107
109
  │ └── "bilingual" → Bilingual Template
108
110
  ├── Generate title:
109
111
  │ ├── "en"/"bilingual" → English (e.g., "feat: add auth")
110
- │ └── "ko" → 한국어 (e.g., "feat: 인증 추가")
112
+ │ └── "ko" → Korean (e.g., "feat: add authentication")
111
113
  ├── Generate body with selected template + commit analysis
112
114
  ├── Merge with project template if exists
113
115
  ├── NO AI signature
@@ -246,22 +248,22 @@ N/A (no UI changes)
246
248
 
247
249
  #### When `prLanguage: "ko"`
248
250
 
249
- **Title**: `feat: 사용자 인증 추가`
251
+ **Title**: `feat: add user authentication`
250
252
 
251
253
  **Body**:
252
254
  ```markdown
253
- ## 컨텍스트
255
+ ## Context
254
256
 
255
- **관련 링크:**
256
- - 이슈: [AUTH-123](https://jira.example.com/browse/AUTH-123)
257
+ **Related Links:**
258
+ - Issue: [AUTH-123](https://jira.example.com/browse/AUTH-123)
257
259
 
258
- **상세 설명:**
260
+ **Description Details:**
259
261
 
260
- JWT 기반 인증과 리프레시 토큰 지원을 추가했습니다.
262
+ Added JWT-based authentication with refresh token support.
261
263
 
262
- ## 스크린샷 또는 비디오
264
+ ## Screenshots or Videos
263
265
 
264
- N/A (UI 변경 없음)
266
+ N/A (no UI changes)
265
267
  ```
266
268
 
267
269
  #### When `prLanguage: "bilingual"`
@@ -281,13 +283,13 @@ Added JWT-based authentication with refresh token support.
281
283
 
282
284
  ---
283
285
 
284
- **상세 설명:**
286
+ **Description Details (Korean):**
285
287
 
286
- JWT 기반 인증과 리프레시 토큰 지원을 추가했습니다.
288
+ Added JWT-based authentication with refresh token support. (Korean translation here)
287
289
 
288
290
  ## Screenshots or Videos
289
291
 
290
- N/A (no UI changes / UI 변경 없음)
292
+ N/A (no UI changes)
291
293
  ```
292
294
 
293
295
  ### Template Definitions
@@ -42,7 +42,7 @@ The skill uses an interactive 4-step configuration flow:
42
42
  [3/4] PR Language
43
43
  ┌──────────────────────────┐
44
44
  │ PR description language │
45
- │ [English] [한국어] │
45
+ │ [English] [Korean] │
46
46
  │ [Bilingual] (EN + KO) │
47
47
  └──────────────────────────┘
48
48
 
@@ -78,7 +78,7 @@ Selects which issue tracking system is used:
78
78
 
79
79
  Determines the language for PR descriptions:
80
80
  - **English**: PRs written in English only
81
- - **한국어**: PRs written in Korean only
81
+ - **Korean**: PRs written in Korean only
82
82
  - **Bilingual**: PRs include both English and Korean
83
83
 
84
84
  ##### Detailed Language Behavior
@@ -86,7 +86,7 @@ Determines the language for PR descriptions:
86
86
  | Value | PR Title | PR Body | Use Case |
87
87
  |-------|----------|---------|----------|
88
88
  | `en` | English | English only | International teams, open source projects |
89
- | `ko` | 한국어 | 한국어만 | Korean-only teams, internal projects |
89
+ | `ko` | Korean | Korean only | Korean-only teams, internal projects |
90
90
  | `bilingual` | English | English + Korean | Mixed teams, global + local collaboration |
91
91
 
92
92
  ##### Language Examples
@@ -97,14 +97,14 @@ Determines the language for PR descriptions:
97
97
  - Best for: Open source, international collaboration
98
98
 
99
99
  **`ko` (Korean)**:
100
- - Title: `feat: 사용자 인증 추가`
101
- - Body: 한국어만 사용한 설명
102
- - Best for: 한국어 기반 팀, 내부 프로젝트
100
+ - Title: `feat: add user authentication`
101
+ - Body: Korean-only description
102
+ - Best for: Korean-speaking teams, internal projects
103
103
 
104
104
  **`bilingual` (Both)**:
105
105
  - Title: `feat: add user authentication` (English)
106
106
  - Body: English description followed by Korean translation
107
- - Best for: 글로벌 팀과 한국 팀이 함께 협업하는 프로젝트
107
+ - Best for: Projects where global and Korean teams collaborate together
108
108
 
109
109
  #### Step 4: Issue URL Template
110
110
  Optional template for auto-generating issue links in PR bodies. Use `{id}` placeholder for the issue ID.