@pasajero_0/agent-stack 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +116 -0
- package/bin/cli.mjs +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +683 -0
- package/dist/index.js.map +1 -0
- package/mcp/catalog.json +42 -0
- package/package.json +61 -0
- package/templates/claude/_TOKENS.md +28 -0
- package/templates/claude/_normative.md +24 -0
- package/templates/claude/agents/code-reviewer.md +78 -0
- package/templates/claude/agents/pattern-scout.md +111 -0
- package/templates/claude/agents/task-analyzer.md +77 -0
- package/templates/claude/agents/test-writer.md +50 -0
- package/templates/claude/commands/reflect.md +25 -0
- package/templates/claude/commands/review.md +25 -0
- package/templates/claude/hooks/guard-bash.sh +19 -0
- package/templates/claude/hooks/guard-file.sh +37 -0
- package/templates/claude/hooks/post-edit-lint.sh +55 -0
- package/templates/claude/hooks/post-edit-verify.sh +71 -0
- package/templates/claude/hooks/session-start-context.sh +57 -0
- package/templates/claude/hooks/stop-flag-reflect.sh +24 -0
- package/templates/claude/rules/README.md +33 -0
- package/templates/claude/skills/ci-testing-patterns.md +22 -0
- package/templates/claude/skills/migration/SKILL.md +35 -0
- package/templates/claude/skills/mr-description/SKILL.md +56 -0
- package/templates/claude/skills/repo-structure.md +22 -0
- package/templates/claude/skills/team-conventions.md +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leonid Malinovsky
|
|
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,116 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# agent-stack
|
|
4
|
+
|
|
5
|
+
CLI that deploys a **Claude Code harness** onto any repository and manages MCP servers. One command
|
|
6
|
+
drops in a battle-tested `.claude/` setup — deterministic guards, session/git context, a disciplined
|
|
7
|
+
migration loop, and scoped subagents — specialized to your project.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @pasajero_0/agent-stack init # no install
|
|
13
|
+
# or
|
|
14
|
+
npm i -g @pasajero_0/agent-stack
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires `git`, `jq`, and (for the verify hook) `python3` on PATH for the deployed hooks to run.
|
|
18
|
+
|
|
19
|
+
## What it deploys
|
|
20
|
+
|
|
21
|
+
`agent-stack generate` (or `init`) writes a `.claude/` tree plus `CLAUDE.md` / `CODEMAP.md`,
|
|
22
|
+
specialized to the detected project (package manager, lockfile, build outputs, default branch, forge):
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
.claude/
|
|
26
|
+
├── settings.json # hook registration + permission allow-list
|
|
27
|
+
├── settings.local.json # read-deny for build/generated noise
|
|
28
|
+
├── hooks/ # 6 deterministic shell hooks (run outside the model)
|
|
29
|
+
│ ├── guard-bash.sh # block `git push` + foreign package managers
|
|
30
|
+
│ ├── guard-file.sh # block edits to generated files / lockfile; confirm .env
|
|
31
|
+
│ ├── session-start-context.sh
|
|
32
|
+
│ ├── stop-flag-reflect.sh
|
|
33
|
+
│ ├── post-edit-lint.sh # self-disables if no linter is installed
|
|
34
|
+
│ └── post-edit-verify.sh # post-apply diff check during migrations
|
|
35
|
+
├── agents/ # task-analyzer, code-reviewer, test-writer, pattern-scout
|
|
36
|
+
├── commands/ # /reflect, /review
|
|
37
|
+
├── skills/ # migration, mr-description, + reference docs
|
|
38
|
+
└── rules/ # EMPTY by design — generate per-repo (see below)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The hooks are the core value: they enforce hard prohibitions at tool-call time and inject context,
|
|
42
|
+
deterministically, regardless of the model.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
| Command | Description |
|
|
47
|
+
|---------|-------------|
|
|
48
|
+
| `agent-stack init` | Wizard: detect environment → deploy harness → optionally install MCP servers |
|
|
49
|
+
| `agent-stack generate` | Deploy the harness into the current repo |
|
|
50
|
+
| `agent-stack sync` | `detect` + `generate` |
|
|
51
|
+
| `agent-stack detect` | Report project context + whether Claude Code is installed |
|
|
52
|
+
| `agent-stack mcp install` | Install MCP servers from the catalog |
|
|
53
|
+
| `agent-stack mcp list` | List configured MCP servers |
|
|
54
|
+
|
|
55
|
+
## After deploying
|
|
56
|
+
|
|
57
|
+
1. **Exclude the harness from git** (it is personal) — add to `.git/info/exclude`:
|
|
58
|
+
```
|
|
59
|
+
.claude/
|
|
60
|
+
CLAUDE.md
|
|
61
|
+
CODEMAP.md
|
|
62
|
+
```
|
|
63
|
+
2. **Generate rules** — `.claude/rules/` ships empty on purpose: path-scoped rules must reflect *your*
|
|
64
|
+
code, not another project's. Open `claude` in the repo and run the **pattern-scout** subagent; it
|
|
65
|
+
drafts rules you review and keep.
|
|
66
|
+
3. **Smoke-test the guards** — a `git push` or a foreign package-manager command should be blocked;
|
|
67
|
+
a normal command should pass.
|
|
68
|
+
|
|
69
|
+
## MCP server catalog
|
|
70
|
+
|
|
71
|
+
Defined in `mcp/catalog.json`, installed via `claude mcp add`:
|
|
72
|
+
|
|
73
|
+
| Server | Description |
|
|
74
|
+
|--------|-------------|
|
|
75
|
+
| GitHub | Issues, PRs, repos |
|
|
76
|
+
| Fetch | Web content as markdown |
|
|
77
|
+
| Memory | Persistent knowledge graph |
|
|
78
|
+
| Sequential Thinking | Structured reasoning |
|
|
79
|
+
|
|
80
|
+
## Architecture
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
agent-stack/
|
|
84
|
+
├── bin/cli.mjs # executable shim → dist/index.js
|
|
85
|
+
├── src/
|
|
86
|
+
│ ├── cli.ts # commander program
|
|
87
|
+
│ ├── commands/ # init, detect, generate, sync, mcp
|
|
88
|
+
│ ├── detect/ # project + harness-param detection
|
|
89
|
+
│ ├── claude/ # harness emitter (templates → .claude/)
|
|
90
|
+
│ ├── mcp/ # MCP catalog loader + installer
|
|
91
|
+
│ └── utils/ # shell helpers, logger
|
|
92
|
+
├── templates/claude/ # harness core (tokenized) — the source of truth
|
|
93
|
+
├── mcp/catalog.json # MCP server catalog
|
|
94
|
+
└── tests/ # vitest unit tests
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`templates/claude/` holds the harness with `{{TOKEN}}` placeholders; the emitter in `src/claude/`
|
|
98
|
+
substitutes values from the detector and writes the tree. This tool targets **Claude Code only**.
|
|
99
|
+
|
|
100
|
+
## Development
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pnpm install # pnpm only — npm/yarn/bun are not supported
|
|
104
|
+
pnpm build
|
|
105
|
+
pnpm test
|
|
106
|
+
pnpm typecheck # the static gate (no linter yet)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Conventions
|
|
110
|
+
|
|
111
|
+
[Conventional Commits](https://www.conventionalcommits.org/) enforced by commitlint + husky
|
|
112
|
+
(`commit-msg`). Default branch `main`; `git push` is manual. GitHub PRs (`gh`).
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT
|
package/bin/cli.mjs
ADDED
package/dist/index.d.ts
ADDED