Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 22, 2025

Overview

Updated the imports documentation (/docs/src/content/docs/reference/imports.md) to add a concise syntax reference for all supported import path formats.

Changes

Added Minimal Path Formats Section

The documentation now includes a concise "Path Formats" section with syntax reference for:

  1. Local Paths - Relative paths (shared/, ../), and absolute paths
  2. Remote (Workflowspec) - GitHub repository imports with format owner/repo/path/file.md[@ref]
  3. Section References - Extract specific sections using #SectionName
  4. Optional Imports - Using {{#import?}} for optional includes

Each format is documented with minimal syntax examples showing the essential patterns without verbose explanations or detailed examples.

Testing

  • All existing unit tests pass
  • No changes to functionality, only documentation
  • Syntax reference verified against actual implementation in pkg/parser/frontmatter.go and pkg/workflow/imports.go

Related

Closes issue requesting documentation of all supported import path formats.

Original prompt

Update the frontmatter "imports" documentation under /docs with all the supported URL and path formats


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add comprehensive section on supported path formats
- Document local relative paths, workflowspec format, section references
- Document optional imports syntax and deprecated legacy syntax
- Add practical examples for each format type
- Include combined examples showing multiple formats together
- Clarify behavior of path resolution and section extraction

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update frontmatter imports documentation with supported formats Update imports documentation with comprehensive path format reference Oct 22, 2025
Copilot AI requested a review from pelikhan October 22, 2025 03:17
Comment on lines 92 to 141
**Requirements:**
- Must have at least 3 parts: `owner/repo/path`
- Cannot start with `.`, `shared/`, or `/` (these indicate local paths)
- File is downloaded from GitHub at compile time

### 3. Section References

Import only a specific section from a markdown file:

```yaml
imports:
- shared/guidelines.md#SecurityNotice
- githubnext/agentics/docs/best-practices.md@v1.0.0#Testing
```

**Behavior:**
- Extracts content from the specified header to the next same-level or higher-level header
- Supports H1 (`#`), H2 (`##`), and H3 (`###`) headers
- Section names are case-sensitive
- Works with both local and remote (workflowspec) paths

### 4. Optional Imports

Mark imports as optional using the `?` modifier (supported in markdown directives only):

```markdown
{{#import? shared/optional-config.md}}
{{#import? githubnext/agentics/experimental/beta-feature.md@develop}}
```

**Behavior:**
- If the file doesn't exist, a friendly informational message is shown
- Compilation continues without error
- Useful for environment-specific or conditional configurations

**Note:** Optional imports are only supported in markdown `{{#import?}}` directives, not in frontmatter `imports:` field.

### 5. Deprecated Syntax (Legacy)

The following syntax is deprecated but still supported:

```markdown
@include shared/file.md
@import shared/file.md
@include? shared/optional.md
```

**Migration:** Use `{{#import}}` instead:
- `@include path` → `{{#import path}}`
- `@include? path` → `{{#import? path}}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the deprecated syntax section in commit 365da41.

Remove the "Deprecated Syntax (Legacy)" section as requested by @pelikhan

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 22, 2025 03:48
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot minimize changes, just minimal syntax reference, no examples

Replace verbose examples with minimal path format syntax reference as requested

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 22, 2025

@copilot minimize changes, just minimal syntax reference, no examples

Minimized to just syntax reference in commit 4b7740a. Removed all verbose examples and kept only the essential path format syntax.

Copilot AI changed the title Update imports documentation with comprehensive path format reference Add minimal path format syntax reference to imports documentation Oct 22, 2025
Copilot AI requested a review from pelikhan October 22, 2025 04:03
@pelikhan pelikhan marked this pull request as ready for review October 22, 2025 04:34
@pelikhan pelikhan merged commit fb9c7f4 into main Oct 22, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/update-frontmatter-imports-docs branch October 22, 2025 04:34
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants