@fredericboyer/dev-team 0.1.1 → 0.2.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/README.md +128 -0
- package/bin/dev-team.js +1 -21
- package/dist/bin/dev-team.d.ts +1 -0
- package/dist/bin/dev-team.js +28 -0
- package/dist/bin/dev-team.js.map +1 -0
- package/dist/files.d.ts +51 -0
- package/dist/files.js +155 -0
- package/dist/files.js.map +1 -0
- package/dist/init.d.ts +4 -0
- package/dist/init.js +307 -0
- package/dist/init.js.map +1 -0
- package/dist/prompts.d.ts +25 -0
- package/dist/prompts.js +109 -0
- package/dist/prompts.js.map +1 -0
- package/dist/scan.d.ts +15 -0
- package/dist/scan.js +187 -0
- package/dist/scan.js.map +1 -0
- package/dist/update.d.ts +5 -0
- package/dist/update.js +229 -0
- package/dist/update.js.map +1 -0
- package/package.json +30 -9
- package/templates/CLAUDE.md +18 -0
- package/templates/agent-memory/dev-team-architect/MEMORY.md +12 -0
- package/templates/agent-memory/dev-team-docs/MEMORY.md +12 -0
- package/templates/agent-memory/dev-team-release/MEMORY.md +12 -0
- package/templates/agents/dev-team-architect.md +62 -0
- package/templates/agents/dev-team-deming.md +2 -1
- package/templates/agents/dev-team-docs.md +63 -0
- package/templates/agents/dev-team-release.md +65 -0
- package/templates/hooks/dev-team-post-change-review.js +63 -10
- package/templates/hooks/dev-team-pre-commit-gate.js +12 -14
- package/templates/hooks/dev-team-safety-guard.js +21 -11
- package/templates/hooks/dev-team-task-loop.js +17 -9
- package/templates/hooks/dev-team-tdd-enforce.js +42 -23
- package/templates/skills/dev-team-audit/SKILL.md +85 -0
- package/templates/skills/dev-team-review/SKILL.md +68 -0
- package/lib/files.js +0 -160
- package/lib/init.js +0 -206
- package/lib/prompts.js +0 -123
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# dev-team
|
|
2
|
+
|
|
3
|
+
Adversarial AI agent team for any project. Installs [Claude Code](https://claude.ai/claude-code) agents, hooks, and skills that enforce quality through productive friction.
|
|
4
|
+
|
|
5
|
+
Instead of an AI that agrees with everything, dev-team gives you six opinionated specialists that challenge each other — and you.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @fredericboyer/dev-team init # Interactive wizard
|
|
11
|
+
npx @fredericboyer/dev-team init --all # Everything, no prompts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Requires Node.js 18+ and Claude Code.
|
|
15
|
+
|
|
16
|
+
## What you get
|
|
17
|
+
|
|
18
|
+
### Agents
|
|
19
|
+
|
|
20
|
+
| Agent | Role | When to use |
|
|
21
|
+
|-------|------|-------------|
|
|
22
|
+
| `@dev-team-voss` | Backend Engineer | API design, data modeling, system architecture, error handling |
|
|
23
|
+
| `@dev-team-mori` | Frontend/UI Engineer | Components, accessibility, UX patterns, state management |
|
|
24
|
+
| `@dev-team-szabo` | Security Auditor | Vulnerability review, auth flows, attack surface analysis |
|
|
25
|
+
| `@dev-team-knuth` | Quality Auditor | Coverage gaps, boundary conditions, correctness verification |
|
|
26
|
+
| `@dev-team-beck` | Test Implementer | Writing tests, TDD cycles, translating audit findings into test cases |
|
|
27
|
+
| `@dev-team-deming` | Tooling Optimizer | Linters, formatters, CI/CD, hooks, onboarding, automation |
|
|
28
|
+
|
|
29
|
+
Szabo and Knuth use Opus (deep analysis, read-only). Voss, Mori, Beck, and Deming use Sonnet (implementation, full access).
|
|
30
|
+
|
|
31
|
+
### Hooks
|
|
32
|
+
|
|
33
|
+
| Hook | Trigger | What it does |
|
|
34
|
+
|------|---------|-------------|
|
|
35
|
+
| Safety guard | Before Bash commands | Blocks dangerous commands (`rm -rf`, `chmod 777`, force push to main, `DROP TABLE/DATABASE`, `curl\|sh`, and others) |
|
|
36
|
+
| TDD enforcement | After file edits | Blocks implementation changes when no corresponding test file exists and no tests were modified in the session |
|
|
37
|
+
| Post-change review | After file edits | Routes files to domain agents for review (security → Szabo, API → Mori, infra → Voss, tooling → Deming, code → Knuth). Advisory, does not block. |
|
|
38
|
+
| Pre-commit gate | On task completion | Reminds about running review agents before committing. Advisory, does not block. |
|
|
39
|
+
| Task loop | On stop | Manages iterative task loop with adversarial review gates |
|
|
40
|
+
|
|
41
|
+
All hooks are Node.js scripts — work on macOS, Linux, and Windows.
|
|
42
|
+
|
|
43
|
+
### Skills
|
|
44
|
+
|
|
45
|
+
| Skill | What it does |
|
|
46
|
+
|-------|-------------|
|
|
47
|
+
| `/dev-team:challenge` | Critically examine a proposal, approach, or implementation |
|
|
48
|
+
| `/dev-team:task` | Start an iterative task loop with adversarial review gates |
|
|
49
|
+
|
|
50
|
+
### Challenge protocol
|
|
51
|
+
|
|
52
|
+
Agents challenge each other using classified findings:
|
|
53
|
+
|
|
54
|
+
- **[DEFECT]** — Concretely wrong. Blocks progress.
|
|
55
|
+
- **[RISK]** — Not wrong today, but creates a likely failure mode. Advisory.
|
|
56
|
+
- **[QUESTION]** — Decision needs justification. Advisory.
|
|
57
|
+
- **[SUGGESTION]** — Works, but here's a specific improvement. Advisory.
|
|
58
|
+
|
|
59
|
+
Rules: concrete evidence required, one exchange before escalation, human decides disputes.
|
|
60
|
+
|
|
61
|
+
## How it works
|
|
62
|
+
|
|
63
|
+
### Task loop (`/dev-team:task`)
|
|
64
|
+
|
|
65
|
+
For non-trivial work, the task loop enforces quality convergence:
|
|
66
|
+
|
|
67
|
+
1. Implementing agent works on the task
|
|
68
|
+
2. Review agents challenge in parallel
|
|
69
|
+
3. If any `[DEFECT]` found → loop continues with fixes
|
|
70
|
+
4. If no `[DEFECT]` remains → done
|
|
71
|
+
5. Max iterations (default: 10) as safety cap
|
|
72
|
+
|
|
73
|
+
The implementing agent can't declare "done" alone — the adversarial review is the quality gate.
|
|
74
|
+
|
|
75
|
+
### Agent memory
|
|
76
|
+
|
|
77
|
+
Each agent maintains persistent memory (`.claude/agent-memory/<agent>/MEMORY.md`) that calibrates over time:
|
|
78
|
+
|
|
79
|
+
- Project-specific patterns and conventions
|
|
80
|
+
- What challenges were accepted vs. overruled
|
|
81
|
+
- Quality benchmarks learned from the codebase
|
|
82
|
+
|
|
83
|
+
Shared team learnings are stored in `.claude/dev-team-learnings.md`.
|
|
84
|
+
|
|
85
|
+
## Customization
|
|
86
|
+
|
|
87
|
+
After installation, you can:
|
|
88
|
+
|
|
89
|
+
- **Edit agent prompts** in `.claude/agents/` to adjust focus areas or challenge style
|
|
90
|
+
- **Disable hooks** by removing entries from `.claude/settings.json`
|
|
91
|
+
- **Add your own agents** following the same frontmatter format
|
|
92
|
+
- **Tune agent memory** in `.claude/agent-memory/` to accelerate calibration
|
|
93
|
+
|
|
94
|
+
## What gets installed
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
.claude/
|
|
98
|
+
agents/ # Agent definitions (YAML frontmatter + prompt)
|
|
99
|
+
hooks/ # Quality enforcement scripts
|
|
100
|
+
skills/ # Skill definitions
|
|
101
|
+
agent-memory/ # Per-agent persistent memory
|
|
102
|
+
settings.json # Hook configuration
|
|
103
|
+
CLAUDE.md # Project instructions (dev-team section added via markers)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Contributing
|
|
107
|
+
|
|
108
|
+
1. Every piece of work starts with a [GitHub Issue](https://github.com/fredericboyer/dev-team/issues)
|
|
109
|
+
2. Branch naming: `feat/123-description` or `fix/456-description`
|
|
110
|
+
3. Commits reference issues: `fixes #123` or `refs #123`
|
|
111
|
+
4. All merges via PR — no direct pushes to main
|
|
112
|
+
5. Run `npm test` before pushing
|
|
113
|
+
|
|
114
|
+
### Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install # Install dependencies (dev only, zero runtime deps)
|
|
118
|
+
npm run build # Compile TypeScript
|
|
119
|
+
npm test # Build + run all tests
|
|
120
|
+
npm run lint # Run oxlint
|
|
121
|
+
npm run format # Run oxfmt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Architecture decisions are documented in `docs/adr/`.
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
package/bin/dev-team.js
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
const { run } = require('../lib/init');
|
|
6
|
-
|
|
7
|
-
const args = process.argv.slice(2);
|
|
8
|
-
const command = args[0];
|
|
9
|
-
|
|
10
|
-
if (command === 'init') {
|
|
11
|
-
run(process.cwd(), args.slice(1)).catch((err) => {
|
|
12
|
-
console.error(`Error: ${err.message}`);
|
|
13
|
-
process.exit(1);
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
console.log('dev-team — Adversarial AI agent team for any project\n');
|
|
17
|
-
console.log('Usage:');
|
|
18
|
-
console.log(' npx dev-team init Interactive onboarding wizard');
|
|
19
|
-
console.log(' npx dev-team init --all Install everything with defaults');
|
|
20
|
-
console.log('');
|
|
21
|
-
process.exit(command === '--help' || command === '-h' ? 0 : 1);
|
|
22
|
-
}
|
|
2
|
+
require("../dist/bin/dev-team.js");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const init_1 = require("../init");
|
|
4
|
+
const update_1 = require("../update");
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const command = args[0];
|
|
7
|
+
if (command === "init") {
|
|
8
|
+
(0, init_1.run)(process.cwd(), args.slice(1)).catch((err) => {
|
|
9
|
+
console.error(`Error: ${err.message}`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
else if (command === "update") {
|
|
14
|
+
(0, update_1.update)(process.cwd()).catch((err) => {
|
|
15
|
+
console.error(`Error: ${err.message}`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
console.log("dev-team — Adversarial AI agent team for any project\n");
|
|
21
|
+
console.log("Usage:");
|
|
22
|
+
console.log(" npx dev-team init Interactive onboarding wizard");
|
|
23
|
+
console.log(" npx dev-team init --all Install everything with defaults");
|
|
24
|
+
console.log(" npx dev-team update Update agents, hooks, and skills to latest");
|
|
25
|
+
console.log("");
|
|
26
|
+
process.exit(command === "--help" || command === "-h" ? 0 : 1);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=dev-team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-team.js","sourceRoot":"","sources":["../../src/bin/dev-team.ts"],"names":[],"mappings":";;AAAA,kCAA8B;AAC9B,sCAAmC;AAEnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAExB,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;IACvB,IAAA,UAAG,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QACrD,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;IAChC,IAAA,eAAM,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QACzC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
package/dist/files.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface HookEntry {
|
|
2
|
+
type: string;
|
|
3
|
+
command: string;
|
|
4
|
+
}
|
|
5
|
+
export interface HookMatcher {
|
|
6
|
+
matcher?: string;
|
|
7
|
+
hooks: HookEntry[];
|
|
8
|
+
}
|
|
9
|
+
export interface HookSettings {
|
|
10
|
+
hooks: Record<string, HookMatcher[]>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the absolute path to the templates/ directory within the package.
|
|
14
|
+
*/
|
|
15
|
+
export declare function templateDir(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Copies a file from src to dest, creating parent directories as needed.
|
|
18
|
+
* Returns true if the file was written.
|
|
19
|
+
*/
|
|
20
|
+
export declare function copyFile(src: string, dest: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a file exists.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fileExists(absPath: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a directory exists.
|
|
27
|
+
*/
|
|
28
|
+
export declare function dirExists(absPath: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Reads a file and returns its content, or null if it doesn't exist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readFile(absPath: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Writes content to a file, creating parent directories as needed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeFile(absPath: string, content: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Deep merges hook configurations from source into target settings.
|
|
39
|
+
* Additive only — never removes existing hooks.
|
|
40
|
+
*/
|
|
41
|
+
export declare function mergeSettings(existingPath: string, newFragment: HookSettings): void;
|
|
42
|
+
/**
|
|
43
|
+
* Appends content to a file with dev-team markers.
|
|
44
|
+
* If markers already exist, replaces content between them.
|
|
45
|
+
* If file doesn't exist, creates it with just the content.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mergeClaudeMd(filePath: string, newContent: string): "created" | "replaced" | "appended";
|
|
48
|
+
/**
|
|
49
|
+
* Lists all files in a directory recursively.
|
|
50
|
+
*/
|
|
51
|
+
export declare function listFilesRecursive(dir: string): string[];
|
package/dist/files.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.templateDir = templateDir;
|
|
7
|
+
exports.copyFile = copyFile;
|
|
8
|
+
exports.fileExists = fileExists;
|
|
9
|
+
exports.dirExists = dirExists;
|
|
10
|
+
exports.readFile = readFile;
|
|
11
|
+
exports.writeFile = writeFile;
|
|
12
|
+
exports.mergeSettings = mergeSettings;
|
|
13
|
+
exports.mergeClaudeMd = mergeClaudeMd;
|
|
14
|
+
exports.listFilesRecursive = listFilesRecursive;
|
|
15
|
+
const fs_1 = __importDefault(require("fs"));
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
/**
|
|
18
|
+
* Returns the absolute path to the templates/ directory within the package.
|
|
19
|
+
*/
|
|
20
|
+
function templateDir() {
|
|
21
|
+
return path_1.default.join(__dirname, "..", "templates");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Copies a file from src to dest, creating parent directories as needed.
|
|
25
|
+
* Returns true if the file was written.
|
|
26
|
+
*/
|
|
27
|
+
function copyFile(src, dest) {
|
|
28
|
+
const dir = path_1.default.dirname(dest);
|
|
29
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
30
|
+
fs_1.default.copyFileSync(src, dest);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Checks if a file exists.
|
|
35
|
+
*/
|
|
36
|
+
function fileExists(absPath) {
|
|
37
|
+
try {
|
|
38
|
+
return fs_1.default.statSync(absPath).isFile();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Checks if a directory exists.
|
|
46
|
+
*/
|
|
47
|
+
function dirExists(absPath) {
|
|
48
|
+
try {
|
|
49
|
+
return fs_1.default.statSync(absPath).isDirectory();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Reads a file and returns its content, or null if it doesn't exist.
|
|
57
|
+
*/
|
|
58
|
+
function readFile(absPath) {
|
|
59
|
+
try {
|
|
60
|
+
return fs_1.default.readFileSync(absPath, "utf-8");
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Writes content to a file, creating parent directories as needed.
|
|
68
|
+
*/
|
|
69
|
+
function writeFile(absPath, content) {
|
|
70
|
+
const dir = path_1.default.dirname(absPath);
|
|
71
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
72
|
+
fs_1.default.writeFileSync(absPath, content);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Deep merges hook configurations from source into target settings.
|
|
76
|
+
* Additive only — never removes existing hooks.
|
|
77
|
+
*/
|
|
78
|
+
function mergeSettings(existingPath, newFragment) {
|
|
79
|
+
let existing = {};
|
|
80
|
+
try {
|
|
81
|
+
existing = JSON.parse(fs_1.default.readFileSync(existingPath, "utf-8"));
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
if (err.code !== "ENOENT") {
|
|
85
|
+
console.warn(`Warning: ${existingPath} exists but is not valid JSON. Starting fresh.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!existing.hooks) {
|
|
89
|
+
existing.hooks = {};
|
|
90
|
+
}
|
|
91
|
+
for (const [event, entries] of Object.entries(newFragment.hooks || {})) {
|
|
92
|
+
if (!existing.hooks[event]) {
|
|
93
|
+
existing.hooks[event] = entries;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// Add entries that don't already exist (by command string)
|
|
97
|
+
for (const newEntry of entries) {
|
|
98
|
+
const newCommands = (newEntry.hooks || []).map((h) => h.command);
|
|
99
|
+
const alreadyExists = existing.hooks[event].some((existingEntry) => {
|
|
100
|
+
const existingCommands = (existingEntry.hooks || []).map((h) => h.command);
|
|
101
|
+
return newCommands.every((cmd) => existingCommands.includes(cmd));
|
|
102
|
+
});
|
|
103
|
+
if (!alreadyExists) {
|
|
104
|
+
existing.hooks[event].push(newEntry);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
fs_1.default.writeFileSync(existingPath, JSON.stringify(existing, null, 2) + "\n");
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Appends content to a file with dev-team markers.
|
|
113
|
+
* If markers already exist, replaces content between them.
|
|
114
|
+
* If file doesn't exist, creates it with just the content.
|
|
115
|
+
*/
|
|
116
|
+
function mergeClaudeMd(filePath, newContent) {
|
|
117
|
+
const BEGIN_MARKER = "<!-- dev-team:begin -->";
|
|
118
|
+
const END_MARKER = "<!-- dev-team:end -->";
|
|
119
|
+
const existing = readFile(filePath);
|
|
120
|
+
if (!existing) {
|
|
121
|
+
writeFile(filePath, newContent);
|
|
122
|
+
return "created";
|
|
123
|
+
}
|
|
124
|
+
if (existing.includes(BEGIN_MARKER)) {
|
|
125
|
+
if (!existing.includes(END_MARKER)) {
|
|
126
|
+
console.warn("Warning: Found dev-team begin marker but no end marker in CLAUDE.md. Appending instead of replacing.");
|
|
127
|
+
writeFile(filePath, existing.trimEnd() + "\n\n" + newContent + "\n");
|
|
128
|
+
return "appended";
|
|
129
|
+
}
|
|
130
|
+
const beforeMarker = existing.substring(0, existing.indexOf(BEGIN_MARKER));
|
|
131
|
+
const afterMarker = existing.substring(existing.indexOf(END_MARKER) + END_MARKER.length);
|
|
132
|
+
writeFile(filePath, beforeMarker + newContent + afterMarker);
|
|
133
|
+
return "replaced";
|
|
134
|
+
}
|
|
135
|
+
writeFile(filePath, existing.trimEnd() + "\n\n" + newContent + "\n");
|
|
136
|
+
return "appended";
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Lists all files in a directory recursively.
|
|
140
|
+
*/
|
|
141
|
+
function listFilesRecursive(dir) {
|
|
142
|
+
const results = [];
|
|
143
|
+
const entries = fs_1.default.readdirSync(dir, { withFileTypes: true });
|
|
144
|
+
for (const entry of entries) {
|
|
145
|
+
const fullPath = path_1.default.join(dir, entry.name);
|
|
146
|
+
if (entry.isDirectory()) {
|
|
147
|
+
results.push(...listFilesRecursive(fullPath));
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
results.push(fullPath);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return results;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":";;;;;AAoBA,kCAEC;AAMD,4BAKC;AAKD,gCAMC;AAKD,8BAMC;AA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