create-agent-room 1.2.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 (58) hide show
  1. package/README.md +229 -0
  2. package/bin/cli.js +186 -0
  3. package/examples/python-project/.agent-room.json +14 -0
  4. package/examples/python-project/AGENTS.md +32 -0
  5. package/examples/rust-project/.agent-room.json +12 -0
  6. package/examples/rust-project/AGENTS.md +32 -0
  7. package/lib/color.js +31 -0
  8. package/lib/fsutil.js +218 -0
  9. package/lib/init.js +660 -0
  10. package/lib/lint-sessions.js +278 -0
  11. package/lib/metrics.js +190 -0
  12. package/lib/pr.js +176 -0
  13. package/lib/prompt.js +20 -0
  14. package/lib/session-utils.js +213 -0
  15. package/lib/sync.js +138 -0
  16. package/lib/validate.js +179 -0
  17. package/package.json +48 -0
  18. package/templates/.agent-room/anti-patterns.md +22 -0
  19. package/templates/.agent-room/coordination/handoff-protocol.md +60 -0
  20. package/templates/.agent-room/coordination/scope-boundaries.md +57 -0
  21. package/templates/.agent-room/coordination/session-log-format.md +62 -0
  22. package/templates/.agent-room/decisions.md +17 -0
  23. package/templates/.agent-room/guardrails.json +23 -0
  24. package/templates/.agent-room/guardrails.md +56 -0
  25. package/templates/.agent-room/principles.md +306 -0
  26. package/templates/.agent-room/sessions/.gitkeep +4 -0
  27. package/templates/.agent-room/skills/brainstorming.md +64 -0
  28. package/templates/.agent-room/skills/closing-the-loop.md +67 -0
  29. package/templates/.agent-room/skills/systematic-debugging.md +85 -0
  30. package/templates/.agent-room/skills/test-driven-development.md +100 -0
  31. package/templates/.agent-room/skills/verification-before-completion.md +56 -0
  32. package/templates/.agent-room/skills/writing-plans.md +87 -0
  33. package/templates/.agent-room/workflow-classifier.md +127 -0
  34. package/templates/AGENTS.md.tmpl +85 -0
  35. package/templates/adapters/CLAUDE.md.tmpl +38 -0
  36. package/templates/adapters/claude-hooks/close-the-loop-check.js +96 -0
  37. package/templates/adapters/clinerules.tmpl +14 -0
  38. package/templates/adapters/codexrules.tmpl +45 -0
  39. package/templates/adapters/cursorrules.tmpl +14 -0
  40. package/templates/adapters/git-hooks/guardrails-check.js +140 -0
  41. package/templates/adapters/git-hooks/pre-commit.tmpl +43 -0
  42. package/templates/adapters/windsurfrules.tmpl +14 -0
  43. package/templates/docs/plans/.gitkeep +0 -0
  44. package/templates/skill-packs/api-design/api-design.md +152 -0
  45. package/templates/skill-packs/code-review/code-review.md +113 -0
  46. package/templates/skill-packs/database/database-migrations.md +123 -0
  47. package/templates/skill-packs/documentation/documentation.md +155 -0
  48. package/templates/skill-packs/observability/observability.md +128 -0
  49. package/templates/skill-packs/performance/performance-optimization.md +150 -0
  50. package/templates/skill-packs/release/release-management.md +145 -0
  51. package/templates/skill-packs/security/security-principles.md +127 -0
  52. package/templates/skill-packs/testing/integration-testing.md +127 -0
  53. package/templates/stacks/python/.agent-room/skills/python-testing.md +59 -0
  54. package/templates/stacks/python/AGENTS.md.tmpl +35 -0
  55. package/templates/stacks/react/.agent-room/skills/react-component-testing.md +76 -0
  56. package/templates/stacks/react/AGENTS.md.tmpl +37 -0
  57. package/templates/stacks/typescript/.agent-room/skills/typescript-testing.md +63 -0
  58. package/templates/stacks/typescript/AGENTS.md.tmpl +36 -0
