ma-agents 3.1.0 → 3.3.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.
Files changed (107) hide show
  1. package/.opencode/skills/.ma-agents.json +99 -99
  2. package/.roo/rules/00-ma-agents.md +13 -0
  3. package/.roo/skills/.ma-agents.json +241 -0
  4. package/.roo/skills/MANIFEST.yaml +254 -0
  5. package/.roo/skills/ai-audit-trail/SKILL.md +23 -0
  6. package/.roo/skills/auto-bug-detection/SKILL.md +169 -0
  7. package/.roo/skills/cmake-best-practices/SKILL.md +64 -0
  8. package/.roo/skills/cmake-best-practices/examples/cmake.md +59 -0
  9. package/.roo/skills/code-documentation/SKILL.md +57 -0
  10. package/.roo/skills/code-documentation/examples/cpp.md +29 -0
  11. package/.roo/skills/code-documentation/examples/csharp.md +28 -0
  12. package/.roo/skills/code-documentation/examples/javascript_typescript.md +28 -0
  13. package/.roo/skills/code-documentation/examples/python.md +57 -0
  14. package/.roo/skills/code-review/SKILL.md +43 -0
  15. package/.roo/skills/commit-message/SKILL.md +79 -0
  16. package/.roo/skills/cpp-best-practices/SKILL.md +234 -0
  17. package/.roo/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
  18. package/.roo/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
  19. package/.roo/skills/cpp-concurrency-safety/SKILL.md +60 -0
  20. package/.roo/skills/cpp-concurrency-safety/examples/concurrency.md +73 -0
  21. package/.roo/skills/cpp-const-correctness/SKILL.md +63 -0
  22. package/.roo/skills/cpp-const-correctness/examples/const_correctness.md +54 -0
  23. package/.roo/skills/cpp-memory-handling/SKILL.md +42 -0
  24. package/.roo/skills/cpp-memory-handling/examples/modern-cpp.md +49 -0
  25. package/.roo/skills/cpp-memory-handling/examples/smart-pointers.md +46 -0
  26. package/.roo/skills/cpp-modern-composition/SKILL.md +64 -0
  27. package/.roo/skills/cpp-modern-composition/examples/composition.md +51 -0
  28. package/.roo/skills/cpp-robust-interfaces/SKILL.md +55 -0
  29. package/.roo/skills/cpp-robust-interfaces/examples/interfaces.md +56 -0
  30. package/.roo/skills/create-hardened-docker-skill/SKILL.md +637 -0
  31. package/.roo/skills/create-hardened-docker-skill/scripts/create-all.sh +489 -0
  32. package/.roo/skills/csharp-best-practices/SKILL.md +278 -0
  33. package/.roo/skills/docker-hardening-verification/SKILL.md +28 -0
  34. package/.roo/skills/docker-hardening-verification/scripts/verify-hardening.sh +39 -0
  35. package/.roo/skills/docker-image-signing/SKILL.md +28 -0
  36. package/.roo/skills/docker-image-signing/scripts/sign-image.sh +33 -0
  37. package/.roo/skills/document-revision-history/SKILL.md +104 -0
  38. package/.roo/skills/git-workflow-skill/SKILL.md +194 -0
  39. package/.roo/skills/git-workflow-skill/hooks/commit-msg +61 -0
  40. package/.roo/skills/git-workflow-skill/hooks/pre-commit +38 -0
  41. package/.roo/skills/git-workflow-skill/hooks/prepare-commit-msg +56 -0
  42. package/.roo/skills/git-workflow-skill/scripts/finish-feature.sh +192 -0
  43. package/.roo/skills/git-workflow-skill/scripts/install-hooks.sh +55 -0
  44. package/.roo/skills/git-workflow-skill/scripts/start-feature.sh +110 -0
  45. package/.roo/skills/git-workflow-skill/scripts/validate-workflow.sh +229 -0
  46. package/.roo/skills/js-ts-dependency-mgmt/SKILL.md +49 -0
  47. package/.roo/skills/js-ts-dependency-mgmt/examples/dependency_mgmt.md +60 -0
  48. package/.roo/skills/js-ts-security-skill/SKILL.md +64 -0
  49. package/.roo/skills/js-ts-security-skill/scripts/verify-security.sh +136 -0
  50. package/.roo/skills/logging-best-practices/SKILL.md +50 -0
  51. package/.roo/skills/logging-best-practices/examples/cpp.md +36 -0
  52. package/.roo/skills/logging-best-practices/examples/csharp.md +49 -0
  53. package/.roo/skills/logging-best-practices/examples/javascript.md +77 -0
  54. package/.roo/skills/logging-best-practices/examples/python.md +57 -0
  55. package/.roo/skills/logging-best-practices/references/logging-standards.md +29 -0
  56. package/.roo/skills/open-presentation/SKILL.md +35 -0
  57. package/.roo/skills/opentelemetry-best-practices/SKILL.md +34 -0
  58. package/.roo/skills/opentelemetry-best-practices/examples/go.md +32 -0
  59. package/.roo/skills/opentelemetry-best-practices/examples/javascript.md +58 -0
  60. package/.roo/skills/opentelemetry-best-practices/examples/python.md +37 -0
  61. package/.roo/skills/opentelemetry-best-practices/references/otel-standards.md +37 -0
  62. package/.roo/skills/python-best-practices/SKILL.md +385 -0
  63. package/.roo/skills/python-dependency-mgmt/SKILL.md +42 -0
  64. package/.roo/skills/python-dependency-mgmt/examples/dependency_mgmt.md +67 -0
  65. package/.roo/skills/python-security-skill/SKILL.md +56 -0
  66. package/.roo/skills/python-security-skill/examples/security.md +56 -0
  67. package/.roo/skills/self-signed-cert/SKILL.md +42 -0
  68. package/.roo/skills/self-signed-cert/scripts/generate-cert.ps1 +45 -0
  69. package/.roo/skills/self-signed-cert/scripts/generate-cert.sh +43 -0
  70. package/.roo/skills/skill-creator/SKILL.md +196 -0
  71. package/.roo/skills/skill-creator/references/output-patterns.md +82 -0
  72. package/.roo/skills/skill-creator/references/workflows.md +28 -0
  73. package/.roo/skills/skill-creator/scripts/init_skill.py +208 -0
  74. package/.roo/skills/skill-creator/scripts/package_skill.py +99 -0
  75. package/.roo/skills/skill-creator/scripts/quick_validate.py +113 -0
  76. package/.roo/skills/story-status-lookup/SKILL.md +78 -0
  77. package/.roo/skills/test-accompanied-development/SKILL.md +50 -0
  78. package/.roo/skills/test-generator/SKILL.md +65 -0
  79. package/.roo/skills/vercel-react-best-practices/SKILL.md +109 -0
  80. package/.roo/skills/verify-hardened-docker-skill/SKILL.md +442 -0
  81. package/.roo/skills/verify-hardened-docker-skill/scripts/verify-docker-hardening.sh +439 -0
  82. package/README.md +50 -3
  83. package/lib/agents.js +23 -0
  84. package/lib/bmad-extension/module-help.csv +8 -4
  85. package/lib/bmad-extension/skills/add-sprint/SKILL.md +126 -40
  86. package/lib/bmad-extension/skills/add-to-sprint/SKILL.md +116 -142
  87. package/lib/bmad-extension/skills/cleanup-done/.gitkeep +0 -0
  88. package/lib/bmad-extension/skills/cleanup-done/SKILL.md +159 -0
  89. package/lib/bmad-extension/skills/cleanup-done/bmad-skill-manifest.yaml +3 -0
  90. package/lib/bmad-extension/skills/create-bug-story/SKILL.md +75 -7
  91. package/lib/bmad-extension/skills/generate-backlog/SKILL.md +183 -0
  92. package/lib/bmad-extension/skills/generate-backlog/bmad-skill-manifest.yaml +3 -0
  93. package/lib/bmad-extension/skills/modify-sprint/SKILL.md +63 -0
  94. package/lib/bmad-extension/skills/prioritize-backlog/.gitkeep +0 -0
  95. package/lib/bmad-extension/skills/prioritize-backlog/SKILL.md +195 -0
  96. package/lib/bmad-extension/skills/prioritize-backlog/bmad-skill-manifest.yaml +3 -0
  97. package/lib/bmad-extension/skills/remove-from-sprint/.gitkeep +0 -0
  98. package/lib/bmad-extension/skills/remove-from-sprint/SKILL.md +163 -0
  99. package/lib/bmad-extension/skills/remove-from-sprint/bmad-skill-manifest.yaml +3 -0
  100. package/lib/bmad-extension/skills/sprint-status-view/SKILL.md +199 -138
  101. package/lib/bmad-extension/workflows/add-sprint/workflow.md +129 -39
  102. package/lib/bmad-extension/workflows/add-to-sprint/workflow.md +3 -205
  103. package/lib/bmad-extension/workflows/modify-sprint/workflow.md +5 -0
  104. package/lib/bmad-extension/workflows/sprint-status-view/workflow.md +3 -192
  105. package/package.json +4 -3
  106. package/test/roo-code-agent.test.js +166 -0
  107. package/test/roo-code-injection.test.js +172 -0
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Tests for Story 18.3: Roo Code Rules Injection
4
+ *
5
+ * Validates that updateAgentInstructions() correctly creates/updates
6
+ * planning instructions in .roo/rules/00-ma-agents.md for Roo Code.
7
+ */
8
+ 'use strict';
9
+
10
+ const assert = require('assert');
11
+ const fs = require('fs-extra');
12
+ const path = require('path');
13
+ const os = require('os');
14
+
15
+ let passed = 0;
16
+ let failed = 0;
17
+ const errors = [];
18
+
19
+ function test(name, fn) {
20
+ try {
21
+ fn();
22
+ console.log(` \u2713 ${name}`);
23
+ passed++;
24
+ } catch (err) {
25
+ console.error(` \u2717 ${name}: ${err.message}`);
26
+ failed++;
27
+ errors.push({ name, error: err.message });
28
+ }
29
+ }
30
+
31
+ async function asyncTest(name, fn) {
32
+ try {
33
+ await fn();
34
+ console.log(` \u2713 ${name}`);
35
+ passed++;
36
+ } catch (err) {
37
+ console.error(` \u2717 ${name}: ${err.message}`);
38
+ failed++;
39
+ errors.push({ name, error: err.message });
40
+ }
41
+ }
42
+
43
+ const { _testUpdateAgentInstructions: updateAgentInstructions } = require('../lib/installer');
44
+ const { getAgent } = require('../lib/agents');
45
+
46
+ // --- Roo Code rules injection tests ---
47
+
48
+ console.log('\nRoo Code rules injection');
49
+
50
+ let tmpDir;
51
+
52
+ async function setup() {
53
+ tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'roo-code-test-'));
54
+ }
55
+
56
+ async function cleanup() {
57
+ if (tmpDir) {
58
+ await fs.remove(tmpDir);
59
+ }
60
+ }
61
+
62
+ (async () => {
63
+ await setup();
64
+
65
+ const rooCode = getAgent('roo-code');
66
+
67
+ await asyncTest('creates .roo/rules/ directory and 00-ma-agents.md when absent', async () => {
68
+ const projectRoot = path.join(tmpDir, 'project-create');
69
+ await fs.ensureDir(projectRoot);
70
+
71
+ // Create a mock roo-code agent with paths relative to tmpDir
72
+ const agent = {
73
+ ...rooCode,
74
+ getProjectPath: () => path.join(projectRoot, '.roo', 'skills'),
75
+ instructionFiles: ['.roo/rules/00-ma-agents.md'],
76
+ injectionStrategy: { position: 'top', skipPatterns: ['---'] }
77
+ };
78
+
79
+ await updateAgentInstructions(agent, projectRoot);
80
+
81
+ const filePath = path.join(projectRoot, '.roo', 'rules', '00-ma-agents.md');
82
+ assert.ok(await fs.pathExists(filePath), '.roo/rules/00-ma-agents.md should be created');
83
+
84
+ const content = await fs.readFile(filePath, 'utf-8');
85
+ assert.ok(content.includes('<!-- MA-AGENTS-START -->'), 'should contain start marker');
86
+ assert.ok(content.includes('<!-- MA-AGENTS-END -->'), 'should contain end marker');
87
+ assert.ok(content.includes('MANIFEST.yaml'), 'should reference MANIFEST.yaml');
88
+ assert.ok(content.includes('.roo/skills/MANIFEST.yaml'), 'should use .roo/skills/ path');
89
+ });
90
+
91
+ await asyncTest('updates existing content with markers in place (idempotent)', async () => {
92
+ const projectRoot = path.join(tmpDir, 'project-update');
93
+ await fs.ensureDir(projectRoot);
94
+
95
+ // Pre-create file with old markers
96
+ const rulesDir = path.join(projectRoot, '.roo', 'rules');
97
+ await fs.ensureDir(rulesDir);
98
+ const filePath = path.join(rulesDir, '00-ma-agents.md');
99
+ await fs.writeFile(filePath, '<!-- MA-AGENTS-START -->\nOLD CONTENT\n<!-- MA-AGENTS-END -->\n');
100
+
101
+ const agent = {
102
+ ...rooCode,
103
+ getProjectPath: () => path.join(projectRoot, '.roo', 'skills'),
104
+ instructionFiles: ['.roo/rules/00-ma-agents.md'],
105
+ injectionStrategy: { position: 'top', skipPatterns: ['---'] }
106
+ };
107
+
108
+ await updateAgentInstructions(agent, projectRoot);
109
+
110
+ const content = await fs.readFile(filePath, 'utf-8');
111
+ assert.ok(!content.includes('OLD CONTENT'), 'old content should be replaced');
112
+ assert.ok(content.includes('MANIFEST.yaml'), 'should contain updated instruction');
113
+ // Verify only one set of markers
114
+ const startCount = (content.match(/<!-- MA-AGENTS-START -->/g) || []).length;
115
+ assert.strictEqual(startCount, 1, 'should have exactly one start marker');
116
+ });
117
+
118
+ await asyncTest('preserves user content when injecting into existing file', async () => {
119
+ const projectRoot = path.join(tmpDir, 'project-preserve');
120
+ await fs.ensureDir(projectRoot);
121
+
122
+ // Pre-create file with user content but no markers
123
+ const rulesDir = path.join(projectRoot, '.roo', 'rules');
124
+ await fs.ensureDir(rulesDir);
125
+ const filePath = path.join(rulesDir, '00-ma-agents.md');
126
+ await fs.writeFile(filePath, '# User Custom Rules\n\nAlways use TypeScript.\n');
127
+
128
+ const agent = {
129
+ ...rooCode,
130
+ getProjectPath: () => path.join(projectRoot, '.roo', 'skills'),
131
+ instructionFiles: ['.roo/rules/00-ma-agents.md'],
132
+ injectionStrategy: { position: 'top', skipPatterns: ['---'] }
133
+ };
134
+
135
+ await updateAgentInstructions(agent, projectRoot);
136
+
137
+ const content = await fs.readFile(filePath, 'utf-8');
138
+ assert.ok(content.includes('<!-- MA-AGENTS-START -->'), 'should contain markers');
139
+ assert.ok(content.includes('Always use TypeScript'), 'should preserve user content');
140
+ });
141
+
142
+ await asyncTest('file can be cleanly removed (uninstall scenario)', async () => {
143
+ const projectRoot = path.join(tmpDir, 'project-uninstall');
144
+ await fs.ensureDir(projectRoot);
145
+
146
+ const agent = {
147
+ ...rooCode,
148
+ getProjectPath: () => path.join(projectRoot, '.roo', 'skills'),
149
+ instructionFiles: ['.roo/rules/00-ma-agents.md'],
150
+ injectionStrategy: { position: 'top', skipPatterns: ['---'] }
151
+ };
152
+
153
+ // Install first
154
+ await updateAgentInstructions(agent, projectRoot);
155
+ const filePath = path.join(projectRoot, '.roo', 'rules', '00-ma-agents.md');
156
+ assert.ok(await fs.pathExists(filePath), 'file should exist after install');
157
+
158
+ // Simulate uninstall by removing the file
159
+ await fs.remove(filePath);
160
+ assert.ok(!(await fs.pathExists(filePath)), 'file should be removed after uninstall');
161
+ });
162
+
163
+ await cleanup();
164
+
165
+ // Print summary
166
+ console.log(`\n${passed} passed, ${failed} failed`);
167
+ if (errors.length > 0) {
168
+ console.log('\nFailed tests:');
169
+ errors.forEach(e => console.log(` - ${e.name}: ${e.error}`));
170
+ }
171
+ if (failed > 0) process.exit(1);
172
+ })();