Reorganize workspace and archive skill artifacts

This commit is contained in:
zhuyongxin
2026-05-20 11:39:30 +08:00
parent 0e0275d46a
commit f45122dafb
83 changed files with 9733 additions and 15 deletions
@@ -0,0 +1,39 @@
## ADDED Requirements
### Requirement: Knowledge entry discovery
The system SHALL scan all directories matching the pattern `knowledge/entries/knowledge_YYYYMMDD_Title/` and extract metadata from each entry's `.md` file.
If `knowledge/entries/` does not exist, the system SHALL fall back to scanning `knowledge_YYYYMMDD_Title/` directories in the project root for backward compatibility.
Metadata fields to extract from YAML frontmatter:
- `title` (required) — entry title
- `author` (optional) — author name
- `date` (optional) — creation date from directory name (YYYYMMDD)
- `tags` (optional) — array of tags
#### Scenario: Valid knowledge directory with complete frontmatter
- **WHEN** a directory `knowledge/entries/knowledge_20260518_mattpocock_skills/` contains `knowledge_20260518_mattpocock_skills.md` with valid YAML frontmatter including title, author, date, and tags
- **THEN** the system extracts all metadata fields and displays them in the index
#### Scenario: Knowledge directory with minimal frontmatter
- **WHEN** a knowledge directory has a `.md` file whose frontmatter contains only `title` (no tags, no author)
- **THEN** the system extracts the title and treats tags as an empty array
#### Scenario: Missing or malformed YAML frontmatter
- **WHEN** a knowledge directory's `.md` file has no YAML frontmatter or the frontmatter is malformed
- **THEN** the system SHALL display the entry using the directory name as a fallback title, with "unknown" date and no tags
#### Scenario: Multiple knowledge directories present
- **WHEN** the project contains 10 knowledge directories
- **THEN** the system SHALL display all 10 entries sorted by date descending
### Requirement: Manifest-based file discovery
The system SHALL generate an inline JavaScript entries array from the local filesystem at build time.
#### Scenario: Entries contain valid paths
- **WHEN** the generated entries array contains paths such as `knowledge/entries/knowledge_20260417_Waza`
- **THEN** the system SHALL render each entry and link its title to the corresponding `.html` file
#### Scenario: Backward-compatible root directory scan
- **WHEN** `knowledge/entries/` does not exist and root-level `knowledge_YYYYMMDD_Title/` directories exist
- **THEN** the system SHALL scan root-level knowledge directories and render them normally
@@ -0,0 +1,35 @@
## ADDED Requirements
### Requirement: Tag-based related entries
The system SHALL display a list of all unique tags across all knowledge entries. When a user clicks a tag, the system SHALL show only the entries that have that tag, and within each displayed entry, highlight the clicked tag.
#### Scenario: Clicking a tag filters entries
- **WHEN** user clicks the "Claude Code" tag
- **THEN** only entries tagged with "Claude Code" are displayed, and the tag is visibly active/selected
#### Scenario: Clicking the same tag again deselects
- **WHEN** user clicks an already-selected tag
- **THEN** the tag filter is removed and all entries are displayed again
#### Scenario: Entry has no tags
- **WHEN** a knowledge entry has no tags in its YAML frontmatter
- **THEN** the entry is displayed without any tag badges and is not matched by any tag filter click
#### Scenario: Multiple entries share a tag
- **WHEN** two or more entries share the same tag
- **THEN** clicking that tag shows all matching entries simultaneously
### Requirement: Related entries section
For each knowledge entry, the system SHALL display a "相关内容" (Related Content) section showing links to other entries that share at least one tag with the current entry.
#### Scenario: Entry has related entries
- **WHEN** entry A has tags ["Claude Code", "TypeScript"] and entry B has tags ["Claude Code", "React"]
- **THEN** under entry A, entry B is shown as related content (matching on "Claude Code")
#### Scenario: Entry has no related entries
- **WHEN** an entry's tags do not match any other entry's tags
- **THEN** no "相关内容" section is displayed for that entry
#### Scenario: Entry has no tags
- **WHEN** an entry has an empty tags array
- **THEN** no "相关内容" section is displayed and the entry is not included in any other entry's related content
@@ -0,0 +1,39 @@
## ADDED Requirements
### Requirement: Full-text search
The system SHALL provide a text input that filters knowledge entries in real-time as the user types. Filtering SHALL match against both metadata (title, tags) and the full body text of each knowledge entry.
#### Scenario: Search matches entry title
- **WHEN** user types "matt" in the search input
- **THEN** only entries whose title or body contains "matt" (case-insensitive) are displayed
#### Scenario: Search matches entry body text
- **WHEN** user types "三层加载" in the search input
- **THEN** all entries whose body text contains "三层加载" are displayed
#### Scenario: Search matches tag
- **WHEN** user types "Claude Code" in the search input
- **THEN** all entries tagged with "Claude Code" are displayed, along with entries mentioning it in body text
#### Scenario: No results found
- **WHEN** user types a keyword that matches no entry
- **THEN** the system SHALL display a "没有找到相关条目" (no results) message
#### Scenario: Clearing search restores all entries
- **WHEN** user clears the search input
- **THEN** all entries are displayed again in their original order (date descending)
#### Scenario: Search is case-insensitive
- **WHEN** user types "CLAUDE" or "claude" or "Claude"
- **THEN** the system SHALL return the same results regardless of case
### Requirement: Highlight matched text
The system SHALL visually highlight the portion of text that matched the search query in each displayed result.
#### Scenario: Single word match
- **WHEN** user searches for "skill" and an entry title is "Matt Pocock Skills"
- **THEN** the word "Skills" in the title is visually highlighted
#### Scenario: Multi-word query
- **WHEN** user searches for "ai agent" (two words)
- **THEN** entries containing both words are prioritized and matched text is highlighted