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

dotcraft-dev-guide

GitHub

DotCraft开发规范,指导协议、代码及Agent技能的修改流程。强调Spec优先、兼容性处理、生成契约更新及Prompt缓存稳定性,确保实现与规范一致。

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

Trigger Scenarios

修改DotCraft仓库代码或协议 调整Agent提示词或技能定义 变更外部接口或SDK API

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, update the affected AppServer clients, CLI arguments, configuration, and public SDK APIs in this repository in the same change. Breaking changes are allowed: older saved threads, configuration, clients, and hosts may stop working, so do not add aliases, legacy parsers, or migration code. When existing workspace data must change shape, put the one-time rewrite in the current release's upgrade under src/DotCraft.Core/Persistence/Upgrades/, replacing the previous release's upgrade (session-core.md §9.1.1).

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

  • 829157d Current 2026-11-02 15:17

    对齐兼容性规则与审查指南;修复工作区重命名时线程保留问题并添加0.9.2升级逻辑。

  • 071b4d1 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
829157d
Hash
068beae4
Indexed
2026-10-18 22:47

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-02 17:34
浙ICP备14020137号-1