@negikirin/repo-pattern 0.1.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.
Files changed (39) hide show
  1. package/.claude/CLAUDE.md +61 -0
  2. package/.claude/settings.example.json +40 -0
  3. package/.claude/settings.local.example.json +24 -0
  4. package/.github/workflows/nodejs-package.yml +60 -0
  5. package/.repo-pattern.json +25 -0
  6. package/.repo-pattern.lock.json +23 -0
  7. package/LICENSE +21 -0
  8. package/README.md +145 -0
  9. package/THIRD_PARTY_NOTICES.md +51 -0
  10. package/docs/repo-pattern/setup-guide.md +725 -0
  11. package/docs/repo-pattern/workflow.md +429 -0
  12. package/mcp/profiles/backend.json +7 -0
  13. package/mcp/profiles/full.json +11 -0
  14. package/mcp/profiles/minimal.json +6 -0
  15. package/mcp/profiles/research.json +8 -0
  16. package/mcp/profiles/web.json +8 -0
  17. package/mcp/servers/chrome-devtools.json +10 -0
  18. package/mcp/servers/context7.json +13 -0
  19. package/mcp/servers/filesystem.json +11 -0
  20. package/mcp/servers/gitnexus.json +11 -0
  21. package/mcp/servers/playwright.json +12 -0
  22. package/mcp/servers/sequential-thinking.json +10 -0
  23. package/mcp/servers/tavily.json +13 -0
  24. package/package.json +71 -0
  25. package/scripts/lib/audit.mjs +127 -0
  26. package/scripts/lib/cleanup.mjs +35 -0
  27. package/scripts/lib/doctor.mjs +86 -0
  28. package/scripts/lib/ecc-rules.mjs +98 -0
  29. package/scripts/lib/ecc.mjs +61 -0
  30. package/scripts/lib/fs-utils.mjs +133 -0
  31. package/scripts/lib/mcp.mjs +203 -0
  32. package/scripts/lib/project-detect.mjs +107 -0
  33. package/scripts/lib/prompt.mjs +226 -0
  34. package/scripts/lib/provision.mjs +184 -0
  35. package/scripts/lib/rules.mjs +142 -0
  36. package/scripts/lib/setup.mjs +299 -0
  37. package/scripts/lib/skills.mjs +249 -0
  38. package/scripts/repo-pattern.mjs +156 -0
  39. package/scripts/self-check.mjs +175 -0
