Agent Skillsopen-circle/formisch › repo-website-api-update

repo-website-api-update

GitHub

当Formisch库源码(函数签名、类型、接口或JSDoc)发生变更时,同步更新网站API文档。遵循源码为唯一真理原则,涵盖从分析变更、定位文件到更新properties.ts和index.mdx的完整流程及示例。

.agents/skills/repo-website-api-update/SKILL.md open-circle/formisch

触发场景

Formisch源码中函数签名、类型或接口发生变动 JSDoc注释描述或参数说明需要更新 验证逻辑、错误消息或默认值等行为发生变化 函数被弃用、重命名或移除

安装

npx skills add open-circle/formisch --skill repo-website-api-update -g -y
更多选项

非标准路径

npx skills add https://github.com/open-circle/formisch/tree/main/.agents/skills/repo-website-api-update -g -y

不安装直接使用

npx skills use open-circle/formisch@repo-website-api-update

指定 Agent (Claude Code)

npx skills add open-circle/formisch --skill repo-website-api-update -a claude-code -g -y

安装 repo 全部 skill

npx skills add open-circle/formisch --all -g -y

预览 repo 内 skill

npx skills add open-circle/formisch --list

SKILL.md

Frontmatter
{
    "name": "repo-website-api-update",
    "metadata": {
        "author": "formisch",
        "version": "1.0"
    },
    "description": "Update existing API documentation when Formisch source code changes. Use when function signatures, types, interfaces, or JSDoc comments change in the library source."
}

Updating API Documentation

API documentation must stay synchronized with source code. When functions, types, or interfaces change in the Formisch packages, update the corresponding documentation.

Key Principle: Source code is the single source of truth. Documentation must never deviate from what's actually implemented.

When to Update

Update documentation when:

  • Function signatures change - New/removed parameters, type changes, generic constraints
  • Interfaces change - New/modified/removed properties
  • JSDoc comments change - Descriptions, param docs, hints
  • Behavior changes - Validation logic, error messages, defaults
  • Deprecations or renames - Functions deprecated or renamed

Do NOT update when:

  • Only internal implementation changes
  • Private/internal functions change
  • Test files change
  • Non-JSDoc comments change

Update Process

Step 1: Understand the Changes

Compare source code changes:

git diff HEAD~1 packages/core/src/path/to/file.ts

Categorize changes:

  • Breaking changes: Signature changes, removed parameters
  • Additions: New parameters, overloads, properties
  • Documentation changes: JSDoc updates
  • Behavioral changes: Logic affecting usage

Step 2: Find Affected Documentation

Locate files to update:

/website/src/routes/(docs)/{framework}/api/{category}/{ApiName}/
├── index.mdx
└── properties.ts

Step 3: Update properties.ts

Ensure types match new source code:

// If generic constraint changed from:
TInput
// To:
TInput extends string | number

// Update properties.ts:
TInput: {
  modifier: 'extends',
  type: {
    type: 'union',
    options: ['string', 'number'],
  },
},

Step 4: Update index.mdx

  1. Front matter: Update source path if file moved
  2. Function signature: Match new signature exactly
  3. Generics section: Add/remove/update generics
  4. Parameters section: Add/remove/update parameters
  5. Explanation: Update if behavior changed
  6. Examples: Update to use new API correctly
  7. Related section: Update cross-references

Step 5: Update Related Files

  • Type documentation: If interfaces changed
  • menu.md: If function renamed/moved
  • Guide files: If usage patterns changed

Common Change Scenarios

Adding a Parameter

Source change:

// Before
export function validate(form: FormStore): void;

// After (added config)
export function validate(form: FormStore, config?: ValidateConfig): void;

properties.ts update:

// Add new parameter
config: {
  type: {
    type: 'union',
    options: [
      { type: 'custom', name: 'ValidateConfig', href: '../ValidateConfig/' },
      'undefined',
    ],
  },
},

