Skip to content

fix: check reports linked skills as unmanaged, and .team/ never ignored itself - #132

Merged
sametcelikbicak merged 4 commits into
sametcelikbicak:mainfrom
abdullahtas0:fix/check-skill-links-and-team-gitignore
Nov 12, 2026
Merged

sametcelikbicak merged 4 commits into
sametcelikbicak:mainfrom
abdullahtas0:fix/check-skill-links-and-team-gitignore

Conversation

@abdullahtas0

@abdullahtas0 abdullahtas0 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Four focused commits:

  1. fix: check reports linked skills as unmanaged — one-line fix in bin/opencode-team plus a regression test.
  2. fix: make .team/ ignore itself instead of claiming it is gitignored — the first /team run (and /memory init) now writes .team/.gitignore; docs describe that mechanism.
  3. docs: correct the model claims and the agent frontmatter example — README/docs/usage.md no longer claim the defaults are free-tier Zen models, and the example frontmatter no longer shows name:, which OpenCode 2 ignores and scripts/validate.rb rejects.
  4. fix: cover direct agent calls and keep bytecode out of the package — review follow-up: the workspace rule in team/AGENTS.md, idempotent creation in run_state.py, a re-verified memory report, and packaging hygiene after a stray __pycache__ slipped in.

Why

1. opencode-team check calls every installed skill "not managed".

The skill loop passed the already-resolved symlink target to targetInRepo, but that helper expects the link path and calls readlinkSync on its argument. Reading a directory link target fails, the catch returns false, and check warns for all 14 skills while the installer has just linked them:

$ node bin/opencode-team install --config-dir /tmp/t
$ node bin/opencode-team check   --config-dir /tmp/t
  ○ skills/team-build → not managed: /.../opencode-team/skills/team-build

The agents/commands loop right above already passes configPath, so this was a copy/paste slip. install.sh --check is unaffected. The existing test only asserted agents → and team.yaml →, which is why it slipped through; the new test fails on the old code and passes on the new one.

2. .team/ is documented as gitignored but never was.

docs/faq.md, docs/memory.md, docs/runs.md, team/AGENTS.md and the orchestrator all said .team/ is gitignored. Nothing created an ignore rule: the repository's own .gitignore only covers this repo, and the installer cannot know which project a later /team run happens in. In a user project, .team/01-research.md and .team/runs/ showed up in git status and were one git add . away from being committed.

Making .team/ ignore itself is the only option that needs no project-side edit and no tracked file:

# OpenCode Team workspace: local only.
*

The orchestrator's first-run lifecycle creates it (preserved when present), /memory init does the same, run_state.py start-run/start-task create it idempotently, team/AGENTS.md carries it as a general rule for every agent including direct @role calls, and the docs describe the mechanism instead of asserting a guarantee that did not exist.

3. Model docs contradicted the manifests and each other.

README said "Models are free-tier OpenCode Zen models" and "the defaults use free-tier models", while no agent pins a model: and each one inherits the session's model — which docs/faq.md already documents correctly. The same section showed name: marketing in an agent frontmatter; OpenCode 2 derives the id from the filename, and the validator explicitly rejects name: in agents/. Both are now accurate, and the example validates.

Also dropped a reference to docs/rfcs/0001-project-memory.md, which no longer exists.

