Agent Skills › DotHarness/dotcraft › dotcraft-dev-guide

dotcraft-dev-guide

GitHub

DotCraft 项目开发规范,涵盖协议优先、契约生成、工具模式及测试要求。指导代码修改、协议更新和 Agent 技能开发。

.agents/skills/dotcraft-dev-guide/SKILL.md DotHarness/dotcraft

Trigger Scenarios

修改 DotCraft 仓库代码或协议 调整 Agent prompts 或 Skills 涉及外部接口变更的兼容性检查

Install

npx skills add DotHarness/dotcraft --skill dotcraft-dev-guide -g -y
More Options

Non-standard path

npx skills add https://github.com/DotHarness/dotcraft/tree/main/.agents/skills/dotcraft-dev-guide -g -y

Use without installing

npx skills use DotHarness/dotcraft@dotcraft-dev-guide

指定 Agent (Claude Code)

npx skills add DotHarness/dotcraft --skill dotcraft-dev-guide -a claude-code -g -y

安装 repo 全部 skill

npx skills add DotHarness/dotcraft --all -g -y

预览 repo 内 skill

npx skills add DotHarness/dotcraft --list

SKILL.md

Frontmatter
{
    "name": "dotcraft-dev-guide",
    "description": "Development conventions for the DotCraft repository. Use when changing its code, protocols, specs, agent prompts, or skills."
}

DotCraft Development Guide

Project-specific workflow and norms for DotCraft. For general language and framework style, follow the relevant ecosystem conventions. For repo orientation, read the applicable AGENTS.md files.

Development Workflow

Spec-First

When modifying protocol designs or process flows defined in specs/, update the spec first, then implement. If a proposed change conflicts with an existing spec, resolve the spec-level conflict before touching code.

Completion Criteria

  • Reuse suitable codebase patterns before introducing new abstractions.
  • Keep implementation, affected specifications, documentation, examples, and localized content aligned with the resulting behavior.
  • Add XML documentation to public C# APIs only when it explains a necessary, non-obvious contract. Like other comments, keep each to at most one or two sentences.
  • Complete the relevant validation below and report the results and any blockers concisely.

Compatibility and Generated Contracts

When changing an external surface, check affected AppServer clients, CLI arguments, configuration, persisted sessions and resume behavior, and public SDK APIs. Account for supported consumers and stored data even when no caller appears in this repository.

For AppServer wire-contract changes, update the owning spec and C# contracts or RPC catalog, then run these commands from the repository root:

dotnet run --project tools/DotCraft.ProtocolGen -- generate
dotnet run --project tools/DotCraft.ProtocolGen -- check

Review source and generated artifacts together and include both in the same change. Follow specs/sdk/protocol-contract-generation.md for profiles and compatibility diffs; generated schemas and SDK bindings are not independent sources to edit.

Tool Schemas And Prompt Cache

When adding or changing model-visible tools, account for prompt cache stability. Avoid changing the tool schema solely because the thread switches operational modes, such as Plan to Agent. Prefer keeping the model-visible tool surface stable and enforcing mode-specific behavior with execution policy, runtime scopes, and prompt guidance.

Mode-specific tool removal is appropriate only when the mode represents a genuinely different role or runtime surface. For ordinary operational constraints, use ModeToolPolicy or an equivalent policy guard to reject disallowed calls, and make the current allowed tool usage clear in the system prompt or runtime context.

Agent Prompts And Skills

When creating or changing model-visible instructions, including system prompts, tool descriptions, and skills, read Prompt guide. It covers reference comparison, instruction placement, concise wording, and behavioral validation.

Testing Rules

Add tests when an observable contract changes, especially for protocol-dependent behavior and complex multi-step flows or state machines. Pure visual polish, copy changes, trivial refactors, and fixes that do not change an observable contract do not require new tests.

A meaningful test catches a real regression without duplicating existing coverage or testing language, framework, or private implementation details. Prefer assertions on public behavior, state, persisted data, wire payloads, and user-visible output. Use real temporary dependencies or small fakes instead of extensive mocking unless an interaction is itself the contract.

Tests must verify observable behavior, not repository layout or source/spec text; do not locate the repository root or assert that production files, directories, comments, prompts, or wording exist at fixed checkout paths. Filesystem assertions are appropriate only when file lifecycle is the behavior under test or the file is an explicit test fixture; otherwise use temporary fixtures and public APIs.

  • Frontend: Test behavior such as accessibility, state, navigation, IPC, serialization, and data mapping. Do not assert presentation such as rendered copy, class names, styles, geometry, or element order; verify it manually.
  • Core C#: Test through public APIs and observable results. Skip trivial formatters, getters, record equality, text passthrough, prompt wording, and framework behavior.

Validation

Select checks for the affected surface and its consumers. Complete required checks; broaden or repeat them only when new changes, failures, or unresolved concerns justify it.

Surface Entry points
.NET From the repo root, build the affected project with dotnet build <project.csproj> and run dotnet test <test-project.csproj>, optionally with --filter "FullyQualifiedName~TestClassName.TestMethodName". Use dotnet test dotcraft.sln when shared changes warrant the full suite.
Desktop In desktop/, run npm run typecheck and relevant tests with npm test -- <test-file>. Run npm run check:styles for renderer style changes.
TypeScript SDK and packages Use the owning package's package.json scripts for type checking and relevant tests. From sdk/typescript/, package scripts can be selected with npm run <script> --workspace <package-name>.
Documentation site When a rendered site page changes, run npm run build in docs/. Apply the documentation guide's artifact-specific checks for other Markdown and README changes.

For pure copy or visual changes, verify the affected content or presentation without adding tests that duplicate the implementation. Report any check that could not run and the reason.

Language Preference

Before changing localized UI, inspect the repository's current locale configuration and catalogs. Treat those as the source of truth and update every currently supported locale; do not rely on a locale list embedded in this skill.

  • Code comments: English
  • UI strings: The client owns UI localization. Update every locale discovered from the current source of truth, including message catalogs and data-driven UI text such as localized plugin or extension labels.
  • C# runtime/UI-adjacent messages: Do not add UI localization state or server-side translation catalogs. C# should emit stable machine-readable keys/codes plus English fallback text (FallbackText for CLI/server fallback copy). Desktop owns UI localization.
  • Protocol-visible system messages: New client-visible notifications and errors must provide a stable key/code, structured params where useful, and an English fallback. User text, model output, and raw tool output must pass through unchanged.

Documentation

Use dotcraft-docs-guide for all documentation and repository README work.

References

  • For SVG assets shipped with built-in skills, read references/svg-style.md.

Version History

  • 071b4d1 Current 2026-10-18 22:47

Same Skill Collection

.agents/skills/dotcraft-docs-guide/SKILL.md
.agents/skills/dotcraft-release-draft/SKILL.md
.agents/skills/dotcraft-simplify/SKILL.md
.agents/skills/fix-oratorio-review/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/automations/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/create-hooks/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/cron/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/dotcraft-api/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/dotcraft-guide/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/generative-ui/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/heartbeat/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/memory/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/plugin-creator/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/skill-authoring/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/skill-installer/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/visualize/SKILL.md
src/DotCraft.Core/Skills/BuiltIn/workflow-authoring/SKILL.md
src/DotCraft.TraceViewer/Skills/BuiltIn/trace-review/SKILL.md

Metadata

Files
0
Version
071b4d1
Hash
5ecb5811
Indexed
2026-10-18 22:47

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 05:52
浙ICP备14020137号-1