ma-agents 2.20.2 → 2.21.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/.opencode/skills/.ma-agents.json +241 -0
- package/.opencode/skills/MANIFEST.yaml +254 -0
- package/.opencode/skills/ai-audit-trail/SKILL.md +23 -0
- package/.opencode/skills/auto-bug-detection/SKILL.md +169 -0
- package/.opencode/skills/cmake-best-practices/SKILL.md +64 -0
- package/.opencode/skills/cmake-best-practices/examples/cmake.md +59 -0
- package/.opencode/skills/code-documentation/SKILL.md +57 -0
- package/.opencode/skills/code-documentation/examples/cpp.md +29 -0
- package/.opencode/skills/code-documentation/examples/csharp.md +28 -0
- package/.opencode/skills/code-documentation/examples/javascript_typescript.md +28 -0
- package/.opencode/skills/code-documentation/examples/python.md +57 -0
- package/.opencode/skills/code-review/SKILL.md +43 -0
- package/.opencode/skills/commit-message/SKILL.md +79 -0
- package/.opencode/skills/cpp-best-practices/SKILL.md +234 -0
- package/.opencode/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
- package/.opencode/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
- package/.opencode/skills/cpp-concurrency-safety/SKILL.md +60 -0
- package/.opencode/skills/cpp-concurrency-safety/examples/concurrency.md +73 -0
- package/.opencode/skills/cpp-const-correctness/SKILL.md +63 -0
- package/.opencode/skills/cpp-const-correctness/examples/const_correctness.md +54 -0
- package/.opencode/skills/cpp-memory-handling/SKILL.md +42 -0
- package/.opencode/skills/cpp-memory-handling/examples/modern-cpp.md +49 -0
- package/.opencode/skills/cpp-memory-handling/examples/smart-pointers.md +46 -0
- package/.opencode/skills/cpp-modern-composition/SKILL.md +64 -0
- package/.opencode/skills/cpp-modern-composition/examples/composition.md +51 -0
- package/.opencode/skills/cpp-robust-interfaces/SKILL.md +55 -0
- package/.opencode/skills/cpp-robust-interfaces/examples/interfaces.md +56 -0
- package/.opencode/skills/create-hardened-docker-skill/SKILL.md +637 -0
- package/.opencode/skills/create-hardened-docker-skill/scripts/create-all.sh +489 -0
- package/.opencode/skills/csharp-best-practices/SKILL.md +278 -0
- package/.opencode/skills/docker-hardening-verification/SKILL.md +28 -0
- package/.opencode/skills/docker-hardening-verification/scripts/verify-hardening.sh +39 -0
- package/.opencode/skills/docker-image-signing/SKILL.md +28 -0
- package/.opencode/skills/docker-image-signing/scripts/sign-image.sh +33 -0
- package/.opencode/skills/document-revision-history/SKILL.md +104 -0
- package/.opencode/skills/git-workflow-skill/SKILL.md +194 -0
- package/.opencode/skills/git-workflow-skill/hooks/commit-msg +61 -0
- package/.opencode/skills/git-workflow-skill/hooks/pre-commit +38 -0
- package/.opencode/skills/git-workflow-skill/hooks/prepare-commit-msg +56 -0
- package/.opencode/skills/git-workflow-skill/scripts/finish-feature.sh +192 -0
- package/.opencode/skills/git-workflow-skill/scripts/install-hooks.sh +55 -0
- package/.opencode/skills/git-workflow-skill/scripts/start-feature.sh +110 -0
- package/.opencode/skills/git-workflow-skill/scripts/validate-workflow.sh +229 -0
- package/.opencode/skills/js-ts-dependency-mgmt/SKILL.md +49 -0
- package/.opencode/skills/js-ts-dependency-mgmt/examples/dependency_mgmt.md +60 -0
- package/.opencode/skills/js-ts-security-skill/SKILL.md +64 -0
- package/.opencode/skills/js-ts-security-skill/scripts/verify-security.sh +136 -0
- package/.opencode/skills/logging-best-practices/SKILL.md +50 -0
- package/.opencode/skills/logging-best-practices/examples/cpp.md +36 -0
- package/.opencode/skills/logging-best-practices/examples/csharp.md +49 -0
- package/.opencode/skills/logging-best-practices/examples/javascript.md +77 -0
- package/.opencode/skills/logging-best-practices/examples/python.md +57 -0
- package/.opencode/skills/logging-best-practices/references/logging-standards.md +29 -0
- package/.opencode/skills/open-presentation/SKILL.md +35 -0
- package/.opencode/skills/opentelemetry-best-practices/SKILL.md +34 -0
- package/.opencode/skills/opentelemetry-best-practices/examples/go.md +32 -0
- package/.opencode/skills/opentelemetry-best-practices/examples/javascript.md +58 -0
- package/.opencode/skills/opentelemetry-best-practices/examples/python.md +37 -0
- package/.opencode/skills/opentelemetry-best-practices/references/otel-standards.md +37 -0
- package/.opencode/skills/python-best-practices/SKILL.md +385 -0
- package/.opencode/skills/python-dependency-mgmt/SKILL.md +42 -0
- package/.opencode/skills/python-dependency-mgmt/examples/dependency_mgmt.md +67 -0
- package/.opencode/skills/python-security-skill/SKILL.md +56 -0
- package/.opencode/skills/python-security-skill/examples/security.md +56 -0
- package/.opencode/skills/self-signed-cert/SKILL.md +42 -0
- package/.opencode/skills/self-signed-cert/scripts/generate-cert.ps1 +45 -0
- package/.opencode/skills/self-signed-cert/scripts/generate-cert.sh +43 -0
- package/.opencode/skills/skill-creator/SKILL.md +196 -0
- package/.opencode/skills/skill-creator/references/output-patterns.md +82 -0
- package/.opencode/skills/skill-creator/references/workflows.md +28 -0
- package/.opencode/skills/skill-creator/scripts/init_skill.py +208 -0
- package/.opencode/skills/skill-creator/scripts/package_skill.py +99 -0
- package/.opencode/skills/skill-creator/scripts/quick_validate.py +113 -0
- package/.opencode/skills/story-status-lookup/SKILL.md +78 -0
- package/.opencode/skills/test-accompanied-development/SKILL.md +50 -0
- package/.opencode/skills/test-generator/SKILL.md +65 -0
- package/.opencode/skills/vercel-react-best-practices/SKILL.md +109 -0
- package/.opencode/skills/verify-hardened-docker-skill/SKILL.md +442 -0
- package/.opencode/skills/verify-hardened-docker-skill/scripts/verify-docker-hardening.sh +439 -0
- package/AiAudit.md +5 -0
- package/QUICK_START.md +11 -5
- package/README.md +52 -1
- package/bin/cli.js +31 -4
- package/docs/BMAD_AI_Development_Training.pptx +0 -0
- package/docs/technical-notes/context-persistence-research.md +434 -0
- package/docs/technical-notes/enforcement-hooks-research.md +415 -0
- package/lib/agents.js +34 -0
- package/lib/bmad-extension/agents/bmm-architect.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-bmad-master.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-cyber.customize.yaml +30 -0
- package/lib/bmad-extension/agents/bmm-dev.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-devops.customize.yaml +30 -0
- package/lib/bmad-extension/agents/bmm-mil498.customize.yaml +42 -0
- package/lib/bmad-extension/agents/bmm-pm.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-qa.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-sm.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-sre.customize.yaml +30 -0
- package/lib/bmad-extension/agents/bmm-tech-writer.customize.yaml +5 -0
- package/lib/bmad-extension/agents/bmm-ux-designer.customize.yaml +5 -0
- package/lib/bmad-extension/module-help.csv +7 -0
- package/lib/bmad-extension/module.yaml +3 -0
- package/lib/bmad-extension/workflows/add-sprint/workflow.md +112 -0
- package/lib/bmad-extension/workflows/add-to-sprint/workflow.md +206 -0
- package/lib/bmad-extension/workflows/create-bug-story/workflow.md +186 -0
- package/lib/bmad-extension/workflows/modify-sprint/workflow.md +250 -0
- package/lib/bmad-extension/workflows/project-context-expansion/workflow.md +229 -0
- package/lib/bmad-extension/workflows/sprint-status-view/workflow.md +193 -0
- package/lib/bmad.js +84 -6
- package/lib/hooks/claude-code/verify-manifest.js +56 -0
- package/lib/installer.js +282 -1
- package/lib/methodology/BMAD_AI_Development_Training.pptx +0 -0
- package/lib/methodology/version.json +7 -0
- package/lib/skill-authoring.js +732 -0
- package/lib/templates/project-context.template.md +47 -0
- package/opencode.json +8 -0
- package/package.json +2 -2
- package/skills/auto-bug-detection/SKILL.md +165 -0
- package/skills/auto-bug-detection/skill.json +8 -0
- package/skills/code-review/SKILL.md +40 -0
- package/skills/cpp-best-practices/SKILL.md +230 -0
- package/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
- package/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
- package/skills/cpp-best-practices/skill.json +25 -0
- package/skills/csharp-best-practices/SKILL.md +274 -0
- package/skills/csharp-best-practices/skill.json +23 -0
- package/skills/git-workflow-skill/skill.json +1 -1
- package/skills/open-presentation/SKILL.md +31 -0
- package/skills/open-presentation/skill.json +11 -0
- package/skills/python-best-practices/SKILL.md +381 -0
- package/skills/python-best-practices/skill.json +26 -0
- package/skills/story-status-lookup/SKILL.md +74 -0
- package/skills/story-status-lookup/skill.json +8 -0
- package/test/agent-injection-strategy.test.js +13 -7
- package/test/bmad-extension.test.js +237 -0
- package/test/bmad-output-policy.test.js +119 -0
- package/test/create-agent.test.js +232 -0
- package/test/enforcement-hooks.test.js +324 -0
- package/test/generate-project-context.test.js +337 -0
- package/test/integration-verification.test.js +402 -0
- package/test/opencode-agent.test.js +150 -0
- package/test/opencode-json-error.test.js +260 -0
- package/test/opencode-json-injection.test.js +256 -0
- package/test/opencode-json-merge.test.js +299 -0
- package/test/skill-authoring.test.js +272 -0
- package/test/skill-customize-agent.test.js +253 -0
- package/test/skill-mandatory.test.js +235 -0
- package/test/skill-validation.test.js +378 -0
- package/test/yes-flag.test.js +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: C++ Modern Composition
|
|
3
|
+
description: Replace legacy C patterns with STL, Ranges, and modern C++ abstractions (C++14+).
|
|
4
|
+
---
|
|
5
|
+
# C++ Modern Composition (Core Guidelines Section STL, CPL, ES)
|
|
6
|
+
|
|
7
|
+
This skill forces the transition from legacy "C-style" C++ to modern, declarative, and safer C++ idioms.
|
|
8
|
+
|
|
9
|
+
## Policies
|
|
10
|
+
|
|
11
|
+
### 1. STL Algorithms over Manual Loops
|
|
12
|
+
* **Rule**: Never write a raw `for` or `while` loop for operations supported by `<algorithm>` or `<numeric>`.
|
|
13
|
+
* **Action**:
|
|
14
|
+
- Use `std::any_of`, `std::all_of`, `std::find_if`, `std::transform`, `std::accumulate`.
|
|
15
|
+
- In C++20 projects, prefer `std::ranges` versions.
|
|
16
|
+
* **Rationale**: Reduces "off-by-one" errors and improves intent readability.
|
|
17
|
+
|
|
18
|
+
### 2. Eradicate C-style Casts and Macros
|
|
19
|
+
* **Rule**: Ban `(type)value` and `#define` for logic/constants.
|
|
20
|
+
* **Action**:
|
|
21
|
+
- Use `static_cast`, `reinterpret_cast`, or `const_cast`.
|
|
22
|
+
- Replace macros with `constexpr` variables or `inline` functions/templates.
|
|
23
|
+
* **Rationale**: Named casts are searchable and safer; `constexpr` respects namespaces and scopes.
|
|
24
|
+
|
|
25
|
+
### 3. Universal Initialization
|
|
26
|
+
* **Rule**: Prefer `{}` initialization to avoid the "Most Vexing Parse".
|
|
27
|
+
* **Action**: Use `auto x = Type{args...};` or `Type x{args...};`.
|
|
28
|
+
* **Rationale**: Prevents narrowing conversions (e.g., `int x{3.5}` is a compiler error, while `int x = 3.5` is not).
|
|
29
|
+
|
|
30
|
+
### 4. Zero Raw Memory Manipulation
|
|
31
|
+
* **Rule**: Ban `memset`, `memcpy`, and `malloc`.
|
|
32
|
+
* **Action**:
|
|
33
|
+
- Use `std::fill`, `std::copy`, or `container.assign()`.
|
|
34
|
+
- Use `std::vector` or `std::array` instead of raw arrays.
|
|
35
|
+
* **Rationale**: Standard containers are bounds-checked (via `.at()`) and manage their own memory.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
### Before (C-style C++)
|
|
40
|
+
```cpp
|
|
41
|
+
#define MAX_BUFFER 1024
|
|
42
|
+
int arr[MAX_BUFFER];
|
|
43
|
+
memset(arr, 0, sizeof(arr));
|
|
44
|
+
|
|
45
|
+
bool found = false;
|
|
46
|
+
for (int i = 0; i < MAX_BUFFER; ++i) {
|
|
47
|
+
if (arr[i] == (int)someFloat) {
|
|
48
|
+
found = true;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### After (Modern C++)
|
|
55
|
+
```cpp
|
|
56
|
+
constexpr size_t MaxBuffer = 1024;
|
|
57
|
+
std::array<int, MaxBuffer> arr;
|
|
58
|
+
arr.fill(0);
|
|
59
|
+
|
|
60
|
+
auto target = static_cast<int>(someFloat);
|
|
61
|
+
bool found = std::any_of(arr.begin(), arr.end(), [target](int v) {
|
|
62
|
+
return v == target;
|
|
63
|
+
});
|
|
64
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Modern Composition Examples (C++14+)
|
|
2
|
+
|
|
3
|
+
### 1. Data Transformation (Transform)
|
|
4
|
+
**Legacy:**
|
|
5
|
+
```cpp
|
|
6
|
+
std::vector<int> inputs = {1, 2, 3};
|
|
7
|
+
std::vector<int> outputs;
|
|
8
|
+
for (size_t i = 0; i < inputs.size(); ++i) {
|
|
9
|
+
outputs.push_back(inputs[i] * 2);
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Modern (C++14):**
|
|
14
|
+
```cpp
|
|
15
|
+
std::vector<int> inputs = {1, 2, 3};
|
|
16
|
+
std::vector<int> outputs;
|
|
17
|
+
outputs.reserve(inputs.size());
|
|
18
|
+
std::transform(inputs.begin(), inputs.end(), std::back_inserter(outputs),
|
|
19
|
+
[](int n) { return n * 2; });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Summation and Reduction (Accumulate)
|
|
23
|
+
**Modern (C++14):**
|
|
24
|
+
```cpp
|
|
25
|
+
#include <numeric>
|
|
26
|
+
|
|
27
|
+
std::vector<double> prices = {10.5, 20.0, 5.25};
|
|
28
|
+
double total = std::accumulate(prices.begin(), prices.end(), 0.0);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Safe Narrowing Protection
|
|
32
|
+
**Logic:**
|
|
33
|
+
```cpp
|
|
34
|
+
double d = 7.9;
|
|
35
|
+
// int i{d}; // Error: narrowing conversion from 'double' to 'int'
|
|
36
|
+
int i = static_cast<int>(d); // Explicit and safe
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 4. Replacing Function Macros
|
|
40
|
+
**Legacy:**
|
|
41
|
+
```cpp
|
|
42
|
+
#define SQUARE(x) ((x)*(x))
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Modern (C++14):**
|
|
46
|
+
```cpp
|
|
47
|
+
template<typename T>
|
|
48
|
+
constexpr T square(T t) {
|
|
49
|
+
return t * t;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: C++ Robust Interfaces
|
|
3
|
+
description: Enforce contract-based design and strong typing in C++ interfaces (C++14+).
|
|
4
|
+
---
|
|
5
|
+
# C++ Robust Interfaces (Core Guidelines Section I & E)
|
|
6
|
+
|
|
7
|
+
This skill ensures that C++ interfaces follow contract-based design principles to improve safety, clarity, and maintainability.
|
|
8
|
+
|
|
9
|
+
## Policies
|
|
10
|
+
|
|
11
|
+
### 1. Make Interfaces Explicit
|
|
12
|
+
* **Rule**: Functions must explicitly state their requirements (pre-conditions) and guarantees (post-conditions).
|
|
13
|
+
* **Action**: Use `Expects()` and `Ensures()` (from GSL) or standardized comments if GSL is unavailable.
|
|
14
|
+
* **Rationale**: Detects integration bugs at the call site rather than deep in the implementation.
|
|
15
|
+
|
|
16
|
+
### 2. Strong Typing over Primitive Types
|
|
17
|
+
* **Rule**: Avoid "Boolean Blindness" and `void*`.
|
|
18
|
+
* **Action**:
|
|
19
|
+
- Use `enum class` for options instead of `bool`.
|
|
20
|
+
- Use `std::chrono` for time instead of `int`.
|
|
21
|
+
- Use specific types/structs instead of a long list of primitive arguments.
|
|
22
|
+
|
|
23
|
+
### 3. Clear Ownership and Lifetime
|
|
24
|
+
* **Rule**: A raw pointer (`T*`) in an interface **must never** represent ownership.
|
|
25
|
+
* **Action**:
|
|
26
|
+
- Use `gsl::not_null<T*>` for pointers that cannot be null.
|
|
27
|
+
- Use `std::unique_ptr` or `std::shared_ptr` ONLY if the function is participating in ownership/lifetime management.
|
|
28
|
+
- Prefer `T&` for arguments that must exist and aren't owned by the callee.
|
|
29
|
+
|
|
30
|
+
### 4. Sequence Safety
|
|
31
|
+
* **Rule**: Never pass an array as a raw pointer + size.
|
|
32
|
+
* **Action**:
|
|
33
|
+
- Use `gsl::span<T>` (C++14/17 via GSL) or `std::span<T>` (C++20).
|
|
34
|
+
- Use `std::string_view` for read-only strings.
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
### Before (Fragile Interface)
|
|
39
|
+
```cpp
|
|
40
|
+
// What does 'flag' mean? Is data allowed to be null? Is it an array?
|
|
41
|
+
void processData(char* data, int size, bool flag);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### After (Robust Interface)
|
|
45
|
+
```cpp
|
|
46
|
+
#include <gsl/gsl>
|
|
47
|
+
|
|
48
|
+
enum class ProcessingMode { Fast, Thorough };
|
|
49
|
+
|
|
50
|
+
// Explicit contract: data must not be null, size is handled by span
|
|
51
|
+
void processData(gsl::span<const char> data, ProcessingMode mode) {
|
|
52
|
+
Expects(!data.empty());
|
|
53
|
+
// ...
|
|
54
|
+
}
|
|
55
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Robust Interface Examples (C++14+)
|
|
2
|
+
|
|
3
|
+
### 1. Avoiding Boolean Blindness
|
|
4
|
+
**Incorrect:**
|
|
5
|
+
```cpp
|
|
6
|
+
void setWindowVisible(bool visible, bool animate);
|
|
7
|
+
// Call site: setWindowVisible(true, false); // What is false?
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
**Correct (C++14):**
|
|
11
|
+
```cpp
|
|
12
|
+
enum class Visibility { Visible, Hidden };
|
|
13
|
+
enum class Animation { Enabled, Disabled };
|
|
14
|
+
|
|
15
|
+
void setWindowVisible(Visibility v, Animation a);
|
|
16
|
+
// Call site: setWindowVisible(Visibility::Visible, Animation::Disabled);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Contract-Based Validation
|
|
20
|
+
Using GSL (Guidelines Support Library) style:
|
|
21
|
+
|
|
22
|
+
```cpp
|
|
23
|
+
#include <gsl/gsl>
|
|
24
|
+
|
|
25
|
+
class User {
|
|
26
|
+
public:
|
|
27
|
+
// Ensure name is never null or empty
|
|
28
|
+
void setName(gsl::not_null<const char*> name) {
|
|
29
|
+
Expects(std::strlen(name) > 0);
|
|
30
|
+
this->name = name;
|
|
31
|
+
}
|
|
32
|
+
private:
|
|
33
|
+
std::string name;
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Safe Sequences with Span
|
|
38
|
+
Replaces pointer + length pairs which are prone to buffer overflows.
|
|
39
|
+
|
|
40
|
+
```cpp
|
|
41
|
+
#include <gsl/gsl> // Use gsl::span in C++14
|
|
42
|
+
|
|
43
|
+
float calculateAverage(gsl::span<const float> values) {
|
|
44
|
+
Expects(!values.empty());
|
|
45
|
+
|
|
46
|
+
float sum = 0.0f;
|
|
47
|
+
for (float v : values) {
|
|
48
|
+
sum += v;
|
|
49
|
+
}
|
|
50
|
+
return sum / values.size();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Usage:
|
|
54
|
+
// float arr[] = {1, 2, 3};
|
|
55
|
+
// calculateAverage(arr); // Automatic conversion to span
|
|
56
|
+
```
|