Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
439ac30
feat(skilldoc): add __dump-commands cobra-tree oracle
ysyneu Jun 20, 2026
d85b3f1
feat(skilldoc): harvest fduty examples from markdown
ysyneu Jun 20, 2026
9f81cc4
feat(skilldoc): validate doc examples against command oracle
ysyneu Jun 20, 2026
b269b26
feat(skilldoc): generate per-domain factual fence from dump
ysyneu Jun 20, 2026
e8a04c4
feat(skilldoc): assert doc fences match fresh render
ysyneu Jun 20, 2026
176349c
feat(skilldoc): dev CLI + gen-cards/check-cards make targets + CI gate
ysyneu Jun 20, 2026
cb457fc
fix(skilldoc): tolerate bare/templated fduty mentions in prose
ysyneu Jun 20, 2026
c3b1453
feat(skilldoc): status-page command card (lean SKILL.md router + gene…
ysyneu Jun 20, 2026
b70f6ba
fix(skilldoc): render cligen positional-folded args, not as flags
ysyneu Jun 20, 2026
93a51bd
docs(skilldoc): teach status-page positional page-id in card + SKILL.md
ysyneu Jun 20, 2026
b656345
fix(skilldoc): stop harvesting at shell pipe so piped jq flags aren't…
ysyneu Jun 20, 2026
b7eef87
feat(skilldoc): roll out generated command cards to all 16 operationa…
ysyneu Jun 20, 2026
7c7fcc4
feat(skilldoc): add monit-query + monit-agent RCA cards + dispatch-de…
ysyneu Jun 20, 2026
33f6dc9
fix(skilldoc): correct integration-id + member-list provenance in enr…
ysyneu Jun 20, 2026
2cda592
feat(skilldoc): validator rejects folded-positional-as-flag; precise …
ysyneu Jun 20, 2026
0ce2efc
docs(skilldoc): surface 协作空间 (=channel) in the channel card's router
ysyneu Jun 20, 2026
af922ce
fix(skilldoc): gen-cards regenerates all cards; restore fduty install…
ysyneu Jun 20, 2026
a2464cc
fix(skilldoc): make card check EOL-insensitive (Windows CI) + satisfy…
ysyneu Jun 20, 2026
163875f
feat(skill): clean public boundary, merge oncall→schedule, bilingual …
ysyneu Jun 20, 2026
1c7deb8
chore(skill): withdraw skill from skills.sh; remove superseded per-do…
ysyneu Jun 20, 2026
f884414
Merge pull request #56 from flashcatcloud/feat/skilldoc-cards
ysyneu Jun 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Skill command-cards are compared byte-for-byte against a generated (LF) fence,
# so they must stay LF on every platform regardless of git's autocrlf setting.
# (The skilldoc tool also normalizes EOL on read; this keeps the committed files
# canonical so Windows checkouts don't materialize them as CRLF.)
skills/flashduty/**/*.md text eol=lf
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ jobs:

- name: Build
run: go build -v ./cmd/flashduty

# Skill command-cards must stay in sync with the CLI tree (equivalent to
# `make check-cards`; invoked directly so it runs on the Windows runner,
# which has no make).
- name: Check skill command-cards
run: go run ./internal/cmd/skilldoc check
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ test-v: ## Run unit tests with verbose output
test-cover: ## Run unit tests with coverage
$(GOTEST) -race -cover ./...

# ============================================================================
# Skill command-cards (internal/skilldoc)
# ============================================================================

.PHONY: gen-cards
gen-cards: ## Rewrite every card's generated fence from the CLI tree
$(GOCMD) run ./internal/cmd/skilldoc gen

.PHONY: check-cards
check-cards: ## Validate skills/flashduty cards against the command oracle
$(GOCMD) run ./internal/cmd/skilldoc check

# ============================================================================
# Pre-push check (recommended before pushing)
# ============================================================================
Expand Down
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,6 @@ Download the latest release for your platform from [GitHub Releases](https://git
| `MIRROR_URL` | Override installer release asset mirror | `https://static.flashcat.cloud/flashduty-cli` |
| `FLASHDUTY_UPDATE_BASE_URL` | Override `flashduty update` and auto update-check base URL | `https://static.flashcat.cloud/flashduty-cli` |

## Agent Skills

Flashduty CLI ships with 10 agent skills that teach AI coding agents how to operate Flashduty from your terminal. Compatible with 41+ agents including Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI, Windsurf, and more.

```bash
npx skills add flashcatcloud/flashduty-cli -y -g
```

The installer auto-detects which agents you have and installs skills to all of them.

### Available Skills

| Skill | Scope |
|-------|-------|
| `flashduty-shared` | Foundation: authentication, 3-layer model, global flags, safety rules |
| `flashduty-incident` | Incident lifecycle: triage, investigate, resolve, merge, snooze, reassign |
| `flashduty-alert` | Alert and alert event investigation: drill down, trace, merge |
| `flashduty-change` | Change event tracking and deployment frequency trends |
| `flashduty-oncall` | On-call schedule queries: who is on call, shift details |
| `flashduty-channel` | Channel and escalation rule lookups |
| `flashduty-statuspage` | Status page management and Atlassian → Flashduty migration |
| `flashduty-insight` | Analytics: MTTA/MTTR, noise reduction, notification trends |
| `flashduty-admin` | Team/member lookups and audit log search |
| `flashduty-template` | Notification template validation and preview |

---

## Quick Start

### 1. Authenticate
Expand Down
27 changes: 0 additions & 27 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,6 @@ irm https://static.flashcat.cloud/flashduty-cli/install.ps1 | iex
| `MIRROR_URL` | 覆盖安装脚本使用的 release 资源镜像 | `https://static.flashcat.cloud/flashduty-cli` |
| `FLASHDUTY_UPDATE_BASE_URL` | 覆盖 `flashduty update` 和自动更新检查的 base URL | `https://static.flashcat.cloud/flashduty-cli` |

## Agent Skills(AI 代理技能)

Flashduty CLI 内置 10 个代理技能,让 AI 编程代理能够通过 CLI 操作 Flashduty 平台。兼容 41+ 编程代理,包括 Claude Code、Cursor、GitHub Copilot、Codex、Gemini CLI、Windsurf 等。

```bash
npx skills add flashcatcloud/flashduty-cli -y -g
```

安装器会自动检测已安装的代理并为其安装技能。

### 可用技能

| 技能 | 范围 |
|------|------|
| `flashduty-shared` | 基础:认证、三层降噪模型、全局参数、安全规则 |
| `flashduty-incident` | 故障生命周期:分诊、调查、解决、合并、暂停、转派 |
| `flashduty-alert` | 告警与告警事件调查:下钻、追踪、合并 |
| `flashduty-change` | 变更事件追踪与部署频率趋势 |
| `flashduty-oncall` | 值班查询:当前值班人、排班详情 |
| `flashduty-channel` | 协作空间与升级规则查询 |
| `flashduty-statuspage` | 状态页管理以及从 Atlassian 迁移到 Flashduty |
| `flashduty-insight` | 分析:MTTA/MTTR、降噪率、通知趋势 |
| `flashduty-admin` | 团队/成员查询与审计日志搜索 |
| `flashduty-template` | 通知模板验证与预览 |

---

## 快速开始

### 1. 认证
Expand Down
33 changes: 33 additions & 0 deletions internal/cli/dump_commands.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cli

import (
"encoding/json"

"github.com/spf13/cobra"

"github.com/flashcatcloud/flashduty-cli/internal/skilldoc"
)

// RootForDump returns the fully-populated root command so dev tooling (the
// internal/cmd/skilldoc generator/validator) can build the command dump
// in-process, without shelling out to `flashduty __dump-commands`.
func RootForDump() *cobra.Command { return rootCmd }

// newDumpCommandsCmd builds the hidden `__dump-commands` command. It serializes
// the live cobra tree to indented JSON — the oracle the card generator and
// validator consume. Hidden because it is internal tooling, not a user verb.
func newDumpCommandsCmd() *cobra.Command {
return &cobra.Command{
Use: "__dump-commands",
Short: "Dump the command tree as JSON (internal tooling)",
Hidden: true,
RunE: func(cmd *cobra.Command, _ []string) error {
out, err := json.MarshalIndent(skilldoc.Build(rootCmd), "", " ")
if err != nil {
return err
}
_, err = cmd.OutOrStdout().Write(append(out, '\n'))
return err
},
}
}
29 changes: 29 additions & 0 deletions internal/cli/dump_commands_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cli

import (
"bytes"
"encoding/json"
"strings"
"testing"
)

func TestDumpCommands_EmitsJSONWithStatusPageChangeCreate(t *testing.T) {
cmd := newDumpCommandsCmd()
var out bytes.Buffer
cmd.SetOut(&out)
if err := cmd.RunE(cmd, nil); err != nil {
t.Fatalf("RunE: %v", err)
}

got := out.String()
if !json.Valid(out.Bytes()) {
t.Fatalf("output is not valid JSON:\n%s", got)
}
if !strings.Contains(got, `"status-page change-create"`) {
head := got
if len(head) > 400 {
head = head[:400]
}
t.Errorf("dump missing status-page change-create path; output head:\n%s", head)
}
}
3 changes: 3 additions & 0 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ func init() {
rootCmd.AddCommand(newMonitQueryCmd())
rootCmd.AddCommand(newMonitAgentCmd())

// Hidden command-tree oracle for the skill-card tooling (internal/skilldoc).
rootCmd.AddCommand(newDumpCommandsCmd())

// Generated commands (full OpenAPI coverage). Registered AFTER curated
// commands so curated leaves win on any name conflict (see genAddLeaf).
registerGenerated(rootCmd)
Expand Down
Loading