hero-mmt-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +21 -0
  3. package/README.md +158 -0
  4. package/bin/hero-mmt-kit.js +70 -0
  5. package/package.json +35 -0
  6. package/presets/enterprise.json +3 -0
  7. package/presets/small-team.json +3 -0
  8. package/presets/solo.json +3 -0
  9. package/skills.manifest.json +72 -0
  10. package/src/detect.cjs +43 -0
  11. package/src/discover.cjs +159 -0
  12. package/src/doctor.cjs +130 -0
  13. package/src/init.cjs +114 -0
  14. package/src/integrations.cjs +93 -0
  15. package/src/links.cjs +37 -0
  16. package/src/merge.cjs +61 -0
  17. package/src/profile-config.cjs +28 -0
  18. package/src/render.cjs +27 -0
  19. package/src/skills.cjs +107 -0
  20. package/src/update.cjs +75 -0
  21. package/src/util.cjs +56 -0
  22. package/src/workflow-state.cjs +65 -0
  23. package/templates/.hero-mmt-kit/session.schema.json +15 -0
  24. package/templates/AGENTS.md.tmpl +16 -0
  25. package/templates/CLAUDE.md.tmpl +23 -0
  26. package/templates/common/.claude/hooks/git-guard.cjs +57 -0
  27. package/templates/common/.claude/hooks/session-bridge.cjs +43 -0
  28. package/templates/common/.claude/hooks/stop-reminder.cjs +43 -0
  29. package/templates/common/.claude/settings.json +27 -0
  30. package/templates/docs/ACTIVE_STATE.md +41 -0
  31. package/templates/docs/BROWNFIELD_DISCOVERY.md +45 -0
  32. package/templates/docs/DESIGN_STANDARDS.md +86 -0
  33. package/templates/docs/INTERACTION_PATTERNS.md +58 -0
  34. package/templates/docs/PERFORMANCE_STANDARDS.md +31 -0
  35. package/templates/docs/SECURITY_STANDARDS.md +38 -0
  36. package/templates/docs/templates/DESIGN_BRIEF.md +44 -0
  37. package/templates/docs/templates/PRD_AI_FEATURE.md +87 -0
  38. package/templates/skills/NOTICE +69 -0
  39. package/templates/skills/brainstorming/SKILL.md +161 -0
  40. package/templates/skills/brainstorming/scripts/frame-template.html +214 -0
  41. package/templates/skills/brainstorming/scripts/helper.js +88 -0
  42. package/templates/skills/brainstorming/scripts/server.cjs +354 -0
  43. package/templates/skills/brainstorming/scripts/start-server.sh +148 -0
  44. package/templates/skills/brainstorming/scripts/stop-server.sh +56 -0
  45. package/templates/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  46. package/templates/skills/brainstorming/visual-companion.md +287 -0
  47. package/templates/skills/dispatching-parallel-agents/SKILL.md +186 -0
  48. package/templates/skills/executing-plans/SKILL.md +72 -0
  49. package/templates/skills/finishing-a-development-branch/SKILL.md +253 -0
  50. package/templates/skills/hero-coding/SKILL.md +69 -0
  51. package/templates/skills/hero-planning/SKILL.md +64 -0
  52. package/templates/skills/hero-reviewing/SKILL.md +66 -0
  53. package/templates/skills/hero-security/SKILL.md +425 -0
  54. package/templates/skills/hero-strict/SKILL.md +77 -0
  55. package/templates/skills/hero-unit-test/SKILL.md +79 -0
  56. package/templates/skills/receiving-code-review/SKILL.md +213 -0
  57. package/templates/skills/requesting-code-review/SKILL.md +108 -0
  58. package/templates/skills/requesting-code-review/code-reviewer.md +168 -0
  59. package/templates/skills/subagent-driven-development/SKILL.md +269 -0
  60. package/templates/skills/subagent-driven-development/code-quality-reviewer-prompt.md +34 -0
  61. package/templates/skills/subagent-driven-development/implementer-prompt.md +121 -0
  62. package/templates/skills/subagent-driven-development/scripts/review-package.sh +38 -0
  63. package/templates/skills/subagent-driven-development/scripts/sdd-workspace.sh +25 -0
  64. package/templates/skills/subagent-driven-development/scripts/task-brief.sh +58 -0
  65. package/templates/skills/subagent-driven-development/spec-reviewer-prompt.md +76 -0
  66. package/templates/skills/systematic-debugging/SKILL.md +296 -0
  67. package/templates/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  68. package/templates/skills/systematic-debugging/condition-based-waiting.md +115 -0
  69. package/templates/skills/systematic-debugging/defense-in-depth.md +122 -0
  70. package/templates/skills/systematic-debugging/find-polluter.sh +63 -0
  71. package/templates/skills/systematic-debugging/root-cause-tracing.md +169 -0
  72. package/templates/skills/test-driven-development/SKILL.md +371 -0
  73. package/templates/skills/test-driven-development/testing-anti-patterns.md +299 -0
  74. package/templates/skills/using-git-worktrees/SKILL.md +206 -0
  75. package/templates/skills/using-hero/SKILL.md +54 -0
  76. package/templates/skills/using-superpowers/SKILL.md +119 -0
  77. package/templates/skills/verification-before-completion/SKILL.md +139 -0
  78. package/templates/skills/writing-plans/SKILL.md +173 -0
  79. package/templates/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ Notable changes to `hero-mmt-kit` are documented here from `1.0.0` onward.
