agentleFS
MrCipherSmithMrCipherSmith/goodai-base/skills/gproject-patterns-researcher/SKILL.md

gproject-patterns-researcher

Skill0 starsChanged 5 months agoMITView on GitHub

Researches best practices per technology in the chosen stack and defines application architecture patterns. Produces constraints that PRD must follow. Use when: dispatched by gproject-orchestrator Phase 3. NOT for: direct user invocation.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After stack is chosen, research and define the specific patterns, conventions, and architectural decisions for each technology.

    line 15
  2. Distinctive:

    Document the pattern with:

    line 81
  3. Distinctive:

    Testing: test pyramid ratios for this project level

    line 140
  4. Very specific:

    Write artifacts/tech-bestpractices.md — this is the constraint document that PRD writer must follow:

    line 176

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

gproject-patterns-researcher

Purpose

After stack is chosen, research and define the specific patterns, conventions, and architectural decisions for each technology. The output becomes a set of binding constraints that Phase 4 (PRD) must adhere to.

Iron Laws

#Law
1Every pattern MUST reference a source (official docs, community consensus, or established practice)
2Patterns MUST be compatible with chosen project level — no enterprise patterns for MVP
3Architecture decisions MUST list alternatives considered
4NEVER copy-paste generic "best practices" — every recommendation must be contextualized to THIS project
5Output MUST be structured as checkable constraints, not prose advice
6Existing project patterns (task_in_project) take precedence unless they're antipatterns

Input Contract

task: "Research per-technology patterns and define application architecture"
input_artifacts:
  - jobs/<job>/artifacts/stack-decision.md
  - jobs/<job>/artifacts/problem-statement.md
decisions_so_far:
  D_level: "..."
  D_frontend: "..."
  D_backend: "..."
  D_database: "..."
  D_deploy: "..."
  # All stack decisions

Output Contract

status: "DONE" | "NEEDS_CONTEXT"
summary: "<3-5 sentences: architecture pattern, key per-tech decisions, constraint count>"
new_decisions:
  D_arch_pattern: "<e.g., Clean Architecture, Feature-Sliced, MVC>"
  D_api_style: "<REST | GraphQL | tRPC | gRPC>"
  D_state_management: "<approach>"
  D_auth_pattern: "<JWT | session | OAuth flow>"
  D_testing_strategy: "<unit + integration + e2e split>"
  D_error_handling: "<pattern>"
  D_logging_observability: "<approach>"
artifact_path: "jobs/<job>/artifacts/architecture.md"
additional_artifacts:
  - "jobs/<job>/artifacts/tech-bestpractices.md"

Workflow

Step 1: Define Application Architecture

Based on project level and stack, select architecture pattern:

LevelTypical PatternWhy
MVPSimple layered (routes → services → DB)Minimum indirection, fast to build
PetFeature-based modulesGood learning structure
StartupClean Architecture / HexagonalTestable, scalable when team grows
ProductionDDD + CQRS where justifiedComplex domain needs it

Document the pattern with:

  • Layer diagram (which layers, what goes where)
  • Dependency direction (who imports whom)
  • Module/feature structure (how to organize code)
  • Cross-cutting concerns (logging, auth, error handling)

Step 2: Per-Technology Research

For EACH technology in the stack, research and document:

Frontend (e.g., Next.js)

  • Project structure pattern (App Router conventions, feature folders)
  • Component patterns (Server vs Client components, composition)
  • State management pattern (chosen approach + why)
  • Data fetching pattern (Server Actions, SWR, React Query)
  • Styling approach (Tailwind, CSS Modules, styled-components)
  • Form handling pattern
  • Error boundary strategy
  • Testing approach (unit: Vitest, e2e: Playwright)

Backend (e.g., NestJS)

  • Module structure pattern
  • DTO and validation approach
  • Service layer patterns
  • Repository / data access pattern
  • Error handling (exception filters, typed errors)
  • Authentication and authorization pattern
  • API versioning strategy
  • Testing approach (unit + integration)

Database (e.g., PostgreSQL)

  • Schema design approach (normalized vs denormalized for use case)
  • Migration strategy and tooling
  • Indexing guidelines for expected queries
  • Connection pooling approach
  • Backup and recovery (if production level)

Infrastructure (e.g., Docker)

  • Container structure (multi-stage builds, compose setup)
  • Environment management (dev/staging/prod)
  • CI/CD pipeline pattern
  • Monitoring and logging stack

Step 3: Define API Contract Style

Based on project needs:

  • REST: resource-based, OpenAPI spec, versioning scheme
  • GraphQL: schema-first vs code-first, resolver patterns
  • tRPC: shared types, router structure
  • gRPC: proto file organization, service boundaries

Step 4: Cross-Cutting Patterns

Define patterns that span all layers:

  • Authentication flow: complete auth pattern (signup, login, token refresh, logout)
  • Authorization: RBAC, ABAC, or simple role checks
  • Error handling: typed errors, error codes, user-facing messages
  • Logging: structured logging format, log levels, sensitive data masking
  • Validation: where validation happens (API layer, domain layer, both)
  • Testing: test pyramid ratios for this project level

Step 5: Write Architecture Doc

Write artifacts/architecture.md:

# Architecture: <Project/Task Name>

## Architecture Pattern: <Pattern Name>
**Rationale**: <why this pattern for this project>
**Alternative considered**: <pattern and why rejected>

## Layer Diagram
<describe layers and dependencies>

## Module Structure
<how code is organized — by feature, by layer, hybrid>

## Component Interaction
<how layers communicate — direct calls, events, DTOs>

## Cross-Cutting Concerns
### Authentication: <pattern>
### Error Handling: <pattern>
### Logging: <pattern>
### Validation: <pattern>

## Key Architecture Decisions
| Decision | Choice | Rationale | Alternative |
|----------|--------|-----------|-------------|
| <decision> | <choice> | <why> | <what else> |

Step 6: Write Best Practices Constraints

Write artifacts/tech-bestpractices.md — this is the constraint document that PRD writer must follow:

# Technical Best Practices & Constraints

## How to Use This Document
Every requirement in the PRD MUST be compatible with these constraints.
The consistency-checker (Phase 5) validates PRD against these rules.

## Frontend Constraints (<technology>)
### MUST
- [ ] <constraint 1 — e.g., "Use Server Components by default, Client only when needed">
- [ ] <constraint 2>
### MUST NOT
- [ ] <antipattern 1 — e.g., "Do not use getServerSideProps in App Router">
- [ ] <antipattern 2>
### SHOULD
- [ ] <recommendation 1>

## Backend Constraints (<technology>)
### MUST
- [ ] ...
### MUST NOT
- [ ] ...
### SHOULD
- [ ] ...

## Database Constraints (<technology>)
### MUST
- [ ] ...
### MUST NOT
- [ ] ...

## API Constraints
### MUST
- [ ] ...

## Infrastructure Constraints
### MUST
- [ ] ...

## Testing Constraints
### MUST
- [ ] <e.g., "Every API endpoint must have integration test">
- [ ] <e.g., "Critical user flows must have e2e tests">
### Test Pyramid Target
- Unit: <X>%
- Integration: <Y>%
- E2E: <Z>%

## Security Constraints
### MUST
- [ ] ...
### MUST NOT
- [ ] ...

Step 7: Return Summary

Compact summary: architecture pattern, number of constraints defined, key per-tech decisions, any concerns about pattern compatibility.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.