index.mdx update:

  • Update function signature
  • Add to Parameters section
  • Update Explanation to mention new parameter
  • Add examples using new parameter

Removing a Parameter (Breaking)

  1. Remove from properties.ts
  2. Update function signature in index.mdx
  3. Remove from Parameters section
  4. Update all examples
  5. Consider adding migration note

Changing Types

Source change:

// Before
TRequirement extends number

// After
TRequirement extends number | string

properties.ts update:

TRequirement: {
  modifier: 'extends',
  type: {
    type: 'union',
    options: ['number', 'string'],
  },
},

Adding Interface Properties

Update type documentation:

// In properties.ts, add new property
received: {
  type: 'string',
},

Update index.mdx Definition section:

- `StringIssue` <Property {...properties.BaseIssue} />
  - `kind` <Property {...properties.kind} />
  - `type` <Property {...properties.type} />
  - `received` <Property {...properties.received} /> <!-- Added -->

Function Renamed

  1. Rename folder: mv /api/oldName /api/newName
  2. Update properties.ts references
  3. Update all occurrences in index.mdx
  4. Update menu.md (maintain alphabetical order)
  5. Update guide files
  6. Update related API docs that reference this function

Deprecation

Add deprecation notice after description:

# oldFunction

Creates a form store.

> **⚠️ Deprecated**: Use <Link href="../newFunction/">`newFunction`</Link> instead. This function will be removed in v2.0.

Link Updates

Cross-Package Links (Use Absolute)

// ✅ Correct
href: '/core/api/FormSchema/';

// ❌ Wrong - relative won't work across packages
href: '../../../core/api/FormSchema/';

Qwik Routing (Exclude Parentheses)

// ✅ Correct
href: '../FormStore/';

// ❌ Wrong - Qwik ignores (types) segment
href: '../(types)/FormStore/';

Verification Checklist

Source Code Accuracy

  • All generic constraints match source exactly
  • All parameter types match source exactly
  • Return type matches source exactly
  • Function signature identical to source

Type Links

  • All href links point to existing documentation
  • Generic references use correct names
  • No broken links to removed types

Examples

  • All examples use updated API correctly
  • Examples compile with new signature
  • New features demonstrated in examples

Consistency

  • Tone and style match existing docs
  • Naming conventions maintained
  • Related section accurate

Cleanup

  • All properties in properties.ts are actually used
  • Remove any unused properties
  • No orphaned references

Quick Reference

Properties.ts Pattern for Optional Parameter

// Optional = union with undefined
config: {
  type: {
    type: 'union',
    options: [
      { type: 'custom', name: 'Config', href: '../Config/' },
      'undefined',
    ],
  },
},

Multiple Overloads in Signature

\`\`\`ts
const result = fn<TSchema>(form);
const result = fn<TSchema, TPath>(form, config);
\`\`\`

Type Reference Rules

Reference generic parameter names, not base types:

// ✅ Correct - use parameter name
generics: [{ type: 'custom', name: 'TFieldPath' }];

// ❌ Wrong - using constraint type
generics: [{ type: 'custom', name: 'RequiredPath' }];

版本历史

  • 09acd5e 当前 2026-07-24 11:30

同 Skill 集合

.agents/skills/repo-prepare-release/SKILL.md
.agents/skills/repo-source-code-document/SKILL.md
.agents/skills/repo-source-code-review/SKILL.md
.agents/skills/repo-source-code-test-frameworks/SKILL.md
.agents/skills/repo-source-code-test-packages/SKILL.md
.agents/skills/repo-structure-navigate/SKILL.md
.agents/skills/repo-website-api-create/SKILL.md
.agents/skills/repo-website-api-review/SKILL.md
.agents/skills/repo-website-guide-create/SKILL.md
website/public/.well-known/agent-skills/formisch/SKILL.md

元信息

文件数
0
版本
865212e
Hash
7374d54d
收录时间
2026-07-24 11:30

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-08 03:40
浙ICP备14020137号-1 $访客地图$