@mainahq/core 0.7.0 → 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.
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainahq/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Maina core engines — Context, Prompt, and Verify for verification-first development",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://mainahq.com/",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/mainahq/maina.git",
|
|
11
11
|
"directory": "packages/core"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
package/src/init/index.ts
CHANGED
|
@@ -177,7 +177,7 @@ function buildAgentsMd(stack: DetectedStack): string {
|
|
|
177
177
|
|
|
178
178
|
return `# AGENTS.md
|
|
179
179
|
|
|
180
|
-
This repo uses [Maina](https://github.com/
|
|
180
|
+
This repo uses [Maina](https://github.com/mainahq/maina) for verification-first development.
|
|
181
181
|
|
|
182
182
|
## Quick Start
|
|
183
183
|
\`\`\`bash
|
|
@@ -204,6 +204,7 @@ maina commit # verify + commit
|
|
|
204
204
|
|------|---------|-----------|
|
|
205
205
|
| \`.maina/constitution.md\` | Project DNA — stack, rules, gates | Team (stable, rarely changes) |
|
|
206
206
|
| \`AGENTS.md\` | Agent instructions — commands, conventions | Team |
|
|
207
|
+
| \`.github/copilot-instructions.md\` | Copilot agent instructions + MCP tools | Team |
|
|
207
208
|
| \`CLAUDE.md\` | Claude Code specific instructions | Optional, Claude Code users |
|
|
208
209
|
| \`.maina/prompts/*.md\` | Prompt overrides for review/commit/etc | Maina (via \`maina learn\`) |
|
|
209
210
|
|
|
@@ -213,6 +214,45 @@ maina commit # verify + commit
|
|
|
213
214
|
`;
|
|
214
215
|
}
|
|
215
216
|
|
|
217
|
+
function buildCopilotInstructions(stack: DetectedStack): string {
|
|
218
|
+
const runCmd = stack.runtime === "bun" ? "bun" : "npm";
|
|
219
|
+
return `# Copilot Instructions
|
|
220
|
+
|
|
221
|
+
You are working on a codebase verified by [Maina](https://mainahq.com), the verification-first developer OS. Maina MCP tools are available — use them.
|
|
222
|
+
|
|
223
|
+
## Workflow
|
|
224
|
+
|
|
225
|
+
1. **Get context** — call \`maina getContext\` to understand codebase state
|
|
226
|
+
2. **Write tests first** — TDD always. Write failing tests, then implement
|
|
227
|
+
3. **Verify your work** — call \`maina verify\` before requesting review
|
|
228
|
+
4. **Check for slop** — call \`maina checkSlop\` on changed files
|
|
229
|
+
5. **Review your code** — call \`maina reviewCode\` with your diff
|
|
230
|
+
|
|
231
|
+
## Available MCP Tools
|
|
232
|
+
|
|
233
|
+
| Tool | When to use |
|
|
234
|
+
|------|-------------|
|
|
235
|
+
| \`getContext\` | Before starting — understand branch state and verification status |
|
|
236
|
+
| \`verify\` | After changes — run the full verification pipeline |
|
|
237
|
+
| \`checkSlop\` | On changed files — detect AI-generated slop patterns |
|
|
238
|
+
| \`reviewCode\` | On your diff — two-stage review (spec compliance + code quality) |
|
|
239
|
+
| \`suggestTests\` | When implementing — generate TDD test stubs |
|
|
240
|
+
| \`getConventions\` | Understand project coding conventions |
|
|
241
|
+
|
|
242
|
+
## Conventions
|
|
243
|
+
|
|
244
|
+
- Runtime: ${stack.runtime}
|
|
245
|
+
- Test: \`${runCmd} test\`
|
|
246
|
+
- Commits: conventional commits (feat, fix, refactor, test, docs, chore)
|
|
247
|
+
- No \`console.log\` in production code
|
|
248
|
+
- Diff-only: only fix issues on changed lines
|
|
249
|
+
|
|
250
|
+
## When Working on Audit Issues
|
|
251
|
+
|
|
252
|
+
Issues labeled \`audit\` come from maina's daily verification. Fix the specific findings listed — don't refactor unrelated code.
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
|
|
216
256
|
const REVIEW_PROMPT_TEMPLATE = `# Review Prompt
|
|
217
257
|
|
|
218
258
|
Review the following code changes for:
|
|
@@ -288,6 +328,10 @@ function getFileManifest(stack: DetectedStack): FileEntry[] {
|
|
|
288
328
|
relativePath: ".github/workflows/maina-ci.yml",
|
|
289
329
|
content: buildCiWorkflow(stack),
|
|
290
330
|
},
|
|
331
|
+
{
|
|
332
|
+
relativePath: ".github/copilot-instructions.md",
|
|
333
|
+
content: buildCopilotInstructions(stack),
|
|
334
|
+
},
|
|
291
335
|
];
|
|
292
336
|
}
|
|
293
337
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"packages": []}
|