Checklist

  • ruby scripts/validate.rb passes
  • macOS/Linux: bash -n install.sh scripts/*.sh and ./scripts/smoke-install.sh pass
  • Windows: covered by CI (windows-latest, both shells); no PowerShell file changed
  • New frontmatter description values are quoted when they contain : — no new frontmatter descriptions
  • team.yaml references resolve (agent, skill, profile stage ids)
  • README updated if a command, flag, agent or stage changed — README and docs/install.md requirements section updated
  • No secrets or machine-specific paths

Verification (local, OpenCode 2.2.7, Node 22.18)

ruby scripts/validate.rb                              # validate: 48 files OK
python3 scripts/test-run-state.py                     # run-state: OK
bash -n install.sh scripts/*.sh skills/team-memory/*.sh  # OK
shellcheck --severity=error install.sh scripts/*.sh skills/team-memory/*.sh  # OK
./scripts/smoke-install.sh                            # OK
./scripts/test-memory-compact.sh                      # OK
npm test                                              # 23 tests, 23 pass, 0 fail
npm run generate:reference && git diff --exit-code -- docs/reference  # clean
npm run docs:build                                    # build complete
npm pack --dry-run                                    # 64 files, no bytecode

The new CLI test was checked against the old code: not ok 1 - check reports installed skills as managed symlinks.

Runtime confirmation that the 14 agents still load in OpenCode 2.x, with the installed config dir:

$ opencode debug agents --standalone
['analyst', 'architect', 'be', 'brand', 'build', ..., 'orchestrator', 'plan', 'pm', 'po', 'qa', 'security', ..., 'ux']

Related issue

No open issue covers these; found while reviewing the v2.0.0 tree.

The skill loop in `check` passed the already-resolved symlink target to
`targetInRepo`, which expects the link path and calls `readlinkSync` on its
argument. Resolving a directory failed, so every installed `skills/team-*`
link was reported as "not managed" and `opencode-team check` disagreed with
the installer.

Pass the link path instead, matching the agents/commands loop, and add a
regression test that fails on the old behaviour.
The docs, the orchestrator and the memory skill all stated that .team/ is
gitignored, but nothing ever created an ignore rule: the repository's own
.gitignore only covers this repo, and the installer cannot know which project
a later /team run happens in. In a user project, artifacts, memory and run
checkpoints showed up in git status and could be committed by accident.

The first /team run (/memory init does the same) now writes .team/.gitignore
with a comment and a single `*` line. The workspace ignores itself, including
that file, so no tracked file changes and the project's own .gitignore stays
untouched. Docs now describe that mechanism, and the stale reference to the
removed docs/rfcs/0001-project-memory.md is dropped.
README and docs/usage.md said agents use free-tier OpenCode Zen models and
that the defaults are free-tier, while no agent pins a `model:` and each one
inherits the session's model. They also showed a `name:` field in an agent
frontmatter, which OpenCode 2 ignores because the filename supplies the id —
scripts/validate.rb rejects it for exactly that reason. Describe the actual
behaviour, keep the free-tier models as reported test picks, and show a
frontmatter that validates.
@sametcelikbicak

Copy link
Copy Markdown
Owner

Thanks for this PR — nice, focused work, and the root-cause analysis is spot on.

I reviewed it locally and verified the following:

  • npm test, ruby scripts/validate.rb, bash -n, smoke-install.sh, test-memory-compact.sh, test-run-state.py, generate:reference and docs:build all pass (23/23 tests, 48 files OK).
  • The new regression test does fail on the old one-line code and passes with the fix.
  • The .team/.gitignore with a single * behaves as documented: git check-ignore matches both .team/.gitignore itself and artifacts, and git add . adds nothing.

There are two things I'd like to see addressed before merging:

1. docs/testing/memory.md is now stale and contradicts the new docs

This page is published in the docs nav as "Memory Verification". Scenario 8 still uses the project's own .gitignore as evidence:

git check-ignore -v .team/memory/INDEX.md → .gitignore:6:.team/

That directly contradicts the new claim that the project's .gitignore is never touched. Scenario 1 should also mention that a fresh /team run creates .team/.gitignore, and the 47 files OK count is now 48 anyway.

Could you update the scenario 1 and 8 evidence (or add a short note that the report predates this mechanism) so the published docs are consistent?

2. Direct agent invocations can still write .team/ without the ignore file

The creation of .team/.gitignore is currently only described in the orchestrator's "First /team run", /memory init, and this line in team/AGENTS.md:

The first /team run creates .team/.gitignore …

However, @analyst, @fe, etc. are documented as usable directly, and they write .team/01-research.md and memory logs without ever running /team first. In that case the workspace is still exposed to git status, which is the exact problem this PR is trying to fix.

Since team/AGENTS.md is loaded for every agent through the instructions config, a general rule there would cover it, for example:

Before writing any file under .team/, create .team/.gitignore if it is missing.

(Alternatively, making run_state.py create it idempotently would remove the dependency on the model following the instruction.)

Minor notes (non-blocking)

  • Phrases like "artifacts ... never reach a commit" and "cannot be committed" are a bit absolute. Ignore rules do not affect already-tracked files, git add -f bypasses them, and a custom artifact_dir/memory_dir outside .team/ is not covered. Something like "new .team/ files are not picked up by normal git commands" would be more accurate.
  • Since memory_dir and artifact_dir are configurable, it may be worth a one-line caveat in docs/faq.md / docs/customization.md that a custom directory outside .team/ needs its own ignore rule.
  • No changelog entry is needed if you add it at release time — just mentioning it in case that is expected.

Overall this is in good shape; the CLI fix is clearly correct and the .gitignore approach works. Once the two items above are handled I'm happy to merge. Thanks again!

abdullahtas0 added a commit to abdullahtas0/opencode-team that referenced this pull request Nov 12, 2026
Review follow-up on sametcelikbicak#132.

- team/AGENTS.md now carries a general workspace rule: create
  .team/.gitignore before writing anything under .team/. Every agent loads
  that file through the instructions config, so a direct @analyst or @fe
  invocation is covered without /team ever running.
- run_state.py creates the same file idempotently in start-run and
  start-task, so the checkpoint-driven path does not depend on the model
  following an instruction. An existing file is never rewritten.
- scripts/test-run-state.py asserts creation and preservation.
- docs/testing/memory.md re-verifies scenario 8 against .team/.gitignore
  instead of the project's own .gitignore, notes the change for scenario 1,
  corrects the file count to 48 and records the remaining gap for bare agent
  calls.
- Absolute claims ('never reach a commit', 'cannot be committed') become what
  ignore rules actually do: new files are not picked up by normal git
  commands. Already-tracked files, git add -f and a custom artifact_dir or
  memory_dir outside .team/ are called out in docs/faq.md,
  docs/customization.md and docs/output.md.
@abdullahtas0

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review — both points were real, and the second one was a genuine hole in my reasoning. Pushed a1ea748 covering them.

1. docs/testing/memory.md is no longer stale

  • Scenario 8 is re-verified against the new mechanism, not the project's own .gitignore:
    .team/.gitignore:4:* .team/memory/INDEX.md — exit 0. I re-ran it in a scratch git init project after run_state.py start-run, and also checked git check-ignore -v .team/.gitignore (matches) and git add . (stages main.txt only).
  • Summary now says explicitly that scenario 8 changed meaning in this PR and that the original run relied on a .gitignore the team never wrote.
  • Scenario 1 notes that the same run also writes .team/.gitignore, with the honest caveat that the creation is covered by scripts/test-run-state.py rather than a new live /team run — I did not want to write "pass" for something I did not execute end to end.
  • File count corrected to 48. Test Project Setup shows the exact commands and output.

I left docs/testing/runs.md and docs/testing/windows.md at 47 on purpose: those are dated reports of separate runs, and rewriting their recorded evidence would make them lie about when they ran. Say the word if you'd rather have all three consistent.

2. Direct agent invocations are covered

I went with both halves of your suggestion, because neither alone is sufficient:

  • team/AGENTS.md now has a ## Workspace section as a general rule, since that file is loaded for every agent through instructions:

    Before writing any file under .team/, create .team/.gitignore if it is missing. … An existing file belongs to the user: never rewrite it.

  • run_state.py creates it idempotently in start-run and start-task (ensure_team_gitignore()), so the checkpoint-driven path does not depend on the model obeying an instruction. Write failures are swallowed on purpose: an unwritable workspace must not block a checkpoint. An existing file is never rewritten.

scripts/test-run-state.py asserts creation, the trailing *, and that a user-edited file survives start-task.

The honest remaining gap is recorded in the report's Risks: a bare @analyst call still has no deterministic hook, so it depends on the agent following the AGENTS.md rule. Closing that fully would need something in the tool/edit path, which is outside this PR's scope.

Minor notes

  • Absolute wording removed. "never reach a commit" / "cannot be committed" are gone. docs/memory.md, docs/output.md and the skill now say new workspace files are not picked up by normal git commands, and name the exceptions: already-tracked files, git add -f, and a custom artifact_dir/memory_dir outside .team/.
  • Custom directory caveat added to docs/faq.md and docs/customization.md, plus a ## Workspace bullet in team/AGENTS.md.
  • No changelog entry, per your note.

Verification

ruby scripts/validate.rb                              # validate: 48 files OK
python3 scripts/test-run-state.py                     # run-state: OK (+3 new assertions)
npm test                                              # 23 tests, 23 pass, 0 fail
bash -n ... && shellcheck --severity=error ...         # OK
./scripts/smoke-install.sh                            # OK
./scripts/test-memory-compact.sh                      # OK
npm run generate:reference && git diff --exit-code -- docs/reference   # clean
npm run docs:build                                    # build complete
python3 -m py_compile skills/team-memory/run_state.py # OK

CI is still green on the previous head; the new commit should re-run it once approved.

@sametcelikbicak

Copy link
Copy Markdown
Owner

Thanks — a1ea748 resolves both review points. I re-checked the new behavior locally:

  • Fresh git init project + run_state.py start-run creates .team/.gitignore, git check-ignore matches it, and git status stays clean.
  • The new test-run-state.py assertions pass (creation, trailing *, user edit preserved).
  • npm test 23/23, validate 48 files OK, smoke/memory checks OK, docs build OK.
  • CI is green on a1ea748 (11/11).

One cleanup before merge, plus a few tiny notes.

Please remove the committed bytecode file

a1ea748 accidentally adds:

skills/team-memory/__pycache__/run_state.cpython-314.pyc

It is not in main, and it ships in the npm package: npm pack --dry-run includes it because files lists skills/ while .npmignore only excludes the test file. It is Python 3.14-specific generated output and does not belong in the repo or the package.

Please remove it:

git rm -r --cached skills/team-memory/__pycache__
rm -rf skills/team-memory/__pycache__

and ignore it in both .gitignore and .npmignore:

__pycache__/
*.py[cod]

Optionally, add a small assertion to the npm pack CI job so the tarball cannot contain __pycache__ or .pyc again — the current pack test passes while the file is included.

Minor notes (non-blocking — fix if easy)

  • The PR body still says "Three focused commits"; there are four now. Update it, or just keep it in mind for the squash.
  • Docs say .team/.gitignore holds "a comment and a single * line", but TEAM_GITIGNORE is a three-line comment block plus *. "a short comment block" would match.
  • docs/runs.md and docs/testing/memory.md mention start-run as the creator; start-task creates it too. Adding "or start-task" keeps it exact.
  • ensure_team_gitignore() always creates .team/.gitignore even when a custom artifact_dir is configured. Harmless, and the custom-directory caveat is documented, so no change needed unless you want to avoid creating .team in that case.

Once the bytecode file is gone and CI stays green, I'm happy to merge. And leaving docs/testing/runs.md and windows.md at 47 is the right call — those are dated records and should not be rewritten.

Review follow-up on sametcelikbicak#132.

Workspace ignore rule

- team/AGENTS.md gains a Workspace section: create .team/.gitignore before
  writing anything under .team/. Every agent loads that file through the
  instructions config, so a direct @analyst or @fe invocation is covered
  without /team ever running.
- run_state.py creates the same file idempotently in start-run and start-task,
  so the checkpoint-driven path does not depend on the model following an
  instruction. An existing file is never rewritten.
- scripts/test-run-state.py asserts creation, the trailing * and that a
  user-edited file survives start-task.

Docs

- docs/testing/memory.md re-verifies scenario 8 against .team/.gitignore
  instead of the project's own .gitignore, notes the change for scenario 1,
  corrects the file count to 48 and records the remaining gap for bare agent
  calls.
- Absolute claims ('never reach a commit', 'cannot be committed') become what
  ignore rules actually do: new files are not picked up by normal git
  commands. Already-tracked files, git add -f and a custom artifact_dir or
  memory_dir outside .team/ are called out in docs/faq.md,
  docs/customization.md and docs/output.md.
- Say "short comment block" rather than "a single * line", and name
  start-task alongside start-run as a creator of .team/.gitignore.

Packaging

- Ignore __pycache__/ and *.py[cod] in .gitignore. A stray py_compile run had
  committed and packaged skills/team-memory/__pycache__/run_state.cpython-314.pyc.
- Add skills/team-memory/.npmignore, the only form npm honours for paths that
  package.json "files" already allows.
- Fail the pack CI job when a tarball contains __pycache__ or .pyc; verified to
  catch the leak when the nested ignore file is absent.
@abdullahtas0
abdullahtas0 force-pushed the fix/check-skill-links-and-team-gitignore branch from a1ea748 to 4386c91 Compare November 12, 2026 12:35
@abdullahtas0

Copy link
Copy Markdown
Contributor Author

Good catch on the bytecode — that was my mistake. I ran python3 -m py_compile as a sanity check and forgot it writes next to the source. All fixed in 4386c91, which replaces a1ea748 + the removal commit; I squashed them so the .pyc never appears anywhere in the branch history, not just at the tip.

Bytecode

  • git rm --cached plus rm -rf on the working tree. git ls-files | grep -i pyc is empty, and git log --diff-filter=A -- '*pycache*' over the branch is empty too.
  • .gitignore gains __pycache__/ and *.py[cod].
  • .npmignore — worth flagging: the root .npmignore does not work here. I tested __pycache__/, **/__pycache__/, *.pyc, **/*.pyc and the full path against npm pack --dry-run; every one still shipped the file, because files already allows skills/ and npm will not subtract from an allowed path via the root ignore file. A nested skills/team-memory/.npmignore does work, so that is where the rule lives, with a comment saying why. Verified: npm pack --dry-run now reports 64 files with no bytecode, and the nested ignore file itself is not shipped.
  • CI backstop added to the pack-test job (Fail when the tarball ships bytecode). I checked both directions: with the nested .npmignore absent and a .pyc in place the step fails and prints the offending path; with it present the step passes. So it catches a regression even if someone deletes the nested file.

Minor notes

  • PR body updated to four commits, and the .team/.gitignore description no longer says "a single * line".
  • "a comment and a single * line" → "a short comment block and a single * line" in skills/team-memory/SKILL.md, team/AGENTS.md, agents/orchestrator.md and docs/output.md.
  • start-task is now named alongside start-run in docs/runs.md, docs/testing/memory.md, skills/team-memory/SKILL.md, docs/customization.md and docs/faq.md.
  • ensure_team_gitignore() still creates .team/ under a custom artifact_dir. I left it: the call has no cheap way to know the resolved team.yaml value at that point, and creating a two-file directory is harmless. The caveat stays documented.

Verification after the squash

ruby scripts/validate.rb                 # validate: 48 files OK
python3 scripts/test-run-state.py        # run-state: OK
npm test                                 # 23 tests, 23 pass, 0 fail
bash -n ... && shellcheck --severity=error ...   # OK
./scripts/smoke-install.sh               # OK
./scripts/test-memory-compact.sh         # OK
npm run generate:reference && git diff --exit-code -- docs/reference  # clean
npm run docs:build                       # build complete
npm pack --dry-run                       # 64 files, bytecode: []

The branch was force-pushed, so CI needs to run once more on 4386c91. Thanks for the close read — the packaging bug would have shipped.

@sametcelikbicak sametcelikbicak left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the thorough follow-up — the bytecode is gone from the tree and the history, the nested .npmignore plus CI backstop is a solid fix, and the docs are consistent now. CI is green on 4386c91, so I'm approving and merging this. Appreciate the careful work!

@sametcelikbicak
sametcelikbicak merged commit b6abdbf into sametcelikbicak:main Nov 12, 2026
11 checks passed
sametcelikbicak added a commit that referenced this pull request Nov 12, 2026
VitePress 1.6.4 pins vite ^5.4.14, and Vite 5 is end-of-life with 8 open advisories; its esbuild ^0.21.3 is also affected. Dependabot cannot produce a compatible fix, so override Vite to the patched 6.x line. The plugin-vue peer range already covers Vite 6.

Also finish the docs consistency left from #132 by naming start-task alongside start-run as a creator of .team/.gitignore, and document the override and its removal condition in CONTRIBUTING.
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