agentleFS
sunholo-datasunholo-data/ailang/.agents/skills/cli-doc-maintainer/SKILL.md

cli-doc-maintainer

Skill38 starsChanged 6 days agoApache-2.0View on GitHub

Maintain AILANG CLI help as single source of truth. Use when: adding new commands, adding environment variables, updating command behavior, auditing CLI documentation, ensuring help.go matches codebase implementation, improving CLI discoverability for AIs.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ensure AILANG CLI help system (ailang --help) remains the authoritative, accurate, and complete source of truth for all CLI features.

    line 8
  2. Distinctive:

    After adding new features (ensure they're documented)

    line 31
  3. Distinctive:

    Proactively: After implementing any user-facing CLI change

    line 33
  4. Distinctive:

    Run audit scripts to identify discrepancies:

    line 85
  5. Very specific:

    Missing command: Add to appropriate category in help.go

    line 98
  6. Distinctive:

    Missing env var: Document with clear purpose and example

    line 99
  7. Distinctive:

    Stale documentation: Remove or update

    line 100
  8. Distinctive:

    New feature: Add examples showing usage

    line 101
  9. Very specific:

    Update cmd/ailang/help.go:

    line 105
  10. Distinctive:

    Add new commands in correct category

    line 106
  11. Distinctive:

    Document new flags/subcommands

    line 107
  12. Distinctive:

    Add environment variables with examples

    line 108
  13. Distinctive:

    Practical Examples: Every major command has a working example

    line 164
  14. Distinctive:

    Run audits after every CLI change (make it a habit)

    line 169
  15. Very specific:

    Keep main help.go under 250 lines (currently ~220)

    line 172
  16. Distinctive:

    Test examples actually work before documenting them

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CLI Documentation Maintainer

Ensure AILANG CLI help system (ailang --help) remains the authoritative, accurate, and complete source of truth for all CLI features. Critical for AI discoverability in external repositories where AGENTS.md isn't available.

Quick Start

Most common usage:

# User says: "I added a new command, update the help"
# This skill will:
# 1. Audit help.go against main.go for missing commands
# 2. Check environment variables usage
# 3. Suggest improvements to help text
# 4. Validate all documented features exist
# 5. Update help.go with new content

When to Use This Skill

Invoke this skill when:

  • Adding new commands to cmd/ailang/main.go
  • Adding new environment variables (DEBUG_, AILANG_, etc.)
  • Updating command behavior or flags
  • Auditing CLI documentation for accuracy
  • Improving CLI discoverability for AIs
  • After adding new features (ensure they're documented)
  • Quarterly CLI documentation review
  • Proactively: After implementing any user-facing CLI change

Available Scripts

scripts/audit_commands.sh

Compare commands in main.go against help.go to find undocumented commands.

Usage:

scripts/audit_commands.sh

Output:

  • Lists all commands in main.go
  • Highlights commands missing from help.go
  • Shows commands in help.go that don't exist in main.go (stale)
  • Exit code 0 if synchronized, 1 if discrepancies found

scripts/audit_env_vars.sh

Find environment variables used in codebase and compare against help.go documentation.

Usage:

scripts/audit_env_vars.sh

Output:

  • Lists all DEBUG_* and AILANG_* variables found in internal/
  • Shows which are documented in help.go
  • Highlights undocumented variables
  • Flags documented variables that don't exist in code (stale)
  • Exit code 0 if synchronized, 1 if discrepancies found

scripts/suggest_improvements.sh

Analyze help text organization and suggest improvements.

Usage:

scripts/suggest_improvements.sh

Output:

  • Checks help text length (should be scannable)
  • Verifies examples are present
  • Suggests missing categories or groupings
  • Recommends cross-references between related commands
  • Flags verbose or unclear descriptions

Workflow

1. Audit Phase

Run audit scripts to identify discrepancies:

# Check commands
.Codex/skills/cli-doc-maintainer/scripts/audit_commands.sh

# Check environment variables
.Codex/skills/cli-doc-maintainer/scripts/audit_env_vars.sh

2. Analysis Phase

For each discrepancy found:

  • Missing command: Add to appropriate category in help.go
  • Missing env var: Document with clear purpose and example
  • Stale documentation: Remove or update
  • New feature: Add examples showing usage

3. Update Phase

Update cmd/ailang/help.go:

  • Add new commands in correct category
  • Document new flags/subcommands
  • Add environment variables with examples
  • Include practical usage examples
  • Maintain consistent formatting

4. Validation Phase

# Rebuild binary
make quick-install

# Test help output
ailang --help

# Test specific command help
ailang <command> --help

# Verify examples work
# (copy examples from help and test them)

5. Documentation Phase

Update supporting documentation:

  • CHANGELOG.md - Document CLI changes
  • This skill's reference.md - Update best practices if needed
  • Website docs (docs/docs/) - Mirror critical CLI info

Resources

CLI Documentation Best Practices

See resources/best_practices.md for:

  • Formatting conventions
  • Category organization
  • Example writing guidelines
  • Environment variable naming conventions

Help Text Template

See resources/help_template.md for:

  • Command entry templates
  • Category section templates
  • Environment variable documentation template
  • Example section templates

Progressive Disclosure

This skill loads information progressively:

  1. Always loaded: This SKILL.md file (YAML frontmatter + workflow overview)
  2. Execute as needed: Scripts in scripts/ (audit, validate)
  3. Load on demand: resources/best_practices.md, resources/help_template.md

Design Principles

  1. CLI as Source of Truth: Help text is THE authoritative reference
  2. AI-First: Optimize for discoverability by AIs in external repos
  3. Progressive Disclosure: Main help scannable, detailed help via subcommands
  4. Practical Examples: Every major command has a working example
  5. Accurate: Zero stale documentation - audit regularly

Notes

  • Run audits after every CLI change (make it a habit)
  • Environment variables must be used in code before documenting
  • Commands must exist in main.go before adding to help.go
  • Keep main help.go under 250 lines (currently ~220)
  • Per-command help (e.g., coordinator --help) can be longer
  • Test examples actually work before documenting them

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.