@zcy2nn/agent-forge 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/agent-forge.schema.json +675 -0
- package/dist/agents/council.d.ts +27 -0
- package/dist/agents/councillor.d.ts +2 -0
- package/dist/agents/implementer.d.ts +2 -0
- package/dist/agents/index.d.ts +30 -0
- package/dist/agents/orchestrator.d.ts +30 -0
- package/dist/agents/researcher.d.ts +2 -0
- package/dist/agents/reviewer.d.ts +2 -0
- package/dist/cli/config-io.d.ts +24 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/doctor.d.ts +38 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1932 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/migration.d.ts +46 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +35 -0
- package/dist/cli/providers.d.ts +99 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +40 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +28 -0
- package/dist/config/council-schema.d.ts +127 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/loader.d.ts +57 -0
- package/dist/config/runtime-preset.d.ts +12 -0
- package/dist/config/schema.d.ts +371 -0
- package/dist/config/utils.d.ts +15 -0
- package/dist/council/council-manager.d.ts +49 -0
- package/dist/council/index.d.ts +1 -0
- package/dist/divoom/council.gif +0 -0
- package/dist/divoom/designer.gif +0 -0
- package/dist/divoom/explorer.gif +0 -0
- package/dist/divoom/fixer.gif +0 -0
- package/dist/divoom/input.gif +0 -0
- package/dist/divoom/intro.gif +0 -0
- package/dist/divoom/librarian.gif +0 -0
- package/dist/divoom/manager.d.ts +57 -0
- package/dist/divoom/oracle.gif +0 -0
- package/dist/divoom/orchestrator.gif +0 -0
- package/dist/hooks/apply-patch/codec.d.ts +7 -0
- package/dist/hooks/apply-patch/errors.d.ts +25 -0
- package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
- package/dist/hooks/apply-patch/index.d.ts +15 -0
- package/dist/hooks/apply-patch/matching.d.ts +26 -0
- package/dist/hooks/apply-patch/operations.d.ts +3 -0
- package/dist/hooks/apply-patch/patch.d.ts +2 -0
- package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
- package/dist/hooks/apply-patch/resolution.d.ts +19 -0
- package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
- package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
- package/dist/hooks/apply-patch/types.d.ts +80 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +32 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +18 -0
- package/dist/hooks/auto-update-checker/types.d.ts +22 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/filter-available-skills/index.d.ts +32 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/image-hook.d.ts +19 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-file-tool-nudge/index.d.ts +19 -0
- package/dist/hooks/task-session-manager/index.d.ts +52 -0
- package/dist/hooks/todo-continuation/index.d.ts +53 -0
- package/dist/hooks/todo-continuation/todo-hygiene.d.ts +35 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32981 -0
- package/dist/interview/dashboard.d.ts +62 -0
- package/dist/interview/document.d.ts +25 -0
- package/dist/interview/helpers.d.ts +10 -0
- package/dist/interview/index.d.ts +1 -0
- package/dist/interview/manager.d.ts +35 -0
- package/dist/interview/parser.d.ts +11 -0
- package/dist/interview/prompts.d.ts +7 -0
- package/dist/interview/server.d.ts +13 -0
- package/dist/interview/service.d.ts +34 -0
- package/dist/interview/types.d.ts +96 -0
- package/dist/interview/ui.d.ts +12 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +9 -0
- package/dist/multiplexer/factory.d.ts +26 -0
- package/dist/multiplexer/index.d.ts +9 -0
- package/dist/multiplexer/session-manager.d.ts +53 -0
- package/dist/multiplexer/tmux/index.d.ts +22 -0
- package/dist/multiplexer/types.d.ts +54 -0
- package/dist/multiplexer/zellij/index.d.ts +34 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/council.d.ts +10 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/preset-manager.d.ts +27 -0
- package/dist/tools/skill.d.ts +9 -0
- package/dist/tools/smartfetch/binary.d.ts +3 -0
- package/dist/tools/smartfetch/cache.d.ts +6 -0
- package/dist/tools/smartfetch/constants.d.ts +12 -0
- package/dist/tools/smartfetch/index.d.ts +3 -0
- package/dist/tools/smartfetch/network.d.ts +38 -0
- package/dist/tools/smartfetch/secondary-model.d.ts +28 -0
- package/dist/tools/smartfetch/tool.d.ts +3 -0
- package/dist/tools/smartfetch/types.d.ts +122 -0
- package/dist/tools/smartfetch/utils.d.ts +18 -0
- package/dist/tui-state.d.ts +15 -0
- package/dist/tui.d.ts +8 -0
- package/dist/tui.js +248 -0
- package/dist/utils/agent-variant.d.ts +63 -0
- package/dist/utils/compat.d.ts +30 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/session-manager.d.ts +55 -0
- package/dist/utils/session.d.ts +74 -0
- package/dist/utils/subagent-depth.d.ts +35 -0
- package/dist/utils/system-collapse.d.ts +6 -0
- package/dist/utils/task.d.ts +4 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +104 -0
- package/src/skills/brainstorming/SKILL.md +177 -0
- package/src/skills/brainstorming/scripts/frame-template.html +214 -0
- package/src/skills/brainstorming/scripts/helper.js +88 -0
- package/src/skills/brainstorming/scripts/server.cjs +354 -0
- package/src/skills/brainstorming/scripts/start-server.sh +148 -0
- package/src/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/src/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/src/skills/brainstorming/visual-companion.md +279 -0
- package/src/skills/codemap/README.md +59 -0
- package/src/skills/codemap/SKILL.md +163 -0
- package/src/skills/codemap/codemap.md +36 -0
- package/src/skills/codemap/scripts/codemap.mjs +483 -0
- package/src/skills/codemap/scripts/codemap.test.ts +129 -0
- package/src/skills/codemap.md +40 -0
- package/src/skills/dispatching-parallel-agents/SKILL.md +193 -0
- package/src/skills/executing-plans/SKILL.md +78 -0
- package/src/skills/finishing-a-development-branch/SKILL.md +211 -0
- package/src/skills/receiving-code-review/SKILL.md +224 -0
- package/src/skills/requesting-code-review/SKILL.md +113 -0
- package/src/skills/requesting-code-review/code-reviewer.md +146 -0
- package/src/skills/simplify/README.md +19 -0
- package/src/skills/simplify/SKILL.md +138 -0
- package/src/skills/simplify/codemap.md +36 -0
- package/src/skills/subagent-driven-development/SKILL.md +288 -0
- package/src/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/src/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/src/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/src/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/src/skills/systematic-debugging/SKILL.md +308 -0
- package/src/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/src/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/src/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/src/skills/systematic-debugging/find-polluter.sh +63 -0
- package/src/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/src/skills/systematic-debugging/test-academic.md +14 -0
- package/src/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/src/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/src/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/src/skills/test-driven-development/SKILL.md +383 -0
- package/src/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/src/skills/using-git-worktrees/SKILL.md +226 -0
- package/src/skills/verification-before-completion/SKILL.md +147 -0
- package/src/skills/writing-plans/SKILL.md +165 -0
- package/src/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/src/skills/writing-skills/SKILL.md +666 -0
- package/src/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/src/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/src/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/src/skills/writing-skills/persuasion-principles.md +187 -0
- package/src/skills/writing-skills/render-graphs.js +168 -0
- package/src/skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codemap
|
|
3
|
+
description: Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codemap Skill
|
|
7
|
+
|
|
8
|
+
You help users understand and map repositories by creating hierarchical codemaps.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- User asks to understand/map a repository
|
|
13
|
+
- User wants codebase documentation
|
|
14
|
+
- Starting work on an unfamiliar codebase
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
### Step 1: Check for Existing State
|
|
19
|
+
|
|
20
|
+
**First, check if `.slim/codemap.json` exists in the repo root.**
|
|
21
|
+
|
|
22
|
+
If it does not exist, check for legacy state at `.slim/cartography.json`.
|
|
23
|
+
|
|
24
|
+
If legacy state exists: move `.slim/cartography.json` to `.slim/codemap.json`, then continue with change detection.
|
|
25
|
+
|
|
26
|
+
If `.slim/codemap.json` exists: Skip to Step 3 (Detect Changes) - no need to re-initialize.
|
|
27
|
+
|
|
28
|
+
If neither file exists: Continue to Step 2 (Initialize).
|
|
29
|
+
|
|
30
|
+
### Step 2: Initialize (Only if no state exists)
|
|
31
|
+
|
|
32
|
+
1. **Analyze the repository structure** - List files, understand directories
|
|
33
|
+
2. **Infer patterns** for **core code/config files ONLY** to include:
|
|
34
|
+
- **Include**: `src/**/*.ts`, `package.json`, etc.
|
|
35
|
+
- **Exclude (MANDATORY)**: Do NOT include tests, documentation, or translations.
|
|
36
|
+
- Tests: `**/*.test.ts`, `**/*.spec.ts`, `tests/**`, `__tests__/**`
|
|
37
|
+
- Docs: `docs/**`, `*.md` (except root `README.md` if needed), `LICENSE`
|
|
38
|
+
- Build/Deps: `node_modules/**`, `dist/**`, `build/**`, `*.min.js`
|
|
39
|
+
- Respect `.gitignore` automatically
|
|
40
|
+
3. **Run codemap.mjs init**:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
node ~/.config/opencode/skills/codemap/scripts/codemap.mjs init \
|
|
44
|
+
--root ./ \
|
|
45
|
+
--include "src/**/*.ts" \
|
|
46
|
+
--exclude "**/*.test.ts" --exclude "dist/**" --exclude "node_modules/**"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This creates:
|
|
50
|
+
- `.slim/codemap.json` - File and folder hashes for change detection
|
|
51
|
+
- Empty `codemap.md` files in all relevant subdirectories
|
|
52
|
+
|
|
53
|
+
4. **Delegate codemap writing to Implementer agents** - Spawn one implementer per folder to read code and create or update its specific `codemap.md` file.
|
|
54
|
+
|
|
55
|
+
### Step 3: Detect Changes (If state already exists)
|
|
56
|
+
|
|
57
|
+
1. **Run codemap.mjs changes** to see what changed:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
node ~/.config/opencode/skills/codemap/scripts/codemap.mjs changes \
|
|
61
|
+
--root ./
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. **Review the output** - It shows:
|
|
65
|
+
- Added files
|
|
66
|
+
- Removed files
|
|
67
|
+
- Modified files
|
|
68
|
+
- Affected folders
|
|
69
|
+
|
|
70
|
+
3. **Only update affected codemaps** - Spawn one implementer per affected folder to update its `codemap.md`.
|
|
71
|
+
4. **Run update** to save new state:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
node ~/.config/opencode/skills/codemap/scripts/codemap.mjs update \
|
|
75
|
+
--root ./
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 4: Finalize Repository Atlas (Root Codemap)
|
|
79
|
+
|
|
80
|
+
Once all specific directories are mapped, the Orchestrator must create or update the root `codemap.md`. This file serves as the **Master Entry Point** for any agent or human entering the repository.
|
|
81
|
+
|
|
82
|
+
1. **Map Root Assets**: Document the root-level files (e.g., `package.json`, `index.ts`, `plugin.json`) and the project's overall purpose.
|
|
83
|
+
2. **Aggregate Sub-Maps**: Create a "Repository Directory Map" section. For every folder that has a `codemap.md`, extract its **Responsibility** summary and include it in a table or list in the root map.
|
|
84
|
+
3. **Cross-Reference**: Ensure that the root map contains the absolute or relative paths to the sub-maps so agents can jump directly to the relevant details.
|
|
85
|
+
|
|
86
|
+
### Step 5: Register Codemap in AGENTS.md
|
|
87
|
+
|
|
88
|
+
**OpenCode auto-loads `AGENTS.md` into agent context on every session.** To ensure agents automatically discover and use the codemap, update (or create) `AGENTS.md` at the repo root:
|
|
89
|
+
|
|
90
|
+
1. If `AGENTS.md` already exists and already contains a `## Repository Map` section, **skip this step** — the reference is already set up.
|
|
91
|
+
2. If `AGENTS.md` exists but has no `## Repository Map` section, **append** the section below.
|
|
92
|
+
3. If `AGENTS.md` doesn't exist, **create** it with the section below.
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
## Repository Map
|
|
96
|
+
|
|
97
|
+
A full codemap is available at `codemap.md` in the project root.
|
|
98
|
+
|
|
99
|
+
Before working on any task, read `codemap.md` to understand:
|
|
100
|
+
- Project architecture and entry points
|
|
101
|
+
- Directory responsibilities and design patterns
|
|
102
|
+
- Data flow and integration points between modules
|
|
103
|
+
|
|
104
|
+
For deep work on a specific folder, also read that folder's `codemap.md`.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
This is idempotent — repeated codemap runs will detect the existing section and skip. No duplication.
|
|
108
|
+
|
|
109
|
+
## Codemap Content
|
|
110
|
+
|
|
111
|
+
Implementers are responsible for writing `codemap.md` files during this workflow. Use precise technical terminology to document the implementation:
|
|
112
|
+
|
|
113
|
+
- **Responsibility** - Define the specific role of this directory using standard software engineering terms (e.g., "Service Layer", "Data Access Object", "Middleware").
|
|
114
|
+
- **Design Patterns** - Identify and name specific patterns used (e.g., "Observer", "Singleton", "Factory", "Strategy"). Detail the abstractions and interfaces.
|
|
115
|
+
- **Data & Control Flow** - Explicitly trace how data enters and leaves the module. Mention specific function call sequences and state transitions.
|
|
116
|
+
- **Integration Points** - List dependencies and consumer modules. Use technical names for hooks, events, or API endpoints.
|
|
117
|
+
|
|
118
|
+
Example codemap:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
# src/agents/
|
|
122
|
+
|
|
123
|
+
## Responsibility
|
|
124
|
+
Defines agent personalities and manages their configuration lifecycle.
|
|
125
|
+
|
|
126
|
+
## Design
|
|
127
|
+
Each agent is a prompt + permission set. Config system uses:
|
|
128
|
+
- Default prompts (orchestrator.ts, researcher.ts, etc.)
|
|
129
|
+
- User overrides from ~/.config/opencode/agent-forge.json
|
|
130
|
+
- Permission wildcards for skill/MCP access control
|
|
131
|
+
|
|
132
|
+
## Flow
|
|
133
|
+
1. Plugin loads → calls getAgentConfigs()
|
|
134
|
+
2. Reads user config preset
|
|
135
|
+
3. Merges defaults with overrides
|
|
136
|
+
4. Applies permission rules (wildcard expansion)
|
|
137
|
+
5. Returns agent configs to OpenCode
|
|
138
|
+
|
|
139
|
+
## Integration
|
|
140
|
+
- Consumed by: Main plugin (src/index.ts)
|
|
141
|
+
- Depends on: Config loader, skills registry
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Example **Root Codemap (Atlas)**:
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
# Repository Atlas: agent-forge
|
|
148
|
+
|
|
149
|
+
## Project Responsibility
|
|
150
|
+
A high-performance, low-latency agent orchestration plugin for OpenCode, focusing on specialized sub-agent delegation and multiplexer-assisted child sessions.
|
|
151
|
+
|
|
152
|
+
## System Entry Points
|
|
153
|
+
- `src/index.ts`: Plugin initialization and OpenCode integration.
|
|
154
|
+
- `package.json`: Dependency manifest and build scripts.
|
|
155
|
+
- `agent-forge.json`: User configuration schema.
|
|
156
|
+
|
|
157
|
+
## Directory Map (Aggregated)
|
|
158
|
+
| Directory | Responsibility Summary | Detailed Map |
|
|
159
|
+
|-----------|------------------------|--------------|
|
|
160
|
+
| `src/agents/` | Defines agent personalities (Orchestrator, Researcher) and manages model routing. | [View Map](src/agents/codemap.md) |
|
|
161
|
+
| `src/features/` | Core logic for tmux integration and session state. | [View Map](src/features/codemap.md) |
|
|
162
|
+
| `src/config/` | Implements the configuration loading pipeline and environment variable injection. | [View Map](src/config/codemap.md) |
|
|
163
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# src/skills/codemap/
|
|
2
|
+
|
|
3
|
+
## Responsibility
|
|
4
|
+
|
|
5
|
+
- Provide a command-style skill package that standardizes repository mapping workflows for unfamiliar codebases.
|
|
6
|
+
- Define the task contract used by Orchestrator/implementer agents via `SKILL.md` and operational guidance via `README.md`.
|
|
7
|
+
- Generate and evolve change-aware codemap state artifacts (`.slim/codemap.json`) and scaffold placeholders (`codemap.md`).
|
|
8
|
+
|
|
9
|
+
## Design
|
|
10
|
+
|
|
11
|
+
- Contract layer: `SKILL.md` (machine prompt contract) + `README.md` (human-facing operation notes).
|
|
12
|
+
- Execution layer: `scripts/codemap.mjs` exports deterministic helper functions:
|
|
13
|
+
- `parseArgs(argv)`
|
|
14
|
+
- `cmdInit`, `cmdChanges`, `cmdUpdate`
|
|
15
|
+
- `selectFiles`, `computeFileHash`, `computeFolderHash`, `createEmptyCodemap`
|
|
16
|
+
- `loadState`, `saveState`, `migrateLegacyState`
|
|
17
|
+
- Persistence model: JSON state at `.slim/codemap.json` with `metadata`, `file_hashes`, and `folder_hashes`.
|
|
18
|
+
- Testing layer: `scripts/codemap.test.ts` validates pattern matching, hash determinism, and migration behavior.
|
|
19
|
+
- The script intentionally avoids network and mutates only filesystem-local state and codemap templates.
|
|
20
|
+
|
|
21
|
+
## Flow
|
|
22
|
+
|
|
23
|
+
- Entry point `main(argv)` parses command and arguments (`init|changes|update`, `--root`, `--include`, `--exclude`, `--exception`) and dispatches via strict branches.
|
|
24
|
+
- `cmdInit()` computes include/exclude candidate sets using `selectFiles()` and writes:
|
|
25
|
+
1) `.slim/codemap.json` via `saveState()`
|
|
26
|
+
2) one `codemap.md` per discovered folder via `createEmptyCodemap()`.
|
|
27
|
+
- `cmdChanges()` reloads state (`loadState()` + `migrateLegacyState()`), recomputes current hashes, emits added/removed/modified diffs and affected folder list, and exits non-zero if state is absent.
|
|
28
|
+
- `cmdUpdate()` recomputes full state from existing metadata and persists it, used after targeted fixers finish updates.
|
|
29
|
+
- `codemap` skill invocation path in SKILL workflow is explicit: Step 1 checks `.slim/codemap.json` or `.slim/cartography.json`, then Step 2/3 selects init or incremental path.
|
|
30
|
+
|
|
31
|
+
## Integration
|
|
32
|
+
|
|
33
|
+
- Installed under OpenCode through `src/cli/custom-skills.ts` as `name: 'codemap'`, `sourcePath: 'src/skills/codemap'`.
|
|
34
|
+
- `src/cli/install.ts` copies this directory into the user skill directory; OpenCode executes `scripts/codemap.mjs` from that context.
|
|
35
|
+
- `src/hooks/filter-available-skills/index.ts` applies agent-level skill gating via names from `getSkillPermissionsForAgent()`.
|
|
36
|
+
- `scripts/verify-release-artifact.ts` includes codemap skill metadata and runtime checks as required packaged files.
|
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import {
|
|
5
|
+
existsSync,
|
|
6
|
+
mkdirSync,
|
|
7
|
+
readdirSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
renameSync,
|
|
10
|
+
statSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
} from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
export const VERSION = '1.0.0';
|
|
17
|
+
export const STATE_DIR = '.slim';
|
|
18
|
+
export const STATE_FILE = 'codemap.json';
|
|
19
|
+
export const LEGACY_STATE_FILE = 'cartography.json';
|
|
20
|
+
export const CODEMAP_FILE = 'codemap.md';
|
|
21
|
+
|
|
22
|
+
export class PatternMatcher {
|
|
23
|
+
regex;
|
|
24
|
+
|
|
25
|
+
constructor(patterns) {
|
|
26
|
+
if (!patterns.length) {
|
|
27
|
+
this.regex = null;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const regexParts = patterns.map((pattern) => {
|
|
32
|
+
let reg = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
33
|
+
reg = reg.replace(/\\\*\\\*\//g, '(?:.*/)?');
|
|
34
|
+
reg = reg.replace(/\\\*\\\*/g, '.*');
|
|
35
|
+
reg = reg.replace(/\\\*/g, '[^/]*');
|
|
36
|
+
reg = reg.replace(/\\\?/g, '.');
|
|
37
|
+
|
|
38
|
+
if (pattern.endsWith('/')) {
|
|
39
|
+
reg += '.*';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (pattern.startsWith('/')) {
|
|
43
|
+
reg = `^${reg.slice(1)}`;
|
|
44
|
+
} else {
|
|
45
|
+
reg = `(?:^|.*/)${reg}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return `(?:${reg}$)`;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
this.regex = new RegExp(regexParts.join('|'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
matches(filePath) {
|
|
55
|
+
if (!this.regex) return false;
|
|
56
|
+
return this.regex.test(filePath);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function loadGitignore(root) {
|
|
61
|
+
const gitignorePath = path.join(root, '.gitignore');
|
|
62
|
+
if (!existsSync(gitignorePath)) return [];
|
|
63
|
+
|
|
64
|
+
return readFileSync(gitignorePath, 'utf8')
|
|
65
|
+
.split('\n')
|
|
66
|
+
.map((line) => line.trim())
|
|
67
|
+
.filter((line) => line && !line.startsWith('#'));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function walkFiles(root) {
|
|
71
|
+
const files = [];
|
|
72
|
+
|
|
73
|
+
function visit(currentDir) {
|
|
74
|
+
for (const entry of readdirSync(currentDir, { withFileTypes: true })) {
|
|
75
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
76
|
+
if (entry.isDirectory()) {
|
|
77
|
+
if (!entry.name.startsWith('.')) {
|
|
78
|
+
visit(fullPath);
|
|
79
|
+
}
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (entry.isFile()) {
|
|
84
|
+
files.push(fullPath);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
visit(root);
|
|
90
|
+
return files.sort();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function selectFiles(
|
|
94
|
+
root,
|
|
95
|
+
includePatterns,
|
|
96
|
+
excludePatterns,
|
|
97
|
+
exceptions,
|
|
98
|
+
gitignorePatterns,
|
|
99
|
+
) {
|
|
100
|
+
const includeMatcher = new PatternMatcher(includePatterns);
|
|
101
|
+
const excludeMatcher = new PatternMatcher(excludePatterns);
|
|
102
|
+
const gitignoreMatcher = new PatternMatcher(gitignorePatterns);
|
|
103
|
+
const exceptionSet = new Set(exceptions);
|
|
104
|
+
|
|
105
|
+
return walkFiles(root).filter((fullPath) => {
|
|
106
|
+
let relPath = path.relative(root, fullPath).replaceAll(path.sep, '/');
|
|
107
|
+
if (relPath.startsWith('./')) {
|
|
108
|
+
relPath = relPath.slice(2);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (gitignoreMatcher.matches(relPath)) return false;
|
|
112
|
+
if (excludeMatcher.matches(relPath) && !exceptionSet.has(relPath)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return includeMatcher.matches(relPath) || exceptionSet.has(relPath);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function computeFileHash(filePath) {
|
|
121
|
+
try {
|
|
122
|
+
const buffer = readFileSync(filePath);
|
|
123
|
+
return createHash('md5').update(buffer).digest('hex');
|
|
124
|
+
} catch {
|
|
125
|
+
return '';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function computeFolderHash(folder, fileHashes) {
|
|
130
|
+
const folderFiles = Object.entries(fileHashes)
|
|
131
|
+
.filter(
|
|
132
|
+
([filePath]) =>
|
|
133
|
+
filePath.startsWith(`${folder}/`) ||
|
|
134
|
+
(folder === '.' && !filePath.includes('/')),
|
|
135
|
+
)
|
|
136
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
137
|
+
|
|
138
|
+
if (!folderFiles.length) return '';
|
|
139
|
+
|
|
140
|
+
const hasher = createHash('md5');
|
|
141
|
+
for (const [filePath, hash] of folderFiles) {
|
|
142
|
+
hasher.update(`${filePath}:${hash}\n`);
|
|
143
|
+
}
|
|
144
|
+
return hasher.digest('hex');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function getFoldersWithFiles(files, root) {
|
|
148
|
+
const folders = new Set(['.']);
|
|
149
|
+
|
|
150
|
+
for (const filePath of files) {
|
|
151
|
+
const relPath = path.relative(root, filePath).replaceAll(path.sep, '/');
|
|
152
|
+
const parts = relPath.split('/').slice(0, -1);
|
|
153
|
+
for (let i = 0; i < parts.length; i++) {
|
|
154
|
+
folders.add(parts.slice(0, i + 1).join('/'));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return folders;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function migrateLegacyState(root) {
|
|
162
|
+
const stateDir = path.join(root, STATE_DIR);
|
|
163
|
+
const legacyPath = path.join(stateDir, LEGACY_STATE_FILE);
|
|
164
|
+
const statePath = path.join(stateDir, STATE_FILE);
|
|
165
|
+
|
|
166
|
+
if (existsSync(statePath) || !existsSync(legacyPath)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
mkdirSync(stateDir, { recursive: true });
|
|
171
|
+
renameSync(legacyPath, statePath);
|
|
172
|
+
console.log(
|
|
173
|
+
`Migrated ${STATE_DIR}/${LEGACY_STATE_FILE} -> ${STATE_DIR}/${STATE_FILE}`,
|
|
174
|
+
);
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function loadState(root) {
|
|
179
|
+
migrateLegacyState(root);
|
|
180
|
+
const statePath = path.join(root, STATE_DIR, STATE_FILE);
|
|
181
|
+
if (!existsSync(statePath)) return null;
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
return JSON.parse(readFileSync(statePath, 'utf8'));
|
|
185
|
+
} catch {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function saveState(root, state) {
|
|
191
|
+
const stateDir = path.join(root, STATE_DIR);
|
|
192
|
+
mkdirSync(stateDir, { recursive: true });
|
|
193
|
+
writeFileSync(
|
|
194
|
+
path.join(stateDir, STATE_FILE),
|
|
195
|
+
`${JSON.stringify(state, null, 2)}\n`,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function createEmptyCodemap(folderPath, folderName) {
|
|
200
|
+
const codemapPath = path.join(folderPath, CODEMAP_FILE);
|
|
201
|
+
if (existsSync(codemapPath)) return;
|
|
202
|
+
|
|
203
|
+
const content = `# ${folderName}/
|
|
204
|
+
|
|
205
|
+
<!-- Fixer: Fill in this section with architectural understanding -->
|
|
206
|
+
|
|
207
|
+
## Responsibility
|
|
208
|
+
|
|
209
|
+
<!-- What is this folder's job in the system? -->
|
|
210
|
+
|
|
211
|
+
## Design
|
|
212
|
+
|
|
213
|
+
<!-- Key patterns, abstractions, architectural decisions -->
|
|
214
|
+
|
|
215
|
+
## Flow
|
|
216
|
+
|
|
217
|
+
<!-- How does data/control flow through this module? -->
|
|
218
|
+
|
|
219
|
+
## Integration
|
|
220
|
+
|
|
221
|
+
<!-- How does it connect to other parts of the system? -->
|
|
222
|
+
`;
|
|
223
|
+
|
|
224
|
+
writeFileSync(codemapPath, content);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function buildState(
|
|
228
|
+
root,
|
|
229
|
+
includePatterns,
|
|
230
|
+
excludePatterns,
|
|
231
|
+
exceptions,
|
|
232
|
+
selectedFiles,
|
|
233
|
+
) {
|
|
234
|
+
const fileHashes = {};
|
|
235
|
+
for (const filePath of selectedFiles) {
|
|
236
|
+
const relPath = path.relative(root, filePath).replaceAll(path.sep, '/');
|
|
237
|
+
fileHashes[relPath] = computeFileHash(filePath);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const folders = getFoldersWithFiles(selectedFiles, root);
|
|
241
|
+
const folderHashes = {};
|
|
242
|
+
for (const folder of folders) {
|
|
243
|
+
folderHashes[folder] = computeFolderHash(folder, fileHashes);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const state = {
|
|
247
|
+
metadata: {
|
|
248
|
+
version: VERSION,
|
|
249
|
+
last_run: new Date().toISOString(),
|
|
250
|
+
root,
|
|
251
|
+
include_patterns: includePatterns,
|
|
252
|
+
exclude_patterns: excludePatterns,
|
|
253
|
+
exceptions,
|
|
254
|
+
},
|
|
255
|
+
file_hashes: fileHashes,
|
|
256
|
+
folder_hashes: folderHashes,
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return { state, folders };
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function cmdInit({ root, include = [], exclude = [], exception = [] }) {
|
|
263
|
+
const resolvedRoot = path.resolve(root);
|
|
264
|
+
if (!existsSync(resolvedRoot) || !statSync(resolvedRoot).isDirectory()) {
|
|
265
|
+
console.error(`Error: ${resolvedRoot} is not a directory`);
|
|
266
|
+
return 1;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const includePatterns = include.length ? include : ['**/*'];
|
|
270
|
+
const excludePatterns = exclude;
|
|
271
|
+
const exceptions = exception;
|
|
272
|
+
const gitignore = loadGitignore(resolvedRoot);
|
|
273
|
+
|
|
274
|
+
console.log(`Scanning ${resolvedRoot}...`);
|
|
275
|
+
console.log(`Include patterns: ${JSON.stringify(includePatterns)}`);
|
|
276
|
+
console.log(`Exclude patterns: ${JSON.stringify(excludePatterns)}`);
|
|
277
|
+
console.log(`Exceptions: ${JSON.stringify(exceptions)}`);
|
|
278
|
+
|
|
279
|
+
const selectedFiles = selectFiles(
|
|
280
|
+
resolvedRoot,
|
|
281
|
+
includePatterns,
|
|
282
|
+
excludePatterns,
|
|
283
|
+
exceptions,
|
|
284
|
+
gitignore,
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
console.log(`Selected ${selectedFiles.length} files`);
|
|
288
|
+
|
|
289
|
+
const { state, folders } = buildState(
|
|
290
|
+
resolvedRoot,
|
|
291
|
+
includePatterns,
|
|
292
|
+
excludePatterns,
|
|
293
|
+
exceptions,
|
|
294
|
+
selectedFiles,
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
saveState(resolvedRoot, state);
|
|
298
|
+
console.log(`Created ${STATE_DIR}/${STATE_FILE}`);
|
|
299
|
+
|
|
300
|
+
for (const folder of folders) {
|
|
301
|
+
const folderPath =
|
|
302
|
+
folder === '.' ? resolvedRoot : path.join(resolvedRoot, folder);
|
|
303
|
+
const folderName = folder === '.' ? path.basename(resolvedRoot) : folder;
|
|
304
|
+
createEmptyCodemap(folderPath, folderName);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
console.log(`Created ${folders.size} empty codemap.md files`);
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export function cmdChanges({ root }) {
|
|
312
|
+
const resolvedRoot = path.resolve(root);
|
|
313
|
+
const state = loadState(resolvedRoot);
|
|
314
|
+
if (!state) {
|
|
315
|
+
console.error("No codemap state found. Run 'init' first.");
|
|
316
|
+
return 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const metadata = state.metadata ?? {};
|
|
320
|
+
const includePatterns = metadata.include_patterns ?? ['**/*'];
|
|
321
|
+
const excludePatterns = metadata.exclude_patterns ?? [];
|
|
322
|
+
const exceptions = metadata.exceptions ?? [];
|
|
323
|
+
const gitignore = loadGitignore(resolvedRoot);
|
|
324
|
+
|
|
325
|
+
const currentFiles = selectFiles(
|
|
326
|
+
resolvedRoot,
|
|
327
|
+
includePatterns,
|
|
328
|
+
excludePatterns,
|
|
329
|
+
exceptions,
|
|
330
|
+
gitignore,
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
const currentHashes = Object.fromEntries(
|
|
334
|
+
currentFiles.map((filePath) => [
|
|
335
|
+
path.relative(resolvedRoot, filePath).replaceAll(path.sep, '/'),
|
|
336
|
+
computeFileHash(filePath),
|
|
337
|
+
]),
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
const savedHashes = state.file_hashes ?? {};
|
|
341
|
+
const currentPaths = new Set(Object.keys(currentHashes));
|
|
342
|
+
const savedPaths = new Set(Object.keys(savedHashes));
|
|
343
|
+
|
|
344
|
+
const added = [...currentPaths]
|
|
345
|
+
.filter((filePath) => !savedPaths.has(filePath))
|
|
346
|
+
.sort();
|
|
347
|
+
const removed = [...savedPaths]
|
|
348
|
+
.filter((filePath) => !currentPaths.has(filePath))
|
|
349
|
+
.sort();
|
|
350
|
+
const modified = [...currentPaths]
|
|
351
|
+
.filter((filePath) => savedPaths.has(filePath))
|
|
352
|
+
.filter((filePath) => currentHashes[filePath] !== savedHashes[filePath])
|
|
353
|
+
.sort();
|
|
354
|
+
|
|
355
|
+
if (!added.length && !removed.length && !modified.length) {
|
|
356
|
+
console.log('No changes detected.');
|
|
357
|
+
return 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (added.length) {
|
|
361
|
+
console.log(`\n${added.length} added:`);
|
|
362
|
+
for (const filePath of added) console.log(` + ${filePath}`);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (removed.length) {
|
|
366
|
+
console.log(`\n${removed.length} removed:`);
|
|
367
|
+
for (const filePath of removed) console.log(` - ${filePath}`);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (modified.length) {
|
|
371
|
+
console.log(`\n${modified.length} modified:`);
|
|
372
|
+
for (const filePath of modified) console.log(` ~ ${filePath}`);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const affectedFolders = new Set(['.']);
|
|
376
|
+
for (const filePath of [...added, ...removed, ...modified]) {
|
|
377
|
+
const parts = filePath.split('/').slice(0, -1);
|
|
378
|
+
for (let i = 0; i < parts.length; i++) {
|
|
379
|
+
affectedFolders.add(parts.slice(0, i + 1).join('/'));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const sortedFolders = [...affectedFolders].sort();
|
|
384
|
+
console.log(`\n${sortedFolders.length} folders affected:`);
|
|
385
|
+
for (const folder of sortedFolders) {
|
|
386
|
+
console.log(` ${folder}/`);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
return 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export function cmdUpdate({ root }) {
|
|
393
|
+
const resolvedRoot = path.resolve(root);
|
|
394
|
+
const state = loadState(resolvedRoot);
|
|
395
|
+
if (!state) {
|
|
396
|
+
console.error("No codemap state found. Run 'init' first.");
|
|
397
|
+
return 1;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const metadata = state.metadata ?? {};
|
|
401
|
+
const includePatterns = metadata.include_patterns ?? ['**/*'];
|
|
402
|
+
const excludePatterns = metadata.exclude_patterns ?? [];
|
|
403
|
+
const exceptions = metadata.exceptions ?? [];
|
|
404
|
+
const gitignore = loadGitignore(resolvedRoot);
|
|
405
|
+
|
|
406
|
+
const selectedFiles = selectFiles(
|
|
407
|
+
resolvedRoot,
|
|
408
|
+
includePatterns,
|
|
409
|
+
excludePatterns,
|
|
410
|
+
exceptions,
|
|
411
|
+
gitignore,
|
|
412
|
+
);
|
|
413
|
+
|
|
414
|
+
const { state: nextState } = buildState(
|
|
415
|
+
resolvedRoot,
|
|
416
|
+
includePatterns,
|
|
417
|
+
excludePatterns,
|
|
418
|
+
exceptions,
|
|
419
|
+
selectedFiles,
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
saveState(resolvedRoot, nextState);
|
|
423
|
+
console.log(
|
|
424
|
+
`Updated ${STATE_DIR}/${STATE_FILE} with ${selectedFiles.length} files`,
|
|
425
|
+
);
|
|
426
|
+
return 0;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export function parseArgs(argv) {
|
|
430
|
+
const [command, ...rest] = argv;
|
|
431
|
+
const options = { include: [], exclude: [], exception: [] };
|
|
432
|
+
|
|
433
|
+
for (let i = 0; i < rest.length; i++) {
|
|
434
|
+
const arg = rest[i];
|
|
435
|
+
const value = rest[i + 1];
|
|
436
|
+
|
|
437
|
+
if (!arg?.startsWith('--')) continue;
|
|
438
|
+
if (value === undefined || value.startsWith('--')) {
|
|
439
|
+
throw new Error(`Missing value for ${arg}`);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const key = arg.slice(2);
|
|
443
|
+
if (key === 'include' || key === 'exclude' || key === 'exception') {
|
|
444
|
+
options[key].push(value);
|
|
445
|
+
} else if (key === 'root') {
|
|
446
|
+
options.root = value;
|
|
447
|
+
} else {
|
|
448
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
i++;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return { command, options };
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export function main(argv = process.argv.slice(2)) {
|
|
458
|
+
try {
|
|
459
|
+
const { command, options } = parseArgs(argv);
|
|
460
|
+
|
|
461
|
+
if (!command || !options.root) {
|
|
462
|
+
console.error(
|
|
463
|
+
'Usage: codemap.mjs <init|changes|update> --root /path [--include glob] [--exclude glob] [--exception path]',
|
|
464
|
+
);
|
|
465
|
+
return 1;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (command === 'init') return cmdInit(options);
|
|
469
|
+
if (command === 'changes') return cmdChanges(options);
|
|
470
|
+
if (command === 'update') return cmdUpdate(options);
|
|
471
|
+
|
|
472
|
+
console.error(`Unknown command: ${command}`);
|
|
473
|
+
return 1;
|
|
474
|
+
} catch (error) {
|
|
475
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
476
|
+
return 1;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
481
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === currentFilePath) {
|
|
482
|
+
process.exit(main());
|
|
483
|
+
}
|