mirror of
https://github.com/GabrielVidal1/ask-form.git
synced 2026-12-02 02:07:27 +01:00
A Go tool that lets Claude Code (or any CLI agent) ask structured questions through a private web form, answered from any browser, with the answers returned as JSON. One binary (`ask-form`) per machine plus a public relay (`ask-form-relay`); one-command install, releases, upgrade and auto-upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
951 B
Go
36 lines
951 B
Go
// Package skill holds the agent instructions for ask-form: SKILL.md is the
|
|
// Claude Code skill `ask-form setup` installs, and its body is what other
|
|
// agents get (`ask-form skill print --body`).
|
|
package skill
|
|
|
|
import (
|
|
_ "embed"
|
|
"strings"
|
|
)
|
|
|
|
// Markdown is SKILL.md, frontmatter included.
|
|
//
|
|
//go:embed SKILL.md
|
|
var Markdown string
|
|
|
|
// Marker identifies a SKILL.md that ask-form wrote (and may rewrite).
|
|
const Marker = "<!-- Installed by `ask-form setup`"
|
|
|
|
// Body is SKILL.md without its frontmatter and install marker: the part to
|
|
// paste into another agent's instructions (AGENTS.md, .cursorrules…).
|
|
func Body() string {
|
|
s := Markdown
|
|
if strings.HasPrefix(s, "---\n") {
|
|
if i := strings.Index(s[4:], "\n---\n"); i >= 0 {
|
|
s = s[4+i+5:]
|
|
}
|
|
}
|
|
var keep []string
|
|
for _, l := range strings.Split(s, "\n") {
|
|
if !strings.HasPrefix(l, Marker) {
|
|
keep = append(keep, l)
|
|
}
|
|
}
|
|
return strings.TrimLeft(strings.Join(keep, "\n"), "\n")
|
|
}
|