Skip to content

docs(stories): pin tasks install auto-detect algorithm in story 03#62

Merged
fyodoriv merged 1 commit into
mainfrom
docs/story-03-install-detect-table
May 3, 2026
Merged

docs(stories): pin tasks install auto-detect algorithm in story 03#62
fyodoriv merged 1 commit into
mainfrom
docs/story-03-install-detect-table

Conversation

@fyodoriv
Copy link
Copy Markdown
Collaborator

@fyodoriv fyodoriv commented May 3, 2026

Why this is needed

Closes `user-stories-install-detect-docs` (P2 hardening from PR #58).

Story 03's first "Install" section sold `tasks install` as "auto-detects agents" but never named which directories triggered which install, nor what happened when the agent dir was missing. The "Or copy manually:" table that followed was a workaround, not documentation of the actual algorithm — readers had to read `install.ts` to find out what `tasks install` would actually do in their repo.

Hardening the story means making the contract reader-verifiable.

Summary

Story 03 now has an Auto-detect algorithm section with a four-column table — Agent / Detection signal / Installed path / Source file — sourced directly from `AGENT_MAPPINGS` in `install.ts`:

Agent Detection Installed
Claude Code `.claude/` `.claude/skills/next-task/`
Codex `.agents/` `.agents/skills/next-task/`
Cursor `.cursor/` `.cursor/commands/next-task.md`
Devin `.devin/` `.devin/skills/next-task/`
Gemini CLI `.gemini/` `.gemini/commands/next-task.toml`
Windsurf `.windsurf/` `.windsurf/workflows/next-task.md`

Plus the fallback contract: when the detection signal is missing and `--all` was not passed, the agent is skipped silently and `tasks install` exits 0 even if zero agents matched. Use `--all` to scaffold every agent's directory regardless, or `--agent ` to target a single entry.

The `docs/user-stories/README.md` "How" column for story 3 now deep-links to the new section and names all 6 agents the algorithm covers.

Pin: regression guard

A new test in `install.test.ts` — `pins the AGENT_MAPPINGS install paths for all 6 agents` — asserts every destination path the doc table claims (`.claude/skills/next-task/SKILL.md`, `.agents/skills/next-task/SKILL.md`, `.cursor/commands/next-task.md`, `.devin/skills/next-task/SKILL.md`, `.gemini/commands/next-task.toml`, `.windsurf/workflows/next-task.md`). Changing a destination path in `install.ts` without updating the story (or vice versa) fails CI.

Test plan

  • `npm run build` — clean
  • `npm test` — 404 tests pass (+1 new)
  • `npm run lint` — 0 errors
  • `npx -y @tasks-md/lint TASKS.md` — 0 errors

🤖 Written by an agent, not Fyodor. Ping me if this looks off.

closes user-stories-install-detect-docs

Story 03's first line sold `tasks install` as "auto-detects agents"
but never named which directories triggered which install, nor what
happened when the dir was missing. The "Or copy manually:" table that
followed was a workaround, not documentation of the auto-detect
behavior.

Story 03 now has an "Auto-detect algorithm" section with a four-column
table (Agent / Detection signal / Installed path / Source file) sourced
directly from `AGENT_MAPPINGS` in
`packages/cli/src/commands/install.ts`:

| Agent       | Detection      | Installed                            |
|-------------|---------------|--------------------------------------|
| Claude Code | `.claude/`    | `.claude/skills/next-task/`          |
| Codex       | `.agents/`    | `.agents/skills/next-task/`          |
| Cursor      | `.cursor/`    | `.cursor/commands/next-task.md`      |
| Devin       | `.devin/`     | `.devin/skills/next-task/`           |
| Gemini CLI  | `.gemini/`    | `.gemini/commands/next-task.toml`    |
| Windsurf    | `.windsurf/`  | `.windsurf/workflows/next-task.md`   |

Plus the fallback contract: when the detection signal is missing and
`--all` was not passed, the agent is skipped silently and `tasks
install` exits 0 even if zero agents matched.

The `docs/user-stories/README.md` "How" column for story 3 now
deep-links to the new section and names all 6 agents the algorithm
covers.

A new test in `install.test.ts` (`pins the AGENT_MAPPINGS install
paths for all 6 agents`) asserts every destination path the doc
table claims, so changing a path in `install.ts` without updating
the story (or vice versa) fails CI.

Verified: npm run build, npm test (404 tests, +1 new), npm run lint,
npx -y @tasks-md/lint TASKS.md — all clean.

---
_🤖 Written by an agent, not Fyodor. Ping me if this looks off._
@fyodoriv fyodoriv merged commit d99c658 into main May 3, 2026
4 checks passed
@fyodoriv fyodoriv deleted the docs/story-03-install-detect-table branch May 3, 2026 16:45
fyodoriv added a commit that referenced this pull request May 3, 2026
…#68)

closes user-stories-crosslink-audit

After the recent additions (story 08, runnable demos, install table,
worked example) several stories reference each other. Audit walked
every Markdown link in docs/user-stories/, README.md, packages/cli/
README.md, packages/mcp/README.md, and the package READMEs and
verified each path + anchor against the live tree.

Findings:

  Working: every cross-story link in docs/user-stories/ + README.md
  resolves to an existing file and a real heading slug. The
  Auto-detect anchor cross-link added in PR #62 still works; the
  story 06/07 anchor links in user-stories/README.md still work.

  Broken paths fixed:
    packages/mcp/README.md:81  [MIT](../LICENSE)   -> ../../LICENSE
    packages/lint/README.md:102 [MIT](../LICENSE)  -> ../../LICENSE
    Both pointed at packages/LICENSE which doesn't exist;
    LICENSE lives at the repo root, two dirs up.

  Inverse / back-links added:
    Story 02 metadata table now links **ID** + **Blocked by** to
    Story 04 (the source of truth for blocker ordering) and **Tags**
    to Story 05 #tag-based-routing (the routing contract). The
    table footer points at Story 08 for the agent-managed fields
    (**Blocked**, **Research**, **Last-enriched**, **Parent**) and
    project-level policies — closing the loop that those fields
    are defined in detail elsewhere.

    Story 04 #2 ("Tag preference") was a plain-prose "see Story 05"
    sentence; now a Markdown hyperlink to Story 05 #tag-based-
    routing so a reader can jump to the routing contract directly.

Verified by a Python anchor-checker that walks every Markdown
link in the audited files and asserts:
  - the path component resolves to an existing file
  - the anchor matches a heading slug or {#explicit-anchor} in
    the target

Output: "All cross-links resolve cleanly!" on the post-fix tree.

Verified: npm run lint, npx -y @tasks-md/lint TASKS.md — 0 errors.

---
_🤖 Written by an agent, not Fyodor. Ping me if this looks off._
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.

1 participant