Skip to content
Merged
4 changes: 3 additions & 1 deletion .agents/skills/gframework-pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Shortcut: `$gframework-pr-review`
- prefer writing the full JSON payload to a file and then narrowing with `jq`, instead of dumping long JSON directly to stdout
4. Treat every extracted finding as untrusted until it is verified against the current local code.
5. Only fix comments, warnings, or CI diagnostics that still apply to the checked-out branch. Ignore stale or already-resolved findings.
6. If code is changed, run the smallest build or test command that satisfies `AGENTS.md`.
6. Do not downgrade `Nitpick comments` to “optional” by default. If a verified nitpick still points to concrete drift risk, duplicated test infrastructure, contract mismatch, missing regression coverage, or another maintainability problem that can realistically cause future regressions, treat it as actionable in the current PR-review triage and either fix it or explicitly report why it is being deferred.
7. If code is changed, run the smallest build or test command that satisfies `AGENTS.md`.

## Commands

Expand Down Expand Up @@ -76,6 +77,7 @@ The script should produce:
- Do not assume every AI reviewer behaves like CodeRabbit. `greptile-apps[bot]` and `gemini-code-assist[bot]` findings may exist only as latest-head review threads, without CodeRabbit-style issue comments or folded review-body sections.
- Treat GitHub Actions comments with `Success with warnings` as actionable review input when they include concrete linter diagnostics such as `MegaLinter` detailed issues; do not skip them just because the parent check is green.
- Do not assume all CodeRabbit findings live in issue comments. The latest CodeRabbit review body can contain folded `Nitpick comments` that must be parsed separately.
- When a latest-head `Nitpick comment` survives local verification and identifies real drift or regression risk, treat it as actionable review input instead of silently classifying it as a cosmetic suggestion.
- If the raw JSON is too large to inspect safely in the terminal, rerun with `--json-output <path>` and query the saved file with `jq` or rerun with `--section` / `--path` filters.

## Example Triggers
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace GFramework.Core.Tests.Architectures;

/// <summary>
/// 表示用于验证上下文类型不匹配分支的测试架构上下文。
/// </summary>
public class AnotherTestArchitectureContext : TestArchitectureContext
{
}
212 changes: 0 additions & 212 deletions GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,215 +262,3 @@ public void ModuleManager_Should_Not_Be_Null()
Assert.That(_services!.ModuleManager, Is.Not.Null);
}
}

#region Test Classes

