maurao-method 0.0.0-stage → 0.1.2
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/.clinerules/maurao-method.md +6 -0
- package/.cursor/rules/maurao-method.mdc +7 -0
- package/.github/copilot-instructions.md +6 -0
- package/.github/workflows/ci.yml +39 -0
- package/.github/workflows/publish.yml +32 -0
- package/.github/workflows/release-on-main.yml +87 -0
- package/.maurao/README.md +13 -0
- package/.maurao/config.json +17 -0
- package/AGENTS.md +30 -0
- package/CLAUDE.md +6 -0
- package/GEMINI.md +6 -0
- package/README.md +110 -2
- package/bin/maurao.mjs +218 -0
- package/commands/debug.md +4 -0
- package/commands/discover.md +4 -0
- package/commands/map.md +4 -0
- package/commands/plan.md +4 -0
- package/commands/pr.md +4 -0
- package/commands/review.md +4 -0
- package/commands/specify.md +4 -0
- package/commands/spike.md +4 -0
- package/commands/verify.md +4 -0
- package/docs/artifact-contract.md +22 -0
- package/docs/commands.md +32 -0
- package/docs/method-overview.md +32 -0
- package/docs/npm-release.md +68 -0
- package/docs/portable-adapters.md +26 -0
- package/docs/project-modes.md +33 -0
- package/docs/specification-standard.md +25 -0
- package/docs/tool-support.md +24 -0
- package/docs/workflow.md +45 -0
- package/package.json +42 -4
- package/skills/core/architecture/SKILL.md +16 -0
- package/skills/core/brownfield-analysis/SKILL.md +20 -0
- package/skills/core/debugging/SKILL.md +32 -0
- package/skills/core/planning/SKILL.md +18 -0
- package/skills/core/product-discovery/SKILL.md +20 -0
- package/skills/core/project-discovery/SKILL.md +32 -0
- package/skills/core/requirements/SKILL.md +13 -0
- package/skills/core/specification/SKILL.md +41 -0
- package/skills/core/spike/SKILL.md +30 -0
- package/skills/core/technology-discovery/SKILL.md +43 -0
- package/skills/practices/code-review/SKILL.md +21 -0
- package/skills/practices/data-migration/SKILL.md +14 -0
- package/skills/practices/observability/SKILL.md +28 -0
- package/skills/practices/observability/checklist.md +11 -0
- package/skills/practices/observability/references/dotnet.md +7 -0
- package/skills/practices/observability/references/java.md +9 -0
- package/skills/practices/observability/references/node.md +7 -0
- package/skills/practices/observability/references/python.md +7 -0
- package/skills/practices/observability/templates/logging-plan.md +16 -0
- package/skills/practices/observability/templates/metrics-plan.md +6 -0
- package/skills/practices/observability/templates/tracing-plan.md +14 -0
- package/skills/practices/pull-request/SKILL.md +17 -0
- package/skills/practices/release-readiness/SKILL.md +20 -0
- package/skills/practices/security/SKILL.md +11 -0
- package/skills/practices/testing/SKILL.md +37 -0
- package/skills/practices/verification/SKILL.md +15 -0
- package/skills/workflows/brownfield-change/SKILL.md +26 -0
- package/skills/workflows/bug-fix/SKILL.md +19 -0
- package/skills/workflows/feature-development/SKILL.md +35 -0
- package/skills/workflows/greenfield-product/SKILL.md +28 -0
- package/technology-packs/dotnet/README.md +6 -0
- package/technology-packs/java/README.md +34 -0
- package/technology-packs/node/README.md +6 -0
- package/technology-packs/python/README.md +6 -0
- package/templates/brownfield-map.md +38 -0
- package/templates/bug-fix.md +36 -0
- package/templates/change-proposal.md +40 -0
- package/templates/decision-record.md +33 -0
- package/templates/feature-spec.md +50 -0
- package/templates/implementation-plan.md +33 -0
- package/templates/product-brief.md +41 -0
- package/templates/pull-request.md +27 -0
- package/templates/spike-report.md +36 -0
- package/templates/system-context.md +36 -0
- package/templates/technology-inventory.md +38 -0
- package/templates/test-plan.md +23 -0
- package/templates/threat-model.md +31 -0
- package/templates/verification-report.md +26 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Apply the Maurao Method to software engineering work.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Read `AGENTS.md` before working. Use the smallest applicable skill from `skills/` and the relevant technology pack from `technology-packs/`. Keep requirements, implementation, and verification evidence explicit.
|
|
6
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Apply the Maurao Method to software engineering work in this repository.
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Read `AGENTS.md` before working. Use the smallest applicable skill from `skills/`, and use the relevant technology pack from `technology-packs/`. Keep requirements, implementation, and verification evidence explicit. Do not claim validation that was not executed.
|
|
7
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validate:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v6
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v6
|
|
20
|
+
with:
|
|
21
|
+
node-version: 24
|
|
22
|
+
cache: npm
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: npm ci
|
|
26
|
+
|
|
27
|
+
- name: Validate package
|
|
28
|
+
run: npm run validate
|
|
29
|
+
|
|
30
|
+
- name: Run CLI tests
|
|
31
|
+
run: npm test
|
|
32
|
+
|
|
33
|
+
- name: Test CLI help and package listing
|
|
34
|
+
run: |
|
|
35
|
+
node bin/maurao.mjs help
|
|
36
|
+
node bin/maurao.mjs list
|
|
37
|
+
|
|
38
|
+
- name: Check package contents
|
|
39
|
+
run: npm pack --dry-run
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Manual npm publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
id-token: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
environment: npm
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v6
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v6
|
|
20
|
+
with:
|
|
21
|
+
node-version: 24
|
|
22
|
+
registry-url: https://registry.npmjs.org
|
|
23
|
+
package-manager-cache: false
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Validate package
|
|
29
|
+
run: npm run validate
|
|
30
|
+
|
|
31
|
+
- name: Publish with npm trusted publishing
|
|
32
|
+
run: npm publish
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Release on main
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- 'AGENTS.md'
|
|
8
|
+
- 'CLAUDE.md'
|
|
9
|
+
- 'GEMINI.md'
|
|
10
|
+
- 'README.md'
|
|
11
|
+
- '.clinerules/**'
|
|
12
|
+
- '.cursor/**'
|
|
13
|
+
- '.github/copilot-instructions.md'
|
|
14
|
+
- '.maurao/**'
|
|
15
|
+
- 'bin/**'
|
|
16
|
+
- 'commands/**'
|
|
17
|
+
- 'docs/**'
|
|
18
|
+
- 'skills/**'
|
|
19
|
+
- 'technology-packs/**'
|
|
20
|
+
- 'templates/**'
|
|
21
|
+
- 'package.json'
|
|
22
|
+
- 'package-lock.json'
|
|
23
|
+
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write
|
|
26
|
+
|
|
27
|
+
concurrency:
|
|
28
|
+
group: release-on-main
|
|
29
|
+
cancel-in-progress: false
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
release:
|
|
33
|
+
if: github.actor != 'github-actions[bot]'
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
environment: npm
|
|
36
|
+
steps:
|
|
37
|
+
- name: Checkout
|
|
38
|
+
uses: actions/checkout@v6
|
|
39
|
+
with:
|
|
40
|
+
fetch-depth: 0
|
|
41
|
+
|
|
42
|
+
- name: Setup Node.js
|
|
43
|
+
uses: actions/setup-node@v6
|
|
44
|
+
with:
|
|
45
|
+
node-version: 24
|
|
46
|
+
registry-url: https://registry.npmjs.org
|
|
47
|
+
package-manager-cache: false
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: npm ci
|
|
51
|
+
|
|
52
|
+
- name: Validate package
|
|
53
|
+
run: npm run validate
|
|
54
|
+
|
|
55
|
+
- name: Run tests
|
|
56
|
+
run: npm test
|
|
57
|
+
|
|
58
|
+
- name: Increment patch version
|
|
59
|
+
id: version
|
|
60
|
+
shell: bash
|
|
61
|
+
run: |
|
|
62
|
+
npm version patch --no-git-tag-version
|
|
63
|
+
VERSION="$(node -p "require('./package.json').version")"
|
|
64
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
65
|
+
|
|
66
|
+
- name: Publish package
|
|
67
|
+
env:
|
|
68
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
69
|
+
run: npm publish
|
|
70
|
+
|
|
71
|
+
- name: Create release commit and tag
|
|
72
|
+
env:
|
|
73
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
74
|
+
run: |
|
|
75
|
+
git config user.name "github-actions[bot]"
|
|
76
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
77
|
+
git add package.json package-lock.json
|
|
78
|
+
git commit -m "chore(release): v${VERSION}"
|
|
79
|
+
git tag --annotate "v${VERSION}" --message "Release v${VERSION}"
|
|
80
|
+
git push origin HEAD:main
|
|
81
|
+
git push origin "v${VERSION}"
|
|
82
|
+
|
|
83
|
+
- name: Create GitHub Release
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ github.token }}
|
|
86
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
87
|
+
run: gh release create "v${VERSION}" --verify-tag "v${VERSION}" --title "v${VERSION}" --generate-notes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Maurao project artifacts
|
|
2
|
+
|
|
3
|
+
This directory stores the durable artifacts produced by the Maurao Method for the host project.
|
|
4
|
+
|
|
5
|
+
- `product-brief.md`: product problem, users, outcome, and smallest useful slice.
|
|
6
|
+
- `system-context.md`: current system, boundaries, dependencies, and invariants.
|
|
7
|
+
- `technology-inventory.md`: detected technology and confirmed commands.
|
|
8
|
+
- `specifications/`: approved change specifications.
|
|
9
|
+
- `decisions/`: architecture and product decisions.
|
|
10
|
+
- `plans/`: implementation plans.
|
|
11
|
+
- `reports/`: verification, spike, review, and release reports.
|
|
12
|
+
|
|
13
|
+
Artifacts are evidence and decision records. They should evolve with the product and must not claim checks that were not executed.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"method": "maurao-method",
|
|
3
|
+
"version": "0.1",
|
|
4
|
+
"projectMode": "auto",
|
|
5
|
+
"rigor": "adaptive",
|
|
6
|
+
"technologyDiscovery": "required",
|
|
7
|
+
"artifacts": {
|
|
8
|
+
"root": ".maurao",
|
|
9
|
+
"productBrief": ".maurao/product-brief.md",
|
|
10
|
+
"systemContext": ".maurao/system-context.md",
|
|
11
|
+
"technologyInventory": ".maurao/technology-inventory.md",
|
|
12
|
+
"specifications": ".maurao/specifications",
|
|
13
|
+
"decisions": ".maurao/decisions",
|
|
14
|
+
"plans": ".maurao/plans",
|
|
15
|
+
"reports": ".maurao/reports"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Maurao Method
|
|
2
|
+
|
|
3
|
+
This repository defines a portable, specification-driven engineering method for AI coding agents.
|
|
4
|
+
|
|
5
|
+
## Repository contract
|
|
6
|
+
|
|
7
|
+
- Read the relevant skill before executing a workflow.
|
|
8
|
+
- Start with `technology-discovery` when the project stack, runtime, or validation commands are unknown.
|
|
9
|
+
- Classify work as greenfield, brownfield, or hybrid before choosing a workflow.
|
|
10
|
+
- Select rigor L0–L3 from `docs/workflow.md` based on ambiguity, blast radius, and risk.
|
|
11
|
+
- Keep the core technology-agnostic; put stack-specific behavior in `technology-packs/`.
|
|
12
|
+
- Treat `templates/` as normative starting points, not mandatory ceremony for trivial changes.
|
|
13
|
+
- Use `.maurao/` as the durable artifact root when working in a host project; follow `docs/artifact-contract.md`.
|
|
14
|
+
- Every implementation must have an explicit verification outcome.
|
|
15
|
+
- Never claim a command, test, review, or deployment was performed unless it was actually performed.
|
|
16
|
+
- Preserve user changes and do not create commits unless explicitly requested.
|
|
17
|
+
|
|
18
|
+
## Skill discovery
|
|
19
|
+
|
|
20
|
+
The canonical skills live under `skills/`. Use the smallest composition that covers the task:
|
|
21
|
+
|
|
22
|
+
- `skills/core/` — reasoning and lifecycle skills.
|
|
23
|
+
- `skills/practices/` — testing, observability, review, and delivery practices.
|
|
24
|
+
- `skills/workflows/` — end-to-end work modes.
|
|
25
|
+
- `technology-packs/` — Node.js, .NET, and Python guidance.
|
|
26
|
+
- `commands/` — tool-independent command entry points.
|
|
27
|
+
- `.maurao/` — host-project configuration and durable engineering artifacts.
|
|
28
|
+
|
|
29
|
+
Tool-specific entry points may point here, but must not duplicate the method.
|
|
30
|
+
|
package/CLAUDE.md
ADDED
package/GEMINI.md
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Maurao Method
|
|
2
|
+
|
|
3
|
+
[](https://github.com/luismpenholato/maurao-method/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/luismpenholato/maurao-method/actions/workflows/release-on-main.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/maurao-method)
|
|
6
|
+
[](https://www.npmjs.com/package/maurao-method)
|
|
7
|
+
[](https://opensource.org/license/mit/)
|
|
8
|
+
|
|
9
|
+
## Modular engineering for AI-assisted software development
|
|
10
|
+
|
|
11
|
+
Install the latest published package from [npm](https://www.npmjs.com/package/maurao-method):
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
npm install --global maurao-method
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then install the method into a project:
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
maurao init . --tool all
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Maurao Method is a technology-agnostic engineering method for building reliable software with AI agents.
|
|
24
|
+
|
|
25
|
+
It combines specification-driven development with disciplined implementation, testing, observability, debugging, review, and verifiable delivery evidence.
|
|
26
|
+
|
|
27
|
+
## Principles
|
|
28
|
+
|
|
29
|
+
- Understand the problem before changing the code.
|
|
30
|
+
- Treat specifications and acceptance criteria as shared contracts.
|
|
31
|
+
- Prefer the smallest safe change that satisfies the contract.
|
|
32
|
+
- Make tests, observability, and review part of implementation—not afterthoughts.
|
|
33
|
+
- Report evidence separately from assumptions.
|
|
34
|
+
- Keep the core generic and move technology-specific knowledge into focused skills.
|
|
35
|
+
|
|
36
|
+
## Repository structure
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
skills/
|
|
40
|
+
├── core/ # Technology-agnostic engineering capabilities
|
|
41
|
+
├── practices/ # Reusable engineering practices
|
|
42
|
+
├── technology-packs/ # Node.js, .NET, Python, and other stacks
|
|
43
|
+
└── workflows/ # Composable end-to-end work modes
|
|
44
|
+
commands/ # Tool-independent command entry points
|
|
45
|
+
templates/ # Specifications, plans, tests, reviews, and reports
|
|
46
|
+
docs/ # Method documentation and design decisions
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Initial skills
|
|
50
|
+
|
|
51
|
+
- `core/specification`: define intent, behavior, constraints, and acceptance criteria.
|
|
52
|
+
- `core/debugging`: reproduce failures, test hypotheses, identify root cause, and prevent regression.
|
|
53
|
+
- `core/spike`: answer technical questions through bounded experiments and recorded evidence.
|
|
54
|
+
- `core/architecture`: make proportionate architecture decisions.
|
|
55
|
+
- `core/project-discovery`: establish a baseline for greenfield, brownfield, and hybrid projects.
|
|
56
|
+
- `core/technology-discovery`: detect the real stack and select applicable technology packs.
|
|
57
|
+
- `core/product-discovery`: frame new product problems and the smallest useful slice.
|
|
58
|
+
- `core/requirements`: structure functional and non-functional requirements.
|
|
59
|
+
- `core/planning`: create ordered, verifiable implementation tasks.
|
|
60
|
+
- `practices/testing`: design tests from behavior and preserve regression coverage.
|
|
61
|
+
- `practices/observability`: define useful logs, metrics, traces, and operational signals.
|
|
62
|
+
- `practices/code-review`: review correctness, risk, security, and maintainability.
|
|
63
|
+
- `practices/pull-request`: prepare focused, evidence-based pull requests.
|
|
64
|
+
- `practices/verification`: map acceptance criteria to executed evidence.
|
|
65
|
+
- `practices/security`: analyze security, privacy, abuse, and supply-chain risks.
|
|
66
|
+
- `practices/data-migration`: plan safe schema and data changes.
|
|
67
|
+
- `practices/release-readiness`: decide whether a change can be delivered safely.
|
|
68
|
+
- `workflows/feature-development`: compose the core loop for a production change.
|
|
69
|
+
- `workflows/bug-fix`: diagnose and fix defects with regression protection.
|
|
70
|
+
- `workflows/greenfield-product`: create a new product through a validated vertical slice.
|
|
71
|
+
- `workflows/brownfield-change`: safely change an existing product.
|
|
72
|
+
|
|
73
|
+
## Portability
|
|
74
|
+
|
|
75
|
+
The method uses a canonical `AGENTS.md`, portable `SKILL.md` files, tool-independent commands, and thin adapters for Codex, Claude Code, Cursor, GitHub Copilot, Gemini CLI, and Cline. Run `scripts/install.ps1` from PowerShell to install the method into another project without overwriting existing files unless `-Force` is supplied.
|
|
76
|
+
|
|
77
|
+
The canonical structure is independent of a model provider, editor, CLI, or programming language. Technology packs provide focused guidance for Node.js, .NET, Python, and Java.
|
|
78
|
+
|
|
79
|
+
Validate the repository and installer with:
|
|
80
|
+
|
|
81
|
+
```powershell
|
|
82
|
+
.\scripts\validate.ps1 -TestInstaller
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
See [tool support](docs/tool-support.md) for the distinction between GPT as a model and Codex as the coding-agent environment.
|
|
86
|
+
|
|
87
|
+
## npm CLI
|
|
88
|
+
|
|
89
|
+
When published, the recommended installation will be:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
npm install -g maurao-method
|
|
93
|
+
maurao init . --tool all
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Available commands:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
maurao init [directory] Install the method in a project
|
|
100
|
+
maurao validate Validate the packaged skills and required files
|
|
101
|
+
maurao list List commands and skills
|
|
102
|
+
maurao doctor [directory] Check whether a project is installed correctly
|
|
103
|
+
maurao inspect [directory] Detect technology evidence and write the inventory
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The npm CI/CD setup is documented in [docs/npm-release.md](docs/npm-release.md). Pull requests run validation automatically, and package changes merged into `main` create a patch release, npm publication, version tag, and GitHub Release.
|
|
107
|
+
|
|
108
|
+
## Status
|
|
109
|
+
|
|
110
|
+
Early development. The method and skill contracts are expected to evolve before the first stable release.
|
|
2
111
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/bin/maurao.mjs
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, cpSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const packageRoot = resolve(fileURLToPath(new URL('..', import.meta.url)));
|
|
8
|
+
const commonEntries = [
|
|
9
|
+
'AGENTS.md',
|
|
10
|
+
'.maurao',
|
|
11
|
+
'commands',
|
|
12
|
+
'docs',
|
|
13
|
+
'skills',
|
|
14
|
+
'technology-packs',
|
|
15
|
+
'templates'
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const adapters = {
|
|
19
|
+
codex: ['AGENTS.md'],
|
|
20
|
+
claude: ['CLAUDE.md', '.claude-skills'],
|
|
21
|
+
cursor: ['.cursor'],
|
|
22
|
+
copilot: ['.github/copilot-instructions.md', '.agents-skills'],
|
|
23
|
+
gemini: ['GEMINI.md'],
|
|
24
|
+
cline: ['.clinerules']
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function usage() {
|
|
28
|
+
console.log(`Maurao Method CLI
|
|
29
|
+
|
|
30
|
+
Usage:
|
|
31
|
+
maurao init [directory] [--tool all|codex|claude|cursor|copilot|gemini|cline] [--force]
|
|
32
|
+
maurao validate
|
|
33
|
+
maurao list
|
|
34
|
+
maurao doctor [directory]
|
|
35
|
+
maurao inspect [directory]
|
|
36
|
+
maurao help
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
maurao init .
|
|
40
|
+
maurao init C:\\projects\\my-app --tool codex
|
|
41
|
+
maurao init . --tool all --force
|
|
42
|
+
`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function parseOptions(args) {
|
|
46
|
+
const options = { force: false, tool: 'all', positional: [] };
|
|
47
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
48
|
+
const value = args[index];
|
|
49
|
+
if (value === '--force') options.force = true;
|
|
50
|
+
else if (value === '--tool') options.tool = args[++index] ?? '';
|
|
51
|
+
else if (value === '--help' || value === '-h') options.help = true;
|
|
52
|
+
else options.positional.push(value);
|
|
53
|
+
}
|
|
54
|
+
return options;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function copyEntry(sourceRelative, targetRoot, force) {
|
|
58
|
+
const source = join(packageRoot, sourceRelative);
|
|
59
|
+
const destination = join(targetRoot, sourceRelative);
|
|
60
|
+
if (!existsSync(source)) throw new Error(`Package entry not found: ${sourceRelative}`);
|
|
61
|
+
if (existsSync(destination) && !force) {
|
|
62
|
+
console.log(`Skipped existing path: ${destination}`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
mkdirSync(dirname(destination), { recursive: true });
|
|
66
|
+
cpSync(source, destination, { recursive: true, force });
|
|
67
|
+
console.log(`Installed: ${destination}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function copyAdapter(adapter, targetRoot, force) {
|
|
71
|
+
for (const entry of adapters[adapter]) {
|
|
72
|
+
if (entry === '.claude-skills') {
|
|
73
|
+
copyEntry('skills', targetRoot + '/.claude', force);
|
|
74
|
+
} else if (entry === '.agents-skills') {
|
|
75
|
+
copyEntry('skills', targetRoot + '/.agents', force);
|
|
76
|
+
} else {
|
|
77
|
+
copyEntry(entry, targetRoot, force);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function init(args) {
|
|
83
|
+
const options = parseOptions(args);
|
|
84
|
+
if (options.help) return usage();
|
|
85
|
+
const allowedTools = ['all', ...Object.keys(adapters)];
|
|
86
|
+
if (!allowedTools.includes(options.tool)) throw new Error(`Invalid tool. Use: ${allowedTools.join(', ')}`);
|
|
87
|
+
const targetRoot = resolve(options.positional[0] ?? '.');
|
|
88
|
+
mkdirSync(targetRoot, { recursive: true });
|
|
89
|
+
for (const entry of commonEntries) copyEntry(entry, targetRoot, options.force);
|
|
90
|
+
const selected = options.tool === 'all' ? Object.keys(adapters) : [options.tool];
|
|
91
|
+
for (const adapter of selected) copyAdapter(adapter, targetRoot, options.force);
|
|
92
|
+
console.log(`Maurao Method installed in ${targetRoot}`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function list() {
|
|
96
|
+
const skills = [];
|
|
97
|
+
for (const category of readdirSync(join(packageRoot, 'skills'))) {
|
|
98
|
+
const categoryPath = join(packageRoot, 'skills', category);
|
|
99
|
+
if (!existsSync(categoryPath)) continue;
|
|
100
|
+
for (const skill of readdirSync(categoryPath)) {
|
|
101
|
+
if (existsSync(join(categoryPath, skill, 'SKILL.md'))) skills.push(`${category}/${skill}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
console.log('Commands:');
|
|
105
|
+
for (const command of readdirSync(join(packageRoot, 'commands')).filter((entry) => entry.endsWith('.md'))) {
|
|
106
|
+
console.log(` maurao ${command.replace(/\.md$/, '')}`);
|
|
107
|
+
}
|
|
108
|
+
console.log('\nSkills:');
|
|
109
|
+
for (const skill of skills.sort()) console.log(` ${skill}`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function validate() {
|
|
113
|
+
const skillsRoot = join(packageRoot, 'skills');
|
|
114
|
+
const skills = [];
|
|
115
|
+
for (const category of readdirSync(skillsRoot)) {
|
|
116
|
+
const categoryPath = join(skillsRoot, category);
|
|
117
|
+
for (const skill of readdirSync(categoryPath)) {
|
|
118
|
+
const file = join(categoryPath, skill, 'SKILL.md');
|
|
119
|
+
if (!existsSync(file)) continue;
|
|
120
|
+
const content = readFileSync(file, 'utf8');
|
|
121
|
+
if (!/^---\s*\nname: .+\ndescription: .+\n---/s.test(content)) {
|
|
122
|
+
throw new Error(`Invalid skill frontmatter: ${file}`);
|
|
123
|
+
}
|
|
124
|
+
skills.push(skill);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (new Set(skills).size !== skills.length) throw new Error('Duplicate skill directory name detected');
|
|
128
|
+
for (const required of ['AGENTS.md', 'templates/feature-spec.md', 'technology-packs/java/README.md']) {
|
|
129
|
+
if (!existsSync(join(packageRoot, required))) throw new Error(`Missing required entry: ${required}`);
|
|
130
|
+
}
|
|
131
|
+
console.log(`Validation passed: ${skills.length} skills.`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function doctor(args) {
|
|
135
|
+
const targetRoot = resolve(args[0] ?? '.');
|
|
136
|
+
const checks = ['AGENTS.md', '.maurao/config.json', 'skills', 'technology-packs', 'templates', 'commands'];
|
|
137
|
+
const missing = checks.filter((entry) => !existsSync(join(targetRoot, entry)));
|
|
138
|
+
if (missing.length > 0) {
|
|
139
|
+
console.error(`Maurao Method is not installed correctly in ${targetRoot}`);
|
|
140
|
+
for (const entry of missing) console.error(`Missing: ${entry}`);
|
|
141
|
+
process.exitCode = 1;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
console.log(`Maurao Method is installed in ${targetRoot}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const ignoredDirectories = new Set(['.git', '.maurao', 'node_modules', 'target', 'build', 'dist', '.venv', 'venv', '__pycache__']);
|
|
148
|
+
const evidence = [
|
|
149
|
+
['package.json', 'Node.js', 'package manifest'],
|
|
150
|
+
['tsconfig.json', 'TypeScript', 'TypeScript configuration'],
|
|
151
|
+
['pom.xml', 'Java / Maven', 'Maven build descriptor'],
|
|
152
|
+
['build.gradle', 'Java or Kotlin / Gradle', 'Gradle build descriptor'],
|
|
153
|
+
['build.gradle.kts', 'Kotlin or Java / Gradle', 'Kotlin Gradle build descriptor'],
|
|
154
|
+
['gradlew', 'Java or Kotlin / Gradle', 'Gradle wrapper'],
|
|
155
|
+
['pyproject.toml', 'Python', 'Python project manifest'],
|
|
156
|
+
['requirements.txt', 'Python', 'Python dependency file'],
|
|
157
|
+
['go.mod', 'Go', 'Go module manifest'],
|
|
158
|
+
['Cargo.toml', 'Rust', 'Cargo manifest'],
|
|
159
|
+
['composer.json', 'PHP', 'Composer manifest'],
|
|
160
|
+
['Gemfile', 'Ruby', 'Ruby dependency manifest'],
|
|
161
|
+
['Package.swift', 'Swift', 'Swift package manifest']
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
function walkFiles(root, depth = 0, result = []) {
|
|
165
|
+
if (depth > 3) return result;
|
|
166
|
+
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
167
|
+
if (entry.isDirectory() && !ignoredDirectories.has(entry.name)) {
|
|
168
|
+
walkFiles(join(root, entry.name), depth + 1, result);
|
|
169
|
+
} else if (entry.isFile()) {
|
|
170
|
+
result.push(join(root, entry.name));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function inspect(args) {
|
|
177
|
+
const targetRoot = resolve(args[0] ?? '.');
|
|
178
|
+
if (!existsSync(targetRoot) || !statSync(targetRoot).isDirectory()) throw new Error(`Directory not found: ${targetRoot}`);
|
|
179
|
+
const files = walkFiles(targetRoot);
|
|
180
|
+
const findings = [];
|
|
181
|
+
for (const [fileName, technology, reason] of evidence) {
|
|
182
|
+
const matches = files.filter((file) => file.endsWith(`\\${fileName}`) || file.endsWith(`/${fileName}`));
|
|
183
|
+
if (matches.length > 0) findings.push({ technology, reason, files: matches.map((file) => file.slice(targetRoot.length + 1)) });
|
|
184
|
+
}
|
|
185
|
+
const lines = [
|
|
186
|
+
'# Technology Inventory',
|
|
187
|
+
'',
|
|
188
|
+
`- Project: ${targetRoot}`,
|
|
189
|
+
'- Mode: To be classified as greenfield, brownfield, or hybrid',
|
|
190
|
+
'',
|
|
191
|
+
'## Detected technologies',
|
|
192
|
+
'',
|
|
193
|
+
'| Technology | Evidence | Confidence |',
|
|
194
|
+
'|---|---|---|'
|
|
195
|
+
];
|
|
196
|
+
if (findings.length === 0) lines.push('| No known technology detected | Inspect repository manually | Low |');
|
|
197
|
+
for (const finding of findings) lines.push(`| ${finding.technology} | ${finding.reason}: ${finding.files.join(', ')} | Medium |`);
|
|
198
|
+
lines.push('', '## Commands to confirm', '', '| Purpose | Command | Confirmed? |', '|---|---|---|', '| Install | | No |', '| Run | | No |', '| Test | | No |', '| Lint | | No |', '| Build | | No |', '', '## Unknowns', '', '- Confirm versions, active modules, and project-specific commands before implementation.');
|
|
199
|
+
const artifactRoot = join(targetRoot, '.maurao');
|
|
200
|
+
mkdirSync(artifactRoot, { recursive: true });
|
|
201
|
+
const output = join(artifactRoot, 'technology-inventory.md');
|
|
202
|
+
writeFileSync(output, `${lines.join('\n')}\n`, 'utf8');
|
|
203
|
+
console.log(`Technology inventory written to ${output}`);
|
|
204
|
+
for (const finding of findings) console.log(`Detected: ${finding.technology}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const [command = 'help', ...args] = process.argv.slice(2);
|
|
208
|
+
try {
|
|
209
|
+
if (command === 'init') init(args);
|
|
210
|
+
else if (command === 'validate') validate();
|
|
211
|
+
else if (command === 'list') list();
|
|
212
|
+
else if (command === 'doctor') doctor(args);
|
|
213
|
+
else if (command === 'inspect') inspect(args);
|
|
214
|
+
else usage();
|
|
215
|
+
} catch (error) {
|
|
216
|
+
console.error(`Error: ${error.message}`);
|
|
217
|
+
process.exitCode = 1;
|
|
218
|
+
}
|
package/commands/map.md
ADDED
package/commands/plan.md
ADDED
package/commands/pr.md
ADDED