4
+
5
+ Format follows [Keep a Changelog](https://keepachangelog.com/); versioning follows [SemVer](https://semver.org/).
6
+
7
+ ## [1.0.0] - 2026-07-10
8
+
9
+ ### Added
10
+
11
+ - Initial standalone `hero-mmt-kit` release.
12
+ - Zero-dependency Node.js CLI published as `hero-mmt-kit`, with `init`, `update`, `discover`, `brownfield`, `doctor`, `version`, and `help` commands.
13
+ - Claude Code-only workflow installation for new and brownfield repositories.
14
+ - `using-hero` overview skill plus six operative workflow skills:
15
+ - `hero-planning`
16
+ - `hero-coding`
17
+ - `hero-reviewing`
18
+ - `hero-unit-test`
19
+ - `hero-security`
20
+ - `hero-strict`
21
+ - Bundled core process skills installed into `.claude/skills/` for every project, with attribution in `templates/skills/NOTICE`.
22
+ - Standalone framework-authored `hero-security` skill for OWASP + AI/LLM security reviews.
23
+ - Lightweight session state in `.hero-mmt-kit/session.json` with `schemaVersion`, `currentSkill`, `lastCheckpoint`, `resumePath`, `nextAction`, and `updatedAt`.
24
+ - Soft Claude Code hooks:
25
+ - `git-guard.cjs` for dangerous git-command protection and commit reminders.
26
+ - `session-bridge.cjs` for once-per-session state injection.
27
+ - `stop-reminder.cjs` for end-of-session state reminders.
28
+ - Brownfield discovery flow via `npx hero-mmt-kit discover` / `brownfield`, generating `docs/BROWNFIELD_DISCOVERY.md`.
29
+ - Standards and template docs:
30
+ - `docs/ACTIVE_STATE.md`
31
+ - `docs/BROWNFIELD_DISCOVERY.md`
32
+ - `docs/SECURITY_STANDARDS.md`
33
+ - `docs/PERFORMANCE_STANDARDS.md`
34
+ - `docs/DESIGN_STANDARDS.md`
35
+ - `docs/INTERACTION_PATTERNS.md`
36
+ - `docs/templates/PRD_AI_FEATURE.md`
37
+ - `docs/templates/DESIGN_BRIEF.md`
38
+ - Managed-region update model using `<!-- hero-mmt-kit:start/end -->` markers in generated guidance files.
39
+ - Optional integration detection for taste/design skills, GitNexus, and Serena.
40
+ - Presets for `enterprise`, `small-team`, and `solo` posture configuration.
41
+ - Test coverage for hook behavior, documentation links, initialization, brownfield discovery, optional integration gating, and CLI smoke flows.
42
+
43
+ ### Changed
44
+
45
+ - Workflow posture is human-led and Claude Code-only: developers invoke skills directly instead of relying on automatic routing, profiles, IDE targeting, or phase enforcement.
46
+ - Framework templates are English-only for consistency and token efficiency; assistants can still reply in the user's chat language.
47
+ - Installed skills are no longer selected by profile, project surface, or verification level. Every install receives the full bundled workflow skill suite.
48
+ - Optional taste/design skills are installed only when the user opts in with `--taste` or answers Yes during interactive `init`.
49
+ - `doctor` validates the current framework surfaces: hooks, settings, session state, doc links, and optional tool presence.
50
+
51
+ ### Removed
52
+
53
+ - Hard workflow enforcement gates and blocking edit/commit checks.
54
+ - Multi-IDE targeting and Cursor-specific installation surfaces.
55
+ - Profile, surface, and verification-level selection flags.
56
+ - Phase-handoff protocol artifacts and handoff validation logic.
57
+ - Legacy migration or compatibility behavior from earlier products. `hero-mmt-kit` starts with a clean runtime directory, managed-region markers, CLI binary, and package name.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hung Vi Manh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # hero-mmt-kit
2
+
3
+ > A focused, human-led coding workflow for **Claude Code** — six operative skills, one overview skill, simple session state, and soft safety hooks. Zero runtime dependencies.
4
+
5
+ `hero-mmt-kit` installs a lightweight Claude Code workflow into new or existing repositories. It is designed for developers who stay in control: you choose the task, invoke the relevant skill, and keep the final judgment on plans, code, tests, reviews, and security checks.
6
+
7
+ ## What it is
8
+
9
+ `hero-mmt-kit` is **documentation + direct-use skills + soft hooks + a zero-dependency CLI**. It does not route work automatically, enforce phases, or block normal development flow.
10
+
11
+ - **Seven installed workflow skills** — `using-hero` for orientation, plus six operative skills: `hero-planning`, `hero-coding`, `hero-reviewing`, `hero-unit-test`, `hero-security`, and `hero-strict`.
12
+ - **Human-led by default** — the developer decides what to work on and which skill to run next.
13
+ - **No router, no hard gates** — `using-hero` is a map, not a controller. There is no task-classification engine and no hard PreToolUse workflow enforcement.
14
+ - **Soft hooks only** — `git-guard` blocks a small set of genuinely dangerous git commands and reminds on ordinary commits; `stop-reminder` nudges you to update state when stopping with uncommitted changes; `session-bridge` injects session state once per Claude Code session.
15
+ - **Lightweight session state** — `.hero-mmt-kit/session.json` is a small resume pointer (`currentSkill`, `lastCheckpoint`, `resumePath`, `nextAction`), not a workflow engine.
16
+ - **Full skill suite, every install** — bundled process skills install unconditionally; there is no profile or surface logic deciding which core skills you get.
17
+ - **English-only framework templates** — installed framework docs and templates are in English for consistency and token efficiency. Claude can still respond in the user's chat language.
18
+
19
+ Optional third-party tools such as taste/design skills, GitNexus, and Serena are referenced or installed from their own sources when available; they are not required for the core workflow.
20
+
21
+ ## Quick start
22
+
23
+ ```bash
24
+ # In your project root (new or existing):
25
+ npx hero-mmt-kit init
26
+
27
+ # For existing codebases, create the first discovery map:
28
+ npx hero-mmt-kit discover
29
+
30
+ # Restart Claude Code (or run /hooks) to activate hooks, then validate:
31
+ npx hero-mmt-kit doctor
32
+ ```
33
+
34
+ Non-interactive / CI examples:
35
+
36
+ ```bash
37
+ npx hero-mmt-kit init --dir <tmp> --yes --skip-integrations
38
+
39
+ # Opt into the optional taste/design skill non-interactively:
40
+ npx hero-mmt-kit init --dir <tmp> --yes --taste
41
+ ```
42
+
43
+ ## What `init` installs
44
+
45
+ ```text
46
+ your-project/
47
+ CLAUDE.md # hero-mmt-kit managed block; existing content preserved
48
+ AGENTS.md # cross-agent entry pointer
49
+ docs/ # ACTIVE_STATE, BROWNFIELD_DISCOVERY, SECURITY_STANDARDS,
50
+ # PERFORMANCE_STANDARDS, DESIGN_STANDARDS, INTERACTION_PATTERNS,
51
+ # templates/PRD_AI_FEATURE, templates/DESIGN_BRIEF
52
+ .claude/
53
+ settings.json # hooks merged into existing settings, not clobbered
54
+ hooks/ # git-guard.cjs, stop-reminder.cjs, session-bridge.cjs
55
+ skills/ # full bundled skill suite
56
+ .hero-mmt-kit/
57
+ config.json # installTasteSkill, enforceLevel, version, brownfield, integrations
58
+ session.json # resume pointer: currentSkill/lastCheckpoint/resumePath/nextAction
59
+ ```
60
+
61
+ - **New project:** scaffolds the workflow from scratch.
62
+ - **Brownfield project:** preserves existing `CLAUDE.md`, `AGENTS.md`, and `.claude/settings.json`; inserts managed blocks (`<!-- hero-mmt-kit:start/end -->`) and deep-merges hooks. `docs/ACTIVE_STATE.md` is never overwritten.
63
+ - **Idempotent updates:** re-running `init` or `update` refreshes framework-managed regions and backs up touched files to `*.bak` when needed.
64
+ - **One interactive question:** `init` asks whether to install the optional taste/design skill (default No). `--yes` accepts the default; `--taste` opts in without prompting.
65
+
66
+ ## Workflow skills
67
+
68
+ Start with `using-hero` when you want the map. It explains the available skills, when each one fits, and how session state carries across Claude Code sessions.
69
+
70
+ | Skill | Use when | Output artifact |
71
+ |---|---|---|
72
+ | `using-hero` | You need the workflow map or are unsure which skill to invoke next. | No required artifact. |
73
+ | `hero-planning` | Starting a feature, bugfix, or refactor that needs a plan before code changes. | `docs/plans/YYYY-MM-DD-slug.md` |
74
+ | `hero-coding` | Implementing an approved plan or a small change that does not need a plan. | `docs/coding-reports/YYYY-MM-DD-slug.md` |
75
+ | `hero-reviewing` | Performing a fresh-eyes check of an implementation against its plan before merge. | `docs/reviews/YYYY-MM-DD-slug.md` |
76
+ | `hero-unit-test` | Verifying implementation correctness, either TDD-first or after implementation. | `docs/test-reports/YYYY-MM-DD-slug.md` |
77
+ | `hero-security` | You want an independent OWASP + AI/LLM security review of auth, data, secrets, external input, AI/LLM behavior, or another sensitive surface. | `docs/security-reports/YYYY-MM-DD-slug.md` |
78
+ | `hero-strict` | You want extra rigor before claiming the work is done. | Appends to the current report. |
79
+
80
+ A typical flow is:
81
+
82
+ ```text
83
+ hero-planning → hero-coding → hero-unit-test and/or hero-reviewing → done
84
+
85
+ hero-security when you want a separate security pass → hero-strict if extra rigor is wanted
86
+ ```
87
+
88
+ Skip stages that do not fit the size or risk of the change. A one-line typo fix does not need a plan artifact.
89
+
90
+ The operative skills wrap proven technique skills instead of duplicating their content: `brainstorming`, `writing-plans`, `executing-plans`, `test-driven-development`, `systematic-debugging`, `verification-before-completion`, `requesting-code-review`, `receiving-code-review`, `dispatching-parallel-agents`, `subagent-driven-development`, `using-git-worktrees`, and `finishing-a-development-branch`. `hero-security` is the standalone framework-authored security review skill. These are bundled under `templates/skills/` and installed unconditionally into `.claude/skills/`, with attribution in `templates/skills/NOTICE`.
91
+
92
+ ## Session state
93
+
94
+ `.hero-mmt-kit/session.json` is a compact resume pointer. Each hero-* skill's Definition of Done includes updating it and `docs/ACTIVE_STATE.md` when there is meaningful state to carry forward.
95
+
96
+ Resuming work in a fresh session:
97
+
98
+ 1. Read `.hero-mmt-kit/session.json` for `currentSkill`, `resumePath`, and `nextAction`.
99
+ 2. Read the artifact at `resumePath` for concrete next steps.
100
+ 3. If `session.json` is blank or stale, read `docs/ACTIVE_STATE.md`'s Active Features table.
101
+
102
+ ## Commands
103
+
104
+ | Command | Purpose |
105
+ |---|---|
106
+ | `init` | Install the workflow into the current project. |
107
+ | `update` | Re-render managed regions while preserving user edits and working files. |
108
+ | `discover` | Scan a brownfield codebase and create `docs/BROWNFIELD_DISCOVERY.md`. |
109
+ | `brownfield` | Alias for `discover`. |
110
+ | `doctor` | Validate hooks, settings, session state, doc links, and tool presence. Use `--strict` for CI. |
111
+ | `version` | Print the package version. |
112
+ | `help` | Show usage. |
113
+
114
+ Flags:
115
+
116
+ ```text
117
+ --dir <path> Target project dir (default: current dir)
118
+ --taste Install the optional taste/design skill (default: off)
119
+ --preset <name> Load a bundled preset (enterprise | small-team | solo) — sets enforceLevel only
120
+ --yes Non-interactive; accept defaults
121
+ --skip-integrations Skip design-skill / GitNexus / Serena integration steps
122
+ --strict (doctor only) treat compliance warnings as failures — for CI use
123
+ ```
124
+
125
+ ## Optional integrations
126
+
127
+ Integrations are auto-detected. Core workflow installation works without them.
128
+
129
+ | Tool | What it is | What `init` does |
130
+ |---|---|---|
131
+ | Taste/design skills | UI/design skills from `Leonxlnx/taste-skill` | Installed from source via the `skills` CLI only if you opt in (`--taste` or interactive Yes) |
132
+ | GitNexus | Code-intelligence CLI/MCP | Auto-runs `npx gitnexus analyze` only if the repo already has a `.gitnexus/` index; otherwise skipped |
133
+ | Serena | Semantic code-intelligence MCP | Auto-seeds pointer notes only if `.serena/` already exists; otherwise skipped |
134
+
135
+ Required: Node.js 18+ and Claude Code. Everything else is optional.
136
+
137
+ ## Update and customize
138
+
139
+ - Edit anything outside `<!-- hero-mmt-kit:start/end -->` markers freely; `update` will not touch it.
140
+ - Fill `<TBD>` placeholders in Security, Performance, and Design docs once the stack is known.
141
+ - Run `npx hero-mmt-kit update` to refresh framework-managed docs/hooks to the latest version.
142
+ - Never hand-edit inside managed regions; change the source template or run `update` from a newer package version.
143
+
144
+ ## Uninstall
145
+
146
+ Review files before deleting them, especially skill directories that may contain user-added content. To remove the framework, delete or clean up:
147
+
148
+ - framework docs under `docs/`,
149
+ - `.claude/hooks/*` and the hook block in `.claude/settings.json`,
150
+ - managed blocks in `CLAUDE.md` and `AGENTS.md`,
151
+ - `.hero-mmt-kit/`,
152
+ - bundled skills under `.claude/skills/` that you no longer want.
153
+
154
+ ## License and attribution
155
+
156
+ MIT (see `LICENSE`). `hero-mmt-kit` vendors a curated, lightly trimmed copy of core process skills from [`obra/superpowers`](https://github.com/obra/superpowers) under `templates/skills/` with attribution in `templates/skills/NOTICE`.
157
+
158
+ Design/UI skills from [`Leonxlnx/taste-skill`](https://github.com/Leonxlnx/taste-skill) are **not** redistributed; they are installed from source via the `skills` CLI under their own license only when the user opts into the taste/design skill.
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('path');
4
+ const PKG_ROOT = path.resolve(__dirname, '..');
5
+
6
+ function parseArgs(argv) {
7
+ const flags = {};
8
+ const pos = [];
9
+ for (let i = 0; i < argv.length; i++) {
10
+ const a = argv[i];
11
+ if (a.startsWith('--')) {
12
+ const eqIdx = a.indexOf('=');
13
+ if (eqIdx !== -1) { flags[a.slice(2, eqIdx)] = a.slice(eqIdx + 1); }
14
+ else if (argv[i + 1] !== undefined && !argv[i + 1].startsWith('--')) { flags[a.slice(2)] = argv[++i]; }
15
+ else { flags[a.slice(2)] = true; }
16
+ } else if (a.startsWith('-') && a.length === 2) {
17
+ flags[a.slice(1)] = true;
18
+ } else pos.push(a);
19
+ }
20
+ return { cmd: pos[0], pos, flags };
21
+ }
22
+
23
+ function printHelp() {
24
+ console.log(`hero-mmt-kit — a focused Claude Code workflow for human-led development
25
+
26
+ Usage: npx hero-mmt-kit <command> [flags]
27
+
28
+ Commands:
29
+ init Install the workflow into the current project (new or brownfield)
30
+ update Re-render managed regions, preserving your edits
31
+ discover Scan a brownfield project and create an AI discovery report
32
+ brownfield Alias for discover
33
+ doctor Validate the install (hooks, settings.json, session state, doc links, tools)
34
+ version Print the version
35
+ help Show this help
36
+
37
+ Flags:
38
+ --dir <path> Target project dir (default: current dir)
39
+ --taste Install the taste/design skill (default: off)
40
+ --preset <name> Load a bundled preset (enterprise | small-team | solo)
41
+ --yes Non-interactive; accept defaults
42
+ --skip-integrations Skip skills / gitnexus / serena prompts
43
+ --strict (doctor only) treat warnings as failures — for CI use`);
44
+ }
45
+
46
+ async function main() {
47
+ const { cmd, flags } = parseArgs(process.argv.slice(2));
48
+ const target = flags.dir ? path.resolve(String(flags.dir)) : process.cwd();
49
+ const opts = { pkgRoot: PKG_ROOT, target, flags };
50
+ const version = () => console.log(require('../package.json').version);
51
+
52
+ if (Object.prototype.hasOwnProperty.call(flags, 'lang')) {
53
+ console.error('Warning: --lang was removed. hero-mmt-kit templates are English-only.');
54
+ }
55
+
56
+ if (flags.version || flags.v) { version(); return; }
57
+
58
+ switch (cmd) {
59
+ case 'init': await require('../src/init.cjs').init(opts); break;
60
+ case 'update': await require('../src/update.cjs').update(opts); break;
61
+ case 'discover': case 'brownfield': await require('../src/discover.cjs').discover(opts); break;
62
+ case 'doctor': await require('../src/doctor.cjs').doctor(opts); break;
63
+ case 'version': version(); break;
64
+ case 'help': case undefined: printHelp(); break;
65
+ default:
66
+ console.error('Unknown command: ' + cmd); printHelp(); process.exit(1);
67
+ }
68
+ }
69
+
70
+ main().catch((e) => { console.error((e && e.stack) || e); process.exit(1); });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "hero-mmt-kit",
3
+ "version": "1.0.0",
4
+ "description": "A focused Claude Code framework for human-led development — seven direct-use skills (planning, coding, reviewing, unit testing, security, strict mode) with simple state tracking. Works for new and existing (brownfield) projects.",
5
+ "keywords": [
6
+ "claude-code",
7
+ "ai-workflow",
8
+ "agentic-development",
9
+ "scaffolding",
10
+ "developer-workflow",
11
+ "ai-assistant"
12
+ ],
13
+ "license": "MIT",
14
+ "type": "commonjs",
15
+ "bin": {
16
+ "hero-mmt-kit": "bin/hero-mmt-kit.js"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "src",
21
+ "templates",
22
+ "presets",
23
+ "skills.manifest.json",
24
+ "README.md",
25
+ "LICENSE",
26
+ "CHANGELOG.md"
27
+ ],
28
+ "scripts": {
29
+ "test": "node --test"
30
+ },
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "dependencies": {}
35
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "enforceLevel": "hard"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "enforceLevel": "mixed"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "enforceLevel": "soft"
3
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$comment": "Skills the hero-mmt-kit workflow references. The `process` core skills are bundled under templates/skills/ and installed by init/update into .claude/skills/. Concise reporting principles are integrated directly into the hero-* workflow skills rather than shipped as a standalone optional skill. Most vendored technique skills are a curated, lightly trimmed MIT-licensed copy from obra/superpowers; the hero-* skills plus using-hero are authored by hero-mmt-kit (attribution: templates/skills/NOTICE). Design/taste skills are NOT bundled — they are referenced here and installed via the `skills` CLI from their ORIGINAL sources when the user opts into the taste/design skill.",
3
+ "schema": 1,
4
+ "installer": "skills",
5
+ "groups": {
6
+ "process": {
7
+ "tier": "vendored",
8
+ "bundled": true,
9
+ "source": "mixed",
10
+ "license": "MIT for obra/superpowers skills; hero-mmt-kit authored for the hero-* skills and using-hero",
11
+ "description": "Core process skills the workflow invokes by name. Bundled under templates/skills/ and installed into .claude/skills/ by init/update. The hero-* skills are the primary developer-facing interface; they wrap the vendored obra/superpowers technique skills rather than duplicating them, except hero-security which is a standalone security review skill (attribution in templates/skills/NOTICE).",
12
+ "selection": {
13
+ "mode": "all",
14
+ "deriveFrom": [],
15
+ "installPolicy": "install the full bundled process suite unconditionally — every install gets all core skills",
16
+ "updatePolicy": "refresh all framework-managed bundled process skills; preserve user-added skill directories"
17
+ },
18
+ "skills": [
19
+ { "name": "using-superpowers", "source": "obra/superpowers" },
20
+ { "name": "using-hero", "source": "hero-mmt-kit", "description": "Overview and router for the hero-* skills — explains which skill to invoke next and how session state carries across sessions." },
21
+ { "name": "brainstorming", "source": "obra/superpowers" },
22
+ { "name": "writing-plans", "source": "obra/superpowers" },
23
+ { "name": "executing-plans", "source": "obra/superpowers" },
24
+ { "name": "test-driven-development", "source": "obra/superpowers" },
25
+ { "name": "systematic-debugging", "source": "obra/superpowers" },
26
+ { "name": "verification-before-completion", "source": "obra/superpowers" },
27
+ { "name": "requesting-code-review", "source": "obra/superpowers" },
28
+ { "name": "receiving-code-review", "source": "obra/superpowers" },
29
+ { "name": "dispatching-parallel-agents", "source": "obra/superpowers" },
30
+ { "name": "subagent-driven-development", "source": "obra/superpowers" },
31
+ { "name": "using-git-worktrees", "source": "obra/superpowers" },
32
+ { "name": "finishing-a-development-branch", "source": "obra/superpowers" },
33
+ { "name": "hero-planning", "source": "hero-mmt-kit", "description": "Turn a request into an agreed, written plan before code changes." },
34
+ { "name": "hero-coding", "source": "hero-mmt-kit", "description": "Implement an approved plan, or a small change that doesn't need one." },
35
+ { "name": "hero-reviewing", "source": "hero-mmt-kit", "description": "Fresh-eyes check of an implementation against its plan, before merge." },
36
+ { "name": "hero-unit-test", "source": "hero-mmt-kit", "description": "Verify implementation correctness — TDD-first or post-implementation." },
37
+ { "name": "hero-security", "source": "hero-mmt-kit", "description": "Run an independent OWASP + AI/LLM security review and write a standalone security report." },
38
+ { "name": "hero-strict", "source": "hero-mmt-kit", "description": "Opt-in full verification pass before a \"done\" claim." }
39
+ ]
40
+ },
41
+ "brand": {
42
+ "tier": "optional",
43
+ "description": "Brand/identity skill. Use once per product/brand.",
44
+ "skills": [
45
+ { "name": "brandkit", "source": "Leonxlnx/taste-skill" }
46
+ ]
47
+ },
48
+ "design-direction": {
49
+ "tier": "optional",
50
+ "description": "Visual-direction taste systems. Pick EXACTLY ONE per project (DESIGN_STANDARDS §3).",
51
+ "pickOne": true,
52
+ "skills": [
53
+ { "name": "design-taste-frontend", "source": "Leonxlnx/taste-skill" },
54
+ { "name": "minimalist-ui", "source": "Leonxlnx/taste-skill" },
55
+ { "name": "industrial-brutalist-ui", "source": "Leonxlnx/taste-skill" },
56
+ { "name": "high-end-visual-design", "source": "Leonxlnx/taste-skill" },
57
+ { "name": "gpt-taste", "source": "<TBD>" }
58
+ ]
59
+ },
60
+ "design-tools": {
61
+ "tier": "optional",
62
+ "description": "Complementary design tools — install as needed (not mutually exclusive).",
63
+ "pickOne": false,
64
+ "skills": [
65
+ { "name": "imagegen-frontend-web", "source": "<TBD>" },
66
+ { "name": "imagegen-frontend-mobile", "source": "<TBD>" },
67
+ { "name": "image-to-code", "source": "<TBD>" },
68
+ { "name": "redesign-existing-projects", "source": "<TBD>" }
69
+ ]
70
+ }
71
+ }
72
+ }
package/src/detect.cjs ADDED
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const { exists } = require('./util.cjs');
5
+
6
+ const CODE_EXT = new Set(['.js', '.mjs', '.cjs', '.ts', '.jsx', '.tsx', '.py', '.go', '.rs', '.java', '.rb', '.php', '.cs', '.cpp', '.c', '.h', '.vue', '.svelte', '.kt', '.swift', '.scala', '.dart']);
7
+ const SKIP = new Set(['.git', 'node_modules', '.gitnexus', '.agents', '.hero-mmt-kit', 'templates', 'dist', 'build', '.next', 'out', 'vendor', '__pycache__', '.serena', '.claude', '.cursor', 'coverage']);
8
+
9
+ function findCode(dir, depth) {
10
+ if (depth > 3) return false;
11
+ let entries;
12
+ try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch (_) { return false; }
13
+ for (const e of entries) {
14
+ if (e.isDirectory()) {
15
+ if (SKIP.has(e.name) || e.name.startsWith('.')) continue;
16
+ if (findCode(path.join(dir, e.name), depth + 1)) return true;
17
+ } else if (CODE_EXT.has(path.extname(e.name))) {
18
+ return true;
19
+ }
20
+ }
21
+ return false;
22
+ }
23
+
24
+ function detect(target) {
25
+ const r = {
26
+ target,
27
+ isGitRepo: exists(path.join(target, '.git')),
28
+ existingClaudeMd: exists(path.join(target, 'CLAUDE.md')),
29
+ existingAgentsMd: exists(path.join(target, 'AGENTS.md')),
30
+ existingSettings: exists(path.join(target, '.claude', 'settings.json')),
31
+ existingActiveState: exists(path.join(target, 'docs', 'ACTIVE_STATE.md')),
32
+ existingConfig: exists(path.join(target, '.hero-mmt-kit', 'config.json')),
33
+ hasSkillsLock: exists(path.join(target, 'skills-lock.json')),
34
+ hasVendoredSkills: exists(path.join(target, '.claude', 'skills')),
35
+ hasSerena: exists(path.join(target, '.serena')),
36
+ hasGitnexus: exists(path.join(target, '.gitnexus')),
37
+ hasCode: findCode(target, 0),
38
+ };
39
+ r.brownfield = r.hasCode || r.existingClaudeMd || r.existingAgentsMd;
40
+ return r;
41
+ }
42
+
43
+ module.exports = { detect };
@@ -0,0 +1,159 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const { log, ensureDir, exists, readJSON } = require('./util.cjs');
5
+ const { detect } = require('./detect.cjs');
6
+ const { mergeManagedBlock } = require('./merge.cjs');
7
+
8
+ const DOC_FILES = new Set(['README.md', 'CONTRIBUTING.md', 'CHANGELOG.md', 'ARCHITECTURE.md', 'ROADMAP.md', 'LICENSE.md']);
9
+ const DOC_DIRS = new Set(['docs', 'documentation', 'wiki', 'adr', 'architecture', 'specs', 'plans', '.github']);
10
+ const CODE_DIRS = new Set(['src', 'app', 'pages', 'components', 'lib', 'server', 'api', 'backend', 'frontend', 'mobile', 'packages', 'apps']);
11
+ const TEST_DIRS = new Set(['test', 'tests', '__tests__', 'spec', 'e2e', 'cypress', 'playwright']);
12
+ const CONFIG_FILES = new Set([
13
+ 'package.json', 'pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'tsconfig.json', 'jsconfig.json',
14
+ 'vite.config.js', 'vite.config.ts', 'next.config.js', 'next.config.mjs', 'nuxt.config.js', 'nuxt.config.ts',
15
+ 'docker-compose.yml', 'docker-compose.yaml', 'Dockerfile', '.env.example', '.env.sample',
16
+ '.github/workflows', '.gitlab-ci.yml', 'Makefile', 'turbo.json', 'nx.json', 'pyproject.toml', 'requirements.txt',
17
+ 'go.mod', 'Cargo.toml', 'pom.xml', 'build.gradle', 'settings.gradle'
18
+ ]);
19
+ const SKIP_DIRS = new Set(['.git', 'node_modules', '.hero-mmt-kit', '.claude', '.serena', '.gitnexus', 'dist', 'build', '.next', 'out', 'coverage', 'vendor']);
20
+
21
+ function rel(target, p) { return path.relative(target, p).split(path.sep).join('/'); }
22
+ function hasMarkdown(name) { return /\.mdx?$/i.test(name); }
23
+ function uniq(xs) { return Array.from(new Set(xs)).sort(); }
24
+ function bullet(xs, empty) { return xs.length ? xs.map((x) => `- ${x}`).join('\n') : `- ${empty}`; }
25
+ function section(title, body) { return `## ${title}\n${body}\n`; }
26
+
27
+ function listEntries(dir) {
28
+ try { return fs.readdirSync(dir, { withFileTypes: true }); } catch (_) { return []; }
29
+ }
30
+
31
+ function walkNear(target, visit, maxDepth, maxItems) {
32
+ let seen = 0;
33
+ function walk(dir, depth) {
34
+ if (depth > maxDepth || seen >= maxItems) return;
35
+ for (const e of listEntries(dir)) {
36
+ if (seen >= maxItems) return;
37
+ if (e.isDirectory() && SKIP_DIRS.has(e.name)) continue;
38
+ const abs = path.join(dir, e.name);
39
+ seen++;
40
+ visit(abs, e, depth);
41
+ if (e.isDirectory()) walk(abs, depth + 1);
42
+ }
43
+ }
44
+ walk(target, 0);
45
+ }
46
+
47
+ function scan(target) {
48
+ const found = { docs: [], codeDirs: [], testDirs: [], config: [], ci: [], packageScripts: [] };
49
+
50
+ for (const e of listEntries(target)) {
51
+ const abs = path.join(target, e.name);
52
+ if (e.isDirectory()) {
53
+ if (CODE_DIRS.has(e.name)) found.codeDirs.push(e.name + '/');
54
+ if (TEST_DIRS.has(e.name)) found.testDirs.push(e.name + '/');
55
+ if (DOC_DIRS.has(e.name)) found.docs.push(e.name + '/');
56
+ } else {
57
+ if (DOC_FILES.has(e.name) || hasMarkdown(e.name)) found.docs.push(e.name);
58
+ if (CONFIG_FILES.has(e.name)) found.config.push(e.name);
59
+ }
60
+ }
61
+
62
+ walkNear(target, (abs, e) => {
63
+ const r = rel(target, abs);
64
+ if (e.isDirectory()) {
65
+ if (r === '.github/workflows') found.ci.push(r + '/');
66
+ if (DOC_DIRS.has(e.name) && r !== e.name) found.docs.push(r + '/');
67
+ if (TEST_DIRS.has(e.name) && r !== e.name) found.testDirs.push(r + '/');
68
+ return;
69
+ }
70
+ if (hasMarkdown(e.name) && (r.includes('/') || !DOC_FILES.has(e.name))) found.docs.push(r);
71
+ if (CONFIG_FILES.has(e.name) || CONFIG_FILES.has(r)) found.config.push(r);
72
+ if (r.startsWith('.github/workflows/')) found.ci.push(r);
73
+ }, 3, 700);
74
+
75
+ const pkg = readJSON(path.join(target, 'package.json'), null);
76
+ if (pkg && pkg.scripts) {
77
+ for (const name of ['dev', 'start', 'build', 'test', 'lint', 'typecheck', 'check']) {
78
+ if (pkg.scripts[name]) found.packageScripts.push(`npm run ${name} — ${pkg.scripts[name]}`);
79
+ }
80
+ }
81
+
82
+ return {
83
+ docs: uniq(found.docs),
84
+ codeDirs: uniq(found.codeDirs),
85
+ testDirs: uniq(found.testDirs),
86
+ config: uniq(found.config),
87
+ ci: uniq(found.ci),
88
+ packageScripts: uniq(found.packageScripts),
89
+ };
90
+ }
91
+
92
+ function contentEn(date, d, s) {
93
+ return [
94
+ '# Brownfield Discovery',
95
+ '',
96
+ `Generated: ${date}`,
97
+ '',
98
+ section('1. Summary and read-next', [
99
+ '- This is a lightweight orientation map, not a final architecture report.',
100
+ '- Read only the files needed for the selected task path; expand context when evidence is insufficient.',
101
+ '- Do not paste long excerpts here — prefer paths, short evidence notes, and linked reports.', '',
102
+ '### Read next candidates', bullet(uniq([...s.docs.slice(0, 8), ...s.config.slice(0, 8)]), 'No docs/config candidates found — inspect the repository tree and likely code areas.'),
103
+ ].join('\n')),
104
+ section('2. What was found', [
105
+ '### Existing docs and knowledge sources', bullet(s.docs, 'None found yet — ask the AI to inspect code/config first, then create missing docs.'), '',
106
+ '### Likely code/app areas', bullet(s.codeDirs, 'No common top-level code folder found — inspect config files and repository tree.'), '',
107
+ '### Tests', bullet(s.testDirs, 'No common test folder found — inspect package/build config before assuming tests are absent.'), '',
108
+ '### Config/build/CI signals', bullet(uniq([...s.config, ...s.ci]), 'No common config/CI files found.'), '',
109
+ '### Package script candidates', bullet(s.packageScripts, 'No package scripts found.'),
110
+ ].join('\n')),
111
+ section('3. Status labels for the AI', [
112
+ '- **Found**: paths listed above exist in this repo.',
113
+ '- **Likely**: folder names suggest their role, but the AI must read files before claiming behavior.',
114
+ '- **Needs confirmation**: business purpose, user roles, deployment flow, and risky areas must be confirmed with the human if not documented.',
115
+ ].join('\n')),
116
+ section('4. First reading checklist for the AI', [
117
+ '1. Read the summary/read-next list first; do not load every discovered file by default.',
118
+ '2. Read config files needed to identify framework, commands, runtime, env requirements, and entry points.',
119
+ '3. Inspect likely code/app areas only as needed for the selected task path.',
120
+ '4. Inspect tests to learn expected behavior and safe verification commands.',
121
+ '5. Write findings as evidence, not guesses: cite files and separate certainty levels.',
122
+ ].join('\n')),
123
+ section('5. Open questions', [
124
+ '- What is the product/business goal of this project?',
125
+ '- Who are the main users/admins/operators?',
126
+ '- Which flows are most risky to break?',
127
+ '- What command proves the app is healthy locally and in CI?',
128
+ '- Are there docs outside the repository that should be linked as references?',
129
+ ].join('\n')),
130
+ section('6. Assumptions register', '- `<TBD>`'),
131
+ section('7. Notes outside the managed block', 'Add human-written corrections below or above this managed block. Re-run `hero-mmt-kit discover` to refresh only the generated block.'),
132
+ `Brownfield signal: ${d.brownfield ? 'existing project/code detected' : 'no code detected by lightweight scan'}`,
133
+ ].join('\n');
134
+ }
135
+
136
+ async function discover(opts) {
137
+ const { target } = opts;
138
+ log.title('hero-mmt-kit · brownfield discovery');
139
+ log.step(`Target : ${target}`);
140
+
141
+ const date = new Date().toISOString().slice(0, 10);
142
+ const d = detect(target);
143
+ const s = scan(target);
144
+ const inner = contentEn(date, d, s);
145
+ const out = path.join(target, 'docs', 'BROWNFIELD_DISCOVERY.md');
146
+ ensureDir(path.dirname(out));
147
+ const result = mergeManagedBlock(out, inner, 'Brownfield Discovery');
148
+
149
+ log.ok(`Report : ${path.relative(target, out).split(path.sep).join('/')} (${result})`);
150
+ log.ok(`Docs : ${s.docs.length} found`);
151
+ log.ok(`Code : ${s.codeDirs.length} likely area(s)`);
152
+ log.ok(`Tests : ${s.testDirs.length} likely area(s)`);
153
+ log.title('Next steps');
154
+ console.log(' 1. Ask the AI to read docs/BROWNFIELD_DISCOVERY.md before changing code.');
155
+ console.log(' 2. Fill the open questions and assumptions after the first real discovery pass.');
156
+ console.log(' 3. Run: npx hero-mmt-kit doctor');
157
+ }
158
+
159
+ module.exports = { discover, scan };