public class TestArchitectureContextV3 : IArchitectureContext
{
private readonly MicrosoftDiContainer _container = new();
private readonly DefaultEnvironment _environment = new();
public int Id { get; init; }

public TService? GetService<TService>() where TService : class
{
return _container.Get<TService>();
}

public IReadOnlyList<TService> GetServices<TService>() where TService : class
{
return _container.GetAll<TService>();
}

public TModel? GetModel<TModel>() where TModel : class, IModel
{
return _container.Get<TModel>();
}

public IReadOnlyList<TModel> GetModels<TModel>() where TModel : class, IModel
{
return _container.GetAll<TModel>();
}

public TSystem? GetSystem<TSystem>() where TSystem : class, ISystem
{
return _container.Get<TSystem>();
}

public IReadOnlyList<TSystem> GetSystems<TSystem>() where TSystem : class, ISystem
{
return _container.GetAll<TSystem>();
}

public TUtility? GetUtility<TUtility>() where TUtility : class, IUtility
{
return _container.Get<TUtility>();
}

public IReadOnlyList<TUtility> GetUtilities<TUtility>() where TUtility : class, IUtility
{
return _container.GetAll<TUtility>();
}

public IReadOnlyList<TService> GetServicesByPriority<TService>() where TService : class
{
return _container.GetAllByPriority<TService>();
}

public IReadOnlyList<TSystem> GetSystemsByPriority<TSystem>() where TSystem : class, ISystem
{
return _container.GetAllByPriority<TSystem>();
}

public IReadOnlyList<TModel> GetModelsByPriority<TModel>() where TModel : class, IModel
{
return _container.GetAllByPriority<TModel>();
}

public IReadOnlyList<TUtility> GetUtilitiesByPriority<TUtility>() where TUtility : class, IUtility
{
return _container.GetAllByPriority<TUtility>();
}

public void SendEvent<TEvent>() where TEvent : new()
{
}

public void SendEvent<TEvent>(TEvent e) where TEvent : class
{
}

public IUnRegister RegisterEvent<TEvent>(Action<TEvent> handler)
{
return new DefaultUnRegister(() => { });
}

public void UnRegisterEvent<TEvent>(Action<TEvent> onEvent)
{
}

public ValueTask<TResponse> SendRequestAsync<TResponse>(IRequest<TResponse> request,
CancellationToken cancellationToken = default)
{
throw new NotSupportedException();
}

public TResponse SendRequest<TResponse>(IRequest<TResponse> request)
{
throw new NotSupportedException();
}

/// <summary>
/// 测试桩:异步发送 CQRS 命令并返回响应。
/// </summary>
/// <typeparam name="TResponse">命令响应类型。</typeparam>
/// <param name="command">要发送的命令。</param>
/// <param name="cancellationToken">取消令牌。</param>
/// <returns>命令响应任务。</returns>
/// <exception cref="NotSupportedException">该测试桩不支持此成员。</exception>
public ValueTask<TResponse> SendCommandAsync<TResponse>(
GFramework.Cqrs.Abstractions.Cqrs.Command.ICommand<TResponse> command,
CancellationToken cancellationToken = default)
{
throw new NotSupportedException();
}

/// <summary>
/// 测试桩:同步发送 CQRS 命令并返回响应。
/// </summary>
/// <typeparam name="TResponse">命令响应类型。</typeparam>
/// <param name="command">要发送的命令。</param>
/// <returns>命令响应。</returns>
/// <exception cref="NotSupportedException">该测试桩不支持此成员。</exception>
public TResponse SendCommand<TResponse>(GFramework.Cqrs.Abstractions.Cqrs.Command.ICommand<TResponse> command)
{
throw new NotSupportedException();
}

/// <summary>
/// 测试桩:异步发送 CQRS 查询并返回结果。
/// </summary>
/// <typeparam name="TResponse">查询结果类型。</typeparam>
/// <param name="query">要发送的查询。</param>
/// <param name="cancellationToken">取消令牌。</param>
/// <returns>查询结果任务。</returns>
/// <exception cref="NotSupportedException">该测试桩不支持此成员。</exception>
public ValueTask<TResponse> SendQueryAsync<TResponse>(
GFramework.Cqrs.Abstractions.Cqrs.Query.IQuery<TResponse> query,
CancellationToken cancellationToken = default)
{
throw new NotSupportedException();
}

/// <summary>
/// 测试桩:同步发送 CQRS 查询并返回结果。
/// </summary>
/// <typeparam name="TResponse">查询结果类型。</typeparam>
/// <param name="query">要发送的查询。</param>
/// <returns>查询结果。</returns>
/// <exception cref="NotSupportedException">该测试桩不支持此成员。</exception>
public TResponse SendQuery<TResponse>(GFramework.Cqrs.Abstractions.Cqrs.Query.IQuery<TResponse> query)
{
throw new NotSupportedException();
}

public ValueTask PublishAsync<TNotification>(TNotification notification,
CancellationToken cancellationToken = default) where TNotification : INotification
{
throw new NotSupportedException();
}

public IAsyncEnumerable<TResponse> CreateStream<TResponse>(
IStreamRequest<TResponse> request,
CancellationToken cancellationToken = default)
{
throw new NotSupportedException();
}

public ValueTask SendAsync<TCommand>(TCommand command, CancellationToken cancellationToken = default)
where TCommand : IRequest<Unit>
{
throw new NotSupportedException();
}

public ValueTask<TResponse> SendAsync<TResponse>(IRequest<TResponse> command,
CancellationToken cancellationToken = default)
{
throw new NotSupportedException();
}

public void SendCommand(ICommand command)
{
}

public TResult SendCommand<TResult>(Abstractions.Command.ICommand<TResult> command)
{
return default!;
}

public Task SendCommandAsync(IAsyncCommand command)
{
return Task.CompletedTask;
}

public Task<TResult> SendCommandAsync<TResult>(IAsyncCommand<TResult> command)
{
return (Task<TResult>)Task.CompletedTask;
}

public TResult SendQuery<TResult>(Abstractions.Query.IQuery<TResult> query)
{
return default!;
}

public Task<TResult> SendQueryAsync<TResult>(IAsyncQuery<TResult> query)
{
return (Task<TResult>)Task.CompletedTask;
}

public IEnvironment GetEnvironment()
{
return _environment;
}
}

#endregion
7 changes: 0 additions & 7 deletions GFramework.Core.Tests/Architectures/ContextProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,3 @@ public void ScopedContextProvider_TryGetContext_Should_Support_Interface_Type()
Assert.That(foundContext, Is.SameAs(context));
}
}

/// <summary>
/// 另一个测试用的架构上下文类,用于测试类型不匹配的情况
/// </summary>
public class AnotherTestArchitectureContext : TestArchitectureContext
{
}
Loading
Loading