metacoding 1.4.3 → 1.5.1
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.
- package/CHANGELOG.md +89 -0
- package/README.md +182 -42
- package/lib/cli.d.ts.map +1 -1
- package/lib/cli.js +15 -13
- package/lib/cli.js.map +1 -1
- package/lib/commands/init.d.ts +7 -0
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +272 -32
- package/lib/commands/init.js.map +1 -1
- package/lib/services/assistant-adapter.d.ts +18 -0
- package/lib/services/assistant-adapter.d.ts.map +1 -0
- package/lib/services/assistant-adapter.js +246 -0
- package/lib/services/assistant-adapter.js.map +1 -0
- package/lib/types/index.d.ts +11 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/assistants/AGENTS.md +203 -0
- package/templates/assistants/CLAUDE.md +156 -0
- package/templates/assistants/GEMINI.md +193 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AssistantAdapterService = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const filesystem_1 = require("./filesystem");
|
|
9
|
+
class AssistantAdapterService {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.fileSystem = new filesystem_1.FileSystemService();
|
|
12
|
+
}
|
|
13
|
+
getAvailableAssistants() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: 'copilot',
|
|
17
|
+
fileName: '.github/copilot-instructions.md',
|
|
18
|
+
description: 'GitHub Copilot - VS Code and IDEs',
|
|
19
|
+
instructions: 'Existing copilot-instructions.md template'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'claude',
|
|
23
|
+
fileName: 'CLAUDE.md',
|
|
24
|
+
description: 'Claude Code - Terminal and project instructions',
|
|
25
|
+
instructions: 'CLAUDE.md template with project instructions'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'codex',
|
|
29
|
+
fileName: 'AGENTS.md',
|
|
30
|
+
description: 'Codex/OpenAI - System message and agent instructions',
|
|
31
|
+
instructions: 'AGENTS.md template with system message configuration'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'gemini',
|
|
35
|
+
fileName: 'GEMINI.md',
|
|
36
|
+
description: 'Gemini Code Assist - Style guide and configuration',
|
|
37
|
+
instructions: 'GEMINI.md template with hierarchical discovery'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
async generateAssistantFiles(assistantTypes, projectConfig, targetPath) {
|
|
42
|
+
const generatedFiles = [];
|
|
43
|
+
if (!assistantTypes || !Array.isArray(assistantTypes)) {
|
|
44
|
+
assistantTypes = ['copilot'];
|
|
45
|
+
}
|
|
46
|
+
if (assistantTypes.includes('all')) {
|
|
47
|
+
assistantTypes = ['copilot', 'claude', 'codex', 'gemini'];
|
|
48
|
+
}
|
|
49
|
+
for (const assistantType of assistantTypes) {
|
|
50
|
+
if (assistantType === 'all')
|
|
51
|
+
continue;
|
|
52
|
+
const filePath = await this.generateAssistantFile(assistantType, projectConfig, targetPath);
|
|
53
|
+
if (filePath) {
|
|
54
|
+
generatedFiles.push(filePath);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return generatedFiles;
|
|
58
|
+
}
|
|
59
|
+
async generateAssistantFile(assistantType, projectConfig, targetPath) {
|
|
60
|
+
try {
|
|
61
|
+
let templatePath;
|
|
62
|
+
let outputPath;
|
|
63
|
+
switch (assistantType) {
|
|
64
|
+
case 'copilot':
|
|
65
|
+
templatePath = path_1.default.join(__dirname, '../..', 'templates', 'general', 'copilot-instructions.md');
|
|
66
|
+
outputPath = path_1.default.join(targetPath, '.github', 'copilot-instructions.md');
|
|
67
|
+
break;
|
|
68
|
+
case 'claude':
|
|
69
|
+
templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'CLAUDE.md');
|
|
70
|
+
outputPath = path_1.default.join(targetPath, 'CLAUDE.md');
|
|
71
|
+
break;
|
|
72
|
+
case 'codex':
|
|
73
|
+
templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'AGENTS.md');
|
|
74
|
+
outputPath = path_1.default.join(targetPath, 'AGENTS.md');
|
|
75
|
+
break;
|
|
76
|
+
case 'gemini':
|
|
77
|
+
templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'GEMINI.md');
|
|
78
|
+
outputPath = path_1.default.join(targetPath, 'GEMINI.md');
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
console.warn(`Unknown assistant type: ${assistantType}`);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const templateContent = await this.fileSystem.readFile(templatePath);
|
|
85
|
+
if (!templateContent) {
|
|
86
|
+
console.warn(`Template not found for ${assistantType}: ${templatePath}`);
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
const processedContent = this.substituteVariables(templateContent, projectConfig);
|
|
90
|
+
const outputDir = path_1.default.dirname(outputPath);
|
|
91
|
+
await this.fileSystem.ensureDirectoryExists(outputDir);
|
|
92
|
+
await this.fileSystem.writeFile(outputPath, processedContent);
|
|
93
|
+
return outputPath;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error(`Error generating ${assistantType} configuration:`, error);
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
substituteVariables(content, projectConfig) {
|
|
101
|
+
const variables = {
|
|
102
|
+
PROJECT_NAME: projectConfig.name,
|
|
103
|
+
PROJECT_DESCRIPTION: projectConfig.description,
|
|
104
|
+
TECH_STACK: projectConfig.techStack.join(', '),
|
|
105
|
+
PROJECT_DOMAIN: projectConfig.projectType,
|
|
106
|
+
ENVIRONMENT_TYPE: projectConfig.ideChoice === 'vscode' || projectConfig.ideChoice === 'cursor'
|
|
107
|
+
? 'IDE'
|
|
108
|
+
: 'Terminal',
|
|
109
|
+
BUILD_COMMAND: this.getBuildCommand(projectConfig),
|
|
110
|
+
TEST_COMMAND: this.getTestCommand(projectConfig),
|
|
111
|
+
LINT_COMMAND: this.getLintCommand(projectConfig),
|
|
112
|
+
TYPECHECK_COMMAND: this.getTypecheckCommand(projectConfig),
|
|
113
|
+
CODE_STYLE_GUIDELINES: this.getCodeStyleGuidelines(projectConfig),
|
|
114
|
+
REPOSITORY_STRUCTURE: this.getRepositoryStructure(projectConfig),
|
|
115
|
+
PROJECT_SPECIFIC_GUIDANCE: ''
|
|
116
|
+
};
|
|
117
|
+
let result = content;
|
|
118
|
+
for (const [key, value] of Object.entries(variables)) {
|
|
119
|
+
const regex = new RegExp(`{{${key}}}`, 'g');
|
|
120
|
+
result = result.replace(regex, value);
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
getBuildCommand(projectConfig) {
|
|
125
|
+
switch (projectConfig.projectType) {
|
|
126
|
+
case 'react':
|
|
127
|
+
case 'node':
|
|
128
|
+
case 'typescript':
|
|
129
|
+
case 'javascript':
|
|
130
|
+
return 'npm run build';
|
|
131
|
+
case 'python':
|
|
132
|
+
return 'python -m build';
|
|
133
|
+
default:
|
|
134
|
+
return 'npm run build';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
getTestCommand(projectConfig) {
|
|
138
|
+
if (projectConfig.testFramework) {
|
|
139
|
+
switch (projectConfig.testFramework) {
|
|
140
|
+
case 'jest':
|
|
141
|
+
return 'npm test';
|
|
142
|
+
case 'vitest':
|
|
143
|
+
return 'npm run test';
|
|
144
|
+
case 'pytest':
|
|
145
|
+
return 'pytest';
|
|
146
|
+
default:
|
|
147
|
+
return 'npm test';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
switch (projectConfig.projectType) {
|
|
151
|
+
case 'python':
|
|
152
|
+
return 'pytest';
|
|
153
|
+
default:
|
|
154
|
+
return 'npm test';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
getLintCommand(projectConfig) {
|
|
158
|
+
switch (projectConfig.projectType) {
|
|
159
|
+
case 'python':
|
|
160
|
+
return 'flake8 . && black --check .';
|
|
161
|
+
default:
|
|
162
|
+
return 'npm run lint';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
getTypecheckCommand(projectConfig) {
|
|
166
|
+
switch (projectConfig.projectType) {
|
|
167
|
+
case 'typescript':
|
|
168
|
+
case 'react':
|
|
169
|
+
return 'npm run typecheck || tsc --noEmit';
|
|
170
|
+
case 'python':
|
|
171
|
+
return 'mypy .';
|
|
172
|
+
default:
|
|
173
|
+
return 'echo "No type checking configured"';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
getCodeStyleGuidelines(projectConfig) {
|
|
177
|
+
switch (projectConfig.projectType) {
|
|
178
|
+
case 'react':
|
|
179
|
+
return 'Use functional components with hooks, JSX best practices, semantic HTML';
|
|
180
|
+
case 'typescript':
|
|
181
|
+
case 'node':
|
|
182
|
+
return 'Use TypeScript strict mode, explicit types, async/await patterns';
|
|
183
|
+
case 'python':
|
|
184
|
+
return 'Follow PEP 8, use type hints, prefer list comprehensions';
|
|
185
|
+
case 'javascript':
|
|
186
|
+
return 'Use ES6+ features, const/let over var, arrow functions';
|
|
187
|
+
default:
|
|
188
|
+
return 'Follow language-specific conventions and best practices';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
getRepositoryStructure(projectConfig) {
|
|
192
|
+
const baseStructure = `
|
|
193
|
+
/src # All source code
|
|
194
|
+
/_meta # Development documentation
|
|
195
|
+
/test # All test-related files
|
|
196
|
+
/.github # GitHub-specific files`;
|
|
197
|
+
switch (projectConfig.projectType) {
|
|
198
|
+
case 'react':
|
|
199
|
+
return `${baseStructure}
|
|
200
|
+
/components # Reusable React components
|
|
201
|
+
/hooks # Custom React hooks
|
|
202
|
+
/pages # Page components
|
|
203
|
+
/utils # Utility functions`;
|
|
204
|
+
case 'node':
|
|
205
|
+
case 'typescript':
|
|
206
|
+
return `${baseStructure}
|
|
207
|
+
/services # Business logic services
|
|
208
|
+
/routes # API routes
|
|
209
|
+
/middleware # Express middleware
|
|
210
|
+
/utils # Utility functions`;
|
|
211
|
+
case 'python':
|
|
212
|
+
return `${baseStructure}
|
|
213
|
+
/modules # Python modules
|
|
214
|
+
/utils # Utility functions
|
|
215
|
+
/config # Configuration files
|
|
216
|
+
requirements.txt # Python dependencies`;
|
|
217
|
+
default:
|
|
218
|
+
return `${baseStructure}
|
|
219
|
+
/components # Reusable components
|
|
220
|
+
/services # Business logic
|
|
221
|
+
/utils # Utility functions`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
async detectExistingAssistants(projectPath) {
|
|
225
|
+
const existingAssistants = [];
|
|
226
|
+
const assistantFiles = [
|
|
227
|
+
{ type: 'copilot', path: '.github/copilot-instructions.md' },
|
|
228
|
+
{ type: 'claude', path: 'CLAUDE.md' },
|
|
229
|
+
{ type: 'codex', path: 'AGENTS.md' },
|
|
230
|
+
{ type: 'gemini', path: 'GEMINI.md' }
|
|
231
|
+
];
|
|
232
|
+
for (const { type, path: filePath } of assistantFiles) {
|
|
233
|
+
const fullPath = path_1.default.join(projectPath, filePath);
|
|
234
|
+
if (await this.fileSystem.fileExists(fullPath)) {
|
|
235
|
+
existingAssistants.push(type);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return existingAssistants;
|
|
239
|
+
}
|
|
240
|
+
async hasExistingAssistantConfig(projectPath) {
|
|
241
|
+
const existingAssistants = await this.detectExistingAssistants(projectPath);
|
|
242
|
+
return existingAssistants.length > 0;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
exports.AssistantAdapterService = AssistantAdapterService;
|
|
246
|
+
//# sourceMappingURL=assistant-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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ACX,OAAO,GAAG,aAAa;;;;2CAIY,CAAC;YAEtC;gBACE,OAAO,GAAG,aAAa;;;yCAGU,CAAC;QACtC,CAAC;IACH,CAAC;IAKD,KAAK,CAAC,wBAAwB,CAAC,WAAmB;QAChD,MAAM,kBAAkB,GAAoB,EAAE,CAAC;QAE/C,MAAM,cAAc,GAAG;YACrB,EAAE,IAAI,EAAE,SAA0B,EAAE,IAAI,EAAE,iCAAiC,EAAE;YAC7E,EAAE,IAAI,EAAE,QAAyB,EAAE,IAAI,EAAE,WAAW,EAAE;YACtD,EAAE,IAAI,EAAE,OAAwB,EAAE,IAAI,EAAE,WAAW,EAAE;YACrD,EAAE,IAAI,EAAE,QAAyB,EAAE,IAAI,EAAE,WAAW,EAAE;SACvD,CAAC;QAEF,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC;YACtD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAClD,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC/C,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAKD,KAAK,CAAC,0BAA0B,CAAC,WAAmB;QAClD,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;QAC5E,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;IACvC,CAAC;CACF;AAhWD,0DAgWC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,6 +6,16 @@ export interface InitOptions {
|
|
|
6
6
|
vscode?: boolean;
|
|
7
7
|
cursor?: boolean;
|
|
8
8
|
ide?: string;
|
|
9
|
+
environment?: 'ide' | 'terminal';
|
|
10
|
+
assistants?: AssistantType[];
|
|
11
|
+
ideChoice?: 'vscode' | 'cursor' | 'intellij';
|
|
12
|
+
}
|
|
13
|
+
export type AssistantType = 'copilot' | 'claude' | 'codex' | 'gemini' | 'all';
|
|
14
|
+
export interface AssistantConfig {
|
|
15
|
+
type: AssistantType;
|
|
16
|
+
fileName: string;
|
|
17
|
+
description: string;
|
|
18
|
+
instructions: string;
|
|
9
19
|
}
|
|
10
20
|
export interface UpdateOptions {
|
|
11
21
|
template?: string;
|
|
@@ -21,7 +31,7 @@ export interface ProjectConfig {
|
|
|
21
31
|
projectType: string;
|
|
22
32
|
testFramework?: string;
|
|
23
33
|
buildTool?: string;
|
|
24
|
-
ideChoice?: 'vscode' | 'cursor';
|
|
34
|
+
ideChoice?: 'vscode' | 'cursor' | 'intellij' | undefined;
|
|
25
35
|
}
|
|
26
36
|
export interface Template {
|
|
27
37
|
name: string;
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,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Q,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metacoding",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Guided Development Workflow for GitHub Copilot - Transform your coding experience with AI-guided standards, structured workflows, and quality practices",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} - Agent Instructions for Codex
|
|
2
|
+
|
|
3
|
+
This file provides system instructions for Codex/OpenAI-compatible agents to ensure consistent development practices and workflow adherence.
|
|
4
|
+
|
|
5
|
+
## Project Context
|
|
6
|
+
|
|
7
|
+
{{PROJECT_DESCRIPTION}}
|
|
8
|
+
|
|
9
|
+
**Project Goals:**
|
|
10
|
+
|
|
11
|
+
- Provide robust development workflow and best practices
|
|
12
|
+
- Ensure code quality and maintainability standards
|
|
13
|
+
- Enable efficient team collaboration and knowledge sharing
|
|
14
|
+
|
|
15
|
+
**Tech Stack:** {{TECH_STACK}}
|
|
16
|
+
**Environment:** {{ENVIRONMENT_TYPE}} development
|
|
17
|
+
**Domain:** {{PROJECT_DOMAIN}}
|
|
18
|
+
|
|
19
|
+
## System Message Configuration
|
|
20
|
+
|
|
21
|
+
You are a senior {{PROJECT_DOMAIN}} developer assistant working in a {{ENVIRONMENT_TYPE}} environment. Follow these instructions precisely for all development tasks.
|
|
22
|
+
|
|
23
|
+
## Mandatory Development Workflow
|
|
24
|
+
|
|
25
|
+
**ALL development tasks must follow this strict 7-step workflow to ensure code quality, proper testing, and comprehensive documentation.**
|
|
26
|
+
|
|
27
|
+
### Step 1: Task Understanding and Planning
|
|
28
|
+
|
|
29
|
+
**Instruction:** Always start with thorough analysis before implementation.
|
|
30
|
+
|
|
31
|
+
- Read project documentation and explore codebase structure thoroughly
|
|
32
|
+
- Assess uncertainty level (1.0 = total uncertainty, 0.1 = very low uncertainty)
|
|
33
|
+
- If uncertainty > 0.1, continue research and exploration before asking questions
|
|
34
|
+
- Present concise implementation outline with key details
|
|
35
|
+
- Wait for explicit user confirmation before proceeding
|
|
36
|
+
- **Critical:** No implementation work begins until all required documentation is complete
|
|
37
|
+
|
|
38
|
+
### Step 2: Task Management
|
|
39
|
+
|
|
40
|
+
**Instruction:** Document all work before execution.
|
|
41
|
+
|
|
42
|
+
- Add tasks to `/_meta/project-task-list.md` BEFORE any implementation work
|
|
43
|
+
- Use standardized naming convention: `[AREA]-TASK-[NUMBER]`
|
|
44
|
+
- Area prefixes: CORE, API, UI, DB, AUTH, UTIL, CONFIG, DOC, CLI, TMPL
|
|
45
|
+
- Mark tasks as "In Progress" with clear descriptions and effort estimates
|
|
46
|
+
- Break down complex tasks into manageable subtasks with sequential numbering
|
|
47
|
+
|
|
48
|
+
### Step 3: Test-Driven Development (TDD)
|
|
49
|
+
|
|
50
|
+
**Instruction:** Tests and test documentation come first.
|
|
51
|
+
|
|
52
|
+
- Document test cases in `/test/test-documentation.md` BEFORE implementing any tests
|
|
53
|
+
- Specify expected inputs, outputs, and edge cases in documentation
|
|
54
|
+
- Implement tests only after test cases are fully documented
|
|
55
|
+
- Verify tests fail appropriately (red phase)
|
|
56
|
+
- Write minimum code to make tests pass (green phase)
|
|
57
|
+
- Clean up test artifacts and move test data to `/test/fixtures/`
|
|
58
|
+
|
|
59
|
+
### Step 4: Implementation and Verification
|
|
60
|
+
|
|
61
|
+
**Instruction:** Implement production code with verification.
|
|
62
|
+
|
|
63
|
+
- Write production code to satisfy documented requirements
|
|
64
|
+
- Run all tests (both new and existing) to ensure functionality
|
|
65
|
+
- Verify implementation meets user requirements and get confirmation
|
|
66
|
+
- Refactor code while maintaining test coverage (refactor phase)
|
|
67
|
+
- Remove temporary files and clean up development artifacts
|
|
68
|
+
|
|
69
|
+
### Step 5: Documentation and Status Updates
|
|
70
|
+
|
|
71
|
+
**Instruction:** Update all documentation consistently.
|
|
72
|
+
|
|
73
|
+
- Update all relevant project documentation
|
|
74
|
+
- Mark completed tasks in `/_meta/project-task-list.md`
|
|
75
|
+
- Record test status in `/test/test-documentation.md`
|
|
76
|
+
- Update `CHANGELOG.md` with user-facing changes
|
|
77
|
+
- Review and update code documentation as needed
|
|
78
|
+
|
|
79
|
+
### Step 6: Version Control
|
|
80
|
+
|
|
81
|
+
**Instruction:** Commit changes properly.
|
|
82
|
+
|
|
83
|
+
- Use conventional commit message format (feat:, fix:, docs:, refactor:, test:)
|
|
84
|
+
- Include tests, documentation, and code in atomic commits
|
|
85
|
+
- Write descriptive commit messages explaining what was implemented and why
|
|
86
|
+
- Ensure each commit represents a complete, working feature
|
|
87
|
+
|
|
88
|
+
### Step 7: Workflow Completion Check
|
|
89
|
+
|
|
90
|
+
**Instruction:** Verify completion before moving on.
|
|
91
|
+
|
|
92
|
+
- Confirm all workflow requirements are satisfied
|
|
93
|
+
- Ensure all tests pass and documentation is current
|
|
94
|
+
- Verify code is committed with proper messages
|
|
95
|
+
- Complete entire workflow before allowing new task planning
|
|
96
|
+
|
|
97
|
+
## Workflow Enforcement Rules
|
|
98
|
+
|
|
99
|
+
### Documentation-First Principle
|
|
100
|
+
|
|
101
|
+
**MANDATORY: Document first, execute second for ALL development work.**
|
|
102
|
+
|
|
103
|
+
**Enforcement:**
|
|
104
|
+
|
|
105
|
+
- Never begin coding, testing, or implementation until corresponding documentation is complete
|
|
106
|
+
- Task documentation required in `/_meta/project-task-list.md` before work begins
|
|
107
|
+
- Test documentation required in `/test/test-documentation.md` before writing test code
|
|
108
|
+
- User must explicitly approve plan, scope, and consequences before proceeding
|
|
109
|
+
|
|
110
|
+
**Correct Examples:**
|
|
111
|
+
|
|
112
|
+
- "I'll add this task to the task list, document the test cases, then get your confirmation before implementing"
|
|
113
|
+
- "Let me document these test cases in test-documentation.md first, then implement the tests"
|
|
114
|
+
|
|
115
|
+
**Incorrect Examples:**
|
|
116
|
+
|
|
117
|
+
- "I'll implement this feature and update the documentation afterwards"
|
|
118
|
+
- "I'll write the tests now and document them later"
|
|
119
|
+
|
|
120
|
+
### Single-Task Focus Enforcement
|
|
121
|
+
|
|
122
|
+
**MANDATORY: One change at a time - never mix tasks in one iteration.**
|
|
123
|
+
|
|
124
|
+
**Enforcement:**
|
|
125
|
+
|
|
126
|
+
- Never work on two different tasks simultaneously or mix unrelated changes
|
|
127
|
+
- When additional requests arise during active work:
|
|
128
|
+
- **Blocking requests:** Add as subtask if it blocks current progress
|
|
129
|
+
- **Non-blocking requests:** Add to task list as separate task, complete current workflow first
|
|
130
|
+
- Politely redirect users who try to switch tasks mid-workflow
|
|
131
|
+
|
|
132
|
+
**Template Responses:**
|
|
133
|
+
|
|
134
|
+
- "I've added that request to the task list. Let me complete the current workflow first, then we can address it as a separate task."
|
|
135
|
+
- "That's related to our current work, so I'll add it as a subtask to address now."
|
|
136
|
+
- "I see that's a separate concern. Let me add it to our task list and complete this workflow first."
|
|
137
|
+
|
|
138
|
+
### Quality Gates
|
|
139
|
+
|
|
140
|
+
**Enforcement:**
|
|
141
|
+
|
|
142
|
+
- No shortcuts: Every step must be completed in order
|
|
143
|
+
- No parallel tasks: Focus on one task at a time until fully complete
|
|
144
|
+
- No skipping tests: TDD approach is mandatory
|
|
145
|
+
- No incomplete documentation: All documentation must be current
|
|
146
|
+
- No uncommitted changes: All work must be committed before moving on
|
|
147
|
+
|
|
148
|
+
## Project Configuration
|
|
149
|
+
|
|
150
|
+
### Build and Test Commands
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Build project
|
|
154
|
+
{{BUILD_COMMAND}}
|
|
155
|
+
|
|
156
|
+
# Run tests
|
|
157
|
+
{{TEST_COMMAND}}
|
|
158
|
+
|
|
159
|
+
# Run linter
|
|
160
|
+
{{LINT_COMMAND}}
|
|
161
|
+
|
|
162
|
+
# Type checking
|
|
163
|
+
{{TYPECHECK_COMMAND}}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Code Style Guidelines
|
|
167
|
+
|
|
168
|
+
- {{CODE_STYLE_GUIDELINES}}
|
|
169
|
+
- Follow conventional commit format (feat:, fix:, docs:, refactor:, test:)
|
|
170
|
+
- Use meaningful variable and function names
|
|
171
|
+
- Prefer early returns over deep nesting
|
|
172
|
+
- Keep functions focused and reasonably sized
|
|
173
|
+
- Add comments explaining complex business logic
|
|
174
|
+
|
|
175
|
+
### Testing Guidelines
|
|
176
|
+
|
|
177
|
+
- Follow Test-Driven Development (TDD) approach
|
|
178
|
+
- Cover edge cases and error conditions in tests
|
|
179
|
+
- Use realistic test data and fixtures
|
|
180
|
+
- Mock external dependencies appropriately in unit tests
|
|
181
|
+
- Maintain high test coverage for critical functionality paths
|
|
182
|
+
|
|
183
|
+
### Repository Organization
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
{{REPOSITORY_STRUCTURE}}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Development Standards
|
|
190
|
+
|
|
191
|
+
- **File Organization:** Never place source code in project root directory
|
|
192
|
+
- **Temporary Files:** Clean up all debug files, temporary outputs, experimental code
|
|
193
|
+
- **Error Handling:** Implement comprehensive error handling with proper logging
|
|
194
|
+
- **Resource Management:** Ensure proper cleanup of resources and event listeners
|
|
195
|
+
- **Performance:** Consider performance implications and optimization opportunities
|
|
196
|
+
- **Security:** Follow secure coding practices, validate inputs, sanitize outputs
|
|
197
|
+
|
|
198
|
+
## Agent Validation
|
|
199
|
+
|
|
200
|
+
After configuration setup, validate these instructions by prompting:
|
|
201
|
+
**"What is the development workflow for this project?"**
|
|
202
|
+
|
|
203
|
+
Expected response should reference the 7-step workflow, emphasize documentation-first principle, and demonstrate understanding of single-task focus enforcement.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} - Development Guidelines for Claude Code
|
|
2
|
+
|
|
3
|
+
This file provides project instructions for Claude Code to ensure consistent development practices and workflow adherence.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
{{PROJECT_DESCRIPTION}}
|
|
8
|
+
|
|
9
|
+
**Project Goals:**
|
|
10
|
+
|
|
11
|
+
- Provide robust development workflow and best practices
|
|
12
|
+
- Ensure code quality and maintainability standards
|
|
13
|
+
- Enable efficient team collaboration and knowledge sharing
|
|
14
|
+
|
|
15
|
+
**Tech Stack:** {{TECH_STACK}}
|
|
16
|
+
|
|
17
|
+
## Development Environment
|
|
18
|
+
|
|
19
|
+
**Working in:** {{ENVIRONMENT_TYPE}} environment
|
|
20
|
+
**Project Type:** {{PROJECT_DOMAIN}} development
|
|
21
|
+
|
|
22
|
+
## Core Development Workflow
|
|
23
|
+
|
|
24
|
+
**CRITICAL: Follow this strict 7-step workflow for ALL development tasks.**
|
|
25
|
+
|
|
26
|
+
### Step 1: Task Understanding and Planning
|
|
27
|
+
|
|
28
|
+
- Begin by thoroughly reading project documentation and exploring the codebase
|
|
29
|
+
- Measure your uncertainty level (scale 1.0 to 0.1) before proceeding
|
|
30
|
+
- If uncertainty > 0.1, continue research before asking clarifying questions
|
|
31
|
+
- Present implementation outline and get explicit user confirmation
|
|
32
|
+
- **Documentation-first principle:** No implementation until documentation is complete
|
|
33
|
+
|
|
34
|
+
### Step 2: Task Management
|
|
35
|
+
|
|
36
|
+
- Add all tasks to `/_meta/project-task-list.md` BEFORE implementation
|
|
37
|
+
- Use standardized naming: `[AREA]-TASK-[NUMBER]` format
|
|
38
|
+
- Mark tasks "In Progress" with clear descriptions
|
|
39
|
+
- Break complex tasks into smaller, manageable subtasks
|
|
40
|
+
|
|
41
|
+
### Step 3: Test-Driven Development (TDD)
|
|
42
|
+
|
|
43
|
+
- Document test cases in `/test/test-documentation.md` FIRST
|
|
44
|
+
- Define expected behavior, inputs, outputs, and edge cases
|
|
45
|
+
- Implement tests after documentation is complete
|
|
46
|
+
- Verify test failure (red phase), then implement code (green phase)
|
|
47
|
+
|
|
48
|
+
### Step 4: Implementation and Verification
|
|
49
|
+
|
|
50
|
+
- Write production code to make tests pass
|
|
51
|
+
- Run all tests (new and existing)
|
|
52
|
+
- Get user confirmation that implementation meets requirements
|
|
53
|
+
- Refactor while maintaining test coverage
|
|
54
|
+
|
|
55
|
+
### Step 5: Documentation and Status Updates
|
|
56
|
+
|
|
57
|
+
- Update all relevant documentation
|
|
58
|
+
- Mark completed tasks in `/_meta/project-task-list.md`
|
|
59
|
+
- Update test documentation status
|
|
60
|
+
- Update `CHANGELOG.md` with user-facing changes
|
|
61
|
+
|
|
62
|
+
### Step 6: Version Control
|
|
63
|
+
|
|
64
|
+
- Commit changes with conventional commit messages
|
|
65
|
+
- Include tests, documentation, and code together
|
|
66
|
+
- Write descriptive commit messages explaining what and why
|
|
67
|
+
- Keep commits atomic (one complete feature per commit)
|
|
68
|
+
|
|
69
|
+
### Step 7: Workflow Completion Check
|
|
70
|
+
|
|
71
|
+
- Verify all workflow requirements are satisfied
|
|
72
|
+
- Ensure tests pass, documentation is current, code is committed
|
|
73
|
+
- Complete current workflow before starting new tasks
|
|
74
|
+
|
|
75
|
+
## Workflow Enforcement Rules
|
|
76
|
+
|
|
77
|
+
### Documentation-First Principle
|
|
78
|
+
|
|
79
|
+
**MANDATORY: Document first, execute second for ALL development work.**
|
|
80
|
+
|
|
81
|
+
- Never begin coding until corresponding documentation is complete
|
|
82
|
+
- Task documentation required in `/_meta/project-task-list.md`
|
|
83
|
+
- Test documentation required in `/test/test-documentation.md`
|
|
84
|
+
- User must explicitly approve plan, scope, and consequences
|
|
85
|
+
|
|
86
|
+
### Single-Task Focus
|
|
87
|
+
|
|
88
|
+
**MANDATORY: One change at a time - never mix tasks.**
|
|
89
|
+
|
|
90
|
+
- Never work on multiple unrelated tasks simultaneously
|
|
91
|
+
- When new requests arise:
|
|
92
|
+
- **Blocking requests:** Add as subtask to current work
|
|
93
|
+
- **Non-blocking requests:** Add to task list, complete current workflow first
|
|
94
|
+
- Politely redirect users who try to switch tasks mid-workflow
|
|
95
|
+
|
|
96
|
+
### Quality Gates
|
|
97
|
+
|
|
98
|
+
- Complete every step in order - no shortcuts
|
|
99
|
+
- Focus on one task at a time until fully complete
|
|
100
|
+
- TDD approach is mandatory - no skipping tests
|
|
101
|
+
- All documentation must be current
|
|
102
|
+
- No uncommitted changes - commit before moving on
|
|
103
|
+
|
|
104
|
+
## Project Commands
|
|
105
|
+
|
|
106
|
+
# Common Commands
|
|
107
|
+
|
|
108
|
+
- `npm run build`: {{BUILD_COMMAND}}
|
|
109
|
+
- `npm test`: {{TEST_COMMAND}}
|
|
110
|
+
- `npm run lint`: {{LINT_COMMAND}}
|
|
111
|
+
- `npm run typecheck`: {{TYPECHECK_COMMAND}}
|
|
112
|
+
|
|
113
|
+
# Development Workflow
|
|
114
|
+
|
|
115
|
+
- Always run tests after making changes
|
|
116
|
+
- Use conventional commit messages (feat:, fix:, docs:, etc.)
|
|
117
|
+
- Prefer running single tests during development for performance
|
|
118
|
+
- Run full test suite before committing
|
|
119
|
+
|
|
120
|
+
## Code Style Guidelines
|
|
121
|
+
|
|
122
|
+
- {{CODE_STYLE_GUIDELINES}}
|
|
123
|
+
- Follow language-specific conventions defined in instruction files
|
|
124
|
+
- Use meaningful variable and function names
|
|
125
|
+
- Keep functions focused and reasonably sized
|
|
126
|
+
- Prefer early returns over deep nesting
|
|
127
|
+
- Add comments for complex business logic
|
|
128
|
+
|
|
129
|
+
## Testing Instructions
|
|
130
|
+
|
|
131
|
+
- Write tests before implementing features (TDD)
|
|
132
|
+
- Cover edge cases and error conditions
|
|
133
|
+
- Use realistic test data and fixtures
|
|
134
|
+
- Mock external dependencies appropriately
|
|
135
|
+
- Maintain high test coverage for critical functionality
|
|
136
|
+
|
|
137
|
+
## Repository Structure
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
{{REPOSITORY_STRUCTURE}}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Important Notes
|
|
144
|
+
|
|
145
|
+
- **Temporary files:** Always clean up debug files, temporary outputs, and experimental code
|
|
146
|
+
- **File organization:** Keep source code in appropriate directories, never in project root
|
|
147
|
+
- **Error handling:** Implement comprehensive error handling with proper logging
|
|
148
|
+
- **Performance:** Consider performance implications in all implementations
|
|
149
|
+
- **Security:** Follow secure coding practices, validate inputs, sanitize outputs
|
|
150
|
+
|
|
151
|
+
## Validation Reminder
|
|
152
|
+
|
|
153
|
+
After setup, test these instructions by asking:
|
|
154
|
+
**"What is the development workflow for this project?"**
|
|
155
|
+
|
|
156
|
+
The assistant should reference the 7-step workflow and demonstrate understanding of the documentation-first principle and single-task focus enforcement.
|