본문으로 건너뛰기
cccskills
무료GitHub에 공개

rseng-software-design

Covers designing research software: modularity and separation of concerns, interfaces and coupling, growing from script to package, the rule of three and the reuse ladder, architecture styles for research systems (pipeline, layered, plugin, services), quality-attribute trade-offs, visual design documentation (C4, Mermaid, PlantUML diagrams-as-code) and architecture decision records. Use when starting non-trivial research software, when a script has grown past easy understanding, when the user asks how to structure or architect code, wants an architecture, API or data-flow diagram, or mentions modularity, coupling, design patterns or refactoring toward structure. For file layout and style see rseng-code-quality; for restructuring inherited code see rseng-legacy-code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills스타 24(GitHub 24 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md11.7 KB
  • references.md579 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Designing research software

Design is deciding what depends on what - everything else is detail. Research code has a characteristic failure mode: the 2,000-line script that grew one working line at a time until nobody can change anything without breaking everything. Design is the prevention, and it is proportional: an exploration notebook needs none, a shared analysis package needs some, community infrastructure needs real architecture. Name the tier (the same tiering rseng-management-planning and rseng-fairguard use) and design to it - overdesign wastes research time as surely as underdesign does.

The core moves

  • Separate concerns ruthlessly: I/O, computation and presentation in different functions/modules. The single highest-payoff research refactor is splitting "read + compute + plot" scripts - it makes the computation testable (rseng-testing), the I/O swappable (rseng-scientific-file-formats) and the plotting rerunnable (rseng-scientific-visualization).
  • Functions over scripts, parameters over globals and edits: code a colleague runs with different inputs must take the inputs as arguments, not require editing line 12 (configuration files for run-level choices - rseng-reproducibility).
  • Pure cores, effectful edges: keep the science (the math, the model) in pure functions that take data and return data; push file paths, printing and state to the boundary. Pure cores are the cheapest code to test, parallelize (rseng-hpc-computing) and reason about numerically (rseng-numerical-accuracy).
  • Interfaces before internals: design what callers see (function signatures, data structures) deliberately - internals can be rewritten, published interfaces cannot without breaking users (rseng-maintenance-sustainability's deprecation discipline).
  • Data structures ARE design: choosing "a DataFrame with these named columns and units documented" over "parallel lists" does more for a codebase than any pattern; make the domain's own concepts (Spectrum, Cohort, Grid) explicit types when they recur.

Coupling and cohesion, the working test

Good structure = things that change together live together; things that change separately depend on each other as little as possible. Practical checks an agent can apply while reviewing or writing:

  • Can you test this function without a filesystem, network or 20-minute setup? If not, coupling is too tight.
  • If the file format changes, how many modules change? (Should be one - rseng-scientific-file-formats.)
  • Does module A need A-internals of module B, or only its interface? Reaching into internals is the smell.
  • Could a colleague reuse the core computation in their pipeline without dragging your plotting and paths along?

Growing structure honestly

Research software evolves script -> module -> package; design effort follows evidence, not aspiration:

  • Extract when it hurts: the second copy-paste, the third positional argument nobody remembers, the first "do not touch this part" - each is the signal to extract a function or module, not before (rseng-legacy-code's seams, applied preemptively).
  • Package structure when sharing: the src-layout, entry points and API surface come when others will install it (rseng-project-scaffolding provides the shape).
  • Patterns are vocabulary, not goals: use a known pattern when the problem genuinely recurs (strategy for interchangeable models, pipeline stages for rseng-workflows shapes); a pattern imposed on a problem that does not have it is complexity with a name.

Modularity that enables reuse

Reusable code is modular code with its assumptions made explicit - design for the SECOND user from the start, cheaply:

  • The rule of three: generalize on the third use, not the first - premature generality is speculative complexity, but the third copy-paste is the signal to extract the shared unit (rseng-software-metrics' duplication numbers find these).
  • Extractable by construction: pure cores with explicit inputs (no reads of project-global config inside the science function), no hardwired paths, units and conventions documented at the interface (rseng-defensive-coding) - the difference between "our script" and "a function any colleague can import".
  • The reuse ladder: function within the project -> module with its own tests -> package others install (rseng-project-scaffolding, rseng-software-publishing). Climb when demand exists - a colleague asking twice IS demand - and note that well-factored modules are what make the strangler and migration paths cheap later (rseng-legacy-code, rseng-open-source-migration).
  • Do not lock reusable parts to the project: a general-purpose reader/solver/plotter that imports project internals cannot leave; keep the dependency arrow pointing from project to reusable unit, never back.
  • Reuse others before designing your own (rseng-software-reuse) - the most modular design is the module you did not have to write; and when you publish a reusable unit, its interface stability becomes a promise (rseng-maintenance-sustainability's deprecation discipline).

Architecture: the system level

When the software is a SYSTEM - multiple components, deployments or consumers - structure needs deciding above the module level. The styles that recur in research software, each fitting a shape of problem:

  • Pipeline: stages transforming data in sequence - the natural architecture for analysis and processing (rseng-workflows is its operational form); keep stages independently runnable with explicit intermediate formats (rseng-scientific-file-formats).
  • Layered: computation core, orchestration, interface - the architecture behind "pure cores, effectful edges" scaled up; the core must stay importable without the layers above it (a CLI, a notebook and a web UI should share one core).
  • Plugin: a stable kernel with extension points - the architecture of extensible research tools (analysis frameworks, format readers, method registries); invest in it when third parties or future-you will add capabilities without touching the kernel (rseng-community-governance benefits: contributors write plugins, not core patches).
  • Services: components behind network interfaces - justified by independent scaling, deployment or team boundaries, and paid for in operational burden; a research group rarely wants five services where one process would do.

Choose by quality attributes, stated out loud: what must this system do well - throughput (rseng-performance-profiling, rseng-big-data-processing), portability across laptop and cluster (rseng-hpc-computing), extensibility, auditability of results (rseng-provenance)? Architecture is the trade among them; a choice that cannot name the attribute it serves is fashion. Record the trade in an ADR (below).

Document the architecture at two zoom levels, C4-style: a context diagram (the system among its users and neighbors) and a container/ component view (the major pieces and their dependencies) - two small diagrams that stay updatable beat a mural that rots (drawn as code per the diagram section below; rseng-documentation's developer-notes section is their home). Re-draw at milestones; a diagram that no longer matches the code is a review finding (rseng-code-review).

Record the decisions

For decisions with lasting consequences - core data structures, dependency choices (rseng-software-reuse), parallelization strategy, API shape - write a short architecture decision record (ADR): context, options, choice, consequences, dated, in the repository (rseng-documentation). Three paragraphs now saves the archaeology later (rseng-legacy-code exists because nobody wrote them), and ADRs are exactly the material design reviews and onboarding need.

Diagram the design, as code

When designing software, an architecture, an API or a data flow, produce a visual diagram as part of the documentation - not as a slide for one meeting. A reader forms a mental model from one good diagram faster than from pages of prose, and the act of drawing exposes coupling and unclear ownership while they are still cheap to fix.

  • Prefer diagrams-as-code so diagrams live in the repository, diff in review and regenerate with the docs: Mermaid (renders natively on GitHub/GitLab and in MkDocs/Sphinx), PlantUML for richer UML and C4 (C4-PlantUML), Graphviz for generated dependency graphs, D2 or draw.io ONLY with the source file committed next to the export.
  • Match the diagram to the question. Architecture: C4 context + container views (above). API design: a sequence diagram per core interaction showing who calls whom in what order, and for HTTP APIs the resource/endpoint map next to the OpenAPI spec. Data: a flow diagram from raw inputs through processing to published outputs (pairs with rseng-provenance's run records), and an entity-relationship sketch when there is a schema. State machines for anything with lifecycle (jobs, sessions, review states).
  • One question per diagram, roughly one screen: a diagram needing a legend for its legend answers nothing. Split rather than cram.
  • Keep them where the text is: embed in the README or docs page they support (Mermaid blocks render inline), store sources under docs/, and regenerate exports in the docs build rather than committing stale images.
  • Keep them true: a diagram that no longer matches the code is a review finding (rseng-code-review), exactly like a stale docstring. Re-draw at the milestones that change structure, and date what you cannot keep current so readers know its era.
  • Accessibility: give every embedded diagram a one-paragraph text equivalent - the caption IS documentation, and screen readers and grep cannot parse boxes (rseng-ux-accessibility).

Working with this skill

This skill is source-independent: it encodes established software design practice proportioned for research software. BSSW's design topic collects the community's deeper material; CodeRefinery teaches the modular-development moves hands-on.

Learn more (verified):

<!-- related-skills:begin -->

Related skills

Check whether any of these applies before moving on:

  • rseng-documentation - home for ADRs and diagrams
  • rseng-hpc-computing - pure cores ease parallelization
  • rseng-legacy-code - seams when refactoring existing structure
  • rseng-maintenance-sustainability - interface stability and deprecation promises
  • rseng-software-reuse - reuse others before designing your own
  • rseng-workflows - pipeline style's operational form
<!-- related-skills:end -->

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Covers operating AI coding agents securely: auditing whether the agent runs sandboxed, permission and dangerous-command configuration, containerized environments, secrets kept out of context, network egress and token privileges, prompt-injection risk, and the privacy of agent use itself. Use PROACTIVELY when permission gating is broadly disabled (skip-permissions modes), when secrets are visible to the agent's shell, or when the agent processes untrusted code, issues or web content; when a project holds personal or confidential data while a cloud agent is active (what leaves the machine, retention, training use), or when the user asks how to run coding agents safely or privately. (Supply-chain security: rseng-security; disclosing agent contributions: rseng-ai-declaration.)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

Covers declaring AI involvement with the AI Declaration Format (https://ai-declaration.org): creating and maintaining an aidecl.yaml that records which AI tools and agents were used, what each contributed, when and how much, plus the README disclosure footnote, JSON/JSON-LD export and CI validation. Machine-readable disclosure is the practice; this format is one implementation. Use PROACTIVELY when an AI assistant or agent creates or modifies a project's content - generate aidecl.yaml if missing, update it after AI-assisted changes. Also use when the user asks about AI transparency, provenance, disclosure or EU AI Act disclosure, wants to state that NO AI was used, or mentions aidecl. For concealment requests see rseng-honesty; for the human review duty see rseng-human-verification.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

Covers long-term archiving of research software and data: Software Heritage save requests and SWHID persistent identifiers, Zenodo deposits with versioned DOIs and forge integration, choosing domain and institutional repositories, deciding what to archive (code, data, environments, documentation) and when, and archiving at project retirement. Use when the user wants software or data preserved beyond the life of a forge account, grant or lab, mentions Software Heritage, SWHIDs, Zenodo deposits or archiving, retires or hands over a project, prepares artifacts that must stay resolvable for a paper, or when funder policy requires long-term preservation. (Cutting the release itself is rseng-publishing-releasing; day-to-day data storage and repository choice is rseng-data-management.)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

Covers processing research data that outgrows one machine's memory: out-of-core and chunked computation, Dask for scaling the scientific Python stack, Spark for distributed tabular pipelines, lazy evaluation, partitioning strategies, idempotent and restartable batch jobs, and knowing when NOT to distribute. Use when datasets no longer fit in memory, when the user mentions Dask, Spark, out-of-core or larger-than-memory data, when a pandas/NumPy workflow hits memory limits, or when designing batch pipelines over many files. (Cluster job submission and job arrays are rseng-hpc-computing; pipeline orchestration engines are rseng-workflows; profile first with rseng-performance-profiling.)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

Covers continuous integration and delivery for research software: CI/CD concepts, automating builds and tests with GitHub Actions and GitLab CI/CD, and wiring an organization's GitLab CI infrastructure to a GitHub-hosted project. Use when the user asks to set up CI, write a pipeline or workflow file (.github/workflows, .gitlab-ci.yml), add automated builds/tests on push or pull request, publish a package or deploy docs when a tag or release is cut, cache dependencies to speed up CI runs, choose between GitHub Actions and GitLab CI, use self-hosted or GPU runners, mirror a repo, or report external CI status back to GitHub. For what to test and shrinking a test matrix see rseng-testing; for linter and pre-commit policy see rseng-code-quality.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

Covers verifying that every citation is real, correct and current: checking references in manuscripts, READMEs, references files and code metadata against Crossref and OpenAlex, screening cited DOIs against the Retraction Watch database, catching fabricated or mis-attributed citations (a documented AI failure mode), and keeping bibliographies and CITATION.cff files resolvable. Use PROACTIVELY before any bibliography, reference list or citation metadata is finalized or published, whenever the agent itself has produced citations, and when the user asks to check references, mentions broken DOIs, retracted papers or citation verification, or prepares a manuscript, README or software paper with references. (Making your own software citable is rseng-citation-metadata.)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

fdiblen/rseng-agent-skills242026년 9월 23일 업데이트

fdiblen의 스킬 모두 보기

이 스킬의 문제 신고