@@ -0,0 +1,61 @@
1
+ # CLAUDE.md
2
+
3
+ Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
4
+
5
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
6
+
7
+ ## 1. Think Before Coding
8
+
9
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
10
+
11
+ Before implementing:
12
+ - State your assumptions explicitly. If uncertain, ask.
13
+ - If multiple interpretations exist, present them - don't pick silently.
14
+ - If a simpler approach exists, say so. Push back when warranted.
15
+ - If something is unclear, stop. Name what's confusing. Ask.
16
+
17
+ ## 2. Simplicity First
18
+
19
+ **Minimum code that solves the problem. Nothing speculative.**
20
+
21
+ - No features beyond what was asked.
22
+ - No abstractions for single-use code.
23
+ - No "flexibility" or "configurability" that wasn't requested.
24
+ - No error handling for impossible scenarios.
25
+ - If you write 200 lines and it could be 50, rewrite it.
26
+
27
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
28
+
29
+ ## 3. Surgical Changes
30
+
31
+ **Touch only what you must. Clean up only your own mess.**
32
+
33
+ When editing existing code:
34
+ - Don't "improve" adjacent code, comments, or formatting.
35
+ - Don't refactor things that aren't broken.
36
+ - Match existing style, even if you'd do it differently.
37
+ - If you notice unrelated dead code, mention it - don't delete it.
38
+
39
+ When your changes create orphans:
40
+ - Remove imports/variables/functions that YOUR changes made unused.
41
+ - Don't remove pre-existing dead code unless asked.
42
+
43
+ The test: Every changed line should trace directly to the user's request.
44
+
45
+ ## 4. Goal-Driven Execution
46
+
47
+ **Define success criteria. Loop until verified.**
48
+
49
+ Transform tasks into verifiable goals:
50
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
51
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
52
+ - "Refactor X" → "Ensure tests pass before and after"
53
+
54
+ For multi-step tasks, state a brief plan:
55
+ ```
56
+ 1. [Step] → verify: [check]
57
+ 2. [Step] → verify: [check]
58
+ 3. [Step] → verify: [check]
59
+ ```
60
+
61
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "hooks": {},
4
+ "attribution": {
5
+ "commit": ""
6
+ },
7
+ "permissions": {
8
+ "deny": [
9
+ "Read(.env)",
10
+ "Read(.env.*)",
11
+ "Read(**/.env)",
12
+ "Read(**/.env.*)",
13
+ "Read(secrets/**)",
14
+ "Read(private/**)",
15
+ "Read(**/*.pem)",
16
+ "Read(**/*.key)",
17
+ "Read(**/id_rsa)",
18
+ "Read(**/id_ed25519)",
19
+ "Read(~/.ssh/**)",
20
+ "Read(~/.aws/**)",
21
+ "Read(~/.config/gcloud/**)",
22
+ "Bash(rm -rf /)",
23
+ "Bash(rm -rf ~)"
24
+ ],
25
+ "ask": [
26
+ "Bash(git push *)",
27
+ "Bash(git reset *)",
28
+ "Bash(git clean *)",
29
+ "Bash(rm *)",
30
+ "Bash(sudo *)",
31
+ "Bash(chmod *)",
32
+ "Bash(chown *)"
33
+ ],
34
+ "defaultMode": "default",
35
+ "disableBypassPermissionsMode": "disable"
36
+ },
37
+ "enabledMcpjsonServers": [],
38
+ "respectGitignore": true,
39
+ "autoUpdatesChannel": "stable"
40
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "model": "opus",
4
+ "fallbackModel": ["sonnet", "haiku"],
5
+ "effortLevel": "high",
6
+ "alwaysThinkingEnabled": true,
7
+ "autoCompactEnabled": true,
8
+ "autoCompactWindow": 180000,
9
+ "preferredNotifChannel": "terminal_bell",
10
+ "showTurnDuration": true,
11
+ "spinnerTipsEnabled": true,
12
+ "fileCheckpointingEnabled": true,
13
+ "env": {
14
+ "ENABLE_TOOL_SEARCH": "auto:5",
15
+ "ANTHROPIC_BASE_URL": "https://example.com/v1",
16
+ "ANTHROPIC_AUTH_TOKEN": "replace-with-your-token-in-settings.local.json",
17
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
18
+ "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
19
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
20
+ "API_TIMEOUT_MS": "300000",
21
+ "BASH_DEFAULT_TIMEOUT_MS": "300000",
22
+ "MCP_TOOL_TIMEOUT": "600000"
23
+ }
24
+ }
@@ -0,0 +1,60 @@
1
+ # This workflow runs tests and publishes this package to npmjs
2
+ # when a GitHub Release is created.
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: 20
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Run tests
30
+ run: npm test
31
+
32
+ - name: Verify package contents
33
+ run: npm pack --dry-run
34
+
35
+ publish-npm:
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ permissions:
39
+ contents: read
40
+
41
+ steps:
42
+ - name: Checkout repository
43
+ uses: actions/checkout@v4
44
+
45
+ - name: Setup Node.js for npmjs
46
+ uses: actions/setup-node@v4
47
+ with:
48
+ node-version: 20
49
+ registry-url: https://registry.npmjs.org/
50
+
51
+ - name: Install dependencies
52
+ run: npm ci
53
+
54
+ - name: Verify package contents
55
+ run: npm pack --dry-run
56
+
57
+ - name: Publish to npmjs
58
+ run: npm publish
59
+ env:
60
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,25 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "workflow": "ecc-native",
4
+ "mode": "template",
5
+ "runtime": {
6
+ "localSkills": false,
7
+ "localCommands": false,
8
+ "localHooks": false,
9
+ "localScripts": false,
10
+ "localRules": false,
11
+ "vendoredEccRules": false
12
+ },
13
+ "ecc": {
14
+ "installMode": "plugin",
15
+ "rulesSync": "repo-pattern-auto-cache",
16
+ "hooks": "plugin-managed",
17
+ "copyRuntimeSurfaces": false,
18
+ "rulesProfile": "auto",
19
+ "rulesScope": "project"
20
+ },
21
+ "mcp": {
22
+ "profile": "web",
23
+ "generated": true
24
+ }
25
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "repoPattern": {
3
+ "version": "2.0.0",
4
+ "lastProvisionRun": null,
5
+ "lastDoctorRun": null
6
+ },
7
+ "ecc": {
8
+ "installMode": "plugin",
9
+ "status": "not-run",
10
+ "rulesSyncedBy": "repo-pattern-auto-cache",
11
+ "hooks": "plugin-managed",
12
+ "syncedAt": null,
13
+ "rulesScope": "project",
14
+ "recommendedRules": [],
15
+ "appliedRules": [],
16
+ "detectedStack": null,
17
+ "rulesAppliedAt": null
18
+ },
19
+ "mcp": {
20
+ "profile": "web",
21
+ "generatedAt": "2026-06-23T01:58:20.499Z"
22
+ }
23
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NegiKirin
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,145 @@
1
+ # repo-pattern
2
+
3
+ <p align="center">
4
+ <img alt="Repo Pattern" src="https://img.shields.io/badge/repo--pattern-ECC--first-blue">
5
+ <img alt="Claude Code" src="https://img.shields.io/badge/Claude%20Code-ready-black">
6
+ <img alt="MCP Profiles" src="https://img.shields.io/badge/MCP-profiles-green">
7
+ <img alt="License" src="https://img.shields.io/badge/license-MIT-lightgrey">
8
+ </p>
9
+
10
+ **A clean Claude Code setup and migrator in one command.**
11
+
12
+ `repo-pattern` initializes or migrates a project into an ECC-first (Everything Claude Code) workspace with safe defaults, MCP profiles, and zero vendored runtime clutter.
13
+
14
+ ## Why use it?
15
+
16
+ - **Start fast** — generate `.claude/`, `.mcp.json`, and repo-pattern metadata.
17
+ - **Stay clean** — no local skills, commands, hooks, scripts, or duplicated templates by default.
18
+ - **Use MCP profiles** — choose `minimal`, `web`, `backend`, `research`, `full`, or `custom`.
19
+ - **ECC-first** — `setup` runs or attempts Everything Claude Code setup automatically.
20
+ - **Migrate safely** — audit, cleanup, doctor, and `setup --migrate` are built in.
21
+
22
+ ## Install
23
+
24
+ Use directly with `npx`:
25
+
26
+ ```bash
27
+ npx @negikirin/repo-pattern setup --profile web --yes
28
+ ```
29
+
30
+ Or install the CLI:
31
+
32
+ ```bash
33
+ npm install -g @negikirin/repo-pattern
34
+ repo-pattern setup --profile web --yes
35
+ ```
36
+
37
+ By default, commands target the current directory. To work on another project, add `--target /path/to/project`.
38
+
39
+ ## Quick start
40
+
41
+ Interactive setup:
42
+
43
+ ```bash
44
+ repo-pattern setup
45
+ ```
46
+
47
+ Scriptable setup:
48
+
49
+ ```bash
50
+ repo-pattern setup --profile web --yes
51
+ ```
52
+
53
+ Migrate an existing project:
54
+
55
+ ```bash
56
+ repo-pattern audit
57
+ repo-pattern setup --profile web --migrate --yes
58
+ repo-pattern doctor
59
+ ```
60
+
61
+ ## Commands
62
+
63
+ | Command | Purpose |
64
+ | --- | --- |
65
+ | `repo-pattern help` | Show CLI help. |
66
+ | `repo-pattern setup` | Initialize or migrate a Claude Code setup. |
67
+ | `repo-pattern audit` | Inspect current Claude Code/ECC state. |
68
+ | `repo-pattern doctor` | Validate the generated setup. |
69
+ | `repo-pattern mcp --profile web` | Regenerate `.mcp.json` from an MCP profile. |
70
+ | `repo-pattern rules` | Apply or refresh project-local ECC rules. |
71
+ | `repo-pattern cleanup` | Archive old local Claude runtime surfaces. |
72
+ | `repo-pattern ecc` | Run or attempt ECC setup manually. |
73
+
74
+ Common options:
75
+
76
+ ```bash
77
+ --target /path/to/project # default: current directory
78
+ --profile web # default MCP profile
79
+ --with-rules # opt in to .claude/rules/ecc
80
+ --with-skill ui-ux-pro-max # optional UI/UX skill; requires Python 3.x
81
+ --with-skills impeccable,huashu-design # optional design QA/media skills
82
+ --migrate # take over legacy/local Claude runtime surfaces
83
+ --dry-run # preview mutating commands
84
+ --yes # non-interactive setup
85
+ ```
86
+
87
+ ## MCP profiles
88
+
89
+ | Profile | Use when |
90
+ | --- | --- |
91
+ | `minimal` | You want only essential docs/filesystem tooling. |
92
+ | `web` | You build web apps and want browser/docs helpers. |
93
+ | `backend` | You focus on server-side projects. |
94
+ | `research` | You need search and extraction tooling. |
95
+ | `full` | You want every bundled MCP server enabled. |
96
+ | `custom` | You want to choose exact MCP servers interactively; not available with `--yes`. |
97
+
98
+ When selected, Context7 and Tavily prompts include dashboard links for getting API keys.
99
+
100
+ ## What it creates
101
+
102
+ ```text
103
+ target-project/
104
+ ├── CLAUDE.md # created empty if missing
105
+ ├── .claude/
106
+ │ ├── CLAUDE.md
107
+ │ ├── settings.json # copied from example, gitignored
108
+ │ └── settings.local.json # when local settings are provided, gitignored
109
+ ├── .mcp.json # generated, gitignored
110
+ ├── .repo-pattern.json
111
+ └── .repo-pattern.lock.json
112
+ ```
113
+
114
+ `repo-pattern` preserves an existing root `CLAUDE.md` and keeps machine-local values out of git.
115
+
116
+ ## Safety defaults
117
+
118
+ - `.mcp.json` is gitignored because it may contain local values.
119
+ - `.claude/settings.local.json` is gitignored.
120
+ - `.claude/settings.json` keeps `hooks: {}` and disables commit attribution by default; interactive setup can turn it on or use a custom trailer.
121
+ - No vendored ECC skills, commands, hooks, scripts, or rules are installed unless explicitly requested.
122
+ - Karpathy-inspired Claude Code guidelines are included in `.claude/CLAUDE.md` from `multica-ai/andrej-karpathy-skills` (MIT).
123
+ - Optional external skills are user opt-in only: `--with-skill taste`, `--with-skill document-specialist`, `--with-skill ui-ux-pro-max`, `--with-skill impeccable`, `--with-skill huashu-design`, or interactive setup.
124
+
125
+ ## External guidance and skills
126
+
127
+ | Name | Integrated as | Source | License |
128
+ | --- | --- | --- | --- |
129
+ | `karpathy-guidelines` | Built-in `.claude/CLAUDE.md` guidance | https://github.com/multica-ai/andrej-karpathy-skills | MIT |
130
+ | `taste` | Optional `.claude/skills/` install via `--with-skill taste` | https://github.com/Leonxlnx/taste-skill/ | MIT |
131
+ | `document-specialist` | Optional `.claude/skills/` install via `--with-skill document-specialist` | https://github.com/SpillwaveSolutions/document-specialist-skill/ | NOASSERTION — no upstream license declared during review on 2026-07-06 |
132
+ | `ui-ux-pro-max` | Optional `.claude/skills/` install via `--with-skill ui-ux-pro-max` (requires Python 3.x) | https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/ | MIT |
133
+ | `impeccable` | Optional `.claude/skills/` skill-only install via `--with-skill impeccable` (scripts require Node >=24) | https://github.com/pbakaus/impeccable/ | Apache-2.0 |
134
+ | `huashu-design` | Optional `.claude/skills/` install via `--with-skill huashu-design` (multimedia scripts may need Playwright/Python/ffmpeg; install can take ~10 minutes, so opt in deliberately) | https://github.com/alchaincyf/huashu-design/ | MIT |
135
+
136
+ ## Learn more
137
+
138
+ Full setup details live in [docs/repo-pattern/setup-guide.md](docs/repo-pattern/setup-guide.md).
139
+ Third-party license notices are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
140
+
141
+ From a source checkout, replace `repo-pattern` with:
142
+
143
+ ```bash
144
+ node scripts/repo-pattern.mjs
145
+ ```
@@ -0,0 +1,51 @@
1
+ # Third-party notices
2
+
3
+ ## ECC
4
+
5
+ repo-pattern integrates with ECC (Everything Claude Code) by referencing the official ECC plugin and, when explicitly requested by the user, syncing ECC rule packs from the upstream repository.
6
+
7
+ Source: https://github.com/affaan-m/ECC
8
+ License: MIT
9
+ Copyright (c) 2026 Affaan Mustafa
10
+
11
+ repo-pattern does not vendor ECC skills, commands, hooks, scripts, or runtime surfaces by default.
12
+
13
+ ## Karpathy-inspired guidelines
14
+
15
+ repo-pattern includes Claude Code behavioral guidelines from `multica-ai/andrej-karpathy-skills` in `.claude/CLAUDE.md`.
16
+
17
+ - Source: https://github.com/multica-ai/andrej-karpathy-skills
18
+ - License: MIT
19
+
20
+ ## Optional external skills
21
+
22
+ Optional skills are not bundled with repo-pattern. When explicitly selected by the user, repo-pattern downloads them from their upstream repositories into the target project's `.claude/skills/` directory.
23
+
24
+ ### taste-skill
25
+
26
+ - Source: https://github.com/Leonxlnx/taste-skill/
27
+ - License: MIT
28
+ - Copyright (c) 2026 Leonxlnx
29
+
30
+ ### document-specialist-skill
31
+
32
+ - Source: https://github.com/SpillwaveSolutions/document-specialist-skill/
33
+ - License: NOASSERTION — no license was declared in the visible repository metadata during review on 2026-07-06. Use only when you accept that upstream source.
34
+
35
+ ### ui-ux-pro-max
36
+
37
+ - Source: https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/
38
+ - License: MIT
39
+ - Copyright (c) 2024 Next Level Builder
40
+
41
+ ### impeccable
42
+
43
+ - Source: https://github.com/pbakaus/impeccable/
44
+ - License: Apache-2.0
45
+ - Copyright 2025 Paul Bakaus
46
+
47
+ ### huashu-design
48
+
49
+ - Source: https://github.com/alchaincyf/huashu-design/
50
+ - License: MIT
51
+ - Copyright (c) 2026 alchaincyf (花叔 · 花生)