package/README.md ADDED
@@ -0,0 +1,229 @@
1
+ # create-agent-room
2
+
3
+ Scaffold an LLM-agent-friendly project structure and governance framework into any new or existing project.
4
+
5
+ `create-agent-room` is a **best-practices scaffolder and analytics engine** for LLM agents. It provides a generic `AGENTS.md` entry point, a principles playbook, a workflow classifier, anti-patterns/decisions logs, and custom multi-agent coordination protocols. It also supports optional thin adapters for Claude Code, Cursor, Windsurf, Cline, Git, and Codex to provide guidance and **optionally enforce** quality and governance.
6
+
7
+ > **Note:** This tool excels at generating initial project structure and post-hoc analytics. Some features are **prescriptive guidance** (documentation) while others are **actively enforced** (e.g., guardrails pre-commit hook, session log validation). See [Feature Categories](#feature-categories) and [CAPABILITIES.md](CAPABILITIES.md) for details on what's enforced vs. guidance.
8
+
9
+ ---
10
+
11
+ ## Features
12
+
13
+ - **Multi-Agent Coordination**: Scaffolds templates for handoffs, scope boundaries, and structured session logs. *[Guidance only; requires human discipline to follow protocols]*
14
+ - **Agent Guardrails**: Defines protected paths, require-approval rules, and forbidden actions via `guardrails.json`. *[Actively enforced via pre-commit hook when Git adapter selected]*
15
+ - **Session Log Format Enforcement**: Validates session logs against required structure via `lint-sessions` command. *[Actively enforced; fails CI if logs malformed]*
16
+ - **Inheritance & Composition**: Composes templates sequentially from base structures, stack-specific files (e.g. Python, React), org-specific conventions (`--org <name>`), and project overrides. *[Framework provided; stack templates must be created or inherited]*
17
+ - **Built-in & External Skill Packs**: Standard templates (testing, security, database-migrations, api-design, code-review, performance, observability, docs) or remote skill packs directly from Git repositories and local paths. *[Documentation and guidance; not executable rules]*
18
+ - **CI Room Validation**: Lint skill YAML frontmatter headers, verify guardrail schemas, and validate session logs in your CI/CD pipelines.
19
+ - **Observability Metrics Dashboard**: Parse and compile analytics (success rates, classifications, file modifications volumes) from agent session logs. *[Post-hoc aggregation; not real-time monitoring]*
20
+ - **PR Description Generator**: Automatically extract Goal, Touched Files, Actions, and Handoff notes from the latest session log to generate standard Pull Request descriptions.
21
+
22
+ ---
23
+
24
+ ## Feature Categories
25
+
26
+ ### 🟢 Actively Enforced Features
27
+ These features actively constrain behavior and will fail/block operations if violated:
28
+
29
+ - **Agent Guardrails** — Pre-commit hook blocks commits to protected paths or with forbidden patterns (optional; requires `--tools git`)
30
+ - **Session Log Validation** — `lint-sessions` command validates all session logs against schema; fails CI with exit code 1 if malformed
31
+ - **Skill Frontmatter Validation** — `validate` command lints skill YAML headers
32
+
33
+ ### 🟡 Prescriptive Guidance (Requires Human Discipline)
34
+ These features provide templates and protocols that agents must choose to follow:
35
+
36
+ - **Workflow Classifier** — Guides agents to tag work as Bug / Enhancement / Feature / Product (not automatically enforced)
37
+ - **Multi-Agent Coordination Protocols** — Handoff, scope, session log format templates exist but agents must follow them manually
38
+ - **Anti-patterns & Decisions Logs** — Require manual updates; no automated enforcement
39
+ - **Principles Playbook** — 12 guidelines for reliable LLM output; agents must apply them
40
+
41
+ ### 🔵 Aspirational/Framework Features
42
+ These provide a framework that requires external setup:
43
+
44
+ - **Stack-Specific Templates** — Inheritance system supports Python, TypeScript, React stacks, but these must be created or provided via `--org` or `--template-source`
45
+ - **Observability Metrics** — Post-hoc aggregation of completed sessions; not real-time monitoring or alerting
46
+ - **Tool Adapters** — Currently supports Claude, Cursor, Windsurf, Cline, Codex, and Git; sync is Claude-only (other tools manually update)
47
+
48
+ ---
49
+
50
+ ## What Requires Human Discipline?
51
+
52
+ Some features depend on agents choosing to follow documented guidance. **There is no automatic enforcement**:
53
+
54
+ - **Workflow Classification** — Agents must tag work as Bug / Enhancement / Feature / Product when creating session logs
55
+ - **Following Coordination Protocols** — Agents must read and follow handoff, scope, and session log format guidelines
56
+ - **Updating Decisions & Anti-patterns Logs** — Agents must manually append learnings; the tool doesn't auto-populate these
57
+ - **Applying Principles** — Agents must read the principles playbook and apply them; the tool provides no real-time guidance
58
+ - **Respecting Tool Rules** — Tool adapters (Claude, Cursor, etc.) provide guidance files, but tools decide whether/how to apply them
59
+
60
+ These features work **only if your team commits to following them**. The tool creates the structure and validation hooks; discipline is external.
61
+
62
+ For comprehensive details on what's enforced, guidance, and aspirational, see [CAPABILITIES.md](CAPABILITIES.md).
63
+
64
+ ---
65
+
66
+ ## Usage
67
+
68
+ ```bash
69
+ # Initialize a new project with all tool adapters, git initialization, and specific skill packs:
70
+ node bin/cli.js init ../my-project --tools claude,cursor,git --git --skill-packs testing,security,observability
71
+
72
+ # Scaffolding using template inheritance (Base -> Python stack -> Acme Org rules):
73
+ node bin/cli.js init . --yes --language python --org acme
74
+
75
+ # Fetching skill packs dynamically from a remote git repository:
76
+ node bin/cli.js init . --yes --skill-packs https://github.com/my-org/custom-skills.git
77
+
78
+ # Run integrity validation on the room (exits with code 1 if files are missing or skill frontmatter is malformed):
79
+ node bin/cli.js validate .
80
+
81
+ # Generate an observability report dashboard based on session logs:
82
+ node bin/cli.js metrics .
83
+
84
+ # Generate a Pull Request description from the latest session log and save it:
85
+ node bin/cli.js pr-desc . --write
86
+ ```
87
+
88
+ **Example: Init Command**
89
+
90
+ ![Create Agent Room Init Output](docs/images/media__1783509718671.png)
91
+
92
+ Once published to npm, the same commands work via `npx`:
93
+
94
+ ```bash
95
+ npx create-agent-room init my-new-project
96
+ npx create-agent-room validate .
97
+ npx create-agent-room metrics .
98
+ npx create-agent-room pr-desc . --write
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Directory Structure
104
+
105
+ ```
106
+ AGENTS.md Generic entry point read by any agent
107
+ .agent-room/
108
+ principles.md 12 playbooks for reliable LLM output
109
+ workflow-classifier.md Bug / Enhancement / Feature / Product routing
110
+ guardrails.md Prose boundaries and constraints (what not to do)
111
+ guardrails.json Machine-readable guardrail rule schema
112
+ anti-patterns.md Append-only negative-knowledge log (starts empty)
113
+ decisions.md Append-only decisions log (starts empty)
114
+ skills/
115
+ brainstorming.md Brainstorming rules, hard-gated
116
+ writing-plans.md Design-to-task plan blueprints
117
+ test-driven-development.md TDD red-green-refactor loop
118
+ systematic-debugging.md Root-cause analysis protocols
119
+ verification-before-completion.md Double-checking results before completion
120
+ closing-the-loop.md Closing out decisions and anti-patterns
121
+ [skill packs] observability.md, api-design.md, database-migrations.md, etc.
122
+ coordination/
123
+ handoff-protocol.md Protocols for serializing state between sessions
124
+ scope-boundaries.md Resource ownership guidelines
125
+ session-log-format.md Layout template for writing session logs
126
+ sessions/ Directory where session logs get saved
127
+ docs/plans/ Where design docs and task plans get saved
128
+ .agent-room.json Project config tracking language, tools, branch, and skill packs
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Subcommands
134
+
135
+ ### 1. `init [target-dir]`
136
+
137
+ Scaffold the agent workspace. If files already exist in the target, they are skipped by default to protect manual edits unless `--force` is specified.
138
+
139
+ ### 2. `sync [target-dir]`
140
+
141
+ Synchronize custom rules from `.agent-room/skills/` directly to `.claude/skills/` mirrors.
142
+
143
+ - Run with `--check` to verify if mirrored rule files are out of date without rewriting them.
144
+ - Sync will automatically skip overwriting files if they have uncommitted manual edits, unless `--force` is used.
145
+
146
+ ### 3. `validate [target-dir]`
147
+
148
+ Performs structural validation and linting on the room. Returns exit code `1` on error:
149
+
150
+ - Asserts presence of all mandatory files and folders (e.g. `AGENTS.md`, `guardrails.md`).
151
+ - Lints skill files under `.agent-room/skills/*.md` to ensure they contain Jekyll-style frontmatter headers (`---`) with valid `name` and `description` attributes.
152
+ - Parses and validates `.agent-room/guardrails.json` schema.
153
+
154
+ **Example: Validation Passed**
155
+
156
+ ![Validation Passed Output](docs/images/media__1783509718049.png)
157
+
158
+ **Example: Validation Failed**
159
+
160
+ ![Validation Failed Output](docs/images/media__1783509718346.png)
161
+
162
+ ### 4. `metrics [target-dir]`
163
+
164
+ Aggregates all JSON and Markdown session logs inside `.agent-room/sessions/` and renders a clean CLI dashboard detailing outcome success rates, task type distributions, and overall file edit volumes.
165
+
166
+ **Example: Metrics Dashboard**
167
+
168
+ ![Agent Session Dashboard](docs/images/media__1783509718617.png)
169
+
170
+ ### 5. `pr-desc [target-dir]`
171
+
172
+ Parses the latest session log inside `.agent-room/sessions/` (based on timestamp filename order) and formats it into a Pull Request description template.
173
+
174
+ - Use `--write` (or `-w`) to output and save it directly to `.agent-room/pr-description.md`.
175
+
176
+ **Example: PR Description Output**
177
+
178
+ ![Pull Request Description](docs/images/media__1783509718632.png)
179
+
180
+ ### 6. `lint-sessions [target-dir]`
181
+
182
+ Validates all session logs in `.agent-room/sessions/` against the required schema (Date, Agent, Classification, Goal, Files touched, Actions taken, Tests run, Decisions, Outcome).
183
+
184
+ - Returns exit code `1` if validation fails (suitable for CI gating)
185
+ - Reports errors (missing required sections) and warnings (invalid classifications, missing files)
186
+
187
+ **Usage in CI:**
188
+
189
+ ```yaml
190
+ - name: Validate Session Logs
191
+ run: npx create-agent-room lint-sessions .
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Options
197
+
198
+ | Flag | Effect |
199
+ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
200
+ | `--name <name>` | Project name substituted into templates (default: target dir name) |
201
+ | `--tools <list>` | Comma-separated: `claude,cursor,windsurf,cline,codex,git,none` (default: prompt) |
202
+ | `--template-source <path>` | Custom templates folder path (default: searches local, home, package) |
203
+ | `--package-manager <name>` | Package manager to use, e.g. npm, poetry, cargo (default: npm) |
204
+ | `--language <name>` | Target project language, e.g. typescript, python, rust (default: javascript) |
205
+ | `--branch <name>` | Default git branch (default: main) |
206
+ | `--skill-packs <list>` | Comma-separated built-in names (`testing`, `security`, `release`, `code-review`, `api-design`, `database`, `performance`, `observability`, `documentation`), Git URLs (`git+ssh://...`), or local directory paths |
207
+ | `--org <name>` | Organization layer directory name to look for during template inheritance overlays |
208
+ | `--git` | Run `git init` and create an initial commit in the target directory |
209
+ | `--force` | Overwrite existing files instead of skipping them |
210
+ | `--write, -w` | Save generated PR description output to `.agent-room/pr-description.md` |
211
+ | `--verbose` | Print detailed stack traces on failure |
212
+ | `-y, --yes` | Skip all prompts, use defaults |
213
+
214
+ ---
215
+
216
+ ## Template Composition & Inheritance
217
+
218
+ `create-agent-room` supports a powerful hierarchical layering mechanism. The overlay resolver will find and inherit files, merging folders in order from lowest-priority to highest-priority:
219
+
220
+ 1. **Packaged Default Templates** (built-in base rules) ✅ Provided
221
+ 2. **Packaged Stack-specific Templates** (e.g. `templates/stacks/python/`) ✅ Provided
222
+ 3. **Global Templates** (`~/.agent-room-templates/base/`) 🔵 User-provided (optional)
223
+ 4. **Global Stack-specific Templates** (`~/.agent-room-templates/stacks/python/`) 🔵 User-provided (optional)
224
+ 5. **Global Org-specific Templates** (`~/.agent-room-templates/org/<org-name>/`) 🔵 User-provided via `--org` (optional)
225
+ 6. **Local Templates** (`.agent-room-templates/` or `--template-source`) 🔵 User-provided (optional)
226
+
227
+ During this overlay process, files in higher-priority folders will overwrite conflicts from lower layers, enabling modular organization-wide guidelines with project-level overrides.
228
+
229
+ **Note:** Layers 3-6 are **aspirational** — the framework supports them, but you must create or provide these templates yourself. Layers 1-2 ship with the package. To use stack inheritance effectively, create your org's stack templates in layer 5 or provide them at project init time.
package/bin/cli.js ADDED
@@ -0,0 +1,186 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('path');
5
+ const { runInit } = require('../lib/init');
6
+ const { runSync } = require('../lib/sync');
7
+ const { runMetrics } = require('../lib/metrics');
8
+ const { runValidate } = require('../lib/validate');
9
+ const { runPrDesc } = require('../lib/pr');
10
+ const { runLintSessions } = require('../lib/lint-sessions');
11
+
12
+ function parseArgs(argv) {
13
+ const args = { _: [] };
14
+ for (let i = 0; i < argv.length; i++) {
15
+ const a = argv[i];
16
+ if (a === '--yes' || a === '-y') {
17
+ args.yes = true;
18
+ } else if (a === '--git') {
19
+ args.git = true;
20
+ } else if (a === '--force') {
21
+ args.force = true;
22
+ } else if (a === '--check' || a === '-c') {
23
+ args.check = true;
24
+ } else if (a === '--verbose') {
25
+ args.verbose = true;
26
+ } else if (a === '--write' || a === '-w') {
27
+ args.write = true;
28
+ } else if (a === '--tools') {
29
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
30
+ args.tools = argv[++i];
31
+ } else {
32
+ throw new Error('Error: --tools option requires a comma-separated list of tools.');
33
+ }
34
+ } else if (a === '--name') {
35
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
36
+ args.name = argv[++i];
37
+ } else {
38
+ throw new Error('Error: --name option requires a project name.');
39
+ }
40
+ } else if (a === '--template-source') {
41
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
42
+ args['template-source'] = argv[++i];
43
+ } else {
44
+ throw new Error('Error: --template-source option requires a directory path.');
45
+ }
46
+ } else if (a === '--package-manager') {
47
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
48
+ args['package-manager'] = argv[++i];
49
+ } else {
50
+ throw new Error('Error: --package-manager option requires a package manager name.');
51
+ }
52
+ } else if (a === '--language') {
53
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
54
+ args.language = argv[++i];
55
+ } else {
56
+ throw new Error('Error: --language option requires a language name.');
57
+ }
58
+ } else if (a === '--branch') {
59
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
60
+ args.branch = argv[++i];
61
+ } else {
62
+ throw new Error('Error: --branch option requires a branch name.');
63
+ }
64
+ } else if (a === '--skill-packs') {
65
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
66
+ args['skill-packs'] = argv[++i];
67
+ } else {
68
+ throw new Error('Error: --skill-packs option requires a comma-separated list of skill packs.');
69
+ }
70
+ } else if (a === '--org') {
71
+ if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
72
+ args.org = argv[++i];
73
+ } else {
74
+ throw new Error('Error: --org option requires an organization name.');
75
+ }
76
+ } else if (a.startsWith('--tools=')) {
77
+ args.tools = a.slice('--tools='.length);
78
+ } else if (a.startsWith('--name=')) {
79
+ args.name = a.slice('--name='.length);
80
+ } else if (a.startsWith('--template-source=')) {
81
+ args['template-source'] = a.slice('--template-source='.length);
82
+ } else if (a.startsWith('--package-manager=')) {
83
+ args['package-manager'] = a.slice('--package-manager='.length);
84
+ } else if (a.startsWith('--language=')) {
85
+ args.language = a.slice('--language='.length);
86
+ } else if (a.startsWith('--branch=')) {
87
+ args.branch = a.slice('--branch='.length);
88
+ } else if (a.startsWith('--skill-packs=')) {
89
+ args['skill-packs'] = a.slice('--skill-packs='.length);
90
+ } else if (a.startsWith('--org=')) {
91
+ args.org = a.slice('--org='.length);
92
+ } else if (a === '--help' || a === '-h' || a === 'help') {
93
+ args.help = true;
94
+ } else if (a.startsWith('-')) {
95
+ throw new Error(`Error: Unknown option: ${a}`);
96
+ } else {
97
+ args._.push(a);
98
+ }
99
+ }
100
+ return args;
101
+ }
102
+
103
+ function printHelp() {
104
+ console.log(`
105
+ create-agent-room - scaffold an LLM-agent-friendly project structure
106
+
107
+ Usage:
108
+ create-agent-room init [target-dir] [options]
109
+ create-agent-room sync [target-dir] [options]
110
+ create-agent-room metrics [target-dir]
111
+ create-agent-room validate [target-dir]
112
+ create-agent-room lint-sessions [target-dir]
113
+ create-agent-room pr-desc [target-dir] [options]
114
+
115
+ Options:
116
+ --name <name> Project name used in templates (default: target dir name)
117
+ --tools <list> Comma-separated: claude,cursor,windsurf,cline,codex,git,none (default: prompt)
118
+ --template-source <path> Custom template folder (default: search local/home/package)
119
+ --package-manager <name> Package manager to use (default: npm)
120
+ --language <name> Language used in project (default: javascript)
121
+ --branch <name> Default branch name (default: main)
122
+ --skill-packs <list> Comma-separated optional skill packs: testing,security,release (default: none)
123
+ --org <name> Organization layer name for template inheritance (default: none)
124
+ --git Run "git init" and create an initial commit in target-dir
125
+ --force Overwrite existing files instead of skipping them
126
+ --check, -c Check if mirrored files are out of sync without writing changes
127
+ --verbose Print detailed stack traces on failure
128
+ --write, -w Save generated PR description to .agent-room/pr-description.md
129
+ -y, --yes Don't prompt; use defaults for anything unspecified
130
+
131
+ Examples:
132
+ create-agent-room init my-new-project --tools claude,cursor,git --git
133
+ create-agent-room init . --yes --language python --package-manager pip --skill-packs testing
134
+ create-agent-room sync . --check
135
+ create-agent-room metrics .
136
+ create-agent-room validate .
137
+ create-agent-room lint-sessions .
138
+ create-agent-room pr-desc . --write
139
+ `);
140
+ }
141
+
142
+ async function main() {
143
+ const argv = process.argv.slice(2);
144
+ const command = argv[0];
145
+ const args = parseArgs(argv.slice(1));
146
+
147
+ if (!command || argv.includes('--help') || argv.includes('-h') || command === 'help') {
148
+ printHelp();
149
+ return;
150
+ }
151
+
152
+ const target = path.resolve(args._[0] || '.');
153
+
154
+ if (command === 'init') {
155
+ await runInit(target, args);
156
+ } else if (command === 'sync') {
157
+ runSync(target, args);
158
+ } else if (command === 'metrics') {
159
+ runMetrics(target, args);
160
+ } else if (command === 'validate') {
161
+ runValidate(target, args);
162
+ } else if (command === 'lint-sessions') {
163
+ runLintSessions(target);
164
+ } else if (command === 'pr-desc') {
165
+ runPrDesc(target, args);
166
+ } else {
167
+ console.error(`Unknown command: ${command}`);
168
+ printHelp();
169
+ process.exitCode = 1;
170
+ }
171
+ }
172
+
173
+ if (require.main === module) {
174
+ const { red } = require('../lib/color');
175
+ main().catch((err) => {
176
+ const isVerbose = process.argv.includes('--verbose');
177
+ if (isVerbose && err && err.stack) {
178
+ console.error(red(err.stack));
179
+ } else {
180
+ console.error(red(err && err.message ? err.message : String(err)));
181
+ }
182
+ process.exitCode = 1;
183
+ });
184
+ }
185
+
186
+ module.exports = { parseArgs };
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "PythonBackend",
3
+ "tools": [
4
+ "claude",
5
+ "git"
6
+ ],
7
+ "language": "python",
8
+ "packageManager": "pipenv",
9
+ "defaultBranch": "main",
10
+ "skillPacks": [
11
+ "testing",
12
+ "security"
13
+ ]
14
+ }
@@ -0,0 +1,32 @@
1
+ # Agent Instructions — PythonBackend
2
+
3
+ This file is the entry point for any AI coding agent working in this repository.
4
+
5
+ ## Read these before doing anything non-trivial
6
+
7
+ - [`.agent-room/principles.md`](.agent-room/principles.md) — how to get reliable output from an LLM.
8
+ - [`.agent-room/workflow-classifier.md`](.agent-room/workflow-classifier.md) — process weight classification.
9
+ - [`.agent-room/anti-patterns.md`](.agent-room/anti-patterns.md) — negative knowledge log.
10
+ - [`.agent-room/decisions.md`](.agent-room/decisions.md) — architectural choices log.
11
+ - [`.agent-room/skills/`](.agent-room/skills/) — brainstorming, writing-plans, TDD, systematic-debugging.
12
+
13
+ ## The default workflow
14
+
15
+ 1. **Classify the work** using `.agent-room/workflow-classifier.md`.
16
+ 2. **Brainstorm before building**: ask clarifying questions, propose 2-3 approaches with trade-offs.
17
+ 3. **Use TDD**: write a failing test in pytest, watch it fail, implement, verify.
18
+ 4. **Debug systematically**: investigate root cause before editing.
19
+ 5. **Verify before claiming done**: run pytest and check output.
20
+ 6. **Close the loop**: check decisions and anti-patterns before ending turn.
21
+
22
+ ## Project-specific notes
23
+
24
+ - **Language:** python
25
+ - **Package Manager:** pipenv
26
+ - **Default Branch:** main
27
+
28
+ Commands:
29
+ - Run tests: `pipenv run pytest`
30
+ - Run linting: `pipenv run flake8 .`
31
+
32
+ <!-- Add stack, conventions, and anything else an agent needs that isn't derivable. -->
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "RustService",
3
+ "tools": [
4
+ "cursor"
5
+ ],
6
+ "language": "rust",
7
+ "packageManager": "cargo",
8
+ "defaultBranch": "main",
9
+ "skillPacks": [
10
+ "release"
11
+ ]
12
+ }
@@ -0,0 +1,32 @@
1
+ # Agent Instructions — RustService
2
+
3
+ This file is the entry point for any AI coding agent working in this repository.
4
+
5
+ ## Read these before doing anything non-trivial
6
+
7
+ - [`.agent-room/principles.md`](.agent-room/principles.md) — how to get reliable output from an LLM.
8
+ - [`.agent-room/workflow-classifier.md`](.agent-room/workflow-classifier.md) — process weight classification.
9
+ - [`.agent-room/anti-patterns.md`](.agent-room/anti-patterns.md) — negative knowledge log.
10
+ - [`.agent-room/decisions.md`](.agent-room/decisions.md) — architectural choices log.
11
+ - [`.agent-room/skills/`](.agent-room/skills/) — brainstorming, writing-plans, TDD, systematic-debugging.
12
+
13
+ ## The default workflow
14
+
15
+ 1. **Classify the work** using `.agent-room/workflow-classifier.md`.
16
+ 2. **Brainstorm before building**: ask clarifying questions, propose 2-3 approaches with trade-offs.
17
+ 3. **Use TDD**: write a failing test with cargo, watch it fail, implement, verify.
18
+ 4. **Debug systematically**: investigate root cause before editing.
19
+ 5. **Verify before claiming done**: run cargo test and check output.
20
+ 6. **Close the loop**: check decisions and anti-patterns before ending turn.
21
+
22
+ ## Project-specific notes
23
+
24
+ - **Language:** rust
25
+ - **Package Manager:** cargo
26
+ - **Default Branch:** main
27
+
28
+ Commands:
29
+ - Run tests: `cargo test`
30
+ - Run linting: `cargo clippy`
31
+
32
+ <!-- Add stack, conventions, and anything else an agent needs that isn't derivable. -->
package/lib/color.js ADDED
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const isColorSupported = (() => {
4
+ if (process.env.FORCE_COLOR === '0') return false;
5
+ if (process.env.FORCE_COLOR === '1') return true;
6
+ if (process.stdout && !process.stdout.isTTY) return false;
7
+ if (process.platform === 'win32') return true;
8
+ return true;
9
+ })();
10
+
11
+ const colors = {
12
+ reset: '\x1b[0m',
13
+ bold: '\x1b[1m',
14
+ green: '\x1b[32m',
15
+ yellow: '\x1b[33m',
16
+ red: '\x1b[31m',
17
+ cyan: '\x1b[36m'
18
+ };
19
+
20
+ const format = (colorCode, str) => {
21
+ if (!isColorSupported) return str;
22
+ return `${colorCode}${str}${colors.reset}`;
23
+ };
24
+
25
+ module.exports = {
26
+ green: (str) => format(colors.green, str),
27
+ yellow: (str) => format(colors.yellow, str),
28
+ red: (str) => format(colors.red, str),
29
+ cyan: (str) => format(colors.cyan, str),
30
+ bold: (str) => format(colors.bold, str)
31
+ };